clean-worktree
Interactive cleanup of stale worktrees (merged branches, orphaned refs)
RTK Code Review — Review locale pre-PR avec auto-fix
$ npx -y skills add rtk-ai/rtk --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
/codereviewContext preview
What this command does when you run it.
RTK Code Review — Review locale pre-PR avec auto-fix
model: sonnet description: RTK Code Review — Review locale pre-PR avec auto-fix argument-hint: "[--fix] [file-pattern]"
Review locale de la branche courante avant création de PR. Applique les critères de qualité RTK.
**Principe**: Preview local → corriger → puis créer PR propre.
/tech:codereview # 🔴 + 🟡 uniquement (compact) /tech:codereview --verbose # + points positifs + 🟢 détaillées /tech:codereview main # Review vs main (défaut: master) /tech:codereview --staged # Seulement fichiers staged /tech:codereview --auto # Review + fix loop /tech:codereview --auto --max 5
Arguments: $ARGUMENTS
# Parse arguments
VERBOSE=false
AUTO_MODE=false
MAX_ITERATIONS=3
STAGED=false
BASE_BRANCH="master"
set -- "$ARGUMENTS"
while [[ $# -gt 0 ]]; do
case "$1" in
--verbose) VERBOSE=true; shift ;;
--auto) AUTO_MODE=true; shift ;;
--max) MAX_ITERATIONS="$2"; shift 2 ;;
--staged) STAGED=true; shift ;;
*) BASE_BRANCH="$1"; shift ;;
esac
done
# Fichiers modifiés
git diff "$BASE_BRANCH"...HEAD --name-only
# Diff complet
git diff "$BASE_BRANCH"...HEAD
# Stats
git diff "$BASE_BRANCH"...HEAD --stat| Si le diff contient... | Vérifier | | ------------------------------ | ------------------------------------------ | | `src/**/*.rs` | CLAUDE.md sections Error Handling + Tests | | `src/core/filter.rs` ou `src/cmds/**/*_cmd.rs` | Filter Development Checklist (CLAUDE.md) | | `src/main.rs` | Command routing + Commands enum | | `src/core/tracking.rs` | SQLite patterns + DB path config | | `src/core/config.rs` | Configuration system | | `src/hooks/init.rs` | Init patterns + hook installation | | `.github/workflows/` | CI/CD multi-platform build targets | | `tests/` ou `fixtures/` | Testing Strategy (CLAUDE.md) | | `Cargo.toml` | Dependencies + build optimizations |
**Error Handling**:
**Performance**:
**Tests**:
**Module**:
**Filtres**:
## 🔍 Review RTK
| 🔴 | 🟡 |
| :-: | :-: |
| 2 | 3 |
**[REQUEST CHANGES]** - unwrap() en production + regex non-lazy
---
### 🔴 Bloquant
• `git_cmd.rs:45` - `unwrap()` → `.context("...")?`
\```rust
// ❌ Avant
let hash = extract_hash(line).unwrap();
// ✅ Après
let hash = extract_hash(line).context("Failed to extract commit hash")?;
\```
• `grep_cmd.rs:12` - pattern fixe recompilé dans la fonction → `LazyLock<Regex>`
\```rust
// ❌ Avant (recompile à chaque appel)
let re = Regex::new(r"pattern").unwrap();
// ✅ Après
static RE: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"pattern").unwrap());
\```
### 🟡 Important
• `filter.rs:78` - Fonction 67 lignes → split en 2
• `ls.rs:34` - clone() inutile, borrow suffit
• `new_cmd.rs` - Pas de fixture réelle dans tests/fixtures/
| Prio | Fichier | L | Action |
| ---- | ----------- | -- | ----------------- |
| 🔴 | git_cmd.rs | 45 | .context() manque |
| 🔴 | grep_cmd.rs | 12 | LazyLock |
| 🟡 | filter.rs | 78 | split function |**Mode verbose (--verbose)** — ajoute points positifs + 🟢 détaillées.
**OBLIGATOIRE avan
CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies
Repo: rtk-ai/rtk
Interactive cleanup of stale worktrees (merged branches, orphaned refs)
Clean all merged worktrees automatically (no interaction)
RTK environment diagnostics - Checks installation, hooks, version, command routing
Conventional Commits enforcer for AI-authored PRs.
Refuse force-pushes / history rewrites unless the user explicitly asks.
Defensive idioms when generating Rust code.