agentleFS
yuanhaorannnnnnyuanhaorannnnnn/agent-skills/skills/passdown/SKILL.md

passdown

Skill0 starsChanged 58 days agoMITView on GitHub

Transfer context from a previous coding-agent session into the current one, or bring past discussion of a topic into an ongoing task. Trigger on "handoff", "接手上下文", "agent交接", "继续上一个agent的对话", "把以前关于 B 的讨论带到这里", or a fresh conversation continuing focused work. Auto-detects runtime and defaults to the current directory; advanced selection loads only when needed.

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 10 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Default: handoff, following the handoff workflow below.

    line 11
  2. Very specific:

    When the handoff target (交接对象) is a GPT model and the source (被交接对象) is DeepSeek or Gemini, enforce review + passdown: perform a read-only …

    line 40
  3. Very specific:

    When the source directory/runtime/session is specified, for fresh-conversation rollover, for optional archival, or for DeepSeek/Gemini → …

    line 102
  4. Distinctive:

    Read runtime quirks only when discovery or parsing needs runtime-specific handling.

    line 106
  5. Distinctive:

    Read-only on source side: Never write to or delete another agent's session storage.

    line 111
  6. Distinctive:

    Filter aggressively: Keep only user messages and assistant core replies.

    line 115
  7. Distinctive:

    If user gives another directory, use it as the source workspace even if the current shell is elsewhere.

    line 123
  8. Very specific:

    If no source directory was specified, use current cwd as --cwd.

    line 138
  9. Very specific:

    If the extractor returns No session found, manually locate the session:

    line 140
  10. Very specific:

    Codex: search ~/.codex/sessions by cwd/focus.

    line 143
  11. Distinctive:

    Do not read or inline large artifacts unless needed for the immediate next step.

    line 187
  12. Distinctive:

    When handing off from DeepSeek or Gemini to a GPT model, do not proceed directly from the extracted transcript to execution.

    line 191
  13. Distinctive:

    Direct code/runtime evidence: Check whether claimed test results or metrics actually exist on disk and were produced by verified runs (e.g.

    line 193
  14. Distinctive:

    Metric bugs & traps: Check for uncalibrated baselines, missing warmup frames, or bad geometric fits in source scripts.

    line 195
  15. Very specific:

    After presenting the handoff, if this was a same-runtime rollover and the archival contract in references/modes.md permits it, archive the …

    line 227
  16. Distinctive:

    If the handoff establishes durable context, create or update a Canon update card under:

    line 234

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Agent Handoff

Mode selection

  • Default: handoff, following the handoff workflow below.
  • /passdown --inject "<topic>": bring relevant past discussion into the current task. Natural-language requests to bring in a topic without handing off also select this mode. --inject is a skill-level parameter, not an extractor flag; pass its value to the extractor as --focus. Do not interpret an ordinary handoff --focus as topic mode.

Topic mode

Preserve the current task, its goal, active constraints and next step. Identify the topic and its relevance to that task; use the historical recall contract when looking for prior conclusions, then reuse the focused extractor and source-selection rules below where session context is needed. Default to the current workspace; honor an explicitly specified workspace, runtime, session, or archive scope. If relevant discussion may be elsewhere, report the searched scope and allow a specified broader scope. Inspect candidate source turns and surrounding context, including plausible semantic candidates, rather than treating a match as proof. Report incomplete coverage or missing source evidence; a miss does not prove absence.

Extract only material useful to the current task: relevant decisions, reasoning, disagreements and unresolved questions. Distinguish historical statements from verified current facts, preserve dates and source references, and verify current state when consequential. Old instructions, pending work, approvals and priorities are historical context only: do not adopt or execute them. Present a concise source-linked synthesis and its bearing on the current task, then continue that task within its existing authorization. Do not use the handoff output template, archival, or Canon promotion merely because context was retrieved; apply ordinary durable-knowledge rules if separate work warrants it.

Example: /passdown --inject "仿真验证边界" --dir /absolute/source/workspace → run extract_handoff.py --dir /absolute/source/workspace --focus "仿真验证边界" --json, verify relevant source passages, and return to the current task.

The remainder of this document describes shared retrieval constraints and the default handoff workflow. In topic mode, use the retrieval rules but do not run handoff-specific steps 3–7 or their output format.

Like tmux attach for coding agents. Read a previous agent's raw JSONL session log, extract the essential user/assistant conversation, and inject it into the current context.

passdown transfers context, not workspace ownership. For durable context and artifacts, follow the shared Canon contract:

/home/yhr/.agents/repos/agent-skills/references/canon-output-contract.md

Historical artifact recall

For historical summaries or conclusions, follow Historical recall before session search. This does not invoke a handoff unless session context is needed.

Core Rule

For handoff, transfer the conversation and relationship map, not the implementation files. The goal is to understand what the user was doing, what decisions were made, what artifacts matter, and what the next step is. Topic mode instead selects only context relevant to the current task.

When the handoff target (交接对象) is a GPT model and the source (被交接对象) is DeepSeek or Gemini, enforce review + passdown: perform a read-only audit on the pending handoff content and evidence before completing the handoff.

Minimal entry

For same-directory handoff, run:

python3 <skill-dir>/scripts/extract_handoff.py --focus "<topic>" --json

For a focused search, auto combines keyword matches with up to three local semantic candidates. Keyword matches are scored on parsed user/assistant turns, not tool calls, tool outputs, or other raw JSONL fields. It ranks by query terms and their frequency within the permitted session scope; common terms cannot by themselves dominate a multi-term query. Multiple distinctive terms normally need one turn; adjacent user-to-assistant turns can also match when each contributes a different rare term. This narrow rule can still miss wording spread across more turns or join unrelated adjacent statements, so read both turns. A recognized four-line automation wrapper is excluded from candidate scoring and embeddings, but its full instruction is included in handoff turns so task restrictions remain visible. Its task name and ID remain in automation_contexts, and the ID can identify its actual assistant results; an ID-only match may represent a run without a result. Before acting on an automation handoff, if instruction_status is truncated or omitted, read the original session to recover the complete task restrictions. The local optional jieba package segments Chinese queries; if unavailable, a literal fallback is used and is reported in keyword_status.tokenizer. Inspect semantic_status.matches even when keyword results exist; for a plausible candidate, read its original session and verify relevance. The returned ordinal and character offset locate the matched passage within the parsed source turn; when using --session or --file, check the source passage directly if the handoff reports truncation. When semantic_passage_truncated is true, the token budget was too small for the whole matched passage and the original must be checked before drawing a conclusion. Semantic-only candidates do not enter a keyword-matched handoff automatically; when there are no keyword hits, extracted semantic candidates remain unverified. The model and private, disposable session index are local; no transcript text is stored in the index. Semantic scores are not proof of relevance: read the returned source turns and reject unrelated candidates. The JSON semantic_status reports fresh versus in-scope sessions and sampled long sessions; incomplete coverage means a miss cannot establish that no relevant conversation exists. Indexing advances incrementally on focused calls and may sample long sessions. A changed session is re-indexed; failure or a missing model falls back to the existing retrieval. Set PASSDOWN_EMBEDDING_MODEL_PATH to a local multilingual-e5-small model to override the default model location, and PASSDOWN_SEMANTIC_STATE_DIR to relocate the private index. Set PASSDOWN_DISABLE_SEMANTIC=1 to restore the legacy automatic retriever, or use --retriever keyword for keyword-only search. --retriever zvec remains the legacy character-feature index, not the semantic model.

Codex search excludes archived conversations by default. Add --archived to include both ~/.codex/sessions and ~/.codex/archived_sessions (not archive-only). An explicit --session <id> searches both stores without requiring the flag; --file reads the specified file directly. These are read-only selections, not permission to archive, restore, or resume the source conversation. When default search finds nothing, report that archives were excluded; do not claim no historical record exists or silently broaden the search.

python3 <skill-dir>/scripts/extract_handoff.py --former codex --archived --focus "<topic>" --json
python3 <skill-dir>/scripts/extract_handoff.py --former codex --session <id> --json

When the source directory/runtime/session is specified, for fresh-conversation rollover, for optional archival, or for DeepSeek/Gemini → GPT handoff, read mode routing and review contract before acting. The latter requires read-only Review + Passdown, not transcript extraction alone. Read runtime quirks only when discovery or parsing needs runtime-specific handling.

Non-Negotiable Constraints

  • Read-only on source side. Never write to or delete another agent's session storage. Conversation archival, when the mode routing contract permits it, is a runtime lifecycle operation, not a session-file edit.
  • Artifacts by reference. In cross-directory handoff, artifacts remain owned by the source workspace. Use absolute paths. Do not copy .planning, .proposal, .research, .agent-state, build outputs, logs, images, tarballs, or reports unless the user explicitly asks for a portable bundle.
  • Filter aggressively. Keep only user messages and assistant core replies. Drop tool call arguments, tool results, system/developer prompts, guardian/judge subflows, token logs, and raw system dumps.
  • Respect token budget. Enforce the extractor's hard token budget. Prefer recent turns, initial context, focus hits, explicit decisions, and next steps.
  • Always show what you learned. For handoff, present source agent, source cwd, current cwd, session file, candidate count, turn count, token estimate, key decisions, artifacts, pending work, and next step. For topic mode, use the concise source-linked synthesis specified above.

Workflow

Step 1: Identify source agent, source workspace, and focus

If user gives another directory, use it as the source workspace even if the current shell is elsewhere.

Examples:

/passdown --former claude --dir /path/to/CarlaUE5 --focus "JHBN-7679"
/passdown --former codex --dir /path/to/agent-skills --focus "Canon migration"

Step 2: Run extractor

python3 <skill-dir>/scripts/extract_handoff.py --former <agent> --dir <source-workspace> --focus "<topic>" --json

If no source directory was specified, use current cwd as --cwd.

If the extractor returns No session found, manually locate the session:

  • Claude Code: ls ~/.claude/projects/-<slug>/*.jsonl, where slug replaces / and _ with -.
  • Codex: search ~/.codex/sessions by cwd/focus; include ~/.codex/archived_sessions only with --archived or an explicit session ID. Preserve this scope in manual/tool fallback too; use list_archived_threads only when archives are in scope.
  • Pi: ls -t ~/.pi/agent/sessions/--<cwd-with-dashes>--/.
  • DSH: ls -t ~/.dsh/sessions/--<cwd-with-dashes>--/; each subdirectory is a session id holding session.jsonl.zstd.

Then rerun with --file.

Step 3: Extract, filter, and compress

The extractor handles:

  • Codex TRANSCRIPT mode for guardian-wrapped sessions
  • Codex direct mode fallback
  • Pi message JSONL
  • Claude Code project JSONL
  • DSH zstd-compressed session JSONL
  • focus-ranked candidate selection
  • local semantic candidates plus keyword search for focused queries; optional legacy zvec retrieval

The extractor enforces --max-tokens before returning JSON. When compressing the selected turns into the final handoff, keep:

  1. first 1-2 turns for initial context
  2. last 3 turns for current state
  3. focus-relevant turns
  4. explicit decisions, approvals, rejected options, and next steps

Drop tool execution noise, repeated clarifications, and raw system/developer text.

Step 4: Build artifact map

For same-directory and cross-directory handoff, produce an artifact map when paths are visible in the transcript or standard workspace files:

Source workspace: /absolute/source/workspace
Current workspace: /absolute/current/workspace

Relevant artifacts:
- /absolute/source/.planning/... — runtime plan, referenced only
- /absolute/source/.proposal/... — proposal/report artifact, referenced only
- /absolute/source/.agent-state/... — runtime recap, referenced only
- /media/yhr/2T/Canon/tasks/... — durable task page when present
- /media/yhr/2T/Canon/raw/update-cards/... — ingest/update card when present

Do not read or inline large artifacts unless needed for the immediate next step. Prefer an index first.

Step 4b: Review Gate for DeepSeek/Gemini source (Review + Passdown)

When handing off from DeepSeek or Gemini to a GPT model, do not proceed directly from the extracted transcript to execution. Perform a read-only evidence audit:

  • Direct code/runtime evidence: Check whether claimed test results or metrics actually exist on disk and were produced by verified runs (e.g. check logs, output images, exit codes).
  • Hypothesis boundary: Flag claims that were derived from LLM code reading rather than physical/dynamic runs (e.g. static configuration differences vs dynamic runtime causes).
  • Metric bugs & traps: Check for uncalibrated baselines, missing warmup frames, or bad geometric fits in source scripts.

Record findings under ## Review Gate Findings. Downgrade any unverified causal claim to an open hypothesis before formatting the final handoff.

Step 5: Format handoff

For short sessions (<15 turns), include the full filtered transcript. For long sessions, include first 2 turns, last 3 turns, focus-relevant decisions, and a compact summary.

Use this structure:

## Agent Handoff — <source agent> session

Source workspace: `<source cwd>`
Current workspace: `<current cwd>`
Focus: `<focus or none>`
Session file: `<path>`
Extracted turns: `<N>`

[... transcript or compressed transcript ...]

## Key Decisions

## Review Gate Findings (when Review + Passdown applies)

## Artifact Map

## Current Next Step

Step 6: Same-runtime archival (optional)

After presenting the handoff, if this was a same-runtime rollover and the archival contract in references/modes.md permits it, archive the source conversation and report the archived source session id plus the successor id. Otherwise leave the source untouched and state why.

Step 7: Canon promotion

If the handoff establishes durable context, create or update a Canon update card under:

/media/yhr/2T/Canon/raw/update-cards/

Promote stable facts into Canon task/project/decision/pattern/incident pages only when the durable target is clear. If not clear, keep the update card as the ingest bridge.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.