Skip to content

fix(templates): give Scribe one definition - #2322

Open
joslat wants to merge 1 commit into
github:devfrom
joslat:joslat/2321-scribe-single-definition
Open

joslat wants to merge 1 commit into
github:devfrom
joslat:joslat/2321-scribe-single-definition

Conversation

@joslat

@joslat joslat commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What

Scribe now has one definition: its charter. #2030 narrowed Scribe in the charter and in the coordinator's inline Scribe Spawn Template, so it only merges accepted durable decisions. This PR brings the prompt surfaces #2030 didn't touch into line with that, and adds a guard test so the old duties can't come back. Those surfaces are the after-agent reference, the host coordinator digest, the decision-hygiene watch prompt, the spawn, routing, ceremony and model-selection references, a few skills and the templates README. It also updates the five main docs pages that describe Scribe.

Why

Closes #2321

#2030 removed the archive "hard gate", the session and orchestration logs, the cross-agent history appends and the history summarization from the inline Scribe template. But after-agent-reference.md still had its own broad Scribe prompt with all of them; it was last edited before #2030, in #1792. The host digest and the watch prompt asked for logs and archival too. So what Scribe did depended on which text the model read.

How

Prompt surfaces, all of which drive behavior:

  • after-agent-reference.md: its Scribe prompt is now byte-identical to the inline Scribe Spawn Template, plus a note that size hygiene is squad nap.
  • coordinator.ts (host digest, item 11): Scribe only merges decisions; no logs, no history edits, no archiving.
  • decision-hygiene.ts: the watch prompt points Scribe at its charter and drops the archiving instructions.
  • squad.agent.md: drops the "Scribe — logging session" example and "Scribe log". Before-ceremonies no longer spawn Scribe "to record".
  • ceremony-reference.md: the facilitator now records each decision with squad_decide, and rule 6 no longer spawns Scribe at ceremony start. This is the one place where something new is asked of an agent. Without it, ceremony decisions would stay in the summary and never reach the inbox, since Scribe no longer records them.
  • spawn-reference.md: "skill extraction is handled by Scribe" is gone (no Scribe definition ever did it). The low-context rule still says "skip post-work entirely"; only the false "Scribe handles it independently" was replaced.
  • routing.md: Scribe runs when accepted decisions need merging, matching Recast repository with descriptive Squad specialists #2030's inline wording.
  • retro-enforcement skill: the retro facilitator is never Scribe.
  • scribe-charter.md: the "Exclusive canonical artifacts" paragraph no longer names a retrospective or a session log as something Scribe creates; a claim marker is the example now. The change is in all four template copies and the gh-aw builtin (workflows/shared/builtins/scribe-charter.md), with its sha256 updated in workflows/squad-workflows.manifest.json.
  • model-selection-reference.md, the other skills and the templates README: labels and ownership rows only.

Everything else:

  • Docs: concepts/architecture.md, concepts/what-is-squad.md, features/memory.md, get-started/first-session.md, reference/glossary.md.
  • test/clients.test.ts matches the new digest wording.
  • test/ci/scribe-template.test.ts adds guard tests. Every .squad-templates/ file is scanned for 15 retired Scribe phrases, the after-agent Scribe prompt must equal the inline one, the charter's exclusive-artifacts paragraph can't name a session log or retrospective, and the gh-aw builtin charter must match the template.
  • Each template change is applied to every mirror (templates/, .squad-templates/, packages/squad-cli/templates/, packages/squad-sdk/templates/, .github/agents/), which is why there are 65 files. The unique sources are 15 templates (the charter has a fifth copy as the gh-aw builtin), 2 code files, 5 docs pages, 2 tests, 1 changeset and the gh-aw manifest.

