continuity-ledger
Maintains a running decision log and context state across agent sessions, preventing context loss between clears and session boundaries. Use when: 'starting a new session on an ongoing project', 'context is getting heavy', 'preserve state before clearing', 'create a handoff document', 'pick up where I left off'.
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-25
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- continuity-ledger
- tier
- 1
- model
- sonnet
- agents
- [ "primary" ]
- inputs
- [ { "name": "session_context", "type": "string", "required": true, "description": "Description of the current session's work, decisions made, and state to preserve" }, { "name": "prior_ledger", "type": "ref", "format": "cas-ref", "required": false, "description": "Reference to a previous ledger entry to build upon (for multi-session chains)" } ]
- outputs
- [ { "name": "ledger", "type": "ref", "format": "cas-ref", "description": "YAML handoff document capturing session state, decisions, findings, and next steps" } ]
- category
- wisdom-garden
- triggers
- [ "starting a new session on an ongoing project", "context is getting heavy", "preserve state before clearing", "create a handoff document", "pick up where I left off" ]
- description
- Maintains a running decision log and context state across agent sessions, preventing context loss between clears and session boundaries. Use when: 'starting a new session on an ongoing project', 'context is getting heavy', 'preserve state before clearing', 'create a handoff document', 'pick up where I left off'.
- tool_dependencies
- [ "file_system" ]
03 SKILL.md 正文
Continuity Ledger
Purpose: Create structured YAML handoff documents that preserve session state -- decisions made, files modified, findings discovered, approaches tried, and concrete next steps -- so that a fresh session can resume work without context loss. Each clear/restart gets a clean context with full signal instead of degraded compacted context.
I. When to Use
- Before running
/clearwhen context usage is approaching 70%+ - At the end of a multi-day implementation session
- During complex refactors you expect to pick up and put down
- Any session expected to hit 85%+ context utilization
- When switching between projects and need to freeze state for later
When NOT to Use
- Quick tasks under 30 minutes
- Simple single-file bug fixes
- Sessions that will complete without approaching context limits
II. Why Clear + Ledger Instead of Compact
Each compaction is lossy compression. After several compactions, you are working with degraded context -- key decisions and file paths silently disappear. Clearing and loading the ledger gives a fresh context with full signal from the structured handoff document.
III. Workflow
Step 1: Determine Ledger Location
Check for existing handoff folders to maintain session continuity:
ls -td thoughts/shared/handoffs/*/ 2>/dev/null | head -1 | xargs basename
- If a handoff folder exists, use that session name
- If none exist, use
generalas the folder name - File path:
thoughts/shared/handoffs/{session-name}/YYYY-MM-DD_HH-MM_description.yaml
Step 2: Capture Session State
Gather the following from the current session:
- Goal -- what this session set out to accomplish (one line, shown in statusline)
- Now -- what the next session should do first (one line, shown in statusline)
- Test command -- a single command to verify the work (
go test ./...,npm test, etc.) - Done this session -- completed tasks with file references
- Decisions -- choices made and their rationale
- Findings -- key learnings and discoveries
- Worked/Failed -- approaches to repeat vs. avoid
- Next steps -- concrete action items for the next session
- Files -- created and modified file lists
Step 3: Write YAML Handoff
Write the ledger using this exact format (field names are parsed by the statusline -- do not rename them):
---
session: {session-name}
date: YYYY-MM-DD
status: complete|partial|blocked
outcome: SUCCEEDED|PARTIAL_PLUS|PARTIAL_MINUS|FAILED
---
goal: {What this session accomplished}
now: {What next session should do first}
test: {Verification command}
done_this_session:
- task: {Completed task description}
files: [file1.py, file2.py]
blockers: [{any blocking issues}]
questions: [{unresolved questions for next session}]
decisions:
- {decision_name}: {rationale}
findings:
- {key_finding}: {details}
worked: [{approaches that worked}]
failed: [{approaches that failed and why}]
next:
- {First next step}
- {Second next step}
files:
created: [{new files}]
modified: [{changed files}]
Step 4: Confirm and Mark Outcome
Ask the user for their assessment of the session outcome:
- SUCCEEDED -- task completed successfully
- PARTIAL_PLUS -- mostly done, minor issues remain
- PARTIAL_MINUS -- some progress, major issues remain
- FAILED -- task abandoned or blocked
Record the outcome in the YAML frontmatter.
IV. Resuming from a Ledger
To resume in a new session:
- Load the most recent handoff YAML
- Read the
goal:andnow:fields for immediate orientation - Run the
test:command to verify the baseline still holds - Review
decisions:andfindings:to restore context - Start executing from
next:list
V. Output
- A YAML handoff document at
thoughts/shared/handoffs/{session-name}/YYYY-MM-DD_HH-MM_description.yaml - Fields: session metadata, goal, now, test command, completed tasks with file refs, decisions with rationale, findings, worked/failed approaches, next steps, file manifest
- Target size: ~400 tokens (compact enough to load without significant context cost)
VI. Examples
Scenario 1: 3-hour refactor session approaching 75% context --> Ledger captures: goal="Migrate event system from callbacks to channels", now="Wire remaining 3 handlers in server/events.go", 5 completed tasks with 12 files, 2 architectural decisions (chose channels over callbacks because of backpressure support), 1 blocker (circular import in pkg/bus), 4 next steps.
Scenario 2: Multi-day feature across sessions --> First ledger: goal="Add WebSocket hub to gateway", now="Implement broadcast logic", outcome=PARTIAL_PLUS. Second session loads ledger, completes broadcast, writes new ledger: goal="WebSocket hub broadcast complete", now="Add integration tests for hub reconnection", outcome=SUCCEEDED.
Scenario 3: Session hit a dead end --> Ledger captures: outcome=PARTIAL_MINUS, failed=["Attempted to use SSE for bidirectional communication -- protocol is server-to-client only"], decisions=["Switch to WebSocket for bidirectional requirement"], now="Start fresh with WebSocket approach using the ws package".
VII. Edge Cases
- No prior handoffs exist: create the
thoughts/shared/handoffs/general/directory and start the first ledger - Session was purely exploratory with no code changes: still write the ledger capturing findings and decisions; set status to
completewith outcomeSUCCEEDEDand files sections empty - Multiple active session chains: use distinct session-name folders to keep ledgers separated by workstream
- Prior ledger referenced but file is missing: note the gap in the new ledger's findings and reconstruct what is known from git log and current file state
VIII. Anti-Patterns
- Writing the ledger after context is already degraded from multiple compactions -- write it early, at 70% context, not after the damage is done
- Using alternative field names (session_goal, objective, focus, current) -- the statusline parser expects exactly
goal:andnow: - Putting implementation details in the ledger instead of references -- the ledger points to files, it does not duplicate their contents
- Skipping the outcome marking step -- the outcome field drives session analytics and helps identify patterns in what causes partial/failed sessions
04 同仓库更多 Skills
kata-test-echo
暂无简介
kata-plain
An ordinary prose skill; not dispatchable.
kata-broken
暂无简介
voice-before-structure
Read the project's design language and philosophy before writing structural artifacts. Ground manifests, READMEs, and descriptions in the project's voice, not boilerplate. Use when creating manifests or READMEs for established projects, writing ecosystem-level documentation, building plugin descriptions or marketplace metadata, or authoring metadata that carries a project's identity. Trigger phrases: 'write the manifest', 'create a README', 'describe this plugin', 'ground yourself in the philosophy', 'ecosystem-level work'.
system-prompt-archaeology
Produces a named ADA disposition preset (YAML) and a layered behavioral analysis (structural decomposition + evidence-cited classifications) from a system prompt. Use when: "analyze this system prompt", "extract disposition from prompt", "reverse-engineer agent behavior", "what patterns does this prompt use", "build a preset from this prompt".
session-lifecycle-automation
Designs and configures all three loops of solo-operator session automation — session bookends, background maintenance agents, and a delegation flywheel. Use when setting up a new workspace, recovering from the 44% zero-artifact session leak, or preparing to scale delegation across multiple concurrent agents.