Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

fix-repo

БесплатноБез исполняемых скриптовНе проверен

Improve a specific repo's corpus conformance by fixing its top diverging cops in parallel using worktree-isolated teammates.

diegosouzapwот diegosouzapw★ 68 звёзд на GitHub

Об этом скилле

Fix Repo — Repo-Targeted Conformance Improvement

This skill targets a specific corpus repo (e.g., rails, discourse, mastodon) and fixes the cops that contribute the most FP/FN for that repo. Unlike /fix-cops (globally worst cops) or /fix-department (all cops in a gem), this focuses on improving a specific repo's match rate.

If you edit code yourself (without dispatching teammates), do that work in a dedicated git worktree by default. Only skip this when the user explicitly asks to use the current tree.

Workflow

Phase 0: Assess (you do this)

  1. If no repo was specified, show the repo list and let the user pick:

    python3 scripts/investigate-repo.py --list $ARGUMENTS
    
  2. Once a repo is chosen, run the repo investigation and paste its full output verbatim to the user (the table IS the primary output — do not summarize or skip it):

    python3 scripts/investigate-repo.py <repo-name> $ARGUMENTS
    

    The script automatically excludes cops fixed since the last corpus oracle run by scanning git commit messages, so the output only shows cops that still need work.

  3. Show the user the top diverging cops and confirm the target repo.

Phase 1: Full Table & Recommendations (you do this)

  1. Show the complete table of ALL diverging cops (use --limit 0) ordered by FP+FN descending. This is the full picture of what needs to happen to reach 100%:

    python3 scripts/investigate-repo.py <repo-name> --limit 0 $ARGUMENTS
    

    Paste the full output verbatim to the user.

  2. Check global FP/FN for the top candidates (use --repos-only | head -5 for each). This helps prioritize cops where the target repo is a significant contributor.

  3. Recommend up to 4 cops to fix in this batch. Prioritize by impact (highest FP+FN first), but use judgment about difficulty. Present your recommendations with global context:

    My recommendations for this batch (4 cops):
    1. Style/OptionHash — 91 FP on rails (1,819 FP globally), likely <hypothesis>
    2. Layout/IndentationWidth — 0 FP, 5,696 FN on rails (Xk FN globally), likely <hypothesis>
    3. ...
    
    Want me to proceed with these, or would you like to swap any out?
    

    Don't skip any cop category — Layout alignment cops, low-match-rate cops, and FN-heavy cops are all fair game. The goal is 100% conformance, so everything needs to be tackled eventually.

Wait for user confirmation before proceeding. The user may want to pick different cops or adjust the batch size.

Once confirmed, investigate each selected cop's FP/FN pattern in depth:

python3 scripts/investigate-cop.py Department/CopName --context --fp-only --limit 10
python3 scripts/investigate-cop.py Department/CopName --context --fn-only --limit 10

Run the delta reducer on up to 3 examples per cop (mix of FP and FN) to get minimal reproductions:

python3 scripts/reduce-mismatch.py Department/CopName repo_id filepath:line            # FP
python3 scripts/reduce-mismatch.py Department/CopName repo_id filepath:line --type fn   # FN

Pick examples from different repos when possible. The reduced files (typically 5–20 lines) go to /tmp/nitrocop-reduce/ — read them and include them in the teammate prompt.

Summarize: cop name, repo-specific FP/FN, global FP/FN, minimal repro(s), root cause hypothesis.

Phase 2: Dispatch (you do this)

  1. Create a team:

    TeamCreate(team_name="fix-repo", description="Improve <repo-name> conformance")
    
  2. Create tasks for each cop fix.

  3. Spawn one teammate per cop using the Task tool. Critical settings:

    • isolation: "worktree" — each teammate gets its own git worktree
    • subagent_type: "general-purpose" — needs full edit/bash access
    • team_name: "fix-repo"
    • mode: "bypassPermissions" — teammates need to run cargo test etc.
  4. Each teammate prompt MUST include:

    • The exact cop name (e.g., Lint/ConstantResolution)
    • The FP/FN counts (both repo-specific and global) and root cause hypothesis
    • The minimal repro(s) from the delta reducer — paste the reduced Ruby source directly
    • Whether to focus on FP fixes, FN fixes, or both
    • A reminder that parallel-agent activity often leaves unrelated local modifications; those files are off-limits
    • The teammate workflow (Phase 3 below) — paste the full instructions

Phase 3: Teammate Workflow (paste this into each teammate's prompt)

You are fixing false positives/negatives in a single nitrocop cop to improve corpus
conformance for a target repo. Follow the CLAUDE.md rules strictly.

**NEVER use git stash or git stash pop.** You are in an isolated git worktree — just commit directly.
Parallel-agent activity is common. If you see unrelated modified files, do not edit/revert them.

## Steps

1. **Read the cop source** at `src/cop/<dept>/<cop_name>.rs`
   Read the vendor RuboCop spec at `vendor/rubocop*/spec/rubocop/cop/<dept>/<cop_name>
Полный SKILL.md на GitHub

Установить fix-repo в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash(*)
Read
Write
Edit
Grep
Glob
Task
TeamCreate
TaskCreate
TaskUpdate
TaskList
TaskGet
SendMessage

Вложенные файлы

metadata.json

FAQ

Что делает скилл fix-repo?

Improve a specific repo's corpus conformance by fixing its top diverging cops in parallel using worktree-isolated teammates.

Как установить скилл fix-repo?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл fix-repo запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить fix-repo с