Detach Govctl
Stop using govctl in a project while preserving its governance history and
unrelated user configuration. Detachment is destructive integration cleanup,
not artifact deletion.
Read-Only Inventory
Do not mutate anything during discovery. Inspect:
gov/config.toml and the full gov/ tree;
- configured documentation, source-scan, and agent-asset paths;
- project-local skills and reviewer agents attributable to govctl;
- hooks, plugin metadata, project instructions, and editor configuration that
invoke or require govctl;
[[RFC-...]], [[ADR-...]], [[WI-...]], and other governed references in
source and configuration; and
- the logical-to-resolved mapping for every candidate path, using symlink
metadata to inspect each existing ancestor without assuming containment; and
- existing
gov.archived/, working-copy changes, ignore rules, and destination
collisions.
Use structured parsers for structured configuration. Use rg for reference and
text discovery. Treat generated projections under configured documentation
paths as historical output and preserve them by default.
Ownership must be established before removal. A matching filename or a mention
of govctl is evidence to inspect, not proof that an entire file or directory
is govctl-owned. When ownership is ambiguous, preserve the content and list it
for manual review.
Hard Stops
- Present a file-level mutation plan and obtain explicit confirmation before
changing anything. Approval applies only to that stated plan.
- Never delete the authoritative
gov/ tree; archive it.
- Stop on an existing archive destination instead of overwriting, merging, or
inventing a new destination without user agreement.
- Require
gov/, its archive destination, and their existing ancestors to be
non-symlink paths contained by the project root.
- Do not remove a shared skills, agents, hooks, plugin, editor, or instruction
directory as a unit unless the inventory proves the directory is wholly
govctl-owned.
- Default all other mutations to resolved targets contained by the project
root. A symlinked or external target requires separate exact authorization
after showing its logical path, resolved target, and symlinked ancestors.
- Do not discard unrelated working-copy changes or non-govctl configuration.
- Do not strip plain historical prose merely because it mentions an RFC, ADR,
Work Item, or govctl.
- After archiving
gov/, do not invoke project-scoped govctl commands unless
the archive is first restored.
- Stop on the first unexpected mutation failure and report completed and pending
operations; do not continue into a less recoverable partial state.
Mutation Plan
The dry-run report must identify:
- the exact logical and resolved archive source and proposed destination;
- every file to remove;
- every structured configuration entry or text span to edit;
- references that will be removed, retained as useful archival prose, or left
for manual review;
- generated documentation and unrelated assets that will remain untouched;
- existing changes that overlap the plan;
- a recoverable baseline for every edited or removed file; and
- restoration steps derived from those baselines and the proposed operations.
Resolve destination collisions and ambiguous ownership before asking for final
confirmation. Re-run the inventory if the user changes the scope.
Execution Policy
Apply the confirmed plan in a recoverable order:
- Preserve the authoritative governance tree by renaming the confirmed,
non-symlinked
gov/ path to the confirmed non-conflicting, non-symlinked
archive path.
- Remove only verified project-local govctl assets. In shared directories,
remove individual owned entries and retain the container.
- Edit hooks and structured configuration surgically, preserving unrelated
entries and valid file structure.
- Remove governed reference markup from source only where the remaining
comment stays accurate. Delete a reference-only comment when it has no other
meaning; preserve useful historical context as plain prose when appropriate.
- Remove govctl-specific instruction sections without altering neighboring
project policy.
- Clean up a directory only when it is empty and was part of the confirmed
plan.
Do not automatically rewrite ignore policy. Report archive tracking or ignore
implications and apply a change only when it was included in the confirmed
plan.
Recovery
Keep an operation record in the final response, not in the archived governed
artifacts. If an edit fails, preserve the archive and successfully completed
changes, stop, and explain the exact restoration or continuation steps. Never
claim atomic detachment when the filesystem operations were not transactional.
Restoration starts by resolving any new gov/ collision, moving the confirmed
archive back to gov/, and reinstalling project-local assets only where they
were removed. Derive the remaining restoration steps from the recorded plan
rather than promising a fixed one-command undo.
Completion Evidence
Detachment is complete when:
- the governance tree exists at the confirmed archive path;
- no active project hook, instruction, or verified govctl-owned local asset
still activates the integration;
- source edits preserve code behavior and meaningful comments;
- configured generated documentation and unrelated user assets remain
untouched unless the user explicitly included them;
- a final scan reports remaining ambiguous or intentionally preserved mentions;
and
- the final report lists archived, removed, edited, preserved, and unresolved
paths plus restoration guidance.
Use commit if the user wants the confirmed detachment recorded in VCS.
1---2name: detach3description: Remove project-local govctl integration through an ownership-aware dry run, archival plan, explicit confirmation, and recoverable edits4---56# Detach Govctl78Stop using govctl in a project while preserving its governance history and9unrelated user configuration. Detachment is destructive integration cleanup,10not artifact deletion.1112## Read-Only Inventory1314Do not mutate anything during discovery. Inspect:1516- `gov/config.toml` and the full `gov/` tree;17- configured documentation, source-scan, and agent-asset paths;18- project-local skills and reviewer agents attributable to govctl;19- hooks, plugin metadata, project instructions, and editor configuration that20 invoke or require govctl;21- `[[RFC-...]]`, `[[ADR-...]]`, `[[WI-...]]`, and other governed references in22 source and configuration; and23- the logical-to-resolved mapping for every candidate path, using symlink24 metadata to inspect each existing ancestor without assuming containment; and25- existing `gov.archived/`, working-copy changes, ignore rules, and destination26 collisions.2728Use structured parsers for structured configuration. Use `rg` for reference and29text discovery. Treat generated projections under configured documentation30paths as historical output and preserve them by default.3132Ownership must be established before removal. A matching filename or a mention33of `govctl` is evidence to inspect, not proof that an entire file or directory34is govctl-owned. When ownership is ambiguous, preserve the content and list it35for manual review.3637## Hard Stops3839- Present a file-level mutation plan and obtain explicit confirmation before40 changing anything. Approval applies only to that stated plan.41- Never delete the authoritative `gov/` tree; archive it.42- Stop on an existing archive destination instead of overwriting, merging, or43 inventing a new destination without user agreement.44- Require `gov/`, its archive destination, and their existing ancestors to be45 non-symlink paths contained by the project root.46- Do not remove a shared skills, agents, hooks, plugin, editor, or instruction47 directory as a unit unless the inventory proves the directory is wholly48 govctl-owned.49- Default all other mutations to resolved targets contained by the project50 root. A symlinked or external target requires separate exact authorization51 after showing its logical path, resolved target, and symlinked ancestors.52- Do not discard unrelated working-copy changes or non-govctl configuration.53- Do not strip plain historical prose merely because it mentions an RFC, ADR,54 Work Item, or govctl.55- After archiving `gov/`, do not invoke project-scoped govctl commands unless56 the archive is first restored.57- Stop on the first unexpected mutation failure and report completed and pending58 operations; do not continue into a less recoverable partial state.5960## Mutation Plan6162The dry-run report must identify:6364- the exact logical and resolved archive source and proposed destination;65- every file to remove;66- every structured configuration entry or text span to edit;67- references that will be removed, retained as useful archival prose, or left68 for manual review;69- generated documentation and unrelated assets that will remain untouched;70- existing changes that overlap the plan;71- a recoverable baseline for every edited or removed file; and72- restoration steps derived from those baselines and the proposed operations.7374Resolve destination collisions and ambiguous ownership before asking for final75confirmation. Re-run the inventory if the user changes the scope.7677## Execution Policy7879Apply the confirmed plan in a recoverable order:80811. Preserve the authoritative governance tree by renaming the confirmed,82 non-symlinked `gov/` path to the confirmed non-conflicting, non-symlinked83 archive path.842. Remove only verified project-local govctl assets. In shared directories,85 remove individual owned entries and retain the container.863. Edit hooks and structured configuration surgically, preserving unrelated87 entries and valid file structure.884. Remove governed reference markup from source only where the remaining89 comment stays accurate. Delete a reference-only comment when it has no other90 meaning; preserve useful historical context as plain prose when appropriate.915. Remove govctl-specific instruction sections without altering neighboring92 project policy.936. Clean up a directory only when it is empty and was part of the confirmed94 plan.9596Do not automatically rewrite ignore policy. Report archive tracking or ignore97implications and apply a change only when it was included in the confirmed98plan.99100## Recovery101102Keep an operation record in the final response, not in the archived governed103artifacts. If an edit fails, preserve the archive and successfully completed104changes, stop, and explain the exact restoration or continuation steps. Never105claim atomic detachment when the filesystem operations were not transactional.106107Restoration starts by resolving any new `gov/` collision, moving the confirmed108archive back to `gov/`, and reinstalling project-local assets only where they109were removed. Derive the remaining restoration steps from the recorded plan110rather than promising a fixed one-command undo.111112## Completion Evidence113114Detachment is complete when:115116- the governance tree exists at the confirmed archive path;117- no active project hook, instruction, or verified govctl-owned local asset118 still activates the integration;119- source edits preserve code behavior and meaningful comments;120- configured generated documentation and unrelated user assets remain121 untouched unless the user explicitly included them;122- a final scan reports remaining ambiguous or intentionally preserved mentions;123 and124- the final report lists archived, removed, edited, preserved, and unresolved125 paths plus restoration guidance.126127Use `commit` if the user wants the confirmed detachment recorded in VCS.