@firatcand/roster 0.1.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.
- package/README.md +77 -215
- package/agents/lesson-drafter.md +3 -8
- package/agents/pattern-detector.md +0 -1
- package/bin/roster.js +7233 -1197
- package/data/plan-ceilings.yaml +57 -0
- package/package.json +8 -3
- package/skills/chief-of-staff/SKILL.md +199 -59
- package/skills/dreamer/SKILL.md +8 -7
- package/skills/roster-orchestrator/SKILL.md +53 -25
- package/templates/CLAUDE.project.template.md +1 -1
- package/templates/CONTEXT.template.md +2 -2
- package/templates/gitignore-defaults.txt +2 -0
- package/templates/hooks/banner.sh +47 -0
- package/templates/scaffold/chief-of-staff/README.md +16 -24
- package/templates/scaffold/chief-of-staff/agent.md +22 -32
- package/templates/scaffold/chief-of-staff/plans/audit-agent.yaml +4 -4
- package/templates/scaffold/chief-of-staff/plans/audit-repo.yaml +5 -4
- package/templates/scaffold/chief-of-staff/plans/create-agent.yaml +5 -34
- package/templates/scaffold/config/project.yaml.template +10 -0
- package/templates/scaffold/conventions.md +188 -173
- package/templates/scaffold/dreamer/README.md +2 -2
- package/templates/scaffold/dreamer/agent.md +0 -1
- package/templates/scaffold/dreamer/plans/nightly-reflection.yaml +23 -37
- package/templates/scaffold/dreamer/subagents/lesson-drafter.md +2 -7
- package/templates/scaffold/{projects/_demo/guidelines → guidelines}/asset-links.md +4 -0
- package/templates/scaffold/{projects/_demo/guidelines → guidelines}/brand-book.md +4 -0
- package/templates/scaffold/{projects/_demo/guidelines → guidelines}/messaging.md +4 -0
- package/templates/scaffold/{projects/_demo/guidelines → guidelines}/voice.md +4 -0
- package/templates/scaffold/logs/cron/.gitkeep +1 -0
- package/templates/scaffold/ops/EXPERT.md +5 -5
- package/templates/scaffold/scripts/audit-agent.sh +326 -0
- package/templates/scaffold/scripts/audit-repo.sh +218 -0
- package/templates/scaffold/scripts/create-function.sh +267 -0
- package/templates/scaffold/scripts/lib/README.md +6 -1
- package/templates/scaffold/scripts/lib/bindings-prompt.sh +53 -0
- package/templates/scaffold/scripts/lib/functions.sh +17 -5
- package/templates/scaffold/scripts/new-agent.sh +416 -0
- package/templates/scaffold/scripts/rename-agent.sh +91 -0
- package/templates/scaffold/scripts/save-state.sh +32 -0
- package/agents/critic.md +0 -74
- package/agents/enricher.md +0 -56
- package/agents/promotion-arbiter.md +0 -71
- package/agents/prospector.md +0 -51
- package/agents/writer.md +0 -58
- package/skills/sdr/SKILL.md +0 -147
- package/templates/scaffold/chief-of-staff/plans/add-agent-to-project.yaml +0 -45
- package/templates/scaffold/chief-of-staff/plans/archive-project.yaml +0 -51
- package/templates/scaffold/chief-of-staff/plans/audit-project.yaml +0 -34
- package/templates/scaffold/chief-of-staff/plans/create-project.yaml +0 -65
- package/templates/scaffold/chief-of-staff/plans/remove-agent-from-project.yaml +0 -50
- package/templates/scaffold/chief-of-staff/plans/rename-project.yaml +0 -62
- package/templates/scaffold/chief-of-staff/plans/unarchive-project.yaml +0 -41
- package/templates/scaffold/dreamer/subagents/promotion-arbiter.md +0 -64
- package/templates/scaffold/gtm/sdr/.claude/settings.json +0 -3
- package/templates/scaffold/gtm/sdr/.mcp.json +0 -21
- package/templates/scaffold/gtm/sdr/README.md +0 -46
- package/templates/scaffold/gtm/sdr/agent.md +0 -136
- package/templates/scaffold/gtm/sdr/plans/cold-outreach.yaml +0 -92
- package/templates/scaffold/gtm/sdr/projects/_demo/asset-references.md +0 -7
- package/templates/scaffold/gtm/sdr/projects/_demo/config/default.yaml +0 -69
- package/templates/scaffold/gtm/sdr/projects/_demo/log/feedback/.gitkeep +0 -0
- package/templates/scaffold/gtm/sdr/projects/_demo/log/runs/.gitkeep +0 -0
- package/templates/scaffold/gtm/sdr/projects/_demo/playbook/.gitkeep +0 -0
- package/templates/scaffold/gtm/sdr/subagents/critic.md +0 -67
- package/templates/scaffold/gtm/sdr/subagents/enricher.md +0 -49
- package/templates/scaffold/gtm/sdr/subagents/prospector.md +0 -44
- package/templates/scaffold/gtm/sdr/subagents/writer.md +0 -51
- package/templates/scaffold/projects/_demo/CLAUDE.md +0 -35
- package/templates/scaffold/projects/_demo/README.md +0 -16
- package/templates/scaffold/projects/_demo/assets/.gitkeep +0 -0
- package/templates/scaffold/projects/_demo/config/default.yaml +0 -28
- package/templates/scaffold/projects/_demo/state.md +0 -11
- package/templates/scaffold/scripts/new-project.sh +0 -125
- /package/templates/scaffold/gtm/{sdr/playbook/.gitkeep → .gitkeep} +0 -0
- /package/templates/scaffold/{projects/_demo/guidelines → guidelines}/icps/_persona-template.md +0 -0
|
@@ -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
|
|
4
|
-
version: "
|
|
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 (
|
|
7
|
-
- "A scheduled fire prompt names a roster agent (e.g., 'Run sdr cold-outreach
|
|
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
|
|
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 `
|
|
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
|
|
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
|
|
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
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
65
|
-
|
|
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>
|
|
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
|
|
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
|
|
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
|
-
-
|
|
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
|
|
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
|
-
-
|
|
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
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# roster:hitl-banner:v2 — SessionStart hook for Claude Code and Codex CLI.
|
|
3
|
+
#
|
|
4
|
+
# 1. (ROS-42) If `roster` is on PATH, run `roster pending sync --silent` with
|
|
5
|
+
# a 5s timeout to synthesize HITL items from any failed-fire signals
|
|
6
|
+
# (.exit non-zero + STALE detections). Silent on success, silent on
|
|
7
|
+
# skip-because-no-roster, silent on timeout.
|
|
8
|
+
# 2. Count pending HITL items in $PWD/roster/<function>/pending/*.md and
|
|
9
|
+
# print one banner line if count > 0. Silent when count is 0.
|
|
10
|
+
#
|
|
11
|
+
# Self-contained POSIX shell — Step 1 is best-effort opt-in, never blocks
|
|
12
|
+
# the session. Step 2 stays under the <200ms latency budget (p50 ~25ms).
|
|
13
|
+
#
|
|
14
|
+
# Installed by `roster hooks install` to:
|
|
15
|
+
# ~/.claude/hooks/roster-banner.sh
|
|
16
|
+
# ~/.codex/hooks/roster-banner.sh
|
|
17
|
+
|
|
18
|
+
set -u
|
|
19
|
+
|
|
20
|
+
# Run only inside roster workspaces. Quiet exit otherwise so non-roster
|
|
21
|
+
# sessions get zero overhead beyond shell startup.
|
|
22
|
+
[ -d "$PWD/roster" ] || exit 0
|
|
23
|
+
|
|
24
|
+
# Step 1: failed-fire synthesis (best-effort).
|
|
25
|
+
# Requires both `roster` on PATH AND a `timeout` binary. Skip silently
|
|
26
|
+
# otherwise — better to miss a sync than to block SessionStart on a slow
|
|
27
|
+
# workspace (codex review impl-pass: an unbounded fallback ran `roster
|
|
28
|
+
# pending sync` with no time cap; if disk was slow the user's first Claude
|
|
29
|
+
# Code message could be delayed seconds). Doctor remains the deterministic
|
|
30
|
+
# way to surface failed fires for users without a timeout binary.
|
|
31
|
+
if command -v roster >/dev/null 2>&1; then
|
|
32
|
+
if command -v timeout >/dev/null 2>&1; then
|
|
33
|
+
timeout 5 roster pending sync --silent --cwd "$PWD" >/dev/null 2>&1 || true
|
|
34
|
+
elif command -v gtimeout >/dev/null 2>&1; then
|
|
35
|
+
gtimeout 5 roster pending sync --silent --cwd "$PWD" >/dev/null 2>&1 || true
|
|
36
|
+
fi
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
# Step 2: banner. `find … | wc -l` returns 0 on empty, never errors on
|
|
40
|
+
# absent subdirs thanks to `-path` matching against a non-existent prefix
|
|
41
|
+
# being a no-op (the explicit `2>/dev/null` covers any read-permission
|
|
42
|
+
# edge case).
|
|
43
|
+
count=$(find "$PWD/roster" -mindepth 3 -maxdepth 3 -type f -name '*.md' -path '*/pending/*.md' 2>/dev/null | wc -l | tr -d ' ')
|
|
44
|
+
|
|
45
|
+
if [ "${count:-0}" -gt 0 ]; then
|
|
46
|
+
printf '⚠ %s pending HITL items — run `roster review`\n' "$count"
|
|
47
|
+
fi
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Chief of Staff Agent
|
|
2
2
|
|
|
3
|
-
Operates on the agent-team
|
|
3
|
+
Operates on the agent-team workspace itself. Scaffolds empty structure for new agents and functions, audits.
|
|
4
4
|
|
|
5
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
6
|
|
|
7
7
|
## Why this is one agent at top level
|
|
8
8
|
|
|
9
|
-
Cross-cutting infrastructure — operates on every function and every
|
|
9
|
+
Cross-cutting infrastructure — operates on every function and every agent. Lives at the same level as `dreamer/` for the same reason.
|
|
10
10
|
|
|
11
11
|
## Files
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ Cross-cutting infrastructure — operates on every function and every project, d
|
|
|
16
16
|
|
|
17
17
|
## Invocation
|
|
18
18
|
|
|
19
|
-
From
|
|
19
|
+
From the workspace root, in an interactive Claude Code session:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
cd /path/to/agent-team
|
|
@@ -25,26 +25,23 @@ claude
|
|
|
25
25
|
|
|
26
26
|
Then ask the agent to perform an operation:
|
|
27
27
|
|
|
28
|
-
- "Create a new
|
|
29
|
-
- "
|
|
30
|
-
- "Audit
|
|
31
|
-
- "Add content-agent to _demo"
|
|
32
|
-
- "Rename project oldname to newname"
|
|
28
|
+
- "Create a new gtm/sdr agent"
|
|
29
|
+
- "Create a new function called ops"
|
|
30
|
+
- "Audit the gtm/sdr agent"
|
|
33
31
|
- "Audit the whole repo"
|
|
34
32
|
|
|
35
33
|
The agent will:
|
|
36
|
-
1. Confirm cwd is
|
|
34
|
+
1. Confirm cwd is the workspace root
|
|
37
35
|
2. Parse intent, restate parameters back to you
|
|
38
|
-
3. Show
|
|
36
|
+
3. Show the paths it plans to create or modify
|
|
39
37
|
4. Execute by invoking the appropriate `scripts/*.sh`
|
|
40
38
|
5. Report what changed
|
|
41
39
|
6. Never auto-commit (you commit manually)
|
|
42
40
|
|
|
43
41
|
## Operations supported
|
|
44
42
|
|
|
45
|
-
- `create-
|
|
46
|
-
- `
|
|
47
|
-
- `audit-project`, `audit-agent`, `audit-repo`
|
|
43
|
+
- `create-agent`, `create-function`
|
|
44
|
+
- `audit-agent`, `audit-repo`
|
|
48
45
|
|
|
49
46
|
See `agent.md` for the full contract and confirmation rules.
|
|
50
47
|
|
|
@@ -52,14 +49,8 @@ See `agent.md` for the full contract and confirmation rules.
|
|
|
52
49
|
|
|
53
50
|
| Operation | Backing script | Result location |
|
|
54
51
|
|---|---|---|
|
|
55
|
-
| create-project | `scripts/new-project.sh` | `projects/<project>/` + optional instances |
|
|
56
52
|
| create-agent | `scripts/new-agent.sh` | `<function>/<agent>/` |
|
|
57
|
-
|
|
|
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` |
|
|
53
|
+
| create-function | `scripts/create-function.sh` | `<function>/` |
|
|
63
54
|
| audit-agent | `scripts/audit-agent.sh` | report at `chief-of-staff/logs/<YYYY-MM>/audit-*.md` |
|
|
64
55
|
| audit-repo | `scripts/audit-repo.sh` | report at `chief-of-staff/logs/<YYYY-MM>/audit-repo-*.md` |
|
|
65
56
|
|
|
@@ -78,9 +69,10 @@ You manually sync to GitHub. The chief-of-staff agent surfaces what changed; you
|
|
|
78
69
|
All operations have backing scripts that work standalone:
|
|
79
70
|
|
|
80
71
|
```bash
|
|
81
|
-
bash scripts/new-
|
|
82
|
-
bash scripts/
|
|
83
|
-
bash scripts/audit-
|
|
72
|
+
bash scripts/new-agent.sh gtm sdr
|
|
73
|
+
bash scripts/create-function.sh ops
|
|
74
|
+
bash scripts/audit-agent.sh gtm sdr
|
|
75
|
+
bash scripts/audit-repo.sh
|
|
84
76
|
```
|
|
85
77
|
|
|
86
|
-
The chief-of-staff agent wraps these with intent-parsing, validation,
|
|
78
|
+
The chief-of-staff agent wraps these with intent-parsing, validation, and confirmations. Scripts are the source of truth for what each operation actually does.
|
|
@@ -2,37 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
## Purpose
|
|
4
4
|
|
|
5
|
-
Operate on the agent-team
|
|
5
|
+
Operate on the agent-team workspace itself. Scaffold empty structure for new agents and functions, audit completeness. This agent does not run business workflows — it manages the structure those workflows live in.
|
|
6
6
|
|
|
7
|
-
In **stub mode** (`create-agent
|
|
7
|
+
In **stub mode** (`create-agent` 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 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
8
|
|
|
9
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
10
|
|
|
11
11
|
## Working directory
|
|
12
12
|
|
|
13
|
-
This agent operates from
|
|
13
|
+
This agent operates from workspace root only. If invoked from elsewhere, abort with: "Run chief-of-staff from agent-team workspace root."
|
|
14
14
|
|
|
15
15
|
## Inputs
|
|
16
16
|
|
|
17
17
|
The orchestrator (slash command or natural-language invocation) expects:
|
|
18
18
|
|
|
19
|
-
- `plan`: name of a plan in `chief-of-staff/plans/` (e.g., `
|
|
19
|
+
- `plan`: name of a plan in `chief-of-staff/plans/` (e.g., `create-agent`, `audit-repo`)
|
|
20
20
|
- Per-plan inputs (positional or named — see each plan's `inputs:` block)
|
|
21
21
|
|
|
22
22
|
Inputs may arrive in natural language. Parse intent, confirm parameters, then run the operation. Examples:
|
|
23
23
|
|
|
24
|
-
- "Create a new
|
|
25
|
-
- "
|
|
26
|
-
- "Audit
|
|
27
|
-
- "
|
|
24
|
+
- "Create a new sdr agent under gtm" → `create-agent function=gtm agent=sdr`
|
|
25
|
+
- "Add a new function called ops" → `create-function function=ops`
|
|
26
|
+
- "Audit the gtm/sdr agent" → `audit-agent function=gtm agent=sdr`
|
|
27
|
+
- "Audit the whole repo" → `audit-repo`
|
|
28
28
|
|
|
29
29
|
Read at runtime:
|
|
30
30
|
|
|
31
31
|
- `agent.md` (this file)
|
|
32
32
|
- `chief-of-staff/plans/<plan>.yaml` — the operation recipe
|
|
33
33
|
- `conventions.md` — canonical structure schema
|
|
34
|
-
-
|
|
35
|
-
- `<function>/<agent>/projects/_template/` — agent instance template (for the relevant agent)
|
|
34
|
+
- `<function>/_template/` — agent template (for the relevant function)
|
|
36
35
|
- `chief-of-staff/playbook/` — global lessons about scaffolding (naming conventions, common mistakes)
|
|
37
36
|
|
|
38
37
|
## Plans
|
|
@@ -41,43 +40,34 @@ This agent runs via plans in `chief-of-staff/plans/`. Each plan wraps a backing
|
|
|
41
40
|
|
|
42
41
|
| Plan | Description | Destructive? |
|
|
43
42
|
|---|---|---|
|
|
44
|
-
| `create-project` | Create a new project, optionally with agent instances | no |
|
|
45
43
|
| `create-agent` | Create a new global agent under a function | no |
|
|
46
44
|
| `create-function` | Add a new function category to the registry | no |
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
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 |
|
|
45
|
+
| `audit-agent` | Validate an agent's structure | no |
|
|
46
|
+
| `audit-repo` | Full workspace audit aggregating agent reports | no |
|
|
55
47
|
|
|
56
48
|
Invoke a plan via the slash command:
|
|
57
49
|
|
|
58
50
|
```
|
|
59
|
-
/chief-of-staff create-
|
|
60
|
-
/chief-of-staff
|
|
51
|
+
/chief-of-staff create-agent gtm sdr
|
|
52
|
+
/chief-of-staff create-function ops
|
|
61
53
|
/chief-of-staff audit-repo
|
|
62
54
|
```
|
|
63
55
|
|
|
64
56
|
Or in natural language:
|
|
65
57
|
|
|
66
58
|
```
|
|
67
|
-
"Run chief-of-staff
|
|
59
|
+
"Run chief-of-staff audit-repo"
|
|
68
60
|
```
|
|
69
61
|
|
|
70
62
|
When invoked without a plan, lists available plans and asks which to run.
|
|
71
63
|
|
|
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
64
|
## Common preamble for every plan
|
|
75
65
|
|
|
76
|
-
1. **Confirm cwd is
|
|
66
|
+
1. **Confirm cwd is workspace root.** Check for presence of `CLAUDE.md`, `conventions.md`. If not present, abort.
|
|
77
67
|
2. **Parse the user's request.** Extract plan name + parameters. If ambiguous, ask before proceeding.
|
|
78
|
-
3. **Show the plan.**
|
|
68
|
+
3. **Show the plan.** Always include the list of paths that will be created or modified.
|
|
79
69
|
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
|
|
70
|
+
5. **Report.** Summarize what changed (paths created/modified). Note anything skipped or warnings.
|
|
81
71
|
6. **Never auto-commit to git.** Leave commits for the user.
|
|
82
72
|
|
|
83
73
|
## Subagents
|
|
@@ -102,21 +92,21 @@ Per-plan output schemas are declared in each plan's `outputs:` block.
|
|
|
102
92
|
|
|
103
93
|
`approval_channel: session` — this agent is invoked interactively, never via cron. All confirmations happen in-session.
|
|
104
94
|
|
|
105
|
-
|
|
95
|
+
None of the current plans are destructive. If a future plan mutates or removes user content, add a mandatory confirmation gate that displays the plan and asks "proceed?" before executing.
|
|
106
96
|
|
|
107
97
|
## Lessons protocol
|
|
108
98
|
|
|
109
|
-
When you observe a pattern across operations — e.g., "users frequently
|
|
99
|
+
When you observe a pattern across operations — e.g., "users frequently invoke create-agent before create-function and end up with orphaned slugs" — 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
100
|
|
|
111
101
|
Do NOT write to `chief-of-staff/playbook/` directly during operations. The user may write a lesson by hand with `source: human`.
|
|
112
102
|
|
|
113
103
|
## Failure modes
|
|
114
104
|
|
|
115
|
-
- **Cwd not
|
|
105
|
+
- **Cwd not workspace root**: abort with clear message
|
|
116
106
|
- **Invalid slug or function name**: abort with example of valid format
|
|
117
107
|
- **Collision (target already exists)**: abort, tell user the existing path
|
|
118
|
-
- **Missing dependency (e.g.,
|
|
108
|
+
- **Missing dependency (e.g., function doesn't exist when running `create-agent`)**: abort, suggest the prerequisite plan
|
|
119
109
|
- **Script fails**: surface the script's stderr; don't attempt to recover by doing the work directly
|
|
120
110
|
- **YAML/JSON parse error in audit**: report as failure with line number from the audit script
|
|
121
111
|
- **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
|
|
112
|
+
- **Partial failure mid-operation**: scripts handle their own rollback. If a script reports partial state, surface exactly what state the workspace is in and what to do next.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
plan: audit-agent
|
|
2
2
|
description: |
|
|
3
|
-
Validate
|
|
4
|
-
agent.md sections, README, .
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Validate one agent at its flat shape `<function>/<agent>/`. Checks required
|
|
4
|
+
agent.md sections, README.md, config.yaml, .env (optional, agent-scoped),
|
|
5
|
+
.mcp.json, .claude/settings.json, subagents/, playbook/, plans/, and the
|
|
6
|
+
slash command at .claude/commands/<agent>.md.
|
|
7
7
|
|
|
8
8
|
inputs:
|
|
9
9
|
function:
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
plan: audit-repo
|
|
2
2
|
description: |
|
|
3
|
-
Full
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Full workspace audit. Runs agent audits for every live agent and aggregates
|
|
4
|
+
into one report. Also checks workspace completeness: root CLAUDE.md,
|
|
5
|
+
conventions.md, README.md, config/project.yaml, guidelines/,
|
|
6
|
+
.config/functions.yaml, universal .mcp.json, and universal
|
|
7
|
+
.claude/settings.json.
|
|
7
8
|
|
|
8
9
|
inputs: {}
|
|
9
10
|
|
|
@@ -11,8 +11,8 @@ description: |
|
|
|
11
11
|
Produces the same on-disk layout as stub mode, but with agent.md
|
|
12
12
|
sections filled in from the dialogue answers.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
Agents scaffold at `<function>/<agent>/` — flat shape, no per-project
|
|
15
|
+
instances.
|
|
16
16
|
|
|
17
17
|
inputs:
|
|
18
18
|
function:
|
|
@@ -26,13 +26,9 @@ inputs:
|
|
|
26
26
|
description: |
|
|
27
27
|
Explicit branch override: `stub` or `guided`. If omitted, `resolve_mode`
|
|
28
28
|
picks based on env + TTY (see that step).
|
|
29
|
-
add-to-projects:
|
|
30
|
-
required: false
|
|
31
|
-
description: List of project slugs to instance into. If omitted, the cross-link prompt runs.
|
|
32
29
|
|
|
33
30
|
outputs:
|
|
34
31
|
agent_path: string
|
|
35
|
-
instance_paths: list
|
|
36
32
|
mode_used: string # "stub" or "guided" — which branch executed.
|
|
37
33
|
files_written: list # absolute paths of every file the plan created or modified.
|
|
38
34
|
|
|
@@ -42,8 +38,7 @@ steps:
|
|
|
42
38
|
Confirm ${inputs.function} is registered. Validate ${inputs.agent} slug
|
|
43
39
|
against `^[a-z][a-z0-9-]*$`. Confirm `${inputs.function}/${inputs.agent}/`
|
|
44
40
|
does not already exist. If ${inputs.mode} is provided, validate it is
|
|
45
|
-
one of {stub, guided}.
|
|
46
|
-
each project exists at `projects/<slug>/`. If any are missing, abort.
|
|
41
|
+
one of {stub, guided}.
|
|
47
42
|
|
|
48
43
|
- id: resolve_mode
|
|
49
44
|
description: |
|
|
@@ -81,34 +76,10 @@ steps:
|
|
|
81
76
|
`TODO: fill in description` placeholder. Append every file touched
|
|
82
77
|
to `${files_written}`.
|
|
83
78
|
|
|
84
|
-
- id: resolve_projects
|
|
85
|
-
description: |
|
|
86
|
-
Branch on whether ${inputs.add-to-projects} was provided.
|
|
87
|
-
- If provided: use the list directly.
|
|
88
|
-
- If omitted: discover all live projects (every dir under `projects/`
|
|
89
|
-
that is not `_template` and does not start with `_`). If empty,
|
|
90
|
-
skip instancing and report "no live projects yet."
|
|
91
|
-
Otherwise present a multi-select via AskUserQuestion with options
|
|
92
|
-
[All projects, ...each project, None — agent stays global-only]
|
|
93
|
-
and `multiSelect: true`.
|
|
94
|
-
|
|
95
|
-
- id: instance_into_projects
|
|
96
|
-
tool: bash
|
|
97
|
-
args:
|
|
98
|
-
command: |
|
|
99
|
-
for proj in ${resolved_projects}; do
|
|
100
|
-
bash scripts/new-agent-instance.sh "$proj" ${inputs.function} ${inputs.agent}
|
|
101
|
-
done
|
|
102
|
-
description: |
|
|
103
|
-
For each resolved project, run `new-agent-instance.sh` and append the
|
|
104
|
-
instance line to `projects/<project>/CLAUDE.md` under
|
|
105
|
-
`## Active agent instances`. Append every created instance path to
|
|
106
|
-
`${files_written}`.
|
|
107
|
-
|
|
108
79
|
- id: report
|
|
109
80
|
description: |
|
|
110
|
-
Print `${outputs.mode_used}`, the
|
|
111
|
-
|
|
81
|
+
Print `${outputs.mode_used}`, the agent path, and the full
|
|
82
|
+
`${files_written}` list.
|
|
112
83
|
|
|
113
84
|
In **stub** mode, surface the script's "Next steps" output verbatim
|
|
114
85
|
(fill `agent.md`, add subagents, configure MCPs, add at least one
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Roster project identity.
|
|
2
|
+
# After roster init: name and display_name are substituted with your project.
|
|
3
|
+
# Edit the remaining fields (stage, audience, motion, created) before running agents.
|
|
4
|
+
|
|
5
|
+
name: {{PROJECT_NAME}} # required — kebab-case slug (substituted by roster init)
|
|
6
|
+
display_name: "{{DISPLAY_NAME}}" # required — human-readable name (substituted by roster init)
|
|
7
|
+
stage: pre-launch # one of: pre-launch | post-launch | scaling | mature
|
|
8
|
+
audience: "" # one-line description of who you sell to (fill in)
|
|
9
|
+
motion: outbound # one of: outbound | inbound | plg | hybrid
|
|
10
|
+
created: "" # yyyy-mm-dd — your project's kickoff date (fill in)
|