| name | validating-rules |
| description | Validates code, specifications, and tasks against project rules using Straion's semantic matching. Use when checking compliance, validating PRs, reviewing specs against rules, or when user asks "does this meet rules", "check compliance", "validate this".
|
Validating Rules
Process
- Receive description of what to validate (spec, task, or code)
- Run
straion find-rules:
--files with the key files supporting the change that should be validated
--tags with applicable scope tags (e.g. api,domain,testing,security)
--keywords with relevant technical keywords (e.g. auth,caching,logging)
- Run
straion find-rules --help for the full flag list and scope-tag whitelist
- Analyze compliance against each returned rule
- Report structured findings
Validation Levels
| Level | What | Check Against |
|---|
| Spec | PRDs, ADRs, RFCs | Architecture, security, design principles |
| Task | Implementation tasks | Technical rules, API contracts, testing |
| Code | Actual changes | Coding standards, security, performance |
Compliance Analysis
For each rule returned by the CLI:
- Read and understand what it mandates/prohibits
- Compare against the input
- Identify gaps or violations
- Assess severity (critical, important, minor)
Output Format
## Rules Validation Report
### Summary
[X rules checked, Y compliant, Z issues]
### Compliant ✅
- **RULE-123**: [Rule summary] — ✅ [What was done correctly]
### Partial Compliance ⚠️
- **RULE-456**: [Rule summary] — ⚠️ [What's missing]
- **Recommendation**: [Specific fix]
### Violations ❌
- **RULE-789**: [Rule summary] — ❌ [The violation]
- **Risk**: [Impact]
- **Fix**: [Concrete solution]
Severity Guidelines
- Critical: Block until fixed
- Important: Address before proceeding
- Minor: Note for consideration
Validation Loop
When violations are found:
- Report specific violations with concrete fixes
- User applies fixes
- Re-validate to confirm compliance
- Repeat until critical violations are resolved