bigpowers 2.2.0 → 2.4.0

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.
Files changed (147) hide show
  1. package/.pi/package.json +16 -0
  2. package/.pi/prompts/assess-impact.md +76 -0
  3. package/.pi/prompts/audit-code.md +156 -0
  4. package/.pi/prompts/build-epic.md +44 -0
  5. package/.pi/prompts/change-request.md +105 -0
  6. package/.pi/prompts/commit-message.md +135 -0
  7. package/.pi/prompts/compose-workflow.md +40 -0
  8. package/.pi/prompts/craft-skill.md +150 -0
  9. package/.pi/prompts/deepen-architecture.md +235 -0
  10. package/.pi/prompts/define-language.md +79 -0
  11. package/.pi/prompts/define-success.md +62 -0
  12. package/.pi/prompts/delegate-task.md +76 -0
  13. package/.pi/prompts/design-interface.md +96 -0
  14. package/.pi/prompts/develop-tdd.md +375 -0
  15. package/.pi/prompts/diagnose-root.md +23 -0
  16. package/.pi/prompts/dispatch-agents.md +83 -0
  17. package/.pi/prompts/edit-document.md +22 -0
  18. package/.pi/prompts/elaborate-spec.md +81 -0
  19. package/.pi/prompts/enforce-first.md +77 -0
  20. package/.pi/prompts/evolve-skill.md +38 -0
  21. package/.pi/prompts/execute-plan.md +54 -0
  22. package/.pi/prompts/fix-bug.md +36 -0
  23. package/.pi/prompts/grill-me.md +95 -0
  24. package/.pi/prompts/grill-with-docs.md +37 -0
  25. package/.pi/prompts/guard-git.md +212 -0
  26. package/.pi/prompts/hook-commits.md +93 -0
  27. package/.pi/prompts/inspect-quality.md +105 -0
  28. package/.pi/prompts/investigate-bug.md +117 -0
  29. package/.pi/prompts/kickoff-branch.md +99 -0
  30. package/.pi/prompts/map-codebase.md +70 -0
  31. package/.pi/prompts/migrate-spec.md +482 -0
  32. package/.pi/prompts/model-domain.md +227 -0
  33. package/.pi/prompts/orchestrate-project.md +161 -0
  34. package/.pi/prompts/organize-workspace.md +159 -0
  35. package/.pi/prompts/plan-refactor.md +77 -0
  36. package/.pi/prompts/plan-release.md +145 -0
  37. package/.pi/prompts/plan-work.md +161 -0
  38. package/.pi/prompts/release-branch.md +158 -0
  39. package/.pi/prompts/request-review.md +70 -0
  40. package/.pi/prompts/research-first.md +62 -0
  41. package/.pi/prompts/reset-baseline.md +20 -0
  42. package/.pi/prompts/respond-review.md +70 -0
  43. package/.pi/prompts/run-evals.md +56 -0
  44. package/.pi/prompts/run-planning.md +26 -0
  45. package/.pi/prompts/scope-work.md +23 -0
  46. package/.pi/prompts/search-skills.md +21 -0
  47. package/.pi/prompts/seed-conventions.md +132 -0
  48. package/.pi/prompts/session-state.md +146 -0
  49. package/.pi/prompts/setup-environment.md +23 -0
  50. package/.pi/prompts/simulate-agents.md +25 -0
  51. package/.pi/prompts/slice-tasks.md +23 -0
  52. package/.pi/prompts/spike-prototype.md +94 -0
  53. package/.pi/prompts/stocktake-skills.md +40 -0
  54. package/.pi/prompts/survey-context.md +129 -0
  55. package/.pi/prompts/terse-mode.md +37 -0
  56. package/.pi/prompts/trace-requirement.md +68 -0
  57. package/.pi/prompts/using-bigpowers.md +105 -0
  58. package/.pi/prompts/validate-fix.md +98 -0
  59. package/.pi/prompts/verify-work.md +125 -0
  60. package/.pi/prompts/visual-dashboard.md +51 -0
  61. package/.pi/prompts/wire-observability.md +92 -0
  62. package/.pi/prompts/write-document.md +244 -0
  63. package/.pi/skills/assess-impact/SKILL.md +77 -0
  64. package/.pi/skills/audit-code/SKILL.md +157 -0
  65. package/.pi/skills/build-epic/SKILL.md +45 -0
  66. package/.pi/skills/change-request/SKILL.md +106 -0
  67. package/.pi/skills/commit-message/SKILL.md +136 -0
  68. package/.pi/skills/compose-workflow/SKILL.md +41 -0
  69. package/.pi/skills/craft-skill/SKILL.md +151 -0
  70. package/.pi/skills/deepen-architecture/SKILL.md +236 -0
  71. package/.pi/skills/define-language/SKILL.md +80 -0
  72. package/.pi/skills/define-success/SKILL.md +63 -0
  73. package/.pi/skills/delegate-task/SKILL.md +77 -0
  74. package/.pi/skills/design-interface/SKILL.md +97 -0
  75. package/.pi/skills/develop-tdd/SKILL.md +376 -0
  76. package/.pi/skills/diagnose-root/SKILL.md +24 -0
  77. package/.pi/skills/dispatch-agents/SKILL.md +84 -0
  78. package/.pi/skills/edit-document/SKILL.md +23 -0
  79. package/.pi/skills/elaborate-spec/SKILL.md +82 -0
  80. package/.pi/skills/enforce-first/SKILL.md +78 -0
  81. package/.pi/skills/evolve-skill/SKILL.md +39 -0
  82. package/.pi/skills/execute-plan/SKILL.md +55 -0
  83. package/.pi/skills/fix-bug/SKILL.md +37 -0
  84. package/.pi/skills/grill-me/SKILL.md +96 -0
  85. package/.pi/skills/grill-with-docs/SKILL.md +38 -0
  86. package/.pi/skills/guard-git/SKILL.md +213 -0
  87. package/.pi/skills/hook-commits/SKILL.md +94 -0
  88. package/.pi/skills/inspect-quality/SKILL.md +106 -0
  89. package/.pi/skills/investigate-bug/SKILL.md +118 -0
  90. package/.pi/skills/kickoff-branch/SKILL.md +100 -0
  91. package/.pi/skills/map-codebase/SKILL.md +71 -0
  92. package/.pi/skills/migrate-spec/SKILL.md +483 -0
  93. package/.pi/skills/model-domain/SKILL.md +228 -0
  94. package/.pi/skills/orchestrate-project/SKILL.md +162 -0
  95. package/.pi/skills/organize-workspace/SKILL.md +160 -0
  96. package/.pi/skills/plan-refactor/SKILL.md +78 -0
  97. package/.pi/skills/plan-release/SKILL.md +146 -0
  98. package/.pi/skills/plan-work/SKILL.md +162 -0
  99. package/.pi/skills/release-branch/SKILL.md +159 -0
  100. package/.pi/skills/request-review/SKILL.md +71 -0
  101. package/.pi/skills/research-first/SKILL.md +63 -0
  102. package/.pi/skills/reset-baseline/SKILL.md +21 -0
  103. package/.pi/skills/respond-review/SKILL.md +71 -0
  104. package/.pi/skills/run-evals/SKILL.md +57 -0
  105. package/.pi/skills/run-planning/SKILL.md +27 -0
  106. package/.pi/skills/scope-work/SKILL.md +24 -0
  107. package/.pi/skills/search-skills/SKILL.md +22 -0
  108. package/.pi/skills/seed-conventions/SKILL.md +133 -0
  109. package/.pi/skills/session-state/SKILL.md +147 -0
  110. package/.pi/skills/setup-environment/SKILL.md +24 -0
  111. package/.pi/skills/simulate-agents/SKILL.md +26 -0
  112. package/.pi/skills/slice-tasks/SKILL.md +24 -0
  113. package/.pi/skills/spike-prototype/SKILL.md +95 -0
  114. package/.pi/skills/stocktake-skills/SKILL.md +41 -0
  115. package/.pi/skills/survey-context/SKILL.md +130 -0
  116. package/.pi/skills/terse-mode/SKILL.md +38 -0
  117. package/.pi/skills/trace-requirement/SKILL.md +69 -0
  118. package/.pi/skills/using-bigpowers/SKILL.md +106 -0
  119. package/.pi/skills/validate-fix/SKILL.md +99 -0
  120. package/.pi/skills/verify-work/SKILL.md +126 -0
  121. package/.pi/skills/visual-dashboard/SKILL.md +52 -0
  122. package/.pi/skills/wire-observability/SKILL.md +93 -0
  123. package/.pi/skills/write-document/SKILL.md +245 -0
  124. package/CHANGELOG.md +14 -0
  125. package/README.md +27 -1
  126. package/deepen-architecture/SKILL.md +2 -0
  127. package/define-language/SKILL.md +2 -0
  128. package/diagnose-root/SKILL.md +2 -0
  129. package/edit-document/SKILL.md +2 -0
  130. package/fix-bug/SKILL.md +3 -1
  131. package/grill-me/SKILL.md +3 -1
  132. package/grill-with-docs/SKILL.md +3 -1
  133. package/investigate-bug/SKILL.md +5 -11
  134. package/map-codebase/SKILL.md +3 -1
  135. package/model-domain/SKILL.md +2 -0
  136. package/package.json +11 -2
  137. package/plan-release/SKILL.md +1 -1
  138. package/plan-work/SKILL.md +3 -1
  139. package/release-branch/SKILL.md +4 -2
  140. package/run-planning/SKILL.md +3 -2
  141. package/scope-work/SKILL.md +3 -1
  142. package/scripts/sync-skills.sh +48 -3
  143. package/scripts/validate-doctrine.sh +24 -9
  144. package/seed-conventions/SKILL.md +2 -0
  145. package/slice-tasks/SKILL.md +3 -1
  146. package/survey-context/SKILL.md +3 -1
  147. package/write-document/SKILL.md +2 -0
