create-claude-cabinet 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +196 -0
  3. package/bin/create-claude-cabinet.js +8 -0
  4. package/lib/cli.js +624 -0
  5. package/lib/copy.js +152 -0
  6. package/lib/db-setup.js +51 -0
  7. package/lib/metadata.js +42 -0
  8. package/lib/reset.js +193 -0
  9. package/lib/settings-merge.js +93 -0
  10. package/package.json +29 -0
  11. package/templates/EXTENSIONS.md +311 -0
  12. package/templates/README.md +485 -0
  13. package/templates/briefing/_briefing-api-template.md +21 -0
  14. package/templates/briefing/_briefing-architecture-template.md +16 -0
  15. package/templates/briefing/_briefing-cabinet-template.md +20 -0
  16. package/templates/briefing/_briefing-identity-template.md +18 -0
  17. package/templates/briefing/_briefing-scopes-template.md +39 -0
  18. package/templates/briefing/_briefing-template.md +148 -0
  19. package/templates/briefing/_briefing-work-tracking-template.md +18 -0
  20. package/templates/cabinet/committees-template.yaml +49 -0
  21. package/templates/cabinet/composition-patterns.md +240 -0
  22. package/templates/cabinet/eval-protocol.md +208 -0
  23. package/templates/cabinet/lifecycle.md +93 -0
  24. package/templates/cabinet/output-contract.md +148 -0
  25. package/templates/cabinet/prompt-guide.md +266 -0
  26. package/templates/hooks/cor-upstream-guard.sh +79 -0
  27. package/templates/hooks/git-guardrails.sh +67 -0
  28. package/templates/hooks/skill-telemetry.sh +66 -0
  29. package/templates/hooks/skill-tool-telemetry.sh +54 -0
  30. package/templates/hooks/stop-hook.md +56 -0
  31. package/templates/memory/patterns/_pattern-template.md +119 -0
  32. package/templates/memory/patterns/pattern-intelligence-first.md +41 -0
  33. package/templates/rules/enforcement-pipeline.md +151 -0
  34. package/templates/scripts/cor-drift-check.cjs +84 -0
  35. package/templates/scripts/finding-schema.json +94 -0
  36. package/templates/scripts/load-triage-history.js +151 -0
  37. package/templates/scripts/merge-findings.js +126 -0
  38. package/templates/scripts/pib-db-schema.sql +68 -0
  39. package/templates/scripts/pib-db.js +365 -0
  40. package/templates/scripts/triage-server.mjs +98 -0
  41. package/templates/scripts/triage-ui.html +536 -0
  42. package/templates/skills/audit/SKILL.md +273 -0
  43. package/templates/skills/audit/phases/finding-output.md +56 -0
  44. package/templates/skills/audit/phases/member-execution.md +83 -0
  45. package/templates/skills/audit/phases/member-selection.md +44 -0
  46. package/templates/skills/audit/phases/structural-checks.md +54 -0
  47. package/templates/skills/audit/phases/triage-history.md +45 -0
  48. package/templates/skills/cabinet-accessibility/SKILL.md +180 -0
  49. package/templates/skills/cabinet-anti-confirmation/SKILL.md +172 -0
  50. package/templates/skills/cabinet-architecture/SKILL.md +279 -0
  51. package/templates/skills/cabinet-boundary-man/SKILL.md +265 -0
  52. package/templates/skills/cabinet-cor-health/SKILL.md +342 -0
  53. package/templates/skills/cabinet-data-integrity/SKILL.md +157 -0
  54. package/templates/skills/cabinet-debugger/SKILL.md +221 -0
  55. package/templates/skills/cabinet-historian/SKILL.md +253 -0
  56. package/templates/skills/cabinet-organized-mind/SKILL.md +338 -0
  57. package/templates/skills/cabinet-process-therapist/SKILL.md +261 -0
  58. package/templates/skills/cabinet-qa/SKILL.md +205 -0
  59. package/templates/skills/cabinet-record-keeper/SKILL.md +168 -0
  60. package/templates/skills/cabinet-roster-check/SKILL.md +297 -0
  61. package/templates/skills/cabinet-security/SKILL.md +181 -0
  62. package/templates/skills/cabinet-small-screen/SKILL.md +154 -0
  63. package/templates/skills/cabinet-speed-freak/SKILL.md +169 -0
  64. package/templates/skills/cabinet-system-advocate/SKILL.md +194 -0
  65. package/templates/skills/cabinet-technical-debt/SKILL.md +115 -0
  66. package/templates/skills/cabinet-usability/SKILL.md +189 -0
  67. package/templates/skills/cabinet-workflow-cop/SKILL.md +238 -0
  68. package/templates/skills/cor-upgrade/SKILL.md +302 -0
  69. package/templates/skills/debrief/SKILL.md +409 -0
  70. package/templates/skills/debrief/phases/auto-maintenance.md +48 -0
  71. package/templates/skills/debrief/phases/close-work.md +88 -0
  72. package/templates/skills/debrief/phases/health-checks.md +54 -0
  73. package/templates/skills/debrief/phases/inventory.md +40 -0
  74. package/templates/skills/debrief/phases/loose-ends.md +52 -0
  75. package/templates/skills/debrief/phases/record-lessons.md +67 -0
  76. package/templates/skills/debrief/phases/report.md +59 -0
  77. package/templates/skills/debrief/phases/update-state.md +48 -0
  78. package/templates/skills/debrief/phases/upstream-feedback.md +129 -0
  79. package/templates/skills/debrief-quick/SKILL.md +12 -0
  80. package/templates/skills/execute/SKILL.md +293 -0
  81. package/templates/skills/execute/phases/cabinet.md +49 -0
  82. package/templates/skills/execute/phases/commit-and-deploy.md +66 -0
  83. package/templates/skills/execute/phases/load-plan.md +49 -0
  84. package/templates/skills/execute/phases/validators.md +50 -0
  85. package/templates/skills/execute/phases/verification-tools.md +67 -0
  86. package/templates/skills/extract/SKILL.md +168 -0
  87. package/templates/skills/investigate/SKILL.md +160 -0
  88. package/templates/skills/link/SKILL.md +52 -0
  89. package/templates/skills/menu/SKILL.md +61 -0
  90. package/templates/skills/onboard/SKILL.md +356 -0
  91. package/templates/skills/onboard/phases/detect-state.md +79 -0
  92. package/templates/skills/onboard/phases/generate-briefing.md +127 -0
  93. package/templates/skills/onboard/phases/generate-session-loop.md +87 -0
  94. package/templates/skills/onboard/phases/interview.md +233 -0
  95. package/templates/skills/onboard/phases/modularity-menu.md +162 -0
  96. package/templates/skills/onboard/phases/options.md +98 -0
  97. package/templates/skills/onboard/phases/post-onboard-audit.md +121 -0
  98. package/templates/skills/onboard/phases/summary.md +122 -0
  99. package/templates/skills/onboard/phases/work-tracking.md +231 -0
  100. package/templates/skills/orient/SKILL.md +251 -0
  101. package/templates/skills/orient/phases/auto-maintenance.md +48 -0
  102. package/templates/skills/orient/phases/briefing.md +53 -0
  103. package/templates/skills/orient/phases/cabinet.md +46 -0
  104. package/templates/skills/orient/phases/context.md +63 -0
  105. package/templates/skills/orient/phases/data-sync.md +35 -0
  106. package/templates/skills/orient/phases/health-checks.md +50 -0
  107. package/templates/skills/orient/phases/work-scan.md +69 -0
  108. package/templates/skills/orient-quick/SKILL.md +12 -0
  109. package/templates/skills/plan/SKILL.md +358 -0
  110. package/templates/skills/plan/phases/cabinet-critique.md +47 -0
  111. package/templates/skills/plan/phases/calibration-examples.md +75 -0
  112. package/templates/skills/plan/phases/completeness-check.md +44 -0
  113. package/templates/skills/plan/phases/composition-check.md +36 -0
  114. package/templates/skills/plan/phases/overlap-check.md +62 -0
  115. package/templates/skills/plan/phases/plan-template.md +69 -0
  116. package/templates/skills/plan/phases/present.md +60 -0
  117. package/templates/skills/plan/phases/research.md +43 -0
  118. package/templates/skills/plan/phases/work-tracker.md +95 -0
  119. package/templates/skills/publish/SKILL.md +74 -0
  120. package/templates/skills/pulse/SKILL.md +242 -0
  121. package/templates/skills/pulse/phases/auto-fix-scope.md +40 -0
  122. package/templates/skills/pulse/phases/checks.md +58 -0
  123. package/templates/skills/pulse/phases/output.md +54 -0
  124. package/templates/skills/seed/SKILL.md +257 -0
  125. package/templates/skills/seed/phases/build-member.md +93 -0
  126. package/templates/skills/seed/phases/evaluate-existing.md +61 -0
  127. package/templates/skills/seed/phases/maintain.md +92 -0
  128. package/templates/skills/seed/phases/scan-signals.md +86 -0
  129. package/templates/skills/triage-audit/SKILL.md +251 -0
  130. package/templates/skills/triage-audit/phases/apply-verdicts.md +90 -0
  131. package/templates/skills/triage-audit/phases/load-findings.md +38 -0
  132. package/templates/skills/triage-audit/phases/triage-ui.md +66 -0
  133. package/templates/skills/unlink/SKILL.md +35 -0
  134. package/templates/skills/validate/SKILL.md +116 -0
  135. package/templates/skills/validate/phases/validators.md +53 -0
