Arness Catch-Up
Developers sometimes bypass the pipeline for quick fixes -- the "2am gap." These commits ship without specs, plans, or records, leaving holes in the artifact trail. Catch-up scans git history, identifies commits that have no corresponding Arness artifacts, and generates lightweight CATCHUP_ records in the CHANGE_RECORD.json envelope. The records are honest about what can and cannot be recovered retroactively: they document what changed (files, diffs, commit messages) and explicitly flag what is unknown (intent, test coverage, architectural reasoning).
This is a standalone skill. It operates outside the main pipeline and can be run at any time.
Step 0: Ensure Configuration
Read ${CLAUDE_PLUGIN_ROOT}/skills/arn-code-ensure-config/references/step-0-fast-path.md and follow its instructions. This guarantees a user profile exists and ## Arness is configured with Arness Code fields before proceeding.
Step 1: Load Configuration
Read the ## Arness section from CLAUDE.md. Extract the following fields:
- Plans directory -- where Arness project artifacts live (CHANGE_RECORD.json files, SWIFT_, STANDARD_, CATCHUP_* directories)
- Specs directory -- where spec files live (for boundary detection)
- Code patterns -- path to pattern documentation (for pattern refresh in Step 6)
- Template path -- path to report templates (for CATCHUP_REPORT_TEMPLATE.json)
- Template version -- plugin version the templates were copied from (if present)
- Template updates -- user preference:
ask,auto, ormanual(if present)
Template version check: If Template version and Template updates fields are present, run the template version check procedure documented in ${CLAUDE_PLUGIN_ROOT}/skills/arn-code-save-plan/references/template-versioning.md before proceeding. If ## Arness does not contain these fields, treat as legacy and skip.
Validate that all paths exist. If the plans directory does not exist, inform the user: "Plans directory not found. Run /arn-planning to set up Arness." and exit.
Step 2: Determine Scan Range
Read ${CLAUDE_PLUGIN_ROOT}/skills/arn-code-catch-up/references/cross-reference-algorithm.md for the scan range detection procedure.
Execute the three-tier fallback:
- Search git log for the most recent commit with a
[swift],[standard],[thorough], or[catchup]tier tag. - If not found, read
PROGRESS_TRACKER.jsonfiles in the plans directory and use the most recentlastUpdatedtimestamp. - If neither found, use 30 days before the current date.
Display:
Scanning commits from <date> to HEAD (<N> commits in range).
Scan range determined by: <method> (tier-tag commit | progress tracker | 30-day default)
Offer override:
Adjust scan range? (Enter a date or commit hash, or press Enter to continue)
If the user provides a date or commit hash, adjust the scan start accordingly.
Step 3: Cross-Reference and Identify Untracked Commits
Follow the cross-reference algorithm from ${CLAUDE_PLUGIN_ROOT}/skills/arn-code-catch-up/references/cross-reference-algorithm.md.
Execute these steps in order:
-
Collect commits: Run
git log --format='%H|%aI|%s' --no-merges --after=<scan-start>to get all commits in range. Validate commit hashes as 40-character hex strings. -
Primary match: Scan all
CHANGE_RECORD.jsonfiles in the plans directory. ExtractcommitHashfields. Mark any commit whose hash appears in a CHANGE_RECORD as "tracked". -
Secondary match -- tier tags: If a commit message contains
[swift],[standard],[thorough], or[catchup], mark as "tracked". -
Secondary match -- file overlap: For remaining unmatched commits, run
git diff-tree --no-commit-id --name-only -r <hash>to get modified files. Compare againstfilesModifiedandfilesCreatedarrays in CHANGE_RECORD.json files. If >80% file overlap with any CHANGE_RECORD, mark as "likely tracked". -
Report file scanning: Check if any
IMPLEMENTATION_REPORT_*.jsonorTESTING_REPORT_*.jsonfiles reference the commit hash. -
Idempotency check: Scan existing CATCHUP_ CHANGE_RECORD.json files for
catchup.coveredCommitsarrays. Exclude any commit whose hash already appears in a previous catch-up record. -
Boundary detection: Identify commits whose dates precede the earliest Arness artifact. Classify these as "pre-Arness".
Classify each commit as one of:
- tracked -- matched to an existing Arness artifact
- likely tracked -- high file overlap with an existing artifact (needs user confirmation)
- untracked -- no match found
- pre-Arness -- predates the earliest Arness artifact
Step 4: Present Overview and Confirm
Display the findings:
Scan Results
============
Total commits in scan range: <N>
Tracked (matched to Arness artifacts): <N>
Likely tracked (file overlap match): <N>
Untracked: <N>
Pre-Arness (predates earliest artifact): <N>
If there are "likely tracked" commits, list them for manual confirmation:
The following commits have >80% file overlap with existing artifacts:
<short-hash> <message> -- overlaps with <CHANGE_RECORD path>
...
Mark these as tracked? (They will be excluded from catch-up records if confirmed.)
Display the proposed batching tier:
- 1-5 untracked: "Batching: individual (one record per commit)"
- 6-20 untracked: "Batching: grouped (commits clustered by theme)"
- 21+ untracked: "Batching: summary (single summary record)"
If grouped (6-20), show the proposed theme groupings with commit lists per group.
Ask (using AskUserQuestion):
"Generate catch-up records for [N] untracked commits?"
- Yes, generate -- Proceed with proposed batching
- Adjust groupings -- Modify theme groups (split, merge, rename)
- Exclude some commits -- Deselect specific commits from the list
- Cancel -- Exit without generating records
If the user chooses option 2 (Adjust groupings), present the groups and allow modifications, then re-ask the question. If the user chooses option 3 (Exclude some commits), show the commit list and let the user deselect, then re-ask with updated count.
Step 5: Generate CATCHUP_ Records
Read ${CLAUDE_PLUGIN_ROOT}/skills/arn-code-catch-up/references/catchup-record-format.md for the record format specification.
Read CATCHUP_REPORT_TEMPLATE.json from the template path configured in ## Arness (field: Template path). If the template is not found in the project template directory, fall back to the plugin default at ${CLAUDE_PLUGIN_ROOT}/skills/arn-code-save-plan/report-templates/default/CATCHUP_REPORT_TEMPLATE.json.
For each record (individual, grouped, or summary):
-
Create the directory:
mkdir -p <plans-dir>/CATCHUP_<name>/ -
Generate
CHANGE_RECORD.jsonusing the template with thecatchupextension object:- Set
ceremonyTierto"catchup" - Populate
filesModifiedandfilesCreatedfromgit diff-treeoutput - Set
commitHashto the commit hash (individual) or the latest commit hash in the group - Set
commitMessageto the commit message (individual) or a generated group summary - Populate
catchup.coveredCommitswith all commit hashes covered by this record - Populate
catchup.scanRangewith the scan window and detection method - Always set
catchup.confidenceto"low" - Populate
catchup.gapshonestly -- list what information is missing - Populate
catchup.whatWeKnowfrom git data (files changed, commit message, diff stats) - Populate
catchup.whatWeDontKnowwith standard unknowns (intent, test coverage, architectural reasoning)
- Set
-
Generate
CATCHUP_<name>.mdmarkdown summary using the "What We Know / What We Don't Know" framing as specified in the record format reference. -
Always set
confidence: "low". Populategaps[]honestly. Do not fabricate intent or reasoni