@@ -0,0 +1,227 @@
1
+ ---
2
+ description: Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates specs/tech-architecture/tech-stack.md and specs/adr/ inline as decisions crystallise. Use when user wants to stress-test a plan against their project's domain language and documented decisions.
3
+ ---
4
+
5
+
6
+ # Model Domain
7
+
8
+ **Distinct from `define-language` and `deepen-architecture`:** Use this skill to stress-test a plan through a grilling interview that resolves domain model decisions and captures invariants. Use `define-language` to produce a canonical glossary of terms. Use `deepen-architecture` to find module-level refactoring opportunities in code.
9
+
10
+ Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
11
+
12
+ > **HARD GATE** — Capture invariants (what MUST always be true) and state machines (what transitions are legal) for core entities. If these are fuzzy, design will fail.
13
+
14
+ Ask the questions one at a time, waiting for feedback on each question before continuing.
15
+
16
+ If a question can be answered by exploring the codebase, explore the codebase instead.
17
+
18
+ ## Domain awareness
19
+
20
+ During codebase exploration, also look for existing documentation:
21
+
22
+ ### File structure
23
+
24
+ Most repos have a single context:
25
+
26
+ ```
27
+ /
28
+ ├── specs/
29
+ │ ├── CONTEXT.md
30
+ │ └── adr/
31
+ │ ├── 0001-event-sourced-orders.md
32
+ │ └── 0002-postgres-for-write-model.md
33
+ └── src/
34
+ ```
35
+
36
+ If a `specs/tech-architecture/tech-stack.md` exists, the repo has multiple contexts. The map points to where each one lives:
37
+
38
+ ```
39
+ /
40
+ ├── specs/
41
+ │ ├── CONTEXT-MAP.md
42
+ │ └── adr/ ← system-wide decisions
43
+ └── src/
44
+ ├── ordering/
45
+ │ └── specs/
46
+ │ ├── CONTEXT.md
47
+ │ └── adr/ ← context-specific decisions
48
+ └── billing/
49
+ └── specs/
50
+ ├── CONTEXT.md
51
+ └── adr/
52
+ ```
53
+
54
+ Create files lazily — only when you have something to write. If no `specs/tech-architecture/tech-stack.md` exists, create it when the first term is resolved. If no `specs/adr/` exists, create it when the first ADR is needed.
55
+
56
+ ## During the session
57
+
58
+ ### Challenge against the glossary
59
+
60
+ When the user uses a term that conflicts with the existing language in `specs/tech-architecture/tech-stack.md`, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y — which is it?"
61
+
62
+ ### Sharpen fuzzy language
63
+
64
+ When the user uses vague or overloaded terms, propose a precise canonical term. "You're saying 'account' — do you mean the Customer or the User? Those are different things."
65
+
66
+ ### Discuss concrete scenarios
67
+
68
+ When domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force the user to be precise about the boundaries between concepts.
69
+
70
+ ### Cross-reference with code
71
+
72
+ When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: "Your code cancels entire Orders, but you just said partial cancellation is possible — which is right?"
73
+
74
+ ### Update specs/tech-architecture/tech-stack.md inline
75
+
76
+ When a term is resolved, update `specs/tech-architecture/tech-stack.md` right there. Don't batch these up — capture them as they happen. Use the format in [CONTEXT-FORMAT.md](./CONTEXT-FORMAT.md).
77
+
78
+ Don't couple `specs/tech-architecture/tech-stack.md` to implementation details. Only include terms that are meaningful to domain experts.
79
+
80
+ ### Offer ADRs sparingly
81
+
82
+ Only offer to create an ADR when all three are true:
83
+
84
+ 1. **Hard to reverse** — the cost of changing your mind later is meaningful
85
+ 2. **Surprising without context** — a future reader will wonder "why did they do it this way?"
86
+ 3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
87
+
88
+ If any of the three is missing, skip the ADR. Use the format in [ADR-FORMAT.md](./ADR-FORMAT.md).
89
+
90
+ ## Concurrency safety audit
91
+
92
+ When the plan touches shared state, async, or multi-threaded code:
93
+
94
+ - [ ] List every **shared mutable** location (globals, singletons, module-level caches).
95
+ - [ ] For each: who reads, who writes, synchronization mechanism (lock, actor, immutable copy).
96
+ - [ ] Flag **race risks** (check-then-act, non-atomic read-modify-write) with severity.
97
+ - [ ] Record findings in `specs/tech-architecture/tech-stack.md` under `## Concurrency` or in an ADR if architectural.
98
+
99
+ ---
100
+
101
+ # ADR Format
102
+
103
+ ADRs live in `docs/adr/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc.
104
+
105
+ Create the `docs/adr/` directory lazily — only when the first ADR is needed.
106
+
107
+ ## Template
108
+
109
+ ```md
110
+ # {Short title of the decision}
111
+
112
+ {1-3 sentences: what's the context, what did we decide, and why.}
113
+ ```
114
+
115
+ That's it. An ADR can be a single paragraph. The value is in recording *that* a decision was made and *why* — not in filling out sections.
116
+
117
+ ## Optional sections
118
+
119
+ Only include these when they add genuine value. Most ADRs won't need them.
120
+
121
+ - **Status** frontmatter (`proposed | accepted | deprecated | superseded by ADR-NNNN`) — useful when decisions are revisited
122
+ - **Considered Options** — only when the rejected alternatives are worth remembering
123
+ - **Consequences** — only when non-obvious downstream effects need to be called out
124
+
125
+ ## Numbering
126
+
127
+ Scan `docs/adr/` for the highest existing number and increment by one.
128
+
129
+ ## When to offer an ADR
130
+
131
+ All three of these must be true:
132
+
133
+ 1. **Hard to reverse** — the cost of changing your mind later is meaningful
134
+ 2. **Surprising without context** — a future reader will look at the code and wonder "why on earth did they do it this way?"
135
+ 3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
136
+
137
+ If a decision is easy to reverse, skip it — you'll just reverse it. If it's not surprising, nobody will wonder why. If there was no real alternative, there's nothing to record beyond "we did the obvious thing."
138
+
139
+ ### What qualifies
140
+
141
+ - **Architectural shape.** "We're using a monorepo." "The write model is event-sourced, the read model is projected into Postgres."
142
+ - **Integration patterns between contexts.** "Ordering and Billing communicate via domain events, not synchronous HTTP."
143
+ - **Technology choices that carry lock-in.** Database, message bus, auth provider, deployment target. Not every library — just the ones that would take a quarter to swap out.
144
+ - **Boundary and scope decisions.** "Customer data is owned by the Customer context; other contexts reference it by ID only." The explicit no-s are as valuable as the yes-s.
145
+ - **Deliberate deviations from the obvious path.** "We're using manual SQL instead of an ORM because X." Anything where a reasonable reader would assume the opposite. These stop the next engineer from "fixing" something that was deliberate.
146
+ - **Constraints not visible in the code.** "We can't use AWS because of compliance requirements." "Response times must be under 200ms because of the partner API contract."
147
+ - **Rejected alternatives when the rejection is non-obvious.** If you considered GraphQL and picked REST for subtle reasons, record it — otherwise someone will suggest GraphQL again in six months.
148
+
149
+ ---
150
+
151
+ # CONTEXT.md Format
152
+
153
+ ## Structure
154
+
155
+ ```md
156
+ # {Context Name}
157
+
158
+ {One or two sentence description of what this context is and why it exists.}
159
+
160
+ ## Language
161
+
162
+ **Order**:
163
+ A customer's request to purchase one or more items.
164
+ _Avoid_: Purchase, transaction
165
+
166
+ **Invoice**:
167
+ A request for payment sent to a customer after delivery.
168
+ _Avoid_: Bill, payment request
169
+
170
+ **Customer**:
171
+ A person or organization that places orders.
172
+ _Avoid_: Client, buyer, account
173
+
174
+ ## Relationships
175
+
176
+ - An **Order** produces one or more **Invoices**
177
+ - An **Invoice** belongs to exactly one **Customer**
178
+
179
+ ## Example dialogue
180
+
181
+ > **Dev:** "When a **Customer** places an **Order**, do we create the **Invoice** immediately?"
182
+ > **Domain expert:** "No — an **Invoice** is only generated once a **Fulfillment** is confirmed."
183
+
184
+ ## Flagged ambiguities
185
+
186
+ - "account" was used to mean both **Customer** and **User** — resolved: these are distinct concepts.
187
+ ```
188
+
189
+ ## Rules
190
+
191
+ - **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others as aliases to avoid.
192
+ - **Flag conflicts explicitly.** If a term is used ambiguously, call it out in "Flagged ambiguities" with a clear resolution.
193
+ - **Keep definitions tight.** One sentence max. Define what it IS, not what it does.
194
+ - **Show relationships.** Use bold term names and express cardinality where obvious.
195
+ - **Only include terms specific to this project's context.** General programming concepts (timeouts, error types, utility patterns) don't belong even if the project uses them extensively. Before adding a term, ask: is this a concept unique to this context, or a general programming concept? Only the former belongs.
196
+ - **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.
197
+ - **Write an example dialogue.** A conversation between a dev and a domain expert that demonstrates how the terms interact naturally and clarifies boundaries between related concepts.
198
+
199
+ ## Single vs multi-context repos
200
+
201
+ **Single context (most repos):** One `CONTEXT.md` at the repo root.
202
+
203
+ **Multiple contexts:** A `CONTEXT-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
204
+
205
+ ```md
206
+ # Context Map
207
+
208
+ ## Contexts
209
+
210
+ - [Ordering](./src/ordering/CONTEXT.md) — receives and tracks customer orders
211
+ - [Billing](./src/billing/CONTEXT.md) — generates invoices and processes payments
212
+ - [Fulfillment](./src/fulfillment/CONTEXT.md) — manages warehouse picking and shipping
213
+
214
+ ## Relationships
215
+
216
+ - **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking
217
+ - **Fulfillment → Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices
218
+ - **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`
219
+ ```
220
+
221
+ The skill infers which structure applies:
222
+
223
+ - If `CONTEXT-MAP.md` exists, read it to find contexts
224
+ - If only a root `CONTEXT.md` exists, single context
225
+ - If neither exists, create a root `CONTEXT.md` lazily when the first term is resolved
226
+
227
+ When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.
@@ -0,0 +1,161 @@
1
+ ---
2
+ description: Meta-skill that enforces the 6-phase core loop (discover → elaborate → plan → build → verify → release) with hard gates. Use to coordinate multi-phase projects with guaranteed quality checkpoints. One-time command for the entire project lifecycle.
3
+ ---
4
+
5
+
6
+ # Orchestrate
7
+ > **HARD GATE** — **HARD GATE** — Do NOT invoke orchestrate-project unless you have a clear multi-phase workflow. Single-skill tasks should use dedicated skills instead. Orchestrate is for complex, multi-stage work that requires coordination across phases.
8
+
9
+
10
+ The orchestrate skill coordinates projects through a prescriptive 6-phase core loop with hard gates, ensuring consistent quality and preventing scope creep.
11
+
12
+ ## Quick Start
13
+
14
+ ```bash
15
+ # Start a new project (initializes specs/ YAML cockpit and begins discover phase)
16
+ claude /orchestrate --mode standard
17
+
18
+ # Or resume an existing project at the current phase
19
+ claude /orchestrate --mode standard --resume
20
+
21
+ # For low-risk scenarios (hotfixes, refactors on well-tested code)
22
+ claude /orchestrate --mode fast-track
23
+ ```
24
+
25
+ ## The 6-Phase Core Loop
26
+
27
+ 1. **DISCOVER** (3-6 hours): Understand problem. Deliverables: `requirements/VISION_LATEST.yaml`, `requirements/SCOPE_LATEST.yaml`, `plans/TECH_STACK_LATEST.md`.
28
+ 2. **ELABORATE** (3-6 hours): Research solutions. Deliverables: Prior art in scope YAML, ADRs in `specs/adr/`.
29
+ 3. **PLAN** (2-4 hours): Write verifiable plan. Deliverables: `release-plan.yaml`, `epics/eNN-*.yaml` with `verify:` per task.
30
+ 4. **BUILD** (1-8 hours): Execute plan. Runs build-epic once per story in WSJF order. Deliverables: Code; update `execution-status.yaml`.
31
+ 5. **VERIFY** (1-3 hours): Validate success criteria. Deliverables: UAT evidence, `specs/EVALS-*.md` if used.
32
+ 6. **RELEASE** (30 min - 2 hours): Ship to production. Deliverables: Release tag (vX.Y.Z), `state.yaml` `release.last_tag`.
33
+
34
+ See [REFERENCE.md](REFERENCE.md) for detailed phase specifications and gate types.
35
+
36
+ ## How Orchestrate Works
37
+
38
+ 1. **Maintains state.yaml** — Tracks current phase, `active_epic`, `active_flow`, decisions, risks.
39
+ 2. **Spawns appropriate skills** — Routes by `model:` frontmatter. Decisions pass only via `specs/state.yaml` `handoff` between spawns.
40
+ 3. **Methodology lenses** — If `specs/tech-architecture/test.md` or ADRs exist, apply at phase gates.
41
+ 4. **Enforces gates** — Hard stops if success criteria not met.
42
+ 5. **The Gatekeeper** — Between stories in BUILD: read `specs/execution-status.yaml`; previous story must be `done` before starting the next; use `build-epic` for the 8-step epic cycle.
43
+ 6. **Pauses for confirmation** — After each phase, asks "Ready to proceed?".
44
+ 7. **Snapshots** — `bash scripts/bp-yaml-snapshot.sh` before major release cuts.
45
+
46
+ ## Orchestration Modes
47
+
48
+ - **Standard**: Enforce all gates. Use for new features and major refactors.
49
+ - **Fast-Track**: Skip negotiable gates. Use for hotfixes and minor improvements.
50
+ - **Ad-Hoc**: Warnings only. Use for prototyping and spikes (non-production).
51
+
52
+ See [REFERENCE.md](REFERENCE.md) for full mode behaviors.
53
+
54
+ ## Verification
55
+
56
+ All phases complete with artifacts:
57
+ ```bash
58
+ verify: test -f specs/state.yaml && test -f specs/release-plan.yaml && test -f specs/product/SCOPE_LATEST.yaml && ls specs/epics/*.yaml 1>/dev/null && echo "✅ All phases complete"
59
+ ```
60
+
61
+ ---
62
+
63
+ # Orchestrate Reference: Phases, Modes, and Workflows
64
+
65
+ Detailed documentation for the `orchestrate-project` meta-skill.
66
+
67
+ ## The 6-Phase Core Loop
68
+
69
+ ### PHASE 1: DISCOVER
70
+ - **Goal**: Understand the problem completely and map existing context.
71
+ - **Deliverables**: `requirements/VISION_LATEST.yaml`, `requirements/SCOPE_LATEST.yaml`, `plans/TECH_STACK_LATEST.md`.
72
+ - **Skills**: `survey-context`, `elaborate-spec`, `grill-me`.
73
+ - **Gate**: Confirm ("Is the problem clear?").
74
+
75
+ ### PHASE 2: ELABORATE
76
+ - **Goal**: Research solutions and lock architectural design.
77
+ - **Deliverables**: Prior art in scope YAML, ADRs in `specs/adr/`.
78
+ - **Skills**: `grill-me`, `model-domain`, `define-language`, `deepen-architecture`, `design-interface`.
79
+ - **Gate**: Quality ≥94% (via `request-review`) + Confirm ("Are decisions locked?").
80
+
81
+ ### PHASE 3: PLAN
82
+ - **Goal**: Write a verifiable implementation plan with success criteria.
83
+ - **Deliverables**: `release-plan.yaml`, `epics/eNN-*.yaml` with `verify:` per task.
84
+ - **Skills**: `scope-work`, `slice-tasks`, `define-success`, `plan-work`.
85
+ - **Gate**: Quality (request-review ≥94%) + slopcheck [SUS]/[SLOP].
86
+
87
+ ### PHASE 4: BUILD
88
+ - **Goal**: Execute the plan story-by-story using the 8-step `build-epic` cycle with TDD and vertical slices.
89
+ - **Deliverables**: Code; `execution-status.yaml` updated per story; `specs/metrics/cycle-times.yaml` row per story.
90
+ - **Skills**: `build-epic` (conductor) → per-story: `survey-context`, `plan-work`, `kickoff-branch`, `develop-tdd`, `verify-work`, `audit-code`, `commit-message`, `release-branch`.
91
+ - **BCP tracking**: `plan-release` sizes each story in Business Complexity Points (BCP) before the build queue; `plan-work` confirms and writes the size to `state.yaml` as `epic_cycle.story_bcps`. See `docs/references/bcp.md` for the canonical sizing method.
92
+ - **Timestamps**: `survey-context` stamps `metrics.story_start`; `release-branch` stamps `metrics.story_end` and writes BCP/hr to `specs/metrics/cycle-times.yaml`.
93
+ - **next_skill**: Each critical-path skill writes `handoff.next_skill` to `state.yaml`. Agents resume by reading `state.yaml` — no guessing.
94
+ - **Dashboard**: `npm run dashboard` (TUI) or `npm run dashboard:web` (browser, port 7742) shows live pipeline, epic queue, BCP metrics, and cycle-time ledger.
95
+ - **Gate**: Integration tests PASS; all 8 build-epic steps completed per story.
96
+
97
+ ### PHASE 5: VERIFY
98
+ - **Goal**: Validate success criteria and ensure production readiness.
99
+ - **Deliverables**: UAT evidence, eval results.
100
+ - **Skills**: `run-evals`, `verify-work`, `audit-code`, `request-review` (optional).
101
+ - **Gate**: Verification Script confirmed; `verify-work` not on `main`/`master`.
102
+
103
+ ### PHASE 6: RELEASE (Integrate)
104
+ - **Goal**: Ship to `main` with full traceability.
105
+ - **Deliverables**: Release tag (vX.Y.Z), release notes via semantic-release.
106
+ - **Skills**: `commit-message`, `release-branch`.
107
+ - **Git arc**:
108
+ 1. Plan on `main` (Discover / Plan)
109
+ 2. `kickoff-branch` → worktree + feature branch + clean baseline
110
+ 3. Build / Verify / Review on feature branch
111
+ 4. Integrate: **solo-local** (`scripts/land-branch.sh`) or **team-pr** (`gh pr create` → squash merge)
112
+ 5. Cleanup worktree; **end on `main`** in primary repo root
113
+ - **Gate**: Safety ("About to land on main. Confirm?").
114
+
115
+ ---
116
+
117
+ ## Orchestration Modes
118
+
119
+ ### Mode 1: Standard (Enforce All Gates)
120
+ **Use Case**: New features, major refactors, architectural changes.
121
+ **Behavior**:
122
+ - All Confirm gates require explicit user approval.
123
+ - All Quality gates are hard stops if threshold is not met.
124
+ - No shortcuts or phase skipping.
125
+
126
+ ### Mode 2: Fast-Track (Skip Negotiable Gates)
127
+ **Use Case**: Hotfixes, minor improvements, refactors on well-tested code.
128
+ **Behavior**:
129
+ - Skip Discover if `requirements/SCOPE_LATEST.yaml` exists.
130
+ - Skip Elaborate if design decisions are already locked.
131
+ - Skip Verify if coverage ≥95% + all tests PASS.
132
+ - Soft gates auto-approve if baseline conditions are met.
133
+
134
+ ### Mode 3: Ad-Hoc (Legacy, Warnings Only)
135
+ **Use Case**: Exploration, prototyping, spikes (NOT for production).
136
+ **Behavior**:
137
+ - Gates emit warnings but do not block execution.
138
+ - User can manually skip any phase.
139
+ - No enforced quality thresholds.
140
+
141
+ ---
142
+
143
+ ## Gate & Checkpoint Types
144
+ *See `docs/references/gates.md` and `docs/references/checkpoints.md` for full specs.*
145
+
146
+ - **Confirm**: Requires human "yes/no" decision.
147
+ - **Quality**: Automated threshold check (e.g., coverage, audit score).
148
+ - **Safety**: Destructive actions require risk acknowledgment.
149
+ - **Transition**: Mandatory artifact presence check.
150
+ - **slopcheck**: Identification of [SUS] (Suspicious) or [SLOP] (High-risk) packages.
151
+
152
+ ---
153
+
154
+ ## Error Recovery & State
155
+ Orchestrate maintains `specs/state.yaml` to track:
156
+ - **Current flow / epic**: `active_flow`, `active_epic_id`, `epic_cycle`.
157
+ - **Handoff**: `last_step_completed`, `open_decisions`, `required_reading`, `next_skill`.
158
+ - **Git**: `branch`, `hash` for session continuity.
159
+ - **Progress**: Story status lives in `execution-status.yaml` only.
160
+
161
+ In the event of a crash or exit, run `claude /orchestrate --resume` to pick up exactly where the session left off.
@@ -0,0 +1,159 @@
1
+ ---
2
+ description: Scans the active workspace for disposable artifacts—logs, caches, stale build output, and stray draft markdown—and proposes consolidation of scattered assets. Produces a reviewable list, asks for explicit confirmation before any delete or move, and optionally revises .gitignore. Use when the user says "clean my room", "organize workspace", "workspace cleanup", "remove temp files", "organize assets", "gitignore", or wants a safe tidy pass.
3
+ ---
4
+
5
+
6
+ # Organize Workspace
7
+ > **HARD GATE** — **HARD GATE** — Workspace structure must reflect domain structure. If the codebase feels disorganized, flag it. Disorganization != 'just a style thing;' it is a signal of domain misalignment.
8
+
9
+
10
+ ## Principles
11
+
12
+ - **Read-only first**: inventory and size (`du`, `ls -la`) before any change.
13
+ - **Never delete or move** without a numbered list and **explicit user approval** (item-level or "approve all").
14
+ - **Prefer `fd` / `ripgrep` / `find`** in that order; avoid blind `rm -rf` on vague globs.
15
+ - **Do not** touch `.git/`, `node_modules/`, `venv/`, `.env*`, or SSH keys; flag them only if the user asked about them.
16
+ - Confirm prompts in the **user's language** if they are not writing in English.
17
+
18
+ ## 1. Establish scope
19
+
20
+ - Default: **current project root** (where the user is working) or the path they name.
21
+ - Record OS (macOS vs Linux) for ignore patterns (e.g. `.DS_Store`).
22
+
23
+ ## 2. Classify candidates (scan)
24
+
25
+ Group findings under these **buckets**:
26
+
27
+ | Bucket | Examples | Typical action |
28
+ |--------|----------|----------------|
29
+ | **Logs & temp** | `*.log`, `logs/`, `tmp/`, `temp/`, `*.pid` | Delete after confirm |
30
+ | **Build / cache** | `dist/`, `build/`, `.next/`, `coverage/`, `.turbo/` | Delete if rebuildable |
31
+ | **Package caches** | root `.cache/`, `__pycache__/` | Offer delete |
32
+ | **Stray drafts** | root-level `*.md` named `draft`, `scratch`, `temp` | User picks: delete, move to `specs/`, or keep |
33
+ | **Duplicate / dump dirs** | `old/`, `backup/`, `copy/`, `*_backup` | List + ask |
34
+
35
+ Use quick size hints: `du -sh` per top-level dir; sort large items first.
36
+
37
+ ## 3. Assets & data (organize, not only delete)
38
+
39
+ If the user wants **organization**:
40
+
41
+ 1. Propose a **single convention**, e.g.:
42
+ - `assets/` — images, fonts, static media
43
+ - `data/` — JSON, CSV, fixtures, samples
44
+ - `specs/` — all planning and domain documents
45
+ 2. For each cluster of loose files, suggest **one target path** and a short rationale.
46
+ 3. Use **git-aware moves** when in a repo: `git mv` if tracked; otherwise `mv` and report.
47
+ 4. Never move secrets or production DB dumps into `docs/` or public `assets/`.
48
+
49
+ ## 4. Present the plan
50
+
51
+ Output a table or numbered list:
52
+
53
+ - Path
54
+ - Kind (log / build / draft / asset / other)
55
+ - Approx size
56
+ - Proposed action: **delete** | **move to …** | **keep**
57
+
58
+ Ask: *"Delete items 1–3? Move 4–5? Skip 6?"*
59
+
60
+ ## 5. Execute after approval
61
+
62
+ - Deletes: on macOS, prefer a Trash-capable tool (e.g. `trash` from Homebrew) if installed; else `rm` with paths echoed back.
63
+ - Moves: create dirs with `mkdir -p` first; one batch at a time.
64
+ - **Verify**: re-run listing on affected parents; if anything failed, report stderr.
65
+
66
+ ## 6. Post-cleanup and `.gitignore` revision
67
+
68
+ Do this when the repo is under Git and the cleanup surfaced **untracked** noise:
69
+
70
+ 1. **Inventory ignore sources**: root `.gitignore`, `.git/info/exclude`, any subpackage `.gitignore` files.
71
+ 2. **Map findings to rules**: for each deleted or recurring artifact class, check whether a pattern already exists; note gaps.
72
+ 3. **Propose a patch**: list only **concrete** changes — `+` add / `-` remove / `~` reword — with one-line why.
73
+ 4. **User must approve** the exact diff before editing the file.
74
+ 5. **Verify**: run `git check-ignore -v <path>` on 2–3 representative paths.
75
+
76
+ See [REFERENCE.md](REFERENCE.md) for shell patterns, `.gitignore` mechanics, and safety checks.
77
+
78
+ ---
79
+
80
+ # clean-my-room — reference patterns
81
+
82
+ Optional commands for the agent. Adapt paths; **dry-run** before bulk delete.
83
+
84
+ ## Discover large top-level entries
85
+
86
+ ```sh
87
+ du -sh ./* .[!.]* 2>/dev/null | sort -hr | head -30
88
+ ```
89
+
90
+ ## Find common logs (respect `.gitignore` when using fd)
91
+
92
+ ```sh
93
+ fd -t f '\.log$' . 2>/dev/null
94
+ fd 'npm-debug' . 2>/dev/null
95
+ ```
96
+
97
+ ## Find build-like dirs (review list before `rm -rf`)
98
+
99
+ ```sh
100
+ fd -t d '^(dist|build|out|target|\.next|coverage)$' . --max-depth 3 2>/dev/null
101
+ ```
102
+
103
+ ## Stray markdown at repo root (heuristic)
104
+
105
+ ```sh
106
+ ls -1 ./*.md 2>/dev/null
107
+ fd -t f '^(draft|scratch|untitled|TODO|notes)' . --max-depth 1 2>/dev/null
108
+ ```
109
+
110
+ ## Git-safe moves
111
+
112
+ ```sh
113
+ git status -sb
114
+ git check-ignore -v <path> # was ignored?
115
+ # Tracked: git mv old new
116
+ # Untracked: mkdir -p … && mv old new
117
+ ```
118
+
119
+ ## `.gitignore` revision (after cleanup)
120
+
121
+ **Goal:** stop regenerated junk from polluting `git status`, without hiding real source.
122
+
123
+ 1. **Read** root `.gitignore` and, in monorepos, `apps/*/.gitignore` / `packages/*/.gitignore` as needed. Check **`.git/info/exclude`** for machine-only rules that should *not* be committed (keep personal noise there; don’t copy into shared `.gitignore` unless the team agrees).
124
+ 2. **Per-path checks** (last match wins; shows which file defined the rule):
125
+
126
+ ```sh
127
+ git check-ignore -v path/to/artifact
128
+ git status -u --ignored # optional: see ignored names (noisy)
129
+ ```
130
+
131
+ 3. **Pattern style**
132
+ - Leading `/` = relative to the `.gitignore`’s directory (e.g. `/dist/` = only that folder at that level, not all nested `dist` unless intended).
133
+ - `**` for deep trees, e.g. `**/*.log`, when noise appears at many depths.
134
+ - **Negation** (`!`) is tricky: later rules, parent dirs, and `git add -f` interact—prefer narrow positive ignores over `!` unless you already use negation in that file.
135
+ 4. **Do not** add rules that would ignore: application source, small JSON/YAML config the repo tracks, or `!important` assets. When unsure, run `git check-ignore -v` on a *known good* file that must stay tracked.
136
+ 5. **Tracked but should be ignored** (user already committed `build/` once): this skill does not silently fix history; flag `git rm -r --cached <path>` + `.gitignore` as a **separate** explicit step the user must approve.
137
+ 6. **Global excludes** (optional heads-up for “why is this still ignored?”):
138
+
139
+ ```sh
140
+ git config --get core.excludesfile
141
+ ```
142
+
143
+ ## Safety: never pass through these in automated deletes
144
+
145
+ - `.git/`, `.svn/`, `.hg/`
146
+ - `node_modules/`, `vendor/`, `venv/`, `.venv/`, `__pypackages__/`
147
+ - Files matching `.env`, `.env.*` (except `.env.example` if intentional)
148
+ - `~/.ssh`, `id_rsa*`, `*.pem` inside project trees
149
+
150
+ ## Post-deploy / server-ish extras (name buckets to stack)
151
+
152
+ - Docker: dangling images/volumes (only if user asked for Docker cleanup; requires `docker` context).
153
+ - CI: `*.log` under `build/`, artifact dirs from previous runs.
154
+ - K8s: local `*.kube`, tmp kubeconfigs—list only; do not delete without confirmation.
155
+
156
+ ## Inspiration
157
+
158
+ - Same **inventory → plan → confirm → act** flow as [post-deploy environment cleanup](https://mcpmarket.com/tools/skills/post-deploy-environment-cleanup) style workflows.
159
+ - [Agent template public](https://github.com/matsuni-kk/agent_template_public): honor **Flow** (draft) vs **Stock** (stable); do not “clean” user drafts from Flow without explicit approval.
@@ -0,0 +1,77 @@
1
+ ---
2
+ description: Create a detailed refactor plan with tiny commits via user interview, then save it as specs/REFACTOR.md. Use when user wants to plan a refactor, create a refactoring RFC, or break a refactor into safe incremental steps.
3
+ ---
4
+
5
+
6
+ # Plan Refactor
7
+ > **HARD GATE** — **HARD GATE** — Before refactoring, document the current behavior and why it is wrong. Extract one invariant that must be preserved. If you skip this, you will break things you don't expect.
8
+
9
+
10
+ Create a detailed refactor plan through a user interview. Save output to `specs/REFACTOR.md`.
11
+
12
+ ## Steps
13
+
14
+ 1. Ask the user for a long, detailed description of the problem they want to solve and any potential ideas for solutions.
15
+
16
+ 2. Explore the repo to verify their assertions and understand the current state of the codebase.
17
+
18
+ 3. Ask whether they have considered other options, and present other options to them.
19
+
20
+ 4. Interview the user about the implementation. Be extremely detailed and thorough.
21
+
22
+ 5. Hammer out the exact scope of the implementation. Work out what you plan to change and what you plan not to change.
23
+
24
+ 6. Look in the codebase to check for test coverage of this area. If there is insufficient test coverage, ask the user what their plans for testing are.
25
+
26
+ 7. Break the implementation into a plan of tiny commits. Remember Martin Fowler's advice: "make each refactoring step as small as possible, so that you can always see the program working."
27
+
28
+ 8. Save the refactor plan to `specs/REFACTOR.md`. Create the `specs/` directory if it doesn't exist.
29
+
30
+ <refactor-plan-template>
31
+
32
+ ## Problem Statement
33
+
34
+ The problem that the developer is facing, from the developer's perspective.
35
+
36
+ ## Solution
37
+
38
+ The solution to the problem, from the developer's perspective.
39
+
40
+ ## Commits
41
+
42
+ A LONG, detailed implementation plan. Write the plan in plain English, breaking down the implementation into the tiniest commits possible. Each commit should leave the codebase in a working state.
43
+
44
+ Each commit entry follows this format:
45
+ ```
46
+ N. <commit description> → verify: <runnable command>
47
+ ```
48
+
49
+ ## Decision Document
50
+
51
+ A list of implementation decisions that were made:
52
+
53
+ - The modules that will be built/modified
54
+ - The interfaces of those modules that will be modified
55
+ - Technical clarifications from the developer
56
+ - Architectural decisions
57
+ - Schema changes, API contracts, specific interactions
58
+
59
+ Do NOT include specific file paths or code snippets. They may end up being outdated very quickly.
60
+
61
+ ## Testing Decisions
62
+
63
+ - A description of what makes a good test (only test external behavior, not implementation details)
64
+ - Which modules will be tested
65
+ - Prior art for the tests (i.e. similar types of tests in the codebase)
66
+
67
+ ## Out of Scope
68
+
69
+ A description of the things that are out of scope for this refactor.
70
+
71
+ ## Further Notes (optional)
72
+
73
+ Any further notes about the refactor.
74
+
75
+ </refactor-plan-template>
76
+
77
+ After writing `specs/REFACTOR.md`, suggest running `kickoff-branch` next to create a refactor branch.