Skip to content

feat(memory): tiered agent memory skill — hot/cold/wiki tiers#606

Merged
bradygaster merged 7 commits intobradygaster:devfrom
tamirdresher:tiered-memory-skill
Mar 28, 2026
Merged

feat(memory): tiered agent memory skill — hot/cold/wiki tiers#606
bradygaster merged 7 commits intobradygaster:devfrom
tamirdresher:tiered-memory-skill

Conversation

@tamirdresher
Copy link
Copy Markdown
Collaborator

Addresses #600

Problem

Agents carry 34-74KB context (82-96% old noise). No tier model exists.

Solution

Three-tier memory model: Hot (always loaded, ~2-4KB), Cold (on-demand, ~8-12KB), Wiki (durable reference).

Measurements from production (tamirdresher/tamresearch1, June 2025): 20-55% context reduction per spawn.

Files

  • skills/tiered-memory/SKILL.md — Full skill reference with tier specs, load policies, measurement data
  • templates/spawn-with-memory.md — Spawn template showing conditional tier inclusion
  • docs/tiered-memory-guide.md — Wiring guide for coordinators, file layout, rollout checklist

Integration

Scribe agent automates tier promotion: Hot→Cold at session end, Cold→Wiki after 30 days.

bradygaster pushed a commit that referenced this pull request Mar 25, 2026
- Flight triaged 14 untriaged GitHub issues, created prioritized work plan
- FIDO reviewed 10 open PRs, identified 3 duplicate/overlap pairs
- Merged 2 decisions from inbox to decisions.md
- Updated Flight and FIDO agent history with team updates
- Orchestration logs: 2026-03-25T15-23-flight.md, 2026-03-25T15-23-fido.md
- Session log: 2026-03-25T15-23-triage-session.md

Work session priority established:
- #610 → PAO (broken link, 5 min fix, unblocks #611)
- #590 → EECOM (getPersonalSquadRoot bug, P0)
- #592, #611 → Flight review
- #588 → Procedures (model list update)

PR deduplication: 10 PRs consolidate to 7
- Merge: #607, #603, #606
- Close as duplicates: #605, #604, #602

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster
Copy link
Copy Markdown
Owner

🔍 Squad Team Review

Reviewed by: Procedures (Prompt Architect) — Pass 3 of consensus ceremony
Action: Hold — proposal-first policy applies
Team Consensus: 5/5 AGREE

Review Summary

This PR implements tiered memory management for skills, enabling efficient caching and context prioritization across skill instances.

Process Note

Per our team's documented proposal-first policy (.squad/decisions.md): "Meaningful changes require a proposal in docs/proposals/ before execution." This is a feature-class change that needs a proposal document before merge.

What's Needed

  1. Create a proposal in docs/proposals/ describing the skill's purpose, integration points, and expected behavior
  2. Retarget this PR from main to dev (our staging branch)
  3. Once proposal is reviewed and approved, this PR can proceed

Thank you for the contribution! The implementation looks solid — we just need the process alignment. 🙏

⏸️ Action: HOLD — awaiting proposal + retarget to dev

bradygaster added a commit that referenced this pull request Mar 26, 2026
#620)

* chore(.squad): session wrap-up — inbox merge, logs, history updates

Merged 12 decision inbox entries into decisions.md. Logged mega-session
covering release recovery, docs fix, 10 PR merges, discussion triage,
and release hardening. Updated agent histories with session learnings.

Deleted inbox files after merge:
- booster-ci-audit.md, booster-ci-cleanup.md
- copilot-directive-2026-03-23T09-56.md, copilot-directive-2026-03-23T10-08.md
- copilot-directive-no-npx.md
- eecom-version-cmd.md
- pao-discussion-triage-2026-03-23.md, pao-npx-purge.md, pao-readme-slim.md
- pao-v090-blog.md
- surgeon-v090-changelog.md, surgeon-v091-retrospective.md

Updated files:
- .squad/decisions.md (12 decision entries merged)
- .squad/identity/now.md (current state updated)
- .squad/log/2026-03-23T22-00-00Z-mega-session-wrapup.md (new)
- .squad/agents/flight/history.md (issue filing patterns, governance directives)
- .squad/agents/eecom/history.md (CLI version subcommand pattern)
- .squad/agents/booster/history.md (CI audit and preflight patterns)
- .squad/agents/surgeon/history.md (release governance rules, retrospective)
- .squad/agents/pao/history.md (discussion triage patterns, Teams MCP urgency)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: add v0.9.0 and v0.9.1 releases to What's New

- v0.9.1 (Current Release): Bug fixes and hardening
  - Shell agent name extraction with multi-pattern fallback
  - Init scaffolding for typed casting files
  - Personal squad global mode support
  - Release CI/docs hardening
  - Doctor command improvements

