team-memory-maintenance · diff
git:20260911.f640e80 to git:20260913.8b79211
30 added, 49 removed. Audit A to A.
---
name: team-memory-maintenance
- description: Maintain Squad session logs, decision inboxes, and agent history through the active state backend
- domain: squad-internals, state-management
+ description: Merge accepted Squad decisions through the active state backend with exact verification
+ domain: squad-internals, decision-management
confidence: high
- source: current collaboration rules, source-of-truth guidance, and Scribe operating contract
+ source: retained pre-recast procedure, narrowed to the current Scribe contract
---
- ## Context
-
- Use this skill when maintaining shared Squad memory after a substantive work session. It covers
- session logs, the decision inbox, canonical decisions, and concise cross-agent updates. Use
- `archival-integrity` whenever an operation moves or trims stored entries.
-
- ## SCOPE
+ # Team Memory Maintenance
- - Activate after substantive work that changes shared Squad memory or when processing decision inbox or history updates.
- - Allowed targets: `.squad/` session logs, decision inbox entries, canonical decision records, and concise cross-agent history updates through the active backend.
- - Exclusions: product source changes, arbitrary repository cleanup, and direct writes that bypass the active backend.
+ Use this skill only for accepted durable decisions. The current Scribe role does not maintain
+ session logs, orchestration logs, specialist histories, onboarding records, or general team memory.
- ## Patterns
+ ## Scope
- 1. Resolve every `.squad/` path from the provided team root; use `git rev-parse --show-toplevel`
- only when no team root is available.
- 2. Honor the active state backend. Use its state operations for mutable Squad state; do not bypass
- that backend with branch switching, note-ref pushes, resets, or hand-managed persistence.
- 3. Record a concise factual session log after substantial work: participants, completed work,
- decisions, and final outcomes. Do not log requests or tentative plans as facts.
- Use filesystem-safe UTC timestamps in filenames (replace `:` with `-`); if there is no
- finalized outcome to record, skip the write and report that no durable update was required.
- 4. Process decision-inbox entries only after reading them. Before merging, deduplicate exact
- entries and normalize nested headings with the archival-integrity helper.
- 5. Confirm the merged content is present in the canonical decision record before deleting an inbox
- entry. Preserve a decision’s author and final rationale.
- 6. Add a short history update only when a finalized decision materially changes another role’s
- work. Put reusable procedure in a skill instead of duplicating it across histories.
- 7. Re-read state through the active backend after consequential writes. If the required backend
- capability is unavailable, stop and report the unavailable operation rather than reporting
- successful persistence.
- 8. After every write, refetch the exact target and verify the expected content. After every
- delete, refetch and verify the entry is absent. Stop on any mismatch; do not continue with
- subsequent memory mutations.
+ - Allowed targets: `.squad/decisions/inbox/` and `.squad/decisions.md`.
+ - Use the active state backend for mutable Squad state.
+ - Preserve decision authorship, rationale, and accepted scope.
+ - Use archival-integrity procedures whenever accepted records are moved or compacted.
- ## STOP CONDITIONS
+ ## Procedure
- - Stop if the team root or active backend cannot be resolved.
- - Stop if the required backend write or read-back verification capability is unavailable.
- - Stop if merged content cannot be verified after the write.
- - Stop if a delete cannot be verified by an exact post-delete read-back.
- - Stop if the requested work produces no finalized fact but a caller asks for a durable write;
- report the no-op instead.
+ 1. Resolve the supplied team root and configured state backend.
+ 2. List and read every candidate inbox entry before acting.
+ 3. Merge only decisions that have explicit acceptance evidence.
+ 4. Deduplicate exact decision headings without rewriting unrelated decisions.
+ 5. Normalize nested headings while preserving relative hierarchy and fenced code blocks.
+ 6. Re-read `.squad/decisions.md` and verify the merged content before deleting an inbox entry.
+ 7. Refetch after deletion and verify the exact inbox entry is absent.
+ 8. Stop on any mismatch and report the incomplete operation.
- ## Examples
+ ## Stop Conditions
- `agent-collaboration` defines the inbox format used by contributors. The archival helpers in
- `packages/squad-sdk/src/state/io/archival.ts` enforce verified archive moves and fence-aware
- heading normalization.
+ - Stop if the team root, active backend, acceptance evidence, or required read-back capability is
+ unavailable.
+ - Stop if merged content or deletion cannot be verified exactly.
+ - Do not manufacture a durable record for a tentative request, onboarding observation, or
+ unaccepted recommendation.
## Anti-Patterns
- - Writing mutable backend state directly to an assumed local checkout
- - Deleting an inbox entry before its merged content is verified
- - Recording a transient request as a durable decision
- - Filling every agent history with a copy of the same operational procedure
+ - Writing session logs or specialist histories.
+ - Bypassing the state backend with branch switching, note-ref pushes, resets, or manual persistence.
+ - Deleting inbox content before verifying the canonical merge.
+ - Expanding a decision-only maintenance request into product or repository cleanup.