Skip to content

Validate code

Code validation runs your rules against actual implementation: a pull request diff, a set of uncommitted changes, or AI-generated output. Straion checks whether the changed code satisfies the rules matched to those files and surfaces violations before merge.

Code validation is the last checkpoint before a change ships. It runs after implementation (whether by a human or AI) and before the change is merged. When used as part of Develop with rules, code is validated automatically as the final step. You can also trigger it manually on any PR or diff.

Validate a PR by number:

/validating-rules Check the changes in PR #42 against our rules

Validate current uncommitted changes:

/validating-rules Validate the code changes using Straion

Natural language alternatives:

Validate these changes against matching rules using Straion
Check the current diff against our Straion rules

How rules are matched to changed files and code

Section titled “How rules are matched to changed files and code”

Straion selects rules based on the files touched by the change — their paths, extensions, and content patterns. A change to an authentication module matches auth rules; a change to a data access layer matches data rules. Rules unrelated to the changed files are not included.

Code validation produces a Validation Report in the same format used for plan and spec validation. Matched rules list, rule status, and suggested fixes: Validate implementation plans.

  • Fix violations before merge — address each violated rule in the code before requesting review or merging
  • If a rule seems wrong, update it in Straion — if the violation indicates a rule is outdated or incorrectly specified, update the rule in Straion before re-validating
  • Re-validate after fixes — run validation again after fixing violations to confirm the changes now comply