@firatcand/roster 0.4.0 → 1.0.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 (76) hide show
  1. package/README.md +77 -220
  2. package/agents/lesson-drafter.md +3 -8
  3. package/agents/pattern-detector.md +0 -1
  4. package/bin/roster.js +168 -57
  5. package/package.json +2 -3
  6. package/skills/chief-of-staff/SKILL.md +62 -78
  7. package/skills/dreamer/SKILL.md +8 -7
  8. package/skills/roster-orchestrator/SKILL.md +53 -25
  9. package/templates/CLAUDE.project.template.md +1 -1
  10. package/templates/CONTEXT.template.md +2 -2
  11. package/templates/gitignore-defaults.txt +2 -0
  12. package/templates/scaffold/chief-of-staff/README.md +16 -24
  13. package/templates/scaffold/chief-of-staff/agent.md +22 -32
  14. package/templates/scaffold/chief-of-staff/plans/audit-agent.yaml +4 -4
  15. package/templates/scaffold/chief-of-staff/plans/audit-repo.yaml +5 -4
  16. package/templates/scaffold/chief-of-staff/plans/create-agent.yaml +5 -34
  17. package/templates/scaffold/config/project.yaml.template +10 -0
  18. package/templates/scaffold/conventions.md +159 -171
  19. package/templates/scaffold/dreamer/README.md +2 -2
  20. package/templates/scaffold/dreamer/agent.md +0 -1
  21. package/templates/scaffold/dreamer/plans/nightly-reflection.yaml +23 -37
  22. package/templates/scaffold/dreamer/subagents/lesson-drafter.md +2 -7
  23. package/templates/scaffold/{projects/_demo/guidelines → guidelines}/asset-links.md +4 -0
  24. package/templates/scaffold/{projects/_demo/guidelines → guidelines}/brand-book.md +4 -0
  25. package/templates/scaffold/{projects/_demo/guidelines → guidelines}/messaging.md +4 -0
  26. package/templates/scaffold/{projects/_demo/guidelines → guidelines}/voice.md +4 -0
  27. package/templates/scaffold/scripts/audit-agent.sh +74 -47
  28. package/templates/scaffold/scripts/audit-repo.sh +27 -49
  29. package/templates/scaffold/scripts/create-function.sh +1 -1
  30. package/templates/scaffold/scripts/lib/README.md +1 -1
  31. package/templates/scaffold/scripts/lib/bindings-prompt.sh +41 -124
  32. package/templates/scaffold/scripts/new-agent.sh +97 -91
  33. package/templates/scaffold/scripts/rename-agent.sh +91 -0
  34. package/templates/scaffold/scripts/save-state.sh +32 -0
  35. package/agents/critic.md +0 -74
  36. package/agents/enricher.md +0 -56
  37. package/agents/promotion-arbiter.md +0 -71
  38. package/agents/prospector.md +0 -51
  39. package/agents/writer.md +0 -58
  40. package/skills/sdr/SKILL.md +0 -147
  41. package/templates/scaffold/chief-of-staff/plans/add-agent-to-project.yaml +0 -45
  42. package/templates/scaffold/chief-of-staff/plans/archive-project.yaml +0 -51
  43. package/templates/scaffold/chief-of-staff/plans/audit-project.yaml +0 -34
  44. package/templates/scaffold/chief-of-staff/plans/create-project.yaml +0 -65
  45. package/templates/scaffold/chief-of-staff/plans/remove-agent-from-project.yaml +0 -50
  46. package/templates/scaffold/chief-of-staff/plans/rename-project.yaml +0 -62
  47. package/templates/scaffold/chief-of-staff/plans/unarchive-project.yaml +0 -41
  48. package/templates/scaffold/dreamer/subagents/promotion-arbiter.md +0 -64
  49. package/templates/scaffold/gtm/sdr/.claude/settings.json +0 -3
  50. package/templates/scaffold/gtm/sdr/.mcp.json +0 -21
  51. package/templates/scaffold/gtm/sdr/README.md +0 -41
  52. package/templates/scaffold/gtm/sdr/agent.md +0 -136
  53. package/templates/scaffold/gtm/sdr/plans/cold-outreach.yaml +0 -92
  54. package/templates/scaffold/gtm/sdr/projects/_demo/asset-references.md +0 -7
  55. package/templates/scaffold/gtm/sdr/projects/_demo/config/default.yaml +0 -69
  56. package/templates/scaffold/gtm/sdr/projects/_demo/log/feedback/.gitkeep +0 -0
  57. package/templates/scaffold/gtm/sdr/projects/_demo/log/runs/.gitkeep +0 -0
  58. package/templates/scaffold/gtm/sdr/projects/_demo/playbook/.gitkeep +0 -0
  59. package/templates/scaffold/gtm/sdr/subagents/critic.md +0 -67
  60. package/templates/scaffold/gtm/sdr/subagents/enricher.md +0 -49
  61. package/templates/scaffold/gtm/sdr/subagents/prospector.md +0 -44
  62. package/templates/scaffold/gtm/sdr/subagents/writer.md +0 -51
  63. package/templates/scaffold/projects/_demo/CLAUDE.md +0 -35
  64. package/templates/scaffold/projects/_demo/README.md +0 -16
  65. package/templates/scaffold/projects/_demo/assets/.gitkeep +0 -0
  66. package/templates/scaffold/projects/_demo/config/default.yaml +0 -28
  67. package/templates/scaffold/projects/_demo/state.md +0 -11
  68. package/templates/scaffold/scripts/archive-project.sh +0 -98
  69. package/templates/scaffold/scripts/audit-project.sh +0 -361
  70. package/templates/scaffold/scripts/new-agent-instance.sh +0 -114
  71. package/templates/scaffold/scripts/new-project.sh +0 -125
  72. package/templates/scaffold/scripts/remove-agent-from-project.sh +0 -67
  73. package/templates/scaffold/scripts/rename-project.sh +0 -118
  74. package/templates/scaffold/scripts/unarchive-project.sh +0 -115
  75. /package/templates/scaffold/gtm/{sdr/playbook/.gitkeep → .gitkeep} +0 -0
  76. /package/templates/scaffold/{projects/_demo/guidelines → guidelines}/icps/_persona-template.md +0 -0
@@ -1,23 +1,22 @@
1
1
  ---
2
2
  name: chief-of-staff
3
- description: "Repo maintenance for roster workspaces — create, archive, rename, audit projects, agents, and functions. Wraps shell scripts in scripts/ with mandatory confirmation gates for destructive operations. Triggers when the user asks to scaffold or restructure a roster workspace, or invokes the /chief-of-staff slash command."
4
- version: "0.1.0"
3
+ description: "Workspace maintenance for a roster v1 workspace — create agents under a function, register new functions, and audit completeness. Wraps shell scripts in scripts/. Triggers when the user asks to scaffold or audit a roster workspace, or invokes the /chief-of-staff slash command."
4
+ version: "1.0.0"
5
5
  trigger_conditions:
6
6
  - "User invokes the /chief-of-staff slash command"
7
- - "User asks to create, archive, rename, or audit a project (e.g., 'archive _demo', 'create project acme with gtm/sdr')"
8
- - "User asks to add or remove an agent from an existing project"
9
- - "User asks for a repo or project completeness audit"
7
+ - "User asks to scaffold a new agent or register a new function (e.g., 'create a gtm/sdr agent', 'add a design function')"
8
+ - "User asks for a repo or agent completeness audit"
10
9
  ---
11
10
 
12
11
  # Chief of Staff
13
12
 
14
- Structural maintenance for a roster workspace. **Operate on the workspace itself**, not on the business workflows inside it. This skill scaffolds empty structure, archives completed projects, renames things, and audits completeness. Filling content into the scaffolds is a separate concern handled by function-level experts and role-level agents.
13
+ Structural maintenance for a roster v1 workspace. **Operate on the workspace itself**, not on the business workflows inside it. This skill scaffolds empty agent and function structure and audits completeness. Filling content into the scaffolds is a separate concern handled by function-level experts and role-level agents.
15
14
 
16
- When in doubt, defer to `conventions.md` in the workspace root for the canonical structure schema, and to the `_template/` directories for the canonical scaffold contents.
15
+ When in doubt, defer to `conventions.md` in the workspace root for the canonical structure schema, and to `scripts/new-agent.sh` for the canonical scaffold contents (heredocs inside the script are the source of truth for every generated file).
17
16
 
18
17
  ## Working directory
19
18
 
20
- This skill operates from the workspace root only — the directory that contains `CLAUDE.md`, `conventions.md`, and the function dirs (`gtm/`, `product/`, etc.). If invoked from elsewhere, abort with:
19
+ This skill operates from the workspace root only — the directory that contains `CLAUDE.md`, `conventions.md`, `config/project.yaml`, `roster/`, and the function dirs (`gtm/`, `product/`, etc.). If invoked from elsewhere, abort with:
21
20
 
22
21
  > Run chief-of-staff from your roster workspace root.
23
22
 
@@ -25,51 +24,42 @@ This skill operates from the workspace root only — the directory that contains
25
24
 
26
25
  The user invokes via slash command or natural language. Parse intent into a plan name plus parameters. Examples:
27
26
 
28
- - `/chief-of-staff create-project acme with gtm/sdr` → `plan=create-project project=acme agents=[gtm/sdr]`
29
- - `/chief-of-staff archive-project test-scaffold` → `plan=archive-project project=test-scaffold`
27
+ - `/chief-of-staff create-agent gtm sdr` → `plan=create-agent function=gtm agent=sdr`
28
+ - `/chief-of-staff create-function design` → `plan=create-function function=design`
29
+ - `/chief-of-staff audit-agent product/copy-agent` → `plan=audit-agent function=product agent=copy-agent`
30
30
  - `/chief-of-staff audit-repo` → `plan=audit-repo`
31
- - "Add content-agent to _demo" → `plan=add-agent-to-project project=_demo function=gtm agent=content-agent`
32
31
 
33
32
  When invoked without a plan, list the available plans and ask which to run.
34
33
 
34
+ ### Out-of-scope intents
35
+
36
+ v1 is a single workspace per directory — this skill does not spin up sibling workspaces. The current workspace's identity lives in `config/project.yaml`; to start a new one, run `roster init` in a fresh directory.
37
+
35
38
  ## Plans
36
39
 
37
- | Plan | Description | Destructive? |
38
- |---|---|---|
39
- | `create-project` | Create a new project, optionally with agent instances | no |
40
- | `create-agent` | Create a new global agent under a function (interactive dialogue by default — see § "Guided agent creation"; `mode=stub` for headless) | no |
41
- | `create-function` | Add a new function category to the registry | no |
42
- | `add-agent-to-project` | Add an agent instance to an existing project | no |
43
- | `remove-agent-from-project` | Archive an agent instance (preserved in `_archive`) | yes |
44
- | `archive-project` | Archive a project plus all its instances | yes |
45
- | `unarchive-project` | Restore an archived project | no |
46
- | `rename-project` | Rename a project everywhere it appears | yes |
47
- | `audit-project` | Validate a project's completeness; reports issues with suggested fixes | no |
48
- | `audit-agent` | Validate an agent's structure and instances | no |
49
- | `audit-repo` | Full repo audit aggregating project + agent reports | no |
40
+ | Plan | Description |
41
+ |---|---|
42
+ | `create-agent` | Create a new agent under a function (interactive dialogue by default — see § "Guided agent creation"; `mode=stub` for headless) |
43
+ | `create-function` | Add a new function category to the registry |
44
+ | `audit-agent` | Validate an agent's structure |
45
+ | `audit-repo` | Full repo audit aggregating agent + workspace completeness reports |
50
46
 
51
47
  Each plan lives in `chief-of-staff/plans/<plan>.yaml` in the workspace, backed by a script in `scripts/`.
52
48
 
53
49
  ## Common preamble for every plan
54
50
 
55
- 1. **Confirm cwd is repo root.** Check for `CLAUDE.md`, `conventions.md`, `gtm/`, `projects/`. If not all present, abort with the message above.
51
+ 1. **Confirm cwd is workspace root.** Check for `CLAUDE.md`, `conventions.md`, `config/project.yaml`, and `roster/`. If not all present, abort with the message above.
56
52
  2. **Parse the user's request.** Extract plan name and parameters. If ambiguous, ask before proceeding.
57
- 3. **Show the plan.** For destructive plans, summarize exactly what will happen (paths created, moved, modified) and ask `proceed?`.
53
+ 3. **Show the plan.** Summarize exactly what will happen (paths created, modified).
58
54
  4. **Execute by invoking the plan's backing script.** Scripts in `scripts/` do the work; this skill orchestrates and parses output. Do not duplicate the script logic.
59
- 5. **Report.** Summarize what changed (paths created, modified, moved). Note anything skipped or any warnings.
55
+ 5. **Report.** Summarize what changed (paths created, modified). Note anything skipped or any warnings.
60
56
  6. **Never auto-commit to git.** Leave commits for the user.
61
57
 
62
- ## Mandatory confirmation gates
63
-
64
- Destructive plans (`archive-project`, `unarchive-project`, `rename-project`, `remove-agent-from-project`) MUST display the planned changes and ask `proceed?` before executing.
65
-
66
- Cross-link prompts during `create-project` (which agents to instance) and `create-agent` (which projects to instance into) are also session-only — they cannot be answered headlessly. Power users skip the prompt by passing `agents=` or `add-to-projects=` inline.
67
-
68
58
  ## Guided agent creation
69
59
 
70
60
  The `create-agent` plan runs in one of two modes (see `chief-of-staff/plans/create-agent.yaml`):
71
61
 