@@ -0,0 +1,356 @@
1
+ ---
2
+ name: onboard
3
+ description: |
4
+ Assemble the cabinet. Interviews you about your project and prepares the
5
+ briefings your cabinet members need to do their jobs — who you are, what
6
+ you're building, where things live, what matters. Re-runnable as the
7
+ project matures — each run refines based on what the project has learned.
8
+ Use when: "onboard", "set up CoR", "bootstrap", "/onboard".
9
+ related:
10
+ - type: file
11
+ path: .claude/skills/onboard/phases/detect-state.md
12
+ role: "Detect existing CoR artifacts and determine run mode"
13
+ - type: file
14
+ path: .claude/skills/onboard/phases/interview.md
15
+ role: "Conversational interview questions"
16
+ - type: file
17
+ path: .claude/skills/onboard/phases/work-tracking.md
18
+ role: "Choose work tracking system (SQLite vs markdown vs external)"
19
+ - type: file
20
+ path: .claude/skills/onboard/phases/options.md
21
+ role: "Structured decision points before generation"
22
+ - type: file
23
+ path: .claude/skills/onboard/phases/generate-briefing.md
24
+ role: "Generate or update briefing files"
25
+ - type: file
26
+ path: .claude/skills/onboard/phases/generate-session-loop.md
27
+ role: "Wire orient/debrief phase files"
28
+ - type: file
29
+ path: .claude/skills/onboard/phases/modularity-menu.md
30
+ role: "Present opt-in modules"
31
+ - type: file
32
+ path: .claude/skills/onboard/phases/summary.md
33
+ role: "Present what was generated/changed"
34
+ - type: file
35
+ path: .claude/skills/onboard/phases/post-onboard-audit.md
36
+ role: "Configuration sanity check after generation"
37
+ ---
38
+
39
+ # /onboard — Assemble the Cabinet
40
+
41
+ ## Purpose
42
+
43
+ Assemble the cabinet. Before your advisors can do their jobs, they need
44
+ briefings — who you are, what you're building, where things live, what
45
+ matters. Without briefings, the session loop runs blind: orient reads
46
+ files that don't exist, debrief records lessons into a structure that
47
+ hasn't been defined, plan looks for overlap in a work tracker that
48
+ hasn't been wired.
49
+
50
+ Onboard fills this gap through conversation, not mechanical config. It
51
+ interviews you about your project — like sitting down with a new hire
52
+ and walking them through how things work here. The answers become the
53
+ briefings your cabinet reads before every session. It's deliberately
54
+ conversational because the best briefing comes from the person who
55
+ lives with the project, not from scanning a directory tree.
56
+
57
+ This is a **skeleton skill** using the `phases/` directory pattern. The
58
+ orchestration is generic — detect state, interview, generate files. Your
59
+ project customizes the specifics in phase files under `phases/`.
60
+
61
+ ### Phase File Protocol
62
+
63
+ Phase files have three states:
64
+
65
+ | State | Meaning |
66
+ |-------|---------|
67
+ | Absent or empty | Use this skeleton's **default behavior** for the phase |
68
+ | Contains only `skip: true` | **Explicitly opted out** — skip this phase entirely |
69
+ | Contains content | **Custom behavior** — use the file's content instead |
70
+
71
+ The skeleton always does something reasonable when a phase file is absent.
72
+ Phase files customize, not enable. Use `skip: true` when you actively
73
+ don't want a phase to run — not even the default.
74
+
75
+ ## Three Modes
76
+
77
+ Onboard is re-runnable. What it does depends on what already exists:
78
+
79
+ ### 1. First Run (no _briefing.md)
80
+
81
+ No CoR briefing layer exists yet. This is the full interview: who are you,
82
+ what is this, what breaks, what do you need. Generates the complete
83
+ initial briefing layer — `_briefing.md`, CLAUDE.md additions, system-status.md,
84
+ and session loop wiring. The goal is a working session loop by the end of
85
+ the conversation.
86
+
87
+ ### 2. Early Re-Run (sparse artifacts)
88
+
89
+ Some CoR artifacts exist but the project is young. The session loop has
90
+ run a few times and the user has learned what works and what doesn't.
91
+ The interview shifts to refinement: What has the session loop taught you
92
+ that CLAUDE.md doesn't reflect? What friction have you hit? What briefing
93
+ is missing that orient keeps needing? This mode proposes updates to
94
+ existing files rather than creating new ones.
95
+
96
+ ### 3. Mature Re-Run (rich context)
97
+
98
+ The project has been using CoR for a while. Briefing files are populated,
99
+ multiple modules are active, patterns have accumulated. The interview
100
+ becomes a health check: Which modules are you actually using? Is anything
101
+ ready to retire? What gaps have you noticed? Are there new areas the
102
+ system should cover? This mode may propose removing or simplifying things
103
+ as often as adding them.
104
+
105
+ The mode is detected automatically in the detect-state phase. The user
106
+ doesn't have to declare it.
107
+
108
+ ## Why This Matters
109
+
110
+ Every CoR skill reads from the briefing layer. Orient reads `_briefing.md`
111
+ to know what files to check. Plan reads it to know where work items live.
112
+ Cabinet members read it to know where to look. If the briefing layer is empty
113
+ or wrong, every skill downstream is degraded. Onboard is the foundation
114
+ pour — invisible when it's done right, catastrophic when it's missing.
115
+
116
+ The re-run capability matters because projects change. The briefing that
117
+ was accurate at day one drifts as the project grows, shifts direction, or
118
+ discovers new pain points. Onboard is not a one-time setup wizard — it is
119
+ the periodic recalibration that keeps the briefing layer honest.
120
+
121
+ ## Workflow
122
+
123
+ ### 1. Detect State
124
+
125
+ Read `phases/detect-state.md` for how to scan existing CoR artifacts.
126
+
127
+ **Default (absent/empty):** Scan for the standard CoR artifact set:
128
+ `_briefing.md`, `system-status.md`, `orient/phases/`, `debrief/phases/`,
129
+ `pib.db`, `committees.yaml`, `memory/patterns/`. Count what exists, classify
130
+ its richness (empty file vs populated), and determine the run mode. Report
131
+ findings so subsequent phases know whether they're generating, refining,
132
+ or health-checking.
133
+
134
+ In first-run mode, this phase is fast — almost nothing exists. In re-run
135
+ modes, it provides the inventory that the interview phase uses to ask
136
+ targeted questions.
137
+
138
+ ### 2. Interview
139
+
140
+ Read `phases/interview.md` for the conversational questions adapted to
141
+ the detected mode.
142
+
143
+ **Default (absent/empty):**
144
+
145
+ In first-run mode, start with the foundational questions: What is this
146
+ project? What technology stack? Who works on it? What pain points led
147
+ you here? What breaks silently? What do you wish Claude knew about this
148
+ project from the start?
149
+
150
+ In early re-run mode, shift to refinement: What has the session loop
151
+ taught you that the briefing files don't capture? What does orient miss?
152
+ What does debrief fail to close? Where is there friction?
153
+
154
+ In mature re-run mode, shift to health: Which modules are you actually
155
+ using? Anything that felt useful at first but isn't anymore? Gaps you've
156
+ noticed in coverage? Any pain points that the system should have caught
157
+ by now?
158
+
159
+ This is a conversation, not a form. Ask 2-3 questions at a time, not all
160
+ at once. Follow up on answers — if the user mentions a pain point, dig
161
+ into it. If something sounds like it maps to a specific CoR module, note
162
+ it for the modularity menu phase. The interview is the most valuable
163
+ phase because it captures knowledge that no amount of file scanning can
164
+ surface.
165
+
166
+ ### 3. Work Tracking
167
+
168
+ Read `phases/work-tracking.md` for how to present work tracking options.
169
+
170
+ **Default (absent/empty):** Detect existing work tracking (pib.db,
171
+ tasks.md, GitHub Issues, custom phase files). Present two built-in
172
+ options — SQLite database (pib-db) or markdown file (tasks.md) — plus
173
+ bring-your-own for external systems. User picks one, the other, or
174
+ neither. The choice is recorded in `.corrc.json` under `workTracking`
175
+ and feeds into generate-briefing and generate-session-loop.
176
+
177
+ ### 4. Options
178
+
179
+ Read `phases/options.md` for how to present structured decision points.
180
+
181
+ **Default (absent/empty):** If the interview revealed open decisions
182
+ (tech stack undecided, architecture unclear, "what would you recommend?"),
183
+ present 2-3 options per decision with trade-offs. Uses architecture and
184
+ boundary-man cabinet members internally to evaluate each option.
185
+ Skips automatically when the user already has clear opinions or this is
186
+ a re-run.
187
+
188
+ The user's choices feed into generate-briefing. Deferred decisions are
189
+ noted as open questions in `_briefing.md`.
190
+
191
+ ### 5. Generate Briefing
192
+
193
+ Read `phases/generate-briefing.md` for how to create or update the briefing
194
+ layer from interview answers.
195
+
196
+ **Default (absent/empty):**
197
+
198
+ In first-run mode, generate:
199
+ - `_briefing.md` from the `_briefing-template.md` — populated with the
200
+ project's identity, stack, principles, architecture, and scan scopes
201
+ - CLAUDE.md additions — project-specific instructions that Claude should
202
+ always follow
203
+ - `system-status.md` — initial state tracking file
204
+
205
+ In re-run mode, propose specific updates to existing files. Show what
206
+ would change as diffs — never overwrite without showing the delta. Let
207
+ the user approve, modify, or reject each change. The user owns their
208
+ briefing files; onboard proposes, never imposes.
209
+
210
+ ### 6. Generate Session Loop
211
+
212
+ Read `phases/generate-session-loop.md` for how to wire orient and debrief
213
+ phase files.
214
+
215
+ **Default (absent/empty):**
216
+
217
+ In first-run mode, create the minimal phase files that make the session
218
+ loop functional:
219
+ - `orient/phases/context.md` pointing at the files generated in step 5
220
+ - Any other orient phase files needed based on what the interview revealed
221
+ (e.g., `data-sync.md` if the project has a remote data store)
222
+ - Debrief phase files if the interview revealed specific close-of-session
223
+ needs
224
+
225
+ Reference existing skeleton defaults — only create phase files that need
226
+ to diverge from defaults. If the default behavior for a phase is already
227
+ correct for this project, don't create a file that restates the default.
228
+
229
+ In re-run mode, examine existing phase files and propose refinements based
230
+ on what the interview surfaced. If the user said "orient never shows me X,"
231
+ that's a signal to update the work-scan or health-checks phase.
232
+
233
+ ### 7. Modularity Menu
234
+
235
+ Read `phases/modularity-menu.md` for which CoR modules to present.
236
+
237
+ **Default (absent/empty):** Present the module hierarchy with adoption
238
+ recommendations based on the interview. The session loop is always set up.
239
+ Other modules are presented with clear descriptions of what they add and
240
+ what they cost in complexity. The user opts in to what makes sense now —
241
+ they can always add more later.
242
+
243
+ In re-run mode, show what's adopted alongside what's available. Surface
244
+ retirement candidates — modules that were adopted but aren't being used.
245
+
246
+ ### 8. Summary
247
+
248
+ Read `phases/summary.md` for how to present results.
249
+
250
+ **Default (absent/empty):** Present what was generated or changed, what
251
+ was skipped, and what to do next. Emphasize progressive refinement: these
252
+ files are a starting point, not a finished product. They'll improve
253
+ through use as orient and debrief reveal what's missing.
254
+
255
+ In re-run mode, present a before/after view: what the briefing layer
256
+ looked like before, what changed, and why.
257
+
258
+ ### 9. Post-Onboard Audit
259
+
260
+ Read `phases/post-onboard-audit.md` for the configuration sanity check.
261
+
262
+ **Default (absent/empty):** Run a lightweight audit from the cor-health
263
+ cabinet member, scoped to what was just generated. Checks interview–config
264
+ coherence (did mentioned technologies get wired into phase files?),
265
+ module–phase alignment (do phase files reference skipped modules?),
266
+ structural basics (do referenced files exist?), and first-session
267
+ readiness (will orient work on its first run?).
268
+
269
+ If everything checks out, one line: "Configuration looks clean." If
270
+ issues are found, present them and offer to fix immediately. This is a
271
+ pre-flight check, not a deferred finding.
272
+
273
+ ## Phase Summary
274
+
275
+ | Phase | Absent = | What it customizes |
276
+ |-------|----------|-------------------|
277
+ | `detect-state.md` | Default: scan standard CoR artifacts | What artifacts to scan and how to determine mode |
278
+ | `interview.md` | Default: mode-adapted questions | What to ask and how to follow up |
279
+ | `work-tracking.md` | Default: detect & present choices | What work tracking system to use (pib-db, markdown, or external) |
280
+ | `options.md` | Default: present decisions with trade-offs | What decisions to surface and how to frame options |
281
+ | `generate-briefing.md` | Default: create/update _briefing.md, CLAUDE.md, system-status.md | What files to generate and how |
282
+ | `generate-session-loop.md` | Default: wire orient/debrief phases | How to set up the session loop |
283
+ | `modularity-menu.md` | Default: present module hierarchy | Which modules to present and how |
284
+ | `summary.md` | Default: present changes + next steps | How to present results |
285
+ | `post-onboard-audit.md` | Default: cor-health sanity check | What to verify after generation |
286
+
287
+ ## Conversational Stance
288
+
289
+ Onboard is a companion, not a configurator. The framing is "let's figure
290
+ out what your project needs" — not "I'll set up your system now." The
291
+ interview is genuine curiosity about the project, not a checklist to get
292
+ through. When the user describes a pain point, the right response is to
293
+ understand it, not to immediately map it to a CoR module.
294
+
295
+ This matters because the quality of the briefing layer depends on the
296
+ quality of the conversation. A mechanical interview produces mechanical
297
+ briefing files. A genuine conversation about what the project needs, what
298
+ breaks, what matters — that produces briefing files worth reading.
299
+
300
+ Concrete stance markers:
301
+ - "Tell me about this project" not "Please provide your project description"
302
+ - "What breaks that nobody notices?" not "List your system's failure modes"
303
+ - "Based on what you've described, I think X would help because..." not
304
+ "Module X is recommended for projects with these characteristics"
305
+ - Ask why, not just what. The reasoning behind a pain point often reveals
306
+ the right response better than the symptom itself.
307
+
308
+ ## Extending
309
+
310
+ To customize a phase: write content in the corresponding `phases/` file.
311
+ To skip a phase: write only `skip: true` in the file.
312
+ To add a phase the skeleton doesn't define: create a new file in
313
+ `phases/` with a description of when it runs relative to the core phases.
314
+
315
+ Examples of phases mature adopters add:
316
+ - Team onboarding (multi-person context: who knows what, communication norms)
317
+ - Migration import (pull context from an existing system being replaced)
318
+ - Integration discovery (scan for connected services, APIs, databases)
319
+ - Compliance baseline (capture regulatory or policy constraints upfront)
320
+
321
+ ## Calibration
322
+
323
+ **Core failure this targets:** Starting CoR adoption with empty context
324
+ files, causing the session loop to run without knowing anything about the
325
+ project it's supposed to help.
326
+
327
+ ### Without Skill (Bad)
328
+
329
+ A project adopts CoR. They copy the skeleton files, run `/orient` — it
330
+ reads a blank `_briefing.md` and an empty `system-status.md`, reports
331
+ nothing useful. They run `/debrief` — it tries to close work items but
332
+ doesn't know where work is tracked. They create a plan — cabinet members
333
+ activate but have no project briefing to ground their findings in. Every
334
+ skill technically runs but none of them know enough to be useful.
335
+
336
+ The user fills in briefing files manually, guessing at what sections
337
+ matter. They miss the scan scopes section entirely, so cabinet members
338
+ can't find the right directories. They write a project description that's
339
+ too abstract to be actionable. Three weeks later, they're still
340
+ discovering context gaps one at a time.
341
+
342
+ ### With Skill (Good)
343
+
344
+ A project adopts CoR and runs `/onboard`. The interview asks what the
345
+ project is, what stack it uses, what hurts. The user mentions they have a
346
+ Rails app with a PostgreSQL database, three developers, and a recurring
347
+ problem with stale feature flags. From the conversation, onboard generates
348
+ a `_briefing.md` with the right scan scopes, a `system-status.md` that
349
+ tracks feature flag freshness, and orient phase files that check the
350
+ database and flag stale flags at session start.
351
+
352
+ The session loop works from day one because it knows what to look at.
353
+ Two weeks later, the user runs `/onboard` again. "Orient is great but it
354
+ never mentions the deploy pipeline." Onboard proposes adding a
355
+ health-check phase for deploy status. The briefing layer grows from use,
356
+ not from guessing.
@@ -0,0 +1,79 @@
1
+ # Detect State — Scan Claude Cabinet Artifacts and Determine Mode
2
+
3
+ Scan the project for existing CoR artifacts to determine whether this is
4
+ a first run, early re-run, or mature re-run. The mode determination
5
+ drives how every subsequent phase behaves.
6
+
7
+ When this file is absent or empty, the default behavior is: scan for the
8
+ standard CoR artifact set, classify each artifact's richness, and
9
+ determine the mode. To explicitly skip state detection (force first-run
10
+ mode), write only `skip: true`.
11
+
12
+ ## Fast Path
13
+
14
+ Check for `_briefing.md` (or `cabinet/_briefing.md`).
15
+ If it doesn't exist, the mode is **first-run** — skip the full scan and
16
+ move to the interview immediately. No need to check 10 artifact types
17
+ when the primary signal is absent.
18
+
19
+ Also read `.corrc.json` if it exists — it records which modules the CLI
20
+ installed and which were skipped (with reasons). The interview phase uses
21
+ this to skip redundant questions.
22
+
23
+ ## User-Level State
24
+
25
+ Before scanning the project, check the user-level layer:
26
+
27
+ - **`~/.claude/CLAUDE.md`** — does a user profile exist? If yes, the
28
+ interview can skip identity questions. If it's sparse or stale (e.g.,
29
+ mentions a role the user seems to have moved past), flag it for the
30
+ interview phase to offer an update.
31
+ - **`~/.claude/cor-registry.json`** — how many other projects does this
32
+ user have? The interview phase uses this to ask about relationships
33
+ between projects. If the registry doesn't exist, skip — the user may
34
+ have installed via npm instead of the shell installer.
35
+
36
+ ## Full Scan (re-runs only)
37
+
38
+ Only when `_briefing.md` exists, scan these artifacts to distinguish
39
+ early vs mature re-run:
40
+
41
+ | Artifact | Path Pattern | Indicates |
42
+ |----------|-------------|-----------|
43
+ | System status | `system-status.md` | State tracking exists |
44
+ | Orient phases | `.claude/skills/orient/phases/*.md` | Session loop is wired |
45
+ | Debrief phases | `.claude/skills/debrief/phases/*.md` | Session loop is wired |
46
+ | Work tracking DB | `pib.db` | Work tracking is active |
47
+ | Cabinet committees | `committees.yaml` or `cabinet/committees.yaml` | Audit system configured |
48
+ | Memory patterns | `memory/patterns/*.md` or `.claude/memory/patterns/*.md` | Feedback loop is active |
49
+ | CLAUDE.md | Root `CLAUDE.md` | Project instructions exist |
50
+ | Rules files | `.claude/rules/*.md` | Scoped instructions exist |
51
+ | Hook config | `.claude/settings.json` or `.claude/settings.local.json` | Enforcement hooks exist |
52
+
53
+ **Early re-run:** Fewer than 5 of the above are populated.
54
+ **Mature re-run:** 5 or more are populated.
55
+
56
+ ## Output
57
+
58
+ For first-run: `Mode: first-run` — that's it. Move on.
59
+
60
+ For re-runs, report a structured summary that subsequent phases can
61
+ reference:
62
+
63
+ ```
64
+ Mode: early-rerun | mature-rerun
65
+
66
+ Artifacts found:
67
+ - system-status.md: populated
68
+ - orient phases: 3 files (context.md, work-scan.md, health-checks.md)
69
+ - pib.db: absent
70
+ - memory patterns: 4 files
71
+ ...
72
+
73
+ Summary: Early re-run. Session loop is wired but work tracking and
74
+ audit are not yet active. Context layer is 3 weeks old.
75
+ ```
76
+
77
+ This summary is not presented to the user directly — it feeds into the
78
+ interview phase so questions can be targeted. The user sees the mode
79
+ reflected in the questions they're asked, not as a diagnostic report.
@@ -0,0 +1,127 @@
1
+ # Generate Briefing — Create or Update Briefing Files
2
+
3
+ Transform interview answers into the files that make the rest of Claude Cabinet
4
+ functional. This is where conversation becomes infrastructure — but it
5
+ is always a proposal, never an imposition.
6
+
7
+ When this file is absent or empty, the default behavior is: generate
8
+ or update files as described below, always showing the user what will
9
+ be created or changed before writing. To explicitly skip briefing
10
+ generation, write only `skip: true`.
11
+
12
+ ## First-Run Generation
13
+
14
+ Create split briefing files from interview answers. The cabinet system
15
+ uses focused files instead of one monolith — see `_briefing-template.md`
16
+ for the full architecture guide.
17
+
18
+ ### Always generate
19
+
20
+ **`_briefing.md`** — The hub/index file. Lists which briefing files were
21
+ created and a one-line summary of each. Always created first.
22
+
23
+ **`_briefing-identity.md`** — Use `_briefing-identity-template.md` as the
24
+ starting point. Populate from interview answers:
25
+ - **What This Project Is** — from identity questions
26
+ - **Core Principles** — from pain points and priorities
27
+ - **User Context** — from who works on the project
28
+
29
+ **`_briefing-architecture.md`** — Use `_briefing-architecture-template.md`.
30
+ Populate from interview answers:
31
+ - **System Structure** — from tech stack and architecture discussion
32
+ - **Codebase Layout** — from where code lives
33
+ - **Technology Stack** — from frameworks, libraries, databases discussed
34
+
35
+ ### Generate if interview covered it
36
+
37
+ **`_briefing-scopes.md`** — Use `_briefing-scopes-template.md`. Only create
38
+ if the interview revealed specific paths and locations. Populate from
39
+ architecture discussion (where does code live, where is the DB, where
40
+ are deploy configs?). Only fill in sections that have real content.
41
+
42
+ **`_briefing-cabinet.md`** — Use `_briefing-cabinet-template.md`. Only
43
+ create after cabinet member selection (during or after onboard). Lists which
44
+ cabinet members are active and how they're grouped.
45
+
46
+ **`_briefing-work-tracking.md`** — Use `_briefing-work-tracking-template.md`.
47
+ Only create if work tracking was discussed in the interview — where items
48
+ live, how to query them, how to mutate them.
49
+
50
+ **`_briefing-api.md`** — Use `_briefing-api-template.md`. Only create if
51
+ the project has an API and the interview covered endpoints, auth, or
52
+ entity types.
53
+
54
+ ### Rules
55
+
56
+ - **Never generate empty files.** Only create a briefing file if the
57
+ interview produced real content for it. An absent file is better than
58
+ one full of placeholders.
59
+ - **The hub lists what exists.** After creating individual files, update
60
+ `_briefing.md` to index them with one-line summaries.
61
+ - **Old monolithic format still works.** If migrating from an existing
62
+ monolithic `_briefing.md`, `/cor-upgrade` handles the split. Don't
63
+ rewrite an existing monolith during onboard re-runs — propose the
64
+ migration instead.
65
+
66
+ ### CLAUDE.md Additions
67
+
68
+ If the project already has a CLAUDE.md, propose additions — don't
69
+ overwrite. If it doesn't, generate an initial one with:
70
+ - Project description (1 paragraph)
71
+ - Key files and directories
72
+ - Conventions and constraints from the interview
73
+ - Any "Claude should always/never" rules that emerged
74
+
75
+ ### system-status.md
76
+
77
+ Create an initial state tracking file with:
78
+ - What's built (current state of the project)
79
+ - What's active (current focus areas)
80
+ - What's planned (near-term intentions from the interview)
81
+
82
+ Keep it concise. This file gets updated every debrief — it doesn't
83
+ need to be comprehensive on day one.
84
+
85
+ ## Re-Run Updates
86
+
87
+ For existing files, never overwrite silently. The protocol:
88
+
89
+ 1. Read the current file content
90
+ 2. Identify what the interview suggests should change
91
+ 3. Present proposed changes as clear before/after diffs
92
+ 4. Let the user approve, modify, or reject each change
93
+ 5. Apply approved changes
94
+
95
+ Common re-run updates:
96
+ - Adding scan scopes that were missing (user said "cabinet members never
97
+ check my tests directory")
98
+ - Updating architecture sections after a stack change
99
+ - Adding new core principles discovered through use
100
+ - Updating work tracking configuration after switching tools
101
+ - Removing stale information that no longer applies
102
+
103
+ ## Update Project Registry
104
+
105
+ After generating the briefing layer, update `~/.claude/cor-registry.json`
106
+ with what you learned from the interview. The installer registers the
107
+ project with just its folder name and an empty description — onboard
108
+ is where the real name and description get filled in.
109
+
110
+ Find this project's entry by path and update:
111
+ - **`name`** — the project's actual name (from the interview, not the
112
+ folder name, unless they match)
113
+ - **`description`** — one line about what the project does
114
+
115
+ This is a silent update — don't ask the user to confirm registry changes
116
+ separately. The information already came from the interview.
117
+
118
+ ## Quality Standards
119
+
120
+ - **Populated, not padded.** Every section should contain real project
121
+ information, not generic advice or placeholder text.
122
+ - **Specific paths, not patterns.** "Server code lives in `src/server/`"
123
+ not "The server code directory."
124
+ - **Decisions, not descriptions.** "We use PostgreSQL because X" carries
125
+ more context than "Database: PostgreSQL."
126
+ - **The user's voice.** Use language from the interview. If they called
127
+ it "the deploy pipeline" don't write "CI/CD infrastructure."
@@ -0,0 +1,87 @@
1
+ # Generate Session Loop — Wire Orient and Debrief Phase Files
2
+
3
+ Create or refine the phase files that make the session loop functional
4
+ for this specific project. The session loop is the mandatory minimum —
5
+ orient reads state, debrief writes state, and the project gets smarter
6
+ with each session.
7
+
8
+ When this file is absent or empty, the default behavior is: create the
9
+ minimal set of phase files that diverge from skeleton defaults, based
10
+ on what the interview revealed. To explicitly skip session loop wiring,
11
+ write only `skip: true`.
12
+
13
+ ## First-Run Wiring
14
+
15
+ The skeleton defaults handle many cases. Only create phase files where
16
+ this project needs something different from the default.
17
+
18
+ ### Always Create
19
+
20
+ **`orient/phases/context.md`** — Point at the briefing files generated in
21
+ the previous phase. At minimum:
22
+ - Read `_briefing.md` for project identity and configuration
23
+ - Read `system-status.md` for current state
24
+ - Read `CLAUDE.md` if it has project-specific instructions beyond what
25
+ Claude Code auto-loads
26
+
27
+ ### Create If Interview Revealed
28
+
29
+ **`orient/phases/data-sync.md`** — If the project has a remote canonical
30
+ data store (database on a server, shared file storage, external API that
31
+ needs fresh pulls). Include the specific sync commands.
32
+
33
+ **`orient/phases/work-scan.md`** — If the project uses a specific work
34
+ tracking system that differs from pib-db defaults (e.g., GitHub Issues,
35
+ Linear, a custom backlog file). If they're using pib-db, the default
36
+ work-scan behavior already handles it — don't create a redundant file.
37
+
38
+ **`orient/phases/health-checks.md`** — If the interview surfaced specific
39
+ failure modes worth detecting at session start (stale deploys, broken
40
+ connections, configuration drift).
41
+
42
+ **`debrief/phases/close-work.md`** — If work items need to be closed in
43
+ a specific system (API calls, issue tracker commands). If using pib-db,
44
+ the default handles it.
45
+
46
+ **`debrief/phases/update-state.md`** — If state lives somewhere specific
47
+ that the default (check system-status.md) wouldn't find.
48
+
49
+ ### Never Create Redundantly
50
+
51
+ Don't create a phase file that restates the skeleton's default behavior.
52
+ If the default is correct, leave the file absent. Phase files exist to
53
+ customize, not to document that the default is fine.
54
+
55
+ Compare what the skeleton says it does by default (in the orient and
56
+ debrief SKILL.md files) with what this project needs. Only write a phase
57
+ file where they diverge.
58
+
59
+ ## Re-Run Refinements
60
+
61
+ In re-run mode, the session loop is already wired. Examine existing
62
+ phase files in the context of what the interview revealed:
63
+
64
+ - **Missing coverage:** User said "orient never mentions X" — does a
65
+ phase file need to be created or updated to scan for X?
66
+ - **Noisy phases:** User said "the health check for Y fires every session
67
+ but it's never a real problem" — should that check be removed or have
68
+ its threshold adjusted?
69
+ - **Stale wiring:** Phase files reference paths or commands that have
70
+ changed since initial onboard. Update them.
71
+ - **Default promotion:** A project that's been using the default work-scan
72
+ may have outgrown it. If the interview suggests the default isn't enough,
73
+ create a custom phase file.
74
+
75
+ Present proposed changes as diffs against current content. Let the user
76
+ approve before modifying existing phase files.
77
+
78
+ ## Structural Principles
79
+
80
+ - **Minimal divergence.** The fewer custom phase files, the less
81
+ maintenance burden. Defaults exist for a reason.
82
+ - **Specific commands.** Phase files should contain the exact commands,
83
+ queries, or file paths — not descriptions of what to do. "Run
84
+ `sqlite3 app.db 'SELECT ...'`" not "Check the database for stale items."
85
+ - **Fail gracefully.** Every phase file should handle the case where its
86
+ target doesn't exist yet (DB not initialized, file not created, service
87
+ not running). Surface the gap, don't crash.