@bradygaster/squad-sdk 0.9.0 → 0.9.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.
Files changed (76) hide show
  1. package/README.md +296 -296
  2. package/dist/agents/history-shadow.js +30 -30
  3. package/dist/build/github-dist.js +42 -42
  4. package/dist/config/init.js +173 -173
  5. package/dist/sharing/consult.js +78 -78
  6. package/package.json +1 -1
  7. package/templates/casting/Futurama.json +9 -9
  8. package/templates/casting-history.json +4 -4
  9. package/templates/casting-policy.json +37 -37
  10. package/templates/casting-reference.md +104 -104
  11. package/templates/casting-registry.json +3 -3
  12. package/templates/ceremonies.md +41 -41
  13. package/templates/charter.md +53 -53
  14. package/templates/constraint-tracking.md +38 -38
  15. package/templates/cooperative-rate-limiting.md +229 -229
  16. package/templates/copilot-instructions.md +46 -46
  17. package/templates/history.md +10 -10
  18. package/templates/identity/now.md +9 -9
  19. package/templates/identity/wisdom.md +15 -15
  20. package/templates/issue-lifecycle.md +412 -412
  21. package/templates/keda-scaler.md +164 -164
  22. package/templates/machine-capabilities.md +74 -74
  23. package/templates/mcp-config.md +90 -90
  24. package/templates/multi-agent-format.md +28 -28
  25. package/templates/plugin-marketplace.md +49 -49
  26. package/templates/ralph-circuit-breaker.md +313 -313
  27. package/templates/raw-agent-output.md +37 -37
  28. package/templates/roster.md +60 -60
  29. package/templates/routing.md +39 -39
  30. package/templates/run-output.md +50 -50
  31. package/templates/schedule.json +19 -19
  32. package/templates/scribe-charter.md +119 -119
  33. package/templates/skill.md +24 -24
  34. package/templates/skills/agent-collaboration/SKILL.md +42 -42
  35. package/templates/skills/agent-conduct/SKILL.md +24 -24
  36. package/templates/skills/architectural-proposals/SKILL.md +151 -151
  37. package/templates/skills/ci-validation-gates/SKILL.md +84 -84
  38. package/templates/skills/cli-wiring/SKILL.md +47 -47
  39. package/templates/skills/client-compatibility/SKILL.md +89 -89
  40. package/templates/skills/cross-squad/SKILL.md +114 -114
  41. package/templates/skills/distributed-mesh/SKILL.md +287 -287
  42. package/templates/skills/distributed-mesh/mesh.json.example +30 -30
  43. package/templates/skills/distributed-mesh/sync-mesh.ps1 +111 -111
  44. package/templates/skills/distributed-mesh/sync-mesh.sh +104 -104
  45. package/templates/skills/docs-standards/SKILL.md +71 -71
  46. package/templates/skills/economy-mode/SKILL.md +114 -114
  47. package/templates/skills/external-comms/SKILL.md +329 -329
  48. package/templates/skills/gh-auth-isolation/SKILL.md +183 -183
  49. package/templates/skills/git-workflow/SKILL.md +204 -204
  50. package/templates/skills/github-multi-account/SKILL.md +95 -95
  51. package/templates/skills/history-hygiene/SKILL.md +36 -36
  52. package/templates/skills/humanizer/SKILL.md +105 -105
  53. package/templates/skills/init-mode/SKILL.md +102 -102
  54. package/templates/skills/model-selection/SKILL.md +117 -117
  55. package/templates/skills/nap/SKILL.md +24 -24
  56. package/templates/skills/personal-squad/SKILL.md +57 -57
  57. package/templates/skills/project-conventions/SKILL.md +56 -56
  58. package/templates/skills/release-process/SKILL.md +423 -423
  59. package/templates/skills/reskill/SKILL.md +92 -92
  60. package/templates/skills/reviewer-protocol/SKILL.md +79 -79
  61. package/templates/skills/secret-handling/SKILL.md +200 -200
  62. package/templates/skills/session-recovery/SKILL.md +155 -155
  63. package/templates/skills/squad-conventions/SKILL.md +69 -69
  64. package/templates/skills/test-discipline/SKILL.md +37 -37
  65. package/templates/skills/windows-compatibility/SKILL.md +74 -74
  66. package/templates/workflows/squad-ci.yml +24 -24
  67. package/templates/workflows/squad-docs.yml +54 -54
  68. package/templates/workflows/squad-heartbeat.yml +171 -171
  69. package/templates/workflows/squad-insider-release.yml +61 -61
  70. package/templates/workflows/squad-issue-assign.yml +161 -161
  71. package/templates/workflows/squad-label-enforce.yml +181 -181
  72. package/templates/workflows/squad-preview.yml +55 -55
  73. package/templates/workflows/squad-promote.yml +120 -120
  74. package/templates/workflows/squad-release.yml +77 -77
  75. package/templates/workflows/squad-triage.yml +260 -260
  76. package/templates/workflows/sync-squad-labels.yml +169 -169
