@firatcand/roster 0.1.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 (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +272 -0
  3. package/agents/critic.md +74 -0
  4. package/agents/enricher.md +56 -0
  5. package/agents/lesson-drafter.md +64 -0
  6. package/agents/pattern-detector.md +62 -0
  7. package/agents/promotion-arbiter.md +71 -0
  8. package/agents/prospector.md +51 -0
  9. package/agents/writer.md +58 -0
  10. package/bin/roster.js +2093 -0
  11. package/lib/.gitkeep +0 -0
  12. package/package.json +68 -0
  13. package/skills/chief-of-staff/SKILL.md +218 -0
  14. package/skills/dreamer/SKILL.md +112 -0
  15. package/skills/roster-orchestrator/SKILL.md +122 -0
  16. package/skills/sdr/SKILL.md +147 -0
  17. package/templates/CLAUDE.project.template.md +45 -0
  18. package/templates/CONTEXT.template.md +51 -0
  19. package/templates/env.example +25 -0
  20. package/templates/gitignore-defaults.txt +28 -0
  21. package/templates/scaffold/.config/functions.yaml +22 -0
  22. package/templates/scaffold/chief-of-staff/README.md +86 -0
  23. package/templates/scaffold/chief-of-staff/agent.md +122 -0
  24. package/templates/scaffold/chief-of-staff/logs/.gitkeep +0 -0
  25. package/templates/scaffold/chief-of-staff/plans/add-agent-to-project.yaml +45 -0
  26. package/templates/scaffold/chief-of-staff/plans/archive-project.yaml +51 -0
  27. package/templates/scaffold/chief-of-staff/plans/audit-agent.yaml +32 -0
  28. package/templates/scaffold/chief-of-staff/plans/audit-project.yaml +34 -0
  29. package/templates/scaffold/chief-of-staff/plans/audit-repo.yaml +26 -0
  30. package/templates/scaffold/chief-of-staff/plans/create-agent.yaml +123 -0
  31. package/templates/scaffold/chief-of-staff/plans/create-function.yaml +48 -0
  32. package/templates/scaffold/chief-of-staff/plans/create-project.yaml +65 -0
  33. package/templates/scaffold/chief-of-staff/plans/remove-agent-from-project.yaml +50 -0
  34. package/templates/scaffold/chief-of-staff/plans/rename-project.yaml +62 -0
  35. package/templates/scaffold/chief-of-staff/plans/unarchive-project.yaml +41 -0
  36. package/templates/scaffold/chief-of-staff/playbook/.gitkeep +0 -0
  37. package/templates/scaffold/conventions.md +608 -0
  38. package/templates/scaffold/design/.gitkeep +0 -0
  39. package/templates/scaffold/design/EXPERT.md +68 -0
  40. package/templates/scaffold/dreamer/README.md +32 -0
  41. package/templates/scaffold/dreamer/agent.md +101 -0
  42. package/templates/scaffold/dreamer/logs/.gitkeep +0 -0
  43. package/templates/scaffold/dreamer/pending/.gitkeep +0 -0
  44. package/templates/scaffold/dreamer/plans/nightly-reflection.yaml +113 -0
  45. package/templates/scaffold/dreamer/playbook/.gitkeep +0 -0
  46. package/templates/scaffold/dreamer/state.md +13 -0
  47. package/templates/scaffold/dreamer/subagents/lesson-drafter.md +56 -0
  48. package/templates/scaffold/dreamer/subagents/pattern-detector.md +55 -0
  49. package/templates/scaffold/dreamer/subagents/promotion-arbiter.md +64 -0
  50. package/templates/scaffold/gtm/EXPERT.md +83 -0
  51. package/templates/scaffold/gtm/sdr/.claude/settings.json +3 -0
  52. package/templates/scaffold/gtm/sdr/.mcp.json +21 -0
  53. package/templates/scaffold/gtm/sdr/README.md +46 -0
  54. package/templates/scaffold/gtm/sdr/agent.md +136 -0
  55. package/templates/scaffold/gtm/sdr/plans/cold-outreach.yaml +92 -0
  56. package/templates/scaffold/gtm/sdr/playbook/.gitkeep +0 -0
  57. package/templates/scaffold/gtm/sdr/projects/_demo/asset-references.md +7 -0
  58. package/templates/scaffold/gtm/sdr/projects/_demo/config/default.yaml +69 -0
  59. package/templates/scaffold/gtm/sdr/projects/_demo/log/feedback/.gitkeep +0 -0
  60. package/templates/scaffold/gtm/sdr/projects/_demo/log/runs/.gitkeep +0 -0
  61. package/templates/scaffold/gtm/sdr/projects/_demo/playbook/.gitkeep +0 -0
  62. package/templates/scaffold/gtm/sdr/subagents/critic.md +67 -0
  63. package/templates/scaffold/gtm/sdr/subagents/enricher.md +49 -0
  64. package/templates/scaffold/gtm/sdr/subagents/prospector.md +44 -0
  65. package/templates/scaffold/gtm/sdr/subagents/writer.md +51 -0
  66. package/templates/scaffold/logs/cron/.gitkeep +0 -0
  67. package/templates/scaffold/ops/.gitkeep +0 -0
  68. package/templates/scaffold/ops/EXPERT.md +84 -0
  69. package/templates/scaffold/product/.gitkeep +0 -0
  70. package/templates/scaffold/product/EXPERT.md +87 -0
  71. package/templates/scaffold/projects/_demo/CLAUDE.md +35 -0
  72. package/templates/scaffold/projects/_demo/README.md +16 -0
  73. package/templates/scaffold/projects/_demo/assets/.gitkeep +0 -0
  74. package/templates/scaffold/projects/_demo/config/default.yaml +28 -0
  75. package/templates/scaffold/projects/_demo/guidelines/asset-links.md +15 -0
  76. package/templates/scaffold/projects/_demo/guidelines/brand-book.md +25 -0
  77. package/templates/scaffold/projects/_demo/guidelines/icps/_persona-template.md +44 -0
  78. package/templates/scaffold/projects/_demo/guidelines/messaging.md +20 -0
  79. package/templates/scaffold/projects/_demo/guidelines/voice.md +29 -0
  80. package/templates/scaffold/projects/_demo/state.md +11 -0
  81. package/templates/scaffold/scripts/lib/README.md +13 -0
  82. package/templates/scaffold/scripts/lib/functions.sh +89 -0
  83. package/templates/scaffold/scripts/new-project.sh +125 -0
@@ -0,0 +1,608 @@
1
+ # Conventions
2
+
3
+ Full reference. CLAUDE.md is the short behavioral guide loaded at session start; this is the long reference.
4
+
5
+ ## Repo philosophy
6
+
7
+ 1. **Agents are the unit of reuse.** An agent's logic lives once. Per-project differences live as instances under that agent.
8
+ 2. **Project guidelines are cross-agent.** Voice, ICPs, design, do-and-don't, compliance, competitors are project-level — every agent that operates on the project reads them. They live under `projects/<project>/guidelines/`.
9
+ 3. **Tooling is scoped where it belongs.** Universal MCPs/skills/plugins at root. Agent-scoped at the agent. No per-project tooling — projects share the agent's tools.
10
+ 4. **Files are the memory layer.** No vector DB, no embedding store. Markdown + YAML + Git.
11
+ 5. **Project-scoped lessons override global on conflict.** Local always wins at runtime.
12
+ 6. **Schedules are stateless.** Cron invokes `claude -p` headlessly.
13
+ 7. **The dreamer learns; agents act.** Reinforcement is a separate, deliberate process. Live agents don't update playbooks.
14
+
15
+ ## Directory map
16
+
17
+ ```
18
+ agent-team/
19
+ ├── .claude/ # universal Claude Code config
20
+ ├── .mcp.json # universal MCPs
21
+
22
+ ├── <function>/ # gtm | product | design | ops | (others — see .config/functions.yaml)
23
+ │ ├── EXPERT.md # function-level expert prompt (optional, see has_expert in registry)
24
+ │ └── <agent>/
25
+ │ ├── agent.md
26
+ │ ├── README.md
27
+ │ ├── playbook/ # GLOBAL lessons for this agent
28
+ │ ├── logs/ # agent-level operational logs
29
+ │ ├── subagents/
30
+ │ ├── .claude/ # agent-scoped tools
31
+ │ ├── .mcp.json # agent-scoped MCPs
32
+ │ └── projects/
33
+ │ ├── _template/
34
+ │ └── <project>/
35
+ │ ├── config/default.yaml
36
+ │ ├── playbook/ # PROJECT-scoped lessons for this agent
37
+ │ ├── log/runs/<YYYY-MM>/
38
+ │ ├── log/feedback/<YYYY-MM>/
39
+ │ └── asset-references.md # which project assets this agent uses
40
+
41
+ ├── dreamer/ # cross-cutting reinforcement agent
42
+ │ └── <same shape>
43
+
44
+ ├── chief-of-staff/ # cross-cutting maintenance agent (operates on repo)
45
+ │ ├── agent.md
46
+ │ ├── README.md
47
+ │ ├── playbook/
48
+ │ └── logs/ # operation logs + audit reports
49
+
50
+ ├── projects/ # PROJECT-LEVEL — cross-agent
51
+ │ ├── _template/
52
+ │ └── <project>/
53
+ │ ├── CLAUDE.md
54
+ │ ├── GUIDANCE.md
55
+ │ ├── state.md
56
+ │ ├── guidelines/
57
+ │ │ ├── voice.md
58
+ │ │ ├── icps/<persona-slug>.md # multiple personas, one file each
59
+ │ │ ├── design.md
60
+ │ │ ├── design-tokens.md
61
+ │ │ ├── brand-book.md
62
+ │ │ ├── messaging.md
63
+ │ │ ├── do-and-dont.md # may be empty stub
64
+ │ │ ├── compliance.md # may be empty stub
65
+ │ │ ├── competitors.md # may be empty stub
66
+ │ │ └── asset-links.md # local paths + URLs to external assets
67
+ │ └── assets/ # local files (gitignored if large)
68
+
69
+ ├── scripts/ # scaffolding + cron
70
+ └── logs/cron/ # cron stdout/stderr
71
+ ```
72
+
73
+ ## Function categories
74
+
75
+ The set of function categories is defined in `.config/functions.yaml`. The four initial functions are `gtm/`, `product/`, `design/`, `ops/`. Cross-cutting infrastructure agents `dreamer/` and `chief-of-staff/` are NOT functions — they're peers, not under any function.
76
+
77
+ To add a new function, use `bash scripts/create-function.sh <slug>` or via chief-of-staff: "create function <slug>".
78
+
79
+ Add a new function only when at least 2-3 agents will live there within ~90 days. Otherwise put the agent in the closest existing one.
80
+
81
+ ## Tool bindings
82
+
83
+ Each agent that uses external tools declares a `## Tools and bindings` section in its `agent.md`. This is a YAML code block that names tools, expected per-project bindings, a `required` flag, and a description.
84
+
85
+ ```yaml
86
+ gmail:
87
+ send_as:
88
+ required: true
89
+ description: "Email alias to send from"
90
+ apply_label:
91
+ required: false
92
+ description: "Gmail label applied to outbound"
93
+ ```
94
+
95
+ When chief-of-staff scaffolds a new agent-instance via `create-project` or `add-agent-to-project`, it parses this block and prompts the user for each binding. Values land in the agent-instance's `config/default.yaml` under `tools:`.
96
+
97
+ ### Runtime read order
98
+
99
+ When invoked, an agent reads:
100
+
101
+ 1. Its `agent.md` (logic + bindings schema)
102
+ 2. The instance's `config/default.yaml` (behavior params + tool bindings under `tools:`)
103
+ 3. Its tools' bindings from `tools:`, validating that required bindings are not TODO placeholders
104
+
105
+ If a required binding is unfilled, the agent aborts before doing tool work, with a clear message naming the missing binding.
106
+
107
+ ### Skipping during scaffolding
108
+
109
+ User can press Enter or type `skip` at any prompt. Skipped bindings land as `# TODO: <description>` placeholders. Optional bindings with TODO are silently skipped at runtime; required bindings with TODO cause a runtime error.
110
+
111
+ ### Editing later
112
+
113
+ Tool bindings can be edited directly in `config/default.yaml` at any time. No re-scaffolding needed.
114
+
115
+ ### Project-level vs agent-level bindings
116
+
117
+ This convention scopes bindings at the agent-instance level. Bindings genuinely shared across multiple agents in a project are duplicated across configs by design — chosen for simplicity at current scale. If shared bindings ever multiply, refactor to project-level `tool-bindings.yaml`; the schema is forward-compatible.
118
+
119
+ ### Defining the schema during agent creation
120
+
121
+ When a new agent is created via `bash scripts/new-agent.sh <fn> <agent>` (or via chief-of-staff `create-agent`), the script asks whether to define tools now. If yes, the user provides a comma-separated list of tool names. The script scaffolds a `## Tools and bindings` section with stub blocks per tool. The user then fills in actual bindings (with `required` flags and descriptions) by editing `agent.md` directly.
122
+
123
+ If skipped, the section is absent and can be added manually later. Agents without a `## Tools and bindings` section don't trigger the binding prompt during instance scaffolding — `new-agent-instance.sh` checks for the section and skips silently if missing.
124
+
125
+ ## Plans and slash commands
126
+
127
+ Agents execute named plans. A plan is a YAML file at `<function>/<role>/plans/<plan-name>.yaml` that defines a workflow recipe — ordered steps using subagents and tools, with input/output contracts.
128
+
129
+ ### Plan structure
130
+
131
+ ```yaml
132
+ plan: <plan-name>
133
+ description: |
134
+ Multi-line description of what this plan does.
135
+
136
+ inputs:
137
+ <field>:
138
+ required: true | false
139
+ default: <value>
140
+ description: ...
141
+
142
+ outputs:
143
+ <name>: <type>
144
+
145
+ steps:
146
+ - id: <step-id>
147
+ subagent: <subagent-name> # optional — names a subagent to invoke
148
+ agent: <function>/<role> # optional — cross-agent invocation
149
+ plan: <other-plan-name> # optional — calling another agent's plan
150
+ tool: <tool-name> # optional — direct tool call (when subagent has multiple tools)
151
+ description: <one-liner>
152
+ args:
153
+ <key>: <value>
154
+ <key>: ${tools.X.Y} # reference instance tool bindings
155
+ <key>: ${inputs.X} # reference plan inputs
156
+ <key>: ${config.X} # reference instance config
157
+ input_from: <prior-step-id> # chain step outputs
158
+
159
+ approval_channel: auto | session | slack | none
160
+
161
+ caps:
162
+ <field>: <value>
163
+ ```
164
+
165
+ ### Step types
166
+
167
+ - **Subagent call** — `subagent: <name>` with optional `tool: <name>` when the subagent has multiple tools available
168
+ - **Direct tool call** — `tool: <name>` with `action: <action>` and `args: {...}`
169
+ - **Cross-agent call** — `agent: <function>/<role>` with `plan: <plan-name>` to invoke another agent's plan
170
+
171
+ All three step types are valid in any plan.
172
+
173
+ ### Slash commands
174
+
175
+ Each agent has a project-level slash command at `.claude/commands/<role>.md`. The slash command is a thin router that:
176
+
177
+ 1. Loads the agent's `agent.md`
178
+ 2. Parses the user's request for `run <plan-name> for <project>`
179
+ 3. If a plan is named: loads the plan, validates bindings, executes, logs the run
180
+ 4. If only a project is named: lists available plans, asks the user
181
+ 5. If neither: lists projects and plans
182
+
183
+ Slash commands are auto-scaffolded by `scripts/new-agent.sh`. Naming: `/sdr`, `/graphic-designer`, `/ux-designer` — match the agent's role-based name.
184
+
185
+ ### Invocation patterns
186
+
187
+ ```
188
+ /sdr run cold-outreach for _demo
189
+ /sdr for _demo # asks which plan
190
+ /graphic-designer run logo-design for _demo
191
+ ```
192
+
193
+ Or in natural language (slash command not strictly required):
194
+
195
+ ```
196
+ "Run gtm/sdr on _demo using cold-outreach plan"
197
+ ```
198
+
199
+ ### Plans vs experts (key distinction)
200
+
201
+ Agents run plans (deterministic, repeatable, scheduled-friendly). Experts at the function level (`<function>/EXPERT.md`) handle goal-directed work (judgment-heavy, ad-hoc). When a user wants strategic exploration or substrate generation, the expert is the right invocation. When they want a known workflow executed, the agent + plan is the right invocation.
202
+
203
+ If you find yourself wanting "one-off" agent runs, you're probably looking for expert invocation, not agent invocation.
204
+
205
+ ### No default plans
206
+
207
+ Agents do NOT have a default plan. Invoking an agent without a named plan triggers an interactive "which plan?" prompt. This is intentional — explicit is better than implicit, and it prevents accidental runs of the wrong workflow.
208
+
209
+ ### Scheduling
210
+
211
+ Plan invocations integrate with Claude Code's native `/schedule` feature. To schedule a plan: use Claude Desktop's scheduled tasks with the prompt `/sdr run cold-outreach for _demo` (or equivalent). Plans don't have a `schedule` field — scheduling is a layer above the plan, not part of it.
212
+
213
+ ## Experts
214
+
215
+ Each function MAY have an `EXPERT.md` at `<function>/EXPERT.md`. An expert is a system prompt that defines a function-level advisor — used for shaping substrate (project guidelines), not producing tactical artifacts.
216
+
217
+ Whether a function has an expert is tracked in `.config/functions.yaml` via the `has_expert` flag.
218
+
219
+ ### What experts produce
220
+
221
+ Experts write to `projects/<project>/guidelines/<file>.md` — voice, ICPs, messaging, brand-book, design principles, design tokens, do-and-dont, compliance, competitors, asset-links. The exact subset depends on the function.
222
+
223
+ Experts do NOT write tactical artifacts (specific emails, single posts, individual component code). Those belong to agents.
224
+
225
+ ### Read-first protocol
226
+
227
+ When invoked, an expert reads in this order:
228
+
229
+ 1. `projects/<project>/CLAUDE.md` — project identity
230
+ 2. Existing `projects/<project>/guidelines/*.md` files relevant to the task
231
+ 3. `projects/<project>/state.md` — current focus
232
+
233
+ Then identifies gaps and asks only about gaps. Never re-asks what's already in substrate.
234
+
235
+ ### Invocation
236
+
237
+ To invoke an expert from any session in the repo:
238
+
239
+ > "Use the [function] expert. Generate [file] for [project]."
240
+ > "Use the GTM expert to critique projects/_demo/guidelines/icps/."
241
+
242
+ The session reads the function's EXPERT.md and follows its protocol.
243
+
244
+ ### Expert vs agent: the rule
245
+
246
+ Experts shape substrate. Agents produce artifacts. See root `CLAUDE.md` § "Experts vs agents" for the full distinction with examples.
247
+
248
+ ## File naming
249
+
250
+ - All lowercase, kebab-case: `sdr`, `cv-tailor`, `trend-scanner`.
251
+ - Lesson IDs: `L-YYYY-MM-DD-NNN`.
252
+ - Run files: `YYYY-MM-DD-HHMM.md` (24-hour, local time).
253
+ - Feedback files mirror run filenames exactly.
254
+ - Configs: `<purpose>.yaml` (typically `default.yaml`).
255
+
256
+ ## Agent contract (agent.md)
257
+
258
+ Required sections:
259
+
260
+ ```markdown
261
+ # <Agent Name>
262
+
263
+ ## Purpose
264
+ What this agent does, why it exists.
265
+
266
+ ## Inputs
267
+ What the orchestrator expects from the caller (plan name, project, per-plan inputs).
268
+ Files read at runtime (config path, guidelines paths, playbook paths).
269
+
270
+ ## Plans
271
+ List of named plans this agent runs (files in `<function>/<role>/plans/<plan>.yaml`).
272
+ One-line description per plan. No default plan — invocation without a plan triggers an interactive prompt.
273
+
274
+ ## Subagents
275
+ List with one-line descriptions.
276
+
277
+ ## Tools and bindings
278
+ Per-project tool bindings declared as a YAML block. See § "Tool bindings".
279
+
280
+ ## Outputs
281
+ Schema of the run output file. Per-plan output schemas live in the plan's `outputs:` block.
282
+
283
+ ## Approval
284
+ HITL routing. Default: `auto`.
285
+
286
+ ## Lessons protocol
287
+ What gets logged as candidate lessons during a run.
288
+ ```
289
+
290
+ `## Steps` is no longer part of the agent contract — workflow logic lives in plans (see § "Plans and slash commands").
291
+
292
+ ## Subagent contract
293
+
294
+ Required sections:
295
+
296
+ ```markdown
297
+ # <Subagent Name>
298
+
299
+ ## Role
300
+ Narrow job, single responsibility.
301
+
302
+ ## Inputs
303
+ What the orchestrator passes in.
304
+
305
+ ## Output
306
+ Structured output the orchestrator can parse.
307
+
308
+ ## Tools
309
+ Named tools this subagent uses.
310
+
311
+ ## Boundaries
312
+ What this subagent does NOT do.
313
+
314
+ ## Quality bar
315
+ Specific criteria for acceptable output.
316
+ ```
317
+
318
+ ## Config schema (config/default.yaml)
319
+
320
+ ```yaml
321
+ ---
322
+ agent: sdr
323
+ project: _demo
324
+ created: 2026-04-26
325
+ last_modified: 2026-04-26
326
+ ---
327
+
328
+ # Project-specific parameters
329
+ # Use prose comments to explain "why" alongside "what"
330
+
331
+ target_personas: [founding-team-hiring-manager, vp-eng-series-b]
332
+ channels:
333
+ primary: linkedin
334
+ fallback: email
335
+ weekly_cap: 10
336
+ approval_channel: auto
337
+
338
+ # Reference files (project-level)
339
+ voice_ref: ../../../../../projects/_demo/guidelines/voice.md
340
+ icps_ref: ../../../../../projects/_demo/guidelines/icps/
341
+ do_and_dont_ref: ../../../../../projects/_demo/guidelines/do-and-dont.md
342
+ compliance_ref: ../../../../../projects/_demo/guidelines/compliance.md
343
+ ```
344
+
345
+ Agents resolve referenced files at runtime. Paths are relative from the config file location.
346
+
347
+ ## Lesson schema
348
+
349
+ One file per lesson. Same schema everywhere — at agent level (global) or instance level (project).
350
+
351
+ ```markdown
352
+ ---
353
+ id: L-2026-04-26-001
354
+ source: human # human | dreamer
355
+ scope: global # global | project
356
+ project: _demo # required if scope=project; "—" if scope=global
357
+ agent: sdr
358
+ created: 2026-04-26
359
+ last_observed: 2026-04-26
360
+ status: observing # observing | candidate | validated | retired
361
+
362
+ evidence:
363
+ observations: 12
364
+ consistency_pct: 78
365
+ threshold:
366
+ observations: 20
367
+ consistency_pct: 70
368
+ signals: [hitl_feedback, post_hoc_analytics]
369
+
370
+ confidence: medium # low | medium | high
371
+ applies_to: [cold-outreach, founding-roles]
372
+ conflicts_with: []
373
+ validated_in: [_demo]
374
+ promoted_to_global: false
375
+ ---
376
+
377
+ # <Lesson title>
378
+
379
+ ## Pattern observed
380
+ ...
381
+
382
+ ## Recommendation
383
+ ...
384
+
385
+ ## Why this might be project-specific
386
+ ...
387
+
388
+ ## Retirement criteria
389
+ ...
390
+ ```
391
+
392
+ ### Lesson lifecycle
393
+
394
+ - **observing**: pattern detected, evidence below threshold. Not applied to runs yet.
395
+ - **candidate**: evidence above threshold, awaiting HITL approval.
396
+ - **validated**: HITL approved. Applied to runs.
397
+ - **retired**: no longer applies. Kept inline with reason.
398
+
399
+ ### Source field
400
+
401
+ - **human**: you wrote this lesson by hand. Could be at agent level (global) or instance level (project). The dreamer respects human lessons — won't override, only extend with HITL approval.
402
+ - **dreamer**: the dreamer agent drafted this from runs+feedback. Started as `observing`, may have been promoted through HITL.
403
+
404
+ ### Promotion rule (project → global)
405
+
406
+ A `validated` project lesson may be promoted to `global` when:
407
+
408
+ 1. Same pattern validated in 2+ projects independently
409
+ 2. Dreamer's promotion-arbiter flags it as a candidate
410
+ 3. HITL approves via Slack
411
+
412
+ Conflicting validated lessons across projects do NOT merge. They stay project-scoped, with `conflicts_with` pointers, and the global playbook records "this is project-dependent — see [list]."
413
+
414
+ ### Where lessons live
415
+
416
+ - `<function>/<agent>/playbook/L-...md` — `scope: global`
417
+ - `<function>/<agent>/projects/<project>/playbook/L-...md` — `scope: project`
418
+
419
+ Same schema everywhere. The folder location and the `scope` field must agree.
420
+
421
+ ## Run file format
422
+
423
+ `<function>/<agent>/projects/<project>/log/runs/<YYYY-MM>/<YYYY-MM-DD-HHMM>.md`
424
+
425
+ ```markdown
426
+ ---
427
+ agent: sdr
428
+ project: _demo
429
+ trigger: cron # cron | session | manual
430
+ session_id: <if session>
431
+ started: 2026-04-26T14:30:00+03:00
432
+ ended: 2026-04-26T14:42:00+03:00
433
+ status: completed # completed | partial | failed
434
+ config_version: <git-sha>
435
+ ---
436
+
437
+ # Run: 2026-04-26 14:30
438
+
439
+ ## Inputs
440
+ ...
441
+
442
+ ## Steps executed
443
+ ...
444
+
445
+ ## Outputs
446
+ ...
447
+
448
+ ## Candidate lessons
449
+ ...
450
+
451
+ ## Errors / partial state
452
+ ...
453
+ ```
454
+
455
+ ## Feedback file format
456
+
457
+ Mirrors run filename exactly. `log/feedback/<YYYY-MM>/<YYYY-MM-DD-HHMM>.md`
458
+
459
+ ```markdown
460
+ ---
461
+ run: 2026-04-26-1430
462
+ reviewed_by: <user>
463
+ reviewed_at: 2026-04-26T18:15:00+03:00
464
+ overall: positive # positive | negative | mixed | neutral
465
+ ---
466
+
467
+ # Feedback on run 2026-04-26-1430
468
+
469
+ ## What worked
470
+ ...
471
+
472
+ ## What didn't
473
+ ...
474
+
475
+ ## Specific edits
476
+ ...
477
+
478
+ ## Lesson candidates
479
+ ...
480
+ ```
481
+
482
+ ## State file format
483
+
484
+ `projects/<project>/state.md` — written by `/save-state`. Five lines max.
485
+
486
+ ```markdown
487
+ ---
488
+ updated: 2026-04-26T19:00:00+03:00
489
+ ---
490
+
491
+ Last task: drafted Q3 positioning hypothesis
492
+ Active artifacts: gtm/positioning/q3-draft.md
493
+ Open questions: ICP narrowing — fintech only or include b2b SaaS?
494
+ Next session: review draft with brand voice agent
495
+ Notes: dreamer flagged 2 candidate lessons in Slack — review before next outreach run
496
+ ```
497
+
498
+ ## Project guidelines
499
+
500
+ Files under `projects/<project>/guidelines/`. Read by every agent operating on the project (where relevant per agent.md).
501
+
502
+ | File | Purpose | Required? |
503
+ |---|---|---|
504
+ | `voice.md` | Tone, vocabulary, sentence patterns, energy | Yes |
505
+ | `icps/<slug>.md` | Persona/ICP definitions — multiple files for multiple personas | Yes (≥1) |
506
+ | `design.md` | Design principles | Yes |
507
+ | `design-tokens.md` | Colors, typography, spacing as tokens | Yes |
508
+ | `brand-book.md` | Visual identity overview, logo usage | Yes |
509
+ | `messaging.md` | Value props, headlines, taglines, anti-claims | Yes |
510
+ | `do-and-dont.md` | Explicit project-specific operating rules | Stub, fill when needed |
511
+ | `compliance.md` | Legal/regulatory constraints | Stub, fill when needed |
512
+ | `competitors.md` | Competitive context, how to position | Stub, fill when needed |
513
+ | `asset-links.md` | Local paths + URLs to brand assets (logos, fonts, mood) | Yes |
514
+
515
+ ICPs note: each persona is a separate file under `icps/`. Buying signals, intent triggers, qualification criteria all live inside the relevant ICP file (not in a separate signals.md).
516
+
517
+ ## Asset references
518
+
519
+ Two sides:
520
+
521
+ **Project-level** (`projects/<project>/guidelines/asset-links.md`): the source of truth. Where every asset for the project actually lives. Mix of local paths (`~/Design/...`) and URLs (Google Drive, Figma, Framer).
522
+
523
+ **Agent-instance level** (`<function>/<agent>/projects/<project>/asset-references.md`): a thin file listing which subset of project assets this agent uses, by name (referencing the project asset-links). This makes it explicit and cheap to audit "what does sdr need from Acme Corp's assets?"
524
+
525
+ Example agent-level `asset-references.md`:
526
+
527
+ ```markdown
528
+ # Asset references — sdr / _demo
529
+
530
+ This agent uses these assets from `projects/_demo/guidelines/asset-links.md`:
531
+
532
+ - Email signature image (PNG)
533
+ - Calendar booking link (URL)
534
+ - Profile photo (square, 400x400)
535
+ ```
536
+
537
+ ## HITL routing
538
+
539
+ Per-run via the agent's `approval_channel`:
540
+
541
+ - `auto` (default): in-session if interactive, function-channel via Slack if cron
542
+ - `session`: always wait for in-session approval (fails if no session)
543
+ - `slack`: always post via Slack (uses the agent's resolved function channel)
544
+ - `none`: no approval gate (low-risk reads only)
545
+
546
+ ### Channel resolution for Slack-routed HITL
547
+
548
+ | Agent location | Channel | Env var |
549
+ |---|---|---|
550
+ | `gtm/<agent>/...` | `#gtm` | `SLACK_HITL_CHANNEL_GTM` |
551
+ | `product/<agent>/...` | `#product` | `SLACK_HITL_CHANNEL_PRODUCT` |
552
+ | `design/<agent>/...` | `#design` | `SLACK_HITL_CHANNEL_DESIGN` |
553
+ | `ops/<agent>/...` | `#ops` | `SLACK_HITL_CHANNEL_OPS` |
554
+ | Future `<function>/<agent>/...` | `#<function>` | `SLACK_HITL_CHANNEL_<FUNCTION>` |
555
+ | `dreamer/...` | `#admin` | `SLACK_HITL_CHANNEL_ADMIN` |
556
+ | `chief-of-staff/...` | `#admin` | `SLACK_HITL_CHANNEL_ADMIN` |
557
+
558
+ The function-channel rule extends automatically when new functions are added via `create-function`. The user is responsible for:
559
+ 1. Creating the corresponding Slack channel (e.g., `#system-architect`)
560
+ 2. Adding the env var to `.env` (e.g., `SLACK_HITL_CHANNEL_SYSTEM_ARCHITECT=#system-architect`)
561
+
562
+ The `create-function` operation prints a reminder when scaffolding a new function.
563
+
564
+ Approval expires after 24h by default. Workflows specify own TTL if different.
565
+
566
+ ## Schedules
567
+
568
+ Cron jobs:
569
+
570
+ 1. Live in `scripts/cron/crontab` (versioned)
571
+ 2. Invoke a wrapper at `scripts/cron/wrappers/<job>.sh`
572
+ 3. Wrapper sets up env, calls `claude -p "<prompt>"` with the right cwd (typically inside an agent's project instance)
573
+ 4. stdout/stderr → `logs/cron/<job>-<YYYY-MM-DD>.log`
574
+ 5. Run output → the agent's instance `log/runs/` as normal
575
+
576
+ Install: `bash scripts/cron/install.sh`. Add a job: `bash scripts/new-cron.sh <job-name>`.
577
+
578
+ ## External-action gates
579
+
580
+ Any agent that takes external action (post, send, message, write to CRM) must:
581
+
582
+ 1. Specify HITL approval (default `auto`)
583
+ 2. Implement daily/weekly cap from config
584
+ 3. Implement auto-reject TTL for unapproved actions
585
+ 4. Log all actions to `log/runs/` regardless of outcome (sent, rejected, expired)
586
+
587
+ Applies to: sdr, twitter-automation, job-application, anything writing externally.
588
+
589
+ ## What we're not building (and triggers to revisit)
590
+
591
+ | Not built | Trigger to revisit |
592
+ |---|---|
593
+ | Vector memory layer | A single playbook file exceeds context window OR fuzzy retrieval becomes a felt need. |
594
+ | Long-running harness | A workflow with validated <5min latency requirement that cron polling at 2-min interval cannot serve. Fake on cron first. |
595
+ | Multi-agent framework (LangGraph etc.) | Claude Code subagents prove insufficient for a real coordination need. |
596
+ | Cross-project agent calls | A specific co-marketing or shared-asset use case emerges. Until then, lessons promote globally; agents do not call across. |
597
+ | Per-project tool scoping | An agent needs different tools for different projects (e.g., outreach uses HeyReach for one project, Outreach.io for another). Today, agent-level tooling assumes consistent toolset across all projects. |
598
+ | Hermes / multi-runtime | Persistent state across days with autonomous resumption AND Claude Code session model is shown to fail. Both required. |
599
+ | Multi-tenant config storage | An agent needs to support a second user beyond the original owner. |
600
+ | Per-domain dreamers | Cross-domain pattern detection turns out to be unhelpful. |
601
+
602
+ ## When the convention isn't clear
603
+
604
+ Ask before guessing. Inconsistent conventions are worse than missing ones. Write the convention into this file once decided, with a date.
605
+
606
+ ---
607
+
608
+ Last updated: 2026-04-27.
File without changes
@@ -0,0 +1,68 @@
1
+ <!--
2
+ This expert prompt is opinionated. It reflects one founder's judgment about
3
+ which thinkers, frameworks, and skills are useful for this function. Replace
4
+ freely with your own perspectives — the practitioner panel, skills routing,
5
+ and stage filter are all customizable to your context.
6
+ -->
7
+
8
+ # Design Expert
9
+
10
+ Senior design advisor for an early-stage founder. Cover UI/UX, brand identity, design systems, frontend implementation guidance, motion, and interface copywriting. Interrogate reasoning before endorsing decisions.
11
+
12
+ ## Scope
13
+
14
+ - **Critique**: Audit guideline files in `projects/<project>/guidelines/` — `voice.md`, `brand-book.md`, `design.md`, `design-tokens.md`, `asset-links.md`. State the principle being violated or upheld. If subjective, say so but still take a position.
15
+ - **Generate guidelines**: Produce or refine these files. Default to producing directly when context is sufficient; otherwise interview, then write.
16
+ - **Guide**: Visual decisions, accessibility constraints, design-system tradeoffs, component library questions, framework/CSS architecture choices.
17
+
18
+ You do **NOT** produce tactical artifacts (specific component code, one-off layouts, ad-hoc designs, single landing pages). Those are workflow output and belong to agents. **Experts shape substrate; agents produce artifacts.**
19
+
20
+ ## Read-first protocol
21
+
22
+ On invocation, read:
23
+
24
+ 1. `projects/<project>/CLAUDE.md` — project identity
25
+ 2. Existing files in `projects/<project>/guidelines/` for visual context already established
26
+ 3. `projects/<project>/state.md`
27
+
28
+ Ask only about gaps. Don't re-ask what's in substrate. If the project hasn't been named, ask which project before proceeding.
29
+
30
+ ## What you cover
31
+
32
+ - UI/UX design for web and mobile (layout, interaction, accessibility, responsive behavior)
33
+ - Brand identity and visual design (logo systems, typography, color, visual language)
34
+ - Design systems and component libraries (tokens, patterns, documentation)
35
+ - Frontend implementation guidance (framework selection, CSS architecture, component structure)
36
+ - Motion and animation (transitions, micro-interactions, animation specs)
37
+ - Interface copywriting (microcopy, labels, error messages, onboarding text)
38
+
39
+ ## Skills
40
+
41
+ Read the matched skill file before producing detailed recommendations or deliverables. If a task spans multiple, read all applicable.
42
+
43
+ | Task | Skill |
44
+ |---|---|
45
+ | Building or implementing a UI (React, HTML/CSS, any framework) | frontend-design |
46
+ | Comprehensive UI/UX with stack/style/palette/font selection | ui-ux-pro-max |
47
+ | UI audit, spacing, typography, color, design-token spec | ui-design |
48
+ | UX audit, flow critique, cognitive/perceptual review | ux-design |
49
+ | Brand identity, palette, type scale, design-system foundations | graphic-design |
50
+ | Motion, transitions, micro-interactions, animation specs | motion-picture |
51
+ | Microcopy, labels, error messages, CTA text | copywriter-skill |
52
+
53
+ ## Output rules
54
+
55
+ - Generated guidelines write to `projects/<project>/guidelines/<file>.md`. Name the path before writing.
56
+ - Critique: name what works and what doesn't, state the principle, take a position even when subjective.
57
+ - When recommending tools or libraries, state the tradeoff — not just the pick.
58
+ - Vague requests: clarify scope before producing work.
59
+
60
+ ## Defaults
61
+
62
+ - WCAG 2.1 AA accessibility unless told otherwise
63
+ - Token-based, systematic decisions over one-offs
64
+ - Prefer design that compounds (system foundations) over one-off polish
65
+
66
+ ## Stage filter
67
+
68
+ Early-stage: limited resources, no brand awareness yet, evolving identity. Bias toward systematic foundations that compound. Flag when a one-off choice will cost rework later. Push back when the user asks for polish before fundamentals are decided.