72
- - **stub** — byte-identical to `bash scripts/new-agent.sh`. Drops placeholder files (`<one paragraph...>`, plan stubs, empty `## Tools and bindings`, etc.) and exits. Used in CI, headless contexts, and as the legacy escape hatch.
62
+ - **stub** — byte-identical to `bash scripts/new-agent.sh` in its non-interactive path (`AGENT_TEAM_NO_CONFIRM=1` or no TTY). Writes an `agent.md` whose grounded/uncertain fields carry `<placeholder>` text verbatim from the script's heredocs, plus `config.yaml` with `tools: {}` and an empty `plans/.gitkeep`. The script's interactive `## Tools and bindings` prompt is skipped, so that section is absent from `agent.md` in stub mode. Used in CI, headless contexts, and as the legacy escape hatch.
73
63
  - **guided** — runs the 5-phase dialogue defined below to produce a filled-in `agent.md` from prose intake plus targeted follow-ups. Same on-disk layout as stub mode, but with real content instead of placeholders.
74
64
 
75
65
  Mode selection priority (first match wins): `${inputs.mode}` → `AGENT_TEAM_NO_CONFIRM=1` (→ `stub`) → TTY detection (TTY → `guided`, no TTY → `stub`).
@@ -78,7 +68,7 @@ Mode selection priority (first match wins): `${inputs.mode}` → `AGENT_TEAM_NO_
78
68
 
79
69
  > The skill MUST NOT write a Step, Subagent, Tool, Plan body, or Failure mode unless that content was supplied by the user (in prose or follow-up) or comes from documented convention. If the skill catches itself about to invent content, it stops and asks instead.
80
70
 
81
- This invariant is load-bearing. Guided mode is **not a content generator** — it is a structured interviewer that organizes what the user said into the canonical `agent.md` shape. Every non-boilerplate line in the generated agent.md must be traceable to either (a) the prose intake, (b) a follow-up answer, or (c) a documented convention in `conventions.md` / `_template/`. Never fill in plausible-looking defaults to make the output feel complete — gaps stay gaps, surfaced explicitly as follow-up questions.
71
+ This invariant is load-bearing. Guided mode is **not a content generator** — it is a structured interviewer that organizes what the user said into the canonical `agent.md` shape. Every non-boilerplate line in the generated agent.md must be traceable to either (a) the prose intake, (b) a follow-up answer, or (c) a documented convention in `conventions.md` / `scripts/new-agent.sh`. Never fill in plausible-looking defaults to make the output feel complete — gaps stay gaps, surfaced explicitly as follow-up questions.
82
72
 
83
73
  ### EXPERT.md auto-load
84
74
 
@@ -101,9 +91,9 @@ Accept the answer as-is — no structure required. Capture it verbatim; it seeds
101
91
 
102
92
  Partition every required `agent.md` field into one of three buckets:
103
93
 
104
- - **boilerplate** — filled silently from `conventions.md` / `_template/`. Examples: standard "Read at runtime" file paths, the lessons-protocol paragraph, the `approval_channel: auto` default, the canonical "Confirmation gate denied" failure mode wording.
94
+ - **boilerplate** — filled silently from `conventions.md` / `scripts/new-agent.sh` heredocs. Examples: standard "Read at runtime" file paths, the lessons-protocol paragraph, the `approval_channel: auto` default, the canonical "Confirmation gate denied" failure mode wording.
105
95
  - **grounded** — drafted directly from the prose intake. Examples: the `Purpose` paragraph, the `Outputs` description, the agent's headline role.
106
- - **uncertain** — content the prose did not specify and convention cannot fill. Examples: which subagents exist, which tools/MCPs are needed, project-specific failure modes, plan names.
96
+ - **uncertain** — content the prose did not specify and convention cannot fill. Examples: which subagents exist, which tools/MCPs are needed, agent-specific failure modes, plan names.
107
97
 
108
98
  Boilerplate is written without asking. Grounded is drafted but explicitly flagged in the Phase 4 preview ("drafted from your prose — review before accepting"). Uncertain becomes the queue for Phase 3.
109
99
 
@@ -125,14 +115,14 @@ Continue until the uncertain bucket is empty.
125
115
  Render the full draft tree to the user. Show:
126
116
 
127
117
  - Every file path that will be written, with a one-line description.
128
- - The full `agent.md` content (purpose, inputs, steps, subagents, tools, outputs, approval, lessons, failure modes).
118
+ - The full `agent.md` content (purpose, inputs, subagents, tools-and-bindings, outputs, approval, lessons, failure modes — per `templates/scaffold/conventions.md`; workflow logic lives in plans, not in `agent.md`).
129
119
  - The slash-command description that will land in `.claude/commands/<agent>.md` (replacing the stub's `TODO: fill in description` placeholder).
130
- - The `plans/` directory (empty `.gitkeep` + a stub for the first plan if one was named during Phase 3).
120
+ - The `plans/` directory (`.gitkeep` only the user writes the first plan in `plans/<plan>.yaml` as a next step after the agent tree lands).
131
121
 
132
122
  Offer three controls:
133
123
 
134
124
  - **`y`** → proceed to Phase 5 (atomic write).
135
- - **`revise <section>`** → re-enter Phase 3 for that section only, then re-render the preview. Valid sections: `purpose`, `inputs`, `steps`, `subagents`, `tools`, `outputs`, `approval`, `failure-modes`, `plans`, `slash-command`. After collecting the revised answers, the skill re-renders the **full** preview (not just the changed section) so the user sees the final state in one place.
125
+ - **`revise <section>`** → re-enter Phase 3 for that section only, then re-render the preview. Valid sections: `purpose`, `inputs`, `subagents`, `tools`, `outputs`, `approval`, `failure-modes`, `slash-command` (the keyword `tools` revises the `## Tools and bindings` section). After collecting the revised answers, the skill re-renders the **full** preview (not just the changed section) so the user sees the final state in one place.
136
126
  - **`cancel`** → abort with no writes. Print: `Cancelled. No files written.`
137
127
 
138
128
  Loop on `revise` until the user types `y` or `cancel`. There is no implicit "looks good enough" — explicit acceptance is required.
@@ -149,13 +139,13 @@ Transitions from accepted Phase 4 preview (`y`) to files-on-disk. The **agent tr
149
139
 
150
140
  #### Step 1 — Pre-write invariant check
151
141
 
152
- Run all five invariants from § "Cross-file invariants" against `draft`. On any failure:
142
+ Run all four invariants from § "Cross-file invariants" against `draft`. On any failure:
153
143
 
154
144
  > Invariant N failed: <specific failure>. Revise the affected section, or `cancel` to abort without writing.
155
145
 
156
146
  Re-enter Phase 3 for the offending section. The atomic-write transaction NEVER proceeds with a tripped invariant — no partial state can leak onto disk.
157
147
 