- v0.9.0 (Major Feature): 6 major features + stability fixes
  - Personal Squad Governance Layer (isolated developer workspaces)
  - Worktree Spawning & Distributed Work (parallel agent orchestration)
  - Machine Capability Discovery (auto-detect tools/models/hardware)
  - Cooperative Rate Limiting (predictive circuit breaker + economy mode)
  - Telemetry & Infrastructure (auto-wire, KEDA, session recovery)
  - Docs, Stability & Distribution (Astro enhancements, npm-only)

- v0.8.2: Renamed from 'Current Release' to historic entry

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(squad): triage session — 14 issues triaged, 10 PRs reviewed

- Flight triaged 14 untriaged GitHub issues, created prioritized work plan
- FIDO reviewed 10 open PRs, identified 3 duplicate/overlap pairs
- Merged 2 decisions from inbox to decisions.md
- Updated Flight and FIDO agent history with team updates
- Orchestration logs: 2026-03-25T15-23-flight.md, 2026-03-25T15-23-fido.md
- Session log: 2026-03-25T15-23-triage-session.md

Work session priority established:
- #610 → PAO (broken link, 5 min fix, unblocks #611)
- #590 → EECOM (getPersonalSquadRoot bug, P0)
- #592, #611 → Flight review
- #588 → Procedures (model list update)

