Install
$ agentstack add skill-yinjialu-context-harness-adapt-agent-backup ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README — it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming — see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps — measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Adapt Agent Backup
Use this skill when adding support for a new Code Agent source to context-harness.
First Read
Before editing, read:
docs/agent-backup-adapter-architecture.md- Existing collectors in
context_harness/collectors/ - Existing tests for Codex and Claude Code in
tests/
Workflow
- Identify the source id.
- Use lowercase kebab-case, for example
my-agent. - Infer the target Agent from the current runtime, app name, CLI name, repository metadata, process environment, or user prompt.
- Derive the id from that Agent name unless the user explicitly provides one.
- Ask the user for the target Agent only if it cannot be inferred with reasonable confidence.
- Use the same id in config, CLI, output directories, state keys, tests, and docs.
- Check whether the source is already supported.
- Search for the source id and common aliases in
context_harness/,tests/,skills/,README.md, andREADME.zh-CN.md. - Inspect
context_harness/cli.pysync choices,context_harness/config.py,context_harness/init.py,context_harness/collectors/, andcontext_harness/hooks/. - If support is complete, do not add a duplicate adapter. Instead, verify it with existing tests or a smoke command, then report that the source is already supported.
- If support is partial or broken, repair only the missing or failing pieces and preserve the existing source id and archive/state compatibility.
- Inspect the target Agent's local transcript format.
- Find default transcript paths.
- Identify session id, title, timestamps, roles, user messages, assistant messages, tool/noise events, and internal meta events.
- Check whether the Agent has a reliable stop/session hook. If not, implement manual sync only.
- Use synthetic or anonymized fixtures only.
- Add config and initialization.
- Update
context_harness/config.pywith a new source inAppConfigandload_config. - Update
context_harness/init.pywith default config andconversations/directory creation.
- Add a collector.
- Create
context_harness/collectors/.py. - Parse raw transcript files into
ConversationandMessage. - Ignore bad JSON lines, empty messages, tools, and internal metadata.
- Return
Nonefor sessions with no user-visible conversation. - Reuse
render_conversation,read_state,write_state, and the existingSyncResultpattern. - Support
latest,all_sessions, andsession_path.
- Register CLI commands.
- Add the source to
syncchoices incontext_harness/cli.py. - Dispatch to
sync_. - Respect
enabled = falsewith_disabled_result.
- Add hooks only when reliable.
- Create
context_harness/hooks/.pyonly if the Agent has a stable hook/config mechanism. - Hook commands should call
sync --hook-stdin. - Preserve unrelated user settings and make hook installation idempotent.
- Register hook install support in
context_harness/cli.py.
- Update docs and skills.
- Update
README.mdandREADME.zh-CN.md. - Add the source to the supported local AI coding assistants list in both README files.
- Prefer the target Agent's official product/docs URL for the link.
- Prefer an official favicon/logo URL from the Agent's website or docs for the icon; if no reliable official icon URL exists, use a plain text link instead of adding an unofficial asset.
- Update
skills/init-context/SKILL.mdandskills/sync-conversations/SKILL.md. - Keep skills as workflow instructions; keep behavior in the CLI.
- Add focused tests.
- Add fixtures under
tests/fixtures/. - Cover config defaults/custom paths, init directories/default config, collector archive output, skipped unchanged archives, missing source directory, latest mtime behavior, hook
session_pathoverride, noise filtering, bad JSON tolerance, filename stability, CLI sync, disabled source behavior, and hook idempotence if hooks are implemented.
- Verify.
- Run
uv syncif dependencies are not installed. - Run
uv run pytest. - Manually smoke test
uv run context-harness --context-home sync --latest 1when a fixture or local sample is available. - Keep changes small and complete; do not refactor unrelated modules.
- Prepare the PR for automated review.
- Add label
agent-backup-adapter. This label marks the PR as an Agent backup adapter and allows repository automation to run adapter-specific checks. - Add label
ai-reviewonly when an explicit Claude AI review is desired. This is a manual shortcut label and does not replaceagent-backup-adapter. - Include
Source id:in the PR body. - Include transcript path/format assumptions, hook support status, verification commands, and remaining risks.
- Optional AI review enhancement: if the repository has Codex GitHub integration enabled, comment
@codex review; if Claude Code GitHub Actions is enabled, either add labelai-reviewor comment@claude review this adapter PR against the adapt-agent-backup checklist. Any one of these is acceptable as an extra AI review signal.
PR Checklist
- The adapter produces Markdown archives in
context_home/conversations//. - The adapter writes incremental state to
context_home/state/-sync-state.json. - README supported-Agent lists, examples, default config, skills, CLI choices, and tests all use the same source id.
- Real user transcripts, memory, logs, state, and private machine config are not committed.
- PR has label
agent-backup-adapter, and its body includesSource id:. - PR has label
ai-reviewonly when a manual Claude AI review should be requested. - PR description states transcript format assumptions, hook support status, commands run, and remaining risks.
- The diff avoids unrelated rewrites and leaves existing behavior intact outside the new adapter path.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: yinjialu
- Source: yinjialu/context-harness
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.