|
| 1 | +# SPDX-License-Identifier: MIT |
| 2 | +"""Specsmith self-referential skills — how to USE specsmith in any project. |
| 3 | +
|
| 4 | +These skills teach AI agents (Warp, Claude Code, Codex, Cursor, etc.) the |
| 5 | +core specsmith governance workflows. Install in any project via: |
| 6 | +
|
| 7 | + specsmith skill install specsmith |
| 8 | + specsmith skill install specsmith-save |
| 9 | + specsmith skill install specsmith-audit |
| 10 | +""" |
| 11 | + |
| 12 | +from specsmith.skills import SkillDomain, SkillEntry |
| 13 | + |
| 14 | +SKILLS: list[SkillEntry] = [ |
| 15 | + SkillEntry( |
| 16 | + slug="specsmith", |
| 17 | + name="Specsmith \u2014 AEE governance CLI reference", |
| 18 | + description=( |
| 19 | + "Master reference for the specsmith AEE governance tool: key concepts, " |
| 20 | + "common commands, session workflow, phase advancement, and audit codes. " |
| 21 | + "Use whenever working in a specsmith-governed project." |
| 22 | + ), |
| 23 | + domain=SkillDomain.GOVERNANCE, |
| 24 | + tags=[ |
| 25 | + "specsmith", "aee", "governance", "session", "workflow", |
| 26 | + "audit", "phase", "save", "esdb", "ledger", |
| 27 | + ], |
| 28 | + prerequisites=["specsmith"], |
| 29 | + body="""\ |
| 30 | +# Specsmith \u2014 Project Governance Tool |
| 31 | +
|
| 32 | +Specsmith is the AEE (Agile Epistemic Engineering) governance CLI. It manages |
| 33 | +requirements, phases, audit trails, and session state. It wraps git with |
| 34 | +governance-aware commits and backs up the epistemic state DB (ESDB). |
| 35 | +
|
| 36 | +## Key concepts |
| 37 | +
|
| 38 | +- **ESDB** \u2014 Epistemic State Database. Tracks certainty, audit state, session memory. |
| 39 | + Backed up on `specsmith save`. |
| 40 | +- **Phases** \u2014 AEE lifecycle: Inception \u2192 Elaboration \u2192 Construction \u2192 |
| 41 | + Transition \u2192 Validation \u2192 Hardening \u2192 Release. |
| 42 | +- **Ledger** \u2014 Running log of changes in `LEDGER.md`. Auto-updated by commits. |
| 43 | +- **Audit** \u2014 Checks requirements vs tests vs architecture for drift. |
| 44 | + Required before phase advance. |
| 45 | +- **Save** \u2014 ESDB backup + governance-aware git commit + push. |
| 46 | +
|
| 47 | +## Session workflow |
| 48 | +
|
| 49 | +``` |
| 50 | +1. specsmith audit # check for drift before working |
| 51 | +2. <make code changes> |
| 52 | +3. specsmith save # commit + push + ESDB backup |
| 53 | +``` |
| 54 | +
|
| 55 | +## Common commands |
| 56 | +
|
| 57 | +| Command | What it does | |
| 58 | +|---------|-------------| |
| 59 | +| `specsmith save` | ESDB backup \u2192 commit (if needed) \u2192 push | |
| 60 | +| `specsmith audit` | Drift/health check \u2014 requirements vs tests vs arch | |
| 61 | +| `specsmith audit --suppress <CODE>` | Accept a known false positive | |
| 62 | +| `specsmith phase` | Show current AEE phase | |
| 63 | +| `specsmith phase advance` | Advance to next phase (requires clean audit) | |
| 64 | +| `specsmith commit` | Governance-aware commit (wraps git commit) | |
| 65 | +| `specsmith ledger` | Show/manage the change ledger | |
| 66 | +| `specsmith compress` | Compress old ledger entries | |
| 67 | +| `specsmith req` | Manage requirements | |
| 68 | +| `specsmith test` | Manage test cases | |
| 69 | +| `specsmith status` | VCS/CI/PR status | |
| 70 | +| `specsmith skill list` | List built-in installable skills | |
| 71 | +| `specsmith skill install <slug>` | Install a skill into `.agents/skills/` | |
| 72 | +
|
| 73 | +## Commit conventions |
| 74 | +
|
| 75 | +Specsmith commits follow: `type: message` where type is one of: |
| 76 | +`feat`, `fix`, `refactor`, `test`, `docs`, `chore`, `perf` |
| 77 | +
|
| 78 | +Always append `Co-Authored-By: Oz <oz-agent@warp.dev>` when committing as an AI agent. |
| 79 | +
|
| 80 | +## Important rules |
| 81 | +
|
| 82 | +- **Never use `git commit` directly** \u2014 use `specsmith save` or `specsmith commit`. |
| 83 | +- **Run `specsmith audit` before advancing a phase** \u2014 drift will cause failure. |
| 84 | +- **Suppressed audit findings** are stored permanently; only suppress genuine false positives. |
| 85 | +- After `specsmith save` outputs `\u2713 push: Everything up-to-date`, the repo is clean. |
| 86 | +
|
| 87 | +## Audit result codes |
| 88 | +
|
| 89 | +- `PASS` \u2014 requirement/test/arch is consistent |
| 90 | +- `WARN` \u2014 drift detected, investigate |
| 91 | +- `SKIP` / suppressed \u2014 accepted false positive |
| 92 | +- IDs like `R20`, `R21` \u2014 requirement IDs in ARCHITECTURE.md |
| 93 | +
|
| 94 | +## Phase advancement |
| 95 | +
|
| 96 | +```bash |
| 97 | +specsmith audit # must be all-pass (or suppressed) |
| 98 | +specsmith phase advance # bumps phase, writes ledger entry |
| 99 | +specsmith save # commit the phase bump |
| 100 | +``` |
| 101 | +
|
| 102 | +## Installing skills in any project |
| 103 | +
|
| 104 | +```bash |
| 105 | +specsmith skill install specsmith # this reference card |
| 106 | +specsmith skill install specsmith-save # save workflow |
| 107 | +specsmith skill install specsmith-audit # audit workflow |
| 108 | +``` |
| 109 | +""", |
| 110 | + ), |
| 111 | + SkillEntry( |
| 112 | + slug="specsmith-save", |
| 113 | + name="Specsmith Save \u2014 commit and push with governance state backup", |
| 114 | + description=( |
| 115 | + "How and when to run `specsmith save`: backs up the ESDB, commits any " |
| 116 | + "staged/unstaged changes, and pushes to the remote. Use at the end of " |
| 117 | + "any work session or after completing a feature/fix." |
| 118 | + ), |
| 119 | + domain=SkillDomain.GOVERNANCE, |
| 120 | + tags=[ |
| 121 | + "specsmith", "save", "commit", "push", "esdb", "governance", "session", |
| 122 | + ], |
| 123 | + prerequisites=["specsmith"], |
| 124 | + body="""\ |
| 125 | +# Specsmith Save |
| 126 | +
|
| 127 | +Saves governance state: backs up the ESDB, commits any staged/unstaged changes, |
| 128 | +and pushes to the remote. |
| 129 | +
|
| 130 | +## When to use |
| 131 | +
|
| 132 | +- At the end of any work session |
| 133 | +- After implementing a feature, fix, or refactor |
| 134 | +- After advancing a phase |
| 135 | +- Whenever the user says \"save\", \"commit and push\", or \"specsmith save\" |
| 136 | +
|
| 137 | +## How to run |
| 138 | +
|
| 139 | +```bash |
| 140 | +specsmith save |
| 141 | +``` |
| 142 | +
|
| 143 | +## What it does (in order) |
| 144 | +
|
| 145 | +1. **ESDB backup** \u2014 snapshots the epistemic state database |
| 146 | +2. **Commit** \u2014 stages all changes and commits (or reports \"Nothing to commit\") |
| 147 | +3. **Push** \u2014 pushes the branch to origin (or reports \"Everything up-to-date\") |
| 148 | +
|
| 149 | +## Expected successful output |
| 150 | +
|
| 151 | +``` |
| 152 | + \u2713 esdb_backup: JSON fallback (no WAL to backup) |
| 153 | + \u2713 commit: Nothing to commit \u2190 or a commit hash |
| 154 | + \u2713 push: Everything up-to-date \u2190 or \"pushed to origin/branch\" |
| 155 | +``` |
| 156 | +
|
| 157 | +## If there are changes to commit |
| 158 | +
|
| 159 | +Specsmith auto-stages and commits. You can also pre-stage manually: |
| 160 | +
|
| 161 | +```bash |
| 162 | +git add -A |
| 163 | +git commit -m \"feat: description |
| 164 | +
|
| 165 | +Co-Authored-By: Oz <oz-agent@warp.dev>\" |
| 166 | +specsmith save # will see nothing to commit, just pushes |
| 167 | +``` |
| 168 | +
|
| 169 | +## Do NOT use `git push` directly |
| 170 | +
|
| 171 | +Always use `specsmith save` \u2014 it ensures the ESDB backup runs before the push, |
| 172 | +keeping governance state consistent with the remote. |
| 173 | +""", |
| 174 | + ), |
| 175 | + SkillEntry( |
| 176 | + slug="specsmith-audit", |
| 177 | + name="Specsmith Audit \u2014 governance drift check", |
| 178 | + description=( |
| 179 | + "How to run `specsmith audit` to check for governance drift between " |
| 180 | + "requirements, tests, and architecture. Required before advancing an AEE phase." |
| 181 | + ), |
| 182 | + domain=SkillDomain.GOVERNANCE, |
| 183 | + tags=[ |
| 184 | + "specsmith", "audit", "drift", "requirements", "governance", |
| 185 | + "aee", "phase", "verification", |
| 186 | + ], |
| 187 | + prerequisites=["specsmith"], |
| 188 | + body="""\ |
| 189 | +# Specsmith Audit |
| 190 | +
|
| 191 | +Checks the project for drift between requirements (ARCHITECTURE.md), test cases, |
| 192 | +and the codebase. Must pass before advancing an AEE phase. |
| 193 | +
|
| 194 | +## How to run |
| 195 | +
|
| 196 | +```bash |
| 197 | +specsmith audit |
| 198 | +``` |
| 199 | +
|
| 200 | +## Interpreting results |
| 201 | +
|
| 202 | +``` |
| 203 | +29 PASS \u2190 all requirements have matching tests and implementation |
| 204 | + 2 WARN \u2190 drift detected \u2014 investigate these |
| 205 | + 0 FAIL |
| 206 | +``` |
| 207 | +
|
| 208 | +**All items must be PASS or suppressed before `specsmith phase advance`.** |
| 209 | +
|
| 210 | +## When a WARN appears |
| 211 | +
|
| 212 | +1. Read the warning \u2014 it references a requirement ID (e.g. `R20`) and describes what's missing |
| 213 | +2. Fix it: add the missing test, update ARCHITECTURE.md, or implement the requirement |
| 214 | +3. Re-run `specsmith audit` to confirm it passes |
| 215 | +4. If it's a confirmed false positive: `specsmith audit --suppress <CODE>` |
| 216 | +
|
| 217 | +## Suppressing a false positive |
| 218 | +
|
| 219 | +Only suppress if you've verified the requirement IS met but the audit can't detect it: |
| 220 | +
|
| 221 | +```bash |
| 222 | +specsmith audit --suppress SEAL-XXXX-001 |
| 223 | +``` |
| 224 | +
|
| 225 | +Suppressions are permanent \u2014 use sparingly. |
| 226 | +
|
| 227 | +## Common causes of WARN |
| 228 | +
|
| 229 | +- Requirement in ARCHITECTURE.md has no corresponding test case |
| 230 | +- Test exists but requirement ID reference is missing from the test |
| 231 | +- Implementation exists but the architecture doc wasn't updated to match |
| 232 | +
|
| 233 | +## After fixing all warnings |
| 234 | +
|
| 235 | +```bash |
| 236 | +specsmith audit # confirm all pass |
| 237 | +specsmith phase advance # advance the phase |
| 238 | +specsmith save # commit the phase bump |
| 239 | +``` |
| 240 | +
|
| 241 | +## Quick audit before a session |
| 242 | +
|
| 243 | +Run `specsmith audit` at the start of a session to catch drift from the previous |
| 244 | +session before making new changes. |
| 245 | +""", |
| 246 | + ), |
| 247 | +] |
0 commit comments