Chuyển đến nội dung
Skillpedia
Lập trình chung8.2k · #12523

autoresearch-finalize

Skill này làm gì

Skill này lấy các thay đổi được giữ lại từ một phiên autoresearch và nhóm chúng thành các nhánh gọn gàng, mỗi ý tưởng một nhánh. Dành cho người muốn công việc có thể xem xét trước khi hợp nhất.

Khi nào nên dùng

  • ✓Khi một phiên autoresearch đã kết thúc và bạn muốn xem xét các thay đổi của nó.
  • ✓Khi bạn có nhiều commit thử nghiệm nhỏ và cần sắp xếp chúng theo chủ đề.
  • ✓Khi bạn muốn xác nhận những thay đổi nào đã được giữ lại trước khi chuẩn bị các nhánh.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/davebcn87/pi-autoresearch/blob/main/skills/autoresearch-finalize/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hoàn tất phiên autoresearch của tôi để mỗi cải tiến nằm trong một nhánh riêng gọn gàng để xem xét.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill đọc nhật ký phiên, chỉ giữ các thử nghiệm được đánh dấu là đã giữ lại và nhóm chúng theo chủ đề. Nó đề xuất các nhóm để bạn xem lại, rồi tạo một nhánh cho mỗi nhóm từ điểm xuất phát chung với nhánh chính.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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.
Câu hỏi thường gặp

Tôi có được kiểm tra các nhóm trước không?

Có. Skill trình bày các nhóm đề xuất trước khi các nhánh được tạo.

Điều gì xảy ra với các thay đổi không được giữ lại?

Chỉ những thử nghiệm được đánh dấu là đã giữ lại mới được dùng, nên các lần thử bị loại sẽ bị bỏ ra.

Nó so sánh với nhánh nào?

Nó dùng merge-base với nhánh chính làm điểm xuất phát cho mỗi nhóm.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
8.2k
Vị trí xếp hạng
#12523
Giấy phép
MIT
Cập nhật
7/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự