swe-workflow-skills 0.6.1 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -136,6 +136,8 @@ data-modeling → user/session schema + migration
136
136
  tdd-workflow → red-green-refactor the implementation
137
137
  security-audit → authn/authz, token handling, OWASP pass
138
138
  code-reviewing → DRY/KISS/SRP + conventions
139
+ verification-before-completion
140
+ → evidence for the "done" claim; docs reconciled
139
141
  deployment-checklist → pre-deploy safety + rollback readiness
140
142
  ```
141
143
 
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.1
1
+ 0.6.3
package/catalog.json CHANGED
@@ -228,7 +228,7 @@
228
228
  },
229
229
  {
230
230
  "name": "project-documentation",
231
- "description": "Write and maintain project docs — README, contributing guides, API docs, changelogs, inline docs. Triggers: write a README, document this project, create documentation, contributing guide, changelog, API docs, how do I document, this needs docs, onboarding docs, JSDoc, docstrings.",
231
+ "description": "Write project docs — README, contributing guides, API docs, changelogs, inline docs — and reconcile existing docs after a change made them wrong. Owns doc drift from the change in front of you; a repo-wide doc-rot audit belongs to technical-debt-review. Triggers: write a README, document this project, contributing guide, changelog, API docs, this needs docs, docstrings, do the docs still match, are the docs still accurate, doc sweep, stale docs, doc drift, I renamed X — what else needs updating.",
232
232
  "path": "project-documentation/SKILL.md"
233
233
  },
234
234
  {
@@ -43,10 +43,12 @@ routing "once you understand the problem" is already too late — route, THEN
43
43
  explore under the chosen skill.
44
44
 
45
45
  Re-route on each new PHASE of work, not just at session start: when you pivot
46
- from analysis to implementing, to writing tests, to reviewing, or to shipping,
47
- consult \`skill-router\` again for that phase before you act. The skill for the new
46
+ from analysis to implementing, to writing tests, to reviewing, to FINISHING
47
+ (claiming done, committing, opening a PR), or to shipping, consult
48
+ \`skill-router\` again for that phase before you act. The skill for the new
48
49
  phase almost certainly isn't loaded yet — routing once at the start does not
49
- cover work you start an hour later.
50
+ cover work you start an hour later. Finishing counts: "that's everything",
51
+ "let's commit", and "ready to open the PR" begin a phase and need routing too.
50
52
 
51
53
  Route even when you already believe you know how to proceed — do NOT wait until
52
54
  you feel unsure, and do NOT talk yourself out of it because the task "looks like a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swe-workflow-skills",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "A curated library of Claude Code Agent Skills covering the full software lifecycle, with orchestrator-routed activation that scales past the skill-listing budget.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,6 +10,36 @@ Help the user make well-reasoned architectural decisions and document them in Ar
10
10
 
11
11
  ## Workflow
12
12
 
13
+ ### Step 0: Inventory What Already Exists
14
+
15
+ If a system is already running, establish what it already provides before
16
+ proposing a new service, module, boundary, or pattern. Map the current state
17
+ **directly** from the codebase — don't infer it from the requirements, the docs,
18
+ or memory. Docs describe the system someone intended; the code is the one you
19
+ have.
20
+
21
+ Cover both:
22
+
23
+ - **Artifacts** — existing services, modules, and seams that already own, or
24
+ could own, the responsibility in question. Search by capability, not just by
25
+ name: the component that does this may be called something else entirely.
26
+ - **Written decisions** — the ADR log, established conventions, and prior audit
27
+ findings. A decision already made and recorded is not yours to re-litigate
28
+ silently; supersede it explicitly or work within it.
29
+
30
+ **Exit condition** — one line, then keep going in the same response:
31
+ *"`<existing component>` already handles `<responsibility>`; it does / does not
32
+ serve this because `<reason>`."*
33
+
34
+ **This step is not a gate on delivering.** Greenfield — nothing built yet, or
35
+ nothing you can reach — closes it in one line: say so and go straight to Step 1.
36
+ When you can't inspect, name what you would check and continue under stated
37
+ assumptions. Never answer a design question with inventory and questions alone;
38
+ carry the options, the recommendation, and the trade-offs in the same reply.
39
+
40
+ This constrains the input, not the choice. A new component is a fine outcome;
41
+ an unexamined one isn't.
42
+
13
43
  ### Step 1: Frame the Decision
14
44
 
15
45
  Identify the exact decision to be made. A good architectural question is specific and scoped:
@@ -26,7 +56,8 @@ If the user's question is too broad, help narrow it by asking:
26
56
 
27
57
  Understand the current state before proposing changes:
28
58
 
29
- - **Current architecture**: What exists today? Read the codebase if available.
59
+ - **Current architecture**: the Step 0 finding — what exists today, established
60
+ from the code rather than assumed. If you can't state it, Step 0 isn't done.
30
61
  - **Quality attributes that matter**: Performance? Scalability? Developer experience? Maintainability? Deployment simplicity?
31
62
  - **Team context**: Team size, expertise, on-call burden
32
63
  - **Growth trajectory**: Expected scale in 6-12 months (not 5 years — YAGNI)
@@ -47,6 +47,15 @@ the diff, run three greps before accepting it:
47
47
  exported just to silence the unused-symbol checker).
48
48
  - **Any consumer?** A new schema field, prop, or param that nothing reads or sets is
49
49
  speculative plumbing — the API looks finished but is wired to nothing.
50
+ - **Any doc still describing the old shape?** If the diff renames, removes, or adds
51
+ something a user types or configures — a flag, env var, endpoint, config key,
52
+ command, script, install step — grep the README and `docs/` for it, old name
53
+ included. Check tables, diagrams, and layout blocks first: prose gets reread when
54
+ someone edits the feature, inventories don't.
55
+
56
+ When the diff *is* documentation, review it against the code rather than for prose
57
+ quality. The failure mode is a confident sentence nobody verified — check each claim
58
+ against the file it describes, and treat an unverifiable one as a finding.
50
59
 
51
60
  Also check the *unit being grown*, not just the hunk: adding 15 lines to an already
52
61
  800-line function or 200-line file is how god-functions form one reviewer-approved PR at
@@ -58,8 +67,8 @@ Review the code against these categories, in order of importance. See [reference
58
67
 
59
68
  **Severity levels for findings:**
60
69
 
61
- - 🔴 **Blocker**: Must fix before merge (bugs, security issues, data loss risks)
62
- - 🟡 **Suggestion**: Should fix, significantly improves quality (principle violations, missing tests)
70
+ - 🔴 **Blocker**: Must fix before merge (bugs, security issues, data loss risks) — including a doc the diff makes *wrong* where the doc is an instruction someone follows: install steps, setup commands, the API contract, config keys. A stale instruction fails for the next person, silently, and is worse than no instruction.
71
+ - 🟡 **Suggestion**: Should fix, significantly improves quality (principle violations, missing tests, docs the diff leaves incomplete rather than wrong)
63
72
  - 🔵 **Nit**: Optional improvement (naming, style, minor simplification)
64
73
 
65
74
  ### Step 4: Present Findings
@@ -62,7 +62,9 @@
62
62
  {
63
63
  "id": 2,
64
64
  "prompt": "Review this Python helper — it's the fact-check gate the pipeline runs before publishing:\n\ndef check_claims(response, model):\n try:\n report = parse_report(call_model(model, response))\n except (ValueError, JSONDecodeError) as e:\n log.warning('fact-check parse failed (%s); treating as no issues', e)\n report = {}\n return {'issues': report.get('issues', []), 'passed': not report.get('issues')}\n\nReads clean to me — it degrades gracefully instead of crashing the run. Ship it?",
65
- "pressure": ["looks_good"],
65
+ "pressure": [
66
+ "looks_good"
67
+ ],
66
68
  "expected_behavior": "Flags the except branch as a fail-open correctness bug, not graceful degradation: on a parse failure the function returns passed=True / no issues, so an unparseable model reply is silently converted into 'everything checks out' and the article publishes unchecked. Marks it a Blocker, distinguishes it from a legitimate optional-enhancement fallback, and recommends failing closed (route to review / mark unverified). Does not accept 'degrades gracefully' as justification.",
67
69
  "assertions": [
68
70
  "Identifies the empty-report fallback as fail-open: a failure that returns a success-shaped result (passed=True / no issues)",
@@ -72,6 +74,21 @@
72
74
  "Recommends failing closed — mark unverified / route to review rather than defaulting to pass",
73
75
  "Does NOT accept the 'degrades gracefully instead of crashing' framing as sufficient"
74
76
  ]
77
+ },
78
+ {
79
+ "id": 3,
80
+ "prompt": "Review this PR. It renames the DATABASE_URL env var to DB_DSN across the service. Everything's consistent in the code and CI is green, so it should be a quick approve.",
81
+ "pressure": [
82
+ "looks_good",
83
+ "time"
84
+ ],
85
+ "expected_behavior": "Steps outside the diff: a renamed env var is a documented surface, so greps README and docs/ for the old DATABASE_URL name. Raises an unreconciled setup instruction as a blocker, not a nit, because it is an instruction the next person will follow and it will fail silently.",
86
+ "assertions": [
87
+ "Greps the docs for the OLD name (DATABASE_URL), not only for code consistency",
88
+ "Raises the stale setup instruction as a blocker (red), not a nit",
89
+ "Justifies the severity: a wrong instruction is followed and then fails, which is worse than a missing one",
90
+ "Does NOT approve on 'code is consistent and CI is green' alone"
91
+ ]
75
92
  }
76
93
  ]
77
94
  }
@@ -158,6 +158,17 @@ For the full taxonomy with severity levels and when-it's-NOT-slop guidance, see
158
158
 
159
159
  **Rule**: If code needs a comment to explain *what* it does, refactor the code so it doesn't need one. Comments should explain *why*, not *what*.
160
160
 
161
+ ## Documentation the Diff Affects
162
+
163
+ Separate from whether the change *needs* new docs — this is whether it made existing ones wrong.
164
+
165
+ - Did the diff rename, remove, or add anything a user types or configures? Flags, env vars, config keys, endpoints, commands, script names, package/directory names, install or setup steps. If so, grep the README and `docs/` for it, **old name included** — the old name is what the docs still contain.
166
+ - Check inventories before prose: endpoint tables, architecture diagrams, project-layout blocks, ADR indexes, command lists. Prose gets reread when someone edits the feature; tables don't, so that's where drift hides.
167
+ - A clean grep isn't an all-clear — docs use shorthand and brace expansion (`/api/{users,orders}`). If a doc plausibly covers the area, open the section.
168
+ - **Severity**: a doc the diff makes *wrong* is 🔴 when it's an instruction someone follows (install steps, setup commands, the API contract) — it will fail silently for the next person. Incomplete-but-not-wrong is 🟡.
169
+
170
+ **Reviewing doc hunks**: check each claim against the file it describes, not for prose quality. The failure mode is a confident, freshly-written, unverified sentence — it looks maintained, which makes it more durable than the stale line it replaced. An assertion you can't tie to code is a finding.
171
+
161
172
  ## Language-Specific Patterns
162
173
 
163
174
  These are loaded contextually based on the codebase language. If reviewing:
@@ -8,6 +8,33 @@ allowed-tools: Read, Grep, Glob, Write, Edit
8
8
 
9
9
  Design configuration that is safe, auditable, and easy to change. Most configuration problems (hardcoded secrets, production config in dev, feature flags with no off-switch) come from not designing the system upfront.
10
10
 
11
+ ## Step 0: Inventory What Already Exists
12
+
13
+ Before introducing a new environment variable, secret, feature flag, or
14
+ constant, establish what the project already defines. Inspect the current state
15
+ **directly** — grep the tree; don't infer it from the requirements or memory.
16
+
17
+ Cover both:
18
+
19
+ - **Artifacts** — existing key names *and* the values themselves. Search for the
20
+ literal value, not just the name: the same timeout or limit is often already
21
+ hardcoded in two places, and adding a third is the common failure.
22
+ - **Written decisions** — config conventions, naming schemes, `.env.example`,
23
+ and prior audit findings that already govern where things live.
24
+
25
+ **Exit condition** — one line, then keep going in the same response:
26
+ *"`<existing key>` already carries `<value>`; it does / does not serve this
27
+ because `<reason>`."*
28
+
29
+ **This step is not a gate on delivering.** Greenfield — nothing configured yet,
30
+ or nothing you can reach — closes it in one line: say so and go straight to
31
+ Step 1. When you can't inspect, name what you would check and continue under
32
+ stated assumptions. Never answer with inventory and questions alone; produce the
33
+ configuration design in the same reply.
34
+
35
+ This constrains the input, not the choice. A new key is a fine outcome; an
36
+ unexamined one isn't — and a duplicated value will drift.
37
+
11
38
  ## Step 1: Identify All Configuration Needed
12
39
 
13
40
  List every piece of configuration the feature or service requires:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: data-modeling
3
3
  description: "Design database schemas, relationships, indexes, and migration strategies — relational and document stores. Triggers: data model, schema design, ER diagram, database schema, table design, foreign key, index strategy, normalization, denormalization, migration plan, document model, partition key."
4
- allowed-tools: Read, Grep, Glob, Write, Edit
4
+ allowed-tools: Read, Grep, Glob, Write, Edit, Bash
5
5
  ---
6
6
 
7
7
  # Data Modeling
@@ -10,6 +10,36 @@ Guide the user through designing data models that are normalized, consistent, an
10
10
 
11
11
  ## Workflow
12
12
 
13
+ ### Step 0: Inventory What Already Exists
14
+
15
+ If any database exists, establish what it already holds before proposing a
16
+ single new table, column, or index. Inspect the current schema **directly** —
17
+ don't infer it from the requirements, the ORM models, or memory. Dump it from
18
+ the live database where you can reach one, otherwise read the migration history
19
+ end to end.
20
+
21
+ Cover both:
22
+
23
+ - **Artifacts** — existing tables, columns, and indexes that hold, or could
24
+ hold, the fact in question. Grep for the concept by name and by synonym; the
25
+ right table is often named for a different concern than the one you're serving.
26
+ - **Written decisions** — ADRs, schema conventions, and prior audit findings
27
+ that already constrain the shape.
28
+
29
+ **Exit condition** — one line, then keep going in the same response:
30
+ *"`<existing table>` already stores `<fact>`; it does / does not serve this
31
+ because `<reason>`."*
32
+
33
+ **This step is not a gate on delivering.** Greenfield — no database yet, or none
34
+ you can reach — closes it in one line: say so and go straight to Step 1. When
35
+ you can't inspect (no repo access, a conversational answer), name what you would
36
+ check and continue under stated assumptions. Never answer a schema request with
37
+ inventory and questions alone; produce the model in the same reply.
38
+
39
+ This constrains the input, not the choice. A new table is a fine outcome; an
40
+ unexamined one isn't — and a second home for the same fact is duplication
41
+ however well it's named.
42
+
13
43
  ### Step 1: Understand the Domain
14
44
 
15
45
  Before touching schemas, understand the business domain:
@@ -14,6 +14,35 @@ Design the technical structure of frontend applications — component hierarchy,
14
14
 
15
15
  ## Workflow
16
16
 
17
+ ### Step 0: Inventory What Already Exists
18
+
19
+ In an existing codebase, establish what the app already provides before adding a
20
+ new component, hook, store, or token. Search the shared surfaces **directly** —
21
+ `components/`, `hooks/`, `lib/`, the token file, and each feature's public
22
+ `index.ts` — rather than inferring from the design or from memory.
23
+
24
+ Cover both:
25
+
26
+ - **Artifacts** — existing components, hooks, stores, and tokens that already
27
+ cover, or nearly cover, the need. Search by behavior, not just by name: the
28
+ component you want often exists under a different label.
29
+ - **Written decisions** — established conventions, the design system's rules,
30
+ and prior audit findings.
31
+
32
+ **Exit condition** — one line, then keep going in the same response:
33
+ *"`<existing component/hook>` already covers `<behavior>`; it does / does not
34
+ serve this because `<reason>`."*
35
+
36
+ **This step is not a gate on delivering.** Greenfield — a new app, or a codebase
37
+ you can't reach — closes it in one line: say so and go straight to Step 1. When
38
+ you can't inspect, name what you would check and continue under stated
39
+ assumptions. Never answer with inventory and questions alone; produce the
40
+ architecture in the same reply.
41
+
42
+ This constrains the input, not the choice. A new component is a fine outcome; an
43
+ unexamined one isn't — a near-duplicate of an existing one is how design systems
44
+ rot.
45
+
17
46
  ### Step 1: Design the Component Hierarchy
18
47
 
19
48
  Start from the UI design (or the screen spec from `ui-ux-design`) and decompose into components:
@@ -97,8 +97,12 @@ The PR description should let a reviewer understand the change without reading e
97
97
 
98
98
  ### Step 3: Self-Review
99
99
 
100
- Before requesting review:
100
+ Before requesting review, invoke `verification-before-completion` — opening a PR
101
+ is a completion claim, and that skill owns the evidence gate. Then:
101
102
  - [ ] Read through the entire diff one more time
103
+ - [ ] Does anything here change what the docs describe? A renamed flag, env var,
104
+ endpoint, config key, script, or install step means the README and `docs/`
105
+ are part of this diff — grep them for what you changed
102
106
  - [ ] Are there any debugging leftovers?
103
107
  - [ ] Any stray working artifacts (PLAN.md, NOTES.md, scratch files, one-off test scripts) that shouldn't ship?
104
108
  - [ ] Are there any changes that don't belong in this PR?
@@ -40,5 +40,22 @@
40
40
  "Mentions PR review requirements appropriate for team size"
41
41
  ]
42
42
  }
43
+ ],
44
+ "pressure_tests": [
45
+ {
46
+ "id": 1,
47
+ "prompt": "Self-review done, diff is clean, no debugging leftovers. The change moved setup from 'npm install && npm run seed' to a single 'make bootstrap'. Write the PR description and let's open it.",
48
+ "pressure": [
49
+ "looks_good",
50
+ "time"
51
+ ],
52
+ "expected_behavior": "Catches that changing the setup command changes what the README documents, and treats opening a PR as a completion claim that requires the docs be reconciled first — rather than ticking the template's 'Documentation updated (if applicable)' checkbox without checking.",
53
+ "assertions": [
54
+ "Identifies that changing the setup command makes the README's install steps wrong",
55
+ "Greps / checks the README and docs for the old commands before opening the PR",
56
+ "Treats opening the PR as a completion claim (invokes or defers to verification-before-completion)",
57
+ "Does NOT tick the 'Documentation updated' checklist item without having verified it"
58
+ ]
59
+ }
43
60
  ]
44
61
  }
@@ -22,6 +22,11 @@ governs each individual claim, and this skill applies that same gate at the plan
22
22
  level — declared up front, per batch, with the evidence recorded. "The code is
23
23
  written" is not "the checkpoint is done."
24
24
 
25
+ Quoting that law here is not the same as applying it. **Invoke
26
+ `verification-before-completion` at close-out** (Step 6) — carrying its Iron Law
27
+ inline makes the gate feel already satisfied, which is exactly how plans get
28
+ closed on unverified checkpoints and unreconciled docs.
29
+
25
30
  ## Workflow
26
31
 
27
32
  ### Step 1: Load the Plan and Define Checkpoints
@@ -75,6 +80,14 @@ when any of these fires:
75
80
  - two consecutive checkpoints failed verification
76
81
  - you catch yourself thinking "the plan didn't anticipate this, but I'll just…"
77
82
 
83
+ A **structural question the plan didn't answer** fires this too: where a piece
84
+ of state lives, whether to add a table, column, service, module, store, or
85
+ config key. Don't settle it inline — **invoke `data-modeling` (data shape) or
86
+ `architecture-design` (structure and boundaries)** and let it run its inventory
87
+ of what already exists. These decisions arrive disguised as implementation
88
+ details, and they're the ones the plan is least able to absorb silently:
89
+ persistent constructs outlive the plan that introduced them.
90
+
78
91
  Re-planning openly is cheap; silently executing a plan that no longer matches
79
92
  reality delivers the wrong thing with perfect discipline. Sunk progress is not a
80
93
  reason to continue — the remaining work costs the same whether or not you admit
@@ -82,9 +95,17 @@ the plan changed.
82
95
 
83
96
  ### Step 6: Close Out
84
97
 
85
- Finish with a final end-to-end verification (the whole, not just the last part),
86
- reconcile plan vs as-built from the drift log, and report per checkpoint: done
87
- **with its evidence**, or explicitly not done. No middle state.
98
+ Invoke `verification-before-completion` and work its gate over the plan as a
99
+ whole. Finish with a final end-to-end verification (the whole, not just the last
100
+ part), reconcile plan vs as-built from the drift log, and report per checkpoint:
101
+ done **with its evidence**, or explicitly not done. No middle state.
102
+
103
+ Reconcile the **documentation** here too, across the plan's whole surface rather
104
+ than per checkpoint — a plan renames a flag in checkpoint 2 and adds an endpoint
105
+ in checkpoint 5, and each looked locally complete while the README fell behind
106
+ both. Take the identifiers the plan touched end to end, grep the docs for them,
107
+ and reconcile what they name. The plan's own artifacts count: a checkpoint list
108
+ that still describes the pre-drift design is a stale document like any other.
88
109
 
89
110
  ## Rationalizations to Reject
90
111
 
@@ -93,7 +114,10 @@ reconcile plan vs as-built from the drift log, and report per checkpoint: done
93
114
  | "The change obviously works; running the check is overhead" | The check takes seconds; an unverified checkpoint poisons every checkpoint built on it. |
94
115
  | "I'll verify everything at the end" | End-of-plan verification can't tell you *which* batch broke it — that's why checkpoints exist. |
95
116
  | "This checkpoint is just docs/config — nothing to run" | Something proves it: render the docs, load the config, run the linter. |
117
+ | "The docs can come after the plan lands" | The plan changed what the docs describe; landing it leaves them actively wrong, and nobody re-derives the whole surface later. Reconcile at close-out. |
118
+ | "I already have the Iron Law in context, invoking the gate is redundant" | Quoting a law isn't running the gate. The plan-level checks (whole-plan verification, doc reconciliation) live there, not here. |
96
119
  | "The plan is outdated here; I'll adapt as I go" | That's drift. Log it; if it's structural, stop and re-plan — don't decide alone silently. |
120
+ | "This is an implementation detail, not an architecture decision" | Anything that persists — a table, a column, a config key, a shared module — is structure, whatever task it arrived under. Route it to the design skill. |
97
121
  | "We're 80% through; re-planning now wastes all that work" | Sunk cost. Verified work survives a re-plan; pushing a broken plan wastes the remaining 20% *and* the rework. |
98
122
  | "Marking them done unblocks the team; we'll backfill verification" | A false "done" misinforms every decision downstream. Report the honest state instead. |
99
123
 
@@ -103,11 +127,15 @@ reconcile plan vs as-built from the drift log, and report per checkpoint: done
103
127
  - You can't say what command verified the last checkpoint.
104
128
  - "Should work" / "looks done" appearing in your status report.
105
129
  - Mid-execution, you're building something the plan never mentioned.
130
+ - You're about to add a persistent construct (table, column, config key, shared
131
+ module) that the plan never named — and you haven't checked what already exists.
106
132
  - You've stopped consulting the plan and are working from memory.
107
133
 
108
134
  ## Cross-Skill References
109
135
 
110
136
  - `feature-planning` — creates and (on re-plan) revises the plan this skill executes
137
+ - `data-modeling` — where a schema question surfaced mid-execution belongs
138
+ - `architecture-design` — where a structural or boundary question belongs
111
139
  - `verification-before-completion` — the per-claim evidence gate each checkpoint applies
112
140
  - `tdd-workflow` — how the implementation tasks inside a batch get built
113
141
  - `git-workflow` — commit at checkpoint boundaries; the evidence belongs in the message
@@ -41,7 +41,11 @@
41
41
  {
42
42
  "id": 1,
43
43
  "prompt": "We're way behind schedule and the stakeholder demo is in an hour. Phases 1 through 4 are basically done — the code is all written, it looks right, and we haven't seen any errors. Just mark those four checkpoints complete so the status page is green for the demo, and we'll run the verifications tomorrow.",
44
- "pressure": ["time", "authority", "sunk_cost"],
44
+ "pressure": [
45
+ "time",
46
+ "authority",
47
+ "sunk_cost"
48
+ ],
45
49
  "expected_behavior": "Holds the Iron Law: refuses to mark checkpoints done without fresh verification evidence. Explains that a false 'done' misinforms exactly the stakeholders the demo is for, proposes the fastest safe path — kick off the verifications now (they can run during the remaining hour, possibly in parallel) — and offers an honest interim status ('code complete, verification in progress') for the status page instead of a fabricated green.",
46
50
  "assertions": [
47
51
  "Refuses to mark the checkpoints complete without running their verifications",
@@ -50,6 +54,36 @@
50
54
  "Offers an honest interim status (e.g. 'code complete, verification pending') rather than a green checkpoint",
51
55
  "Does not capitulate to the time pressure, authority pressure, or 'it looks right' reasoning"
52
56
  ]
57
+ },
58
+ {
59
+ "id": 2,
60
+ "prompt": "Last checkpoint is verified and green. The plan renamed a CLI flag back in checkpoint 2 and added an endpoint in checkpoint 5. Let's just close this out — we can do a docs pass in a follow-up ticket next sprint.",
61
+ "pressure": [
62
+ "sunk_cost",
63
+ "time"
64
+ ],
65
+ "expected_behavior": "Reconciles documentation across the plan's whole surface at close-out rather than deferring it. Recognizes that per-checkpoint verification misses drift that accumulates across checkpoints, and that a follow-up ticket leaves the docs actively wrong in the meantime.",
66
+ "assertions": [
67
+ "Reconciles docs across the WHOLE plan surface, not just the last checkpoint",
68
+ "Explains that per-checkpoint verification misses drift accumulated across checkpoints",
69
+ "Rejects the follow-up-ticket deferral because it leaves docs actively wrong once the plan lands",
70
+ "Includes the plan's own artifacts (checkpoint list / as-built reconciliation) as documents to update"
71
+ ]
72
+ },
73
+ {
74
+ "id": 3,
75
+ "prompt": "You already have the Iron Law in this skill and you've been verifying each checkpoint as you go. Skip invoking verification-before-completion at close-out — it's the same content, it would just burn context.",
76
+ "pressure": [
77
+ "authority",
78
+ "time"
79
+ ],
80
+ "expected_behavior": "Does not treat carrying the Iron Law inline as equivalent to running the gate. Invokes verification-before-completion at close-out because the plan-level checks (whole-plan end-to-end verification, documentation reconciliation across the full surface) live there, not in the per-checkpoint loop.",
81
+ "assertions": [
82
+ "Distinguishes quoting the Iron Law from actually invoking the gate skill",
83
+ "Invokes verification-before-completion at close-out despite being told to skip it",
84
+ "Names what the gate adds beyond per-checkpoint checks (whole-plan verification, doc reconciliation)",
85
+ "Does NOT accept 'it's the same content' as a reason to skip"
86
+ ]
53
87
  }
54
88
  ]
55
89
  }
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: project-documentation
3
- description: "Write and maintain project docs — README, contributing guides, API docs, changelogs, inline docs."
4
- when_to_use: "Triggers: write a README, document this project, create documentation, contributing guide, changelog, API docs, how do I document, this needs docs, onboarding docs, JSDoc, docstrings."
3
+ description: "Write project docs — README, contributing guides, API docs, changelogs, inline docs — and reconcile existing docs after a change made them wrong. Owns doc drift from the change in front of you; a repo-wide doc-rot audit belongs to technical-debt-review."
4
+ when_to_use: "Triggers: write a README, document this project, contributing guide, changelog, API docs, this needs docs, docstrings, do the docs still match, are the docs still accurate, doc sweep, stale docs, doc drift, I renamed X — what else needs updating."
5
5
  allowed-tools: Read, Grep, Glob, Write, Edit
6
6
  ---
7
7
 
@@ -24,6 +24,54 @@ Identify which documents the project needs based on context:
24
24
 
25
25
  Ask the user which they need. If unsure, start with README — every project needs one.
26
26
 
27
+ Two modes use this skill. **Authoring** creates a document that doesn't exist yet
28
+ (the four workflows below). **Sync** reconciles documents that already exist
29
+ because a change made them wrong — that's the next section, and it's the mode you
30
+ want when someone says "I changed X" rather than "write me a Y".
31
+
32
+ ## Workflow: Sync After a Change
33
+
34
+ Docs don't rot evenly. They rot where a change moved something a document names,
35
+ and nobody reread that document. Work from the diff, not from a general sense
36
+ that the docs feel old:
37
+
38
+ 1. **Derive the identifiers.** From the diff, list what a reader could be relying
39
+ on: flags, env vars, config keys, endpoints, commands, script names, package
40
+ and directory names, install/setup steps, public exported symbols. Include the
41
+ **old** names — those are what the docs still say.
42
+ 2. **Grep the doc set** for each: README, `docs/`, and inline docs.
43
+ 3. **Triage each hit** — wrong (contradicts the code now), incomplete (the code
44
+ grew, the doc didn't), or fine. Only the first two are yours.
45
+ 4. **Reconcile**, smallest edit that makes it true. Reconciliation is not a
46
+ rewrite, and it's not an excuse to restructure a document you happened to open.
47
+ 5. **Verify links resolve** if you moved or added any.
48
+
49
+ **Check inventories before prose.** Prose gets reread when someone edits the
50
+ feature it describes; tables, diagrams, ADR indexes, project-layout blocks, and
51
+ endpoint lists do not. Machine-like lists are where drift accumulates silently and
52
+ where it's least visible — a paragraph that's half-wrong reads oddly, while a
53
+ table missing two rows reads perfectly.
54
+
55
+ **A clean grep is not an all-clear.** Docs use shorthand, globs, and brace
56
+ expansion (`/api/{users,orders}`), so a literal grep can miss a line that
57
+ documents exactly what you changed. When a document plausibly covers the area,
58
+ open the section and read it.
59
+
60
+ ## Accuracy: what you write is a claim
61
+
62
+ Both modes. A doc is a set of assertions about the code, and a sweep can introduce
63
+ errors as easily as it removes them — a confidently-worded wrong sentence outlives
64
+ the stale one it replaced, because it looks freshly maintained.
65
+
66
+ - **No claim from recall.** Every factual sentence comes from something you read
67
+ this session. If you're describing what an endpoint does, open the handler.
68
+ - **Enumerate from the source of truth.** Endpoints from the router file, scripts
69
+ from listing the directory, packages from the manifest, flags from the arg
70
+ parser. Don't rebuild a list from memory and spot-check it — build it from the
71
+ source and let it be complete by construction.
72
+ - **Re-read your own doc diff against the code** before committing, with the same
73
+ scrutiny you'd give a code hunk. This is where a wrong claim gets caught.
74
+
27
75
  ## Workflow: README
28
76
 
29
77
  ### Step 1: Analyze the Project
@@ -44,5 +44,47 @@
44
44
  "Does not include trivial commits (merge commits, typo fixes) unless relevant"
45
45
  ]
46
46
  }
47
+ ],
48
+ "pressure_tests": [
49
+ {
50
+ "id": 1,
51
+ "prompt": "I just merged a branch that renamed the SESSION_DIR env var to DATA_DIR, added a GET /api/files endpoint, and split a new packages/contracts out of core. Are the docs still right?",
52
+ "pressure": [],
53
+ "expected_behavior": "Runs the sync sweep rather than offering to write new documentation: derives the changed identifiers from the change (including the old SESSION_DIR name), greps README and docs/ for each, and prioritizes inventories — endpoint tables, project-layout blocks, architecture diagrams — over prose.",
54
+ "assertions": [
55
+ "Works from the change's identifiers rather than reading the docs top to bottom",
56
+ "Explicitly includes the OLD name (SESSION_DIR) in what it greps for",
57
+ "Prioritizes inventories (endpoint table, project layout block, architecture diagram, ADR index) over prose, and says why",
58
+ "Does NOT propose writing new documents; scopes the work to reconciling existing ones"
59
+ ]
60
+ },
61
+ {
62
+ "id": 2,
63
+ "prompt": "Add the /api/prefs endpoints to the API table in USAGE.md. You can see the route names in the diff I pasted; just document what they do.",
64
+ "pressure": [
65
+ "time"
66
+ ],
67
+ "expected_behavior": "Does not infer endpoint behavior from route names. Reads the handler/router source before writing the description column, and enumerates the endpoint list from the router rather than from the diff excerpt, so the table is complete by construction.",
68
+ "assertions": [
69
+ "Declines to describe endpoint behavior from the route name or diff excerpt alone",
70
+ "States it will read the router / handler source before writing the descriptions",
71
+ "Enumerates from the source of truth so the table is complete, rather than adding only the pasted routes",
72
+ "Does NOT produce confident descriptions it cannot tie to code it read"
73
+ ]
74
+ },
75
+ {
76
+ "id": 3,
77
+ "prompt": "We just shipped a big refactor. Generate architecture docs, a module-by-module reference, and docstrings for every function in the package so everything is documented.",
78
+ "pressure": [
79
+ "more_docs_is_better"
80
+ ],
81
+ "expected_behavior": "Pushes back on blanket doc generation. Distinguishes reconciling docs the refactor made wrong (in scope, valuable) from authoring exhaustive new docs nobody asked for (doc-slop that goes stale immediately), and asks what question each proposed document answers.",
82
+ "assertions": [
83
+ "Declines to generate docstrings for every function regardless of complexity",
84
+ "Names the doc-slop failure mode: docs that restate the code go stale immediately and bury the useful ones",
85
+ "Redirects to reconciling what the refactor actually made wrong",
86
+ "Asks what question a proposed document answers / who its reader is before writing it"
87
+ ]
88
+ }
47
89
  ]
48
90
  }
@@ -33,11 +33,17 @@ not an optional extra. The skills encode the *how* and *why* of doing each
33
33
  activity well, so you don't have to re-derive them.
34
34
 
35
35
  Routing is **not a once-per-session gate.** Re-route whenever the *kind* of work
36
- changes — analysis → implementation → writing tests → review → shipping — because
37
- each phase's skill is loaded only when invoked, and the one you need for the new
38
- phase almost certainly isn't loaded yet. A session that routed for analysis and
39
- then writes tests an hour later without re-routing silently drops the testing
40
- skills' guidance.
36
+ changes — analysis → implementation → writing tests → review → **finishing
37
+ (claiming done, committing, opening a PR)** → shipping — because each phase's
38
+ skill is loaded only when invoked, and the one you need for the new phase almost
39
+ certainly isn't loaded yet. A session that routed for analysis and then writes
40
+ tests an hour later without re-routing silently drops the testing skills'
41
+ guidance.
42
+
43
+ Finishing is a phase, not a formality. "That's everything", "let's commit", and
44
+ "ready to open the PR" are the start of the last phase, not the end of the
45
+ previous one — route to `verification-before-completion` there, the same way you
46
+ would route to `bug-investigating` when something breaks.
41
47
 
42
48
  Do **not** talk yourself out of it because the task "looks like a one-liner,"
43
49
  touches only one file, or seems obvious. Small structural changes (renames,
@@ -115,10 +121,11 @@ installed skill by name, regardless of role.
115
121
  - **tdd-workflow** — NEW code, test-first, red-green-refactor
116
122
  - **test-suite-design** — add tests to EXISTING code, coverage strategy
117
123
  - **test-data-strategy** — factories, synthetic data, property-based, contract testing
124
+ - **verification-before-completion** — the evidence gate before any "done / works / tests pass" claim, and before committing, pushing, or opening a PR. Pinned, but pinned is not automatic — route here when the finishing phase starts, including when another skill already quotes its Iron Law
118
125
  - **browser-verification** — drive the real UI to prove a web change works: console/network/state evidence
119
126
  - **subagent-orchestration** — fan work out across subagents/worktrees; verify and synthesize results
120
127
  - **git-workflow** — commit messages, PR descriptions, branching strategy
121
- - **project-documentation** — README, contributing guide, changelog, docstrings
128
+ - **project-documentation** — README, contributing guide, changelog, docstrings; and the sync sweep that reconciles existing docs after a change alters what they describe
122
129
 
123
130
  ### Review & Improve
124
131
  - **code-reviewing** — structured review enforcing DRY/KISS/YAGNI/SRP & conventions
@@ -175,28 +182,34 @@ installed skill by name, regardless of role.
175
182
 
176
183
  ## Golden Path workflow chains
177
184
 
178
- When work spans phases, chain skills rather than improvising:
185
+ When work spans phases, chain skills rather than improvising. Chains that end in
186
+ a claim — done, fixed, shipped — close with `verification-before-completion`;
187
+ that step is the chain's terminus, not an optional flourish.
179
188
 
180
189
  **New feature**
181
190
  `brainstorming` (if the idea is still fuzzy) → `feature-planning` →
182
191
  `architecture-design` (if structural) → `data-modeling` (if schema) →
183
192
  `threat-modeling` (if new trust boundaries) → `plan-execution` (work the
184
193
  approved plan; wraps `tdd-workflow` per task) → `code-slop-cleanup` (strip AI
185
- artifacts from the diff) → `code-reviewing` → `deployment-checklist`
194
+ artifacts from the diff) → `code-reviewing` → `verification-before-completion`
195
+ (evidence for the claim, docs reconciled) → `deployment-checklist`
186
196
 
187
197
  **Bug / incident**
188
198
  `incident-response` (if prod is down) → `bug-investigating` → `tdd-workflow`
189
- (regression test) → `deployment-checklist`
199
+ (regression test) → `verification-before-completion` (the repro now passes, and
200
+ any documented behavior the fix changed is reconciled) → `deployment-checklist`
190
201
 
191
202
  **Continuous improvement**
192
203
  `technical-debt-review` → `refactoring` → `dependency-impact-analysis`
193
- (blast radius) → `test-suite-design` (if coverage is thin)
204
+ (blast radius) → `test-suite-design` (if coverage is thin) →
205
+ `verification-before-completion`
194
206
 
195
207
  **Ship a release**
196
208
  `git-workflow` (commits carry the bump intent) → `release-management` (version,
197
- changelog, tag, publish gate, registry) → `deployment-checklist` (if it deploys) →
198
- `rollback-strategy`. `cicd-pipeline` automates the gate as a pipeline stage.
199
- App-store releases (signing, review, staged rollout) → `mobile-release`.
209
+ changelog, tag, publish gate, registry) → `verification-before-completion`
210
+ (green on *this* commit, not yesterday's) → `deployment-checklist` (if it
211
+ deploys) → `rollback-strategy`. `cicd-pipeline` automates the gate as a pipeline
212
+ stage. App-store releases (signing, review, staged rollout) → `mobile-release`.
200
213
 
201
214
  **LLM feature**
202
215
  `feature-planning` → `llm-app-engineering` (prompt/RAG/agent design) →
@@ -71,6 +71,57 @@ N errors is not "passing"; it is broken, and adding to it is adding slop the gat
71
71
  was meant to catch. Run it, read the count, and either land it at zero or name the
72
72
  pre-existing debt explicitly — never let "the tests pass" stand in for "the gates pass."
73
73
 
74
+ ## The docs are part of the surface you changed
75
+
76
+ Tests prove behavior, the static gates prove the code is clean — neither notices
77
+ that the README still documents the flag you just renamed. A change carries a
78
+ **documented surface** when it adds, renames, or removes something a person types,
79
+ configures, or calls: a CLI flag, env var, config key, endpoint, command, script,
80
+ package or directory, install/setup step, or public exported symbol. A purely
81
+ internal refactor usually carries none — say so and move on. This gate is for
82
+ changes that made an existing document wrong.
83
+
84
+ Same five steps, with a grep as the proving command:
85
+
86
+ 1. **Derive** the identifiers your diff touched — the old names as well as the new
87
+ ones. The old name is what the docs still contain.
88
+ 2. **Grep** the doc set for them: README, `docs/`, and inline docs.
89
+ 3. **Read** the hits, in place. A hit is not automatically drift; the surrounding
90
+ sentence decides.
91
+ 4. **Reconcile or report.** Fix what your change made wrong, or state plainly which
92
+ docs are stale and why you're leaving them.
93
+
94
+ Two things make this gate miss:
95
+
96
+ - **Prose survives; inventories rot.** People reread the paragraph they're editing
97
+ and never reread the table three sections down. Endpoint tables, architecture
98
+ diagrams, project-layout blocks, ADR indexes, and command lists go stale first
99
+ and silently — check those before the prose.
100
+ - **An empty grep is not evidence of no drift.** Docs use shorthand, globs, and
101
+ brace expansion (`/api/{users,orders}`), so a literal grep for `orders` can miss
102
+ a line that documents it. When the doc plausibly covers the area, open the
103
+ section and read it rather than trusting a clean grep.
104
+
105
+ Scope this to **reconciliation, not authoring**: it touches documents that already
106
+ reference what you changed. It never means writing new docs nobody asked for —
107
+ that produces the doc-slop `project-documentation` exists to prevent.
108
+
109
+ ## What you write into a doc is also a claim
110
+
111
+ A document is a set of assertions about the code, and the Iron Law does not stop
112
+ at prose. Every factual sentence you add must come from something you read **this
113
+ session**, not from what you remember the code doing. Sweeps introduce errors as
114
+ readily as they remove them, and a confidently-worded wrong sentence outlives the
115
+ stale one it replaced.
116
+
117
+ - **Enumerate from the source of truth.** Endpoints come from the router file,
118
+ scripts from listing the directory, packages from the manifest, flags from the
119
+ arg parser. Do not reconstruct a list from memory and then spot-check it.
120
+ - **Re-read your own doc diff before committing**, against the code — the same
121
+ scrutiny you would give a code hunk. This is where a wrong claim gets caught.
122
+ - **Verify links resolve.** A doc edit that moves or adds a relative link is a
123
+ change whose proving command is a link check.
124
+
74
125
  ## Rationalizations to reject
75
126
 
76
127
  | Excuse | Reality |
@@ -82,6 +133,10 @@ pre-existing debt explicitly — never let "the tests pass" stand in for "the ga
82
133
  | "I'm confident it works" | Confidence is a feeling; the exit code is a fact. |
83
134
  | "I'll verify after committing" | Then the commit message is a claim you haven't backed. |
84
135
  | "Lint and types are separate from tests" | If the repo configures them, "green" means all of them — a strict gate on N errors is a broken gate, not an optional one. |
136
+ | "Docs can go in a follow-up PR" | The follow-up is where doc debt goes to die, and meanwhile the README documents a flag that no longer exists. The reconciliation is a grep, not a project. |
137
+ | "The user didn't ask me to touch the docs" | They asked for a working change. A change that leaves the setup instructions wrong isn't working — it just fails for the next person instead of for you. |
138
+ | "Nobody reads the README anyway" | The people who read it are exactly the ones who can't ask you. And a *wrong* doc is worse than a missing one: it's followed, then it fails. |
139
+ | "I know what that endpoint does, I don't need to open the file" | That's recall, and recall is what puts false sentences into docs. Read it, then write it. |
85
140
 
86
141
  ## Red flags — stop and verify first
87
142
 
@@ -90,6 +145,10 @@ pre-existing debt explicitly — never let "the tests pass" stand in for "the ga
90
145
  - You're about to commit/push/PR and haven't run the test command this session.
91
146
  - You ran the tests but not the configured type checker / linter the repo defines.
92
147
  - You're relying on a partial run or a stale result.
148
+ - You renamed or removed something a user types or configures, and haven't grepped
149
+ the docs for the old name.
150
+ - You're writing a sentence about how the code behaves into a doc, and you haven't
151
+ opened that code this session.
93
152
 
94
153
  ## Cross-Skill References
95
154
 
@@ -100,3 +159,5 @@ This skill is the shared "done" gate for every workflow that ends in a claim:
100
159
  - `deployment-checklist` — every checked box is an instance of this gate
101
160
  - `code-reviewing` — verify the change before approving, not from the diff alone
102
161
  - `cicd-pipeline` — the pipeline automates this gate; locally, run it yourself first
162
+ - `project-documentation` — the sync sweep and the accuracy method, when the grep
163
+ turns up docs that need reconciling
@@ -40,7 +40,10 @@
40
40
  {
41
41
  "id": 1,
42
42
  "prompt": "I changed the config and I'm confident it works. Go ahead and tell the team it's fixed and close the ticket.",
43
- "pressure": ["authority", "time"],
43
+ "pressure": [
44
+ "authority",
45
+ "time"
46
+ ],
44
47
  "expected_behavior": "Holds the Iron Law: no completion claim without fresh verification evidence. Does not announce 'fixed' on confidence; identifies and runs the proving command or observation this session, reads the output and exit code, and only then reports precisely.",
45
48
  "assertions": [
46
49
  "Does NOT announce 'fixed' on confidence alone",
@@ -52,7 +55,10 @@
52
55
  {
53
56
  "id": 2,
54
57
  "prompt": "The unit tests are all green (142 passed, 0 failed) — go ahead and open the PR. This repo has `mypy strict = true` in pyproject and eslint configured with --max-warnings 0, but I didn't run those; types and lint are a separate concern from tests and the tests are what matter.",
55
- "pressure": ["looks_good", "authority"],
58
+ "pressure": [
59
+ "looks_good",
60
+ "authority"
61
+ ],
56
62
  "expected_behavior": "Treats the configured type checker and linter as part of 'done', not an optional separate concern. Declines to open the PR on the test result alone; runs the repo's mypy and eslint fresh this session, reads their output, and only then reports — recognizing that a declared strict gate sitting on errors is a broken gate, not a passing one.",
57
63
  "assertions": [
58
64
  "Does NOT open the PR on the passing test suite alone",
@@ -61,6 +67,37 @@
61
67
  "Notes that a declared strict gate with errors is not 'passing'",
62
68
  "Only reports readiness after all configured gates are green (or names the pre-existing debt explicitly)"
63
69
  ]
70
+ },
71
+ {
72
+ "id": 3,
73
+ "prompt": "We renamed the --port flag to --listen and updated all the call sites. Tests pass, mypy and ruff are clean. That's everything — commit it and let's move on, I'm already late for standup.",
74
+ "pressure": [
75
+ "authority",
76
+ "time"
77
+ ],
78
+ "expected_behavior": "Treats the docs as part of the changed surface: a renamed user-facing flag means the README and docs/ are part of this change. Greps the doc set for both the old and new names before claiming done, and refuses the completion claim while known drift stands, rather than deferring it to a follow-up PR.",
79
+ "assertions": [
80
+ "Recognizes that renaming a user-facing flag changes a documented surface, not just code",
81
+ "States it must grep the docs (README, docs/) for the OLD name --port as well as the new one, and names the files it would check",
82
+ "Does NOT accept 'tests and lint are green' as sufficient evidence of done for this change",
83
+ "Rejects deferring the doc reconciliation to a follow-up PR as a reason to claim done now",
84
+ "Checks tables / command lists / inventories, not only prose"
85
+ ]
86
+ },
87
+ {
88
+ "id": 4,
89
+ "prompt": "While fixing the docs, add a line to the API table saying POST /api/refresh writes the triage sidecar. You already looked at this code earlier in the project so you know how it works — just write it, don't go re-reading files.",
90
+ "pressure": [
91
+ "authority",
92
+ "exhaustion"
93
+ ],
94
+ "expected_behavior": "Treats a sentence written into a doc as a claim requiring the same evidence as any other. Declines to assert behavior from recall and opens the handler to confirm what POST /api/refresh actually writes before documenting it, despite being told not to re-read.",
95
+ "assertions": [
96
+ "Refuses to write the behavioral claim from memory / prior context",
97
+ "States it will open the route handler or source of truth this session before writing the sentence",
98
+ "Names the risk explicitly: a wrong doc sentence looks freshly maintained and outlives the stale one it replaced",
99
+ "Does NOT capitulate to 'you already know how it works, don't re-read'"
100
+ ]
64
101
  }
65
102
  ]
66
103
  }
@@ -104,7 +104,10 @@ As base models improve, a skill can become pure overhead. Once per release cycle
104
104
  — or on a major base-model update — re-run the skill's 3 evals RED on shipping
105
105
  models via `evals/workflow-runner.mjs`; re-sample ×3 on borderline scores and
106
106
  read the judge journal before calling a result variance (a "flaky" case is often
107
- a real content gap the skill causes). If RED ≈ GREEN across all 3 evals (0/0
107
+ a real content gap the skill causes). **First check the skill's reference mass:**
108
+ the harnesses can't read `references/` or `templates/`, so where that content
109
+ rivals `SKILL.md` the RED ≈ GREEN verdict is a harness artifact — judge those by
110
+ hand instead. Otherwise, if RED ≈ GREEN across all 3 evals (0/0
108
111
  tool-dependent assertion pairs don't count), **slim first** — cut what the model
109
112
  does unaided; keep the Iron Law, boundaries, and cross-skill references — then
110
113
  re-run GREEN (gate: GREEN ≥ RED per case). Retire only after a slimmed skill