PR deduplication: 10 PRs consolidate to 7
- Merge: #607, #603, #606
- Close as duplicates: #605, #604, #602

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(prompts): update model catalog to current platform offerings (#588)

Update all model references in squad.agent.md to match the current
Copilot platform catalog:

- Remove stale models: claude-opus-4.6-fast, gpt-5 (standalone)
- Add new models: claude-sonnet-4.6, claude-opus-4.6-1m, gpt-5.4,
  gpt-5.3-codex, gpt-5.4-mini
- Bump code-writing defaults from claude-sonnet-4.5 to claude-sonnet-4.6
- Bump code specialist from gpt-5.2-codex to gpt-5.3-codex
- Update fallback chains with new models in sensible positions
- Propagate via sync-templates to all 4 derived copies

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: update procedures history and decision for model catalog refresh

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(sdk): getPersonalSquadRoot resolves to personal-squad dir (#590)

getPersonalSquadRoot() was hardcoded to append '.squad' to the global
squad directory, causing it to resolve to a nonexistent path. All users
running squad consult entered Init Mode and lost their personal agents.

Changed the subdirectory from '.squad' to 'personal-squad' to match
the actual layout used by resolvePersonalSquadDir() and
ensurePersonalSquadDir().

Added two tests verifying the correct resolution path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(cli): fix remaining personal-squad path in shell init (#590)

The shell's runShell() first-run check was looking for '.squad' inside the
global squad directory instead of 'personal-squad', mirroring the bug EECOM
already fixed in consult.ts. Also updated the matching test assertions in
cli-global.test.ts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bradygaster added a commit that referenced this pull request Mar 26, 2026
* chore(.squad): session wrap-up — inbox merge, logs, history updates

Merged 12 decision inbox entries into decisions.md. Logged mega-session
covering release recovery, docs fix, 10 PR merges, discussion triage,
and release hardening. Updated agent histories with session learnings.

Deleted inbox files after merge:
- booster-ci-audit.md, booster-ci-cleanup.md
- copilot-directive-2026-03-23T09-56.md, copilot-directive-2026-03-23T10-08.md
- copilot-directive-no-npx.md
- eecom-version-cmd.md
- pao-discussion-triage-2026-03-23.md, pao-npx-purge.md, pao-readme-slim.md
- pao-v090-blog.md
- surgeon-v090-changelog.md, surgeon-v091-retrospective.md

Updated files:
- .squad/decisions.md (12 decision entries merged)
- .squad/identity/now.md (current state updated)
- .squad/log/2026-03-23T22-00-00Z-mega-session-wrapup.md (new)
- .squad/agents/flight/history.md (issue filing patterns, governance directives)
- .squad/agents/eecom/history.md (CLI version subcommand pattern)
- .squad/agents/booster/history.md (CI audit and preflight patterns)
- .squad/agents/surgeon/history.md (release governance rules, retrospective)
- .squad/agents/pao/history.md (discussion triage patterns, Teams MCP urgency)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: add v0.9.0 and v0.9.1 releases to What's New

- v0.9.1 (Current Release): Bug fixes and hardening
  - Shell agent name extraction with multi-pattern fallback
  - Init scaffolding for typed casting files
  - Personal squad global mode support
  - Release CI/docs hardening
  - Doctor command improvements

- v0.9.0 (Major Feature): 6 major features + stability fixes
  - Personal Squad Governance Layer (isolated developer workspaces)
  - Worktree Spawning & Distributed Work (parallel agent orchestration)
  - Machine Capability Discovery (auto-detect tools/models/hardware)
  - Cooperative Rate Limiting (predictive circuit breaker + economy mode)
  - Telemetry & Infrastructure (auto-wire, KEDA, session recovery)
  - Docs, Stability & Distribution (Astro enhancements, npm-only)

- v0.8.2: Renamed from 'Current Release' to historic entry

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(squad): triage session — 14 issues triaged, 10 PRs reviewed

- Flight triaged 14 untriaged GitHub issues, created prioritized work plan
- FIDO reviewed 10 open PRs, identified 3 duplicate/overlap pairs
- Merged 2 decisions from inbox to decisions.md
- Updated Flight and FIDO agent history with team updates
- Orchestration logs: 2026-03-25T15-23-flight.md, 2026-03-25T15-23-fido.md
- Session log: 2026-03-25T15-23-triage-session.md

Work session priority established:
- #610 → PAO (broken link, 5 min fix, unblocks #611)
- #590 → EECOM (getPersonalSquadRoot bug, P0)
- #592, #611 → Flight review
- #588 → Procedures (model list update)

PR deduplication: 10 PRs consolidate to 7
- Merge: #607, #603, #606
- Close as duplicates: #605, #604, #602

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(squad): log work session — triage, fixes, research

Round 1 outcomes:
- PAO: #610 docs link already resolved
- EECOM: #590 personal squad path fix (getPersonalSquadRoot)
- Procedures: #588 model catalog updated to current platform
- Flight: #612 community issue filed on routing regression
- CAPCOM: CLI platform research — identified 8 releases (1.0.4→1.0.11) with 3 high-impact changes
- GNC: Squad codebase research — routing regression caused by v0.9.0 prompt saturation + missing name param

Round 2: Code review & quality gate
- FIDO: Found same bug in shell/index.ts, enforced revision
- CONTROL: Full sweep of #590 fix, awaiting FIDO re-review

Merged decisions:
1. Personal squad path canonicalization (personal-squad/)
2. Model catalog refresh (claude-sonnet-4.6, gpt-5.3-codex defaults)
3. CLI platform analysis (monorepo discovery, idle hiding, hook injection)
4. Squad regression analysis (prompt saturation, workstream replacement, missing name param)

Logs created:
- 6 orchestration logs (one per agent)
- 1 session synthesis log with research synthesis
- 4 agent history updates (team update annotations)

All inbox decision files merged and deleted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Merge: VS Code routing enforcement fix proposal (#613)

- Merged procedures-vscode-routing-fix.md from inbox to decisions.md
- Cleared decision inbox after merge
- Logged session finalization work

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: add count-based fallback to archiveDecisions() (#626)

archiveDecisions() silently returned null when all entries were <30 days
old, allowing decisions.md to grow unboundedly. Active projects hit
145KB+ (35K tokens burned per agent spawn).

Added count-based fallback: when all entries are recent but total size
exceeds 20KB, archive the oldest recent entries to stay under threshold.
Undated entries are preserved (not archived) per Procedures' guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: update EECOM history with #626 learnings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bradygaster added a commit that referenced this pull request Mar 26, 2026
…#624)

* chore(.squad): session wrap-up — inbox merge, logs, history updates

Merged 12 decision inbox entries into decisions.md. Logged mega-session
covering release recovery, docs fix, 10 PR merges, discussion triage,
and release hardening. Updated agent histories with session learnings.

Deleted inbox files after merge:
- booster-ci-audit.md, booster-ci-cleanup.md
- copilot-directive-2026-03-23T09-56.md, copilot-directive-2026-03-23T10-08.md
- copilot-directive-no-npx.md
- eecom-version-cmd.md
- pao-discussion-triage-2026-03-23.md, pao-npx-purge.md, pao-readme-slim.md
- pao-v090-blog.md
- surgeon-v090-changelog.md, surgeon-v091-retrospective.md

Updated files:
- .squad/decisions.md (12 decision entries merged)
- .squad/identity/now.md (current state updated)
- .squad/log/2026-03-23T22-00-00Z-mega-session-wrapup.md (new)
- .squad/agents/flight/history.md (issue filing patterns, governance directives)
- .squad/agents/eecom/history.md (CLI version subcommand pattern)
- .squad/agents/booster/history.md (CI audit and preflight patterns)
- .squad/agents/surgeon/history.md (release governance rules, retrospective)
- .squad/agents/pao/history.md (discussion triage patterns, Teams MCP urgency)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: add v0.9.0 and v0.9.1 releases to What's New

- v0.9.1 (Current Release): Bug fixes and hardening
  - Shell agent name extraction with multi-pattern fallback
  - Init scaffolding for typed casting files
  - Personal squad global mode support
  - Release CI/docs hardening
  - Doctor command improvements

- v0.9.0 (Major Feature): 6 major features + stability fixes
  - Personal Squad Governance Layer (isolated developer workspaces)
  - Worktree Spawning & Distributed Work (parallel agent orchestration)
  - Machine Capability Discovery (auto-detect tools/models/hardware)
  - Cooperative Rate Limiting (predictive circuit breaker + economy mode)
  - Telemetry & Infrastructure (auto-wire, KEDA, session recovery)
  - Docs, Stability & Distribution (Astro enhancements, npm-only)

- v0.8.2: Renamed from 'Current Release' to historic entry

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(squad): triage session — 14 issues triaged, 10 PRs reviewed

- Flight triaged 14 untriaged GitHub issues, created prioritized work plan
- FIDO reviewed 10 open PRs, identified 3 duplicate/overlap pairs
- Merged 2 decisions from inbox to decisions.md
- Updated Flight and FIDO agent history with team updates
- Orchestration logs: 2026-03-25T15-23-flight.md, 2026-03-25T15-23-fido.md
- Session log: 2026-03-25T15-23-triage-session.md

Work session priority established:
- #610 → PAO (broken link, 5 min fix, unblocks #611)
- #590 → EECOM (getPersonalSquadRoot bug, P0)
- #592, #611 → Flight review
- #588 → Procedures (model list update)

PR deduplication: 10 PRs consolidate to 7
- Merge: #607, #603, #606
- Close as duplicates: #605, #604, #602

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(squad): log work session — triage, fixes, research

Round 1 outcomes:
- PAO: #610 docs link already resolved
- EECOM: #590 personal squad path fix (getPersonalSquadRoot)
- Procedures: #588 model catalog updated to current platform
- Flight: #612 community issue filed on routing regression
- CAPCOM: CLI platform research — identified 8 releases (1.0.4→1.0.11) with 3 high-impact changes
- GNC: Squad codebase research — routing regression caused by v0.9.0 prompt saturation + missing name param

Round 2: Code review & quality gate
- FIDO: Found same bug in shell/index.ts, enforced revision
- CONTROL: Full sweep of #590 fix, awaiting FIDO re-review

Merged decisions:
1. Personal squad path canonicalization (personal-squad/)
2. Model catalog refresh (claude-sonnet-4.6, gpt-5.3-codex defaults)
3. CLI platform analysis (monorepo discovery, idle hiding, hook injection)
4. Squad regression analysis (prompt saturation, workstream replacement, missing name param)

Logs created:
- 6 orchestration logs (one per agent)
- 1 session synthesis log with research synthesis
- 4 agent history updates (team update annotations)

All inbox decision files merged and deleted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Merge: VS Code routing enforcement fix proposal (#613)

- Merged procedures-vscode-routing-fix.md from inbox to decisions.md
- Cleared decision inbox after merge
- Logged session finalization work

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: rename template copies to prevent CLI instruction merging (#613)

Copilot CLI 1.0.11 discovers all *.agent.md files from cwd to git root
and merges them into the coordinator prompt. Squad had 3 template copies
that were being discovered and merged, causing 4x instruction duplication.

Renamed template copies to .agent.md.template so only the active copy
at .github/agents/squad.agent.md is discovered by the CLI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* scribe: Record spawn manifest session — template rename completion

Orchestration logs:
- CONTROL: Template rename (3 copies squad.agent.md → .agent.md.template)
- FIDO: QA approval of template rename work
- Coordinator: 3 PRs opened (#624, #620, #619)

Session log: Spawn manifest execution summary
- Template duplication risk eliminated
- Zero stale references found
- Build + test: zero new failures
- All work ready for merge coordination

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bradygaster added a commit that referenced this pull request Mar 26, 2026
* chore(.squad): session wrap-up — inbox merge, logs, history updates

Merged 12 decision inbox entries into decisions.md. Logged mega-session
covering release recovery, docs fix, 10 PR merges, discussion triage,
and release hardening. Updated agent histories with session learnings.

Deleted inbox files after merge:
- booster-ci-audit.md, booster-ci-cleanup.md
- copilot-directive-2026-03-23T09-56.md, copilot-directive-2026-03-23T10-08.md
- copilot-directive-no-npx.md
- eecom-version-cmd.md
- pao-discussion-triage-2026-03-23.md, pao-npx-purge.md, pao-readme-slim.md
- pao-v090-blog.md
- surgeon-v090-changelog.md, surgeon-v091-retrospective.md

Updated files:
- .squad/decisions.md (12 decision entries merged)
- .squad/identity/now.md (current state updated)
- .squad/log/2026-03-23T22-00-00Z-mega-session-wrapup.md (new)
- .squad/agents/flight/history.md (issue filing patterns, governance directives)
- .squad/agents/eecom/history.md (CLI version subcommand pattern)
- .squad/agents/booster/history.md (CI audit and preflight patterns)
- .squad/agents/surgeon/history.md (release governance rules, retrospective)
- .squad/agents/pao/history.md (discussion triage patterns, Teams MCP urgency)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: add v0.9.0 and v0.9.1 releases to What's New

- v0.9.1 (Current Release): Bug fixes and hardening
  - Shell agent name extraction with multi-pattern fallback
  - Init scaffolding for typed casting files
  - Personal squad global mode support
  - Release CI/docs hardening
  - Doctor command improvements

- v0.9.0 (Major Feature): 6 major features + stability fixes
  - Personal Squad Governance Layer (isolated developer workspaces)
  - Worktree Spawning & Distributed Work (parallel agent orchestration)
  - Machine Capability Discovery (auto-detect tools/models/hardware)
  - Cooperative Rate Limiting (predictive circuit breaker + economy mode)
  - Telemetry & Infrastructure (auto-wire, KEDA, session recovery)
  - Docs, Stability & Distribution (Astro enhancements, npm-only)

- v0.8.2: Renamed from 'Current Release' to historic entry

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(squad): triage session — 14 issues triaged, 10 PRs reviewed

- Flight triaged 14 untriaged GitHub issues, created prioritized work plan
- FIDO reviewed 10 open PRs, identified 3 duplicate/overlap pairs
- Merged 2 decisions from inbox to decisions.md
- Updated Flight and FIDO agent history with team updates
- Orchestration logs: 2026-03-25T15-23-flight.md, 2026-03-25T15-23-fido.md
- Session log: 2026-03-25T15-23-triage-session.md

Work session priority established:
- #610 → PAO (broken link, 5 min fix, unblocks #611)
- #590 → EECOM (getPersonalSquadRoot bug, P0)
- #592, #611 → Flight review
- #588 → Procedures (model list update)

PR deduplication: 10 PRs consolidate to 7
- Merge: #607, #603, #606
- Close as duplicates: #605, #604, #602

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(squad): log work session — triage, fixes, research

Round 1 outcomes:
- PAO: #610 docs link already resolved
- EECOM: #590 personal squad path fix (getPersonalSquadRoot)
- Procedures: #588 model catalog updated to current platform
- Flight: #612 community issue filed on routing regression
- CAPCOM: CLI platform research — identified 8 releases (1.0.4→1.0.11) with 3 high-impact changes
- GNC: Squad codebase research — routing regression caused by v0.9.0 prompt saturation + missing name param

Round 2: Code review & quality gate
- FIDO: Found same bug in shell/index.ts, enforced revision
- CONTROL: Full sweep of #590 fix, awaiting FIDO re-review

Merged decisions:
1. Personal squad path canonicalization (personal-squad/)
2. Model catalog refresh (claude-sonnet-4.6, gpt-5.3-codex defaults)
3. CLI platform analysis (monorepo discovery, idle hiding, hook injection)
4. Squad regression analysis (prompt saturation, workstream replacement, missing name param)

Logs created:
- 6 orchestration logs (one per agent)
- 1 session synthesis log with research synthesis
- 4 agent history updates (team update annotations)

All inbox decision files merged and deleted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Merge: VS Code routing enforcement fix proposal (#613)

- Merged procedures-vscode-routing-fix.md from inbox to decisions.md
- Cleared decision inbox after merge
- Logged session finalization work

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: platform-neutral routing enforcement for VS Code (#613)

- Rewrite CRITICAL RULE to be platform-neutral (task + runSubagent)
- Update all enforcement references to mention both dispatch mechanisms
- Add routing reinforcement reminder at prompt boundary
- Addresses VS Code Autopilot routing bypass reported in #613

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: update Procedures history with #613 fix implementation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Owner

@bradygaster bradygaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIDO Quality Review — PR #606: tiered agent memory skill

Verdict: ⚠️ NEEDS CHANGES

Blocking Issues

❌ Wrong file paths: Files are placed at root-level directories that don't exist in this project:

  • skills/tiered-memory/SKILL.md — no root skills/ dir. Skills go in packages/squad-cli/templates/skills/ and packages/squad-sdk/templates/skills/
  • docs/tiered-memory-guide.mddocs/ is for the Astro docs site (docs/src/content/docs/), not standalone guides
  • templates/spawn-with-memory.md — root templates/ is for .squad/templates/ scaffolding, not standalone spawn templates

Expected locations:

  • Skill → packages/squad-cli/templates/skills/tiered-memory/SKILL.md (and SDK equivalent)
  • Guide → fold into the SKILL.md or docs/src/content/docs/features/tiered-memory.md
  • Spawn template → packages/squad-cli/templates/skills/tiered-memory/spawn-with-memory.md or similar

❌ No changeset file: Feature PRs need a changeset with @bradygaster/squad-cli and @bradygaster/squad-sdk scoped names.

Non-Blocking Notes

  • Target branch: Targets main — consider dev.
  • Content quality: Excellent research. The 3-tier model (Hot/Cold/Wiki) is well-designed, the production measurement data from tamirdresher/tamresearch1 adds credibility, and the Scribe integration patterns are practical.
  • SKILL.md format: Uses # Skill: Tiered Agent Memory heading and ## Overview instead of standard SKILL.md frontmatter. Missing frontmatter block entirely.
  • Previously reviewed: This was approved in my earlier triage session (PR #606 over #602 as the superset). The content is still solid — just needs to land in the right places.

Needs restructuring to use correct file paths, add frontmatter, and include a changeset.

chrislomonico pushed a commit to clomonico/squad that referenced this pull request Mar 26, 2026
…ster#605, bradygaster#606, bradygaster#607) (bradygaster#623)

* test: add first-run gating tests (issue bradygaster#607)

25 tests across 6 categories enforcing Init Mode gating:
- Banner renders exactly once (not duplicated)
- First-run hint appears on initial session only
- Console output contains no raw Node warnings
- 'Your squad is assembled' requires non-empty roster
- Session-scoped Static keys prevent cross-session collisions
- Terminal clear runs before Ink render

Closes bradygaster#607

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: standardize elapsed time placement inline after agent messages (bradygaster#605)

Elapsed time annotations were inconsistent — the Static scrollback block in
App.tsx rendered completed agent messages without any duration, while
MessageStream had duration code that was dead (receives messages=[]).

Changes:
- Export formatDuration from MessageStream.tsx for shared use
- Add inline (duration) display to App.tsx Static block for agent messages
- Duration computed by finding preceding user message timestamp
- Format: inline dimColor after message content, e.g. (4.4s)

Closes bradygaster#605

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: update cheritto history and decision for bradygaster#605

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(shell): remove duplicate prompt hint that conflicts with header (bradygaster#606)

The InputPrompt placeholder showed 'Type @agent or /help' for the first 5
messages, duplicating guidance already present in the header banner. This
created visual noise with two competing prompt elements.

Consolidated to two hint tiers: tab/history (messageCount < 10) and
command hints (>= 10). The header banner remains the single source for
@agent and /help guidance.

Closes bradygaster#606

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: update kovash history and decision for bradygaster#606 prompt consolidation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster
Copy link
Copy Markdown
Owner

Thank you for this work, Tamir! 🚀

To get this PR ready for team review and merge, we need two quick adjustments:

  1. *Retarget to \dev* — All feature work merges to the \dev\ branch first (not \main). You can change the base branch in the PR settings.

  2. Add a proposal document — Feature-class skills need a brief proposal in \docs/proposals/\ before merging. Include:

    • What the skill does
    • Why it's needed
    • How it fits into our existing skill architecture

Once those are in place, the team will take another look and we can get this merged!

Thanks for your continued contributions to Squad 👍

@tamirdresher tamirdresher changed the base branch from main to dev March 26, 2026 08:24
@tamirdresher
Copy link
Copy Markdown
Collaborator Author

Fixed per FIDO review: restructured file layout to correct package paths. Moved skill content to packages/squad-cli/templates/skills/tiered-memory/SKILL.md and packages/squad-sdk/templates/skills/tiered-memory/SKILL.md. Merged content from skills/, docs/, and templates/ into single coherent SKILL.md with proper frontmatter. Added changeset with correct @bradygaster/squad-cli and @bradygaster/squad-sdk package names. Removed old wrong-path files. Also retargeting to dev branch.

- Move skills/tiered-memory/SKILL.md -> packages/squad-cli/templates/skills/tiered-memory/SKILL.md
- Add packages/squad-sdk/templates/skills/tiered-memory/SKILL.md (mirror)
- Add SKILL.md frontmatter with correct field format
- Fold spawn template into SKILL.md (removed templates/spawn-with-memory.md)
- Remove docs/tiered-memory-guide.md (content folded into SKILL.md)
- Add .changeset/tiered-memory.md with @bradygaster scoped package names
@tamirdresher
Copy link
Copy Markdown
Collaborator Author

Fixed per FIDO review:

  • Moved SKILL.md from incorrect root-level \skills/tiered-memory/\ to correct \packages/squad-cli/templates/skills/tiered-memory/SKILL.md\ (and SDK equivalent)
  • Added proper SKILL.md frontmatter (name, description, domain, confidence, source fields)
  • Removed incorrect \docs/tiered-memory-guide.md\ (content folded into SKILL.md)
  • Removed incorrect \ emplates/spawn-with-memory.md\ (spawn template folded into SKILL.md as appendix)
  • Added .changeset/tiered-memory.md\ with correct @bradygaster/squad-cli\ and @bradygaster/squad-sdk\ scoped package names
  • Retargeted PR to \dev\ branch

@tamirdresher
Copy link
Copy Markdown
Collaborator Author

Addressed all review items: (1) Restructured files to packages/squad-cli/templates/skills/tiered-memory/ and SDK mirror. (2) Added SKILL.md frontmatter. (3) Added .changeset/tiered-memory.md with @bradygaster scoped names. (4) Added docs/proposals/tiered-memory.md. (5) Retargeted to dev.

Copilot AI review requested due to automatic review settings March 28, 2026 13:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a new “tiered-memory” skill template that proposes a hot/cold/wiki memory model to reduce agent spawn context size, along with a proposal doc and a changeset to publish the new templates in both the CLI and SDK packages.

Changes:

  • Add tiered-memory SKILL.md templates to both @bradygaster/squad-cli and @bradygaster/squad-sdk.
  • Add a written proposal documenting the motivation, approach, and risks for tiered memory.
  • Add a Changesets entry bumping both packages minor for the new skill.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 12 comments.

File Description
packages/squad-sdk/templates/skills/tiered-memory/SKILL.md Adds the tiered-memory skill template and embedded spawn template guidance for the SDK templates.
packages/squad-cli/templates/skills/tiered-memory/SKILL.md Adds the same tiered-memory skill template for the CLI templates.
docs/proposals/tiered-memory.md Adds a proposal document describing the tiered-memory approach and intended rollout.
.changeset/tiered-memory.md Publishes the new skill templates via minor bumps for CLI and SDK packages.

Comment on lines +96 to +103
| Agent | Total Context | Old Noise % | Hot-Only Size | Savings |
|-------|--------------|-------------|---------------|---------|
| Picard (Lead) | 74KB / 18.5K tokens | 96% | ~3KB | 55% |
| Scribe | 52KB / 13K tokens | 91% | ~4KB | 48% |
| Data | 43KB / 10.7K tokens | 88% | ~3.5KB | 42% |
| Ralph | 38KB / 9.5K tokens | 85% | ~3KB | 38% |
| Worf | 34KB / 8.5K tokens | 82% | ~3KB | 20% |

Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The measurement table rows start with ||, which creates an unintended blank first column when rendered. Use a single leading | per row for proper markdown table formatting.

Copilot uses AI. Check for mistakes.
Comment on lines +114 to +116
3. **On-demand wiki writes:** Any agent can request Scribe to write a wiki entry mid-session using `scribe:wiki-write`

See Scribe charter: `.squad/agents/scribe/charter.md`
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This references a scribe:wiki-write capability, but the current Scribe charter (.squad/agents/scribe/charter.md) does not define this command or workflow. Either document how agents request wiki writes (and where they are written), or soften this to a proposed/optional convention to avoid misleading readers.

Suggested change
3. **On-demand wiki writes:** Any agent can request Scribe to write a wiki entry mid-session using `scribe:wiki-write`
See Scribe charter: `.squad/agents/scribe/charter.md`
3. **On-demand wiki writes (recommended convention):** Teams may define a `scribe:wiki-write` command that agents can use to request mid-session wiki entries.
If you adopt this, document the `scribe:wiki-write` workflow in your Scribe charter (e.g. `.squad/agents/scribe/charter.md`); it is not defined there by default.

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +20
| Agent | Context Size | Old Noise % |
|-------|-------------|-------------|
| Picard | 74KB / 18,500 tokens | 96% |
| Scribe | 52KB / 13,000 tokens | 91% |
| Data | 43KB / 10,700 tokens | 88% |
| Ralph | 38KB / 9,500 tokens | 85% |
| Worf | 34KB / 8,500 tokens | 82% |
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This table uses || at the start of each row, which renders as an unintended blank first column. Use a single leading | per row for proper markdown table formatting.

Copilot uses AI. Check for mistakes.
Comment on lines +61 to +71
## What Changes

- New skill: packages/squad-cli/templates/skills/tiered-memory/SKILL.md
- New skill: packages/squad-sdk/templates/skills/tiered-memory/SKILL.md
- New changeset: .changeset/tiered-memory.md

## What Stays the Same

- Existing spawn templates unchanged (opt-in)
- Scribe charter not modified (skill provides guidance, Scribe charter update is separate)
- No CLI or SDK runtime code changed
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description mentions additional deliverables (e.g., templates/spawn-with-memory.md, docs/tiered-memory-guide.md, and a skills/ skill path), but the proposal’s “What Changes” list doesn’t include them and the referenced guide file doesn’t exist in the repo. Please either add the missing files or update the PR description/proposal to reflect the actual artifacts being introduced.

Copilot uses AI. Check for mistakes.
Comment on lines +233 to +234
- See `skills/tiered-memory/SKILL.md` for full tier reference
- See `docs/tiered-memory-guide.md` for wiring instructions
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These references appear to be broken in this repo: there is no docs/tiered-memory-guide.md, and there is no skills/ directory at repo root (skills live under .copilot/skills/ and .squad/skills/, and this template is under packages/.../templates/skills/). Update the links/paths (or add the referenced guide file) so readers can navigate to the intended documentation.

Suggested change
- See `skills/tiered-memory/SKILL.md` for full tier reference
- See `docs/tiered-memory-guide.md` for wiring instructions
- This SKILL file serves as the full tier reference
- See your project's Squad wiring documentation (for example, `.squad/README.md`) for wiring instructions

Copilot uses AI. Check for mistakes.
Comment on lines +233 to +234
- See `skills/tiered-memory/SKILL.md` for full tier reference
- See `docs/tiered-memory-guide.md` for wiring instructions
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These references appear to be broken in this repo: there is no docs/tiered-memory-guide.md, and there is no skills/ directory at repo root (skills live under .copilot/skills/ and .squad/skills/, and this template is under packages/.../templates/skills/). Update the links/paths (or add the referenced guide file) so readers can navigate to the intended documentation.

Suggested change
- See `skills/tiered-memory/SKILL.md` for full tier reference
- See `docs/tiered-memory-guide.md` for wiring instructions
- See `.squad/skills/tiered-memory/SKILL.md` (or `.copilot/skills/tiered-memory/SKILL.md`) for full tier reference
- See the Tiered Memory wiring guide in your project's documentation for wiring instructions

Copilot uses AI. Check for mistakes.
Comment on lines +46 to +54
| Situation | Hot | Cold | Wiki |
|-----------|-----|------|------|
| New task, no prior context needed | ✅ | ❌ | ❌ |
| Resuming interrupted work | ✅ | ✅ | ❌ |
| Debugging a recurring issue | ✅ | ✅ | ❌ |
| Implementing against a spec/ADR | ✅ | ❌ | ✅ |
| Onboarding to unfamiliar subsystem | ✅ | ❌ | ✅ |
| Post-incident review | ✅ | ✅ | ✅ |

Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The markdown table has an extra leading | on each row (|| ...), which renders as an unintended empty first column. Use single leading pipes so the table renders correctly.

Copilot uses AI. Check for mistakes.
Comment on lines +96 to +103
| Agent | Total Context | Old Noise % | Hot-Only Size | Savings |
|-------|--------------|-------------|---------------|---------|
| Picard (Lead) | 74KB / 18.5K tokens | 96% | ~3KB | 55% |
| Scribe | 52KB / 13K tokens | 91% | ~4KB | 48% |
| Data | 43KB / 10.7K tokens | 88% | ~3.5KB | 42% |
| Ralph | 38KB / 9.5K tokens | 85% | ~3KB | 38% |
| Worf | 34KB / 8.5K tokens | 82% | ~3KB | 20% |

Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The measurement table rows start with ||, which creates an unintended blank first column when rendered. Use a single leading | per row for proper markdown table formatting.

Copilot uses AI. Check for mistakes.
Comment on lines +114 to +116
3. **On-demand wiki writes:** Any agent can request Scribe to write a wiki entry mid-session using `scribe:wiki-write`

See Scribe charter: `.squad/agents/scribe/charter.md`
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This references a scribe:wiki-write capability, but the current Scribe charter (.squad/agents/scribe/charter.md) does not define this command or workflow. Either document how agents request wiki writes (and where they are written), or soften this to a proposed/optional convention to avoid misleading readers.

Suggested change
3. **On-demand wiki writes:** Any agent can request Scribe to write a wiki entry mid-session using `scribe:wiki-write`
See Scribe charter: `.squad/agents/scribe/charter.md`
3. **On-demand wiki writes (optional convention):** You can define a request pattern (for example, a `scribe:wiki-write` command) that agents use to ask Scribe to persist wiki entries mid-session.
Document your chosen wiki-write workflow in `.squad/agents/scribe/charter.md` so it is clear how agents should request wiki updates and where they are stored.

Copilot uses AI. Check for mistakes.
Comment on lines +122 to +127
- [ ] Scribe writes Hot context file at session start (`.squad/memory/hot/{agent}.md`)
- [ ] Scribe compresses and writes Cold summary at session end
- [ ] Spawn templates default to Hot-only
- [ ] Coordinators add `--include-cold` / `--include-wiki` flags as needed
- [ ] Wiki entries stored in `.squad/memory/wiki/`
- [ ] Cold entries stored in `.squad/memory/cold/` with 30-day TTL
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The skill introduces runtime artifacts under .squad/memory/..., but .gitignore currently does not ignore .squad/memory/ (it only ignores .squad/log/, .squad/sessions/, etc.). This will likely create persistent untracked changes for users. Consider moving hot/cold tiers under an already-ignored runtime directory (e.g., .squad/sessions/) or update the repo ignore rules and clarify which tiers are intended to be committed.

Copilot uses AI. Check for mistakes.
@bradygaster bradygaster merged commit e11b5d3 into bradygaster:dev Mar 28, 2026
7 checks passed
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.

3 participants