showdar-skills 0.16.0 → 0.17.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.
- package/CHANGELOG.md +17 -0
- package/MIGRATION.md +14 -0
- package/README.md +9 -2
- package/docs/REFERENCE.md +30 -17
- package/package.json +1 -1
- package/profiles/backend.json +1 -1
- package/profiles/developer.json +1 -1
- package/profiles/full.json +1 -1
- package/profiles/product.json +1 -1
- package/profiles/qa.json +1 -1
- package/skills/{showdar-refine → showdar-brainstorm}/SKILL.md +10 -4
- package/skills/{showdar-refine → showdar-brainstorm}/references/approval-handoff.md +1 -1
- package/skills/showdar-brainstorm/references/handoff-plan.md +8 -0
- package/skills/showdar-build/SKILL.md +25 -0
- package/skills/showdar-build/references/plan-execution.md +22 -0
- package/skills/showdar-design/SKILL.md +7 -1
- package/skills/showdar-feature/SKILL.md +17 -2
- package/skills/showdar-plan/SKILL.md +16 -1
- package/skills/showdar-plan/examples/persisted-plan.md +37 -0
- package/skills/showdar-plan/references/plan-persistence.md +25 -0
- package/skills/showdar-recover/SKILL.md +15 -0
- package/skills/showdar-requirements/SKILL.md +7 -1
- package/skills/showdar-review/SKILL.md +7 -0
- package/skills/showdar-setup/SKILL.md +1 -1
- package/skills/showdar-tdd/SKILL.md +159 -0
- package/skills/showdar-tdd/examples/behavior-change.md +20 -0
- package/skills/showdar-tdd/references/red-green-refactor.md +28 -0
- package/skills/showdar-test/SKILL.md +14 -0
- package/src/adapter-renderers.js +1 -1
- package/src/catalog.js +6 -5
- package/src/project.js +61 -11
- package/src/validate.js +2 -2
- /package/skills/{showdar-refine → showdar-brainstorm}/references/questioning.md +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.17.0]
|
|
10
|
+
|
|
11
|
+
### Additional unpublished changes
|
|
12
|
+
|
|
13
|
+
- Added portable native `showdar-tdd` companion with evidence-based RED → GREEN → REFACTOR; integrated into Build/Plan/Test/Feature/Recover without adding a workflow stage.
|
|
14
|
+
- Canonical default plan and spec documents now live under `docs/showdar/plans/` and `docs/showdar/specs/`; existing repository locations still win.
|
|
15
|
+
- Updated developer/backend/qa/full profiles and 26-skill catalog, migration guidance, and regression coverage.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
- Renamed native portable `showdar-refine` to **`showdar-brainstorm`**, without a legacy CLI alias.
|
|
20
|
+
- Adaptive Markdown plan persistence and verification-backed task resume for the Brainstorm → Plan → Build workflow.
|
|
21
|
+
- Safe, hash-checked migration for CLI-owned legacy native skills and commands.
|
|
22
|
+
|
|
23
|
+
### Notes
|
|
24
|
+
- Plan files do not replace workflow checkpoints or imply approval, Git, publication or deployment authority.
|
|
25
|
+
|
|
9
26
|
## [0.16.0]
|
|
10
27
|
|
|
11
28
|
### Added
|
package/MIGRATION.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# Further v0.17.0 changes (pre-release)
|
|
2
|
+
|
|
3
|
+
`showdar-tdd` is a new optional companion installable with `showdar add tdd --ai cursor`; developer/backend/qa/full profiles include it. Existing installations retain their selection until explicitly updated. Canonical default plan and approved-spec documents now live under `docs/showdar/plans/` and `docs/showdar/specs/`. Existing project documentation conventions are never migrated or overwritten automatically. TDD is evidence-based RED → GREEN → REFACTOR where runnable tests exist, not a source of implicit Git or deployment authority.
|
|
4
|
+
|
|
5
|
+
# Upgrade from v0.16.0 to v0.17.0
|
|
6
|
+
|
|
7
|
+
The native skill `showdar-refine` is retired, and `showdar-brainstorm` is its sole replacement. **No CLI alias**: `showdar add refine` and `showdar add showdar-refine` are rejected. Use `showdar add brainstorm` or update the project profile.
|
|
8
|
+
|
|
9
|
+
For CLI-managed installs, `showdar init --profile developer --ai cursor` or `showdar add brainstorm --ai cursor` migrates matching owned v0.16 native files and commands only when their recorded hashes still match. If a managed file was modified, migration stops without deleting user changes. Independently installed skills (e.g. via `npx skills add`) have no Showdar ownership record: inspect and update them with their original installer.
|
|
10
|
+
|
|
11
|
+
Plans may stay in chat for small tasks. Complex, staged or cross-session plans can be saved to a repository's existing canonical plan path (default `docs/showdar/plans/<feature>.md`) with task IDs, dependencies and verification ledger. Build checks actual source/tests before completing tasks. A plan never stores authorization or replaces lifecycle checkpoints.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
1
15
|
# Migrating to 0.8.0
|
|
2
16
|
|
|
3
17
|
0.8.0 adds local declarative extensibility (extension packs, custom
|
package/README.md
CHANGED
|
@@ -43,10 +43,17 @@ showdar doctor
|
|
|
43
43
|
## Portable companions
|
|
44
44
|
|
|
45
45
|
- `showdar-setup`: repository evidence audit, project context onboarding and optional glossary bootstrap; user approval before writing.
|
|
46
|
-
- `showdar-
|
|
46
|
+
- `showdar-brainstorm`: conditional questioning for material ambiguity. After brainstorming starts, a complete Decision Brief must receive explicit approval before implementation; skip when work is already defined.
|
|
47
|
+
- `showdar-tdd`: verified RED → GREEN → REFACTOR for bounded testable behavior tasks; callable directly or used within Build when installed. Never invent a failing test, and declare a reason/alternative check when no runnable harness exists.
|
|
47
48
|
- `showdar-domain-model`: read canonical terminology and ADRs when relevant; propose edits for accepted domain definitions or real architecture decisions, and write only after approval.
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
Use `showdar add brainstorm` or `/showdar-brainstorm`. The retired skill name is not a CLI alias. Existing v0.16.0 installs should update their profile; Showdar-managed legacy copies are migrated only when unchanged. Independent Skills CLI installs must be updated with that installer.
|
|
51
|
+
|
|
52
|
+
Durable specs default to `docs/showdar/specs/<feature>.md` after full-spec approval, unless the project has an existing canonical convention. For longer work, `showdar-plan` may persist a plan in the repository's canonical plans location (default `docs/showdar/plans/<feature>.md`) with stable task IDs and a verification ledger. `showdar-build` resumes from that plan, but a checkbox is not proof and a plan is not Git or implementation authority.
|
|
53
|
+
|
|
54
|
+
Native usage: `showdar add tdd --ai cursor`, then `/showdar-tdd` where supported. For automatic Build use, select a profile including TDD (developer/backend/qa/full) or add it explicitly.
|
|
55
|
+
|
|
56
|
+
Companions are native-discoverable and first-class installable skills, not primary lifecycle routes. `showdar-feature` consults brainstorm only when decisions can alter behavior, and handoff reuses approved specs rather than asking again. Specs follow adaptive persistence: use existing canonical tickets/docs first; create a durable spec for complex cross-session work, and keep small same-session briefs in conversation.
|
|
50
57
|
|
|
51
58
|
## Version and updates
|
|
52
59
|
|
package/docs/REFERENCE.md
CHANGED
|
@@ -167,8 +167,8 @@ guidance, including re-adding an existing skill. Global installs keep native dis
|
|
|
167
167
|
and do not write project AGENTS.md or CLAUDE.md.
|
|
168
168
|
|
|
169
169
|
The four workflows remain native discoverable/installable skills; `route` does not
|
|
170
|
-
introduce workflow selection. Profiles
|
|
171
|
-
18 primitives
|
|
170
|
+
introduce workflow selection. Profiles contain primitives plus portable companions: `full` contains all
|
|
171
|
+
18 primitives and 4 companions; the insurance profile remains unchanged.
|
|
172
172
|
|
|
173
173
|
Before the first local-write task source edit, the coding agent must run
|
|
174
174
|
`showdar guard --mutation local-write --json` and require `ok=true` and
|
|
@@ -215,7 +215,7 @@ source edits.
|
|
|
215
215
|
|
|
216
216
|
## Why Showdar?
|
|
217
217
|
|
|
218
|
-
- **18 focused primitive skills
|
|
218
|
+
- **18 focused primitive skills**, 4 portable companions and 4 adaptive workflow skills (26 installable), including an opt-in insurance domain profile.
|
|
219
219
|
- **Lifecycle coverage** from product rules to implementation, verification,
|
|
220
220
|
security, operations, release readiness, and Git completion.
|
|
221
221
|
- **Intent-based discovery** that selects the workflow matching the request.
|
|
@@ -387,20 +387,19 @@ paths are refreshed or removed.
|
|
|
387
387
|
|
|
388
388
|
## Profiles
|
|
389
389
|
|
|
390
|
-
Role-specific profiles improve routing precision. Profiles install primitive
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
skill, but still does not eagerly load every skill body.
|
|
390
|
+
Role-specific profiles improve routing precision. Profiles install selected primitive
|
|
391
|
+
and portable companion skills; workflows remain opt-in through `showdar add <workflow>`.
|
|
392
|
+
`full` includes every primitive and companion, but does not eagerly load every skill body.
|
|
394
393
|
|
|
395
394
|
| Profile | Skills | Best for |
|
|
396
395
|
| --- | ---: | --- |
|
|
397
396
|
| `minimal` | 8 | Focused everyday assistance |
|
|
398
|
-
| `developer` |
|
|
399
|
-
| `backend` |
|
|
400
|
-
| `qa` |
|
|
401
|
-
| `product` |
|
|
397
|
+
| `developer` | 16 | General application development |
|
|
398
|
+
| `backend` | 18 | APIs, services, and runtime operations |
|
|
399
|
+
| `qa` | 13 | Testing and quality workflows |
|
|
400
|
+
| `product` | 9 | Product, requirements, and design work |
|
|
402
401
|
| `insurance` | 3 | Insurance terminology, business flows, and UI/API review |
|
|
403
|
-
| `full` |
|
|
402
|
+
| `full` | 22 | All primitive and companion capabilities |
|
|
404
403
|
|
|
405
404
|
Legacy aliases remain compatible:
|
|
406
405
|
|
|
@@ -411,10 +410,23 @@ web -> developer
|
|
|
411
410
|
|
|
412
411
|
New manifests store the canonical `developer` profile.
|
|
413
412
|
|
|
413
|
+
## Test-driven implementation and document layout
|
|
414
|
+
|
|
415
|
+
The `showdar-tdd` companion is included in developer/backend/qa/full profiles, or can be installed individually with `showdar add tdd --ai cursor`. It runs one scoped RED (reproduced behavior failure), GREEN (passing focused test), REFACTOR (focused test stays passing) cycle at a time and hands actual proof to `showdar-build`. `showdar-test` independently selects integration, regression and E2E coverage; Review remains a separate quality gate. No fabricated RED logs and no ceremonial tests for documentation-only or missing-harness work.
|
|
416
|
+
|
|
417
|
+
Adaptive documentation persistence uses a project's existing canonical docs first; if none exists, durable approved specs default to `docs/showdar/specs/<feature>.md` and multi-session execution plans default to `docs/showdar/plans/<feature>.md`. Smaller tasks can remain in chat. A saved plan is not execution authorization and task checkboxes require fresh code/test evidence.
|
|
418
|
+
|
|
419
|
+
```text
|
|
420
|
+
docs/showdar/
|
|
421
|
+
specs/<feature>.md
|
|
422
|
+
plans/<feature>.md
|
|
423
|
+
```
|
|
424
|
+
|
|
414
425
|
## Skill catalog
|
|
415
426
|
|
|
416
|
-
All 18 primitive entries are
|
|
417
|
-
compose
|
|
427
|
+
All 18 primitive entries and 4 portable companions are installable Showdar skills.
|
|
428
|
+
Four workflow skills compose the primitive stages; see [Workflow skills](#workflow-skills).
|
|
429
|
+
`showdar-tdd` is a companion used inside the Build stage when suitable; it does not change the workflow-state stage list.
|
|
418
430
|
|
|
419
431
|
### Analysis and planning
|
|
420
432
|
|
|
@@ -438,6 +450,7 @@ compose them; see [Workflow skills](#workflow-skills).
|
|
|
438
450
|
| Skill | Use when |
|
|
439
451
|
| --- | --- |
|
|
440
452
|
| `showdar-test` | Choosing or implementing automated tests for behavior, regressions, integration, E2E, or coverage. |
|
|
453
|
+
| `showdar-tdd` (companion) | Implementing a bounded behavioral change with real RED → GREEN → REFACTOR evidence; direct invocation `/showdar-tdd` is available where native skills support it. |
|
|
441
454
|
| `showdar-quality` | Planning QA/QC scenarios, risk coverage, regression scope, compatibility checks, or bug-report evidence. |
|
|
442
455
|
| `showdar-review` | Reviewing code or diffs for general correctness, architecture, performance, maintainability, or tests. |
|
|
443
456
|
|
|
@@ -748,9 +761,9 @@ Use `showdar add insurance-workflows --ai codex` and
|
|
|
748
761
|
that wants all three, `showdar init --profile insurance --ai codex` installs the set.
|
|
749
762
|
|
|
750
763
|
Accepted names are the short form (`debug`, `feature`, `insurance-domain`)
|
|
751
|
-
or the canonical form (`showdar-debug`, `showdar-feature`). The release ships exactly 18 primitive
|
|
752
|
-
|
|
753
|
-
|
|
764
|
+
or the canonical form (`showdar-debug`, `showdar-feature`). The release ships exactly 18 primitive,
|
|
765
|
+
4 companion and 4 workflow skills (26 installable total); built-in profiles select primitive
|
|
766
|
+
and companion skills but do not include workflows. There is no `showdar workflow ...` command. `showdar add`
|
|
754
767
|
is idempotent, preserves the configured profile, supports `--ai`/`--scope`
|
|
755
768
|
overrides, and refuses to overwrite a foreign same-name skill directory that
|
|
756
769
|
Showdar does not own.
|
package/package.json
CHANGED
package/profiles/backend.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"skills":["showdar-understand","showdar-plan","showdar-build","showdar-debug","showdar-test","showdar-review","showdar-upgrade","showdar-ship","showdar-recover","showdar-git","showdar-requirements","showdar-quality","showdar-security","showdar-ops","showdar-setup","showdar-
|
|
1
|
+
{"skills":["showdar-understand","showdar-plan","showdar-build","showdar-debug","showdar-test","showdar-review","showdar-upgrade","showdar-ship","showdar-recover","showdar-git","showdar-requirements","showdar-quality","showdar-security","showdar-ops","showdar-setup","showdar-brainstorm","showdar-domain-model","showdar-tdd"]}
|
package/profiles/developer.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"skills":["showdar-understand","showdar-plan","showdar-design","showdar-build","showdar-debug","showdar-test","showdar-review","showdar-upgrade","showdar-ship","showdar-recover","showdar-git","showdar-security","showdar-setup","showdar-
|
|
1
|
+
{"skills":["showdar-understand","showdar-plan","showdar-design","showdar-build","showdar-debug","showdar-test","showdar-review","showdar-upgrade","showdar-ship","showdar-recover","showdar-git","showdar-security","showdar-setup","showdar-brainstorm","showdar-domain-model","showdar-tdd"]}
|
package/profiles/full.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"skills":["showdar-understand","showdar-plan","showdar-design","showdar-build","showdar-debug","showdar-test","showdar-review","showdar-upgrade","showdar-ship","showdar-recover","showdar-git","showdar-requirements","showdar-quality","showdar-security","showdar-ops","showdar-insurance-domain","showdar-insurance-workflows","showdar-insurance-review","showdar-setup","showdar-
|
|
1
|
+
{"skills":["showdar-understand","showdar-plan","showdar-design","showdar-build","showdar-debug","showdar-test","showdar-review","showdar-upgrade","showdar-ship","showdar-recover","showdar-git","showdar-requirements","showdar-quality","showdar-security","showdar-ops","showdar-insurance-domain","showdar-insurance-workflows","showdar-insurance-review","showdar-setup","showdar-brainstorm","showdar-tdd","showdar-domain-model"]}
|
package/profiles/product.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"skills":["showdar-understand","showdar-requirements","showdar-plan","showdar-design","showdar-quality","showdar-review","showdar-setup","showdar-
|
|
1
|
+
{"skills":["showdar-understand","showdar-requirements","showdar-plan","showdar-design","showdar-quality","showdar-review","showdar-setup","showdar-brainstorm","showdar-domain-model"]}
|
package/profiles/qa.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"skills":["showdar-understand","showdar-requirements","showdar-quality","showdar-test","showdar-debug","showdar-review","showdar-ship","showdar-recover","showdar-git","showdar-setup","showdar-
|
|
1
|
+
{"skills":["showdar-understand","showdar-requirements","showdar-quality","showdar-test","showdar-debug","showdar-review","showdar-ship","showdar-recover","showdar-git","showdar-setup","showdar-brainstorm","showdar-domain-model","showdar-tdd"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: showdar-
|
|
3
|
-
description: Use when a feature
|
|
2
|
+
name: showdar-brainstorm
|
|
3
|
+
description: Use when brainstorming a feature, challenging assumptions, comparing real alternatives, and approving the complete spec before implementation.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Showdar
|
|
6
|
+
# Showdar Brainstorm
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
9
9
|
|
|
@@ -44,6 +44,12 @@ description: Use when a feature idea or implementation request has unresolved pr
|
|
|
44
44
|
|
|
45
45
|
Read `references/questioning.md` and `references/approval-handoff.md` only when that depth of detail is needed; these references are packaged inside this skill for skills-only installers.
|
|
46
46
|
|
|
47
|
+
## Plan handoff
|
|
48
|
+
|
|
49
|
+
- Read `references/handoff-plan.md` when moving from brainstorming to implementation planning.
|
|
50
|
+
- Pass the accepted Decision Brief revision, decision IDs and acceptance criteria to `showdar-plan`. Durable specs follow existing canonical locations; the plan is a separate artifact whose persistence is adaptive.
|
|
51
|
+
- A full-spec approval is necessary after brainstorming but does not mark plan tasks as done or grant Git/write authority.
|
|
52
|
+
|
|
47
53
|
## Workflow
|
|
48
54
|
|
|
49
55
|
- Start read-only: inspect request, canonical spec/ticket, relevant repository context and existing ADR/glossary.
|
|
@@ -55,7 +61,7 @@ Read `references/questioning.md` and `references/approval-handoff.md` only when
|
|
|
55
61
|
- Draft a concise Decision Brief: goal, scope, non-goals, decisions with IDs, alternatives, acceptance notes and blockers.
|
|
56
62
|
- Show the complete proposed spec and request explicit approval; a response to one question is not approval for the whole brief.
|
|
57
63
|
- On changes, revise the brief and ask approval again; do not implement while waiting.
|
|
58
|
-
- After approval, prefer an existing canonical spec or ticket; save to docs/specs only for complex durable handoffs with file approval.
|
|
64
|
+
- After approval, prefer an existing canonical spec or ticket; save to docs/showdar/specs only for complex durable handoffs with file approval.
|
|
59
65
|
- For a small one-session task, keep the approved brief in conversation; never claim chat memory persists across sessions.
|
|
60
66
|
- Handoff the approved brief and exact decisions to showdar-requirements or showdar-plan without repeating the interview.
|
|
61
67
|
- If later evidence contradicts an accepted decision, reopen only affected decisions and request fresh approval.
|
|
@@ -6,6 +6,6 @@ States: skipped, needs-input, ready-for-approval, approved. Do not silently prom
|
|
|
6
6
|
|
|
7
7
|
When triggered, request explicit acceptance of the whole brief, not approval inferred from individual answers. Never begin implementation from a draft.
|
|
8
8
|
|
|
9
|
-
Adaptive persistence: update existing canonical spec/ticket only with approval, otherwise write docs/specs/<feature>.md when cross-session or complex handoff justifies it. In-session small approved briefs may remain in chat, but do not assume another session can recover the approval.
|
|
9
|
+
Adaptive persistence: update existing canonical spec/ticket only with approval, otherwise write docs/showdar/specs/<feature>.md when cross-session or complex handoff justifies it. In-session small approved briefs may remain in chat, but do not assume another session can recover the approval.
|
|
10
10
|
|
|
11
11
|
Do not store mutation permissions inside a workflow checkpoint. Require fresh repository authority for writes, commits or publication.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Brainstorm to Plan handoff
|
|
2
|
+
|
|
3
|
+
- Start with repository context and one meaningful unresolved decision at a time. Ask questions until material ambiguity is resolved.
|
|
4
|
+
- Draft an explicit Decision Brief (goals, non-goals, decision IDs, alternatives, acceptance notes, unresolved risks).
|
|
5
|
+
- A reply to one question does not authorize the entire spec. Request approval for the *whole* current brief revision.
|
|
6
|
+
- If no material ambiguity existed, explicitly skip brainstorming and use existing approved requirements; do not generate ceremonial specs.
|
|
7
|
+
- If approved, hand off stable decision IDs, approved revision and canonical spec/ticket path if persisted to `showdar-plan`.
|
|
8
|
+
- Brainstorm approval does not authorize writes, commits, merges, deployment or plan task completion.
|
|
@@ -60,6 +60,31 @@ Before any task-owned source/config/test/docs write, apply `showdar-git` branch
|
|
|
60
60
|
- Invoke installed `showdar-domain-model` only for a meaningful shared glossary/architecture update, with a separate proposed diff and approval.
|
|
61
61
|
- Do not assume `showdar route`, CLI install or workflow checkpoint grants mutation authority.
|
|
62
62
|
|
|
63
|
+
## Test-driven implementation
|
|
64
|
+
|
|
65
|
+
- Use installed `showdar-tdd` for behavior-changing tasks when tests can be run at a meaningful boundary; the companion is optional, not a new workflow stage. If missing, follow the same evidence-first RED → GREEN → REFACTOR contract directly with `showdar-test` support.
|
|
66
|
+
- RED: add a minimal behavioral test and run it against current code. Confirm it fails for the expected missing behavior/defect rather than a broken fixture, imports or configuration.
|
|
67
|
+
- GREEN: make the smallest production change that makes the test pass; rerun the same targeted test and inspect negative/error cases.
|
|
68
|
+
- REFACTOR: improve production/test code only within the agreed task boundaries, rerun the targeted tests and affected checks to keep GREEN.
|
|
69
|
+
- Document actual commands and observed RED, GREEN and REFACTOR results against the plan task ID. Never fabricate a failing run or mark `[x]` when proof is absent.
|
|
70
|
+
- When TDD cannot meaningfully apply (docs-only, generated assets, unavailable test harness), explicitly record why and execute an honest alternate verification. Do not write ceremonial tests.
|
|
71
|
+
- `showdar-test` still owns broad test-level strategy and integration/E2E verification, and `showdar-review` still reviews final diffs.
|
|
72
|
+
|
|
73
|
+
## Execute and resume a task plan
|
|
74
|
+
|
|
75
|
+
- Read `references/plan-execution.md` before using a persisted plan to track or resume tasks.
|
|
76
|
+
- Discover the canonical implementation plan and approved spec first. If no durable plan is appropriate, use the agreed in-chat plan; never manufacture a file requirement for a small change.
|
|
77
|
+
- Compare plan revision, linked spec and decision IDs, actual source, dependencies, and prior verification receipts before editing.
|
|
78
|
+
- Treat checked boxes as *claims* requiring code/test evidence, never as proof or authorization. If prior evidence is stale or missing, classify as `implemented-unverified`, inspect the implementation, then verify it before writing new code.
|
|
79
|
+
- Pick the earliest unmet dependency-ready task, implement its bounded change, and run the exact relevant verification plus checks needed for affected contracts.
|
|
80
|
+
- Only after behavior exists and required proof succeeds may its task be marked `[x]`, together with an evidence ledger receipt containing actual command/scenario, outcome, changed files and commit/revision context when available.
|
|
81
|
+
- If proof is blocked, failed or unavailable, keep `[ ]` and record `blocked` or `implemented-unverified`; never mark a task done just because code was edited.
|
|
82
|
+
- Progress updates to Markdown are writes governed by the same Git preflight and foreign-file protections as source code. If file writes cannot be performed safely, report status in chat instead of falsifying a plan.
|
|
83
|
+
- If plan or spec has materially drifted, stop the affected task, report the conflict and return to `showdar-plan` or `showdar-brainstorm` for the relevant decision; do not silently reshape scope during Build.
|
|
84
|
+
- A saved plan supplements, but never replaces, workflow-state checkpoints, full-spec approval, Git authorization, or separate Test/Review evidence.
|
|
85
|
+
- When interrupted, return verified/unverified task IDs, proof, blockers, plan revision/path and first ready task so `showdar-recover` or another agent can resume without guessing.
|
|
86
|
+
|
|
87
|
+
|
|
63
88
|
## Workflow
|
|
64
89
|
|
|
65
90
|
### Phase 1 — pre-change check
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Executing and resuming Markdown plans
|
|
2
|
+
|
|
3
|
+
## Locate and reconcile
|
|
4
|
+
- Discover the current canonical plan through repo instructions, task description and specs; `docs/showdar/plans/<feature>.md` is a fallback, not a search constraint.
|
|
5
|
+
- Verify the linked product spec's approval if brainstorming was triggered, plan revision, current Git branch/status, and affected dependencies.
|
|
6
|
+
- Check each `TASK-NNN` checkbox against actual implemented behavior, diff and reliable test receipts. A checked task can be stale. A task left unchecked may already be implemented, so inspect before redoing.
|
|
7
|
+
- Classify: `not-started`, `implemented-unverified`, `verified-complete`, `blocked`, or `superseded`. The checkbox represents `verified-complete` only.
|
|
8
|
+
|
|
9
|
+
## Per-task loop
|
|
10
|
+
1. Choose the earliest unmet task whose declared dependencies are verified. Do not infer a dependency is satisfied from its checkbox alone.
|
|
11
|
+
2. Inspect current implementation and run a minimal confirming test to avoid duplication.
|
|
12
|
+
3. For testable behavior work, execute a scoped RED → GREEN → REFACTOR cycle with `showdar-tdd` if installed, or equivalent evidence-first steps directly. Capture each run under the same task ID. If exempt, record a defensible reason and alternate proof.
|
|
13
|
+
4. Apply the smallest scoped change using the repository's Git preflight and policy checks.
|
|
14
|
+
5. Run the task's proof checks and relevant broader checks. Record *actual* commands/results, RED/GREEN/REFACTOR receipts when applicable, and source revision when available.
|
|
15
|
+
6. For verified-complete, check `[x]` and add a concise receipt to the plan ledger *only when the plan file can safely be edited*. If unavailable, leave the artifact untouched and report progress in chat.
|
|
16
|
+
7. For failed or missing proof, leave `[ ]`, classify blocker/unverified state and report the next safe action. Do not mark an unverified task complete.
|
|
17
|
+
|
|
18
|
+
## Replan and resume
|
|
19
|
+
- Mismatched product decision, interface contract or incompatible plan revision: stop affected implementation and reopen that decision with Plan/Brainstorm; do not silently broaden change scope.
|
|
20
|
+
- Keep unchanged task IDs across revisions; explicitly mark superseded tasks and stale receipts without erasing their history.
|
|
21
|
+
- Plan Markdown is not executable orchestration, not user approval, not a workflow-state checkpoint and not a Git permission record.
|
|
22
|
+
- On interruption report exact task IDs, state, relevant test evidence, plan path/revision, remaining blockers and the earliest verified dependency-ready task.
|
|
@@ -60,10 +60,16 @@ Before any task-owned source/config/test/docs write, apply `showdar-git` branch
|
|
|
60
60
|
|
|
61
61
|
- Locate an approved feature brief, established design system and relevant accepted ADRs before proposing UI changes.
|
|
62
62
|
- Preserve approved behavior and product constraints instead of silently revising flow, terminology, or permission rules.
|
|
63
|
-
- When a design decision would materially change approved behavior, ask to reopen just that decision; use installed `showdar-
|
|
63
|
+
- When a design decision would materially change approved behavior, ask to reopen just that decision; use installed `showdar-brainstorm` when a real interview is needed.
|
|
64
64
|
- If a shared term is newly accepted, propose canonical glossary updates through installed `showdar-domain-model` rather than duplicating vocabulary.
|
|
65
65
|
- Do not manufacture ADRs for routine visual preferences or minor component decisions.
|
|
66
66
|
|
|
67
|
+
## Brainstorm and plan handoff
|
|
68
|
+
|
|
69
|
+
- Preserve the accepted behavior and constraints from `showdar-brainstorm` when creating design guidance.
|
|
70
|
+
- Pass relevant design outcomes into `showdar-plan` without marking implementation task checkboxes as done or treating design approval as execution authority.
|
|
71
|
+
|
|
72
|
+
|
|
67
73
|
## Workflow
|
|
68
74
|
|
|
69
75
|
### Mode selection
|
|
@@ -49,15 +49,30 @@ Before any task-owned source/config/test/docs write, apply `showdar-git` branch
|
|
|
49
49
|
|
|
50
50
|
- Before selecting implementation stages, assess whether the requested feature has material unresolved product, permission, state, data, or architecture decisions.
|
|
51
51
|
- If the request is sufficiently defined, skip refinement with a concrete evidence reason; never force an interview for a local, low-risk or already approved change.
|
|
52
|
-
- If materially unclear and the optional `showdar-
|
|
52
|
+
- If materially unclear and the optional `showdar-brainstorm` companion is installed, invoke it before implementation; ask one high-impact question at a time and produce a Decision Brief.
|
|
53
53
|
- If the companion is missing, report it rather than claiming it ran; resolve blocking decisions with the user before continuing.
|
|
54
54
|
- When refinement has been triggered, wait for explicit user approval of the *whole* proposed spec revision before entering `showdar-build`.
|
|
55
55
|
- Carry approved decisions, non-goals, acceptance notes, unresolved questions and evidence into requirements/plan/design without repeating already answered questions.
|
|
56
|
-
- Use the existing canonical spec/ticket when present; persist a new `docs/specs/` document only for durable or complex handoff after approval.
|
|
56
|
+
- Use the existing canonical spec/ticket when present; persist a new `docs/showdar/specs/` document only for durable or complex handoff after approval.
|
|
57
57
|
- If later repository evidence contradicts an approved decision, reopen only the affected decision and obtain revision-specific approval.
|
|
58
58
|
- Refer to installed `showdar-domain-model` for meaningful shared terminology or accepted architectural decisions, not as a required lifecycle stage.
|
|
59
59
|
- This decision gate is portable guidance, not a new router, workflow-state stage, checkpoint authority, or implicit permission to mutate files.
|
|
60
60
|
|
|
61
|
+
## Adaptive TDD companion
|
|
62
|
+
|
|
63
|
+
- `showdar-tdd` is an optional companion for the `showdar-build` implementation loop, not a new candidate stage or workflow-state schema field.
|
|
64
|
+
- For behavior changes with runnable tests, Build should hand the smallest task and acceptance criteria to TDD, retain RED/GREEN/REFACTOR receipts and follow with `showdar-test` and `showdar-review`.
|
|
65
|
+
- If TDD cannot run, record why and use task-appropriate alternate proof. Do not skip verification or imply an unavailable companion was invoked.
|
|
66
|
+
|
|
67
|
+
## Resumable plan handoff
|
|
68
|
+
|
|
69
|
+
- When the `showdar-plan` stage is selected, prefer the repository's canonical plan location for complex or cross-session work; bounded work may keep a short plan in chat.
|
|
70
|
+
- Supply `showdar-build` with the approved spec reference, persisted plan path and revision (or explicit in-chat brief), stable task IDs, dependencies and required verification.
|
|
71
|
+
- A saved task checkbox is neither an approval nor a workflow stage completion receipt; the receiving Build agent must revalidate current repo and evidence.
|
|
72
|
+
- On session changes or interruptions use `showdar-recover` to reconcile plan tasks with actual source and tests before continuing.
|
|
73
|
+
- Do not add new workflow-state schema fields or treat plan persistence as a substitute for serialized workflow checkpoints.
|
|
74
|
+
|
|
75
|
+
|
|
61
76
|
## Workflow
|
|
62
77
|
|
|
63
78
|
### Phase 1 — determine needed stages
|
|
@@ -55,10 +55,24 @@ Before any task-owned source/config/test/docs write, apply `showdar-git` branch
|
|
|
55
55
|
|
|
56
56
|
- Read an available approved Decision Brief, canonical glossary and accepted ADRs before selecting the approach.
|
|
57
57
|
- Treat approved alternatives and non-goals as constraints; avoid re-opening decisions merely to make the plan look cleaner.
|
|
58
|
-
- If a materially different choice is required, stop and reopen only affected decisions through `showdar-
|
|
58
|
+
- If a materially different choice is required, stop and reopen only affected decisions through `showdar-brainstorm` if installed, or request the user decision directly.
|
|
59
59
|
- Use `showdar-domain-model` only to propose a meaningful new shared concept or approved high-impact architecture record.
|
|
60
60
|
- Approval of a design never grants write, Git, release, or production authority.
|
|
61
61
|
|
|
62
|
+
## Adaptive Plan Persistence and handoff
|
|
63
|
+
|
|
64
|
+
- Read `references/plan-persistence.md` when a durable plan or cross-session handoff is needed; `examples/persisted-plan.md` illustrates the shape, not a mandatory template.
|
|
65
|
+
- Locate the repository's canonical ticket/plan first. Reuse a matching existing artifact; never create a duplicate solely because its path differs from `docs/showdar/plans/`.
|
|
66
|
+
- For bounded work contained in one session, a short in-chat plan is sufficient. For complex, staged, multi-agent or cross-session work, propose a Markdown plan at the canonical location, defaulting to `docs/showdar/plans/<feature>.md` only if no convention exists.
|
|
67
|
+
- Before creating or modifying a plan file, obtain authorization for that write and pass Git preflight; if blocked, provide the proposed plan in chat without claiming it was persisted.
|
|
68
|
+
- Reference the approved spec/ticket and its revision where one exists. If `showdar-brainstorm` was triggered, do not designate a plan execution-ready until the entire Decision Brief revision has explicit user approval.
|
|
69
|
+
- Assign stable `TASK-NNN` identifiers to ordered tasks with `- [ ]` checkboxes; include requirement/decision IDs, dependency IDs, scope, edge behavior, exact existing proof commands or explicitly manual checks, and acceptance conditions.
|
|
70
|
+
- Planning alone never checks any task. The plan's `ready` status records preparedness, not implementation authority or proof.
|
|
71
|
+
- Store plan revision, state, linked spec revision, risks, verification ledger, blockers and next dependency-ready task. Never fabricate approvals, command output, commit SHA or test results.
|
|
72
|
+
- Revising scope requires identifying affected tasks and increasing plan revision. Preserve stable IDs for unchanged outcomes, keep historical proof while marking stale receipts invalid, and never silently amend an approved product decision.
|
|
73
|
+
- Handoff states the exact plan path/revision or in-chat brief, persistence status (skipped/proposed/written), unresolved blockers and next actionable task.
|
|
74
|
+
|
|
75
|
+
|
|
62
76
|
## Workflow
|
|
63
77
|
|
|
64
78
|
### Phase 1 — normalize the requirement
|
|
@@ -86,6 +100,7 @@ Before any task-owned source/config/test/docs write, apply `showdar-git` branch
|
|
|
86
100
|
### Phase 5 — decompose execution
|
|
87
101
|
- Order tasks by dependency and independent reviewability.
|
|
88
102
|
- Each task states files/symbols, behavior, error/edge behavior, test, and verification command.
|
|
103
|
+
- For testable behavior tasks, include an expected RED → GREEN → REFACTOR sequence and the test boundary/command; where unavailable, document why and choose an honest alternative proof, never fake RED output.
|
|
89
104
|
- Keep task boundaries small enough that a reviewer could approve one and reject the next.
|
|
90
105
|
|
|
91
106
|
### Phase 6 — self-review
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Example: Invitation RSVP editing implementation plan
|
|
2
|
+
|
|
3
|
+
> Illustrative schema only. Replace examples with evidence from the actual repository; never invent a test command, approval or commit SHA.
|
|
4
|
+
|
|
5
|
+
- Plan revision: 1
|
|
6
|
+
- Status: ready
|
|
7
|
+
- Canonical spec: existing approved invitation spec (identify its path/revision in the real project)
|
|
8
|
+
- Goal: authenticated hosts can edit RSVP configuration
|
|
9
|
+
- Non-goals: guest authentication redesign and database replacement
|
|
10
|
+
- Existing evidence: to be populated from repository inspection
|
|
11
|
+
- Approach: validate and authorize patch at service boundary; preserve guest read contract
|
|
12
|
+
- Risk/rollback: host-only feature flag; avoid breaking guest payload
|
|
13
|
+
|
|
14
|
+
## Ordered tasks
|
|
15
|
+
|
|
16
|
+
- [ ] **TASK-001** — Validate and authorize host updates.
|
|
17
|
+
- Depends on: none
|
|
18
|
+
- Acceptance: authorized patch succeeds; wrong owner, invalid payload and expired deadline fail
|
|
19
|
+
- Files/symbols: name verified API and service symbols during planning
|
|
20
|
+
- TDD: expected RED is denied-owner update test; GREEN is minimal authorization/validation; REFACTOR reruns unchanged behavior proof.
|
|
21
|
+
- Proof: existing project integration test command (discover exact command before execution)
|
|
22
|
+
- [ ] **TASK-002** — Refresh host UI after successful mutation.
|
|
23
|
+
- Depends on: TASK-001
|
|
24
|
+
- Acceptance: host shows saved values; failed save preserves previous values and explains failure
|
|
25
|
+
- Proof: repository-native component test and manual negative path where needed
|
|
26
|
+
|
|
27
|
+
## Verification ledger
|
|
28
|
+
|
|
29
|
+
| Task ID | State | Command / scenario | Result | Source ref | Evidence gap |
|
|
30
|
+
| --- | --- | --- | --- | --- | --- |
|
|
31
|
+
| TASK-001 | pending | not run | not verified | unknown | awaiting implementation |
|
|
32
|
+
| TASK-002 | pending | not run | not verified | unknown | depends on TASK-001 |
|
|
33
|
+
|
|
34
|
+
## Open decisions and next step
|
|
35
|
+
|
|
36
|
+
- Blocker: none assumed by the example; verify against the real spec
|
|
37
|
+
- Next: TASK-001 after confirming execution authorization and Git preflight
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Adaptive Plan Persistence
|
|
2
|
+
|
|
3
|
+
## Choose a location
|
|
4
|
+
1. Read repo instructions and discover existing plan/ticket conventions. Existing canonical artifacts take priority.
|
|
5
|
+
2. Short, single-session work stays in chat. For staged, cross-session or multi-agent work, propose a Markdown plan at the canonical plan path; use `docs/showdar/plans/<feature>.md` only when the repo has no convention.
|
|
6
|
+
3. A request for advice/plan is not blanket permission to write files. Present the proposed path/content and acquire authorization as needed, then run Git preflight. If the write is blocked, leave the proposal in chat.
|
|
7
|
+
4. Link the approved spec/ticket and revision. An unapproved brainstorm draft cannot become an execution-ready plan.
|
|
8
|
+
|
|
9
|
+
## Durable plan contract
|
|
10
|
+
- Header includes goal, plan revision, status (`proposed` / `ready` / `in-progress` / `blocked` / `completed`), spec path/reference and spec revision if applicable.
|
|
11
|
+
- Include non-goals, concrete current-state evidence, chosen approach/trade-offs, risks/rollbacks and unresolved decisions.
|
|
12
|
+
- Every task has stable `TASK-NNN` ID, unchecked `- [ ]`, dependency IDs, covered acceptance/decision IDs, file/symbol scope, observable behavior, edge/error cases and exact existing proof commands or a clearly labeled manual check.
|
|
13
|
+
- Add a verification ledger with task ID, actual command/check, outcome, environment/ref when known and gaps. Planned checks are not actual verification.
|
|
14
|
+
- Plan a RED → GREEN → REFACTOR loop for testable behavior changes. Link intended failing assertion, test command, minimum production change, and proof after refactoring. For non-applicable work label the exemption and alternate verification, without inventing a failing run.
|
|
15
|
+
- Mark the first dependency-ready, not-yet-proven task as the next action; do not simply pick the first unchecked item when its prerequisites are unmet.
|
|
16
|
+
|
|
17
|
+
## Ownership and completion
|
|
18
|
+
- Only implementation plus passing required proof permits checking `[x]`. Absent, failed, skipped, or stale proof leaves `[ ]` and is reported as blocked or implemented-unverified.
|
|
19
|
+
- A checked box is not itself proof. Repo code/tests and fresh evidence override stale narration.
|
|
20
|
+
- When decisions change, increment plan revision, preserve unchanged task IDs, track superseded work and invalidate affected evidence explicitly; never erase historical results.
|
|
21
|
+
- The approved spec governs product behavior; the plan does not grant Git mutation permission, merge authority or deployment privileges.
|
|
22
|
+
- Workflow-state checkpoint JSON remains an independent execution record with no plan-path additions.
|
|
23
|
+
|
|
24
|
+
## Handoff
|
|
25
|
+
Report plan path/revision (or chat-only), what was proven, blocked/unverified task IDs, exact proof and next dependency-ready task. Never silently persist if the user only asked for a read-only plan.
|
|
@@ -51,6 +51,21 @@ Before any task-owned source/config/test/docs write, apply `showdar-git` branch
|
|
|
51
51
|
- Re-run relevant verification before declaring recovered work complete.
|
|
52
52
|
- Conflict resolution must preserve semantic intent from both sides, not just remove markers.
|
|
53
53
|
|
|
54
|
+
## Recover TDD evidence
|
|
55
|
+
|
|
56
|
+
- For partially completed tasks, inspect actual tests/code and the RED/GREEN/REFACTOR ledger when present. Treat old test logs and checkboxes as hints; rerun relevant proof before declaring verified-complete.
|
|
57
|
+
- If interrupted in RED, make no assumption that implementation started. If interrupted in GREEN or REFACTOR, check the code against acceptance and rerun targeted test before further edits.
|
|
58
|
+
- When the companion is absent, resume with the same evidence contract through Build/Test; do not fabricate a historical RED run.
|
|
59
|
+
|
|
60
|
+
## Resume from persisted plans
|
|
61
|
+
|
|
62
|
+
- Locate the canonical plan and matching approved spec, if present. Never presume `docs/showdar/plans/` is canonical when the repo specifies another path.
|
|
63
|
+
- Compare stable task IDs, recorded revision, task checkboxes and evidence ledger with current Git changes and executable proof.
|
|
64
|
+
- A checked task with stale or missing proof is `implemented-unverified`. Preserve existing and unrelated user edits and reverify rather than automatically repeating the implementation.
|
|
65
|
+
- Identify the first unmet dependency-ready task, then hand it to `showdar-build`. If plan and spec conflict, stop and request a targeted plan revision.
|
|
66
|
+
- Do not treat a plan file as Git/implementation authority or rewrite progress without normal preflight.
|
|
67
|
+
|
|
68
|
+
|
|
54
69
|
## Workflow
|
|
55
70
|
|
|
56
71
|
### Phase 1 — reconstruct goal
|
|
@@ -59,11 +59,17 @@ Before any task-owned source/config/test/docs write, apply `showdar-git` branch
|
|
|
59
59
|
## Approved-spec and refinement handoff
|
|
60
60
|
|
|
61
61
|
- First inspect existing canonical spec/ticket and an approved Decision Brief when available; do not restart an interview for accepted decisions.
|
|
62
|
-
- If blocking product or architectural choices remain and `showdar-
|
|
62
|
+
- If blocking product or architectural choices remain and `showdar-brainstorm` is installed, use it as a companion before claiming the requirement implementation-ready.
|
|
63
63
|
- Once refinement was triggered, no implementation may begin until the user explicitly approves the complete spec.
|
|
64
64
|
- Capture newly agreed shared terms for an optional `showdar-domain-model` glossary proposal; do not silently edit docs or infer approvals.
|
|
65
65
|
- Preserve Decision Brief IDs and non-goals in acceptance criteria. Report missing approval or conflicting sources as blockers.
|
|
66
66
|
|
|
67
|
+
## Brainstorm handoff
|
|
68
|
+
|
|
69
|
+
- Reuse the complete approved Decision Brief from `showdar-brainstorm` rather than interviewing again; preserve stable decision IDs and revision.
|
|
70
|
+
- If brainstorming occurred but full-spec approval is absent, stop before claiming requirements are implementation-ready.
|
|
71
|
+
|
|
72
|
+
|
|
67
73
|
## Workflow
|
|
68
74
|
|
|
69
75
|
### Phase 1 — establish the source of truth
|
|
@@ -53,6 +53,13 @@ description: Use when reviewing code or diffs for general correctness, architect
|
|
|
53
53
|
- Propose glossary/ADR changes through installed `showdar-domain-model` only when a real accepted domain or architectural decision has changed.
|
|
54
54
|
- Reviewing code does not authorize editing domain docs or overriding approval decisions.
|
|
55
55
|
|
|
56
|
+
## Saved-plan review checks
|
|
57
|
+
|
|
58
|
+
- Where relevant, compare the code diff against the canonical plan revision, linked approved spec and task evidence ledger.
|
|
59
|
+
- Flag tasks whose checkboxes claim completion but whose behavior or verification receipts do not substantiate that claim.
|
|
60
|
+
- Return findings linked to task IDs; Review does not grant permission to change plan state or approved decisions.
|
|
61
|
+
|
|
62
|
+
|
|
56
63
|
## Workflow
|
|
57
64
|
|
|
58
65
|
### Phase 1 — understand intent and diff
|
|
@@ -20,7 +20,7 @@ description: Use when onboarding a repository, auditing project context, or prop
|
|
|
20
20
|
|
|
21
21
|
## When not to use
|
|
22
22
|
|
|
23
|
-
- A single feature needs questions: use showdar-
|
|
23
|
+
- A single feature needs questions: use showdar-brainstorm.
|
|
24
24
|
- An existing contract needs implementation: use the appropriate lifecycle skill.
|
|
25
25
|
- The user only wants the interactive CLI installer: use showdar setup.
|
|
26
26
|
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: showdar-tdd
|
|
3
|
+
description: Use when implementing a testable behavior change or regression through a verified RED, GREEN, and REFACTOR cycle with executable evidence.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Showdar TDD
|
|
7
|
+
|
|
8
|
+
## Mandatory Git preflight for task-owned writes
|
|
9
|
+
|
|
10
|
+
Before any test, source, config or documentation write, respect the repository's Git policy and inspect worktree state. On a protected integration branch, prepare a task branch with `showdar git-start --type <type> --name "<task>"` when the CLI is present. Before every write, require `showdar guard --mutation local-write --json` to return `ok=true` and `data.allowed=true`. If blocked, stop before editing. If the Showdar CLI is unavailable in a skills-only installation, perform the equivalent manual Git/policy preflight; never download it automatically, and never infer commit, merge, push or deployment authority.
|
|
11
|
+
|
|
12
|
+
## Purpose
|
|
13
|
+
|
|
14
|
+
- Deliver a bounded behavior change with evidence-backed RED → GREEN → REFACTOR.
|
|
15
|
+
- Use executable behavior tests to constrain production code rather than test internal structure.
|
|
16
|
+
- Keep each iteration small, reversible and aligned with the approved spec or task plan.
|
|
17
|
+
- Produce task-linked proof that `showdar-build` can use without claiming unverified completion.
|
|
18
|
+
- This is a portable companion skill; it does not introduce a new workflow-state stage.
|
|
19
|
+
|
|
20
|
+
## When to use
|
|
21
|
+
|
|
22
|
+
- The user explicitly invokes `showdar-tdd` for an actionable, testable change.
|
|
23
|
+
- `showdar-build` is implementing a bounded behavior task and a runnable test boundary exists.
|
|
24
|
+
- A regression with known root cause needs a test that fails before its fix.
|
|
25
|
+
- A public contract, parser, business rule, state transition, or UI interaction needs demonstrable behavior proof.
|
|
26
|
+
|
|
27
|
+
## When not to use
|
|
28
|
+
|
|
29
|
+
- User requests only test strategy or test coverage assessment; use `showdar-test`.
|
|
30
|
+
- Root cause is unknown; investigate via `showdar-debug` before coding a guessed fix.
|
|
31
|
+
- Work is documentation-only, generated-only, or a pure visual reference lacking an executable harness.
|
|
32
|
+
- An already-verified implementation merely needs independent checks; use `showdar-test`.
|
|
33
|
+
- Requirements are materially ambiguous or approved scope is missing after brainstorming; return to the appropriate decision gate.
|
|
34
|
+
|
|
35
|
+
## Inputs and assumptions
|
|
36
|
+
|
|
37
|
+
- Read task acceptance criteria, current approved spec and plan task ID when supplied.
|
|
38
|
+
- Inspect repository manifests, test setup and current behavior before selecting a test command.
|
|
39
|
+
- Determine the actual behavioral boundary, owners and affected consumers.
|
|
40
|
+
- Discover the existing test framework; do not invent package scripts or command names.
|
|
41
|
+
- Read `references/red-green-refactor.md` for the evidence and exemption contract.
|
|
42
|
+
- For behavior examples, read `examples/behavior-change.md` when helpful.
|
|
43
|
+
|
|
44
|
+
## Non-negotiable rules
|
|
45
|
+
|
|
46
|
+
- Confirm required full-spec approval if `showdar-brainstorm` was triggered; no new approval ceremony for already specified changes.
|
|
47
|
+
- RED means a newly written behavioral test actually failed for the expected missing behavior; syntax, imports, environment or flaky fixture errors do not count.
|
|
48
|
+
- Do not write production implementation before obtaining a meaningful RED when a reproducible harness is available.
|
|
49
|
+
- GREEN means the same focused test passes after the smallest adequate implementation.
|
|
50
|
+
- REFACTOR follows GREEN, changes structure without changing intended behavior, and reruns the focused tests to prove they remain green.
|
|
51
|
+
- Keep one behavior/invariant per cycle; for multiple independent behaviors, repeat the cycle.
|
|
52
|
+
- Do not weaken assertions, remove tests, fake outputs, mock away the behavior under test or swallow exceptions to get GREEN.
|
|
53
|
+
- Preserve unrelated working-tree changes and public contracts; do not reset, clean, commit, push or merge without explicit authority.
|
|
54
|
+
- When a test cannot be run, report the constraint and alternate verification; never fabricate RED, GREEN or REFACTOR receipts.
|
|
55
|
+
- A checkbox, narrative or previous agent claim is not evidence of a passing test.
|
|
56
|
+
|
|
57
|
+
## Workflow
|
|
58
|
+
|
|
59
|
+
### Phase 1 — scope a single observable behavior
|
|
60
|
+
- Read the current plan and linked spec; identify the earliest dependency-ready task.
|
|
61
|
+
- Name the user-visible success condition and at least one important negative/error case.
|
|
62
|
+
- Confirm existing code/test coverage and the smallest reliable test boundary.
|
|
63
|
+
- If required evidence, approval or Git state is missing, stop before mutation.
|
|
64
|
+
|
|
65
|
+
### Phase 2 — RED: capture a meaningful failure
|
|
66
|
+
- Write the smallest new or modified automated test expressing the required behavior.
|
|
67
|
+
- Run the exact targeted command against current production code.
|
|
68
|
+
- Record the task ID, test location, command, expected failing assertion and observed failure.
|
|
69
|
+
- If the test passes unexpectedly, determine whether behavior already exists or the test is invalid; never pretend it failed.
|
|
70
|
+
- If it fails due to harness/setup/environment, repair or report the harness before claiming RED.
|
|
71
|
+
|
|
72
|
+
### Phase 3 — GREEN: implement minimally
|
|
73
|
+
- Change the smallest coherent production surface that satisfies the observed failing behavior.
|
|
74
|
+
- Rerun the same targeted test; record the actual outcome.
|
|
75
|
+
- Confirm relevant negative, boundary and error behavior rather than adding broad unrelated code.
|
|
76
|
+
- If not green, iterate on the same scoped behavior without broad speculative refactors.
|
|
77
|
+
|
|
78
|
+
### Phase 4 — REFACTOR: keep behavior green
|
|
79
|
+
- Clean duplication, naming and ownership within the approved task only when beneficial.
|
|
80
|
+
- Run the same targeted test again and ensure the observed behavior remains green.
|
|
81
|
+
- If refactoring introduces failures, correct them or revert that refactor without discarding user changes.
|
|
82
|
+
- Run relevant adjacent tests, typecheck/lint/build according to the repository and affected risk.
|
|
83
|
+
|
|
84
|
+
### Phase 5 — handoff the proof
|
|
85
|
+
- Report the task ID, changed tests and production files, exact RED/GREEN/REFACTOR evidence, broadened checks and residual gaps.
|
|
86
|
+
- Only when the required proof succeeded may `showdar-build` mark the corresponding plan task `[x]` and update its verification ledger under normal Git preflight.
|
|
87
|
+
- Leave a missing, failed or unverified test as `[ ]`; do not claim task completion.
|
|
88
|
+
- Keep the separate `showdar-test` verification and `showdar-review` stages; TDD is not a substitute for them.
|
|
89
|
+
|
|
90
|
+
## Decision points
|
|
91
|
+
|
|
92
|
+
- Existing implementation already meets the new test? Stop and inspect requirements; do not manufacture a RED by breaking code.
|
|
93
|
+
- Only a manual environment can demonstrate behavior? State the TDD exemption and use honest manual/contract proof.
|
|
94
|
+
- Test scope spans infrastructure? Prefer the lowest effective integration level that still exercises the contract.
|
|
95
|
+
- UI/native timing concerns? Use controllable event/clock boundaries rather than arbitrary sleeps.
|
|
96
|
+
- Requirements or public compatibility changed during GREEN? Stop the affected task and request a revised approved decision.
|
|
97
|
+
- Missing TDD companion elsewhere? `showdar-build` may follow this contract directly; never claim a companion ran when absent.
|
|
98
|
+
|
|
99
|
+
## Stack detection
|
|
100
|
+
|
|
101
|
+
- React/Next.js/Vite: inspect the existing Vitest/Jest/component test setup and server/client boundaries.
|
|
102
|
+
- React Native: respect gesture, navigation, native and lifecycle boundaries; use installed RN testing tools.
|
|
103
|
+
- Flutter: use existing `flutter test` / widget / integration-test setup only after confirming project commands.
|
|
104
|
+
- Backend: choose unit for pure rules and integration for persistence/auth/protocol semantics.
|
|
105
|
+
- Unsupported stacks: use repository-native tests or explicitly report no runnable test harness.
|
|
106
|
+
|
|
107
|
+
## Failure modes
|
|
108
|
+
|
|
109
|
+
- Claiming RED from an import error, failing unrelated suite or omitted test execution.
|
|
110
|
+
- Writing implementation first and then constructing an artificial failing test narrative.
|
|
111
|
+
- Accepting GREEN after weakening assertions, stubbing the very contract under test or dropping error cases.
|
|
112
|
+
- Refactoring outside the task scope to make a green check look more comprehensive.
|
|
113
|
+
- Checking plan tasks done based on source edits without verified proof.
|
|
114
|
+
- Forcing ceremonial TDD on design mockups, docs-only tasks or unavailable harnesses.
|
|
115
|
+
|
|
116
|
+
## Stop conditions
|
|
117
|
+
|
|
118
|
+
- Stop when the scoped behavior has RED, GREEN and post-REFACTOR proof plus suitable broader checks.
|
|
119
|
+
- Stop and report blocked if the harness or expected failure cannot be reproduced honestly.
|
|
120
|
+
- Stop before unapproved spec changes, protected Git mutations, release or deployment actions.
|
|
121
|
+
- If the task is already complete, report evidence without inventing a new test-first cycle.
|
|
122
|
+
|
|
123
|
+
## Escalation conditions
|
|
124
|
+
|
|
125
|
+
- Ask about unresolved product, auth, data or compatibility choices that materially alter behavior.
|
|
126
|
+
- Return to debugging for unknown root causes or nondeterministic failures.
|
|
127
|
+
- Return to plan/brainstorm for changed architecture or approved requirements.
|
|
128
|
+
- Request permission before modifying unrelated user-owned files or rewriting canonical plans.
|
|
129
|
+
|
|
130
|
+
## Verification
|
|
131
|
+
|
|
132
|
+
- Confirm every stated test command exists and was run, or identify the unverified gap.
|
|
133
|
+
- Distinguish intentional assertion RED from broken runner/configuration.
|
|
134
|
+
- Verify focused behavior passes after both GREEN and REFACTOR.
|
|
135
|
+
- Check relevant boundary, error and adjacent contract coverage.
|
|
136
|
+
- Compare implementation against linked task/spec and report accidental scope expansion.
|
|
137
|
+
|
|
138
|
+
## Output contract
|
|
139
|
+
|
|
140
|
+
- **Task and invariant** — plan task ID when available, linked requirement and chosen test boundary.
|
|
141
|
+
- **RED** — test/command, expected assertion, observed failure or explicit exemption.
|
|
142
|
+
- **GREEN** — minimal implementation and actual passing test/command.
|
|
143
|
+
- **REFACTOR** — scope of cleanup and actual post-refactor passing result.
|
|
144
|
+
- **Broader checks** — commands and outcomes; distinguish unrun checks from passed checks.
|
|
145
|
+
- **Handoff** — paths changed, remaining risks and plan completion recommendation, not invented authority.
|
|
146
|
+
|
|
147
|
+
## Anti-patterns
|
|
148
|
+
|
|
149
|
+
- Mandating an E2E test for a rule already proved at unit/integration boundary.
|
|
150
|
+
- Treating test-first as a textual checklist instead of an executed failing test.
|
|
151
|
+
- Confusing generated test files with a repeatable automated harness.
|
|
152
|
+
- Hiding environmental failures by claiming TDD passed.
|
|
153
|
+
- Treating a passing test as authority to merge, publish or skip review.
|
|
154
|
+
|
|
155
|
+
## Example
|
|
156
|
+
|
|
157
|
+
- In a pricing rule task, write a test asserting an exclusive upper bound and run it before changing the rate lookup. The test must fail for the expected boundary behavior.
|
|
158
|
+
- Implement the smallest correct bracket comparison, prove the test now passes, clean naming without changing the contract and rerun the test.
|
|
159
|
+
- Report RED, GREEN, REFACTOR commands/results to Build for task-ledger update. If no test framework exists, report the exemption and alternate verification rather than inventing output.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Example: rate-table exclusive upper bound (illustrative only)
|
|
2
|
+
|
|
3
|
+
Task: TASK-002 — fee lookup uses a `[min, max)` bracket where `max` is exclusive.
|
|
4
|
+
|
|
5
|
+
RED:
|
|
6
|
+
- Write an assertion that a key equal to `max` must not match a bracket.
|
|
7
|
+
- Run the repository's **existing** targeted test command against current production code.
|
|
8
|
+
- Observe the intended assertion failure. A command failing because the test tool is missing is not valid RED.
|
|
9
|
+
|
|
10
|
+
GREEN:
|
|
11
|
+
- Make the smallest code change to implement `key >= min && key < max`.
|
|
12
|
+
- Run the same focused test command and confirm it passes.
|
|
13
|
+
|
|
14
|
+
REFACTOR:
|
|
15
|
+
- Improve duplication/naming within the pricing change only, if needed.
|
|
16
|
+
- Rerun the focused tests, relevant full suite and typecheck as appropriate.
|
|
17
|
+
|
|
18
|
+
Handoff:
|
|
19
|
+
- Record the exact executed commands and results under TASK-002's verification ledger.
|
|
20
|
+
- Never check a task complete from this example alone; this document is explanatory, not test output.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# RED → GREEN → REFACTOR contract
|
|
2
|
+
|
|
3
|
+
## Prerequisites
|
|
4
|
+
- Confirm current approved behavior and a single task or observable invariant.
|
|
5
|
+
- Determine the lowest test level that exercises the real contract and name an existing executable test command.
|
|
6
|
+
- Check Git preflight before writing the test file. This companion never bypasses showdar guard or branch policy.
|
|
7
|
+
|
|
8
|
+
## Evidence for RED
|
|
9
|
+
- Add the smallest test targeting missing behavior, then run it **before** production edits.
|
|
10
|
+
- The test must fail for a specific expected behavioral assertion. Test loader, dependency, setup, syntax, flaky timing and unrelated failures do **not** establish RED.
|
|
11
|
+
- Record test path, command, observed failing assertion, environment and task ID. If the command cannot run, stop or document an exemption.
|
|
12
|
+
- If the test already passes, verify whether functionality exists and whether requirements are satisfied; do not deliberately sabotage code to fake a failing test.
|
|
13
|
+
|
|
14
|
+
## Evidence for GREEN
|
|
15
|
+
- Implement only enough production behavior to satisfy the failure while honoring adjacent contracts.
|
|
16
|
+
- Run the same targeted command and record its **actual** passing result. Do not weaken/delete assertions or replace the real boundary with a permissive mock.
|
|
17
|
+
- Validate the meaningful negative path. Leave work unverified if the test remains flaky or has not run.
|
|
18
|
+
|
|
19
|
+
## Evidence for REFACTOR
|
|
20
|
+
- When structurally useful, refactor production or test code inside the approved task scope without changing requirements.
|
|
21
|
+
- Run the same focused test again, then relevant broader suite/typecheck/lint/build checks. Record both actual results.
|
|
22
|
+
- If no refactor is needed, explicitly note that and rerun the focused test to verify the final state.
|
|
23
|
+
|
|
24
|
+
## Exemptions and handoff
|
|
25
|
+
- A pure Markdown edit, visual specification without app harness, generated-only artifact or unavailable runner may be unsuitable for automated TDD. Record exact cause and credible alternate proof; don't write hollow tests.
|
|
26
|
+
- Keep test strategy and integration/E2E coverage under showdar-test, final review under showdar-review.
|
|
27
|
+
- For a persisted `docs/showdar/plans/<feature>.md` plan, record per-task RED, GREEN and REFACTOR receipts in its verification ledger **only after Git preflight** and do not mark `[x]` until full required proof exists.
|
|
28
|
+
- Never invent commands, results, current source revisions or approvals. The plan ledger cannot grant Git, build or release authority.
|
|
@@ -51,6 +51,20 @@ Before any task-owned source/config/test/docs write, apply `showdar-git` branch
|
|
|
51
51
|
- Keep test-only shortcuts out of production APIs.
|
|
52
52
|
- Do not use snapshot-only assertions for critical behavior.
|
|
53
53
|
|
|
54
|
+
## Relationship with showdar-tdd
|
|
55
|
+
|
|
56
|
+
- `showdar-tdd` owns the tight RED → GREEN → REFACTOR implementation loop for a bounded behavior task, if the companion is installed.
|
|
57
|
+
- This skill owns test strategy, selecting the correct boundary, regression, integration and E2E coverage and independent verification; it is not replaced by TDD.
|
|
58
|
+
- When TDD is active, require genuine expected RED evidence (not configuration failure), a passing GREEN test and another passing test after REFACTOR. If the companion is absent, these behavior-first rules still apply.
|
|
59
|
+
- Do not demand artificial RED proofs for docs-only work, generated assets, existing behavior re-verification or no runnable harness; state an alternative verified check.
|
|
60
|
+
|
|
61
|
+
## Task-plan verification handoff
|
|
62
|
+
|
|
63
|
+
- When a task plan exists, derive relevant proof cases from its task IDs, acceptance notes and linked approved spec.
|
|
64
|
+
- Send concrete command/scenario and pass/fail evidence back to `showdar-build` for progress ledger updates; Test alone does not mark plan tasks completed.
|
|
65
|
+
- Never treat a checked box as a test result, and never certify skipped, stale or blocked proof.
|
|
66
|
+
|
|
67
|
+
|
|
54
68
|
## Workflow
|
|
55
69
|
|
|
56
70
|
### Phase 1 — state the invariant
|
package/src/adapter-renderers.js
CHANGED
|
@@ -4,7 +4,7 @@ const RUNTIME_GUIDANCE = `Automatic Showdar selection: route the current request
|
|
|
4
4
|
Explicit named-skill requests may load that installed skill directly without automatic routing. Workflow skills remain native discoverable choices; the router does not select workflows. If the CLI is unavailable, use native skill discovery/static descriptions below. Do not fetch a CLI through npx or install dependencies automatically.
|
|
5
5
|
Routing does not authorize mutation. Inspect the returned mutation class and current task authority before work. For local-write tasks, before the first task-owned source edit inspect Git state. On develop, development, dev, main, master or the repository default/integration branch, DO NOT begin source edits yet: prepare one branch per coherent task first. Follow repository instructions/documented convention, explicit current user instruction, clearly detected convention, then the Showdar safe default. Explicit trunk/direct-work policy wins.
|
|
6
6
|
Before ANY task-owned source/config/test/docs write, execute Git preflight even if the router selected build directly. On integration/default branches inspect repository policy and EXECUTE \`showdar git-start --type <type> --name <task>\` (not just --dry-run), or equivalent repository-safe branch preparation. Then EXECUTE \`showdar guard --mutation local-write --json\` and require ok=true AND data.allowed=true BEFORE invoking any file-writing tool. If blocked, STOP before editing. On a matching task branch run guard without creating a new branch. Recheck before each later mutating stage. Do not infer permission from \`showdar route\`. If the CLI is unavailable, manually inspect Git and confirm the appropriate task branch or documented direct-work policy; never silently write on develop/main. Dirty ownership/branch collisions require inspection; never infer stash/reset/restore/clean. Guard and git-start do not authorize source edits, commit, merge or push. Completion means verify and report.
|
|
7
|
-
Companions are portable and do not compete for canonical lifecycle primary: showdar-setup onboards a project, showdar-
|
|
7
|
+
Companions are portable and do not compete for canonical lifecycle primary: showdar-setup onboards a project, showdar-brainstorm is a conditional pre-implementation decision gate requiring explicit approval of the whole spec when triggered, and showdar-domain-model maintains accepted glossary/ADR knowledge only after approved changes, and showdar-tdd is an optional RED → GREEN → REFACTOR companion within showdar-build for testable behavior tasks (not a lifecycle stage). If a companion is not installed, never imply it ran. Shared project context: before project work, read the relevant existing files under docs/agents/ (project.md, issue-tracker.md, verification.md, domain.md) when present. These are project-specific conventions, not mutation authority. Use the canonical glossary and ADRs when present; do not invent them. If project context is missing or stale, read repository evidence and suggest invoking installed showdar-setup when useful; showdar setup in the CLI is only an interactive skill installer.`;
|
|
8
8
|
|
|
9
9
|
const CANONICAL_ROUTE_ORDER = [
|
|
10
10
|
['map repository architecture, dependencies, or impact', 'showdar-understand'],
|
package/src/catalog.js
CHANGED
|
@@ -21,7 +21,8 @@ export const SKILLS = [
|
|
|
21
21
|
|
|
22
22
|
export const COMPANION_SKILLS = [
|
|
23
23
|
{ id: 'showdar-setup', kind: 'companion', domain: 'onboarding', description: 'Use when onboarding a repository, auditing project context, or proposing grounded glossary and agent documentation improvements.' },
|
|
24
|
-
{ id: 'showdar-
|
|
24
|
+
{ id: 'showdar-brainstorm', kind: 'companion', domain: 'brainstorming', description: 'Use when brainstorming feature ideas, challenging assumptions, comparing alternatives, and approving a complete spec before implementation.' },
|
|
25
|
+
{ id: 'showdar-tdd', kind: 'companion', domain: 'tdd', description: 'Use when implementing a testable behavior change or regression through a verified RED, GREEN, and REFACTOR cycle with executable evidence.' },
|
|
25
26
|
{ id: 'showdar-domain-model', kind: 'companion', domain: 'domain', description: 'Use when clarifying shared domain terminology, maintaining an evidence-backed glossary, or documenting confirmed architectural decisions as ADRs.' },
|
|
26
27
|
];
|
|
27
28
|
|
|
@@ -50,10 +51,10 @@ const ids = (...values) => values;
|
|
|
50
51
|
|
|
51
52
|
export const PROFILES = {
|
|
52
53
|
minimal: ids('showdar-understand', 'showdar-plan', 'showdar-build', 'showdar-debug', 'showdar-test', 'showdar-review', 'showdar-recover', 'showdar-git'),
|
|
53
|
-
developer: ids('showdar-understand', 'showdar-plan', 'showdar-design', 'showdar-build', 'showdar-debug', 'showdar-test', 'showdar-review', 'showdar-upgrade', 'showdar-ship', 'showdar-recover', 'showdar-git', 'showdar-security', 'showdar-setup', 'showdar-
|
|
54
|
-
backend: ids('showdar-understand', 'showdar-plan', 'showdar-build', 'showdar-debug', 'showdar-test', 'showdar-review', 'showdar-upgrade', 'showdar-ship', 'showdar-recover', 'showdar-git', 'showdar-requirements', 'showdar-quality', 'showdar-security', 'showdar-ops', 'showdar-setup', 'showdar-
|
|
55
|
-
qa: ids('showdar-understand', 'showdar-requirements', 'showdar-quality', 'showdar-test', 'showdar-debug', 'showdar-review', 'showdar-ship', 'showdar-recover', 'showdar-git', 'showdar-setup', 'showdar-
|
|
56
|
-
product: ids('showdar-understand', 'showdar-requirements', 'showdar-plan', 'showdar-design', 'showdar-quality', 'showdar-review', 'showdar-setup', 'showdar-
|
|
54
|
+
developer: ids('showdar-understand', 'showdar-plan', 'showdar-design', 'showdar-build', 'showdar-debug', 'showdar-test', 'showdar-review', 'showdar-upgrade', 'showdar-ship', 'showdar-recover', 'showdar-git', 'showdar-security', 'showdar-setup', 'showdar-brainstorm', 'showdar-domain-model', 'showdar-tdd'),
|
|
55
|
+
backend: ids('showdar-understand', 'showdar-plan', 'showdar-build', 'showdar-debug', 'showdar-test', 'showdar-review', 'showdar-upgrade', 'showdar-ship', 'showdar-recover', 'showdar-git', 'showdar-requirements', 'showdar-quality', 'showdar-security', 'showdar-ops', 'showdar-setup', 'showdar-brainstorm', 'showdar-domain-model', 'showdar-tdd'),
|
|
56
|
+
qa: ids('showdar-understand', 'showdar-requirements', 'showdar-quality', 'showdar-test', 'showdar-debug', 'showdar-review', 'showdar-ship', 'showdar-recover', 'showdar-git', 'showdar-setup', 'showdar-brainstorm', 'showdar-domain-model', 'showdar-tdd'),
|
|
57
|
+
product: ids('showdar-understand', 'showdar-requirements', 'showdar-plan', 'showdar-design', 'showdar-quality', 'showdar-review', 'showdar-setup', 'showdar-brainstorm', 'showdar-domain-model'),
|
|
57
58
|
insurance: ids('showdar-insurance-domain', 'showdar-insurance-workflows', 'showdar-insurance-review'),
|
|
58
59
|
full: [...SKILLS, ...COMPANION_SKILLS].map((skill) => skill.id),
|
|
59
60
|
};
|
package/src/project.js
CHANGED
|
@@ -170,6 +170,34 @@ async function generateCommandFiles({ baseRoot, skillIds, target, commandRoot, p
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
// Legacy custom commands collided with native /showdar-setup skill invocation.
|
|
173
|
+
// The retired skill is not a runnable alias. Delete only pristine managed copies.
|
|
174
|
+
function isLegacyBrainstormPath(relative) {
|
|
175
|
+
return typeof relative === 'string' &&
|
|
176
|
+
(/(^|\/)skills\/showdar-refine$/.test(relative) ||
|
|
177
|
+
/(^|\/)commands\/showdar\/refine\.md$/.test(relative));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
async function inspectLegacyBrainstormFiles({ baseRoot, manifest, scope, homeRoot = homedir(), managedRoots = [] }) {
|
|
181
|
+
const entries = (manifest?.files ?? []).filter(entry => isLegacyBrainstormPath(entry.path));
|
|
182
|
+
const results = [];
|
|
183
|
+
for (const entry of entries) {
|
|
184
|
+
const target = safeOwnedPath(baseRoot, entry.path, managedRoots);
|
|
185
|
+
if (!target || !isManagedDeletionTarget(baseRoot, target, scope, homeRoot, manifest)) {
|
|
186
|
+
throw new Error('Unsafe retired Showdar skill path: ' + entry.path);
|
|
187
|
+
}
|
|
188
|
+
await assertSafeManagedPath(baseRoot, target, managedRoots);
|
|
189
|
+
if (await exists(target) && await hashTree(target) !== entry.hash) {
|
|
190
|
+
throw new Error('Modified retired Showdar skill; preserve user changes before migrating: ' + entry.path);
|
|
191
|
+
}
|
|
192
|
+
results.push({ path: entry.path, target });
|
|
193
|
+
}
|
|
194
|
+
return results;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function migrateBrainstormSelection(ids) {
|
|
198
|
+
return [...new Set(ids.map(id => id === 'showdar-refine' ? 'showdar-brainstorm' : id))];
|
|
199
|
+
}
|
|
200
|
+
|
|
173
201
|
function isLegacySetupCommandPath(relative) {
|
|
174
202
|
return typeof relative === 'string' && /(^|\/)commands\/showdar-setup\.md$/.test(relative);
|
|
175
203
|
}
|
|
@@ -196,7 +224,9 @@ async function inspectLegacySetupCommands({ baseRoot, manifest, scope, homeRoot
|
|
|
196
224
|
}
|
|
197
225
|
|
|
198
226
|
async function removeLegacySetupCommands(entries) {
|
|
199
|
-
|
|
227
|
+
// Entries have already passed ownership/path and hash checks; native skill
|
|
228
|
+
// directories require recursive removal, legacy commands are regular files.
|
|
229
|
+
for (const entry of entries) await rm(entry.target, { recursive: true, force: true });
|
|
200
230
|
}
|
|
201
231
|
|
|
202
232
|
async function initInstallation({
|
|
@@ -305,6 +335,9 @@ async function initInstallation({
|
|
|
305
335
|
if (isLegacySetupCommandPath(entry.path) && await exists(targetPath) && await hashTree(targetPath) !== entry.hash) {
|
|
306
336
|
throw new Error('Modified legacy Showdar setup command; resolve the conflict before migrating: ' + entry.path);
|
|
307
337
|
}
|
|
338
|
+
if (isLegacyBrainstormPath(entry.path) && await exists(targetPath) && await hashTree(targetPath) !== entry.hash) {
|
|
339
|
+
throw new Error('Modified retired Showdar skill; preserve user changes before migrating: ' + entry.path);
|
|
340
|
+
}
|
|
308
341
|
staleTargets.push(targetPath);
|
|
309
342
|
}
|
|
310
343
|
}
|
|
@@ -717,6 +750,23 @@ export async function addSkill({ cwd, skill, ai = null, scope = null, home = hom
|
|
|
717
750
|
: [],
|
|
718
751
|
});
|
|
719
752
|
const legacyPaths = new Set(legacyCommands.map(entry => entry.path));
|
|
753
|
+
const migrationManagedRoots = migrationScope === 'global'
|
|
754
|
+
? [...new Set([
|
|
755
|
+
...NATIVE_TARGETS.map(t => globalSkillRootFor(t, { homeRoot: home })),
|
|
756
|
+
...NATIVE_TARGETS.filter(t => globalCommandRootForTarget(t, { homeRoot: home })).map(t => globalCommandRootForTarget(t, { homeRoot: home })),
|
|
757
|
+
])]
|
|
758
|
+
: [];
|
|
759
|
+
// On explicit add brainstorm, migrate preexisting CLI-owned v0.16 skill/commands;
|
|
760
|
+
// other adds leave the old managed selection until an explicit profile upgrade.
|
|
761
|
+
const migratingBrainstorm = skillId === 'showdar-brainstorm' && existingManifest?.skills?.includes('showdar-refine');
|
|
762
|
+
const retiredFiles = migratingBrainstorm
|
|
763
|
+
? await inspectLegacyBrainstormFiles({ baseRoot: migrationRoot, manifest: existingManifest, scope: migrationScope, homeRoot: home, managedRoots: migrationManagedRoots })
|
|
764
|
+
: [];
|
|
765
|
+
const retiredPaths = new Set(retiredFiles.map(entry => entry.path));
|
|
766
|
+
const removedPaths = new Set([...legacyPaths, ...retiredPaths]);
|
|
767
|
+
const migratedSkills = migratingBrainstorm
|
|
768
|
+
? migrateBrainstormSelection(existingManifest.skills)
|
|
769
|
+
: existingManifest?.skills ?? [];
|
|
720
770
|
const effectiveAi = ai ?? existingManifest?.ai ?? 'universal';
|
|
721
771
|
const effectiveScope = scope ?? existingManifest?.scope ?? 'project';
|
|
722
772
|
if (effectiveAi !== 'all' && !NATIVE_TARGETS.includes(effectiveAi)) throw new Error(`Unknown AI target "${effectiveAi}".`);
|
|
@@ -754,19 +804,19 @@ export async function addSkill({ cwd, skill, ai = null, scope = null, home = hom
|
|
|
754
804
|
}
|
|
755
805
|
for (const target of existingManifest.commandHarness ?? []) {
|
|
756
806
|
const commandRoot = effectiveScope === 'global' ? globalCommandRootForTarget(target, { homeRoot: home }) : commandRootFor(target, cwd);
|
|
757
|
-
if (commandRoot) await generateCommandFiles({ baseRoot, skillIds:
|
|
807
|
+
if (commandRoot) await generateCommandFiles({ baseRoot, skillIds: migratedSkills, target, commandRoot, priorOwned, newFiles: refreshedFiles });
|
|
758
808
|
}
|
|
759
809
|
if (effectiveScope === 'project' && existingManifest.instructions) {
|
|
760
810
|
const instruction = existingManifest.instructions;
|
|
761
811
|
const file = path.join(cwd, instruction.file);
|
|
762
|
-
if (instruction.kind === 'block') await writeManagedBlock(file,
|
|
763
|
-
else if (instruction.kind === 'file') await writeCursorRule(file,
|
|
812
|
+
if (instruction.kind === 'block') await writeManagedBlock(file, migratedSkills);
|
|
813
|
+
else if (instruction.kind === 'file') await writeCursorRule(file, migratedSkills);
|
|
764
814
|
}
|
|
765
|
-
await removeLegacySetupCommands(legacyCommands);
|
|
766
|
-
const files = new Map((existingManifest.files ?? []).filter(f => !
|
|
815
|
+
await removeLegacySetupCommands([...legacyCommands, ...retiredFiles]);
|
|
816
|
+
const files = new Map((existingManifest.files ?? []).filter(f => !removedPaths.has(f.path)).map(f => [f.path, f]));
|
|
767
817
|
for (const f of refreshedFiles) files.set(f.path, f);
|
|
768
818
|
await writeJsonAtomic(effectiveScope === 'global' ? globalManifestPath(home) : path.join(cwd, PROJECT_MANIFEST),
|
|
769
|
-
{ ...existingManifest, packageVersion, commands: (existingManifest.commands ?? []).filter(c => !
|
|
819
|
+
{ ...existingManifest, packageVersion, skills: migratedSkills, commands: (existingManifest.commands ?? []).filter(c => !removedPaths.has(c.path)), files: [...files.values()] });
|
|
770
820
|
return { skill: skillId, root: '', destination: '', added: false, scope: effectiveScope, ai: effectiveAi, profile: existingManifest.profile };
|
|
771
821
|
}
|
|
772
822
|
|
|
@@ -813,7 +863,7 @@ export async function addSkill({ cwd, skill, ai = null, scope = null, home = hom
|
|
|
813
863
|
}
|
|
814
864
|
}
|
|
815
865
|
|
|
816
|
-
const allSkillIds = [...new Set([...
|
|
866
|
+
const allSkillIds = [...new Set([...migratedSkills, skillId])];
|
|
817
867
|
const newCommands = [];
|
|
818
868
|
const harnessTargets = [...new Set([...(existingManifest?.commandHarness ?? []), ...commandHarnesses.map(c => c.target)])];
|
|
819
869
|
for (const target of harnessTargets) {
|
|
@@ -823,8 +873,8 @@ export async function addSkill({ cwd, skill, ai = null, scope = null, home = hom
|
|
|
823
873
|
newCommands.push(...generated.map(c => ({ target, name: c.shortName, path: manifestPathFor(baseRoot, c.destination) })));
|
|
824
874
|
}
|
|
825
875
|
|
|
826
|
-
await removeLegacySetupCommands(legacyCommands);
|
|
827
|
-
const merged = new Map((existingManifest?.files ?? []).filter(e => !
|
|
876
|
+
await removeLegacySetupCommands([...legacyCommands, ...retiredFiles]);
|
|
877
|
+
const merged = new Map((existingManifest?.files ?? []).filter(e => !removedPaths.has(e.path)).map((e) => [e.path, e]));
|
|
828
878
|
for (const f of files) merged.set(f.path, f);
|
|
829
879
|
|
|
830
880
|
const instructionFile = existingManifest?.instructions ?? (effectiveScope === 'project' ? instructionSurfaceFor(effectiveAi === 'all' ? 'universal' : effectiveAi, cwd) : null);
|
|
@@ -840,7 +890,7 @@ export async function addSkill({ cwd, skill, ai = null, scope = null, home = hom
|
|
|
840
890
|
targets: [...new Set([...(existingManifest?.targets ?? []), ...targets])],
|
|
841
891
|
skills: allSkillIds,
|
|
842
892
|
satisfiedByGlobal: existingManifest?.satisfiedByGlobal ?? [],
|
|
843
|
-
commands: [...new Map([...(existingManifest?.commands ?? []).filter(c => !
|
|
893
|
+
commands: [...new Map([...(existingManifest?.commands ?? []).filter(c => !removedPaths.has(c.path)), ...newCommands].map(c => [c.path, c])).values()],
|
|
844
894
|
files: [...merged.values()],
|
|
845
895
|
instructions: instructionFile ? { file: instructionFile.file, kind: instructionFile.kind } : null,
|
|
846
896
|
commandHarness,
|
package/src/validate.js
CHANGED
|
@@ -336,8 +336,8 @@ export async function validateRepository(packageRoot) {
|
|
|
336
336
|
|
|
337
337
|
if (SKILLS.length !== PRIMITIVE_COUNT || PRIMITIVE_COUNT !== 18) errors.push(`primitive skill count must remain 18 (found ${SKILLS.length})`);
|
|
338
338
|
if (WORKFLOW_SKILLS.length !== WORKFLOW_COUNT || WORKFLOW_COUNT !== 4) errors.push(`workflow skill count must be 4 (found ${WORKFLOW_SKILLS.length})`);
|
|
339
|
-
if (COMPANION_SKILLS.length !== COMPANION_COUNT || COMPANION_COUNT !==
|
|
340
|
-
if (ALL_SKILLS.length !== TOTAL_COUNT || TOTAL_COUNT !==
|
|
339
|
+
if (COMPANION_SKILLS.length !== COMPANION_COUNT || COMPANION_COUNT !== 4) errors.push(`companion skill count must be 4 (found ${COMPANION_SKILLS.length})`);
|
|
340
|
+
if (ALL_SKILLS.length !== TOTAL_COUNT || TOTAL_COUNT !== 26) errors.push(`total installable skill count must be 26 (found ${ALL_SKILLS.length})`);
|
|
341
341
|
|
|
342
342
|
for (const error of validateCapabilities().errors) errors.push(`capabilities: ${error}`);
|
|
343
343
|
|
|
File without changes
|