@bradygaster/squad-cli 0.9.6-insider.2 → 0.10.0-insider.1
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/CHANGELOG.md +555 -0
- package/README.md +5 -5
- package/dist/cli/commands/build.js +3 -3
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/copilot-bridge.d.ts.map +1 -1
- package/dist/cli/commands/copilot-bridge.js +5 -1
- package/dist/cli/commands/copilot-bridge.js.map +1 -1
- package/dist/cli/commands/cross-squad.d.ts +15 -2
- package/dist/cli/commands/cross-squad.d.ts.map +1 -1
- package/dist/cli/commands/cross-squad.js +78 -4
- package/dist/cli/commands/cross-squad.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +6 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +120 -5
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/export.d.ts +7 -3
- package/dist/cli/commands/export.d.ts.map +1 -1
- package/dist/cli/commands/export.js +68 -16
- package/dist/cli/commands/export.js.map +1 -1
- package/dist/cli/commands/import.d.ts +7 -3
- package/dist/cli/commands/import.d.ts.map +1 -1
- package/dist/cli/commands/import.js +140 -42
- package/dist/cli/commands/import.js.map +1 -1
- package/dist/cli/commands/install-hooks.d.ts.map +1 -1
- package/dist/cli/commands/install-hooks.js +50 -5
- package/dist/cli/commands/install-hooks.js.map +1 -1
- package/dist/cli/commands/link.d.ts.map +1 -1
- package/dist/cli/commands/link.js +7 -1
- package/dist/cli/commands/link.js.map +1 -1
- package/dist/cli/commands/loop.d.ts.map +1 -1
- package/dist/cli/commands/loop.js +7 -5
- package/dist/cli/commands/loop.js.map +1 -1
- package/dist/cli/commands/memory.d.ts +2 -0
- package/dist/cli/commands/memory.d.ts.map +1 -0
- package/dist/cli/commands/memory.js +304 -0
- package/dist/cli/commands/memory.js.map +1 -0
- package/dist/cli/commands/migrate-backend.d.ts +36 -5
- package/dist/cli/commands/migrate-backend.d.ts.map +1 -1
- package/dist/cli/commands/migrate-backend.js +250 -40
- package/dist/cli/commands/migrate-backend.js.map +1 -1
- package/dist/cli/commands/notes.d.ts +27 -0
- package/dist/cli/commands/notes.d.ts.map +1 -0
- package/dist/cli/commands/notes.js +222 -0
- package/dist/cli/commands/notes.js.map +1 -0
- package/dist/cli/commands/plugin.d.ts.map +1 -1
- package/dist/cli/commands/plugin.js +423 -8
- package/dist/cli/commands/plugin.js.map +1 -1
- package/dist/cli/commands/skill.d.ts +31 -0
- package/dist/cli/commands/skill.d.ts.map +1 -0
- package/dist/cli/commands/skill.js +498 -0
- package/dist/cli/commands/skill.js.map +1 -0
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +9 -1
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/state-mcp.d.ts +25 -0
- package/dist/cli/commands/state-mcp.d.ts.map +1 -0
- package/dist/cli/commands/state-mcp.js +174 -0
- package/dist/cli/commands/state-mcp.js.map +1 -0
- package/dist/cli/commands/watch/agent-spawn.d.ts +62 -0
- package/dist/cli/commands/watch/agent-spawn.d.ts.map +1 -0
- package/dist/cli/commands/watch/agent-spawn.js +127 -0
- package/dist/cli/commands/watch/agent-spawn.js.map +1 -0
- package/dist/cli/commands/watch/capabilities/board.d.ts.map +1 -1
- package/dist/cli/commands/watch/capabilities/board.js +2 -1
- package/dist/cli/commands/watch/capabilities/board.js.map +1 -1
- package/dist/cli/commands/watch/capabilities/decision-hygiene.d.ts.map +1 -1
- package/dist/cli/commands/watch/capabilities/decision-hygiene.js +3 -2
- package/dist/cli/commands/watch/capabilities/decision-hygiene.js.map +1 -1
- package/dist/cli/commands/watch/capabilities/execute.d.ts.map +1 -1
- package/dist/cli/commands/watch/capabilities/execute.js +14 -2
- package/dist/cli/commands/watch/capabilities/execute.js.map +1 -1
- package/dist/cli/commands/watch/capabilities/index.d.ts.map +1 -1
- package/dist/cli/commands/watch/capabilities/index.js +2 -0
- package/dist/cli/commands/watch/capabilities/index.js.map +1 -1
- package/dist/cli/commands/watch/capabilities/monitor-email.d.ts +1 -1
- package/dist/cli/commands/watch/capabilities/monitor-email.d.ts.map +1 -1
- package/dist/cli/commands/watch/capabilities/monitor-email.js +21 -4
- package/dist/cli/commands/watch/capabilities/monitor-email.js.map +1 -1
- package/dist/cli/commands/watch/capabilities/monitor-teams.d.ts +1 -1
- package/dist/cli/commands/watch/capabilities/monitor-teams.d.ts.map +1 -1
- package/dist/cli/commands/watch/capabilities/monitor-teams.js +21 -5
- package/dist/cli/commands/watch/capabilities/monitor-teams.js.map +1 -1
- package/dist/cli/commands/watch/capabilities/notes-promote.d.ts +11 -0
- package/dist/cli/commands/watch/capabilities/notes-promote.d.ts.map +1 -0
- package/dist/cli/commands/watch/capabilities/notes-promote.js +124 -0
- package/dist/cli/commands/watch/capabilities/notes-promote.js.map +1 -0
- package/dist/cli/commands/watch/capabilities/retro.d.ts.map +1 -1
- package/dist/cli/commands/watch/capabilities/retro.js +3 -2
- package/dist/cli/commands/watch/capabilities/retro.js.map +1 -1
- package/dist/cli/commands/watch/capabilities/wave-dispatch.d.ts.map +1 -1
- package/dist/cli/commands/watch/capabilities/wave-dispatch.js +2 -1
- package/dist/cli/commands/watch/capabilities/wave-dispatch.js.map +1 -1
- package/dist/cli/commands/watch/index.d.ts.map +1 -1
- package/dist/cli/commands/watch/index.js +16 -12
- package/dist/cli/commands/watch/index.js.map +1 -1
- package/dist/cli/core/cast.d.ts.map +1 -1
- package/dist/cli/core/cast.js +216 -1
- package/dist/cli/core/cast.js.map +1 -1
- package/dist/cli/core/command-help.d.ts +44 -0
- package/dist/cli/core/command-help.d.ts.map +1 -0
- package/dist/cli/core/command-help.js +401 -0
- package/dist/cli/core/command-help.js.map +1 -0
- package/dist/cli/core/copilot-invocation.d.ts +57 -0
- package/dist/cli/core/copilot-invocation.d.ts.map +1 -0
- package/dist/cli/core/copilot-invocation.js +84 -0
- package/dist/cli/core/copilot-invocation.js.map +1 -0
- package/dist/cli/core/effective-squad-dir.d.ts +33 -0
- package/dist/cli/core/effective-squad-dir.d.ts.map +1 -0
- package/dist/cli/core/effective-squad-dir.js +37 -0
- package/dist/cli/core/effective-squad-dir.js.map +1 -0
- package/dist/cli/core/init.d.ts +2 -0
- package/dist/cli/core/init.d.ts.map +1 -1
- package/dist/cli/core/init.js +130 -1
- package/dist/cli/core/init.js.map +1 -1
- package/dist/cli/core/mcp-root.d.ts +73 -0
- package/dist/cli/core/mcp-root.d.ts.map +1 -0
- package/dist/cli/core/mcp-root.js +195 -0
- package/dist/cli/core/mcp-root.js.map +1 -0
- package/dist/cli/core/mcp-spec.d.ts +48 -0
- package/dist/cli/core/mcp-spec.d.ts.map +1 -0
- package/dist/cli/core/mcp-spec.js +62 -0
- package/dist/cli/core/mcp-spec.js.map +1 -0
- package/dist/cli/core/npm-registry.d.ts +25 -0
- package/dist/cli/core/npm-registry.d.ts.map +1 -0
- package/dist/cli/core/npm-registry.js +65 -0
- package/dist/cli/core/npm-registry.js.map +1 -0
- package/dist/cli/core/templates.d.ts.map +1 -1
- package/dist/cli/core/templates.js +102 -24
- package/dist/cli/core/templates.js.map +1 -1
- package/dist/cli/core/upgrade.d.ts +29 -0
- package/dist/cli/core/upgrade.d.ts.map +1 -1
- package/dist/cli/core/upgrade.js +413 -15
- package/dist/cli/core/upgrade.js.map +1 -1
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +1 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/shell/components/App.js +1 -1
- package/dist/cli/shell/components/App.js.map +1 -1
- package/dist/cli/shell/components/MessageStream.js +2 -2
- package/dist/cli/shell/components/MessageStream.js.map +1 -1
- package/dist/cli/shell/coordinator.d.ts.map +1 -1
- package/dist/cli/shell/coordinator.js +11 -5
- package/dist/cli/shell/coordinator.js.map +1 -1
- package/dist/cli/shell/index.d.ts.map +1 -1
- package/dist/cli/shell/index.js +14 -7
- package/dist/cli/shell/index.js.map +1 -1
- package/dist/cli/shell/lifecycle.d.ts.map +1 -1
- package/dist/cli/shell/lifecycle.js +12 -7
- package/dist/cli/shell/lifecycle.js.map +1 -1
- package/dist/cli/shell/session-store.d.ts +4 -4
- package/dist/cli/shell/session-store.d.ts.map +1 -1
- package/dist/cli/shell/session-store.js +11 -11
- package/dist/cli/shell/session-store.js.map +1 -1
- package/dist/cli-entry.js +171 -50
- package/dist/cli-entry.js.map +1 -1
- package/package.json +9 -4
- package/scripts/patch-esm-imports.mjs +3 -1
- package/templates/after-agent-reference.md +64 -0
- package/templates/ceremony-reference.md +82 -0
- package/templates/client-compatibility-reference.md +46 -0
- package/templates/copilot-agent.md +96 -0
- package/templates/copilot-instructions.md +14 -0
- package/templates/fact-checker-policy.md +104 -0
- package/templates/model-selection-reference.md +101 -0
- package/templates/prd-intake.md +105 -0
- package/templates/rai-charter.md +110 -0
- package/templates/rai-policy.md +103 -0
- package/templates/ralph-reference.md +141 -0
- package/templates/routing.md +1 -0
- package/templates/scribe-charter.md +18 -151
- package/templates/session-init-reference.md +199 -0
- package/templates/skills/cross-squad/SKILL.md +66 -6
- package/templates/skills/cross-squad-communication/SKILL.md +399 -0
- package/templates/skills/e2e-template-testing/SKILL.md +557 -0
- package/templates/skills/fact-checking/SKILL.md +61 -0
- package/templates/skills/release-process/SKILL.md +2 -2
- package/templates/skills/squad/SKILL.md +299 -0
- package/templates/skills/squad-help/SKILL.md +97 -0
- package/templates/skills/squad-version-check/SKILL.md +169 -0
- package/templates/skills/tiered-memory/SKILL.md +31 -44
- package/templates/spawn-reference.md +131 -0
- package/templates/squad.agent.md.template +306 -618
- package/templates/workflow-wiring-appendix-a-code-reviewer.md +131 -0
- package/templates/workflow-wiring-appendix-b-documenter.md +140 -0
- package/templates/workflow-wiring-guide.md +276 -0
- package/templates/workflows/squad-heartbeat.yml +167 -167
- package/templates/worktree-reference.md +126 -0
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tiered-memory
|
|
3
|
-
description: Three-tier agent memory model (hot/cold/wiki) for
|
|
3
|
+
description: Three-tier agent memory model (hot/cold/wiki) for context reduction per spawn
|
|
4
4
|
domain: memory-management, performance
|
|
5
|
-
confidence:
|
|
6
|
-
source:
|
|
5
|
+
confidence: design (runtime not yet implemented)
|
|
6
|
+
source: design proposal
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Skill: Tiered Agent Memory
|
|
10
10
|
|
|
11
|
+
> **Status (v0.10.0):** This skill describes a **design proposal**, not a shipped runtime. Skill files install via `squad init`/`upgrade`, but the underlying tier scaffolding (`.squad/memory/hot/`, `cold/`, `wiki/`), Scribe promotion logic, and spawn-template tier-aware reads are tracked in [bradygaster/squad#1264](https://github.com/bradygaster/squad/issues/1264). Until those land, agents continue to load full `history.md` + `decisions.md` on every spawn.
|
|
12
|
+
|
|
11
13
|
## Overview
|
|
12
14
|
|
|
13
|
-
Squad agents
|
|
15
|
+
Squad agents today load their full context history on every spawn, which grows unboundedly across sessions. The Tiered Agent Memory model proposes a three-tier separation so agents only load the bytes that are actually relevant to the current task, with older context kept available on demand.
|
|
14
16
|
|
|
15
17
|
---
|
|
16
18
|
|
|
17
19
|
## Memory Tiers
|
|
18
20
|
|
|
19
21
|
### 🔥 Hot Tier — Current Session Context
|
|
20
|
-
- **Size target:** ~2–4KB
|
|
22
|
+
- **Size target:** keep small (~2–4KB typical)
|
|
21
23
|
- **Load policy:** Always loaded. Every spawn includes hot memory by default.
|
|
22
24
|
- **Contents:** Current task description, active decisions made this session, immediate blockers, last 3–5 actions taken, who you are talking to right now.
|
|
23
25
|
- **Lifetime:** Current session only. Discarded after session ends (Scribe promotes relevant parts to Cold).
|
|
24
26
|
- **Purpose:** Provide immediate task context without any latency or load decision.
|
|
25
27
|
|
|
26
28
|
### ❄️ Cold Tier — Summarized Cross-Session History
|
|
27
|
-
- **Size target:** ~8–12KB
|
|
29
|
+
- **Size target:** larger summary, not full transcript (~8–12KB typical)
|
|
28
30
|
- **Load policy:** Load on demand. Include only when the task explicitly needs history.
|
|
29
31
|
- **Contents:** Summarized past sessions (compressed by Scribe), cross-session decisions, recurring patterns, unresolved issues from prior work.
|
|
30
|
-
- **Lifetime:**
|
|
32
|
+
- **Lifetime:** Rolling window (default proposal: 30 days). Eligible entries are then promoted to Wiki.
|
|
31
33
|
- **Purpose:** Answer "what have we tried before?" and "what was decided?" without replaying full transcripts.
|
|
32
34
|
- **How to include:** Pass `--include-cold` in spawn template or add `## Cold Memory` section.
|
|
33
35
|
|
|
@@ -89,49 +91,34 @@ See: .squad/memory/wiki/{topic}.md
|
|
|
89
91
|
|
|
90
92
|
---
|
|
91
93
|
|
|
92
|
-
##
|
|
93
|
-
|
|
94
|
-
Baseline measurements from tamirdresher/tamresearch1 production runs (June 2025):
|
|
95
|
-
|
|
96
|
-
| Agent | Total Context | Old Noise % | Hot-Only Size | Savings |
|
|
97
|
-
|-------|--------------|-------------|---------------|---------|
|
|
98
|
-
| Picard (Lead) | 74KB / 18.5K tokens | 96% | ~3KB | 55% |
|
|
99
|
-
| Scribe | 52KB / 13K tokens | 91% | ~4KB | 48% |
|
|
100
|
-
| Data | 43KB / 10.7K tokens | 88% | ~3.5KB | 42% |
|
|
101
|
-
| Ralph | 38KB / 9.5K tokens | 85% | ~3KB | 38% |
|
|
102
|
-
| Worf | 34KB / 8.5K tokens | 82% | ~3KB | 20% |
|
|
103
|
-
|
|
104
|
-
**Average savings: 20–55% per spawn** with Hot-only loading. Cold + Wiki on-demand adds ~2–8KB when needed, still well below current baselines.
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
## Integration with Scribe Agent
|
|
94
|
+
## Integration with Scribe Agent (design — not yet implemented)
|
|
109
95
|
|
|
110
|
-
Scribe is the memory coordinator for this system.
|
|
96
|
+
Scribe is the proposed memory coordinator for this system. Once the runtime lands, Scribe will:
|
|
111
97
|
|
|
112
|
-
1. **End of session:**
|
|
113
|
-
2. **
|
|
114
|
-
3. **On-demand wiki writes:** Any agent can request Scribe to write a wiki entry mid-session
|
|
98
|
+
1. **End of session:** Compress Hot → Cold summary (target: ~10% of session verbosity)
|
|
99
|
+
2. **Aged cold entries:** Promote Cold → Wiki for decisions/facts that aged into stable knowledge
|
|
100
|
+
3. **On-demand wiki writes:** Any agent can request Scribe to write a wiki entry mid-session
|
|
115
101
|
|
|
116
|
-
|
|
102
|
+
Until then, see the Scribe charter for current behavior: `.squad/agents/scribe/charter.md`
|
|
117
103
|
|
|
118
104
|
---
|
|
119
105
|
|
|
120
|
-
## Implementation Checklist
|
|
106
|
+
## Implementation Checklist (tracked in #1264)
|
|
121
107
|
|
|
122
108
|
- [ ] Scribe writes Hot context file at session start (`.squad/memory/hot/{agent}.md`)
|
|
123
109
|
- [ ] Scribe compresses and writes Cold summary at session end
|
|
124
110
|
- [ ] Spawn templates default to Hot-only
|
|
125
111
|
- [ ] Coordinators add `--include-cold` / `--include-wiki` flags as needed
|
|
126
112
|
- [ ] Wiki entries stored in `.squad/memory/wiki/`
|
|
127
|
-
- [ ] Cold entries stored in `.squad/memory/cold/` with
|
|
113
|
+
- [ ] Cold entries stored in `.squad/memory/cold/` with rolling TTL
|
|
128
114
|
|
|
129
115
|
---
|
|
130
116
|
|
|
131
117
|
## References
|
|
132
118
|
|
|
133
|
-
-
|
|
134
|
-
-
|
|
119
|
+
- Tracking issue: [bradygaster/squad#1264](https://github.com/bradygaster/squad/issues/1264) — installation gap + runtime status
|
|
120
|
+
- Original design spike: [bradygaster/squad#686](https://github.com/bradygaster/squad/issues/686) — tiered memory implementation plan
|
|
121
|
+
- Related: [bradygaster/squad#600](https://github.com/bradygaster/squad/issues/600) — context payload growth
|
|
135
122
|
|
|
136
123
|
---
|
|
137
124
|
|
|
@@ -162,7 +149,7 @@ Use this template when spawning any Squad agent. By default it loads **Hot tier
|
|
|
162
149
|
|
|
163
150
|
### 🔥 Hot (always included)
|
|
164
151
|
|
|
165
|
-
> Paste current session context here (2–4KB
|
|
152
|
+
> Paste current session context here (~2–4KB target):
|
|
166
153
|
|
|
167
154
|
```
|
|
168
155
|
Current task: {task_description}
|
|
@@ -178,12 +165,12 @@ Talking to: {current_interlocutor}
|
|
|
178
165
|
|
|
179
166
|
> Load on demand. Do not inline unless specifically needed.
|
|
180
167
|
|
|
181
|
-
Summarized cross-session history is at:
|
|
168
|
+
Summarized cross-session history is at:
|
|
182
169
|
`.squad/memory/cold/{agent-name}.md`
|
|
183
170
|
|
|
184
171
|
Include when:
|
|
185
172
|
- Resuming interrupted work
|
|
186
|
-
- Debugging a recurring issue
|
|
173
|
+
- Debugging a recurring issue
|
|
187
174
|
- "What have we tried before?"
|
|
188
175
|
|
|
189
176
|
**To load cold memory, add this section and fetch the file before spawning:**
|
|
@@ -218,17 +205,17 @@ Include when:
|
|
|
218
205
|
## Escalation
|
|
219
206
|
|
|
220
207
|
If blocked or uncertain:
|
|
221
|
-
- Architecture questions → @picard
|
|
222
|
-
- Security concerns → @worf
|
|
223
|
-
- Infrastructure/deployment → @belanna
|
|
224
|
-
- Memory/history questions → @scribe
|
|
208
|
+
- Architecture questions → @picard
|
|
209
|
+
- Security concerns → @worf
|
|
210
|
+
- Infrastructure/deployment → @belanna
|
|
211
|
+
- Memory/history questions → @scribe
|
|
225
212
|
|
|
226
213
|
---
|
|
227
214
|
|
|
228
215
|
## Notes
|
|
229
216
|
|
|
230
|
-
- Hot tier is always included
|
|
231
|
-
- Cold adds
|
|
217
|
+
- Hot tier is always included; keep it focused
|
|
218
|
+
- Cold adds a summary; only include when history is relevant
|
|
232
219
|
- Wiki adds variable size; only include specific relevant docs
|
|
233
|
-
-
|
|
234
|
-
|
|
220
|
+
- Runtime backing is tracked in [bradygaster/squad#1264](https://github.com/bradygaster/squad/issues/1264) — until those changes land, this skill is design-only and agents continue to load full history.md + decisions.md on every spawn
|
|
221
|
+
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Spawn Reference
|
|
2
|
+
|
|
3
|
+
### How to Spawn an Agent
|
|
4
|
+
|
|
5
|
+
**You MUST dispatch every agent spawn** via the platform's tool (`task` on CLI, `runSubagent` on VS Code):
|
|
6
|
+
|
|
7
|
+
- **`agent_type`**: `"general-purpose"` (always — this gives agents full tool access)
|
|
8
|
+
- **`mode`**: `"background"` (default) or `"sync"` — use `"background"` for all parallelizable work; use `"sync"` only when the result is needed before the next step can proceed
|
|
9
|
+
- **`description`**: `"{Name}: {brief task summary}"` (e.g., `"Ripley: Design REST API endpoints"`, `"Dallas: Build login form"`) — this is what appears in the UI, so it MUST carry the agent's name and what they're doing
|
|
10
|
+
- **`prompt`**: The full agent prompt (see below)
|
|
11
|
+
|
|
12
|
+
**⚡ Inline the charter.** Before spawning, read the agent's `charter.md` (resolve from team root: `{team_root}/.squad/agents/{name}/charter.md`) and paste its contents directly into the spawn prompt. This eliminates a tool call from the agent's critical path. The agent still reads its own `history.md` and `decisions.md`.
|
|
13
|
+
|
|
14
|
+
**Background spawn (the default):** Use the template below with `mode: "background"`.
|
|
15
|
+
|
|
16
|
+
**Sync spawn (when required):** Use the template below and omit the `mode` parameter (sync is default).
|
|
17
|
+
|
|
18
|
+
> **VS Code equivalent:** Use `runSubagent` with the prompt content below. Drop `agent_type`, `mode`, `model`, and `description` parameters. Multiple subagents in one turn run concurrently. Sync is the default on VS Code.
|
|
19
|
+
|
|
20
|
+
**Template for any agent** (substitute `{Name}`, `{Role}`, `{name}`, and inline the charter):
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
agent_type: "general-purpose"
|
|
24
|
+
model: "{resolved_model}"
|
|
25
|
+
mode: "background"
|
|
26
|
+
name: "{name}"
|
|
27
|
+
description: "{emoji} {Name}: {brief task summary}"
|
|
28
|
+
prompt: |
|
|
29
|
+
You are {Name}, the {Role} on this project.
|
|
30
|
+
|
|
31
|
+
YOUR CHARTER:
|
|
32
|
+
{paste contents of .squad/agents/{name}/charter.md here}
|
|
33
|
+
|
|
34
|
+
TEAM ROOT: {team_root}
|
|
35
|
+
CURRENT_DATETIME: <resolved CURRENT_DATETIME literal>
|
|
36
|
+
All `.squad/` paths are relative to this root.
|
|
37
|
+
|
|
38
|
+
Use the literal CURRENT_DATETIME value from your prompt for dated file content:
|
|
39
|
+
`<literal CURRENT_DATETIME value from your prompt>`. Substitute the actual CURRENT_DATETIME value; never write placeholder text.
|
|
40
|
+
|
|
41
|
+
PERSONAL_AGENT: {true|false} # Whether this is a personal agent
|
|
42
|
+
GHOST_PROTOCOL: {true|false} # Whether ghost protocol applies
|
|
43
|
+
|
|
44
|
+
{If PERSONAL_AGENT is true, append Ghost Protocol rules:}
|
|
45
|
+
## Ghost Protocol
|
|
46
|
+
You are a personal agent operating in a project context. You MUST follow these rules:
|
|
47
|
+
- Read-only project state: Do NOT write to project's .squad/ directory
|
|
48
|
+
- No project ownership: You advise; project agents execute
|
|
49
|
+
- Transparent origin: Tag all logs with [personal:{name}]
|
|
50
|
+
- Consult mode: Provide recommendations, not direct changes
|
|
51
|
+
{end Ghost Protocol block}
|
|
52
|
+
|
|
53
|
+
WORKTREE_PATH: {worktree_path}
|
|
54
|
+
WORKTREE_MODE: {true|false}
|
|
55
|
+
|
|
56
|
+
{% if WORKTREE_MODE %}
|
|
57
|
+
**WORKTREE:** You are working in a dedicated worktree at `{WORKTREE_PATH}`.
|
|
58
|
+
- All file operations should be relative to this path
|
|
59
|
+
- Do NOT switch branches — the worktree IS your branch (`{branch_name}`)
|
|
60
|
+
- Build and test in the worktree, not the main repo
|
|
61
|
+
- Commit and push from the worktree
|
|
62
|
+
{% endif %}
|
|
63
|
+
|
|
64
|
+
STATE_BACKEND: {state_backend}
|
|
65
|
+
|
|
66
|
+
## State Protocol — Runtime State Tools
|
|
67
|
+
Mutable squad state is owned by the runtime. You MUST use the `state.*` tools
|
|
68
|
+
whenever they are available:
|
|
69
|
+
- `squad_state_read` / `squad_state_list` for decisions, history, logs, and inbox entries
|
|
70
|
+
- `squad_state_write` / `squad_state_append` for durable updates
|
|
71
|
+
- `squad_state_delete` after Scribe merges inbox entries
|
|
72
|
+
- `squad_state_health` when diagnosing backend availability
|
|
73
|
+
- `squad_decide` for team-relevant decisions
|
|
74
|
+
|
|
75
|
+
The runtime routes those calls to the configured backend (`{state_backend}`), including
|
|
76
|
+
git-native backends. Do NOT run backend git commands, switch to a state branch, push
|
|
77
|
+
note refs, or write mutable `.squad/` state files by hand. Static config (charters,
|
|
78
|
+
team.md, routing.md, skills) remains on disk and may be read with normal file tools.
|
|
79
|
+
|
|
80
|
+
Read `agents/{name}/history.md` with `squad_state_read` when state tools are available; otherwise fall back to `.squad/agents/{name}/history.md`.
|
|
81
|
+
Read `decisions.md` with `squad_state_read` when state tools are available; otherwise fall back to `.squad/decisions.md`.
|
|
82
|
+
If .squad/identity/wisdom.md exists, read it before starting work.
|
|
83
|
+
If .squad/identity/now.md exists, read it at spawn time.
|
|
84
|
+
Check project skill directories (.squad/skills/, .github/skills/, .copilot/skills/, .claude/skills/, .agents/skills/) for any SKILL.md the coordinator attached to your prompt.
|
|
85
|
+
Read any relevant SKILL.md files before working.
|
|
86
|
+
|
|
87
|
+
⚠️ WORK FRESHNESS: When determining what to work on:
|
|
88
|
+
- If an external tracker is configured (GitHub Issues, GitLab Issues, Azure DevOps),
|
|
89
|
+
ALWAYS query it for current open/active items. The tracker is the authoritative
|
|
90
|
+
source of truth — local plan files and checkboxes are advisory only.
|
|
91
|
+
- If .squad/identity/now.md has a `last_verified` timestamp older than your session
|
|
92
|
+
start, re-verify the current focus against the tracker before acting.
|
|
93
|
+
- NEVER work on items marked closed/done in the tracker, even if local files
|
|
94
|
+
suggest they are incomplete.
|
|
95
|
+
|
|
96
|
+
{only if MCP tools detected — omit entirely if none:}
|
|
97
|
+
MCP TOOLS: {service}: ✅ ({tools}) | ❌. Fall back to CLI when unavailable.
|
|
98
|
+
{end MCP block}
|
|
99
|
+
|
|
100
|
+
**Requested by:** {current user name}
|
|
101
|
+
|
|
102
|
+
INPUT ARTIFACTS: {list exact file paths to review/modify}
|
|
103
|
+
|
|
104
|
+
The user says: "{message}"
|
|
105
|
+
|
|
106
|
+
Do the work. Respond as {Name}.
|
|
107
|
+
|
|
108
|
+
⚠️ OUTPUT: Report outcomes in human terms. Never expose tool internals or SQL.
|
|
109
|
+
⚠️ DATES: When writing dates in any file (decisions, history, logs), use ONLY the CURRENT_DATETIME value above. Never infer or guess the date.
|
|
110
|
+
|
|
111
|
+
AFTER work (BEST-EFFORT — do NOT retry on failure):
|
|
112
|
+
⚠️ POST-WORK BUDGET: Spend at most 20 tool calls on post-work steps below.
|
|
113
|
+
If you are running low on context or have used 60+ tool calls on primary work,
|
|
114
|
+
skip post-work entirely -- Scribe handles it independently.
|
|
115
|
+
1. APPEND learnings with `squad_state_append` to `agents/{name}/history.md`.
|
|
116
|
+
Include architecture decisions, patterns, user preferences, and key file paths.
|
|
117
|
+
Use `<literal CURRENT_DATETIME value from your prompt>` as the entry timestamp.
|
|
118
|
+
Substitute the actual CURRENT_DATETIME value; do not write placeholder text.
|
|
119
|
+
2. If you made a team-relevant decision, call `squad_decide`. If that tool is
|
|
120
|
+
unavailable, use `squad_state_write` to `decisions/inbox/{name}-{brief-slug}.md`.
|
|
121
|
+
3. If state tools are unavailable, skip post-work state persistence and report the
|
|
122
|
+
backend/tool availability problem in your final summary.
|
|
123
|
+
4. SKILL EXTRACTION is handled by Scribe — do NOT attempt it yourself.
|
|
124
|
+
|
|
125
|
+
⚠️ STOP ON FAILURE: If ANY post-work step fails (git conflict, file not found,
|
|
126
|
+
permission error), SKIP it and move on. Do NOT retry. Scribe handles cleanup
|
|
127
|
+
independently. Your primary deliverable is already done — post-work is optional.
|
|
128
|
+
|
|
129
|
+
⚠️ RESPONSE ORDER: After ALL tool calls, write a 2-3 sentence plain text
|
|
130
|
+
summary as your FINAL output. No tool calls after this summary.
|
|
131
|
+
```
|