@nklisch/pi-agile-workflow 0.15.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/.claude-plugin/plugin.json +10 -0
- package/.codex-plugin/plugin.json +28 -0
- package/CHANGELOG.md +591 -0
- package/README.md +107 -0
- package/docs/ARCHITECTURE.md +716 -0
- package/docs/MIGRATION.md +419 -0
- package/docs/PRINCIPLES.md +464 -0
- package/docs/ROADMAP.md +95 -0
- package/docs/SPEC.md +855 -0
- package/docs/VISION.md +106 -0
- package/extensions/agile-workflow.test.ts +419 -0
- package/extensions/agile-workflow.ts +467 -0
- package/hooks/hooks.json +52 -0
- package/hooks/scripts/prompt-context.py +628 -0
- package/hooks/scripts/substrate-maintainer.py +359 -0
- package/hooks/scripts/test_prompt_context.py +757 -0
- package/package.json +30 -0
- package/scripts/install-work-view.sh +165 -0
- package/scripts/tests/agent-metadata.test.sh +75 -0
- package/scripts/tests/bump-version.test.sh +552 -0
- package/scripts/tests/channel-parity.test.sh +117 -0
- package/scripts/tests/convert-content-integrity.test.sh +246 -0
- package/scripts/tests/convert-install-routing.test.sh +159 -0
- package/scripts/tests/install-work-view.test.sh +411 -0
- package/scripts/tests/pi-package-metadata.test.sh +119 -0
- package/scripts/tests/work-board-shim.test.sh +239 -0
- package/scripts/tests/work-view-dist-version.test.sh +105 -0
- package/scripts/work-board.sh +64 -0
- package/scripts/work-view.sh +423 -0
- package/skills/autopilot/SKILL.md +330 -0
- package/skills/autopilot/agents/openai.yaml +6 -0
- package/skills/board/SKILL.md +62 -0
- package/skills/board/agents/openai.yaml +6 -0
- package/skills/bold-refactor/SKILL.md +244 -0
- package/skills/bold-refactor/agents/openai.yaml +6 -0
- package/skills/bug-scan/SKILL.md +378 -0
- package/skills/bug-scan/agents/openai.yaml +6 -0
- package/skills/bug-scan/references/async-promises.md +119 -0
- package/skills/bug-scan/references/concurrency-races.md +148 -0
- package/skills/bug-scan/references/data-layer.md +167 -0
- package/skills/bug-scan/references/error-handling.md +197 -0
- package/skills/bug-scan/references/gate-item-template.md +94 -0
- package/skills/bug-scan/references/language-footguns.md +219 -0
- package/skills/bug-scan/references/parked-item-template.md +103 -0
- package/skills/bug-scan/references/report-template.md +115 -0
- package/skills/bug-scan/references/resource-leaks.md +199 -0
- package/skills/bug-scan/references/state-closures.md +148 -0
- package/skills/bug-scan/references/time-numbers.md +158 -0
- package/skills/convert/SKILL.md +1463 -0
- package/skills/convert/agents/openai.yaml +6 -0
- package/skills/convert/references/legacy-overlap-migration.md +179 -0
- package/skills/deep-code-scan/SKILL.md +378 -0
- package/skills/deep-code-scan/agents/openai.yaml +6 -0
- package/skills/deep-code-scan/references/artifact-ledger.md +148 -0
- package/skills/deep-code-scan/references/consolidation.md +91 -0
- package/skills/deep-code-scan/references/decomposition.md +127 -0
- package/skills/deep-code-scan/references/item-templates.md +263 -0
- package/skills/deep-code-scan/references/lane-catalog.md +129 -0
- package/skills/deep-code-scan/references/review-gauntlet.md +108 -0
- package/skills/deep-code-scan/references/scanner-brief.md +152 -0
- package/skills/e2e-test-design/SKILL.md +517 -0
- package/skills/e2e-test-design/references/anti-tautology.md +261 -0
- package/skills/e2e-test-design/references/service-mocks.md +234 -0
- package/skills/e2e-test-design/references/test-taxonomy.md +211 -0
- package/skills/epic-design/SKILL.md +476 -0
- package/skills/epicize/SKILL.md +210 -0
- package/skills/epicize/agents/openai.yaml +6 -0
- package/skills/feature-design/SKILL.md +472 -0
- package/skills/fix/SKILL.md +173 -0
- package/skills/gate-cruft/SKILL.md +258 -0
- package/skills/gate-docs/SKILL.md +278 -0
- package/skills/gate-patterns/SKILL.md +389 -0
- package/skills/gate-refactor/SKILL.md +408 -0
- package/skills/gate-security/SKILL.md +275 -0
- package/skills/gate-tests/SKILL.md +367 -0
- package/skills/groom/SKILL.md +162 -0
- package/skills/groom/agents/openai.yaml +6 -0
- package/skills/ideate/SKILL.md +185 -0
- package/skills/ideate/agents/openai.yaml +6 -0
- package/skills/implement/SKILL.md +288 -0
- package/skills/implement-orchestrator/SKILL.md +604 -0
- package/skills/park/SKILL.md +111 -0
- package/skills/perf-design/SKILL.md +427 -0
- package/skills/perf-scout/SKILL.md +404 -0
- package/skills/perf-scout/agents/openai.yaml +6 -0
- package/skills/perf-scout/references/algorithmic-and-data-structures.md +126 -0
- package/skills/perf-scout/references/approximation-and-precomputation.md +136 -0
- package/skills/perf-scout/references/caching-and-memoization.md +123 -0
- package/skills/perf-scout/references/compiler-runtime-and-language.md +136 -0
- package/skills/perf-scout/references/database-and-storage-internals.md +144 -0
- package/skills/perf-scout/references/distributed-systems.md +150 -0
- package/skills/perf-scout/references/game-engine-and-realtime.md +136 -0
- package/skills/perf-scout/references/gpu-and-accelerators.md +130 -0
- package/skills/perf-scout/references/idea-ranking.md +75 -0
- package/skills/perf-scout/references/io-and-batching.md +135 -0
- package/skills/perf-scout/references/memory-and-data-locality.md +137 -0
- package/skills/perf-scout/references/parallelism-and-vectorization.md +126 -0
- package/skills/perf-scout/references/parked-item-template.md +117 -0
- package/skills/perf-scout/references/peer-review-pass.md +150 -0
- package/skills/perf-scout/references/report-template.md +148 -0
- package/skills/principles/SKILL.md +678 -0
- package/skills/principles/references/models.md +191 -0
- package/skills/principles/references/subagents.md +158 -0
- package/skills/prose-author/SKILL.md +185 -0
- package/skills/refactor-conventions-creator/SKILL.md +359 -0
- package/skills/refactor-conventions-creator/agents/openai.yaml +6 -0
- package/skills/refactor-conventions-creator/references/common-structures.md +91 -0
- package/skills/refactor-conventions-creator/references/common-styles.md +90 -0
- package/skills/refactor-design/SKILL.md +384 -0
- package/skills/release-deploy/SKILL.md +667 -0
- package/skills/release-deploy/agents/openai.yaml +6 -0
- package/skills/research/SKILL.md +166 -0
- package/skills/research/agents/openai.yaml +6 -0
- package/skills/review/SKILL.md +267 -0
- package/skills/review/references/deep-review.md +98 -0
- package/skills/review/references/review-lenses.md +68 -0
- package/skills/review/references/substrate-side-effects.md +161 -0
- package/skills/review/references/target-resolution.md +52 -0
- package/skills/scope/SKILL.md +486 -0
- package/work-view/Cargo.lock +486 -0
- package/work-view/Cargo.toml +9 -0
- package/work-view/crates/cli/.work-view-version +1 -0
- package/work-view/crates/cli/Cargo.toml +18 -0
- package/work-view/crates/cli/src/actionable.rs +500 -0
- package/work-view/crates/cli/src/args.rs +792 -0
- package/work-view/crates/cli/src/board/assets/board.css +855 -0
- package/work-view/crates/cli/src/board/assets/board.js +259 -0
- package/work-view/crates/cli/src/board/assets/card.js +139 -0
- package/work-view/crates/cli/src/board/assets/components.css +290 -0
- package/work-view/crates/cli/src/board/assets/dependency.js +1193 -0
- package/work-view/crates/cli/src/board/assets/detail.js +256 -0
- package/work-view/crates/cli/src/board/assets/filters.js +389 -0
- package/work-view/crates/cli/src/board/assets/index.html +77 -0
- package/work-view/crates/cli/src/board/assets/kanban.js +231 -0
- package/work-view/crates/cli/src/board/assets/markdown.js +260 -0
- package/work-view/crates/cli/src/board/assets/motion.css +131 -0
- package/work-view/crates/cli/src/board/assets/state.js +245 -0
- package/work-view/crates/cli/src/board/assets/table.js +304 -0
- package/work-view/crates/cli/src/board/assets/tokens.css +602 -0
- package/work-view/crates/cli/src/board/assets/views.js +41 -0
- package/work-view/crates/cli/src/board/assets.rs +162 -0
- package/work-view/crates/cli/src/board/feed.rs +204 -0
- package/work-view/crates/cli/src/board/mod.rs +246 -0
- package/work-view/crates/cli/src/board/open.rs +144 -0
- package/work-view/crates/cli/src/board/server.rs +407 -0
- package/work-view/crates/cli/src/main.rs +195 -0
- package/work-view/crates/cli/src/render.rs +354 -0
- package/work-view/crates/cli/src/scope.rs +157 -0
- package/work-view/crates/cli/src/stale.rs +581 -0
- package/work-view/crates/cli/tests/board-js/dependency-table.test.mjs +64 -0
- package/work-view/crates/cli/tests/board-js/expanded-browsing.test.mjs +79 -0
- package/work-view/crates/cli/tests/board-js/harness-smoke.test.mjs +11 -0
- package/work-view/crates/cli/tests/board-js/harness.mjs +437 -0
- package/work-view/crates/cli/tests/board-js/kanban-detail.test.mjs +75 -0
- package/work-view/crates/cli/tests/board-js/markdown-filter.test.mjs +60 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/CONVENTIONS.md +3 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/active/epics/epic-alpha.md +16 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/active/features/feat-a.md +16 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/active/features/feat-b.md +16 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/active/stories/story-alpha-1.md +16 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/active/stories/story-research-1.md +19 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/archive/feat-done.md +16 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/archive/feat-shipped.md +18 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/backlog/idea-backlog.md +7 -0
- package/work-view/crates/cli/tests/fixtures/golden/.work/releases/v1.0/v1.0.md +16 -0
- package/work-view/crates/cli/tests/fixtures/ready-drafting/.work/CONVENTIONS.md +6 -0
- package/work-view/crates/cli/tests/fixtures/ready-drafting/.work/active/features/feat-dep-done.md +17 -0
- package/work-view/crates/cli/tests/fixtures/ready-drafting/.work/active/features/feat-design-ready.md +17 -0
- package/work-view/crates/cli/tests/fixtures/ready-drafting/.work/active/features/feat-impl-ready.md +17 -0
- package/work-view/crates/cli/tests/fixtures/ready-drafting/.work/active/stories/story-review-ready.md +17 -0
- package/work-view/crates/cli/tests/fixtures/with-malformed/.work/CONVENTIONS.md +4 -0
- package/work-view/crates/cli/tests/fixtures/with-malformed/.work/active/epics/malformed-no-closing-fence.md +8 -0
- package/work-view/crates/cli/tests/fixtures/with-malformed/.work/active/features/good-item.md +16 -0
- package/work-view/crates/cli/tests/integration.rs +2833 -0
- package/work-view/crates/core/Cargo.toml +13 -0
- package/work-view/crates/core/src/error.rs +61 -0
- package/work-view/crates/core/src/filter.rs +804 -0
- package/work-view/crates/core/src/graph.rs +324 -0
- package/work-view/crates/core/src/index.rs +590 -0
- package/work-view/crates/core/src/lib.rs +54 -0
- package/work-view/crates/core/src/model.rs +202 -0
- package/work-view/crates/core/src/parse.rs +494 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/CONVENTIONS.md +15 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/active/epics/epic-core.md +16 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/active/features/feat-parser.md +16 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/active/features/feat-query.md +16 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/active/stories/malformed-no-id.md +15 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/active/stories/story-parse-unit.md +16 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/active/stories/story-security-gate.md +16 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/archive/feat-old.md +16 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/archive/feat-parser.md +17 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/backlog/idea-future-board.md +7 -0
- package/work-view/crates/core/tests/fixtures/golden/.work/releases/v1.0/v1.0.md +16 -0
- package/work-view/crates/core/tests/fixtures/precedence/.work/CONVENTIONS.md +10 -0
- package/work-view/crates/core/tests/fixtures/precedence/.work/archive/dup-item.md +18 -0
- package/work-view/crates/core/tests/fixtures/precedence/.work/releases/v2.0/dup-item.md +18 -0
- package/work-view/crates/core/tests/integration.rs +541 -0
- package/work-view/dist/.gitattributes +1 -0
- package/work-view/dist/README.md +42 -0
- package/work-view/dist/aarch64-apple-darwin/work-view +0 -0
- package/work-view/dist/aarch64-unknown-linux-musl/work-view +0 -0
- package/work-view/dist/x86_64-apple-darwin/work-view +0 -0
- package/work-view/dist/x86_64-unknown-linux-musl/work-view +0 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fix
|
|
3
|
+
description: >
|
|
4
|
+
ALWAYS invoke this skill when the user asks to fix a specific verified bug — do not just edit code
|
|
5
|
+
inline. Diagnoses and repairs a specific bug as a single-stride substrate story. Reproduces the
|
|
6
|
+
issue, identifies the root cause, writes a failing test, applies the minimal fix, confirms, and
|
|
7
|
+
creates a story item under .work/active/stories/ at stage:review capturing the work. Use when
|
|
8
|
+
something is verifiably broken — not for unverified hunches, refactors, or feature additions.
|
|
9
|
+
Triggers on "fix bug X", "fix the typo in", "fix this issue", "this is broken — fix it", and "patch
|
|
10
|
+
this item".
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Fix
|
|
14
|
+
|
|
15
|
+
You diagnose and repair a specific reported bug, capturing the work as a single
|
|
16
|
+
substrate story that lands at `stage: review`. The discipline is the same as a
|
|
17
|
+
careful bug-fix workflow — reproduce, diagnose to root cause, write a regression
|
|
18
|
+
test, apply the minimal fix, confirm — but the artifact is a substrate item, not
|
|
19
|
+
a separate fix doc.
|
|
20
|
+
|
|
21
|
+
## When to invoke
|
|
22
|
+
|
|
23
|
+
Trigger phrases:
|
|
24
|
+
- "fix bug X", "fix the issue with Y", "fix this"
|
|
25
|
+
- "the typo in foo.md should be Z"
|
|
26
|
+
- "I'm seeing error X when Y happens"
|
|
27
|
+
|
|
28
|
+
Skip if:
|
|
29
|
+
- User wants a refactor (no broken behavior) → use `/agile-workflow:scope` with
|
|
30
|
+
`tags: [refactor]`
|
|
31
|
+
- User wants a new feature → use `/agile-workflow:scope`
|
|
32
|
+
- The bug requires architectural changes spanning multiple subsystems → scope a
|
|
33
|
+
feature instead, fix is for targeted patches
|
|
34
|
+
|
|
35
|
+
## Workflow
|
|
36
|
+
|
|
37
|
+
### Phase 1: Reproduce
|
|
38
|
+
|
|
39
|
+
A bug you can't reproduce can't be reliably fixed.
|
|
40
|
+
|
|
41
|
+
1. Get the symptom from the user's input — error message, stack trace, failing test,
|
|
42
|
+
exact steps. If anything critical is missing (steps, environment, inputs), ask
|
|
43
|
+
the user.
|
|
44
|
+
2. Read `AGENTS.md` / `CLAUDE.md` for build and test commands, plus
|
|
45
|
+
`.agents/rules/*.md` (if present) — the project's force-loaded agent rules
|
|
46
|
+
(tag semantics, test integrity, review policy).
|
|
47
|
+
3. Reproduce locally. Capture the error verbatim.
|
|
48
|
+
|
|
49
|
+
If you can't reproduce, halt and ask the user for more specific reproduction steps.
|
|
50
|
+
|
|
51
|
+
### Phase 2: Diagnose to root cause
|
|
52
|
+
|
|
53
|
+
1. Form a hypothesis. Read the relevant code; trace the data flow from symptom to source.
|
|
54
|
+
2. Test the hypothesis (logging, debugger, code reading).
|
|
55
|
+
3. Use `git bisect` if the bug is a recent regression.
|
|
56
|
+
4. Name the root cause explicitly — not "the function fails" but the specific
|
|
57
|
+
assumption that's wrong, and where.
|
|
58
|
+
|
|
59
|
+
A NullPointerException is a symptom. "The user object is built without an email
|
|
60
|
+
field when login is via OAuth" is a root cause. Fix the root cause.
|
|
61
|
+
|
|
62
|
+
### Phase 3: Capture in a test
|
|
63
|
+
|
|
64
|
+
Before writing the fix, write a test that fails because of this bug. Use the project's
|
|
65
|
+
test framework. Run it; confirm it fails. The test becomes the regression guard.
|
|
66
|
+
|
|
67
|
+
If the bug is genuinely untestable (timing-dependent, external infra), document that
|
|
68
|
+
in the story body and write the closest approximation.
|
|
69
|
+
|
|
70
|
+
### Phase 4: Create the story item
|
|
71
|
+
|
|
72
|
+
Create `.work/active/stories/<id>.md`:
|
|
73
|
+
|
|
74
|
+
```yaml
|
|
75
|
+
---
|
|
76
|
+
id: story-fix-<short-slug>
|
|
77
|
+
kind: story
|
|
78
|
+
stage: implementing
|
|
79
|
+
tags: [bug]
|
|
80
|
+
parent: null
|
|
81
|
+
depends_on: []
|
|
82
|
+
release_binding: null
|
|
83
|
+
gate_origin: null
|
|
84
|
+
created: YYYY-MM-DD
|
|
85
|
+
updated: YYYY-MM-DD
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
# <one-line description>
|
|
89
|
+
|
|
90
|
+
## Symptom
|
|
91
|
+
<what the user reported, verbatim if useful>
|
|
92
|
+
|
|
93
|
+
## Root cause
|
|
94
|
+
<one paragraph: specific code path and assumption that was wrong>
|
|
95
|
+
|
|
96
|
+
## Fix approach
|
|
97
|
+
<what's changing, why it addresses the root cause>
|
|
98
|
+
|
|
99
|
+
## Regression test
|
|
100
|
+
<file path and what it asserts>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Phase 5: Apply the minimal fix
|
|
104
|
+
|
|
105
|
+
The smallest change that:
|
|
106
|
+
- Makes the failing test pass
|
|
107
|
+
- Doesn't break any existing tests
|
|
108
|
+
- Addresses the root cause, not the symptom
|
|
109
|
+
|
|
110
|
+
**Resist the urge to:**
|
|
111
|
+
- Refactor adjacent code that isn't causing the bug
|
|
112
|
+
- "Improve" surrounding logic while you're in there
|
|
113
|
+
- Add defensive code beyond what addresses the root cause
|
|
114
|
+
- Expand the fix's scope to "clean things up"
|
|
115
|
+
|
|
116
|
+
These are valid improvements — but they belong in a separate concern. If you
|
|
117
|
+
notice something genuinely worth addressing, park it via `/agile-workflow:park`
|
|
118
|
+
for separate consideration — don't bundle.
|
|
119
|
+
|
|
120
|
+
### Phase 6: Confirm (four-step checklist)
|
|
121
|
+
|
|
122
|
+
1. **Run the new test** — it passes now
|
|
123
|
+
2. **Run the full test suite** — nothing else regressed
|
|
124
|
+
3. **Re-run the original reproduction** — the symptom is gone
|
|
125
|
+
4. **Verify against the user's report** — does this resolve what they actually
|
|
126
|
+
described? (A test passing is necessary but not sufficient — confirm the
|
|
127
|
+
*symptom* the user reported is gone.)
|
|
128
|
+
|
|
129
|
+
If any step fails, return to diagnosis. Do not ship a fix you can't confirm works.
|
|
130
|
+
|
|
131
|
+
**Test integrity during Phase 6.** If running the full suite surfaces
|
|
132
|
+
*other* failing tests:
|
|
133
|
+
|
|
134
|
+
- Bad tests (stale fixtures, drifted assertions, broken mocks) → fix
|
|
135
|
+
in-session if the fix is small and scoped to this bug's surface area;
|
|
136
|
+
otherwise park.
|
|
137
|
+
- Pre-existing real production bugs → park via `/agile-workflow:park`.
|
|
138
|
+
Do NOT bundle them into this fix's commit; this skill is for *one*
|
|
139
|
+
bug.
|
|
140
|
+
- NEVER make a test pass by weakening its assertion or silencing it
|
|
141
|
+
without a documented reason. The regression test you wrote in Phase 3
|
|
142
|
+
must verify behavior, not "whatever the code returns now".
|
|
143
|
+
|
|
144
|
+
### Phase 7: Advance to review and commit
|
|
145
|
+
|
|
146
|
+
1. Update story stage: `implementing → review`. The PostToolUse hook auto-bumps `updated:`.
|
|
147
|
+
2. Append an "Implementation notes" section to the story body capturing:
|
|
148
|
+
- Files changed
|
|
149
|
+
- Test added
|
|
150
|
+
- Adjacent issues parked (with their backlog ids)
|
|
151
|
+
3. Commit:
|
|
152
|
+
```bash
|
|
153
|
+
git add .work/active/stories/<id>.md <changed-files> <test-file>
|
|
154
|
+
git commit -m "fix: <short description> (<story-id>)"
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Output
|
|
158
|
+
|
|
159
|
+
Brief report in conversation:
|
|
160
|
+
- **Story**: `<id>` at `stage: review`
|
|
161
|
+
- **Root cause**: one sentence
|
|
162
|
+
- **Fix**: file(s) changed
|
|
163
|
+
- **Test**: file path, what it asserts
|
|
164
|
+
- **Parked for separate consideration**: any adjacent issues you noticed but didn't bundle
|
|
165
|
+
|
|
166
|
+
## Guardrails
|
|
167
|
+
|
|
168
|
+
- Do NOT skip the test (Phase 3). Fixes without tests recur.
|
|
169
|
+
- Do NOT bundle refactoring or unrelated improvements into the fix's commit.
|
|
170
|
+
- Do NOT advance the story past `review` — the user reviews and runs
|
|
171
|
+
`/agile-workflow:review` to advance to `done`.
|
|
172
|
+
- If the fix would touch > 5 files or change a public interface, stop. This isn't a
|
|
173
|
+
fix; it's a feature with refactor implications. Use `/agile-workflow:scope` instead.
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gate-cruft
|
|
3
|
+
description: >
|
|
4
|
+
Cruft gate that scans the items bound to a release for AI-accumulated debris (dead code, stale
|
|
5
|
+
comments, compatibility shims, defensive bloat, over-abstraction) introduced or revealed by the
|
|
6
|
+
bundle. Delegates the full scan to a deep cleanup scanner agent which runs language-aware
|
|
7
|
+
detection plus heuristic pattern-matching, then returns findings. The orchestrator converts findings
|
|
8
|
+
into items in .work/active/ with gate_origin:cruft and tags:[cleanup]. Auto-triggers during
|
|
9
|
+
/agile-workflow:release-deploy.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Gate-Cruft
|
|
13
|
+
|
|
14
|
+
You orchestrate a cruft gate over the items bound to a release. The actual
|
|
15
|
+
scan runs inside a **deep cleanup scanner agent** (a generic sub-agent prompted with the scanner posture from `../principles/references/subagents.md`); your role is to prepare the bundle context,
|
|
16
|
+
dispatch the scanner, and convert the findings it returns into items in the
|
|
17
|
+
substrate. Findings get `gate_origin: cruft`,
|
|
18
|
+
`tags: [cleanup]`, with severity tier shaping the stage.
|
|
19
|
+
|
|
20
|
+
Scanner strength is explicit: spawn exactly one source-read-only deep cleanup
|
|
21
|
+
scanner with the strongest inspection/reviewer setting the host exposes. Use a generic sub-agent prompted with the scanner posture from `../principles/references/subagents.md`. Use extra-high reasoning
|
|
22
|
+
for large or polyglot release bundles. If the host has no scanner path,
|
|
23
|
+
run the audit inline and record the reduced isolation in the release body.
|
|
24
|
+
|
|
25
|
+
## Trigger
|
|
26
|
+
|
|
27
|
+
- `/agile-workflow:release-deploy` invokes during `quality-gate` stage
|
|
28
|
+
- User can invoke manually: `/agile-workflow:gate-cruft <release-version>`
|
|
29
|
+
|
|
30
|
+
## Workflow
|
|
31
|
+
|
|
32
|
+
### Phase 1: Identify bundle changes
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Bound non-release items. `--release` auto-widens to ALL tiers (active + archive + releases).
|
|
36
|
+
# Include late-bound archived stubs; their bodies may be pruned, but their item id is still
|
|
37
|
+
# present and can recover the bundle commits/files. Ignore only the release orchestration item.
|
|
38
|
+
.work/bin/work-view --release <version> --paths | while IFS= read -r item; do
|
|
39
|
+
kind=$(grep -m1 '^kind:' "$item" | awk '{print $2}')
|
|
40
|
+
[ "$kind" = "release" ] && continue
|
|
41
|
+
echo "$item"
|
|
42
|
+
done > /tmp/bundle-items-<version>.txt
|
|
43
|
+
|
|
44
|
+
# Files changed by the bundle. For archived stubs, the body is pruned on disk by design; use the
|
|
45
|
+
# item id to find implementation commits instead of treating the missing body as a skip reason.
|
|
46
|
+
while IFS= read -r item; do
|
|
47
|
+
id=$(grep -m1 '^id:' "$item" | awk '{print $2}')
|
|
48
|
+
git log --grep "$id" --format='%H' | xargs -I{} git diff-tree --no-commit-id --name-only -r {}
|
|
49
|
+
done < /tmp/bundle-items-<version>.txt | sort -u > /tmp/bundle-files-<version>.txt
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Phase 2: Read existing gate items (idempotency prep)
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
.work/bin/work-view --release <version> --gate cruft --paths
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Capture the set of `(file:line, category)` already-tracked findings to feed
|
|
59
|
+
into the scanner brief.
|
|
60
|
+
|
|
61
|
+
### Phase 3: Dispatch the cruft scanner
|
|
62
|
+
|
|
63
|
+
Spawn ONE source-read-only deep scanner agent with the full scan brief. Use a generic sub-agent prompted with the scanner posture from `../principles/references/subagents.md` and the strongest
|
|
64
|
+
inspection/reviewer setting the host exposes, escalating for large or polyglot
|
|
65
|
+
bundles. If scanner agents are unavailable, run the audit inline and record
|
|
66
|
+
the reduced isolation in the release body. The scanner does ecosystem detection,
|
|
67
|
+
runs language-aware tools, applies heuristic pattern-matching, triages
|
|
68
|
+
confidence, and returns structured findings.
|
|
69
|
+
|
|
70
|
+
**Brief template**:
|
|
71
|
+
|
|
72
|
+
> You are conducting a cruft scan for release `<version>` as an agile-workflow
|
|
73
|
+
> scanner. Use read/search/shell tools as needed. Audit ONLY the bundle's
|
|
74
|
+
> changed files — not the whole repo. Do not spawn nested sub-agents or implement
|
|
75
|
+
> fixes.
|
|
76
|
+
>
|
|
77
|
+
> **Bundle scope**:
|
|
78
|
+
> ```
|
|
79
|
+
> <bundle-files>
|
|
80
|
+
> ```
|
|
81
|
+
>
|
|
82
|
+
> **Already-tracked findings to skip**:
|
|
83
|
+
> ```
|
|
84
|
+
> <already-tracked file:line / category pairs>
|
|
85
|
+
> ```
|
|
86
|
+
>
|
|
87
|
+
> **Methodology**:
|
|
88
|
+
>
|
|
89
|
+
> 1. **Ecosystem discovery** — examine `package.json`, `tsconfig.json`,
|
|
90
|
+
> `Cargo.toml`, `go.mod`, `pyproject.toml`, `Makefile`. This determines
|
|
91
|
+
> which language-aware detection tools are available.
|
|
92
|
+
>
|
|
93
|
+
> 2. **Language-aware detection (high confidence)** — run against the
|
|
94
|
+
> bundle's changed files only:
|
|
95
|
+
> - **TypeScript/JavaScript** — `tsc --noUnusedLocals --noUnusedParameters
|
|
96
|
+
> --noEmit`, eslint unused rules
|
|
97
|
+
> - **Python** — `ruff check --select F811,F841,F401`, `vulture`
|
|
98
|
+
> - **Go** — `go vet`, `deadcode`
|
|
99
|
+
> - **Rust** — compiler warnings for `#[warn(dead_code)]`
|
|
100
|
+
> Capture output and parse into findings.
|
|
101
|
+
>
|
|
102
|
+
> 3. **Heuristic pattern-matching** via Grep on bundle files:
|
|
103
|
+
>
|
|
104
|
+
> **Medium confidence:**
|
|
105
|
+
> - Comments containing "removed", "backwards compat", "for backwards
|
|
106
|
+
> compatibility", "deprecated", "TODO" where the work is clearly done,
|
|
107
|
+
> "FIXME" for fixed code
|
|
108
|
+
> - Re-exports that nothing imports (cross-check with Grep)
|
|
109
|
+
> - Variables prefixed with `_` that were renamed to suppress warnings
|
|
110
|
+
> - Empty catch/except blocks with "// ignore" style comments
|
|
111
|
+
> - Wrapper functions that just call through to one other function with no
|
|
112
|
+
> added logic
|
|
113
|
+
>
|
|
114
|
+
> **Low confidence:**
|
|
115
|
+
> - Try/catch around code that cannot throw
|
|
116
|
+
> - Validation of internal-only inputs at non-boundary functions
|
|
117
|
+
> - Single-use helper functions that could be inlined
|
|
118
|
+
> - Config/options parameters that only ever receive one value
|
|
119
|
+
> - Abstractions with a single implementation
|
|
120
|
+
>
|
|
121
|
+
> 4. **Cross-check existing patterns** — read `.agents/skills/patterns/` and
|
|
122
|
+
> legacy `.claude/skills/patterns/` if
|
|
123
|
+
> present. Intentional repetition documented as a pattern is NOT cruft.
|
|
124
|
+
>
|
|
125
|
+
> 5. **Triage by confidence**:
|
|
126
|
+
> | Confidence | Stage of produced item |
|
|
127
|
+
> |---|---|
|
|
128
|
+
> | High (tool-detected) | `stage: implementing` |
|
|
129
|
+
> | Medium (pattern-matched) | `stage: drafting` |
|
|
130
|
+
> | Low (judgment calls) | backlog file |
|
|
131
|
+
>
|
|
132
|
+
> **Output format** — return a single markdown document with:
|
|
133
|
+
>
|
|
134
|
+
> ```
|
|
135
|
+
> ## Findings
|
|
136
|
+
>
|
|
137
|
+
> ### Finding 1
|
|
138
|
+
> - **Title**: <one-line description>
|
|
139
|
+
> - **Confidence**: High | Medium | Low
|
|
140
|
+
> - **Category**: unused import | dead function | stale comment |
|
|
141
|
+
> compatibility shim | passthrough wrapper | defensive try/catch |
|
|
142
|
+
> single-use helper | over-abstraction
|
|
143
|
+
> - **Location**: `<file>:<line>`
|
|
144
|
+
> - **Evidence**:
|
|
145
|
+
> ```<lang>
|
|
146
|
+
> <the offending code, 1-10 lines>
|
|
147
|
+
> ```
|
|
148
|
+
> - **Removal**: <what to remove and what to fix in surroundings>
|
|
149
|
+
>
|
|
150
|
+
> ### Finding 2
|
|
151
|
+
> ...
|
|
152
|
+
> ```
|
|
153
|
+
>
|
|
154
|
+
> Followed by:
|
|
155
|
+
>
|
|
156
|
+
> ```
|
|
157
|
+
> ## Scan summary
|
|
158
|
+
> - Ecosystem: <one-line>
|
|
159
|
+
> - Tools run: <list>
|
|
160
|
+
> - Files scanned: <count>
|
|
161
|
+
> - Findings by confidence: High=<n>, Medium=<n>, Low=<n>
|
|
162
|
+
> ```
|
|
163
|
+
>
|
|
164
|
+
> **Rules**:
|
|
165
|
+
> - Scan only Bundle scope. Don't expand.
|
|
166
|
+
> - Cite file:line for every finding.
|
|
167
|
+
> - Don't fabricate. If a tool produces no output, don't invent findings.
|
|
168
|
+
> - Skip already-tracked. Patterns documented in
|
|
169
|
+
> `.agents/skills/patterns/` or legacy `.claude/skills/patterns/` are
|
|
170
|
+
> intentional, not cruft.
|
|
171
|
+
> - Don't propose findings you can't verify (e.g. "is this exported function
|
|
172
|
+
> used externally?" — if you can't confirm zero callers, downgrade to
|
|
173
|
+
> medium confidence rather than high).
|
|
174
|
+
|
|
175
|
+
### Phase 4: Convert findings to items
|
|
176
|
+
|
|
177
|
+
For each finding the scanner returned:
|
|
178
|
+
|
|
179
|
+
Read `gate_finding_routing` from `.work/CONVENTIONS.md` before writing items.
|
|
180
|
+
If absent, use the default routing below. Normalize cruft confidence to routing
|
|
181
|
+
keys as: `High -> high`, `Medium -> medium`, and `Low -> low`. If a normalized
|
|
182
|
+
key maps to `skip`, do not emit an item for that finding; include the skipped
|
|
183
|
+
count in the gate output. If it maps to `backlog`, write a `.work/backlog/`
|
|
184
|
+
item instead of an active story.
|
|
185
|
+
|
|
186
|
+
```yaml
|
|
187
|
+
---
|
|
188
|
+
id: gate-cruft-<short-slug>
|
|
189
|
+
kind: story
|
|
190
|
+
stage: implementing | drafting # by confidence
|
|
191
|
+
tags: [cleanup]
|
|
192
|
+
parent: null
|
|
193
|
+
depends_on: []
|
|
194
|
+
release_binding: <version>
|
|
195
|
+
gate_origin: cruft
|
|
196
|
+
created: YYYY-MM-DD
|
|
197
|
+
updated: YYYY-MM-DD
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
# <one-line description>
|
|
201
|
+
|
|
202
|
+
## Confidence
|
|
203
|
+
High | Medium | Low
|
|
204
|
+
|
|
205
|
+
## Category
|
|
206
|
+
<category>
|
|
207
|
+
|
|
208
|
+
## Location
|
|
209
|
+
`<file>:<line>`
|
|
210
|
+
|
|
211
|
+
## Evidence
|
|
212
|
+
\`\`\`<lang>
|
|
213
|
+
<the offending code, 1-10 lines>
|
|
214
|
+
\`\`\`
|
|
215
|
+
|
|
216
|
+
## Removal
|
|
217
|
+
<what to remove and what to fix in the surroundings — imports, whitespace, etc.>
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Default confidence -> placement mapping:
|
|
221
|
+
- **High** → `stage: implementing` in `.work/active/stories/`
|
|
222
|
+
- **Medium** → `stage: drafting` in `.work/active/stories/`
|
|
223
|
+
- **Low** → backlog file in `.work/backlog/`
|
|
224
|
+
|
|
225
|
+
### Phase 5: Commit
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
git add .work/active/stories/ .work/backlog/
|
|
229
|
+
git commit -m "gate-cruft: <N> findings for <version>"
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Output
|
|
233
|
+
|
|
234
|
+
In conversation:
|
|
235
|
+
- **Bundle**: `<version>` — `<N>` items audited, `<M>` files changed
|
|
236
|
+
- **Findings**: count by confidence (High / Medium / Low)
|
|
237
|
+
- **Items created**: count, with new ids
|
|
238
|
+
- **Already-tracked**: count skipped
|
|
239
|
+
|
|
240
|
+
If the count of cleanup items is large (> 20), suggest the user implement them
|
|
241
|
+
in a single orchestrated pass: "These items can be drained efficiently via
|
|
242
|
+
`/agile-workflow:implement-orchestrator` against a parent feature, OR by
|
|
243
|
+
starting an autopilot goal scoped to gate-cruft items. Cleanup is mechanical
|
|
244
|
+
and parallelizes well."
|
|
245
|
+
|
|
246
|
+
## Guardrails
|
|
247
|
+
|
|
248
|
+
- **The scan happens in the scanner agent, not here.** Your job is bundle
|
|
249
|
+
prep, dispatch, and item-writing. Don't replicate the scanner's analysis.
|
|
250
|
+
- Audit only the bundle's changed files, not the whole repo.
|
|
251
|
+
- Never remove code in this skill — produce items only.
|
|
252
|
+
- Cleanup items must be surgical when implemented. They remove cruft and fix
|
|
253
|
+
the immediate surroundings only. They do NOT improve, refactor, or enhance.
|
|
254
|
+
- Patterns documented in `.agents/skills/patterns/` or legacy
|
|
255
|
+
`.claude/skills/patterns/` are intentional, not
|
|
256
|
+
cruft. The scanner cross-checks; don't override.
|
|
257
|
+
- Pass already-tracked findings into the scanner brief so it skips
|
|
258
|
+
duplicates.
|