From autoresearch
Finalize an autoresearch session into clean, reviewable branches. Use when asked to "finalize autoresearch", "clean up experiments", or "prepare autoresearch for review".
How this skill is triggered — by the user, by Claude, or both
Slash command
/autoresearch:autoresearch-finalizeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Turn a noisy autoresearch branch into clean, independent branches — one per logical change, each starting from the merge-base.
Turn a noisy autoresearch branch into clean, independent branches — one per logical change, each starting from the merge-base.
.auto/log.jsonl (legacy: autoresearch.jsonl). Filter to kept experiments only..auto/prompt.md (legacy: autoresearch.md) for context.git rev-parse <short_hash>git merge-base HEAD main$BASE..<commit> for the first, <prev_kept>..<commit> for subsequent).api.js and group 2 calls it in parser.js, group 2's branch won't work in isolation. When proposing groups, flag dependencies: "group 2 depends on group 1 — review together." If the dependency is tight, merge the groups.Present the proposed grouping to the user:
Proposed branches (each from merge-base, independent):
1. **Switch test runner to forks pool** (commits abc1234, def5678)
Files: vitest.config.ts, package.json
Metric: 42.3s → 38.1s (-9.9%)
2. **Tune worker count and timeouts** (commits ghi9012, jkl3456)
Files: test/setup.ts
Metric: 38.1s → 31.7s (-16.8%)
Wait for approval before proceeding.
Write groups.json:
{
"base": "<full merge-base hash>",
"trunk": "main",
"final_tree": "<full hash of current HEAD>",
"goal": "short-slug",
"groups": [
{
"title": "Switch to forks pool",
"body": "Why + what changed.\n\nExperiments: #3, #5\nMetric: total_time 42.3s → 38.1s (-9.9%)",
"last_commit": "<full hash of last kept commit in this group>",
"slug": "forks-pool"
}
]
}
Key rules:
last_commit must be a full hash. Expand from jsonl short hashes with git rev-parse.Then run:
bash <SKILL_DIR>/finalize.sh /tmp/groups.json
The script creates one branch per group from the merge-base, verifies the union matches the original branch, and prints a summary with all branches, cleanup commands, and any ideas from .auto/ideas.md (legacy: autoresearch.ideas.md).
On creation failure: rolls back (deletes branches, restores original branch, pops stash). On verification failure: exits non-zero but leaves branches intact for inspection.
After the script finishes, report to the user:
Guides collaborative design exploration before implementation: explores context, asks clarifying questions, proposes approaches, and writes a design doc for user approval.
Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
Implements work from a spec or tickets using TDD at agreed seams, with regular typechecking and test runs, followed by code review.
npx claudepluginhub vedang/pi-autoresearch