본문으로 건너뛰기
Skillpedia
일반 코딩8.2k · #12523

autoresearch-finalize

하는 일

이 스킬은 autoresearch 세션에서 남긴 변경을 가져와 아이디어 하나당 브랜치 하나로 깔끔하게 묶습니다. 병합 전에 검토 가능한 작업을 원하는 사람을 위한 스킬입니다.

사용하는 경우

  • ✓autoresearch 세션이 끝나서 변경 사항을 검토받고 싶을 때.
  • ✓작은 실험 커밋이 많아서 주제별로 정리해야 하는 경우.
  • ✓브랜치를 만들기 전에 어떤 변경이 남았는지 확인하고 싶을 때.

스킬 링크

https://github.com/davebcn87/pi-autoresearch/blob/main/skills/autoresearch-finalize/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/davebcn87/pi-autoresearch/blob/main/skills/autoresearch-finalize/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“autoresearch 세션을 마무리해 주세요. 각 개선 사항이 검토할 수 있도록 별도의 깔끔한 브랜치에 들어가게 해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 세션 기록을 읽고 유지로 표시된 실험만 남겨 주제별로 묶습니다. 묶음을 제안해 확인받은 뒤, 메인 브랜치와의 공통 시작점에서 묶음마다 브랜치를 하나씩 만듭니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Finalize Autoresearch

Turn a noisy autoresearch branch into clean, independent branches — one per logical change, each starting from the merge-base.

Step 1 — Analyze and Propose Groups

  1. Read .auto/log.jsonl (legacy: autoresearch.jsonl). Filter to kept experiments only.
  2. Read .auto/prompt.md (legacy: autoresearch.md) for context.
  3. Expand all short commit hashes to full hashes: git rev-parse <short_hash>
  4. Get the merge-base: git merge-base HEAD main
  5. For each kept commit, get the diff stat (use $BASE..<commit> for the first, <prev_kept>..<commit> for subsequent).
  6. Group kept commits into logical changesets:
    • Preserve application order. Group N comes before Group N+1.
    • No two groups may touch the same file. Each branch is applied to merge-base independently — overlapping files would conflict. If two groups touch the same file, merge them into one group.
    • Watch for cross-file dependencies. Each branch is independent, so if group 1 adds an API in 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.
    • Keep each group small and focused. One idea, one theme per group.
    • Don't hardcode a count. Could be 2, could be 15.

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.

Step 2 — Write groups.json and Run

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.
  • No two groups may share a file. The script validates this and fails if violated.

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.

Step 3 — Report

After the script finishes, report to the user:

  • Branches created and what each contains
  • Overall metric improvement (baseline → best)
  • Show the cleanup commands from the script's summary output

Edge Cases

  • Only 1 kept experiment: One branch is fine — don't force splits.
  • Overlapping files between groups: The script fails with an error naming the file. Merge the overlapping groups and retry.
  • Non-experiment commits on the branch: Skip them — only process kept experiments from the jsonl.
자주 묻는 질문

묶음을 먼저 확인할 수 있나요?

네. 브랜치를 만들기 전에 제안된 묶음을 먼저 보여 줍니다.

남기지 않은 변경은 어떻게 되나요?

유지로 표시된 실험만 쓰므로, 버려진 시도는 빠집니다.

어떤 브랜치와 비교하나요?

묶음마다 메인 브랜치와의 공통 기준점인 merge-base를 시작점으로 사용합니다.

상세 정보

작성자의 원본 설명

Finalize an autoresearch session into clean, reviewable branches. Use when asked to "finalize autoresearch", "clean up experiments", or "prepare autoresearch for review".

repo: davebcn87/pi-autoresearch

인기도

GitHub 스타
8.2k
순위
#12523
라이선스
MIT
업데이트
2026. 10. 7.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