agentleFS
mayankjain1815-commitsmayankjain1815-commits/CITADEL/skills/unharness/SKILL.md

unharness

Skill4 starsChanged 4 months agoMITView on GitHub

Remove Citadel from a project. Exports valuable state (campaigns, postmortems, research, backlog, discoveries) to docs/citadel/ as human-readable markdown, then removes all harness files and hooks. The archive is detected by /do setup on re-install and offered for restore.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read .citadel/plugin-root.txt to locate the Citadel install.

    line 41
  2. Very specific:

    If missing, use the directory containing this SKILL.md as the fallback.

    line 42
  3. Distinctive:

    After the script completes, print:

    line 78
  4. Very specific:

    If the user wants to keep prior archives, they should commit docs/citadel/ to git first.

    line 113
  5. Distinctive:

    Never prompt the user before running — the export is the safety net, not a confirmation dialog

    line 129
  6. Distinctive:

    Always print the script output so the user can see exactly what happened

    line 130
  7. Distinctive:

    If the script errors, surface the error directly — don't swallow it

    line 131
  8. Distinctive:

    After the closing message in Step 3, output nothing further.

    line 135

≈ “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

/unharness — Remove Citadel from a Project

Orientation

Use when: removing Citadel from a project entirely -- exports state and cleans up hooks before uninstall. Don't use when: pausing campaign work (just stop or use /session-handoff); removing a single skill (delete its directory manually).

Invocation Forms

/unharness               # Export archive, then remove harness
/unharness --export-only # Export to docs/citadel/ without removing anything

Protocol

Step 1: FIND CITADEL ROOT

Read .citadel/plugin-root.txt to locate the Citadel install. If missing, use the directory containing this SKILL.md as the fallback.

cat .citadel/plugin-root.txt 2>/dev/null || echo "fallback"

Store as {citadelRoot}.


Step 2: RUN UNHARNESS SCRIPT

node {citadelRoot}/scripts/unharness.js

For --export-only:

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

The script:

  1. Scans .planning/ for valuable content (campaigns, postmortems, research, backlog, discoveries)
  2. Reads .citadel/project.md and .claude/harness.json for project metadata
  3. Writes docs/citadel/{category}.md files with citadel-archive: true frontmatter
  4. Removes .planning/, .citadel/, .claude/agent-context/
  5. Strips Citadel hook entries from .claude/settings.json (preserves user hooks)
  6. Prints a summary of what was exported and removed

Print the script output verbatim.


Step 3: CLOSING MESSAGE

After the script completes, print:

If archive was written:

Archive is at docs/citadel/ — commit it, delete it, or leave it.
Run /do setup again anytime to reinstall Citadel.
If you run setup in this project, it will find the archive and offer to restore your history.

If nothing was exported (empty project):

Citadel removed. No history to archive.
Run /do setup again anytime to reinstall.

If --export-only:

Archive written to docs/citadel/. Harness files left in place.
Run /unharness without --export-only to complete the removal.

Fringe Cases

Script not found: Report the error and explain the user can run the hook installer manually: node /path/to/Citadel/scripts/unharness.js

No .planning/ directory (harness was installed but never used): The script handles this gracefully — it skips the export and proceeds to cleanup. Nothing special needed.

docs/citadel/ already exists from a previous unharness: The script overwrites with the current timestamp. Prior archives are replaced. If the user wants to keep prior archives, they should commit docs/citadel/ to git first.

User runs unharness on a project that was never set up: The script exits cleanly with "Nothing to export." and nothing is deleted that shouldn't be.


Contextual Gates

Disclosure: "Removing Citadel from [project]. Exporting state to [path] before deletion. This is irreversible without reinstalling." Reversibility: red — removes hooks, clears .claude/settings.json entries, deletes .planning/. State export is made first, but reinstalling requires /setup. Trust gates:

  • Trusted (20+ sessions): irreversible unless reinstalled; exports state first.

Quality Gates

  • Never prompt the user before running — the export is the safety net, not a confirmation dialog
  • Always print the script output so the user can see exactly what happened
  • If the script errors, surface the error directly — don't swallow it

Exit Protocol

After the closing message in Step 3, output nothing further. Unharness is a terminal action — no HANDOFF block, no next-step suggestions. The session is now running without hooks.

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.