You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add constitution violation check command and after_implement hook
Adds /speckit.optimize.check for on-demand compliance auditing of feature
artifacts against constitution principles. Fills the gap between spec-kit's
built-in gates at /speckit.plan and /speckit.analyze where manual edits can
silently break constitution rules.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
On-demand compliance audit: checks the current feature's spec, plan, tasks, and optionally implementation code against every principle in the constitution. Catches violations introduced by manual edits between the built-in `/speckit.plan` and `/speckit.analyze` gates.
|`--feature <name>`| Target a specific feature instead of auto-detecting | Active feature |
90
+
|`--include-code`| Also scan implementation source files referenced in tasks | Disabled |
91
+
|`--severity <level>`| Filter to CRITICAL, HIGH, or ALL | ALL |
92
+
93
+
**How it works:**
94
+
1. Parses the constitution into individual principles using RFC 2119 keywords (MUST, SHOULD, etc.)
95
+
2. Loads the feature's spec.md, plan.md, and tasks.md
96
+
3. Evaluates each principle for contradictions, omissions, structural violations, and semantic drift
97
+
4. Reports violations with severity (CRITICAL for MUST, HIGH for SHOULD, MEDIUM for ambiguous)
98
+
5. Provides evidence and location for every finding
99
+
100
+
**Hook:** After `/speckit.implement` completes, you are prompted to run this check automatically. This catches violations at the earliest useful moment — after code is written but before you commit.
101
+
69
102
### `/speckit.optimize.learn` — Session Learning
70
103
71
104
End-of-session analysis: detects AI mistake patterns, repetitive corrections, and governance gaps. Suggests constitution rules or memory entries to prevent recurrence.
0 commit comments