From jsf
Software factory memory protocol — use when reading or writing factory state. Covers JSONL memory operations, well-known keys, and agent startup protocol.
How this skill is triggered — by the user, by Claude, or both
Slash command
/jsf:memory-protocolThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Factory agents share state via a JSONL memory file managed by `scripts/memory.py`.
Factory agents share state via a JSONL memory file managed by scripts/memory.py.
${CLAUDE_PLUGIN_DATA}/memory.jsonl — persists across sessions and agent invocations.
CLAUDE_PLUGIN_DATA is set by Claude Code. In local testing: export CLAUDE_PLUGIN_DATA=~/.factory.
# Write a value — returns UUID of the new entry
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/memory.py" write \
--key "phase_status" --value '{"phase":"planning","status":"complete"}' \
--tags "phase,orchestration" --agent "${SF_AGENT_ID}"
# Read latest value for a key
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/memory.py" read --key "phase_status"
# Query by tag (returns JSONL of full entries)
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/memory.py" query --tag "phase"
# List all live keys (call this at agent startup to discover state)
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/memory.py" list-keys
# Delete a specific entry by UUID
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/memory.py" delete --id "<uuid>"
# Garbage collect expired entries (orchestrator calls at session start)
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/memory.py" gc
| Key | Written by | Content |
|---|---|---|
clarification_summary | clarifier agent | Confirmed Q&A from the user |
implementation_plan | planner agent | Ordered phases with specs |
phase_complete:<name> | implementer agent | Test results, files changed |
review_result:<name> | reviewer agent | Security review outcome |
validation_confirmed:<name> | validator agent | User confirmation timestamp |
checkpoint:<name> | orchestrator | Git commit SHA |
main_trace_id / main_span_id | orchestrator | Root OTEL trace context |
phase_trace:<name> / phase_span:<name> | orchestrator | Sub-trace context per phase |
Every agent MUST do this before any other action:
list-keys — discover what state existsread --key agent_context — get task assignment and trace ID from orchestratorSF_AGENT_ID and SF_TRACE_ID from the agent contextSF_AGENT_ID — entries without it are hard to tracegc is only called by the orchestrator at session start — not by subagents--ttl 300 (5 minutes) so crashes don't leave stale locksGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub jmeagher/software-factory --plugin jsf