apply
audit decides what needs
fixing. apply does the fixing. The bridge is a structured
markdown file produced by the audit's interactive HTML report.
When to use it
- Right after running
groundwork audit --html, making decisions in the browser, and downloading the remediation plan. - When a teammate hands you a remediation plan and asks you to enact it.
When not to
- On a hand-written
.mdthat lacks thegroundwork-remediation: v1frontmatter marker. The command refuses by design. - When the underlying repo state has changed since the audit ran. Re-audit first; the plan references the state captured at audit time.
What it produces
- Edits to one or more files (usually
AGENTS.md, sometimespackage.jsonor aSKILL.md), each tied to a finding the user already decided on. - A short chat summary: what changed, what was skipped, what is deferred.
- The remediation file stays in place. Suggest committing it alongside the changes.
How it works
- Read and validate. YAML frontmatter parses,
groundwork-remediation: v1marker is present. Files without the marker are refused. - Build the action list, dry-run. Group actions by file. Show the user, ask for confirmation. Never touch files before consent.
- Pre-flight state check. For each
replace-line, confirm the target line still matches the recordedoriginal. Skip cleanly on mismatch; do not patch the wrong line. - Apply each action by kind:
replace-line,remove,append-to-section,add-stub,split-to-target,rewrite-link,create-target,add-frontmatter,rewrite-description,manual-review. - Verify. Run the fast verification command from
AGENTS.md. If it fails, offer to roll back viagit checkouton the touched files. Default to rolling back. - Report. Files touched, changes per file, skipped actions with reasons, deferred + dismissed counts, verification result, one next move.