158
- Invariant 2 (step ids match `plans/<plan>.yaml`) is vacuously satisfied when no starter plan was named during Phase 3 per the Generated file contracts table, `plans/<plan>.yaml` is optional. The check applies only when at least one plan file is staged in `draft`.
148
+ Per `templates/scaffold/conventions.md`, workflow logic lives in plan YAMLs, not in `agent.md` and the create-agent plan does not auto-write the first plan (the user writes it as a next step). The pre-write check therefore validates only the agent tree, not any `plans/<plan>.yaml` content.
159
149
 
160
150
  #### Step 2 — Final user preview
161
151
 
@@ -183,18 +173,14 @@ Enumerate every directory the transaction creates **explicitly** (no `mkdir -p`
183
173
  - `<fn>/<agent>/`
184
174
  - `<fn>/<agent>/subagents/`
185
175
  - `<fn>/<agent>/playbook/`
176
+ - `<fn>/<agent>/pending/`
186
177
  - `<fn>/<agent>/logs/`
178
+ - `<fn>/<agent>/logs/runs/`
179
+ - `<fn>/<agent>/logs/feedback/`
187
180
  - `<fn>/<agent>/.claude/`
188
181
  - `<fn>/<agent>/.claude/skills/`
189
182
  - `<fn>/<agent>/.claude/plugins/`
190
183
  - `<fn>/<agent>/plans/`
191
- - `<fn>/<agent>/projects/`
192
- - `<fn>/<agent>/projects/_template/`
193
- - `<fn>/<agent>/projects/_template/config/`
194
- - `<fn>/<agent>/projects/_template/playbook/`
195
- - `<fn>/<agent>/projects/_template/log/`
196
- - `<fn>/<agent>/projects/_template/log/runs/`
197
- - `<fn>/<agent>/projects/_template/log/feedback/`
198
184
 
199
185
  If a directory already exists at the moment we try to create it (e.g., racing process, or `<fn>/` exists from a prior function), do NOT append it to `rollback` — pre-existing paths are not ours to delete. Skip and continue. The parent `<fn>/` itself is never in `rollback` for the same reason (it predates this transaction or was created as `<fn>/<agent>/`'s implicit parent — see invariant: if `<fn>/` does not exist, abort the whole transaction before Step 4 and ask the user to register the function via `create-function` first).
200
186
 
@@ -212,17 +198,15 @@ Order:
212
198
  4. `<fn>/<agent>/subagents/_template.md`
213
199
  5. `<fn>/<agent>/subagents/<name>.md` (one per `agent.md ## Subagents` entry; zero files if none named)
214
200
  6. `<fn>/<agent>/plans/.gitkeep`
215
- 7. `<fn>/<agent>/plans/<plan>.yaml` (one per plan named in Phase 3; absent in stub mode and when no plan named)
216
- 8. `<fn>/<agent>/projects/_template/config/default.yaml`
217
- 9. `<fn>/<agent>/projects/_template/asset-references.md`
218
- 10. `<fn>/<agent>/playbook/.gitkeep`
219
- 11. `<fn>/<agent>/logs/.gitkeep`
220
- 12. `<fn>/<agent>/.claude/skills/.gitkeep`
221
- 13. `<fn>/<agent>/.claude/plugins/.gitkeep`
222
- 14. `<fn>/<agent>/projects/_template/playbook/.gitkeep`
223
- 15. `<fn>/<agent>/projects/_template/log/runs/.gitkeep`
224
- 16. `<fn>/<agent>/projects/_template/log/feedback/.gitkeep`
225
- 17. `<fn>/<agent>/agent.md` ← **LAST. Canonical contract.**
201
+ 7. `<fn>/<agent>/config.yaml`
202
+ 8. `<fn>/<agent>/asset-references.md`
203
+ 9. `<fn>/<agent>/playbook/.gitkeep`
204
+ 10. `<fn>/<agent>/pending/.gitkeep`
205
+ 11. `<fn>/<agent>/logs/runs/.gitkeep`
206
+ 12. `<fn>/<agent>/logs/feedback/.gitkeep`
207
+ 13. `<fn>/<agent>/.claude/skills/.gitkeep`
208
+ 14. `<fn>/<agent>/.claude/plugins/.gitkeep`
209
+ 15. `<fn>/<agent>/agent.md` ← **LAST. Canonical contract.**
226
210
 
227
211
  **Why `agent.md` last:** It is the canonical orchestrator contract — the file roster's commands grep for to detect an agent's existence. Writing it last guarantees that any process **keyed off the existence of `agent.md`** observes either no agent or a complete one. A mid-Step-5 crash leaves either no `agent.md` at all, or — after Step 7 rollback — an empty `<fn>/<agent>/` parent that no contract-aware reader will treat as a valid agent.
228
212
 
@@ -299,11 +283,13 @@ Every file the guided plan writes has a per-file content contract. Stub mode pro
299
283
 
300
284
  | File | Guided-mode contract | Stub-mode contract |
301
285
  | --- | --- | --- |
302
- | `agent.md` | See per-section disposition below. Populated and grounded fields filled from prose + Phase 3 answers; boilerplate fields filled from `_template/` and `conventions.md`. Zero literal `<placeholder>` strings remain (explicit `TODO: <gap>` markers allowed only where the user deferred during Phase 3). | Identical to `bash scripts/new-agent.sh` output: every grounded/uncertain field carries its `<placeholder>` text verbatim. |
303
- | `plans/<plan>.yaml` | Created only if the user named at least one plan during Phase 3. Step `id:` fields 1:1 with `agent.md ## Steps` they cannot drift. Inputs / outputs schemas come from the user's plan description. | `plans/.gitkeep` only. No starter plan file. |
304
- | `subagents/<name>.md` | One file per name listed in `agent.md ## Subagents`. All **six** required sections present and populated: `Role`, `Inputs`, `Output`, `Tools`, `Boundaries`, `Quality bar`. **Never half-populate a subagent.** If a section cannot be populated from prose / follow-ups, either remove the subagent from `agent.md ## Subagents` entirely or Phase 3 re-asks. `subagents/_template.md` is also written byte-for-byte from `_template/` (same as stub mode). | `subagents/_template.md` only. No per-name files. |
305
- | `.claude/commands/<agent>.md` | `description:` field is a real sentence: 80 chars, contains no `<` character, and contains no literal `TODO:` substring. The body matches the canonical routing-logic template from `_template/` with `<agent>` and `<function>` substituted. | `description: <function> agent — TODO: fill in description`. Canonical body otherwise unchanged. |
306
- | `README.md`, `.mcp.json`, `.claude/settings.json`, `projects/_template/**`, every `.gitkeep` | Identical to stub mode — byte-for-byte. These files do not vary by mode. | (canonical) |
286
+ | `agent.md` | See per-section disposition below. Populated and grounded fields filled from prose + Phase 3 answers; boilerplate fields filled from `scripts/new-agent.sh` heredocs and `conventions.md`. Zero literal `<placeholder>` strings remain (explicit `TODO: <gap>` markers allowed only where the user deferred during Phase 3). | Identical to `bash scripts/new-agent.sh` output: every grounded/uncertain field carries its `<placeholder>` text verbatim. |
287
+ | `subagents/<name>.md` | One file per name listed in `agent.md ## Subagents`. All **six** required sections present and populated: `Role`, `Inputs`, `Output`, `Tools`, `Boundaries`, `Quality bar`. **Never half-populate a subagent.** If a section cannot be populated from prose / follow-ups, either remove the subagent from `agent.md ## Subagents` entirely or Phase 3 re-asks. `subagents/_template.md` is also written byte-for-byte from the `scripts/new-agent.sh` heredoc (same as stub mode). | `subagents/_template.md` only. No per-name files. |
288
+ | `.claude/commands/<agent>.md` | `description:` field is a real sentence: 80 chars, contains no `<` character, and contains no literal `TODO:` substring. The body matches the canonical routing-logic template emitted by `write_slash_command` in `scripts/new-agent.sh`, with `<agent>` and `<function>` substituted. | `description: <function> agent TODO: fill in description`. Canonical body otherwise unchanged. |
289
+ | `config.yaml` | Stub mode writes `tools: {}` (empty). Guided mode mirrors the `## Tools and bindings` block from the generated `agent.md` into the `tools:` map per `templates/scaffold/conventions.md` § "Tool bindings"; every named tool has an `env_var`, `required`, and `description` entry (TODO placeholders allowed only where the user deferred). | `tools: {}`. |
290
+ | `README.md`, `.mcp.json`, `.claude/settings.json`, `asset-references.md`, every `.gitkeep` | Identical to stub mode — byte-for-byte. These files do not vary by mode. | (canonical) |
291
+
292
+ > Plan YAMLs are not in this table — `create-agent` does not write `plans/<plan>.yaml`. The user authors plans as a next step after the agent tree lands.
307
293
 
308
294
  ### `agent.md` per-section disposition
309
295
 
@@ -313,24 +299,22 @@ For each section of the agent.md template (the structure emitted by `scripts/new
313
299
  | --- | --- |
314
300
  | `## Purpose` | **grounded** — drafted from the Phase 1 prose. |
315
301
  | `## Inputs` — orchestrator-expected list | **grounded** — drafted from prose + Phase 3 answers about what triggers a run. |
316
- | `## Inputs` — "Read at runtime" list | **boilerplate** — canonical paths from `conventions.md` (agent.md, instance config, project CLAUDE.md, project guidelines, playbooks, recent runs). |
317
- | `## Steps` | **grounded** — every step comes from prose / Phase 3. Must have matching ids in `plans/<plan>.yaml`. |
302
+ | `## Inputs` — "Read at runtime" list | **boilerplate** — canonical paths from `conventions.md` (agent.md, agent `config.yaml`, workspace `CLAUDE.md`, workspace `guidelines/`, playbooks, recent runs). |
318
303
  | `## Subagents` | **uncertain → guided** — Phase 3 collects the subagent list (or empty). Each named subagent gets a fully populated `subagents/<name>.md`. |
319
- | `## Tools` | **uncertain → guided** — Phase 3 collects tool / MCP names. Each tool listed gets a bindings block (invariant 3). |
304
+ | `## Tools and bindings` | **uncertain → guided** — Phase 3 collects tool / MCP names. Each named tool gets a bindings entry (invariant 2). Section is omitted entirely when the user defines no tools. |
320
305
  | `## Outputs` | **boilerplate + grounded** — canonical run-file path is boilerplate; the artifact description is grounded from prose. |
321
306
  | `## Approval` | **boilerplate** — `approval_channel: auto` line with the standard Slack / HITL routing paragraph. |
322
307
  | `## Lessons protocol` | **boilerplate** — canonical paragraph, identical in every agent. |
323
- | `## Failure modes` | **boilerplate + uncertain** — standard failures (cwd wrong, slug invalid, script fails) are boilerplate; project-specific failures come from Phase 3. |
308
+ | `## Failure modes` | **boilerplate + uncertain** — standard failures (cwd wrong, slug invalid, script fails) are boilerplate; agent-specific failures come from Phase 3. |
324
309
 
325
310
  ### Cross-file invariants
326
311
 
327
- Five invariants MUST pass during the pre-write check (Phase 5). Any failure aborts the write — no partial state is committed to the workspace — and the user is shown which invariant tripped and offered the chance to revise the relevant section.
312
+ Four invariants MUST pass during the pre-write check (Phase 5). Any failure aborts the write — no partial state is committed to the workspace — and the user is shown which invariant tripped and offered the chance to revise the relevant section.
328
313
 
329
314
  1. **Subagent files match the declared list.** Every subagent named in `agent.md ## Subagents` has a populated file at `subagents/<name>.md` with all six required sections. Conversely, every file under `subagents/` other than `_template.md` is named in `agent.md ## Subagents`. Neither side may carry an orphan.
330
- 2. **Step ids match between agent.md and the starter plan.** Every step in `agent.md ## Steps` appears in the starter `plans/<plan>.yaml` with a matching `id:` field. Order may differ; presence and ids may not.
331
- 3. **Every named tool has a bindings block.** Every tool listed in `agent.md ## Tools` has a corresponding entry in the `## Tools and bindings` block of `agent.md` with a non-`TODO` `required` flag and a non-empty `description`.
332
- 4. **Slash-command description is real.** The `description:` field in `.claude/commands/<agent>.md` is 80 characters, contains no `<` character, and contains no literal `TODO:` substring.
333
- 5. **No unfilled placeholders in agent.md.** `agent.md` contains zero literal `<placeholder>` strings (i.e., no `<...>` patterns from the stub template). Explicit `TODO: <gap>` comments are allowed only where the user deferred during Phase 3; they must include a specific gap description, not a bare `TODO:`.
315
+ 2. **Every named tool has a bindings entry.** Every tool listed in the `## Tools and bindings` block of `agent.md` has a non-`TODO` `required` flag and a non-empty `description`. The same set is mirrored into `config.yaml` under `tools:` (per `templates/scaffold/conventions.md` § "Tool bindings").
316
+ 3. **Slash-command description is real.** The `description:` field in `.claude/commands/<agent>.md` is 80 characters, contains no `<` character, and contains no literal `TODO:` substring.
317
+ 4. **No unfilled placeholders in agent.md.** `agent.md` contains zero literal `<placeholder>` strings (i.e., no `<...>` patterns from the stub template). Explicit `TODO: <gap>` comments are allowed only where the user deferred during Phase 3; they must include a specific gap description, not a bare `TODO:`.
334
318
 
335
319
  On invariant failure, the skill prints:
336
320
 
@@ -340,14 +324,14 @@ Then re-enters Phase 3 for the section that owns the tripped invariant. The atom
340
324
 
341
325
  ## Outputs
342
326
 
343
- - **Mutation plans:** Summary printed to chat (paths created, moved, modified). The backing script also appends to `chief-of-staff/logs/<YYYY-MM>/operations-<YYYY-MM-DD>.md` (one log file per day, append-only).
327
+ - **Mutation plans:** Summary printed to chat (paths created, modified). The backing script also appends to `chief-of-staff/logs/<YYYY-MM>/operations-<YYYY-MM-DD>.md` (one log file per day, append-only).
344
328
  - **Audit plans:** A report file at `chief-of-staff/logs/<YYYY-MM>/audit-...-<YYYY-MM-DD-HHMM>.md`, plus a condensed stdout summary.
345
329
 
346
330
  Per-plan output schemas are declared in each plan's `outputs:` block in its YAML.
347
331
 
348
332
  ## Lessons protocol
349
333
 
350
- If you observe a recurring pattern during operations (e.g., users forgetting to run `create-agent` before `add-agent-to-project`), log it inline in the operation's log entry under a `## Candidate lessons` section. The dreamer picks it up on the next reflection pass.
334
+ If you observe a recurring pattern during operations (e.g., users forgetting to fill `config/project.yaml` before running `create-agent`), log it inline in the operation's log entry under a `## Candidate lessons` section. The dreamer picks it up on the next reflection pass.
351
335
 
352
336
  Never write directly to `chief-of-staff/playbook/` during operations. The user may write a lesson by hand with `source: human`; those are respected.
353
337
 
@@ -356,7 +340,7 @@ Never write directly to `chief-of-staff/playbook/` during operations. The user m
356
340
  - **Cwd not workspace root** → abort with clear message
357
341
  - **Invalid slug or function name** → abort with an example of valid format
358
342
  - **Collision (target already exists)** → abort, tell the user the existing path
359
- - **Missing dependency** (e.g., agent doesn't exist for `add-agent-to-project`) → abort, suggest the prerequisite plan
343
+ - **Missing dependency** (e.g., function not registered when running `create-agent` — run `create-function` first) → abort, suggest the prerequisite plan
360
344
  - **Script fails** → surface the script's stderr; do not attempt to recover by doing the work directly
361
345
  - **YAML/JSON parse error in audit** → report as failure with the line number from the audit script
362
346
  - **Confirmation gate denied** → abort cleanly, no changes
@@ -369,6 +353,6 @@ Never write directly to `chief-of-staff/playbook/` during operations. The user m
369
353
  ## What this skill does NOT do
370
354
 
371
355
  - Run business workflows (SDR outreach, design generation, content authoring). Those are separate role-level skills.
372
- - Edit guidelines, ICPs, voice, or any project substrate content. That's expert-level work.
356
+ - Edit guidelines, ICPs, voice, or any workspace content. That's expert-level work.
373
357
  - Make git commits. Always leave commits for the user.
374
358
  - Touch files outside the workspace.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: dreamer
3
- description: "Off-hours reflection agent. Reads recent runs and feedback across all agents and projects, detects recurring patterns, drafts lesson candidates, routes through HITL approval, and writes approved lessons to the right playbook scope. The only agent that writes to playbook files. Triggers when the user invokes /dreamer or asks to consolidate lessons from past work."
3
+ description: "Off-hours reflection agent. Reads recent runs and feedback across all agents, detects recurring patterns, drafts lesson candidates, routes through HITL approval, and writes approved lessons to the agent's playbook. The only agent that writes to playbook files. Triggers when the user invokes /dreamer or asks to consolidate lessons from past work."
4
4
  version: "0.1.0"
5
5
  trigger_conditions:
6
6
  - "User invokes the /dreamer slash command"
@@ -13,7 +13,7 @@ trigger_conditions:
13
13
 
14
14
  ## Purpose
15
15
 
16
- Reinforcement and consolidation. Reads recent runs, feedback, and post-hoc analytics across all agents and all projects. Detects patterns. Drafts lesson candidates. Routes through HITL approval. On approval, writes lessons to the right scope (project-scoped or global).
16
+ Reinforcement and consolidation. Reads recent runs, feedback, and post-hoc analytics across all agents. Detects patterns. Drafts lesson candidates. Routes through HITL approval. On approval, the candidate file moves from `<function>/<agent>/pending/` to `<function>/<agent>/playbook/`.
17
17
 
18
18
  This is the only agent allowed to write to `playbook/` files (apart from the user writing by hand with `source: human`).
19
19
 
@@ -34,7 +34,7 @@ Read at runtime:
34
34
  - `dreamer/plans/<plan>.yaml` — the workflow recipe
35
35
  - `dreamer/state.md` — last processed cutoff and run summary
36
36
  - `dreamer/pending/` — queued candidates awaiting Slack approval
37
- - All `<function>/<agent>/projects/<project>/log/runs/` and `log/feedback/` for material since the cutoff
37
+ - All `<function>/<agent>/logs/runs/` and `<function>/<agent>/logs/feedback/` for material since the cutoff
38
38
  - Existing playbook lessons for evidence comparison
39
39
 
40
40
  ## Plans
@@ -56,11 +56,10 @@ Typically scheduled nightly via cron or `/schedule`. When invoked without a plan
56
56
 
57
57
  - `pattern-detector.md` — finds patterns across runs+feedback
58
58
  - `lesson-drafter.md` — drafts a single lesson in schema format
59
- - `promotion-arbiter.md` — decides project vs global scope for validated lessons
60
59
 
61
60
  ## Tools and bindings
62
61
 
63
- - File reads across the entire repo (the one agent that crawls broadly) — no per-project bindings
62
+ - File reads across the entire repo (the one agent that crawls broadly) — no external tool bindings
64
63
  - `Slack` MCP — for HITL posting (from universal `.mcp.json`); HITL channel resolved via `SLACK_HITL_CHANNEL_ADMIN` env var
65
64
  - No external APIs needed beyond Slack
66
65
 
@@ -68,7 +67,7 @@ Typically scheduled nightly via cron or `/schedule`. When invoked without a plan
68
67
 
69
68
  Run file at `dreamer/logs/<YYYY-MM>/<YYYY-MM-DD-HHMM>.md` containing:
70
69
 
71
- - Material processed (counts by project and agent)
70
+ - Material processed (counts by agent)
72
71
  - Patterns detected
73
72
  - Lesson candidates drafted (Slack thread links)
74
73
  - Promotion candidates
@@ -81,6 +80,8 @@ State file at `dreamer/state.md` tracking last successful run timestamp + summar
81
80
 
82
81
  `approval_channel: slack` always. The dreamer typically runs nightly via cron — there's no interactive caller.
83
82
 
83
+ On approval, the candidate file in `<agent>/pending/` moves to `<agent>/playbook/`. There is no scope decision and no arbiter — v1 has a single playbook per agent.
84
+
84
85
  TTL: 7 days. Unapproved candidates roll forward in `dreamer/pending/`. After 7 days, marked stale and require re-evaluation.
85
86
 
86
87
  ## Pattern detection signals
@@ -108,5 +109,5 @@ The dreamer writes lessons FOR other agents. It does not write lessons about its
108
109
 
109
110
  - **No new material**: log no-op run, exit cleanly
110
111
  - **Slack unavailable**: queue candidates locally in `dreamer/pending/`, retry next run
111
- - **Conflicting lessons across projects**: do NOT auto-merge. Surface conflict; HITL decides.
112
+ - **Conflicting lessons across agents**: do NOT auto-merge. Surface conflict; HITL decides.
112
113
  - **Threshold not met**: keep candidate in `observing` status, accumulate evidence next pass
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: roster-orchestrator
3
- description: "Bootstraps roster workspaces. On chat session start, surfaces pending HITL items as a single banner. On a scheduled fire, verifies the schedule is registered, dispatches the named agent via the host tool's native subagent primitive, writes a run log + state.md entry, and exits. Reads roster/<function>/schedules.yaml and roster/<function>/pending/. Subscription-billed primitives only — never invokes claude -p, claude --prompt, claude api, or the Anthropic SDK."
4
- version: "0.1.0"
3
+ description: "Bootstraps roster workspaces. On chat session start, surfaces pending HITL items as a single banner. On a scheduled fire, verifies the schedule is registered, resolves the agent's merged env, dispatches the named agent via the host tool's native subagent primitive, writes a run log + state.md entry, and exits. Reads roster/<function>/schedules.yaml plus pending items at both roster/<function>/pending/ (error class) and <function>/<agent>/pending/ (lesson class). Subscription-billed primitives only — never invokes claude -p, claude --prompt, claude api, or the Anthropic SDK."
4
+ version: "1.0.0"
5
5
  trigger_conditions:
6
- - "Session start in a roster workspace (CONTEXT.md / CLAUDE.md / AGENTS.md present at cwd)"
7
- - "A scheduled fire prompt names a roster agent (e.g., 'Run sdr cold-outreach for _demo')"
6
+ - "Session start in a roster workspace (CLAUDE.md / AGENTS.md / CONTEXT.md present at cwd)"
7
+ - "A scheduled fire prompt names a roster agent (e.g., 'Run sdr cold-outreach')"
8
8
  - "User invokes /roster-orchestrator"
9
9
  ---
10
10
 
@@ -12,32 +12,34 @@ trigger_conditions:
12
12
 
13
13
  The bootstrap entry point for every fresh CLI session in a roster workspace. Two modes:
14
14
 
15
- 1. **Chat-session bootstrap** — surface a single banner if `roster/*/pending/` has items.
16
- 2. **Scheduled fire** — verify the fire matches a registered schedule, dispatch the named agent, log the run, exit.
15
+ 1. **Chat-session bootstrap** — surface a single banner if any HITL surface has items.
16
+ 2. **Scheduled fire** — verify the fire matches a registered schedule, resolve the agent's merged env, dispatch the named agent, log the run, exit.
17
17
 
18
18
  The skill is **stateless**. It re-reads disk on every invocation so `/clear` and fresh fires both work identically.
19
19
 
20
20
  ## Working directory
21
21
 
22
- Operate from the workspace root only — the directory containing `CONTEXT.md` (or the `CLAUDE.md` / `AGENTS.md` symlink that points to it) plus a `roster/` directory. If invoked elsewhere, abort with:
22
+ Operate from the workspace root only — the directory containing `config/project.yaml` (the v1 workspace identity file) plus a `roster/` directory (scheduler namespace). If invoked elsewhere, abort with:
23
23
 
24
- > Run roster-orchestrator from your roster workspace root (must contain CONTEXT.md and roster/).
24
+ > Run roster-orchestrator from your roster workspace root (must contain config/project.yaml and roster/).
25
25
 
26
26
  ## Mode detection
27
27
 
28
28
  Inspect the initial prompt:
29
29
 
30
- - If it matches a scheduled-fire shape (`Run <agent> <plan> for <project>`, `Use the <agent> skill to <plan> for <project>`, etc.) → **scheduled-fire mode**.
30
+ - If it matches a scheduled-fire shape (`Run <agent> <plan>`, `Use the <agent> skill to <plan>`, etc.) → **scheduled-fire mode**.
31
31
  - Otherwise → **chat-session-bootstrap mode**.
32
32
 
33
33
  When ambiguous, default to chat-session-bootstrap (it is the safe no-op when no fire is happening).
34
34
 
35
35
  ## Mode 1 — Chat-session bootstrap
36
36
 
37
- 1. Walk `roster/*/pending/` across all functions (`gtm`, `product`, `design`, `ops`, `marketing`, …).
38
- 2. Count files matching `*.md` (one HITL item per file).
39
- 3. If count == 0 print nothing, exit silently.
40
- 4. If count > 0 print one banner line and stop:
37
+ 1. Walk both HITL surfaces:
38
+ - **Error class** `roster/<function>/pending/*.md` across all functions (synthesized by `roster pending sync` from non-zero cron exit codes / STALE detection).
39
+ - **Lesson class** `<function>/<agent>/pending/*.md` across all agents (drafted by the dreamer skill).
40
+ 2. Count files matching `*.md` in each surface. Sum the counts (no dedupe — error and lesson namespaces are disjoint).
41
+ 3. If sum == 0 → print nothing, exit silently.
42
+ 4. If sum > 0 → print one banner line and stop:
41
43
  ```
42
44
  ⚠ N pending HITL items — run `roster review`
43
45
  ```
@@ -47,22 +49,48 @@ No other side effects. Do not read item bodies. Do not modify any file.
47
49
 
48
50
  ## Mode 2 — Scheduled fire
49
51
 
50
- 1. Parse the fire prompt for `<agent>`, `<plan>`, `<project>`.
52
+ 1. Parse the fire prompt for `<agent>` and `<plan>`.
51
53
  - Preferred shape: `<function>/<agent>` (e.g., `gtm/sdr`). Use this whenever the prompt provides it.
52
54
  - Bare-agent shape (e.g., `sdr`): resolve by scanning `<function>/<agent>/` for exactly one matching directory. If zero or more than one match, abort with the parsed fields and the candidate functions.
53
- - Refuse if `<agent>`, `<plan>`, or `<project>` is missing — list which one.
55
+ - Refuse if `<agent>` or `<plan>` is missing — list which one.
54
56
  2. Load `roster/<function>/schedules.yaml` using the resolved function from step 1.
55
- 3. Verify an entry exists in `schedules.yaml` with matching `agent` + `plan` + `project`. If not, abort with:
56
- > Schedule not registered: <function>/<agent>/<plan> for <project>. Use `roster schedule list` to see registered schedules.
57
- 4. Dispatch the named agent via the host tool's subagent primitive (see "Subagent dispatch" below). Block until the subagent returns. The subagent runs in isolated context; nothing leaks back here.
58
- 5. Append a single line to `roster/<function>/state.md`. Exact format (one line, three fields, pipe-separated with surrounding single spaces):
57
+ 3. Verify a matching entry exists (2-tuple lookup):
59
58
  ```
60
- <utc-iso-8601> | <function>/<agent>/<plan>/<project> | <status>
59
+ match = none
60
+ for entry in schedules_yaml.schedules:
61
+ if entry.agent == "<function>/<agent>" and entry.plan == "<plan>":
62
+ match = entry
63
+ break
64
+ if match is none:
65
+ abort "Schedule not registered: <function>/<agent>/<plan>. Use `roster schedule list` to see registered schedules."
66
+ ```
67
+ 4. Resolve the agent's merged env via `resolveAgentEnv` (see "Env resolution" below). The dispatch primitive must see this merged env.
68
+ 5. Dispatch the named agent via the host tool's subagent primitive (see "Subagent dispatch" below). Block until the subagent returns. The subagent runs in isolated context; nothing leaks back here.
69
+ 6. Append a single line to `roster/<function>/state.md`. Exact format (one line, three fields, pipe-separated with surrounding single spaces):
70
+ ```
71
+ <utc-iso-8601> | <function>/<agent>/<plan> | <status>
61
72
  ```
62
73
  - `<utc-iso-8601>`: UTC, second precision, `Z` suffix. Example: `2026-05-16T14:09:00Z`.
63
74
  - `<status>`: exactly one of `success` or `failed`. No other values.
64
- 6. The subagent itself is responsible for the full run log at `<function>/<agent>/projects/<project>/log/runs/<ts>.md`. Do not write that file from here.
65
- 7. Exit cleanly. Do not start a new turn.
75
+ 7. The subagent itself is responsible for the full run log at `<function>/<agent>/logs/runs/<YYYY-MM>/<ts>.md` (path flattened in v1). Do not write that file from here.
76
+ 8. Exit cleanly. Do not start a new turn.
77
+
78
+ ## Env resolution
79
+
80
+ The dispatched subagent needs workspace-wide secrets plus any agent-specific overrides. v1 ships a pure loader for this:
81
+
82
+ ```ts
83
+ import { resolveAgentEnv } from '<roster-internal>'; // src/lib/env-merge.ts
84
+ const env = resolveAgentEnv(workspaceRoot, "<function>/<agent>");
85
+ ```
86
+
87
+ Precedence (each key resolved independently):
88
+
89
+ 1. `<function>/<agent>/.env` — if the key is defined, use that value. Empty string = explicit unset (does NOT fall through).
90
+ 2. `/.env` (workspace) — if the key is defined, use that value.
91
+ 3. Otherwise the key is unset.
92
+
93
+ The orchestrator must ensure the merged env is materialized in the dispatch primitive's environment before the subagent runs — apply via the host's env-application mechanism (Claude `Task` env hand-off, Codex agent env, Gemini equivalent). Subscription-safety: only `.env` values are loaded; never inherit API-key shell exports from the user's interactive session. For scheduled fires this is reinforced upstream by the cron wrap (`env -i`).
66
94
 
67
95
  ## Subagent dispatch
68
96
 
@@ -75,7 +103,7 @@ Use the `Task` tool with `run_in_background: false`:
75
103
  ```
76
104
  Task(
77
105
  subagent_type="<agent>",
78
- prompt="Run plan <plan> for project <project>",
106
+ prompt="Run plan <plan>",
79
107
  run_in_background=false,
80
108
  )
81
109
  ```
@@ -86,7 +114,7 @@ The subagent runs in isolated context. The return value is a short status string
86
114
 
87
115
  Invoke the subagent via natural language. Codex resolves the agent name against `~/.codex/agents/<agent>.toml`:
88
116
 
89
- > Use the `<agent>` subagent to run plan `<plan>` for project `<project>`.
117
+ > Use the `<agent>` subagent to run plan `<plan>`.
90
118
 
91
119
  Wait for the subagent to return its status, then proceed to the state.md write.
92
120
 
@@ -116,7 +144,7 @@ If you encounter a workflow that seems to require one of the above, stop and sur
116
144
  ## Failure modes
117
145
 
118
146
  - **Cwd not a roster workspace** → abort with the message above.
119
- - **Fire prompt missing agent/plan/project** → abort, list the parsed fields.
147
+ - **Fire prompt missing agent or plan** → abort, list the parsed fields.
120
148
  - **Schedule not registered** → abort with the `roster schedule list` pointer.
121
149
  - **Subagent dispatch fails** → write `status=failed` to state.md, do not retry. Failure-class HITL items are created by the next session-start (ROS-42 / failure observability).
122
150
  - **`roster/` directory missing** → first run on a fresh init; treat as zero pending items, exit cleanly.
@@ -37,7 +37,7 @@ format, project structure. When the convention isn't clear, ask before guessing.
37
37
  - Call agents across projects. An agent on Project A cannot invoke a different project's
38
38
  instance of itself.
39
39
  - Invent tools, connectors, or capabilities. If something isn't available, say so.
40
- - Write secrets, API keys, or credentials to any file under version control.
40
+ - Commit secrets, API keys, or credentials to git. Tool API keys your agents need (Apollo, HeyReach, Slack, Linear, etc.) belong in `.env`, which is gitignored.
41
41
 
42
42
  ## When in doubt
43
43
 
@@ -29,7 +29,7 @@ This directive applies to both scheduled fires and interactive chat sessions.
29
29
 
30
30
  - `chief-of-staff/` — repo maintenance and project wiring
31
31
  - `dreamer/` — reflection; promotes lessons to playbooks
32
- - `gtm/sdr/` — outbound sales development
32
+ - `gtm/`, `product/`, `design/`, `ops/` — function dirs with an `EXPERT.md`; populate with agents via `/chief-of-staff create-agent <function> <agent>`
33
33
  - `<function>/<agent>/agent.md` — contract for each agent (inputs, steps, tools, outputs)
34
34
 
35
35
  ## Key files
@@ -43,7 +43,7 @@ This directive applies to both scheduled fires and interactive chat sessions.
43
43
  - Modify agent contracts during a run (that is a deliberate, separate task).
44
44
  - Invoke agents across project boundaries.
45
45
  - Invent tools, MCP servers, or capabilities that are not installed.
46
- - Write secrets or credentials to any tracked file.
46
+ - Commit secrets or credentials to git. Tool API keys your agents need (Apollo, HeyReach, Slack, Linear, etc.) belong in `.env`, which is gitignored.
47
47
 
48
48
  ## When in doubt
49
49
 
@@ -3,6 +3,8 @@
3
3
  # Secrets and credentials
4
4
  .env
5
5
  .env.local
6
+ /.env
7
+ **/.env
6
8
  *.pem
7
9
  *.key
8
10