Unharness

From SethGammon/Citadel · View interactive version

Unharness is an AI agent skill from the GitHub repository SethGammon/Citadel. Safely leave Citadel using the active adoption receipt. Produces a no-write, reviewable plan, preserves a portable archive, removes only exact owned material, and reports modified or externally registered surfaces as retained or unknown. Legacy installs must be imported before exact leave is claimed

How to use this skill

Skill file

/unharness - Receipt-owned exit from Citadel

Orientation

Use this skill when the user wants Citadel removed from a project. Exit is a

two-step, receipt-owned operation. A plan never mutates the project. Apply

requires the exact saved plan and its confirmation token.

Do not infer ownership from familiar paths. Do not delete .planning/,

.citadel/, runtime settings, hooks, skills, or registrations merely because

they look Citadel-related.

Protocol

1. Locate Citadel and inspect adoption authority

Read .citadel/plugin-root.txt when present. Otherwise use the directory

containing this skill. Check for .citadel/adoption/active.json; the adoption

planner also checks the private recovery ledger.

2. Create a no-write leave plan

Choose a plan path inside the project, such as

.planning/adoption/leave.plan.json, and run:

node {citadelRoot}/scripts/adopt.js leave plan \
  --target {projectRoot} \
  --out {planPath} \
  --json

Show the user:

If the result is NOT_ADOPTED, stop. Create a conservative legacy inventory:

node {citadelRoot}/scripts/adopt.js import plan {citadelRoot} \
  --target {projectRoot} \
  --out {importPlanPath} \
  --json

Apply that import only after its own explicit approval. Then create a new leave

plan from the resulting receipt. Never describe legacy cleanup as exact

removal.

3. Obtain explicit approval

Leaving is destructive. Ask the user to approve the displayed plan and exact

confirmation token. Do not apply from an unsaved or regenerated plan.

4. Apply and verify

After approval:

node {citadelRoot}/scripts/adopt.js leave apply {planPath} \
  --confirm {confirmationToken} \
  --json

node {citadelRoot}/scripts/adopt.js doctor \
  --target {projectRoot} \
  --json

Doctor may report not_adopted after a clean leave. Report the leave receipt,

archive path, removed entries, retained conflicts, and every unknown

unregistration observation. “Citadel removed” is permitted only when the

receipt proves every required local and external removal.

Export-only compatibility

When the user explicitly wants a human-readable export without leaving:

node {citadelRoot}/scripts/unharness.js {projectRoot} --export-only

This writes the legacy Markdown archive but does not remove harness material.

Fringe Cases

show the setup/import hint; do not create it merely to leave.

private-ledger recovery; never guess ownership.

observation required.

Quality gates

pre-images.

remain exact.

unknown or blocked, never successful.

and recovery.

Exit Protocol

Return the leave operation ID and receipt digest, portable archive path, exact

removed/restored counts, retained conflicts, and unknown external removals.

State plainly whether exact exit was proved. Do not claim success from a

completed command when required removal evidence is missing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.