@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,147 @@
1
+ ---
2
+ name: sdr
3
+ description: "Cold outreach agent for a project. Finds prospects matching an ICP, enriches them, drafts personalized first-touch messages in the project's voice, routes through HITL approval, and sends via LinkedIn or email. Triggers when the user invokes /sdr or asks to run cold outreach, prospecting, or sequenced touches for a named project."
4
+ version: "0.1.0"
5
+ trigger_conditions:
6
+ - "User invokes the /sdr slash command (e.g., /sdr run cold-outreach for _demo)"
7
+ - "User asks to run cold outreach, prospecting, or first-touch messages against a named project"
8
+ - "User says 'send cold outreach to these prospects' or names an ICP + project pair"
9
+ - "Cron or /schedule fires an SDR plan against a project"
10
+ ---
11
+
12
+ # SDR
13
+
14
+ ## Purpose
15
+
16
+ The SDR (sales development) agent runs cold outreach for a project. Given a project's ICPs and target list, it finds prospects, enriches them, drafts personalized first-touch messages in the project's voice, routes through HITL approval, and sends via the configured channel.
17
+
18
+ This is a global agent. Logic, agent-scoped tools, and global lessons live here. Per-project instances live under `projects/<project>/`. Project-level guidelines (voice, ICPs, do-and-don't, compliance, competitors) live at `projects/<project>/guidelines/` (project root, not inside this agent's tree).
19
+
20
+ ## Inputs
21
+
22
+ The orchestrator (slash command or natural-language invocation) expects:
23
+
24
+ - `plan`: name of a plan in `gtm/sdr/plans/` (e.g., `cold-outreach`)
25
+ - `project`: project slug (must match a folder in `projects/`)
26
+ - Per-plan inputs (see the plan file for details, e.g., `count`, `prospects`, `channel`)
27
+
28
+ Read at runtime:
29
+
30
+ - `agent.md` (this file)
31
+ - `gtm/sdr/plans/<plan>.yaml` — workflow recipe
32
+ - `gtm/sdr/projects/<project>/config/default.yaml` — params and tool bindings
33
+ - `projects/<project>/CLAUDE.md` — project session context
34
+ - `projects/<project>/guidelines/voice.md` — voice
35
+ - `projects/<project>/guidelines/icps/*.md` — all personas
36
+ - `projects/<project>/guidelines/do-and-dont.md` — explicit operating rules (if non-empty)
37
+ - `projects/<project>/guidelines/compliance.md` — legal/regulatory constraints (if non-empty)
38
+ - `projects/<project>/guidelines/competitors.md` — competitive context (if non-empty)
39
+ - `gtm/sdr/projects/<project>/asset-references.md` — which assets this agent uses
40
+ - `gtm/sdr/projects/<project>/playbook/*.md` — project-scoped lessons
41
+ - `gtm/sdr/playbook/*.md` — global lessons
42
+ - Recent ~10 runs in `gtm/sdr/projects/<project>/log/runs/` to avoid duplicate outreach
43
+
44
+ ## Plans
45
+
46
+ This agent runs via named plans in `gtm/sdr/plans/`. Available plans:
47
+
48
+ - `cold-outreach` — Cold outreach to hiring managers via LinkedIn (primary) with email fallback. Originally the only workflow this agent ran.
49
+
50
+ When invoked without a plan, the agent lists available plans and asks which to run. To invoke a plan: use the `/sdr` slash command (e.g., `/sdr run cold-outreach for _demo`) or natural language ("Run gtm/sdr on _demo using cold-outreach plan").
51
+
52
+ ## Subagents
53
+
54
+ - `prospector.md` — finds prospects matching criteria. Read-only against external data sources.
55
+ - `enricher.md` — fills missing fields on existing prospects.
56
+ - `writer.md` — drafts outreach copy in project voice. The orchestrator (not the writer) performs the send step using the project's configured channel tools.
57
+ - `critic.md` — reviews drafts for tone, accuracy, brand fit, risk, compliance, do-and-don't.
58
+
59
+ ## Tools and bindings
60
+
61
+ Per-project tool bindings expected by this agent. Chief-of-staff prompts for these when scaffolding a new agent-instance. Values land in `gtm/sdr/projects/<project>/config/default.yaml` under a `tools:` key.
62
+
63
+ `required: true` means the agent will error at runtime if the binding is unfilled (TODO placeholder). `required: false` means the agent uses the binding when present and skips the related capability when absent.
64
+
65
+ ```yaml
66
+ gmail:
67
+ send_as:
68
+ required: true
69
+ description: "Email alias to send from (e.g., you@example.com)"
70
+ apply_label:
71
+ required: false
72
+ description: "Gmail label applied to outbound emails"
73
+ signature:
74
+ required: false
75
+ description: "Signature path or inline text"
76
+ attio:
77
+ list_id:
78
+ required: true
79
+ description: "Attio list ID for prospect records"
80
+ parent_object:
81
+ required: true
82
+ description: "Attio parent object slug (default: people)"
83
+ status_attribute:
84
+ required: false
85
+ description: "Attio status attribute name (default: status)"
86
+ heyreach:
87
+ campaign_id:
88
+ required: true
89
+ description: "HeyReach campaign ID for this project"
90
+ tag_prefix:
91
+ required: false
92
+ description: "Prefix applied to HeyReach tags"
93
+ apollo:
94
+ search_filters_default:
95
+ required: false
96
+ description: "Default search filter ID or JSON for Apollo searches"
97
+ drive:
98
+ parent_folder_id:
99
+ required: true
100
+ description: "Google Drive folder ID where this agent saves artifacts"
101
+ folder_path:
102
+ required: false
103
+ description: "Human-readable folder path (e.g., gtm/_demo/assets) — documentation only"
104
+ ```
105
+
106
+ Tools available via MCP (see `gtm/sdr/.mcp.json` and the universal `.mcp.json`):
107
+
108
+ - `Apollo.io` — prospect search and enrichment
109
+ - `HeyReach` — LinkedIn outreach send + status
110
+ - `Attio` — CRM upsert and status update
111
+ - `Gmail` — email sends
112
+ - `Slack` — HITL routing when async (universal)
113
+ - Web search — for prospect signal gathering when enrichment APIs lack info
114
+
115
+ If any required tool is unavailable at runtime, surface the gap before proceeding.
116
+
117
+ ## Outputs
118
+
119
+ Run file at `gtm/sdr/projects/<project>/log/runs/<YYYY-MM>/<YYYY-MM-DD-HHMM>.md`. See `conventions.md` § "Run file format". Per-plan output schemas are declared in the plan's `outputs:` block.
120
+
121
+ ## Approval
122
+
123
+ `approval_channel: auto` — in-session if interactive caller, Slack `#gtm` if cron-triggered. TTL: 24h. After TTL, drafts marked `expired` and not sent.
124
+
125
+ Per-run config can override:
126
+ - `approval_channel: slack` — always async
127
+ - `approval_channel: session` — always sync (fails if no session)
128
+
129
+ ## Lessons protocol
130
+
131
+ Log to the run's `## Candidate lessons` section:
132
+
133
+ - Subject lines / opening hooks that converted vs didn't
134
+ - Voice-fit issues the critic flagged
135
+ - ICP-scoring outcomes that surprised you
136
+ - Channel performance differences
137
+ - Timing patterns
138
+ - Compliance edge cases
139
+
140
+ The dreamer reads these on its next pass. Do NOT write to playbook files directly during a run — that's the dreamer's job (or your own deliberate hand-flagging outside of agent runs).
141
+
142
+ ## Failure modes
143
+
144
+ - **Required guideline missing or empty**: abort, request setup
145
+ - **Config invalid or required tool binding is TODO**: abort with schema error
146
+ - **Tool unavailable**: abort, surface which tool and that it should be in this agent's `.mcp.json`
147
+ - **HITL TTL expired with N drafts pending**: log expired, do not send, alert in next session
@@ -0,0 +1,45 @@
1
+ # {{PROJECT_NAME}} — Agent-Team Workspace
2
+
3
+ This workspace was scaffolded by `roster init`. It hosts a structured multi-agent team —
4
+ function-level experts and role-level agents — working on **{{PROJECT_NAME}}**.
5
+
6
+ ## Path discovery
7
+
8
+ Claude Code's `.claude/` discovery walks UP from your CWD, merging settings from each
9
+ parent directory. Agent-scoped config lives at `<function>/<agent>/.claude/`; universal
10
+ config at the workspace root.
11
+
12
+ ## Layout
13
+
14
+ - `chief-of-staff/` — repo maintenance agent (CRUD on projects, agents, functions)
15
+ - `dreamer/` — reflection agent; promotes lessons from runs to playbooks
16
+ - `projects/_demo/` — placeholder project; copy + rename for real work
17
+ - `gtm/`, `product/`, `design/`, `ops/` — function-level homes
18
+
19
+ Each `<function>/<agent>/agent.md` is the contract that defines that agent's inputs,
20
+ steps, tools, and outputs. Subagents live in `<function>/<agent>/subagents/`. Per-project
21
+ runs and feedback land under `<function>/<agent>/projects/<project>/log/`.
22
+
23
+ ## Running agents
24
+
25
+ Workflows are slash-command driven (`/sdr`, `/graphic-designer`, …) once their skills are
26
+ installed via `roster install`. Each command loads its agent's `agent.md` and executes a
27
+ named plan against a named project, writing a run log on completion.
28
+
29
+ ## Conventions
30
+
31
+ See `conventions.md` for the full reference: file naming, lesson schema, run-log
32
+ format, project structure. When the convention isn't clear, ask before guessing.
33
+
34
+ ## What you should NOT do
35
+
36
+ - Modify agent logic during a run — that's a separate, deliberate task.
37
+ - Call agents across projects. An agent on Project A cannot invoke a different project's
38
+ instance of itself.
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.
41
+
42
+ ## When in doubt
43
+
44
+ Read `conventions.md`. This workspace is shared with collaborators and future-you;
45
+ an inconsistent convention is worse than a missing one.
@@ -0,0 +1,51 @@
1
+ # {{PROJECT_NAME}} — Project Context
2
+
3
+ This is the canonical project context for **{{PROJECT_NAME}}**. Both `CLAUDE.md`
4
+ and `AGENTS.md` are symlinks (POSIX) or copies (Windows) pointing here; every new
5
+ session loads this file automatically.
6
+
7
+ <!-- roster:managed:start orchestrator -->
8
+ ## Orchestrator directive
9
+
10
+ On every new conversation in this workspace — including after `/clear` — invoke the
11
+ `roster-orchestrator` skill immediately before doing anything else:
12
+
13
+ > **You are operating inside a roster-managed workspace.** At the start of every
14
+ > conversation, activate the `roster-orchestrator` skill. The skill will inspect the
15
+ > pending queue, surface any HITL items, and prepare the session context. Do not
16
+ > proceed with user requests until the orchestrator bootstrap completes.
17
+
18
+ This directive applies to both scheduled fires and interactive chat sessions.
19
+ <!-- roster:managed:end orchestrator -->
20
+
21
+ <!-- roster:user:start workspace -->
22
+ ## Workspace: {{PROJECT_NAME}}
23
+
24
+ [Replace this section with project-specific context: domain, goals, constraints.]
25
+ <!-- roster:user:end workspace -->
26
+
27
+ <!-- roster:managed:start agent-layout -->
28
+ ## Agent team layout
29
+
30
+ - `chief-of-staff/` — repo maintenance and project wiring
31
+ - `dreamer/` — reflection; promotes lessons to playbooks
32
+ - `gtm/sdr/` — outbound sales development
33
+ - `<function>/<agent>/agent.md` — contract for each agent (inputs, steps, tools, outputs)
34
+
35
+ ## Key files
36
+
37
+ - `conventions.md` — naming, schema, run-log format
38
+ - `roster/<function>/pending/` — HITL queue (read on session start)
39
+ - `roster/<function>/schedules.yaml` — schedule registry mirror
40
+
41
+ ## What you must NOT do
42
+
43
+ - Modify agent contracts during a run (that is a deliberate, separate task).
44
+ - Invoke agents across project boundaries.
45
+ - Invent tools, MCP servers, or capabilities that are not installed.
46
+ - Write secrets or credentials to any tracked file.
47
+
48
+ ## When in doubt
49
+
50
+ Read `conventions.md`. An inconsistent convention is worse than a missing one.
51
+ <!-- roster:managed:end agent-layout -->
@@ -0,0 +1,25 @@
1
+ # roster workspace environment
2
+ #
3
+ # Copy this file to `.env` and fill in real values. Never commit `.env`.
4
+ # Each agent's docs name the variables it expects; uncomment what you use.
5
+
6
+ # --- Linear (MCP-driven workflows) ---
7
+ # LINEAR_API_KEY=lin_api_xxx
8
+ # LINEAR_TEAM_ID=xxx
9
+ # LINEAR_PROJECT_ID=xxx
10
+
11
+ # --- Slack HITL routing ---
12
+ # SLACK_BOT_TOKEN=xoxb-xxx
13
+ # SLACK_HITL_CHANNEL_GTM=gtm-hitl
14
+ # SLACK_HITL_CHANNEL_PRODUCT=product-hitl
15
+ # SLACK_HITL_CHANNEL_DESIGN=design-hitl
16
+ # SLACK_HITL_CHANNEL_OPS=ops-hitl
17
+ # SLACK_HITL_CHANNEL_ADMIN=admin-hitl
18
+
19
+ # --- LLM providers (for cron-driven workflows that run outside Claude Code) ---
20
+ # OPENAI_API_KEY=sk-xxx
21
+ # ANTHROPIC_API_KEY=sk-ant-xxx
22
+
23
+ # --- Optional integrations ---
24
+ # NOTION_API_KEY=secret_xxx
25
+ # GITHUB_TOKEN=ghp_xxx
@@ -0,0 +1,28 @@
1
+ # Roster defaults — managed by `roster init`; do not edit between markers
2
+
3
+ # Secrets and credentials
4
+ .env
5
+ .env.local
6
+ *.pem
7
+ *.key
8
+
9
+ # Editor / OS
10
+ .DS_Store
11
+ .idea/
12
+ .vscode/
13
+ *.swp
14
+ *~
15
+
16
+ # Node
17
+ node_modules/
18
+
19
+ # Operation logs and run/feedback bodies — preserve directories with .gitkeep
20
+ */log/runs/2*/
21
+ */log/feedback/2*/
22
+
23
+ # Temp / scratch
24
+ **/scratch/
25
+ **/tmp/
26
+ **/.cache/
27
+
28
+ # End Roster defaults
@@ -0,0 +1,22 @@
1
+ # Functions registry — single source of truth for function categories.
2
+ # Edit only via chief-of-staff `create-function` operation when possible.
3
+ # Manual edits OK; keep slugs lowercase kebab-case, alphanumeric + hyphens.
4
+ #
5
+ # Fields:
6
+ # slug — folder name under repo root (must match an existing folder)
7
+ # description — one-line summary, used in stub READMEs and audit reports
8
+ # has_expert — true if this function has an EXPERT.md the audit should expect
9
+
10
+ functions:
11
+ - slug: gtm
12
+ description: Go-to-market — outreach, lead gen, sales, marketing
13
+ has_expert: true
14
+ - slug: product
15
+ description: Product work — research, specs, roadmap, user feedback
16
+ has_expert: true
17
+ - slug: design
18
+ description: Design — brand, visual, content production assets
19
+ has_expert: true
20
+ - slug: ops
21
+ description: Operations — internal automations, reporting, admin
22
+ has_expert: true
@@ -0,0 +1,86 @@
1
+ # Chief of Staff Agent
2
+
3
+ Operates on the agent-team repo itself. Scaffolds empty structure for new projects/agents, archives, renames, audits.
4
+
5
+ This agent is the empty-structure scaffolder. It produces folders and template files in their default placeholder state. Filling content (voice, ICPs, brand) is a separate concern handled outside this agent.
6
+
7
+ ## Why this is one agent at top level
8
+
9
+ Cross-cutting infrastructure — operates on every function and every project, doesn't have its own per-project instances. Lives at the same level as `dreamer/` for the same reason.
10
+
11
+ ## Files
12
+
13
+ - `agent.md` — orchestrator contract: operations, steps, confirmation gates
14
+ - `playbook/` — global lessons about scaffolding (one file per lesson)
15
+ - `logs/` — operation logs and audit reports
16
+
17
+ ## Invocation
18
+
19
+ From repo root, in an interactive Claude Code session:
20
+
21
+ ```bash
22
+ cd /path/to/agent-team
23
+ claude
24
+ ```
25
+
26
+ Then ask the agent to perform an operation:
27
+
28
+ - "Create a new project called myproject with gtm/sdr and gtm/twitter-agent"
29
+ - "Archive the test-scaffold project"
30
+ - "Audit Acme Corp"
31
+ - "Add content-agent to _demo"
32
+ - "Rename project oldname to newname"
33
+ - "Audit the whole repo"
34
+
35
+ The agent will:
36
+ 1. Confirm cwd is repo root
37
+ 2. Parse intent, restate parameters back to you
38
+ 3. Show a plan before destructive ops, ask "proceed?"
39
+ 4. Execute by invoking the appropriate `scripts/*.sh`
40
+ 5. Report what changed
41
+ 6. Never auto-commit (you commit manually)
42
+
43
+ ## Operations supported
44
+
45
+ - `create-project`, `create-agent`, `add-agent-to-project`
46
+ - `remove-agent-from-project`, `archive-project`, `unarchive-project`, `rename-project`
47
+ - `audit-project`, `audit-agent`, `audit-repo`
48
+
49
+ See `agent.md` for the full contract and confirmation rules.
50
+
51
+ ## Where things land
52
+
53
+ | Operation | Backing script | Result location |
54
+ |---|---|---|
55
+ | create-project | `scripts/new-project.sh` | `projects/<project>/` + optional instances |
56
+ | create-agent | `scripts/new-agent.sh` | `<function>/<agent>/` |
57
+ | add-agent-to-project | `scripts/new-agent-instance.sh` | `<function>/<agent>/projects/<project>/` |
58
+ | remove-agent-from-project | `scripts/remove-agent-from-project.sh` | moved to `_archive/<function>/<agent>/projects/<project>-<date>/` |
59
+ | archive-project | `scripts/archive-project.sh` | moved to `_archive/projects/<project>-<date>/` (+ all instances) |
60
+ | unarchive-project | `scripts/unarchive-project.sh` | restored from `_archive/` |
61
+ | rename-project | `scripts/rename-project.sh` | folders + content updates everywhere |
62
+ | audit-project | `scripts/audit-project.sh` | report at `chief-of-staff/logs/<YYYY-MM>/audit-*.md` |
63
+ | audit-agent | `scripts/audit-agent.sh` | report at `chief-of-staff/logs/<YYYY-MM>/audit-*.md` |
64
+ | audit-repo | `scripts/audit-repo.sh` | report at `chief-of-staff/logs/<YYYY-MM>/audit-repo-*.md` |
65
+
66
+ Operation logs (mutations): `chief-of-staff/logs/<YYYY-MM>/operations-<YYYY-MM-DD>.md` (append-only).
67
+
68
+ ## Why no subagents
69
+
70
+ The work is mostly script invocation and structural validation. Subagents would add complexity without adding capability.
71
+
72
+ ## Why this never auto-commits
73
+
74
+ You manually sync to GitHub. The chief-of-staff agent surfaces what changed; you decide what's worth committing.
75
+
76
+ ## Direct script use
77
+
78
+ All operations have backing scripts that work standalone:
79
+
80
+ ```bash
81
+ bash scripts/new-project.sh myproject
82
+ bash scripts/archive-project.sh test-scaffold "no longer needed"
83
+ bash scripts/audit-project.sh _demo
84
+ ```
85
+
86
+ The chief-of-staff agent wraps these with intent-parsing, validation, confirmations, and orchestration (e.g., create-project + create-instances in one operation). Scripts are the source of truth for what each operation actually does.
@@ -0,0 +1,122 @@
1
+ # Chief of Staff Agent
2
+
3
+ ## Purpose
4
+
5
+ Operate on the agent-team repo itself. Scaffold empty structure for new projects/agents, archive completed projects, rename, audit completeness. This agent does not run business workflows — it manages the structure those workflows live in.
6
+
7
+ In **stub mode** (`create-agent`/`create-project` invoked headlessly or with `mode=stub`), this agent is an empty-structure scaffolder: it creates folders and template files in their default placeholder state — `voice.md` will say `<3 adjectives describing...>`, ICPs are `_persona-template.md`, agent purpose reads `<one paragraph...>`, and so on. In **guided mode** (the default when invoked interactively), `create-agent` runs the Guided Agent Creation dialogue defined in `skills/chief-of-staff/SKILL.md` and produces an `agent.md` with purpose, inputs, steps, tools, and subagents filled in from the dialogue answers — see that contract for the full prompt sequence. Filling project guidelines with real content remains a separate concern handled by function-level experts (a content agent, an expert, or templated generation from existing brand assets).
8
+
9
+ When in doubt, defer to `conventions.md` for the canonical structure schema and to the `_template/` directories for the canonical scaffold contents. This agent does not duplicate those — it tells you how to USE them.
10
+
11
+ ## Working directory
12
+
13
+ This agent operates from repo root only. If invoked from elsewhere, abort with: "Run chief-of-staff from agent-team repo root."
14
+
15
+ ## Inputs
16
+
17
+ The orchestrator (slash command or natural-language invocation) expects:
18
+
19
+ - `plan`: name of a plan in `chief-of-staff/plans/` (e.g., `archive-project`, `audit-repo`)
20
+ - Per-plan inputs (positional or named — see each plan's `inputs:` block)
21
+
22
+ Inputs may arrive in natural language. Parse intent, confirm parameters, then run the operation. Examples:
23
+
24
+ - "Create a new project called myproject with sdr and twitter-agent" → `create-project project=myproject agents=[gtm/sdr, gtm/twitter-agent]`
25
+ - "Archive test-scaffold" → `archive-project project=test-scaffold`
26
+ - "Audit Acme Corp" → `audit-project project=_demo`
27
+ - "Add content-agent to _demo" → `add-agent-to-project project=_demo function=gtm agent=content-agent`
28
+
29
+ Read at runtime:
30
+
31
+ - `agent.md` (this file)
32
+ - `chief-of-staff/plans/<plan>.yaml` — the operation recipe
33
+ - `conventions.md` — canonical structure schema
34
+ - `projects/_template/` — project template
35
+ - `<function>/<agent>/projects/_template/` — agent instance template (for the relevant agent)
36
+ - `chief-of-staff/playbook/` — global lessons about scaffolding (naming conventions, common mistakes)
37
+
38
+ ## Plans
39
+
40
+ This agent runs via plans in `chief-of-staff/plans/`. Each plan wraps a backing script in `scripts/`. Available plans:
41
+
42
+ | Plan | Description | Destructive? |
43
+ |---|---|---|
44
+ | `create-project` | Create a new project, optionally with agent instances | no |
45
+ | `create-agent` | Create a new global agent under a function | no |
46
+ | `create-function` | Add a new function category to the registry | no |
47
+ | `add-agent-to-project` | Add an agent instance to an existing project | no |
48
+ | `remove-agent-from-project` | Archive an agent instance (preserved in _archive) | yes |
49
+ | `archive-project` | Archive a project + all its instances | yes |
50
+ | `unarchive-project` | Restore an archived project | no |
51
+ | `rename-project` | Rename a project everywhere it appears | yes |
52
+ | `audit-project` | Validate a project's completeness; reports issues with suggested fixes | no |
53
+ | `audit-agent` | Validate an agent's structure and instances | no |
54
+ | `audit-repo` | Full repo audit aggregating project + agent reports | no |
55
+
56
+ Invoke a plan via the slash command:
57
+
58
+ ```
59
+ /chief-of-staff create-project myproject with gtm/sdr
60
+ /chief-of-staff archive-project test-scaffold
61
+ /chief-of-staff audit-repo
62
+ ```
63
+
64
+ Or in natural language:
65
+
66
+ ```
67
+ "Run chief-of-staff archive-project for test-scaffold"
68
+ ```
69
+
70
+ When invoked without a plan, lists available plans and asks which to run.
71
+
72
+ Destructive plans (`archive-project`, `unarchive-project`, `remove-agent-from-project`, `rename-project`) always show the planned changes and ask "proceed?" before executing. The cross-link prompts in `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.
73
+
74
+ ## Common preamble for every plan
75
+
76
+ 1. **Confirm cwd is repo root.** Check for presence of `CLAUDE.md`, `conventions.md`, `gtm/`, `projects/`. If not all present, abort.
77
+ 2. **Parse the user's request.** Extract plan name + parameters. If ambiguous, ask before proceeding.
78
+ 3. **Show the plan.** For destructive plans, summarize what will happen and ask "proceed?". Always include the list of paths that will be created, modified, or moved.
79
+ 4. **Execute by invoking the plan's backing script.** All operations are backed by a script in `scripts/`. The script does the work; this agent orchestrates and parses output.
80
+ 5. **Report.** Summarize what changed (paths created/modified/moved). Note anything skipped or warnings.
81
+ 6. **Never auto-commit to git.** Leave commits for the user.
82
+
83
+ ## Subagents
84
+
85
+ None. Chief-of-staff is a single orchestrator; the work is mostly script invocation and structural validation, not deep reasoning.
86
+
87
+ ## Tools and bindings
88
+
89
+ This agent uses bash for script invocation. All plans are backed by scripts in `scripts/`. No external MCPs required, no per-project tool bindings.
90
+
91
+ If a script is missing or fails, surface the failure clearly. Don't try to do the work directly — that's two sources of truth and they will drift.
92
+
93
+ ## Outputs
94
+
95
+ For mutation plans: a summary printed to chat (paths created, moved, modified). The corresponding script also appends to `chief-of-staff/logs/<YYYY-MM>/operations-<YYYY-MM-DD>.md` (one log file per day, append-only).
96
+
97
+ For audit plans: the report file at `chief-of-staff/logs/<YYYY-MM>/audit-...-<YYYY-MM-DD-HHMM>.md`, plus a condensed stdout summary.
98
+
99
+ Per-plan output schemas are declared in each plan's `outputs:` block.
100
+
101
+ ## Approval
102
+
103
+ `approval_channel: session` — this agent is invoked interactively, never via cron. All confirmations happen in-session.
104
+
105
+ Confirmation gates are MANDATORY for: `archive-project`, `unarchive-project`, `rename-project`, `remove-agent-from-project`. They display the plan and ask "proceed?" before executing.
106
+
107
+ ## Lessons protocol
108
+
109
+ When you observe a pattern across operations — e.g., "users frequently forget to run create-agent before create-project for that agent's instance" — log it as a candidate lesson in the operation's log entry, in a `## Candidate lessons` section. The dreamer picks it up next pass and may write a `chief-of-staff/playbook/L-...md` lesson.
110
+
111
+ Do NOT write to `chief-of-staff/playbook/` directly during operations. The user may write a lesson by hand with `source: human`.
112
+
113
+ ## Failure modes
114
+
115
+ - **Cwd not repo root**: abort with clear message
116
+ - **Invalid slug or function name**: abort with example of valid format
117
+ - **Collision (target already exists)**: abort, tell user the existing path
118
+ - **Missing dependency (e.g., agent doesn't exist for create-instance)**: abort, suggest the prerequisite plan
119
+ - **Script fails**: surface the script's stderr; don't attempt to recover by doing the work directly
120
+ - **YAML/JSON parse error in audit**: report as failure with line number from the audit script
121
+ - **Confirmation gate denied**: abort cleanly, no changes
122
+ - **Partial failure mid-operation**: scripts handle their own rollback. If a script reports partial state, surface exactly what state the repo is in and what to do next.
@@ -0,0 +1,45 @@
1
+ plan: add-agent-to-project
2
+ description: |
3
+ Instance an existing global agent into an existing project. Additive —
4
+ no confirmation gate. The backing script prompts interactively for tool
5
+ bindings declared in the agent's ## Tools and bindings section.
6
+
7
+ inputs:
8
+ project:
9
+ required: true
10
+ description: Project slug (must exist at projects/<slug>/).
11
+ function:
12
+ required: true
13
+ description: Function slug.
14
+ agent:
15
+ required: true
16
+ description: Agent slug (must exist at <function>/<agent>/).
17
+
18
+ outputs:
19
+ instance_path: string
20
+
21
+ steps:
22
+ - id: validate
23
+ description: |
24
+ Confirm projects/${inputs.project}/ exists. Confirm
25
+ ${inputs.function}/${inputs.agent}/ exists. Confirm instance does not
26
+ exist at ${inputs.function}/${inputs.agent}/projects/${inputs.project}/.
27
+
28
+ - id: execute
29
+ tool: bash
30
+ args:
31
+ command: bash scripts/new-agent-instance.sh ${inputs.project} ${inputs.function} ${inputs.agent}
32
+ description: |
33
+ Run the backing script. It will prompt interactively for tool bindings
34
+ declared in the agent's ## Tools and bindings section. Skip with Enter
35
+ or "skip" to leave as # TODO: placeholders.
36
+
37
+ - id: update_project_claude_md
38
+ description: |
39
+ Append a line for the new instance to projects/${inputs.project}/CLAUDE.md
40
+ under ## Active agent instances. Don't replace existing entries.
41
+
42
+ - id: report
43
+ description: Print the instance path and any TODO bindings the user must fill in.
44
+
45
+ approval_channel: session
@@ -0,0 +1,51 @@
1
+ plan: archive-project
2
+ description: |
3
+ Archive a project AND all its agent instances. Use when retiring a project
4
+ entirely. Preserves run history and project-scoped lessons in _archive/
5
+ for restoration via unarchive-project.
6
+
7
+ inputs:
8
+ project:
9
+ required: true
10
+ description: Project slug to archive (must exist at projects/<slug>/).
11
+ reason:
12
+ required: false
13
+ description: Free-text reason recorded in _archive/projects/<slug>-<date>/ARCHIVED.md.
14
+
15
+ outputs:
16
+ paths_archived: integer
17
+ archive_suffix: string
18
+
19
+ steps:
20
+ - id: validate
21
+ description: |
22
+ Confirm projects/${inputs.project}/ exists. Find all agent instances
23
+ under <function>/<agent>/projects/${inputs.project}/. Build the list of
24
+ paths that will move.
25
+
26
+ - id: confirmation
27
+ description: |
28
+ Show the full list of paths to be moved:
29
+
30
+ Will move to _archive/ (with date suffix YYYY-MM-DD; archive script
31
+ disambiguates with -2, -3 if same-day):
32
+ projects/${inputs.project}/ (project root)
33
+ <function>/<agent>/projects/${inputs.project}/ (each instance)
34
+ ...
35
+
36
+ Total: 1 project + N instances. Proceed?
37
+
38
+ Wait for "proceed", "yes", "y". Abort cleanly if denied.
39
+ approval: session
40
+
41
+ - id: execute
42
+ tool: bash
43
+ args:
44
+ command: bash scripts/archive-project.sh ${inputs.project} ${inputs.reason}
45
+ description: Move the project and instances to _archive/.
46
+
47
+ - id: report
48
+ description: |
49
+ Summarize what moved. Print the path to ARCHIVED.md and the operation log.
50
+
51
+ approval_channel: session
@@ -0,0 +1,32 @@
1
+ plan: audit-agent
2
+ description: |
3
+ Validate a global agent's structure and all its instances. Checks required
4
+ agent.md sections, README, .mcp.json, .claude/settings.json, subagents,
5
+ playbook, projects/_template/, plans/, slash command, and per-instance
6
+ config validity.
7
+
8
+ inputs:
9
+ function:
10
+ required: true
11
+ description: Function slug.
12
+ agent:
13
+ required: true
14
+ description: Agent slug.
15
+
16
+ outputs:
17
+ status: string # pass | warn | fail
18
+ report_path: string
19
+
20
+ steps:
21
+ - id: execute
22
+ tool: bash
23
+ args:
24
+ command: bash scripts/audit-agent.sh ${inputs.function} ${inputs.agent}
25
+ description: Run the backing audit script.
26
+
27
+ - id: report
28
+ description: |
29
+ Print the summary. Reference the full report at
30
+ chief-of-staff/logs/<YYYY-MM>/audit-${inputs.function}-${inputs.agent}-<YYYY-MM-DD-HHMM>.md.
31
+
32
+ approval_channel: session