agent-comms
SendMessage recipient validation and worktreePath safety (CWE-59). TRIGGER when: validating a SendMessage `to:` recipient against the agent whitelist, or a…
3-tier markdown memory protocol (shared/agent/conversation) for cross-session knowledge. TRIGGER when: reading or writing agent memory files, choosing which memory tier an insight belongs in, or starting a task needing prior context. SKIP: vector recall (use
$ npx -y skills add komluk/scaffolding --skill agent-memory --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/agent-memoryContext preview
The summary Claude sees to decide when to auto-load this skill.
3-tier markdown memory protocol (shared/agent/conversation) for cross-session knowledge. TRIGGER when: reading or writing agent memory files, choosing which memory tier an insight belongs in, or starting a task needing prior context. SKIP: vector recall (use
name: agent-memory description: "3-tier markdown memory protocol (shared/agent/conversation) for cross-session knowledge. TRIGGER when: reading or writing agent memory files, choosing which memory tier an insight belongs in, or starting a task needing prior context. SKIP: vector recall (use semantic-memory-mcp); distilling conversations into candidates (use distill)."
3-tier persistent memory system for cross-session knowledge accumulation.
| Tier | Path | Scope | Written By | Read By | |------|------|-------|------------|---------| | **Shared** | `.scaffolding/agent-memory/shared/KNOWLEDGE.md` | Whole project | Any agent | All agents | | **Agent** | `.scaffolding/agent-memory/agents/{agent-name}/MEMORY.md` | Per agent | Owning agent | Own agent + architect | | **Conversation** | `.scaffolding/conversations/{conversation_id}/agent-memory/context.md` | Per conversation | Any agent in conversation | Agents in same conversation |
Memory is auto-injected into agent context via `recall_for_agent()` in the task execution pipeline. When a task starts, the system reads: 1. `.scaffolding/agent-memory/shared/KNOWLEDGE.md` (always) 2. `.scaffolding/agent-memory/agents/{agent-name}/MEMORY.md` (when agent_name is known) 3. `.scaffolding/conversations/{id}/agent-memory/context.md` (when conversation_id is provided)
This means agents receive memory context automatically. Manual reading on first turn is optional but recommended for verifying latest data.
Before starting work, optionally read available memory for latest content (skip if files don't exist):
1. Read `.scaffolding/agent-memory/shared/KNOWLEDGE.md` 2. Read `.scaffolding/agent-memory/agents/{your-agent-name}/MEMORY.md` 3. If `conversation_id` is provided in task context: Read `.scaffolding/conversations/{conversation_id}/agent-memory/context.md`
Write significant findings to the appropriate tier:
Save here:
Do NOT save:
Save here:
Do NOT save:
Save here:
Do NOT save:
Agents with `disallowedTools: Write, Edit` (architect, reviewer) cannot write to `.scaffolding/agent-memory/` directly. These agents should report findings in their output, and writable agents in the same conversation chain can persist them.
File-based memory (this skill) is the **hot** layer — auto-injected into every agent context under a 200-line budget, so keep it lean: stable, high-level facts and pointers only. Push detailed prose and rarely-needed, fuzzy-discoverable knowledge to the **cold** layer (vector store) via the `semantic-memory-store` skill — it only surfaces on similarity match and carries no per-turn token cost. Durable source-of-truth facts still get a file here; the cold copy is for natural-language recall.
**Local-only carve-out:** secrets and memory/MCP recovery procedures NEVER go to the cold vector store. Recovery info must stay readable when the store itself is down (a 401 means you cannot query the store to learn how to fix it), and secrets must not be embedded in a remote/shared backend. Keep these as file memory only.
If memory files don't exist, create them with the appropriate header:
# Shared Knowledge <!-- Cross-agent project knowledge. Max 200 lines. -->
# {Agent Name} Memory
<!-- Agent-specific patterns and lessons. Max 200 lines. --># Conversation {conversation_id} Context
<!-- Decisions and findings for this conversation chain. -->Conversation memory is always available via file-based recall. When a task runs with a `conversation_id`, the system reads `context.md` and injects it into the agent's context. No database setup is required for conversation-tier memory.
The `/learn` command closes the loop between a finished conversation and the memory tiers above. It distills one conversation into knowledge candidates (via the `distill` skill's Conversation-Scoped Distillation mode) and routes each candidate back into this memory system.
| Candidate kind | Target tier | File | |----------------|-------------|------| | Cross-cutting project fact | Shared | `.scaffolding/agent-memory/shared/KNOWLEDGE.md` | | Domain-specific pattern or lesson | Agent | `.scaffolding/agent-memory/agents/
Spec-driven multi-agent orchestration for Claude Code — pure markdown, zero backend, runs on the stock runtime. 13 agents, 36 skills, 19 commands, 15 hooks, per-phase model tiers, opt-in lifecycle hooks, optional cross-device semantic memory.
Repo: komluk/scaffolding
SendMessage recipient validation and worktreePath safety (CWE-59). TRIGGER when: validating a SendMessage `to:` recipient against the agent whitelist, or a…
RESTful API design standards: resource naming, HTTP methods, status codes, pagination, versioning. TRIGGER when: designing new API endpoints, defining error…
Optimize Claude Code context-window usage for accuracy and cost. TRIGGER when: hitting context limits, structuring prompts for an agent, or trimming what gets…
Schema design, index strategy, migration safety, and query analysis. TRIGGER when: designing tables or indexes, writing a migration, or diagnosing a slow…
Knowledge distillation methodology: candidate extraction, confidence scoring, tier routing, conversation-scoped mode. TRIGGER when: running /learn or /distill,…
Docker multi-stage build templates, image security, and docker-compose patterns. TRIGGER when: writing a Dockerfile, composing services, or hardening a…