Effects to expect

  • Scribe spawns less often: only when the inbox has decisions, as Recast repository with descriptive Squad specialists #2030 already does for the inline template.
  • No automatic archiving or history compaction: decisions.md and history.md grow until someone runs squad nap. The old prompt "hard gate" was the only automatic trigger and didn't hold reliably. If you'd like it to stay automatic, I can add a coordinator hint to suggest squad nap past 20 KB.
  • No Scribe session logs: squad cost uses the newest .squad/log/*.md as the "current session" start (getCurrentSessionCutoff), so with no session logs plain squad cost reports every recorded turn. That's already what happens on hosts that follow Recast repository with descriptive Squad specialists #2030's inline template. Keying the session on the usage ledger instead would fix it; that's a separate change.
  • Ceremony decisions now reach decisions.md through the inbox like any other decision.

Not in this PR

  • Six docs pages still describe the old Scribe in examples: scenarios/disaster-recovery.md, scenarios/large-codebase.md, reference/compaction-recovery.md, features/reflect.md, tips-and-tricks.md, and the Scribe row title in reference/host-feature-matrix.md. They're user-facing walkthroughs that need rewriting, not one-line fixes, so I'd send them as a separate docs PR.
  • The role label "Session Logger" in packages/squad-cli/src/cli/core/team-md.ts:120. The Scribe row it labels is filtered out of rosters.
  • Refreshing an existing .squad/agents/scribe/charter.md on squad upgrade.

Related: #1268, #1823.


⚠️ Quick Check

  • If SDK/CLI source files changed: completed the applicable Changeset step below (.changeset/scribe-single-definition.md)

PR Readiness Checklist

Branch & Commit

  • Branch created from dev (not main)
  • Branch is up to date with dev (c3f54c2)
  • Verified diff contains only intended changes
  • PR is not in draft mode
  • Commit history is clean

Build & Test

  • npm run build passes
  • npm test passes (all tests green). Test summary from my Windows machine, since this touches more than 20 files: ci/scribe-template, clients, template-sync, coordinator, init-upgrade-parity, feature-parity and squad-agent-roster pass, with 719 passed and 35 expected fails. The gh-aw suites fail the same way on plain dev on Windows (same counts), and the full integrity check needs the gh-aw compiler, so I checked the manifest directly: all 22 runtime and skill digests match the committed files. CI is the real check.
  • npm run lint passes (type check clean)
  • npm run lint:eslint passes on the changed code files

Changeset

  • Changeset added (@bradygaster/squad-cli patch, @bradygaster/squad-sdk patch)

Docs

  • Docs pages updated (5; the remaining 6 are listed above)

Exports

  • N/A

Breaking Changes

None in code. Behavior changes are listed under "Effects to expect".

Waivers

None.

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 2331cfa

PR Scope: 📦🔧 Mixed (product + infrastructure)

⚠️ 2 item(s) to address before review

Status Check Details
✅ Single commit 1 commit — clean history
✅ Not in draft Ready for review
✅ Branch up to date Up to date with dev
❌ Copilot review No Copilot review yet — it may still be processing
✅ Changeset present Changeset file found
✅ Scope clean No .squad/ or docs/proposals/ files
✅ No merge conflicts No merge conflicts
✅ Copilot threads resolved No Copilot review threads
❌ CI passing 9 check(s) failing: sdk-exports-validation, docs-quality, Policy Gates, samples-build, test, Changeset Drift, changes, Shebang EOL, gh-aw strict compile

Files Changed (65 files, +257 −298)

File +/−
.changeset/scribe-single-definition.md +6 −0
.github/agents/squad.agent.md +4 −5
.squad-templates/README.md +1 −1
.squad-templates/after-agent-reference.md +15 −44
.squad-templates/ceremony-reference.md +2 −1
.squad-templates/model-selection-reference.md +2 −2
.squad-templates/routing.md +1 −1
.squad-templates/scribe-charter.md +1 −1
.squad-templates/skills/agent-collaboration/SKILL.md +1 −1
.squad-templates/skills/coordinator-init-mode/SKILL.md +2 −2
.squad-templates/skills/coordinator-source-of-truth/SKILL.md +4 −4
.squad-templates/skills/init-mode/SKILL.md +2 −2
.squad-templates/skills/retro-enforcement/SKILL.md +1 −1
.squad-templates/spawn-reference.md +4 −4
.squad-templates/squad.agent.md +4 −5
docs/src/content/docs/concepts/architecture.md +1 −1
docs/src/content/docs/concepts/what-is-squad.md +1 −1
docs/src/content/docs/features/memory.md +6 −4
docs/src/content/docs/get-started/first-session.md +2 −2
docs/src/content/docs/reference/glossary.md +1 −1
packages/squad-cli/src/cli/commands/watch/capabilities/decision-hygiene.ts +4 −3
packages/squad-cli/templates/README.md +1 −1
packages/squad-cli/templates/after-agent-reference.md +15 −44
packages/squad-cli/templates/ceremony-reference.md +2 −1
packages/squad-cli/templates/model-selection-reference.md +2 −2
packages/squad-cli/templates/routing.md +1 −1
packages/squad-cli/templates/scribe-charter.md +1 −1
packages/squad-cli/templates/skills/agent-collaboration/SKILL.md +1 −1
packages/squad-cli/templates/skills/coordinator-init-mode/SKILL.md +2 −2
packages/squad-cli/templates/skills/coordinator-source-of-truth/SKILL.md +4 −4
packages/squad-cli/templates/skills/init-mode/SKILL.md +2 −2
packages/squad-cli/templates/skills/retro-enforcement/SKILL.md +1 −1
packages/squad-cli/templates/spawn-reference.md +4 −4
packages/squad-cli/templates/squad.agent.md.template +4 −5
packages/squad-sdk/src/client/adapters/coordinator.ts +1 −1
packages/squad-sdk/templates/README.md +1 −1
packages/squad-sdk/templates/after-agent-reference.md +15 −44
packages/squad-sdk/templates/ceremony-reference.md +2 −1
packages/squad-sdk/templates/model-selection-reference.md +2 −2
packages/squad-sdk/templates/routing.md +1 −1
packages/squad-sdk/templates/scribe-charter.md +1 −1
packages/squad-sdk/templates/skills/agent-collaboration/SKILL.md +1 −1
packages/squad-sdk/templates/skills/coordinator-init-mode/SKILL.md +2 −2
packages/squad-sdk/templates/skills/coordinator-source-of-truth/SKILL.md +4 −4
packages/squad-sdk/templates/skills/init-mode/SKILL.md +2 −2
packages/squad-sdk/templates/skills/retro-enforcement/SKILL.md +1 −1
packages/squad-sdk/templates/spawn-reference.md +4 −4
packages/squad-sdk/templates/squad.agent.md.template +4 −5
templates/README.md +1 −1
templates/after-agent-reference.md +15 −44
... +15 more files

Total: +257 −298


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🏗️ Architectural Review

Authoritative evidence: base-controlled pull_request_target reporter.

⚠️ Architectural review: 1 warning(s).

Severity Category Finding Files
🟡 warning sweeping-refactor This PR touches 65 files (65 modified/added, 0 deleted). Large PRs are harder to review — consider splitting if possible. —

Automated architectural review — informational only.

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🔴 Impact Analysis — PR #2322

Risk tier: 🔴 CRITICAL

📊 Summary

Metric Count
Files changed 65
Files added 1
Files modified 64
Files deleted 0
Modules touched 7

🎯 Risk Factors

  • 65 files changed (>50 → CRITICAL)
  • 7 modules touched (5-8 → HIGH)

📦 Modules Affected

ci-workflows (1 file)
  • .github/agents/squad.agent.md
docs (5 files)
  • docs/src/content/docs/concepts/architecture.md
  • docs/src/content/docs/concepts/what-is-squad.md
  • docs/src/content/docs/features/memory.md
  • docs/src/content/docs/get-started/first-session.md
  • docs/src/content/docs/reference/glossary.md
root (16 files)
  • .changeset/scribe-single-definition.md
  • templates/README.md
  • templates/after-agent-reference.md
  • templates/ceremony-reference.md
  • templates/model-selection-reference.md
  • templates/routing.md
  • templates/scribe-charter.md
  • templates/skills/agent-collaboration/SKILL.md
  • templates/skills/coordinator-init-mode/SKILL.md
  • templates/skills/coordinator-source-of-truth/SKILL.md
  • templates/skills/init-mode/SKILL.md
  • templates/skills/retro-enforcement/SKILL.md
  • templates/spawn-reference.md
  • templates/squad.agent.md.template
  • workflows/shared/builtins/scribe-charter.md
  • workflows/squad-workflows.manifest.json
squad-cli (14 files)
  • packages/squad-cli/src/cli/commands/watch/capabilities/decision-hygiene.ts
  • packages/squad-cli/templates/README.md
  • packages/squad-cli/templates/after-agent-reference.md
  • packages/squad-cli/templates/ceremony-reference.md
  • packages/squad-cli/templates/model-selection-reference.md
  • packages/squad-cli/templates/routing.md
  • packages/squad-cli/templates/scribe-charter.md
  • packages/squad-cli/templates/skills/agent-collaboration/SKILL.md
  • packages/squad-cli/templates/skills/coordinator-init-mode/SKILL.md
  • packages/squad-cli/templates/skills/coordinator-source-of-truth/SKILL.md
  • packages/squad-cli/templates/skills/init-mode/SKILL.md
  • packages/squad-cli/templates/skills/retro-enforcement/SKILL.md
  • packages/squad-cli/templates/spawn-reference.md
  • packages/squad-cli/templates/squad.agent.md.template
squad-sdk (14 files)
  • packages/squad-sdk/src/client/adapters/coordinator.ts
  • packages/squad-sdk/templates/README.md
  • packages/squad-sdk/templates/after-agent-reference.md
  • packages/squad-sdk/templates/ceremony-reference.md
  • packages/squad-sdk/templates/model-selection-reference.md
  • packages/squad-sdk/templates/routing.md
  • packages/squad-sdk/templates/scribe-charter.md
  • packages/squad-sdk/templates/skills/agent-collaboration/SKILL.md
  • packages/squad-sdk/templates/skills/coordinator-init-mode/SKILL.md
  • packages/squad-sdk/templates/skills/coordinator-source-of-truth/SKILL.md
  • packages/squad-sdk/templates/skills/init-mode/SKILL.md
  • packages/squad-sdk/templates/skills/retro-enforcement/SKILL.md
  • packages/squad-sdk/templates/spawn-reference.md
  • packages/squad-sdk/templates/squad.agent.md.template
templates (13 files)
  • .squad-templates/README.md
  • .squad-templates/after-agent-reference.md
  • .squad-templates/ceremony-reference.md
  • .squad-templates/model-selection-reference.md
  • .squad-templates/routing.md
  • .squad-templates/scribe-charter.md
  • .squad-templates/skills/agent-collaboration/SKILL.md
  • .squad-templates/skills/coordinator-init-mode/SKILL.md
  • .squad-templates/skills/coordinator-source-of-truth/SKILL.md
  • .squad-templates/skills/init-mode/SKILL.md
  • .squad-templates/skills/retro-enforcement/SKILL.md
  • .squad-templates/spawn-reference.md
  • .squad-templates/squad.agent.md
tests (2 files)
  • test/ci/scribe-template.test.ts
  • test/clients.test.ts

This report is generated automatically for every PR. See #733 for details.

@joslat

joslat commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Heads-up on overlap with #1969: both change what Scribe does, in opposite directions. #1969 adds a "Session Init — Scribe Bootstrap" to squad.agent.md (spawn Scribe once per Team Mode session and initialize the session record) and rewrites routing.md rule 2 to match. This PR follows #2030, so Scribe only runs when accepted decisions need merging.

The routing.md rule conflicts in all four copies, so whoever lands second will see it. The bootstrap section in squad.agent.md merges cleanly though, so the coordinator could end up with both rules unless someone catches it.

Which way do you want Scribe to go? If the bootstrap stays, I can adjust this PR so the bootstrap only processes the decision inbox, or rebase on top of #1969 once it lands.

@tamirdresher

Copy link
Copy Markdown
Collaborator

Thanks Jose, I really like unifying Scribe around one definition and the guard test in est/ci/scribe-template.test.ts is great. One thing we want to sort out before merging is the squad cost dependency you flagged in the PR description: getCurrentSessionCutoff in packages/squad-cli/src/cli/commands/cost.ts:249 currently keys off the newest .squad/log/*.md file to find the current session start, so once every prompt surface stops asking Scribe for session logs, plain squad cost loses its session boundary. Also note that emplates/scribe-charter.md:26 still mentions a session log under canonical artifacts, and compressHistory in packages/squad-cli/src/cli/core/nap.ts:243 does not yet have the git-ignored destination check that decisions-archive.md has. How would you like to handle the squad cost cutoff? We can either keep one Scribe definition that still writes the brief session log, or update squad cost to derive the session boundary from the usage ledger instead.

@joslat

joslat commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks Tamir. I'd go with the usage ledger. A Scribe session log isn't a reliable boundary even if we keep it:

  • Only the interactive shell writes the ledger (shell/index.ts records turn starts and usage). Copilot CLI and VS Code sessions never write it, and their markdown fallback has no real numbers anyway: the orchestration-log template doesn't have a Token usage row, and our own old logs said "Not reported by coordinator". So the boundary only matters for shell runs, and the shell knows exactly when its session starts.
  • Scribe only spawns when there are decisions to merge, so a session without decisions writes no log and squad cost quietly widens to the previous session.

Concretely: the shell already has a session id (persistedSession.id in session-store.ts, the one /resume uses). I'd stamp every ledger record with it as an optional field and have plain squad cost show the records that share the newest one. --all stays the same, and a ledger with no stamped records falls back to today's log/*.md cutoff, so existing data reads the same. The validators ignore extra fields, so older CLIs still read the new records. That's also why I'd avoid a new record kind.

It touches the SDK and CLI, so I'd open it as its own issue and PR and land it before this one.

On the other two:

  • scribe-charter.md:26: I'll drop "a retrospective, a session log" from the examples in this PR (the four copies plus workflows/shared/builtins/scribe-charter.md and its manifest hash) and add a check for it to the guard test.
  • compressHistory: agreed, and it matters more after this PR, since squad nap becomes the only thing that compacts history. I'll open a separate issue and PR that gives it the same two rules archiveDecisions has: refuse a destination that can't be committed, and verify the append before rewriting history.md.

Does that work for you?

@joslat

joslat commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

The squad cost fix is up: #2348 (issue #2347). The shell now stamps every usage ledger record with its session id, and plain squad cost scopes to the newest one. A ledger with no stamped records falls back to the old cutoff. With that in, squad cost no longer depends on Scribe's session logs, so this PR can go in after it.

Next I'll push the scribe-charter.md:26 change to this PR. The compressHistory check will come as its own issue and PR.

Since github#2030 Scribe's charter says it only merges accepted decisions, and the
coordinator's inline Scribe template matches it. Other shipped surfaces still
gave Scribe the old broad job: the after-agent reference (archive hard gate,
session and orchestration logs, cross-agent history appends, history
summarization), the host coordinator digest, the decision-hygiene watch
prompt, the spawn reference (skill extraction), routing, ceremony and
model-selection references, several skills and docs.

Align all of them with the charter, make the after-agent Scribe prompt
identical to the inline template, point size hygiene at `squad nap`, and add
cross-surface guard tests so retired duties can't come back.

The charter's "Exclusive canonical artifacts" paragraph no longer names a
session log or a retrospective as something Scribe creates (all copies,
including the gh-aw builtin and its manifest digest).

Closes github#2321
@joslat
joslat force-pushed the joslat/2321-scribe-single-definition branch from bfbd312 to 2331cfa Compare October 26, 2026 17:48
@joslat

joslat commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Hey Tamir, thanks a lot for going through the whole batch so quickly, and for the kind words. Really appreciated!

Quick status from my side:

And yes, happy to keep going! 🙂

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

👋 Friendly nudge — this PR has had no activity for 7 days.

What needs attention:

  • 👀 No approving reviews yet. Request a review from a teammate.
  • ⬇️ 19 commits behind dev. Rebase to pick up latest changes.

If this PR is abandoned, please close it. If it's blocked on something external, leave a comment so the team knows.
This is an automated check that runs on weekdays. It won't nudge the same PR more than once per week.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scribe has conflicting definitions across templates, the host digest and docs since #2030

2 participants