Core Concepts
Rules are the core input Straion uses to keep your AI coding agents aligned with your engineering standards. They capture requirements from your existing documentation, markdown files, and repositories, and connect them to the agent’s implementation plan.
What are rules?
Section titled “What are rules?”A rule is a single, well‑formed requirement that expresses how your system must or your code should be written in a specific context. With Straion you can import rules from sources like architecture docs, security guidelines or repo-local .md files.
How does Straion use rules?
Section titled “How does Straion use rules?”-
It selects the relevant rules based on task context (team, project, tech stack, change type).
-
It matches those rules against the AI agent’s task or implementation plan before code is generated.
-
It highlights any plan steps that violate or ignore the rules, so developers can fix them early.
-
It validates generated code against rules.
Best Practices for writing rules
Section titled “Best Practices for writing rules”The following are some best practices for writing great rules. If you are using Straion’s rule import, your rules will automatically follow these best practices.
”Must” vs “Should”
Section titled “”Must” vs “Should””Consistent modality is critical for both humans and AI to interpret rules correctly.
Use must for rules that are clearly mandatory or enforced (for example, security controls, compliance constraints, org-wide architecture decisions).
Use should for rules that are recommended, preferred, or optional, where deviations are allowed with justification.
Sample Code for Rules
Section titled “Sample Code for Rules”Rules can include a code snippet that demonstrates how to implement or enforce the rule. Choose a snippet that directly illustrates the rule. This gives the AI a concrete pattern to follow rather than a generic template.
Quality Attributes
Section titled “Quality Attributes”Atomicity The rule describes exactly one action.
Good: “The API gateway must reject requests without an Authorization header.”
Bad: “The API gateway must reject unauthenticated requests and log all errors to Datadog.”
Completeness The rule includes a precise verb, object/parameters, and any important conditions or scope.
Clarity The rule uses active voice and precice verbs. Avoid vague verbs like “support”, “handle”, or “ensure”.
Good: “The webhook processor must retry failed deliveries up to 3 times with exponential backoff.”
Vague: “The webhook processor must handle failures.”
Good: “The upload service must accept files up to 500 MB and process them within 60 seconds.”
Vague: “The system should support large files.”
Validation Report
Section titled “Validation Report”A Validation Report is a structured review of how well a plan, spec, or code change complies with the rules Straion matched to that task. It connects each step or section of work to the rules it affects and shows whether those rules are satisfied, violated, or missing.
You typically see a Validation Report after Straion has analyzed:
- An implementation plan
- A software specification document
- A code change
Straion runs validation at key moments so you catch issues before they ship:
- Before coding: Validate an implementation plan against your rules so the AI adjusts the plan instead of generating non-compliant code.
- During design/spec: Validate a spec document to spot missing requirements early.
- Before merge: Validate the code (or diff) against rules to ensure the implementation still conforms.
Each run produces a fresh report, so you can see progress as the plan, spec, or code evolves.
Content of a Validation Report
Section titled “Content of a Validation Report”- List of all matched rules
- Status/Violation with description
- Suggested fixes as applicable
Develop and validate
Section titled “Develop and validate”Develop with Straion
Section titled “Develop with Straion”Guide AI-assisted development by injecting matched rules directly into implementation planning and code generation.
-
For a new feature or change, Straion selects relevant rules based on the task.
-
Those rules are attached to the implementation plan, so the AI agent “knows” how you want to build a solution.
-
When you ask the AI to generate code, it does so under those constraints, using rules and sample code as guidance rather than generic best practices.
Use this when you want AI to “do the right thing by default” and avoid rework later.
Validate with Straion
Section titled “Validate with Straion”Check existing work (AI-generated or manually written) against matching rules and get a structured validation report.
Straion analyzes artifacts you already have: Code changes, specs and implementation plans.
Straion matches rules and produces a validation report that shows which rules are passed, violated, or not covered.