@rashidee/co2 1.2.5
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/dist/index.js +25449 -0
- package/drizzle/0000_remarkable_charles_xavier.sql +210 -0
- package/drizzle/0001_wise_wolf_cub.sql +13 -0
- package/drizzle/0002_secret_spyke.sql +16 -0
- package/drizzle/0003_workspace_config_singleton.sql +16 -0
- package/drizzle/0004_terminal_claim_v120.sql +11 -0
- package/drizzle/0005_brainstorm_v124.sql +10 -0
- package/drizzle/0006_project_v140.sql +6 -0
- package/drizzle/0007_prd_wizard_v124.sql +14 -0
- package/drizzle/0008_workflow_artifact_v126.sql +24 -0
- package/drizzle/0009_project_import_v150.sql +7 -0
- package/drizzle/0010_quality_v151.sql +3 -0
- package/drizzle/meta/0000_snapshot.json +1335 -0
- package/drizzle/meta/0001_snapshot.json +1416 -0
- package/drizzle/meta/0002_snapshot.json +1510 -0
- package/drizzle/meta/_journal.json +83 -0
- package/package.json +41 -0
- package/plugin/.claude-plugin/marketplace.json +36 -0
- package/plugin/.claude-plugin/plugin.json +22 -0
- package/plugin/README.md +625 -0
- package/plugin/SKILLS.md +350 -0
- package/plugin/co2.svg +5 -0
- package/plugin/commands/brainstorm-loop.md +129 -0
- package/plugin/skills/conductor-defect/SKILL.md +898 -0
- package/plugin/skills/conductor-feature-develop/SKILL.md +1383 -0
- package/plugin/skills/conductor-feature-develop/references/implementation-domain-template.md +131 -0
- package/plugin/skills/conductor-feature-develop/references/implementation-master-template.md +89 -0
- package/plugin/skills/conductor-feature-develop/references/playwright-setup.md +224 -0
- package/plugin/skills/conductor-feature-prepare/SKILL.md +604 -0
- package/plugin/skills/depgen-k8s/SKILL.md +468 -0
- package/plugin/skills/depgen-k8s/references/dockerfile-laravel.md +197 -0
- package/plugin/skills/depgen-k8s/references/dockerfile-nodejs.md +163 -0
- package/plugin/skills/depgen-k8s/references/dockerfile-spring-boot.md +174 -0
- package/plugin/skills/depgen-k8s/references/k8s-patterns.md +869 -0
- package/plugin/skills/mockgen-shadcn/SKILL.md +1067 -0
- package/plugin/skills/mockgen-shadcn/references/admin-layout-template.md +1467 -0
- package/plugin/skills/mockgen-shadcn/references/mockup-hub-template.md +498 -0
- package/plugin/skills/mockgen-shadcn/references/mockup-index-template.md +216 -0
- package/plugin/skills/mockgen-tailwind/SKILL.md +904 -0
- package/plugin/skills/mockgen-tailwind/references/admin-layout-template.md +720 -0
- package/plugin/skills/mockgen-tailwind/references/mockup-hub-template.md +498 -0
- package/plugin/skills/mockgen-tailwind/references/mockup-index-template.md +190 -0
- package/plugin/skills/modelgen-nosql/SKILL.md +617 -0
- package/plugin/skills/modelgen-nosql/references/model-extraction-methodology.md +497 -0
- package/plugin/skills/modelgen-nosql/references/nosql-design-guide.md +258 -0
- package/plugin/skills/modelgen-relational/SKILL.md +707 -0
- package/plugin/skills/modelgen-relational/references/model-extraction-methodology.md +499 -0
- package/plugin/skills/specgen-flutter-riverpod/SKILL.md +898 -0
- package/plugin/skills/specgen-flutter-riverpod/references/component-patterns.md +971 -0
- package/plugin/skills/specgen-flutter-riverpod/references/notification-patterns.md +457 -0
- package/plugin/skills/specgen-flutter-riverpod/references/routing-patterns.md +362 -0
- package/plugin/skills/specgen-flutter-riverpod/references/security-patterns.md +709 -0
- package/plugin/skills/specgen-flutter-riverpod/references/spec-template.md +1566 -0
- package/plugin/skills/specgen-flutter-riverpod/references/state-patterns.md +518 -0
- package/plugin/skills/specgen-flutter-riverpod/references/storage-patterns.md +370 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/SKILL.md +984 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/batch-patterns.md +359 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/messaging-patterns.md +468 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/modulith-patterns.md +461 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/reporting-patterns.md +803 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/security-patterns.md +501 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/spec-template.md +1268 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/web-patterns.md +301 -0
- package/plugin/skills/specgen-node-cli-web/SKILL.md +561 -0
- package/plugin/skills/specgen-node-cli-web/references/auth-patterns.md +293 -0
- package/plugin/skills/specgen-node-cli-web/references/cli-packaging-patterns.md +250 -0
- package/plugin/skills/specgen-node-cli-web/references/server-patterns.md +247 -0
- package/plugin/skills/specgen-node-cli-web/references/spec-template.md +401 -0
- package/plugin/skills/specgen-node-cli-web/references/testing-patterns.md +174 -0
- package/plugin/skills/specgen-react-mui/SKILL.md +789 -0
- package/plugin/skills/specgen-react-mui/references/component-patterns.md +1077 -0
- package/plugin/skills/specgen-react-mui/references/reporting-patterns.md +1998 -0
- package/plugin/skills/specgen-react-mui/references/routing-patterns.md +461 -0
- package/plugin/skills/specgen-react-mui/references/security-patterns.md +599 -0
- package/plugin/skills/specgen-react-mui/references/spec-template.md +1030 -0
- package/plugin/skills/specgen-react-mui/references/state-patterns.md +327 -0
- package/plugin/skills/specgen-react-tailwind/SKILL.md +859 -0
- package/plugin/skills/specgen-react-tailwind/references/component-patterns.md +1212 -0
- package/plugin/skills/specgen-react-tailwind/references/reporting-patterns.md +1529 -0
- package/plugin/skills/specgen-react-tailwind/references/routing-patterns.md +669 -0
- package/plugin/skills/specgen-react-tailwind/references/security-patterns.md +656 -0
- package/plugin/skills/specgen-react-tailwind/references/spec-template.md +1237 -0
- package/plugin/skills/specgen-react-tailwind/references/state-patterns.md +327 -0
- package/plugin/skills/specgen-sdk-java/SKILL.md +933 -0
- package/plugin/skills/specgen-sdk-java/references/api-extraction-patterns.md +247 -0
- package/plugin/skills/specgen-sdk-java/references/http-client-patterns.md +495 -0
- package/plugin/skills/specgen-sdk-java/references/packaging-patterns.md +366 -0
- package/plugin/skills/specgen-sdk-java/references/spec-template.md +956 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/SKILL.md +1284 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/batch-patterns.md +1224 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/jasper-patterns.md +1638 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/messaging-patterns.md +512 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/modulith-patterns.md +354 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/security-patterns.md +551 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/spec-template.md +2502 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/web-patterns.md +503 -0
- package/plugin/skills/specgen-spring-jpa-restapi/SKILL.md +990 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/batch-patterns.md +1224 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/messaging-patterns.md +512 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/modulith-patterns.md +279 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/reporting-patterns.md +1536 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/restapi-patterns.md +722 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/security-patterns.md +351 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/spec-template.md +553 -0
- package/plugin/skills/specgen-ts-cli/SKILL.md +861 -0
- package/plugin/skills/specgen-ts-cli/references/async-patterns.md +1101 -0
- package/plugin/skills/specgen-ts-cli/references/command-patterns.md +383 -0
- package/plugin/skills/specgen-ts-cli/references/config-patterns.md +430 -0
- package/plugin/skills/specgen-ts-cli/references/database-patterns.md +750 -0
- package/plugin/skills/specgen-ts-cli/references/packaging-patterns.md +426 -0
- package/plugin/skills/specgen-ts-cli/references/spec-template.md +1391 -0
- package/plugin/skills/specgen-ts-cli/references/testing-patterns.md +909 -0
- package/plugin/skills/testgen-functional/SKILL.md +1381 -0
- package/plugin/skills/tracegen-matrix/SKILL.md +243 -0
- package/plugin/skills/util-preparek8senv/SKILL.md +422 -0
- package/plugin/skills/util-projectinit/SKILL.md +307 -0
- package/plugin/skills/util-projectinit/reference/brainstorm-loop.md +129 -0
- package/plugin/skills/util-projectinit/reference/brainstorm-protocol.md +144 -0
- package/plugin/skills/util-projectinit/reference/brainstorm-setup-guide.md +153 -0
- package/plugin/skills/util-projectinit/reference/brainstorm-template-appdev.md +87 -0
- package/plugin/skills/util-projectinit/reference/co2-context-generation-guide.md +761 -0
- package/plugin/skills/util-projectsync/SKILL.md +501 -0
- package/plugin/skills/util-updprd/SKILL.md +324 -0
- package/plugin/skills/util-usanalyzer/SKILL.md +307 -0
- package/plugin/skills/util-ustagger/SKILL.md +154 -0
- package/static/assets/abnfDiagram-VRR7QNED-DvPuwyCV.js +1 -0
- package/static/assets/arc-DRKw7sjs.js +1 -0
- package/static/assets/architectureDiagram-ZJ3FMSHR-CaNcxUbC.js +36 -0
- package/static/assets/blockDiagram-677ZJIJ3-Demd4AOK.js +132 -0
- package/static/assets/c4Diagram-LMCZKHZV-PVKUfc2x.js +10 -0
- package/static/assets/channel-C2nVbuwv.js +1 -0
- package/static/assets/chunk-2Q5K7J3B-CExf8ww_.js +1 -0
- package/static/assets/chunk-32BRIVSS-CFPaoONF.js +1 -0
- package/static/assets/chunk-5VM5RSS4-DE2esM67.js +15 -0
- package/static/assets/chunk-EX3LRPZG-SON_YdDG.js +231 -0
- package/static/assets/chunk-JWPE2WC7-Qxah8LNr.js +1 -0
- package/static/assets/chunk-MOJQB5TN-BcWGQV3j.js +88 -0
- package/static/assets/chunk-RYQCIY6F-DkDj-OR5.js +1 -0
- package/static/assets/chunk-V7JOEXUC-BlI1Mrah.js +206 -0
- package/static/assets/chunk-VR4S4FIN-Agf__duj.js +1 -0
- package/static/assets/chunk-XXDRQBXY-B5CfAh85.js +1 -0
- package/static/assets/classDiagram-OUVF2IWQ-DXJIljsR.js +1 -0
- package/static/assets/classDiagram-v2-EOCWNBFH-DXJIljsR.js +1 -0
- package/static/assets/cose-bilkent-JH36ORCC-DO0cQkcy.js +1 -0
- package/static/assets/cynefin-VYW2F7L2-CfOnsnXc.js +178 -0
- package/static/assets/cynefinDiagram-TSTJHNR4-BJ8tULAv.js +62 -0
- package/static/assets/cytoscape.esm-DTSO7Bv0.js +331 -0
- package/static/assets/dagre-VKFMJZFB-DfjwzHqP.js +4 -0
- package/static/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/static/assets/diagram-FQU43EPY-CndSOIIM.js +3 -0
- package/static/assets/diagram-G47NLZAW-Czf5hN0Z.js +24 -0
- package/static/assets/diagram-NH7WQ7WH-COAyojGh.js +24 -0
- package/static/assets/diagram-OA4YK3LP-H8PoiN2m.js +30 -0
- package/static/assets/diagram-WEI45ONY-DzcaVzjp.js +41 -0
- package/static/assets/ebnfDiagram-CCIWWBDH-DPazGYLJ.js +1 -0
- package/static/assets/erDiagram-Q63AITRT-Bo-fubgF.js +85 -0
- package/static/assets/flowDiagram-23GEKE2U-CSvxUDwh.js +156 -0
- package/static/assets/ganttDiagram-NO4QXBWP-DnBveWX6.js +292 -0
- package/static/assets/gitGraphDiagram-IHSO6WYX-B3rVL8c-.js +106 -0
- package/static/assets/graph-C9eacEi8.js +1 -0
- package/static/assets/index-LZSQkLE2.css +41 -0
- package/static/assets/index-y7XDSgMG.js +495 -0
- package/static/assets/infoDiagram-FWYZ7A6U-CvWV9yy2.js +2 -0
- package/static/assets/init-Gi6I4Gst.js +1 -0
- package/static/assets/ishikawaDiagram-FXEZZL3T-DF28a1N6.js +70 -0
- package/static/assets/journeyDiagram-5HDEW3XC-CB6CugYk.js +139 -0
- package/static/assets/kanban-definition-HUTT4EX6-ResSLF6d.js +89 -0
- package/static/assets/katex-C5jXJg4s.js +257 -0
- package/static/assets/layout-DEXfKzaS.js +1 -0
- package/static/assets/linear-CLO--ryk.js +1 -0
- package/static/assets/map-Czzmt4hB.js +1 -0
- package/static/assets/mindmap-definition-LN4V7U3C-BvW3EbxX.js +96 -0
- package/static/assets/ordinal-Cboi1Yqb.js +1 -0
- package/static/assets/pegDiagram-2B236MQR-BHCgqrrM.js +1 -0
- package/static/assets/pieDiagram-ENE6RG2P-DVmCQ5FA.js +39 -0
- package/static/assets/quadrantDiagram-ABIIQ3AL-B3e5KR52.js +7 -0
- package/static/assets/railroadDiagram-RFXS5EU6-Csv5ysLc.js +1 -0
- package/static/assets/requirementDiagram-TGXJPOKE-DOMVzvnB.js +84 -0
- package/static/assets/sankeyDiagram-HTMAVEWB-B1dcTOvy.js +40 -0
- package/static/assets/sequenceDiagram-DBY2YBRQ-BY414yeO.js +162 -0
- package/static/assets/sizeCapture-X5ZJPWSS-CuJfrfBN.js +1 -0
- package/static/assets/stateDiagram-2N3HPSRC-FX4rJkzV.js +1 -0
- package/static/assets/stateDiagram-v2-6OUMAXLB-BVufbO_H.js +1 -0
- package/static/assets/swimlanes-5IMT3BWC-Sfy58mmv.js +2 -0
- package/static/assets/swimlanesDiagram-G3AALYLV-wDCDw08H.js +8 -0
- package/static/assets/timeline-definition-FHXFAJF6-CmV7by8p.js +120 -0
- package/static/assets/vennDiagram-L72KCM5P-FqIyFZFt.js +34 -0
- package/static/assets/wardleyDiagram-EHGQE667-BZ06O45i.js +78 -0
- package/static/assets/xychartDiagram-FW5EYKEG-BOkffR06.js +7 -0
- package/static/index.html +24 -0
package/plugin/SKILLS.md
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
# CO2 Skills Catalog — Agent Reference
|
|
2
|
+
|
|
3
|
+
> **Audience:** AI agents. This document tells you WHICH skill to invoke WHEN in the
|
|
4
|
+
> Compound Context (CO2) workflow. Every skill reads its inputs from the project's context
|
|
5
|
+
> files (`CLAUDE.md`, `<app_folder>/context/PRD.md`, etc.) — invoke with the application
|
|
6
|
+
> name and version; do not ask the user for information the context files already contain.
|
|
7
|
+
|
|
8
|
+
## Workflow Order
|
|
9
|
+
|
|
10
|
+
Skills belong to phases and generally must run in this order per application:
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
0. Bootstrap util-projectinit → (user fills session) → /brainstorm-loop → util-projectsync
|
|
14
|
+
1. PRD clean-up util-usanalyzer → util-ustagger (util-updprd for requirement changes)
|
|
15
|
+
2. Artifacts modelgen-* → mockgen-* → specgen-* → testgen-functional
|
|
16
|
+
(or all four via conductor-feature-prepare)
|
|
17
|
+
3. Infrastructure util-preparek8senv (before development)
|
|
18
|
+
4. Development conductor-feature-develop → tracegen-matrix (auto) → depgen-k8s (auto)
|
|
19
|
+
5. Bug fixing conductor-defect → tracegen-matrix (auto)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Artifact Map — who produces what
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
<project_root>/
|
|
26
|
+
├── CLAUDE.md ← /brainstorm-loop (Phase A), annotated by util-projectsync
|
|
27
|
+
├── DEVTOOL.md ← per-developer (manual)
|
|
28
|
+
├── ENVIRONMENT.md ← util-preparek8senv
|
|
29
|
+
├── <topic>.brainstorm.md ← util-projectinit (session doc, iterated by /brainstorm-loop)
|
|
30
|
+
├── brainstorm-protocol.md ← util-projectinit (copied)
|
|
31
|
+
├── co2-context-generation-guide.md ← util-projectinit (copied)
|
|
32
|
+
├── environment/ ← util-preparek8senv (K8s manifests for 3rd party apps; gitignored)
|
|
33
|
+
└── <app_folder>/
|
|
34
|
+
├── CHANGELOG.md ← appended by every skill (version gate)
|
|
35
|
+
├── Dockerfile ← depgen-k8s
|
|
36
|
+
├── k8s/ ← depgen-k8s (app manifests; gitignored)
|
|
37
|
+
├── (source code) ← conductor-feature-develop / conductor-defect
|
|
38
|
+
└── context/
|
|
39
|
+
├── PRD.md ← /brainstorm-loop (Phase B), scaffolded by util-projectsync,
|
|
40
|
+
│ tagged by util-ustagger, annotated by util-usanalyzer
|
|
41
|
+
├── BUG.md ← util-projectsync scaffold; user reports; tagged by conductor-defect
|
|
42
|
+
├── TRACEABILITY.md ← tracegen-matrix
|
|
43
|
+
├── model/ ← modelgen-relational / modelgen-nosql
|
|
44
|
+
├── mockup/ ← mockgen-tailwind / mockgen-shadcn (assets + manifest;
|
|
45
|
+
│ served by the shared Mockup Hub at <root>/mockup)
|
|
46
|
+
├── specification/ ← specgen-* (one variant)
|
|
47
|
+
├── test/ ← testgen-functional
|
|
48
|
+
├── prepare/ ← conductor-feature-prepare (PREPARE_MASTER.md tracking)
|
|
49
|
+
├── develop/ ← conductor-feature-develop (tracking files)
|
|
50
|
+
└── bug/ ← conductor-defect (per-bug tracking files)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Universal conventions (apply to almost every skill):**
|
|
54
|
+
|
|
55
|
+
- **Invocation shape:** `/skill-name <application> <version> [module:<name>]`. The application
|
|
56
|
+
name resolves to a root-level app folder (leading `<number>_` prefix stripped,
|
|
57
|
+
case-insensitive, snake/kebab/title case all match).
|
|
58
|
+
- **Version gate:** skills refuse to run for a version lower than the highest version recorded
|
|
59
|
+
in `<app_folder>/CHANGELOG.md`, and append a row there on success.
|
|
60
|
+
- **Version filtering:** only PRD items tagged `[vX.Y.Z]` <= the requested version are included;
|
|
61
|
+
strikethrough (`~~…~~`) items are deprecated and excluded.
|
|
62
|
+
- **Traceability:** PRD item IDs (e.g., `[USHM00003]`, `[NFRHM0012]`) must be carried through
|
|
63
|
+
into every generated artifact.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Phase 0 — Project Bootstrap
|
|
68
|
+
|
|
69
|
+
### `util-projectinit`
|
|
70
|
+
- **Invoke:** `/util-projectinit "<application idea or topic>"`
|
|
71
|
+
- **What it does:** Sets up a file-based, turn-based **brainstorming session** in the project
|
|
72
|
+
folder: generates `<topic>.brainstorm.md` from the appdev template (seeded with the idea),
|
|
73
|
+
copies `brainstorm-protocol.md` and `co2-context-generation-guide.md` to the project root,
|
|
74
|
+
and ensures the `/brainstorm-loop` command is installed. It does NOT generate project context
|
|
75
|
+
directly and it NEVER starts the loop itself — it instructs the user to fill in the session
|
|
76
|
+
document and manually run `/brainstorm-loop`.
|
|
77
|
+
- **Use when:** the user wants to start/init/bootstrap a NEW project, or brainstorm an
|
|
78
|
+
application idea into CO2 context. First skill of the workflow.
|
|
79
|
+
- **Do NOT use when:** the project already has a `CLAUDE.md` and the user wants to evolve it
|
|
80
|
+
(use `util-projectsync` or `util-updprd`).
|
|
81
|
+
- **Prerequisites:** an application idea (even one paragraph).
|
|
82
|
+
- **Output:** `<topic>.brainstorm.md` (session document), `brainstorm-protocol.md`,
|
|
83
|
+
`co2-context-generation-guide.md` at the project root, and
|
|
84
|
+
`.claude/commands/brainstorm-loop.md` when the plugin command is not available — plus a
|
|
85
|
+
hand-off instruction block. Non-destructive — never overwrites existing files.
|
|
86
|
+
|
|
87
|
+
### `/brainstorm-loop` (plugin command, not a skill)
|
|
88
|
+
- **Invoke:** `/brainstorm-loop [scan-root] [max-watch-rounds]` — **run manually by the user**,
|
|
89
|
+
never auto-started by a skill.
|
|
90
|
+
- **What it does:** In-session watch loop over `*.brainstorm.md` session documents. Each round
|
|
91
|
+
the agent drafts the CO2 context tree (Phase A: root `CLAUDE.md`; Phase B: one `PRD.md` per
|
|
92
|
+
application) per `co2-context-generation-guide.md`, appends questions, and waits for the
|
|
93
|
+
human to answer and flip a status row. Token-efficient: 60-second file polling, acts only on
|
|
94
|
+
status flips.
|
|
95
|
+
- **Output:** root `CLAUDE.md` + `<app_folder>/context/PRD.md` per application (at the session's
|
|
96
|
+
destination), plus a `.brainstorm-loop-status.md` dashboard.
|
|
97
|
+
|
|
98
|
+
### `util-projectsync`
|
|
99
|
+
- **Invoke:** `/util-projectsync` (no arguments — reads everything from `CLAUDE.md`)
|
|
100
|
+
- **What it does:** Synchronizes project folder structure with `CLAUDE.md`: validates
|
|
101
|
+
dependencies (circular, missing, logical) and orphaned services, creates missing application
|
|
102
|
+
folders, scaffolds `PRD.md`/`BUG.md` from templates, adds missing module sections, inserts
|
|
103
|
+
`[TODO]` annotations into `CLAUDE.md` for validation failures.
|
|
104
|
+
- **Use when:** after the brainstorm closes, or any time `CLAUDE.md` applications/modules
|
|
105
|
+
changed and folders/PRDs must catch up ("sync project", "scaffold project folders",
|
|
106
|
+
"validate dependencies").
|
|
107
|
+
- **Prerequisites:** `CLAUDE.md`.
|
|
108
|
+
- **Output:** missing `<app_folder>/` folders, scaffolded `<app_folder>/context/PRD.md` and
|
|
109
|
+
`BUG.md`, missing module sections added to existing files, `[TODO]` annotations in
|
|
110
|
+
`CLAUDE.md` for validation failures, and a sync/validation summary report.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Phase 1 — PRD Clean-Up
|
|
115
|
+
|
|
116
|
+
### `util-usanalyzer`
|
|
117
|
+
- **Invoke:** `/util-usanalyzer <application>`
|
|
118
|
+
- **What it does:** Analyzes `PRD.md` for quality issues — incomplete sentences, broken
|
|
119
|
+
references, cross-module inconsistencies, contradictions, duplicate roles, process-flow
|
|
120
|
+
coverage gaps — and adds inline `[TODO]` annotations for each issue.
|
|
121
|
+
- **Use when:** the user asks to validate/review/audit user stories or requirements quality,
|
|
122
|
+
or before tagging a freshly edited PRD.
|
|
123
|
+
- **Prerequisites:** `PRD.md`.
|
|
124
|
+
- **Output:** inline `[TODO]` annotations written into `PRD.md` at each issue, plus a summary
|
|
125
|
+
report of all issues found with improvement suggestions.
|
|
126
|
+
|
|
127
|
+
### `util-ustagger`
|
|
128
|
+
- **Invoke:** `/util-ustagger <application> <version>`
|
|
129
|
+
- **What it does:** Tags every untagged top-level item in `PRD.md` (User Stories, NFRs,
|
|
130
|
+
Constraints, References, Tests) with a unique 9-character ID code and validates that no
|
|
131
|
+
duplicate tags exist.
|
|
132
|
+
- **Use when:** new PRD items need IDs ("tag user stories", "add IDs to requirements",
|
|
133
|
+
"validate tags"). Run after any manual PRD edit and before artifact generation.
|
|
134
|
+
- **Prerequisites:** `PRD.md`.
|
|
135
|
+
- **Output:** updated `PRD.md` with every item tagged (e.g., `[USHM00003]`, `[NFRHM0012]`,
|
|
136
|
+
`[CONHM0009]`, `[REFHM0003]`), plus a duplicate-tag validation report.
|
|
137
|
+
|
|
138
|
+
### `util-updprd` ⚠️ *not yet implemented — folder is an empty stub; do not invoke*
|
|
139
|
+
- **Documented intent:** apply a free-form requirement change across all applications' PRD.md
|
|
140
|
+
files — decide add/cancel/modify per item, auto-classify major/minor/patch, layer changes
|
|
141
|
+
under a NEW version tag (prior versions immutable), tag via `util-ustagger`, append
|
|
142
|
+
CHANGELOG entries.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Phase 2 — Context Artifact Generation
|
|
147
|
+
|
|
148
|
+
> Run the four steps individually below, or all at once via `conductor-feature-prepare`.
|
|
149
|
+
|
|
150
|
+
### `conductor-feature-prepare` (orchestrator)
|
|
151
|
+
- **Invoke:** `/conductor-feature-prepare <application> [version:<v>] [module:<m>]`
|
|
152
|
+
- **What it does:** Runs `util-ustagger` → `modelgen-*` → `mockgen-*` → `specgen-*` →
|
|
153
|
+
`testgen-functional` in sequence, auto-selecting the right variant per the application's
|
|
154
|
+
technology stack, tracking progress in `PREPARE_MASTER.md` (read first on resume to skip
|
|
155
|
+
already-completed steps/versions). Multiple versions are processed sequentially in ascending
|
|
156
|
+
semver order. Manages its own Ralph Loop internally for cross-session continuity.
|
|
157
|
+
- **Use when:** "prepare artifacts", "generate context", "prepare for development",
|
|
158
|
+
"resume preparation".
|
|
159
|
+
- **Prerequisites:** `PRD.md`, `CLAUDE.md`.
|
|
160
|
+
- **Output:** the complete `context/` artifact tree — `model/`, `mockup/`, `specification/`
|
|
161
|
+
and `test/` (each as described under its sub-skill below) — plus `CHANGELOG.md` entries per
|
|
162
|
+
step and the `context/prepare/PREPARE_MASTER.md` progress tracker (inferred config, per-version
|
|
163
|
+
× per-artifact status) for cross-session resumption.
|
|
164
|
+
|
|
165
|
+
### `modelgen-relational`
|
|
166
|
+
- **Invoke:** `/modelgen-relational <application> <version> [module:<m>]`
|
|
167
|
+
- **What it does:** Extracts relational (SQL) entity models from user stories using DDD —
|
|
168
|
+
ERD diagrams (Mermaid) + per-module model documentation. Also handles "update/upgrade the
|
|
169
|
+
model" for incremental evolution.
|
|
170
|
+
- **Use when:** the app's datastore is a relational DB (MySQL, PostgreSQL, SQLite …).
|
|
171
|
+
- **Output:** `context/model/` — `MODEL.md` index + per-module `model.md` / `erd.mermaid`.
|
|
172
|
+
|
|
173
|
+
### `modelgen-nosql`
|
|
174
|
+
- **Invoke:** `/modelgen-nosql <application> <version> [module:<m>]`
|
|
175
|
+
- **What it does:** Extracts NoSQL document models (embed-vs-reference analysis, Mermaid class
|
|
176
|
+
diagrams, JSON schema examples per collection). Database-agnostic (MongoDB, Couchbase,
|
|
177
|
+
DynamoDB, Firestore, CosmosDB).
|
|
178
|
+
- **Use when:** the app's datastore is document-oriented. **Not** for relational schemas —
|
|
179
|
+
use `modelgen-relational`.
|
|
180
|
+
- **Output:** `context/model/` — `MODEL.md` index + per-module `model.md` (embed/reference
|
|
181
|
+
decisions), Mermaid class diagram, and `schemas.json` JSON schema examples per collection.
|
|
182
|
+
|
|
183
|
+
### `mockgen-tailwind`
|
|
184
|
+
- **Invoke:** `/mockgen-tailwind <application> <version> [module:<m>]`
|
|
185
|
+
- **What it does:** Generates HTML mockup screens (Alpine.js + HTMX assets, admin
|
|
186
|
+
dashboard layout, organized by user role) for human designer review. All mockups are
|
|
187
|
+
served by the single shared **Mockup Hub** at `<root>/mockup` — a zero-dependency Node
|
|
188
|
+
server (created/upgraded automatically) with a landing page listing every application
|
|
189
|
+
and role (unclickable until ready) and a configurable port (`PORT` env /
|
|
190
|
+
`mockup.config.json`).
|
|
191
|
+
- **Use when:** mockups are needed and the target stack is server-rendered or plain HTML;
|
|
192
|
+
default mockup generator.
|
|
193
|
+
- **Prerequisites:** `PRD.md`, `modelgen-*` output.
|
|
194
|
+
- **Output:** `context/mockup/` — `MOCKUP.html` index, `mockup-manifest.json`, partials,
|
|
195
|
+
role folders (assets only; no per-app server) + shared hub at `<root>/mockup/`.
|
|
196
|
+
|
|
197
|
+
### `mockgen-shadcn`
|
|
198
|
+
- **Invoke:** `/mockgen-shadcn <application> <version> [module:<m>]`
|
|
199
|
+
- **What it does:** Generates React + shadcn/ui mockup screens (Vite + React 19 + TypeScript +
|
|
200
|
+
React Router v7, admin dashboard layout, organized by user role) with
|
|
201
|
+
`base`/`basename` = `/{app_slug}/`, builds them (`npm run build`), and serves the `dist/`
|
|
202
|
+
output through the same shared **Mockup Hub** at `<root>/mockup` (Vite dev server remains
|
|
203
|
+
for design iteration only).
|
|
204
|
+
- **Use when:** the target application is React/shadcn-based (pairs naturally with
|
|
205
|
+
`specgen-nextjs-react-tailwind` / `specgen-node-cli-web`).
|
|
206
|
+
- **Prerequisites:** `PRD.md`, `modelgen-*` output.
|
|
207
|
+
- **Output:** `context/mockup/` — `MOCKUP.html` index page, `mockup-manifest.json`, Vite +
|
|
208
|
+
React project files, layout components, vendored shadcn/ui components, role-specific page
|
|
209
|
+
components, and built `dist/` + shared hub at `<root>/mockup/`.
|
|
210
|
+
|
|
211
|
+
### `specgen-*` — Technical Specification Generators
|
|
212
|
+
|
|
213
|
+
All specgens share the same contract: **Invoke** `/specgen-<variant> <application> <version>
|
|
214
|
+
[module:<m>]`; **Prerequisites** `PRD.md` + `modelgen-*` output (+ `mockgen-*` output for
|
|
215
|
+
UI-bearing stacks); **Output** `context/specification/` — root `SPECIFICATION.md` + one
|
|
216
|
+
self-contained `SPEC.md` per module (or per command for CLI stacks), with complete code
|
|
217
|
+
samples and traceability tables. **Pick exactly ONE variant, matching the application's
|
|
218
|
+
technology stack** (declared in `CLAUDE.md` / PRD Architecture Principle):
|
|
219
|
+
|
|
220
|
+
| Skill | Pick when the application is… |
|
|
221
|
+
|-------|-------------------------------|
|
|
222
|
+
| `specgen-spring-jpa-jtehtmx` | Spring Boot 3 server-rendered web app (JTE + Tailwind + Alpine.js + htmx, Spring Modulith; optional Keycloak, RabbitMQ, Quartz/Batch, i18n) |
|
|
223
|
+
| `specgen-spring-jpa-restapi` | Spring Boot 3 REST API (Spring Modulith; optional Keycloak resource server / JWT, RabbitMQ, Quartz/Batch) |
|
|
224
|
+
| `specgen-laravel-eloquent-bladehtmx` | Laravel 12 server-rendered web app (Blade + Tailwind + Alpine.js + htmx, nwidart modules; optional Keycloak/Breeze, RabbitMQ, scheduling, i18n) |
|
|
225
|
+
| `specgen-react-mui` | React 19 SPA with Material UI v6 (TypeScript 5, Vite 6, React Router 7, TanStack Query 5, Zustand 5, RHF 7, Zod 3; optional Keycloak/OIDC, WebSocket, i18n, MUI X grids/charts) |
|
|
226
|
+
| `specgen-react-tailwind` | React 19 SPA with Tailwind CSS v3 + Headless UI v2 + Heroicons (same data stack as react-mui, no component framework; optional TanStack Table, Recharts, react-day-picker, Tiptap, reporting) |
|
|
227
|
+
| `specgen-flutter-riverpod` | Flutter 3 mobile app (Dart 3, Riverpod 2, Hive 2, Dio 5, go_router 14, Firebase Messaging, freezed/json_serializable; optional Keycloak PKCE, WebSocket, i18n) |
|
|
228
|
+
| `specgen-ts-cli` | Distributable Node.js CLI **tool** (TypeScript 5, Commander 12, tsup, Zod, chalk/ora; optional prompts, conf/cosmiconfig, SQLite, execa, got, @yao-pkg/pkg binaries) — terminal-only, no web UI |
|
|
229
|
+
| `specgen-node-cli-web` | Self-hosted **web application distributed as a global npm CLI** — installed `npm i -g`, started `<app> start`, opened at `http://IP:PORT`. Single Node 22 process: Hono 4 API + embedded pre-built React 19/Vite 6 SPA (Tailwind v4, shadcn/ui), Drizzle + SQLite, hand-rolled scrypt sessions with first-run admin + forced password change, tsup, Biome, Vitest + Playwright with built-binary smoke test |
|
|
230
|
+
| `specgen-sdk-java` | Java SDK **library** wrapping a remote REST API — Maven Multi-Release fat JAR, JDK 8 baseline + JDK 11+ overlay, OkHttp as sole runtime dependency |
|
|
231
|
+
|
|
232
|
+
> **`specgen-ts-cli` vs `specgen-node-cli-web`:** if the deliverable is a terminal tool with
|
|
233
|
+
> commands and flags → `specgen-ts-cli`. If the deliverable is a browser-accessed web app that
|
|
234
|
+
> merely *installs and starts* via a CLI → `specgen-node-cli-web`.
|
|
235
|
+
|
|
236
|
+
⚠️ `specgen-nextjs-react-tailwind` (Next.js 15 App Router) is documented but **not yet
|
|
237
|
+
implemented** (empty stub — no SKILL.md). Do not invoke; fall back to `specgen-react-tailwind`
|
|
238
|
+
+ a REST API specgen, or ask the user.
|
|
239
|
+
|
|
240
|
+
### `testgen-functional`
|
|
241
|
+
- **Invoke:** `/testgen-functional <application> <version> [module:<m>]`
|
|
242
|
+
- **What it does:** Generates a Playwright E2E test plan and per-module test specifications as
|
|
243
|
+
Markdown blueprints (scenarios, data seeding, cleanup) — NOT actual test code.
|
|
244
|
+
- **Use when:** "generate test plan/spec", after specgen completes. Last artifact step.
|
|
245
|
+
- **Prerequisites:** `PRD.md`, `modelgen-*`, `mockgen-*`, `specgen-*` outputs.
|
|
246
|
+
- **Output:** `context/test/` — `TEST_PLAN.md`/`TEST_PLAN.mmd` + per-module `TEST_SPEC.md`.
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Phase 3 — Infrastructure
|
|
251
|
+
|
|
252
|
+
### `util-preparek8senv`
|
|
253
|
+
- **Invoke:** `/util-preparek8senv [environment]`
|
|
254
|
+
- **What it does:** Generates StatefulSet-based K8s manifests for ALL 3rd party supporting
|
|
255
|
+
applications (databases, queues, caches, SSO, gateways) for one target environment, and
|
|
256
|
+
creates/updates `ENVIRONMENT.md` with per-environment configs and credentials. Output goes
|
|
257
|
+
directly into the gitignored `environment/` folder.
|
|
258
|
+
- **Use when:** "prepare k8s environment", "setup infrastructure" — run BEFORE application
|
|
259
|
+
development so backing services exist.
|
|
260
|
+
- **Prerequisites:** `CLAUDE.md`, `DEVTOOL.md`.
|
|
261
|
+
- **Output:** `ENVIRONMENT.md` (created/updated with per-environment configs and credentials)
|
|
262
|
+
and `environment/` — `namespace.yaml` plus one StatefulSet-based manifest per 3rd party
|
|
263
|
+
application (PVC, ConfigMap, Secret, headless Service, NodePort Service).
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Phase 4 — Development
|
|
268
|
+
|
|
269
|
+
### `conductor-feature-develop` (orchestrator)
|
|
270
|
+
- **Invoke:** `/conductor-feature-develop <application> [version:<v>] [module:<m>]`
|
|
271
|
+
- **What it does:** Implements the full application module-by-module (code + Playwright E2E
|
|
272
|
+
tests) using all generated artifacts, tracking progress in `IMPLEMENTATION_MASTER.md` and
|
|
273
|
+
per-module `IMPLEMENTATION_MODULE.md`. Auto-starts a Ralph Loop for cross-session
|
|
274
|
+
continuity; invokes `tracegen-matrix` and `depgen-k8s` at the end.
|
|
275
|
+
- **Use when:** "implement the application", "start development", "develop from specs",
|
|
276
|
+
"resume implementation".
|
|
277
|
+
- **Prerequisites:** all `conductor-feature-prepare` outputs (model/, mockup/,
|
|
278
|
+
specification/, test/).
|
|
279
|
+
- **Output:** application source code organized by module; `context/develop/` tracking files
|
|
280
|
+
(`IMPLEMENTATION_MASTER.md` with overall status/execution order/pre-implementation
|
|
281
|
+
checklist, and per-module `IMPLEMENTATION_MODULE.md` with resource tables, implementation
|
|
282
|
+
checklists, user-story/NFR completion checklists and timestamped logs); Playwright E2E test
|
|
283
|
+
suite per module; then via auto-invoked sub-skills: `context/TRACEABILITY.md`, `Dockerfile`
|
|
284
|
+
and `k8s/` manifests.
|
|
285
|
+
|
|
286
|
+
### `tracegen-matrix`
|
|
287
|
+
- **Invoke:** `/tracegen-matrix <application> [version] [module]`
|
|
288
|
+
- **What it does:** Links every PRD requirement ID and bug code to the implementing source
|
|
289
|
+
code and writes `context/TRACEABILITY.md`. Resolves from in-source CO2 comments
|
|
290
|
+
(`Implements:` / `NFR:` / `Constraints:` / `Bug fixes:`) with a name-based fallback;
|
|
291
|
+
optional codebase-memory MCP enrichment (works fully without it).
|
|
292
|
+
- **Use when:** "generate/update traceability", "link requirements to code" — usually invoked
|
|
293
|
+
automatically as the final step of `conductor-feature-develop` and `conductor-defect`.
|
|
294
|
+
- **Prerequisites:** `PRD.md`, `specification/*/SPEC.md`, application source code.
|
|
295
|
+
- **Output:** `context/TRACEABILITY.md` — per-application matrix mapping every requirement ID
|
|
296
|
+
and bug code to the implementing source files.
|
|
297
|
+
|
|
298
|
+
### `depgen-k8s`
|
|
299
|
+
- **Invoke:** `/depgen-k8s <application> [environment]`
|
|
300
|
+
- **What it does:** Generates a production-ready multi-stage Dockerfile (application root) and
|
|
301
|
+
Kubernetes manifests in the gitignored `<app_folder>/k8s/` for one target environment.
|
|
302
|
+
Auto-detects the stack (Spring Boot / Laravel / Node.js) from project files. Only CUSTOM
|
|
303
|
+
applications — never 3rd party services (those are `util-preparek8senv`'s job).
|
|
304
|
+
- **Use when:** "containerize", "create a Dockerfile", "generate k8s manifests", "deploy this
|
|
305
|
+
app" — auto-invoked by `conductor-feature-develop` after all modules complete.
|
|
306
|
+
- **Prerequisites:** `SPECIFICATION.md`, `CLAUDE.md`, application source code.
|
|
307
|
+
- **Output:** `<app_folder>/Dockerfile` (multi-stage, production-ready) and
|
|
308
|
+
`<app_folder>/k8s/` — namespace, ConfigMap, Secret, Deployment, Service and Ingress YAML
|
|
309
|
+
files with env-var mapping and health/readiness probes (gitignored, per-machine).
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Phase 5 — Bug Fixing
|
|
314
|
+
|
|
315
|
+
### `conductor-defect` (orchestrator)
|
|
316
|
+
- **Invoke:** `/conductor-defect <application> [version:<v>] [module:<m>]`
|
|
317
|
+
- **What it does:** Fixes bugs from `<app_folder>/context/BUG.md` one at a time: tags untagged
|
|
318
|
+
bugs, creates `BUG_MASTER.md`, then per bug — reproduce with Playwright, write
|
|
319
|
+
`BUG_TEST_SPEC.md`, plan (`BUG_FIX_PLAN.md`), fix, verify, and sync affected artifacts
|
|
320
|
+
(mockups, specs, models, PRD). Manages Ralph Loop internally; runs `tracegen-matrix` at the
|
|
321
|
+
end.
|
|
322
|
+
- **Use when:** "fix bugs", "bug fix session", "resolve bugs from BUG.md",
|
|
323
|
+
"resume bug fixing".
|
|
324
|
+
- **Prerequisites:** `BUG.md`, all `conductor-feature-prepare` outputs.
|
|
325
|
+
- **Output:** fixed source code; tagged `BUG.md` (`[BUG-XXX]`); `context/bug/BUG_MASTER.md`
|
|
326
|
+
tracking file (statuses: NEW, IN_PROGRESS, FIXED, CANNOT_REPRODUCE, HIGH_IMPACT); per-bug
|
|
327
|
+
folder `context/bug/<module>/<BUG-XXX>/` with `reproduce.spec.ts`,
|
|
328
|
+
`screenshot_reproduce.png`, `BUG_TEST_SPEC.md`, `BUG_FIX_PLAN.md`, `screenshot_fixed.png`;
|
|
329
|
+
synced artifacts (mockups, specs, models, PRD) and an updated `context/TRACEABILITY.md`.
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## Quick Decision Table
|
|
334
|
+
|
|
335
|
+
| User intent sounds like… | Invoke |
|
|
336
|
+
|---|---|
|
|
337
|
+
| "start a new project / I have an app idea" | `util-projectinit` (then user runs `/brainstorm-loop`) |
|
|
338
|
+
| "sync folders / CLAUDE.md changed / scaffold PRDs" | `util-projectsync` |
|
|
339
|
+
| "check my requirements / review user stories" | `util-usanalyzer` |
|
|
340
|
+
| "tag the new PRD items / add requirement IDs" | `util-ustagger` |
|
|
341
|
+
| "prepare everything for development" | `conductor-feature-prepare` |
|
|
342
|
+
| "design the data model / ERD" | `modelgen-relational` or `modelgen-nosql` (by datastore) |
|
|
343
|
+
| "generate mockups / UI screens" | `mockgen-tailwind` or `mockgen-shadcn` (by stack) |
|
|
344
|
+
| "write the technical spec" | the ONE `specgen-*` matching the stack (see table) |
|
|
345
|
+
| "generate the test plan" | `testgen-functional` |
|
|
346
|
+
| "set up databases/queues in k8s" | `util-preparek8senv` |
|
|
347
|
+
| "build/implement the app" | `conductor-feature-develop` |
|
|
348
|
+
| "link requirements to code" | `tracegen-matrix` |
|
|
349
|
+
| "dockerize / deploy the app" | `depgen-k8s` |
|
|
350
|
+
| "fix the reported bugs" | `conductor-defect` |
|
package/plugin/co2.svg
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 80" width="200" height="80">
|
|
2
|
+
<text x="100" y="55" font-family="Arial, Helvetica, sans-serif" font-size="48" font-weight="bold" fill="#2563EB" text-anchor="middle">
|
|
3
|
+
CO<tspan font-size="32" baseline-shift="-8">2</tspan>
|
|
4
|
+
</text>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: In-session loop — watch a folder for AI brainstorm session documents and advance each per the shared protocol (60s polling, token-efficient)
|
|
3
|
+
argument-hint: [scan-root] [max-watch-rounds]
|
|
4
|
+
allowed-tools: Bash(find:*), Bash(sleep:*), Bash(md5sum:*), Bash(sort:*), Bash(bash:*), Read, Write, Edit, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Brainstorm Session Loop (in-session, token-efficient)
|
|
8
|
+
|
|
9
|
+
You are the **AI Agent** actor defined in `brainstorm-protocol.md`. Read that file
|
|
10
|
+
from the scan root FIRST and follow it exactly. This command defines only the
|
|
11
|
+
polling mechanics; the protocol governs all document handling.
|
|
12
|
+
|
|
13
|
+
**Scan root**: `$1` (default: current working directory)
|
|
14
|
+
**Max watch rounds**: `$2` (default: 20 — each watch round blocks up to ~9 minutes,
|
|
15
|
+
so the default covers roughly a 3-hour working session)
|
|
16
|
+
|
|
17
|
+
## Core principle: pay tokens only for change
|
|
18
|
+
|
|
19
|
+
You have session memory — use it. Maintain an in-memory cache across cycles:
|
|
20
|
+
`{ file_path → (mtime, state, current_round, last_turn_decision) }`.
|
|
21
|
+
Never fully re-read a file whose mtime is unchanged since you last processed it.
|
|
22
|
+
|
|
23
|
+
## Phase 1 — Initial full scan (once, at invocation)
|
|
24
|
+
|
|
25
|
+
1. `find <scan-root> -name '*.brainstorm.md' -not -path '*/node_modules/*' -printf '%p %T@\n'`
|
|
26
|
+
2. For each file, read the frontmatter head; keep only `doc_type: ai-brainstorm-session`.
|
|
27
|
+
3. Build the cache. For every document where it is YOUR TURN per the Status table
|
|
28
|
+
(protocol §5.1 NEW / §5.3 continue / §5.4 finalize), act now — one document at a
|
|
29
|
+
time, sequentially, with strict session isolation (§6.7) and the pre-write
|
|
30
|
+
re-read rule (§6.8). Update the cache after each write.
|
|
31
|
+
4. Report one concise summary line.
|
|
32
|
+
|
|
33
|
+
## Phase 2 — Watch loop (repeat up to max-watch-rounds)
|
|
34
|
+
|
|
35
|
+
Run this single BLOCKING bash call (set the bash timeout to 600000 ms). It polls
|
|
36
|
+
internally every 60 s and returns early only when something changed — idle waiting
|
|
37
|
+
costs you zero tokens:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
ROOT="<scan-root>"
|
|
41
|
+
snap() { find "$ROOT" -name '*.brainstorm.md' -not -path '*/node_modules/*' -printf '%p %T@\n' | sort | md5sum; }
|
|
42
|
+
S0=$(snap)
|
|
43
|
+
for i in 1 2 3 4 5 6 7 8 9; do
|
|
44
|
+
sleep 60
|
|
45
|
+
S1=$(snap)
|
|
46
|
+
if [ "$S0" != "$S1" ]; then echo "CHANGED"; exit 0; fi
|
|
47
|
+
done
|
|
48
|
+
echo "UNCHANGED"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
- On `UNCHANGED`: emit nothing except a minimal heartbeat (e.g. `…watching (round 4/20)`),
|
|
52
|
+
then start the next watch round. Do not re-read any files.
|
|
53
|
+
- On `CHANGED`: re-run the find/printf listing, diff mtimes against the cache, and
|
|
54
|
+
fully re-read ONLY the changed files (plus any brand-new files). For each changed
|
|
55
|
+
document, derive the turn from its Status table (authoritative over frontmatter)
|
|
56
|
+
and act per protocol §5.1 / §5.3 / §5.4 if it is your turn. A human save without a
|
|
57
|
+
status flip is not your turn — update the cached mtime and resume watching.
|
|
58
|
+
Update the runtime status file, then report one concise line, e.g.:
|
|
59
|
+
`advanced api-key-rotation (round 2 → 3); finalized cost-model (xlsx written); 1 still awaiting human`
|
|
60
|
+
|
|
61
|
+
## Runtime status file (compaction advisory)
|
|
62
|
+
|
|
63
|
+
Maintain a runtime dashboard at `<scan-root>/.brainstorm-loop-status.md`. This file
|
|
64
|
+
is intentionally OUTSIDE the `*.brainstorm.md` watch glob — the watcher must never
|
|
65
|
+
see it (writing to it must not trigger a wake). Update it only at moments you are
|
|
66
|
+
already awake: after the Phase 1 scan, after acting on any document, and at the end
|
|
67
|
+
of every watch round. Never wake solely to update it.
|
|
68
|
+
|
|
69
|
+
Format (override the whole file each update):
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
# Brainstorm Loop Status
|
|
73
|
+
- loop_started: <ISO timestamp>
|
|
74
|
+
- watch_round: 7 / 20
|
|
75
|
+
- agent_actions_this_conversation: 9
|
|
76
|
+
- compact_advice: OK <!-- OK | RECOMMENDED | REQUIRED -->
|
|
77
|
+
- advice_reason: —
|
|
78
|
+
|
|
79
|
+
## Sessions
|
|
80
|
+
| session_id | state | round | last activity |
|
|
81
|
+
| ---------------- | -------------- | ----- | -------------------- |
|
|
82
|
+
| api-key-rotation | AWAITING_HUMAN | 3 | agent asked round 3 |
|
|
83
|
+
| cost-model | CLOSED | 5 | xlsx finalized |
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Advisory heuristic (token count is not directly observable — use work proxies):
|
|
87
|
+
- `OK` — fewer than ~10 agent actions since the conversation started (or since the
|
|
88
|
+
user last compacted) and under 2/3 of max watch rounds.
|
|
89
|
+
- `RECOMMENDED` — ~10+ agent actions, or watch rounds past 2/3 of max, or any
|
|
90
|
+
single action involved reading large reference files. Set advice_reason
|
|
91
|
+
accordingly (e.g. "12 actions incl. 2 large reference reads").
|
|
92
|
+
- `REQUIRED` — max watch rounds reached; the loop is stopping. Reason:
|
|
93
|
+
"loop halted — run /compact then /brainstorm-loop to resume".
|
|
94
|
+
|
|
95
|
+
If the user tells you they have compacted (or you detect compaction per the
|
|
96
|
+
post-compaction rule), reset the action counter and advice to OK after the
|
|
97
|
+
Phase 1 rescan.
|
|
98
|
+
|
|
99
|
+
## Context hygiene
|
|
100
|
+
|
|
101
|
+
- Keep per-cycle output to 1–2 lines. Never echo document contents back into chat
|
|
102
|
+
unless the user asks.
|
|
103
|
+
- If ALL sessions reach `CLOSED`, say so and stop the loop early.
|
|
104
|
+
- On reaching max watch rounds with sessions still active, stop and tell the user:
|
|
105
|
+
run `/compact` if the session is long, then re-invoke `/brainstorm-loop` — the
|
|
106
|
+
first phase-1 scan will rebuild the cache from the files, so nothing is lost.
|
|
107
|
+
- All coordination state lives in the documents, never only in your memory: after
|
|
108
|
+
every action, frontmatter `state`/`current_round` must reflect reality, so a
|
|
109
|
+
compaction or restart is always safe.
|
|
110
|
+
|
|
111
|
+
## Post-compaction rule
|
|
112
|
+
|
|
113
|
+
If this conversation has been compacted (auto or manual) at any point since the
|
|
114
|
+
last Phase 1 scan, treat your in-memory cache and any remembered per-session
|
|
115
|
+
conclusions as INVALID. Immediately redo Phase 1 (full scan, rebuild cache,
|
|
116
|
+
re-derive every turn from the Status tables) before taking any action. Never act
|
|
117
|
+
on a summarized memory of a document's state — the files are the only truth.
|
|
118
|
+
|
|
119
|
+
## Hard boundaries
|
|
120
|
+
|
|
121
|
+
- Never set `Session completion` yourself.
|
|
122
|
+
- Never edit Human-owned content (answers, feedback, Objective, Context,
|
|
123
|
+
Output Specification).
|
|
124
|
+
- Never let one session's content influence another (protocol §6.7).
|
|
125
|
+
|
|
126
|
+
## Portability note
|
|
127
|
+
|
|
128
|
+
`find -printf` is GNU find (Linux / Git Bash / WSL). On macOS/BSD, substitute:
|
|
129
|
+
`find "$ROOT" -name '*.brainstorm.md' -exec stat -f '%N %m' {} \; | sort | md5sum`
|