@caddis/cli 0.4.70 → 0.4.71

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.
@@ -1,387 +1,27 @@
1
1
  ---
2
2
  name: writing-plans
3
- context: fork
4
- description: Use when you have a spec or requirements for a multi-step task, before touching code
3
+ description: Use when you have a spec or requirements for a multi-step task, before touching code. In caddis, plans are written with /caddis:feature-plan, the only plan writer; this skill sends you there.
5
4
  ---
6
5
 
7
- # Writing Plans
6
+ # Writing plans
8
7
 
9
- ## Overview
8
+ Plans in caddis are written with **`/caddis:feature-plan`**. It is the only plan writer. Run it with the
9
+ feature description, the spec path or the PRD path:
10
10
 
11
- Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
12
-
13
- Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.
14
-
15
- **Announce at start:** "I'm using the writing-plans skill to create the implementation plan."
16
-
17
- **Context:** This should be run in a dedicated worktree (created by brainstorming skill).
18
-
19
- > **Prefer `/caddis:feature-plan`.** It is the canonical planning entry point and produces a plan
20
- > the harness can resume, track and gate. This skill remains for free-form planning prose.
21
-
22
- **Save plans to:** `.caddis/plans/YYYY-MM-DD-<feature-name>.md`
23
-
24
- **Document metadata:** Before creating or updating a plan, apply `.github/instructions/document-frontmatter.instructions.md`. The YAML frontmatter block must be the first content in the file. New plans require `Original Author`, `Creation Date`, and `Creating Model`; revised plans must preserve those fields and add or update `Last Author`, `Last Updated`, and `Last Model Used`.
25
-
26
- ## Bite-Sized Task Granularity
27
-
28
- **Each step is one action (2-5 minutes):**
29
- - "Write the failing test" - step
30
- - "Run it to make sure it fails" - step
31
- - "Implement the minimal code to make the test pass" - step
32
- - "Run the tests and make sure they pass" - step
33
- - "Commit" - step
34
-
35
- ## Plan Document Header
36
-
37
- **Every plan MUST start with this header (YAML frontmatter first, then title):**
38
-
39
- ```markdown
40
- ---
41
- chain_id: <chain_id>
42
- type: plan
43
- status: current
44
- approval: pending
45
- Original Author: <active author or agent name>
46
- Creation Date: <YYYY-MM-DDTHH:MM:SSZ>
47
- Creating Model: <exact runtime model identifier or display name>
48
- ---
49
-
50
- # [Feature Name] Implementation Plan
51
-
52
- > **For the implementing agent:** Follow this plan task-by-task, executing each step sequentially.
53
-
54
- **Goal:** [One sentence describing what this builds]
55
-
56
- **Architecture:** [2-3 sentences about approach]
57
-
58
- **Tech Stack:** [Key technologies/libraries]
59
-
60
- ---
61
- ```
62
-
63
- > ⚠️ The YAML frontmatter block (`---` delimiters) is required for Orchestrator artefact contract validation. Do NOT use blockquote-style metadata (`> **approval:** pending`) — it will not be parsed.
64
- > Preserve the original metadata fields on later edits, and add or update `Last Author`, `Last Updated`, and `Last Model Used` when the plan is revised. Use full ISO 8601 UTC timestamps for `Creation Date` and `Last Updated`.
65
-
66
- ## Task Structure
67
-
68
- ```markdown
69
- ### Task N: [Component Name]
70
-
71
- **Files:**
72
- - Create: `exact/path/to/file.py`
73
- - Modify: `exact/path/to/existing.py:123-145`
74
- - Test: `tests/exact/path/to/test.py`
75
-
76
- **Step 1: Write the failing test**
77
-
78
- ```python
79
- def test_specific_behavior():
80
- result = function(input)
81
- assert result == expected
82
11
  ```
83
-
84
- **Step 2: Run test to verify it fails**
85
-
86
- Run: `pytest tests/path/test.py::test_name -v`
87
- Expected: FAIL with "function not defined"
88
-
89
- **Step 3: Write minimal implementation**
90
-
91
- ```python
92
- def function(input):
93
- return expected
12
+ /caddis:feature-plan <feature, spec path or PRD path>
94
13
  ```
95
14
 
96
- **Step 4: Run test to verify it passes**
97
-
98
- Run: `pytest tests/path/test.py::test_name -v`
99
- Expected: PASS
100
-
101
- **Step 5: Commit**
102
-
103
- ```bash
104
- git add tests/path/test.py src/path/file.py
105
- git commit -m "feat: add specific feature" -- tests/path/test.py src/path/file.py
106
- ```
107
- ```
108
-
109
- ## Manual Execution Protocol
110
-
111
- **Every plan MUST include a Manual Execution Protocol section** at the top (after header, before phases). This tells the user exactly how to run each phase session:
112
-
113
- ```markdown
114
- ## Manual Execution Protocol
115
-
116
- For each phase below, follow this workflow:
117
-
118
- 1. **Open** a new chat session with the agent specified in the phase header
119
- 2. **Load skills** listed in the phase's "Skills to load" section
120
- 3. **Attach files** listed in the phase's "Files to attach" section
121
- 4. **Paste** the self-contained Phase Prompt into the chat
122
- 5. **Validate** using the phase's Validation Checklist — every item must pass
123
- 6. **Get green light** before moving to the next phase
124
-
125
- **Drift rule:** If you find bugs introduced by Phase N, fix them in the SAME session
126
- before starting Phase N+1. Never carry implementation debt forward between phases.
127
-
128
- **Dependency sequencing rule:** Write phases in execution order \u2014 every phase's dependencies must appear before that phase in the plan. If Phase 3 requires output from Phase 4, reorder before writing. No forward dependencies.
129
- ```
130
-
131
- ## Phase 0 — Context & Decisions
132
-
133
- **Every multi-phase plan MUST include a Phase 0** before the implementation phases. Phase 0 is not an implementation phase — it is a ground-truth inventory that prevents agents from making assumptions.
134
-
135
- Phase 0 contains four mandatory tables:
136
-
137
- ### Technology Decision Table
138
-
139
- ```markdown
140
- ### Technology Decisions
141
-
142
- | Decision | Choice | Rationale |
143
- |----------|--------|-----------|
144
- | Charting library | Recharts | Tree-shakeable, React-native, typed API |
145
- | Animation | Framer Motion | AnimatePresence for tab transitions, spring physics |
146
- | State management | Zustand | Lightweight, no boilerplate, devtools support |
147
- | ... | ... | ... |
148
- ```
149
-
150
- Every technology choice that is NOT already in `project-config.md` must appear here with a rationale.
151
-
152
- ### Data Parity / Availability Matrix
153
-
154
- ```markdown
155
- ### Data Availability
156
-
157
- | Feature / Tab | Data Field | Available? | Strategy |
158
- |---------------|-----------|------------|----------|
159
- | Executive Overview | `ceoInsight` | ✅ Full | Live API |
160
- | Product Deep-Dive | `satisfactionScores` | ❌ Empty `{}` | Show empty state: "Coming in future release" |
161
- | Geography | `byGeography` | ⚠️ Partial (was present May-Oct) | Show empty state with explanation |
162
- | ... | ... | ... | ... |
163
- ```
164
-
165
- For any data field that may be empty, partial, or absent: document the exact empty state message text.
166
-
167
- ### Existing Scaffold Audit
168
-
169
- ```markdown
170
- ### Existing Scaffold — DO NOT Recreate
171
-
172
- | File | Purpose | Current State |
173
- |------|---------|---------------|
174
- | `frontend/src/api/client.ts` | API client with JWT auth | ✅ Working — build on top |
175
- | `frontend/src/types/nps.ts` | 30+ TypeScript interfaces | ✅ Working — import, don't recreate |
176
- | `frontend/src/components/layout/AppShell.tsx` | App shell | ⚠️ Cold zinc theme — needs warm overhaul |
177
- | ... | ... | ... |
178
- ```
179
-
180
- The "Current State" column tells agents what exists and whether to modify or leave it alone.
181
-
182
- ### Dependency Split
183
-
184
- ```markdown
185
- ### Dependencies
186
-
187
- **Already installed** (DO NOT reinstall):
188
- - react, react-dom, typescript, vite
189
- - @tanstack/react-query, @tanstack/react-router
190
- - tailwindcss, zustand
191
-
192
- **Not yet installed** (install in Phase 1):
193
- - recharts, framer-motion, leaflet, react-leaflet
194
- - d3-force, d3-scale
195
- ```
196
-
197
- ## Enhanced Per-Phase Template
198
-
199
- **Every implementation phase MUST use this structure.** The sections OUTSIDE the prompt block are for the user (what to prepare before opening a session). The prompt block is for the agent (what to paste into the session).
200
-
201
- ```markdown
202
- ## Phase N — {Name}
203
-
204
- **Agent:** `@{agent-name}`
205
- **Objective:** {One sentence describing what this phase builds}
206
-
207
- ### Skills to load
208
-
209
- - `.github/skills/{path}/SKILL.md` — {why}
210
- - `.github/skills/{path}/SKILL.md` — {why}
211
-
212
- ### Instructions to follow
213
-
214
- - `.github/instructions/{name}.instructions.md`
215
- - `.github/instructions/{name}.instructions.md`
216
-
217
- ### Files to attach
218
-
219
- - `path/to/file.ext` — {why this file is needed}
220
- - `path/to/file.ext` (from Phase N-1)
221
- - `.caddis/plans/{this-plan}.md` (this file)
222
-
223
- ### Phase Prompt
224
-
225
- \`\`\`
226
- {Self-contained prompt — copy-paste ready. 30-60 lines.
227
- References plan sections for detail. Does NOT duplicate code blocks.
228
- Includes PRINCIPLES, SKILLS TO READ, IMPORTANT warnings, and numbered deliverable list.}
229
- \`\`\`
230
-
231
- ### What to build
232
-
233
- #### N.1 {Deliverable Name}
234
-
235
- **File:** `exact/path/to/file.ext`
236
-
237
- {Component interface / function signature}
238
-
239
- **Data binding:**
240
- - Uses `data.field.path` for {purpose}
241
- - Uses `data.other.field` for {purpose}
242
-
243
- **Behavior:**
244
- - {Specific interactive behavior}
245
- - {Animation spec with exact values}
246
-
247
- **Empty state:** When `data.field` is `{}` or `[]`:
248
- > "{Exact message text to display}"
249
-
250
- **IMPORTANT:** {Trap-specific warning — e.g., "DO NOT recreate api/client.ts",
251
- "field uses snake_case in BOTH API and TS types — no transformation needed"}
252
-
253
- #### N.2 {Next Deliverable}
254
- ...
255
-
256
- ### Validation Checklist — Phase N complete when
257
-
258
- - [ ] `npm run build` succeeds (or equivalent build command)
259
- - [ ] {Specific behavioral criterion — e.g., "KpiFlipCard flip animation works independently on each card"}
260
- - [ ] {Data binding criterion — e.g., "NpsSummaryTable renders 5 rows with correct data from surveys + trend"}
261
- - [ ] {Visual criterion — e.g., "Dark mode: all components render correctly with soft dark tokens"}
262
- - [ ] {Integration criterion — e.g., "Row click switches to Tab 2 and scrolls to chart"}
263
- - [ ] Zero hardcoded data — all from props/hooks
264
- - [ ] Zero hardcoded colors — all from CSS vars or constants
265
- ```
266
-
267
- ### Key rules for the "What to build" subsections
268
-
269
- 1. **Data binding is mandatory for UI components.** Every component spec must list the exact JSON field paths it consumes (e.g., `surveys.{product}.nps`, `trend.historicalNPS.byProduct.{product}`). This eliminates the #1 implementer failure mode: guessing which field to bind.
270
-
271
- 2. **Empty state specs are mandatory.** For every data field that might be empty, specify the exact message text. Do NOT say "show appropriate empty state" — write the message.
272
-
273
- 3. **IMPORTANT warnings for traps.** If a file already exists and must NOT be recreated, say so. If a field uses unexpected casing (snake_case where camelCase is expected), warn explicitly. These prevent the most common implementation errors.
274
-
275
- 4. **Complete code blocks when the component is foundational.** For theme files, config files, utility functions, and CSS — include the full source code in the plan. For application components — specify interface, behavior, and data binding; let the agent write the implementation.
276
-
277
- ## Remember
278
- - Exact file paths always
279
- - Complete code in plan (not "add validation")
280
- - Exact commands with expected output
281
- - Reference relevant skills with @ syntax
282
- - DRY, YAGNI, TDD, frequent commits
283
- - **Every phase MUST end with a numbered exit gate task** (e.g., "Task N.X: Exit Gate") that includes pass/fail checks, commit message format, and an explicit "STOP — do not proceed to next phase" instruction
284
- - **Every phase/step must specify the executing agent and include a ready-to-use prompt with `═══ PROMPT START` / `═══ PROMPT END` markers**
285
- - **Use 4-backtick fences (`` ```` ``) for the outer prompt block** so nested code blocks render correctly
286
- - **After writing all phases, run the Cross-Reference Audit against ALL source documents**
287
- - **Every plan MUST include a Manual Execution Protocol and Phase 0 — Context & Decisions**
288
- - **Every UI phase MUST include data binding specs (exact JSON paths) per component**
289
- - **Every data field that might be empty MUST have an explicit empty state message**
290
- - **Drift rule: fix bugs from Phase N before starting Phase N+1**
291
-
292
- ## Cross-Reference Audit
293
-
294
- **Run this AFTER all phases are written, BEFORE finalizing the plan.**
295
-
296
- Walk through every FR, NFR, risk, and design decision from ALL input documents. For each, verify it maps to a specific, actionable plan step. Output a traceability matrix:
297
-
298
- ```markdown
299
- ## Source Document Traceability
300
-
301
- | Requirement | Source | Plan Phase/Step | Status |
302
- |-------------|--------|-----------------|--------|
303
- | FR-101 | PRD §3.1 | Phase 1, Step 2 | ✅ Covered |
304
- | NFR-208 | PRD §4.2 | Phase 5, Step 1 | ✅ Covered |
305
- | Risk-003 | Arch §9 | Phase 3, Step 3 | ✅ Covered |
306
- | ALT-002 | Arch §7.4 | N/A | ⚠️ Out of Scope — rationale: deferred to v2 |
307
- ```
308
-
309
- **Rules:**
310
- - A requirement without a plan step → add a step or mark "Out of Scope" with rationale
311
- - A cited section reference (§N) → verify the section number matches the actual document
312
- - Zero-tolerance: no unmapped requirements in a finalized plan
313
-
314
- ## Agent & Prompt Assignment
315
-
316
- **Every phase/step MUST include a ready-to-use prompt block.** This is non-negotiable because plans are executed across multiple sessions by different agents.
317
-
318
- ### Prompt Block Template
319
-
320
- > **CRITICAL**: Use 4-backtick fences (` ```` `) for the outer prompt block so nested code blocks (yaml, python, etc.) inside the prompt render correctly. Add `═══ PROMPT START` and `═══ PROMPT END` markers so users can clearly see where to copy from/to.
321
-
322
- ```markdown
323
- ### Ready-to-Use Prompt (Phase N — Step M)
324
-
325
- > **How to use:** Copy the prompt block below (between ═══ START and ═══ END markers) into a new chat session. **Include all code blocks** — they're context for the agent, not for you to apply manually.
326
- > **Agent:** `@{agent-name}` (see `.github/agents/{agent-name}.agent.md`)
327
- > **Skills to load:** `.github/skills/{skill-path}/SKILL.md`
328
- > **Instructions (auto-applied):** `{instruction1}.instructions.md`, `{instruction2}.instructions.md`
329
- > **Project config:** `.github/project-config.md` (profile: `{profile}`)
330
-
331
- > ═══ PROMPT START — Copy everything between START and END into a new chat ═══
332
-
333
- \`\`\`\`
334
- {One-sentence task description}
335
-
336
- **Agent context:** You are the `@{agent-name}` agent. Load `.github/project-config.md` before starting.
337
-
338
- **Read these files FIRST (in order):**
339
- 1. `.caddis/plans/{plan-file}.md` — **THIS PLAN** — read "Phase N — Step M"
340
- 2. {Architecture/PRD doc} — {specific sections}
341
- 3. {Target file(s)} — current state
342
-
343
- **What to do:**
344
- - {Actionable instruction 1}
345
- - {Actionable instruction 2}
346
-
347
- **Acceptance criteria:**
348
- - {Testable criterion 1}
349
- - {Testable criterion 2}
350
-
351
- **Scope boundary:**
352
- - Exit gate: Task N.X (the last task in this phase)
353
- - Do NOT proceed to Phase N+1 after the exit gate passes
354
- - Do NOT offer additional work beyond the exit gate tasks
355
- - Commit with: `feat({feature}): Phase N — {description}` and STOP
356
- \`\`\`\`
357
-
358
- > ═══ PROMPT END ═══════════════════════════════════════════════════════════
359
- ```
360
-
361
- ### Agent Selection Guide
362
-
363
- | Task Type | Agent | Agent File |
364
- |-----------|-------|------------|
365
- | Models, services, logic | `@implement` | `implement.agent.md` |
366
- | Streamlit UI, components | `@streamlit-developer` | `streamlit-developer.agent.md` |
367
- | Tests, fixtures | `@tester` | `tester.agent.md` |
368
- | SQL queries, schema | `@sql-expert` | `sql-expert.agent.md` |
369
- | Docs, README | `@docs` | `docs.agent.md` |
370
- | Code review | `@code-review` | `code-review.agent.md` |
371
-
372
- ## Execution Handoff
373
-
374
- After saving the plan, offer execution choice:
375
-
376
- **"Plan complete and saved to `.caddis/plans/<filename>.md`. Two execution options:**
377
-
378
- **1. This session** — I implement each task sequentially, reviewing between tasks
15
+ Do not write a plan by hand from this skill. `/caddis:feature-plan` writes the plan to
16
+ `.caddis/plans/<feature-slug>.md`, where handoff, resume, `/caddis:implement` and the Tracker read it. It
17
+ gives each phase a model, a `Lane:` and an `Execution: inline | per-task` line. For a `per-task` phase it
18
+ writes each task with `Files:`, `Interfaces:` and its TDD steps. It also writes Global Constraints, a
19
+ Review Focus list and runs a self-review.
379
20
 
380
- **2. Separate session** — Open a new session with the `@implement` agent and provide the plan path
21
+ To run the plan, use `/caddis:implement <plan path>`.
381
22
 
382
- **Which approach?"**
23
+ The plan file's header follows `.github/instructions/document-frontmatter.instructions.md`;
24
+ `/caddis:feature-plan` writes it.
383
25
 
384
- **If separate session chosen:**
385
- - Guide them to open new session
386
- - Reference the `@implement` agent (`.github/agents/implement.agent.md`)
387
- - Provide the plan file path for the implementing agent to read
26
+ This skill was once a copy of obra/superpowers `writing-plans` (MIT). Its ideas now live in
27
+ `/caddis:feature-plan` and `/caddis:implement`; see NOTICE.md and `.github/upstream-sources.json`.