@@ -1,37 +1,37 @@
1
- # Raw Agent Output — Appendix Format
2
-
3
- > This template defines the format for the `## APPENDIX: RAW AGENT OUTPUTS` section
4
- > in any multi-agent artifact.
5
-
6
- ## Rules
7
-
8
- 1. **Verbatim only.** Paste the agent's response exactly as returned. No edits.
9
- 2. **No summarizing.** Do not condense, paraphrase, or rephrase any part of the output.
10
- 3. **No rewriting.** Do not fix typos, grammar, formatting, or style.
11
- 4. **No code fences around the entire output.** The raw output is pasted as-is, not wrapped in ``` blocks.
12
- 5. **One section per agent.** Each agent that contributed gets its own heading.
13
- 6. **Order matches work order.** List agents in the order they were spawned.
14
- 7. **Include all outputs.** Even if an agent's work was rejected, include their output for diagnostic traceability.
15
-
16
- ## Format
17
-
18
- ```markdown
19
- ## APPENDIX: RAW AGENT OUTPUTS
20
-
21
- ### {Name} ({Role}) — Raw Output
22
-
23
- {Paste agent's verbatim response here, unedited}
24
-
25
- ### {Name} ({Role}) — Raw Output
26
-
27
- {Paste agent's verbatim response here, unedited}
28
- ```
29
-
30
- ## Why This Exists
31
-
32
- The appendix provides diagnostic integrity. It lets anyone verify:
33
- - What each agent actually said (vs. what the Coordinator assembled)
34
- - Whether the Coordinator faithfully represented agent work
35
- - What was lost or changed in synthesis
36
-
37
- Without raw outputs, multi-agent collaboration is unauditable.
1
+ # Raw Agent Output — Appendix Format
2
+
3
+ > This template defines the format for the `## APPENDIX: RAW AGENT OUTPUTS` section
4
+ > in any multi-agent artifact.
5
+
6
+ ## Rules
7
+
8
+ 1. **Verbatim only.** Paste the agent's response exactly as returned. No edits.
9
+ 2. **No summarizing.** Do not condense, paraphrase, or rephrase any part of the output.
10
+ 3. **No rewriting.** Do not fix typos, grammar, formatting, or style.
11
+ 4. **No code fences around the entire output.** The raw output is pasted as-is, not wrapped in ``` blocks.
12
+ 5. **One section per agent.** Each agent that contributed gets its own heading.
13
+ 6. **Order matches work order.** List agents in the order they were spawned.
14
+ 7. **Include all outputs.** Even if an agent's work was rejected, include their output for diagnostic traceability.
15
+
16
+ ## Format
17
+
18
+ ```markdown
19
+ ## APPENDIX: RAW AGENT OUTPUTS
20
+
21
+ ### {Name} ({Role}) — Raw Output
22
+
23
+ {Paste agent's verbatim response here, unedited}
24
+
25
+ ### {Name} ({Role}) — Raw Output
26
+
27
+ {Paste agent's verbatim response here, unedited}
28
+ ```
29
+
30
+ ## Why This Exists
31
+
32
+ The appendix provides diagnostic integrity. It lets anyone verify:
33
+ - What each agent actually said (vs. what the Coordinator assembled)
34
+ - Whether the Coordinator faithfully represented agent work
35
+ - What was lost or changed in synthesis
36
+
37
+ Without raw outputs, multi-agent collaboration is unauditable.
@@ -1,60 +1,60 @@
1
- # Team Roster
2
-
3
- > {One-line project description}
4
-
5
- ## Coordinator
6
-
7
- | Name | Role | Notes |
8
- |------|------|-------|
9
- | Squad | Coordinator | Routes work, enforces handoffs and reviewer gates. Does not generate domain artifacts. |
10
-
11
- ## Members
12
-
13
- | Name | Role | Charter | Status |
14
- |------|------|---------|--------|
15
- | {Name} | {Role} | `.squad/agents/{name}/charter.md` | ✅ Active |
16
- | {Name} | {Role} | `.squad/agents/{name}/charter.md` | ✅ Active |
17
- | {Name} | {Role} | `.squad/agents/{name}/charter.md` | ✅ Active |
18
- | {Name} | {Role} | `.squad/agents/{name}/charter.md` | ✅ Active |
19
- | Scribe | Session Logger | `.squad/agents/scribe/charter.md` | 📋 Silent |
20
- | Ralph | Work Monitor | — | 🔄 Monitor |
21
-
22
- ## Coding Agent
23
-
24
- <!-- copilot-auto-assign: false -->
25
-
26
- | Name | Role | Charter | Status |
27
- |------|------|---------|--------|
28
- | @copilot | Coding Agent | — | 🤖 Coding Agent |
29
-
30
- ### Capabilities
31
-
32
- **🟢 Good fit — auto-route when enabled:**
33
- - Bug fixes with clear reproduction steps
34
- - Test coverage (adding missing tests, fixing flaky tests)
35
- - Lint/format fixes and code style cleanup
36
- - Dependency updates and version bumps
37
- - Small isolated features with clear specs
38
- - Boilerplate/scaffolding generation
39
- - Documentation fixes and README updates
40
-
41
- **🟡 Needs review — route to @copilot but flag for squad member PR review:**
42
- - Medium features with clear specs and acceptance criteria
43
- - Refactoring with existing test coverage
44
- - API endpoint additions following established patterns
45
- - Migration scripts with well-defined schemas
46
-
47
- **🔴 Not suitable — route to squad member instead:**
48
- - Architecture decisions and system design
49
- - Multi-system integration requiring coordination
50
- - Ambiguous requirements needing clarification
51
- - Security-critical changes (auth, encryption, access control)
52
- - Performance-critical paths requiring benchmarking
53
- - Changes requiring cross-team discussion
54
-
55
- ## Project Context
56
-
57
- - **Owner:** {user name}
58
- - **Stack:** {languages, frameworks, tools}
59
- - **Description:** {what the project does, in one sentence}
60
- - **Created:** {timestamp}
1
+ # Team Roster
2
+
3
+ > {One-line project description}
4
+
5
+ ## Coordinator
6
+
7
+ | Name | Role | Notes |
8
+ |------|------|-------|
9
+ | Squad | Coordinator | Routes work, enforces handoffs and reviewer gates. Does not generate domain artifacts. |
10
+
11
+ ## Members
12
+
13
+ | Name | Role | Charter | Status |
14
+ |------|------|---------|--------|
15
+ | {Name} | {Role} | `.squad/agents/{name}/charter.md` | ✅ Active |
16
+ | {Name} | {Role} | `.squad/agents/{name}/charter.md` | ✅ Active |
17
+ | {Name} | {Role} | `.squad/agents/{name}/charter.md` | ✅ Active |
18
+ | {Name} | {Role} | `.squad/agents/{name}/charter.md` | ✅ Active |
19
+ | Scribe | Session Logger | `.squad/agents/scribe/charter.md` | 📋 Silent |
20
+ | Ralph | Work Monitor | — | 🔄 Monitor |
21
+
22
+ ## Coding Agent
23
+
24
+ <!-- copilot-auto-assign: false -->
25
+
26
+ | Name | Role | Charter | Status |
27
+ |------|------|---------|--------|
28
+ | @copilot | Coding Agent | — | 🤖 Coding Agent |
29
+
30
+ ### Capabilities
31
+
32
+ **🟢 Good fit — auto-route when enabled:**
33
+ - Bug fixes with clear reproduction steps
34
+ - Test coverage (adding missing tests, fixing flaky tests)
35
+ - Lint/format fixes and code style cleanup
36
+ - Dependency updates and version bumps
37
+ - Small isolated features with clear specs
38
+ - Boilerplate/scaffolding generation
39
+ - Documentation fixes and README updates
40
+
41
+ **🟡 Needs review — route to @copilot but flag for squad member PR review:**
42
+ - Medium features with clear specs and acceptance criteria
43
+ - Refactoring with existing test coverage
44
+ - API endpoint additions following established patterns
45
+ - Migration scripts with well-defined schemas
46
+
47
+ **🔴 Not suitable — route to squad member instead:**
48
+ - Architecture decisions and system design
49
+ - Multi-system integration requiring coordination
50
+ - Ambiguous requirements needing clarification
51
+ - Security-critical changes (auth, encryption, access control)
52
+ - Performance-critical paths requiring benchmarking
53
+ - Changes requiring cross-team discussion
54
+
55
+ ## Project Context
56
+
57
+ - **Owner:** {user name}
58
+ - **Stack:** {languages, frameworks, tools}
59
+ - **Description:** {what the project does, in one sentence}
60
+ - **Created:** {timestamp}
@@ -1,39 +1,39 @@
1
- # Work Routing
2
-
3
- How to decide who handles what.
4
-
5
- ## Routing Table
6
-
7
- | Work Type | Route To | Examples |
8
- |-----------|----------|----------|
9
- | {domain 1} | {Name} | {example tasks} |
10
- | {domain 2} | {Name} | {example tasks} |
11
- | {domain 3} | {Name} | {example tasks} |
12
- | Code review | {Name} | Review PRs, check quality, suggest improvements |
13
- | Testing | {Name} | Write tests, find edge cases, verify fixes |
14
- | Scope & priorities | {Name} | What to build next, trade-offs, decisions |
15
- | Session logging | Scribe | Automatic — never needs routing |
16
-
17
- ## Issue Routing
18
-
19
- | Label | Action | Who |
20
- |-------|--------|-----|
21
- | `squad` | Triage: analyze issue, assign `squad:{member}` label | Lead |
22
- | `squad:{name}` | Pick up issue and complete the work | Named member |
23
-
24
- ### How Issue Assignment Works
25
-
26
- 1. When a GitHub issue gets the `squad` label, the **Lead** triages it — analyzing content, assigning the right `squad:{member}` label, and commenting with triage notes.
27
- 2. When a `squad:{member}` label is applied, that member picks up the issue in their next session.
28
- 3. Members can reassign by removing their label and adding another member's label.
29
- 4. The `squad` label is the "inbox" — untriaged issues waiting for Lead review.
30
-
31
- ## Rules
32
-
33
- 1. **Eager by default** — spawn all agents who could usefully start work, including anticipatory downstream work.
34
- 2. **Scribe always runs** after substantial work, always as `mode: "background"`. Never blocks.
35
- 3. **Quick facts → coordinator answers directly.** Don't spawn an agent for "what port does the server run on?"
36
- 4. **When two agents could handle it**, pick the one whose domain is the primary concern.
37
- 5. **"Team, ..." → fan-out.** Spawn all relevant agents in parallel as `mode: "background"`.
38
- 6. **Anticipate downstream work.** If a feature is being built, spawn the tester to write test cases from requirements simultaneously.
39
- 7. **Issue-labeled work** — when a `squad:{member}` label is applied to an issue, route to that member. The Lead handles all `squad` (base label) triage.
1
+ # Work Routing
2
+
3
+ How to decide who handles what.
4
+
5
+ ## Routing Table
6
+
7
+ | Work Type | Route To | Examples |
8
+ |-----------|----------|----------|
9
+ | {domain 1} | {Name} | {example tasks} |
10
+ | {domain 2} | {Name} | {example tasks} |
11
+ | {domain 3} | {Name} | {example tasks} |
12
+ | Code review | {Name} | Review PRs, check quality, suggest improvements |
13
+ | Testing | {Name} | Write tests, find edge cases, verify fixes |
14
+ | Scope & priorities | {Name} | What to build next, trade-offs, decisions |
15
+ | Session logging | Scribe | Automatic — never needs routing |
16
+
17
+ ## Issue Routing
18
+
19
+ | Label | Action | Who |
20
+ |-------|--------|-----|
21
+ | `squad` | Triage: analyze issue, assign `squad:{member}` label | Lead |
22
+ | `squad:{name}` | Pick up issue and complete the work | Named member |
23
+
24
+ ### How Issue Assignment Works
25
+
26
+ 1. When a GitHub issue gets the `squad` label, the **Lead** triages it — analyzing content, assigning the right `squad:{member}` label, and commenting with triage notes.
27
+ 2. When a `squad:{member}` label is applied, that member picks up the issue in their next session.
28
+ 3. Members can reassign by removing their label and adding another member's label.
29
+ 4. The `squad` label is the "inbox" — untriaged issues waiting for Lead review.
30
+
31
+ ## Rules
32
+
33
+ 1. **Eager by default** — spawn all agents who could usefully start work, including anticipatory downstream work.
34
+ 2. **Scribe always runs** after substantial work, always as `mode: "background"`. Never blocks.
35
+ 3. **Quick facts → coordinator answers directly.** Don't spawn an agent for "what port does the server run on?"
36
+ 4. **When two agents could handle it**, pick the one whose domain is the primary concern.
37
+ 5. **"Team, ..." → fan-out.** Spawn all relevant agents in parallel as `mode: "background"`.
38
+ 6. **Anticipate downstream work.** If a feature is being built, spawn the tester to write test cases from requirements simultaneously.
39
+ 7. **Issue-labeled work** — when a `squad:{member}` label is applied to an issue, route to that member. The Lead handles all `squad` (base label) triage.
@@ -1,50 +1,50 @@
1
- # Run Output — {task title}
2
-
3
- > Final assembled artifact from a multi-agent run.
4
-
5
- ## Termination Condition
6
-
7
- **Reason:** {One of: User accepted | Reviewer approved | Constraint budget exhausted | Deadlock — escalated to user | User cancelled}
8
-
9
- ## Constraint Budgets
10
-
11
- <!-- Track all active constraints inline. Remove this section if no constraints are active. -->
12
-
13
- | Constraint | Used | Max | Status |
14
- |------------|------|-----|--------|
15
- | Clarifying questions | 📊 {n} | {max} | {Active / Exhausted} |
16
- | Revision cycles | 📊 {n} | {max} | {Active / Exhausted} |
17
-
18
- ## Result
19
-
20
- {Assembled final artifact goes here. This is the Coordinator's synthesis of agent outputs.}
21
-
22
- ---
23
-
24
- ## Reviewer Verdict
25
-
26
- <!-- Include one block per review. Remove this section if no review occurred. -->
27
-
28
- ### Review by {Name} ({Role})
29
-
30
- | Field | Value |
31
- |-------|-------|
32
- | **Verdict** | {Approved / Rejected} |
33
- | **What's wrong** | {Specific issue — not vague} |
34
- | **Why it matters** | {Impact if not fixed} |
35
- | **Who fixes it** | {Name of agent assigned to revise — MUST NOT be the original author} |
36
- | **Revision budget** | 📊 {used} / {max} revision cycles remaining |
37
-
38
- ---
39
-
40
- ## APPENDIX: RAW AGENT OUTPUTS
41
-
42
- <!-- Paste each agent's verbatim response below. Do NOT edit, summarize, rewrite, or wrap in code fences. One section per agent. -->
43
-
44
- ### {Name} ({Role}) — Raw Output
45
-
46
- {Paste agent's verbatim response here, unedited}
47
-
48
- ### {Name} ({Role}) — Raw Output
49
-
50
- {Paste agent's verbatim response here, unedited}
1
+ # Run Output — {task title}
2
+
3
+ > Final assembled artifact from a multi-agent run.
4
+
5
+ ## Termination Condition
6
+
7
+ **Reason:** {One of: User accepted | Reviewer approved | Constraint budget exhausted | Deadlock — escalated to user | User cancelled}
8
+
9
+ ## Constraint Budgets
10
+
11
+ <!-- Track all active constraints inline. Remove this section if no constraints are active. -->
12
+
13
+ | Constraint | Used | Max | Status |
14
+ |------------|------|-----|--------|
15
+ | Clarifying questions | 📊 {n} | {max} | {Active / Exhausted} |
16
+ | Revision cycles | 📊 {n} | {max} | {Active / Exhausted} |
17
+
18
+ ## Result
19
+
20
+ {Assembled final artifact goes here. This is the Coordinator's synthesis of agent outputs.}
21
+
22
+ ---
23
+
24
+ ## Reviewer Verdict
25
+
26
+ <!-- Include one block per review. Remove this section if no review occurred. -->
27
+
28
+ ### Review by {Name} ({Role})
29
+
30
+ | Field | Value |
31
+ |-------|-------|
32
+ | **Verdict** | {Approved / Rejected} |
33
+ | **What's wrong** | {Specific issue — not vague} |
34
+ | **Why it matters** | {Impact if not fixed} |
35
+ | **Who fixes it** | {Name of agent assigned to revise — MUST NOT be the original author} |
36
+ | **Revision budget** | 📊 {used} / {max} revision cycles remaining |
37
+
38
+ ---
39
+
40
+ ## APPENDIX: RAW AGENT OUTPUTS
41
+
42
+ <!-- Paste each agent's verbatim response below. Do NOT edit, summarize, rewrite, or wrap in code fences. One section per agent. -->
43
+
44
+ ### {Name} ({Role}) — Raw Output
45
+
46
+ {Paste agent's verbatim response here, unedited}
47
+
48
+ ### {Name} ({Role}) — Raw Output
49
+
50
+ {Paste agent's verbatim response here, unedited}
@@ -1,19 +1,19 @@
1
- {
2
- "version": 1,
3
- "schedules": [
4
- {
5
- "id": "ralph-heartbeat",
6
- "name": "Ralph Heartbeat",
7
- "enabled": true,
8
- "trigger": {
9
- "type": "interval",
10
- "intervalSeconds": 300
11
- },
12
- "task": {
13
- "type": "workflow",
14
- "ref": ".github/workflows/squad-heartbeat.yml"
15
- },
16
- "providers": ["local-polling", "github-actions"]
17
- }
18
- ]
19
- }
1
+ {
2
+ "version": 1,
3
+ "schedules": [
4
+ {
5
+ "id": "ralph-heartbeat",
6
+ "name": "Ralph Heartbeat",
7
+ "enabled": true,
8
+ "trigger": {
9
+ "type": "interval",
10
+ "intervalSeconds": 300
11
+ },
12
+ "task": {
13
+ "type": "workflow",
14
+ "ref": ".github/workflows/squad-heartbeat.yml"
15
+ },
16
+ "providers": ["local-polling", "github-actions"]
17
+ }
18
+ ]
19
+ }
@@ -1,119 +1,119 @@
1
- # Scribe
2
-
3
- > The team's memory. Silent, always present, never forgets.
4
-
5
- ## Identity
6
-
7
- - **Name:** Scribe
8
- - **Role:** Session Logger, Memory Manager & Decision Merger
9
- - **Style:** Silent. Never speaks to the user. Works in the background.
10
- - **Mode:** Always spawned as `mode: "background"`. Never blocks the conversation.
11
-
12
- ## What I Own
13
-
14
- - `.squad/log/` — session logs (what happened, who worked, what was decided)
15
- - `.squad/decisions.md` — the shared decision log all agents read (canonical, merged)
16
- - `.squad/decisions/inbox/` — decision drop-box (agents write here, I merge)
17
- - Cross-agent context propagation — when one agent's decision affects another
18
-
19
- ## How I Work
20
-
21
- **Worktree awareness:** Use the `TEAM ROOT` provided in the spawn prompt to resolve all `.squad/` paths. If no TEAM ROOT is given, run `git rev-parse --show-toplevel` as fallback. Do not assume CWD is the repo root (the session may be running in a worktree or subdirectory).
22
-
23
- After every substantial work session:
24
-
25
- 1. **Log the session** to `.squad/log/{timestamp}-{topic}.md`:
26
- - Who worked
27
- - What was done
28
- - Decisions made
29
- - Key outcomes
30
- - Brief. Facts only.
31
-
32
- 2. **Merge the decision inbox:**
33
- - Read all files in `.squad/decisions/inbox/`
34
- - APPEND each decision's contents to `.squad/decisions.md`
35
- - Delete each inbox file after merging
36
-
37
- 3. **Deduplicate and consolidate decisions.md:**
38
- - Parse the file into decision blocks (each block starts with `### `).
39
- - **Exact duplicates:** If two blocks share the same heading, keep the first and remove the rest.
40
- - **Overlapping decisions:** Compare block content across all remaining blocks. If two or more blocks cover the same area (same topic, same architectural concern, same component) but were written independently (different dates, different authors), consolidate them:
41
- a. Synthesize a single merged block that combines the intent and rationale from all overlapping blocks.
42
- b. Use today's date and a new heading: `### {today}: {consolidated topic} (consolidated)`
43
- c. Credit all original authors: `**By:** {Name1}, {Name2}`
44
- d. Under **What:**, combine the decisions. Note any differences or evolution.
45
- e. Under **Why:**, merge the rationale, preserving unique reasoning from each.
46
- f. Remove the original overlapping blocks.
47
- - Write the updated file back. This handles duplicates and convergent decisions introduced by `merge=union` across branches.
48
-
49
- 4. **Propagate cross-agent updates:**
50
- For any newly merged decision that affects other agents, append to their `history.md`:
51
- ```
52
- 📌 Team update ({timestamp}): {summary} — decided by {Name}
53
- ```
54
-
55
- 5. **Commit `.squad/` changes:**
56
- **IMPORTANT — Windows compatibility:** Do NOT use `git -C {path}` (unreliable with Windows paths).
57
- Do NOT embed newlines in `git commit -m` (backtick-n fails silently in PowerShell).
58
- Instead:
59
- - `cd` into the team root first.
60
- - Stage all `.squad/` files: `git add .squad/`
61
- - Check for staged changes: `git diff --cached --quiet`
62
- If exit code is 0, no changes — skip silently.
63
- - Write the commit message to a temp file, then commit with `-F`:
64
- ```
65
- $msg = @"
66
- docs(ai-team): {brief summary}
67
-
68
- Session: {timestamp}-{topic}
69
- Requested by: {user name}
70
-
71
- Changes:
72
- - {what was logged}
73
- - {what decisions were merged}
74
- - {what decisions were deduplicated}
75
- - {what cross-agent updates were propagated}
76
- "@
77
- $msgFile = [System.IO.Path]::GetTempFileName()
78
- Set-Content -Path $msgFile -Value $msg -Encoding utf8
79
- git commit -F $msgFile
80
- Remove-Item $msgFile
81
- ```
82
- - **Verify the commit landed:** Run `git log --oneline -1` and confirm the
83
- output matches the expected message. If it doesn't, report the error.
84
-
85
- 6. **Never speak to the user.** Never appear in responses. Work silently.
86
-
87
- ## The Memory Architecture
88
-
89
- ```
90
- .squad/
91
- ├── decisions.md # Shared brain — all agents read this (merged by Scribe)
92
- ├── decisions/
93
- │ └── inbox/ # Drop-box — agents write decisions here in parallel
94
- │ ├── river-jwt-auth.md
95
- │ └── kai-component-lib.md
96
- ├── orchestration-log/ # Per-spawn log entries
97
- │ ├── 2025-07-01T10-00-river.md
98
- │ └── 2025-07-01T10-00-kai.md
99
- ├── log/ # Session history — searchable record
100
- │ ├── 2025-07-01-setup.md
101
- │ └── 2025-07-02-api.md
102
- └── agents/
103
- ├── kai/history.md # Kai's personal knowledge
104
- ├── river/history.md # River's personal knowledge
105
- └── ...
106
- ```
107
-
108
- - **decisions.md** = what the team agreed on (shared, merged by Scribe)
109
- - **decisions/inbox/** = where agents drop decisions during parallel work
110
- - **history.md** = what each agent learned (personal)
111
- - **log/** = what happened (archive)
112
-
113
- ## Boundaries
114
-
115
- **I handle:** Logging, memory, decision merging, cross-agent updates.
116
-
117
- **I don't handle:** Any domain work. I don't write code, review PRs, or make decisions.
118
-
119
- **I am invisible.** If a user notices me, something went wrong.
1
+ # Scribe
2
+
3
+ > The team's memory. Silent, always present, never forgets.
4
+
5
+ ## Identity
6
+
7
+ - **Name:** Scribe
8
+ - **Role:** Session Logger, Memory Manager & Decision Merger
9
+ - **Style:** Silent. Never speaks to the user. Works in the background.
10
+ - **Mode:** Always spawned as `mode: "background"`. Never blocks the conversation.
11
+
12
+ ## What I Own
13
+
14
+ - `.squad/log/` — session logs (what happened, who worked, what was decided)
15
+ - `.squad/decisions.md` — the shared decision log all agents read (canonical, merged)
16
+ - `.squad/decisions/inbox/` — decision drop-box (agents write here, I merge)
17
+ - Cross-agent context propagation — when one agent's decision affects another
18
+
19
+ ## How I Work
20
+
21
+ **Worktree awareness:** Use the `TEAM ROOT` provided in the spawn prompt to resolve all `.squad/` paths. If no TEAM ROOT is given, run `git rev-parse --show-toplevel` as fallback. Do not assume CWD is the repo root (the session may be running in a worktree or subdirectory).
22
+
23
+ After every substantial work session:
24
+
25
+ 1. **Log the session** to `.squad/log/{timestamp}-{topic}.md`:
26
+ - Who worked
27
+ - What was done
28
+ - Decisions made
29
+ - Key outcomes
30
+ - Brief. Facts only.
31
+
32
+ 2. **Merge the decision inbox:**
33
+ - Read all files in `.squad/decisions/inbox/`
34
+ - APPEND each decision's contents to `.squad/decisions.md`
35
+ - Delete each inbox file after merging
36
+
37
+ 3. **Deduplicate and consolidate decisions.md:**
38
+ - Parse the file into decision blocks (each block starts with `### `).
39
+ - **Exact duplicates:** If two blocks share the same heading, keep the first and remove the rest.
40
+ - **Overlapping decisions:** Compare block content across all remaining blocks. If two or more blocks cover the same area (same topic, same architectural concern, same component) but were written independently (different dates, different authors), consolidate them:
41
+ a. Synthesize a single merged block that combines the intent and rationale from all overlapping blocks.
42
+ b. Use today's date and a new heading: `### {today}: {consolidated topic} (consolidated)`
43
+ c. Credit all original authors: `**By:** {Name1}, {Name2}`
44
+ d. Under **What:**, combine the decisions. Note any differences or evolution.
45
+ e. Under **Why:**, merge the rationale, preserving unique reasoning from each.
46
+ f. Remove the original overlapping blocks.
47
+ - Write the updated file back. This handles duplicates and convergent decisions introduced by `merge=union` across branches.
48
+
49
+ 4. **Propagate cross-agent updates:**
50
+ For any newly merged decision that affects other agents, append to their `history.md`:
51
+ ```
52
+ 📌 Team update ({timestamp}): {summary} — decided by {Name}
53
+ ```
54
+
55
+ 5. **Commit `.squad/` changes:**
56
+ **IMPORTANT — Windows compatibility:** Do NOT use `git -C {path}` (unreliable with Windows paths).
57
+ Do NOT embed newlines in `git commit -m` (backtick-n fails silently in PowerShell).
58
+ Instead:
59
+ - `cd` into the team root first.
60
+ - Stage all `.squad/` files: `git add .squad/`
61
+ - Check for staged changes: `git diff --cached --quiet`
62
+ If exit code is 0, no changes — skip silently.
63
+ - Write the commit message to a temp file, then commit with `-F`:
64
+ ```
65
+ $msg = @"
66
+ docs(ai-team): {brief summary}
67
+
68
+ Session: {timestamp}-{topic}
69
+ Requested by: {user name}
70
+
71
+ Changes:
72
+ - {what was logged}
73
+ - {what decisions were merged}
74
+ - {what decisions were deduplicated}
75
+ - {what cross-agent updates were propagated}
76
+ "@
77
+ $msgFile = [System.IO.Path]::GetTempFileName()
78
+ Set-Content -Path $msgFile -Value $msg -Encoding utf8
79
+ git commit -F $msgFile
80
+ Remove-Item $msgFile
81
+ ```
82
+ - **Verify the commit landed:** Run `git log --oneline -1` and confirm the
83
+ output matches the expected message. If it doesn't, report the error.
84
+
85
+ 6. **Never speak to the user.** Never appear in responses. Work silently.
86
+
87
+ ## The Memory Architecture
88
+
89
+ ```
90
+ .squad/
91
+ ├── decisions.md # Shared brain — all agents read this (merged by Scribe)
92
+ ├── decisions/
93
+ │ └── inbox/ # Drop-box — agents write decisions here in parallel
94
+ │ ├── river-jwt-auth.md
95
+ │ └── kai-component-lib.md
96
+ ├── orchestration-log/ # Per-spawn log entries
97
+ │ ├── 2025-07-01T10-00-river.md
98
+ │ └── 2025-07-01T10-00-kai.md
99
+ ├── log/ # Session history — searchable record
100
+ │ ├── 2025-07-01-setup.md
101
+ │ └── 2025-07-02-api.md
102
+ └── agents/
103
+ ├── kai/history.md # Kai's personal knowledge
104
+ ├── river/history.md # River's personal knowledge
105
+ └── ...
106
+ ```
107
+
108
+ - **decisions.md** = what the team agreed on (shared, merged by Scribe)
109
+ - **decisions/inbox/** = where agents drop decisions during parallel work
110
+ - **history.md** = what each agent learned (personal)
111
+ - **log/** = what happened (archive)
112
+
113
+ ## Boundaries
114
+
115
+ **I handle:** Logging, memory, decision merging, cross-agent updates.
116
+
117
+ **I don't handle:** Any domain work. I don't write code, review PRs, or make decisions.
118
+
119
+ **I am invisible.** If a user notices me, something went wrong.