From argos
Stack-bağımsız temiz kod + refactor disiplini — code smell tespit, complexity ölçümü, Fowler refactoring katalogu, küçük-adım plan + karakterizasyon testi.
npx claudepluginhub resultakak/argos --plugin argosThis skill uses the workspace's default tool permissions.
`agents/shared/severity-rubric.md` ve `agents/shared/escalation-matrix.md` default-load
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
agents/shared/severity-rubric.md ve agents/shared/escalation-matrix.md default-load
sayılır (agents/coordination.md §11). Bu skill'in çıktısı Critical / High / Medium /
Low + kanıt formatında olmak zorunda — spekülatif Critical yasak. Sahiplik dışı bulgu
ilgili agent'a delege; karar yetkisi eşiği aşılırsa kullanıcı onayı zorunlu.
Refactor için yeşil test zorunlu. Yoksa:
test-engineer ile koordine; staged scope ≥ %70 hedef.Stack'e göre tool:
| Stack | Tool |
|---|---|
| Python | ruff, radon cc, radon mi, pylint |
| JS/TS | eslint --rule sonarjs/cognitive-complexity, complexity-report |
| Go | gocyclo, gocognit, staticcheck |
| Java | pmd, checkstyle, spotbugs |
Eşik:
rules/clean-code.md)Tabloyu tara. Her smell için çözüm ve risk belirle.
Sırasız değil. Sıra:
Her adım:
refactor(scope): ...).pytest, go test, npm test).code-reviewer agent — refactor PR'ı bağımsız ses ile geçmeli.
| Pattern | Tetik |
|---|---|
| Extract Method | Long method, comment'la anlatılan blok |
| Inline Method | Method body == method name (gereksiz indirection) |
| Extract Variable | Karmaşık ifade |
| Inline Variable | Variable kullanılmıyor / tek yerde, anlamı kayboluyor |
| Replace Temp with Query | Geçici değişken hesaplama, expression olabilir |
| Split Temporary Variable | Bir variable iki amaca hizmet ediyor |
| Remove Assignments to Parameters | Parametre mutate ediliyor |
| Pattern | Tetik |
|---|---|
| Move Method | Feature Envy |
| Move Field | Field başka sınıfa daha çok ait |
| Extract Class | Large Class / SRP |
| Inline Class | Lazy Class |
| Hide Delegate | Demeter chain (a.b.c.d) |
| Remove Middle Man | Middle Man smell |
| Pattern | Tetik |
|---|---|
| Decompose Conditional | If branch'leri uzun |
| Consolidate Conditional Expression | Birden çok if aynı sonuç |
| Replace Nested Conditional with Guard Clauses | Erken return ile düzleştir |
| Replace Conditional with Polymorphism | Switch + tip-bazlı dispatch |
| Introduce Null Object | Null check'ler yayılmış |
| Pattern | Tetik |
|---|---|
| Rename Method | Yanıltıcı isim |
| Add/Remove Parameter | API üyesi parametre değişimi |
| Separate Query from Modifier | Bir method hem hesap hem mutate |
| Parameterize Method | Aynı kod farklı sabitle |
| Replace Parameter with Method | Caller hesaplayabilir argüman |
| Introduce Parameter Object | Data Clump (3+ aynı param) |
| Preserve Whole Object | Param liste yerine whole object |
| Pattern | Tetik |
|---|---|
| Pull Up Field/Method | Subclass'larda duplikasyon |
| Push Down Field/Method | Superclass üyesi sadece bir subclass'a ait |
| Extract Subclass / Superclass | Yeni varyasyon, ortaklık |
| Replace Inheritance with Delegation | Inheritance abuse, "is-a" zayıf |
| Replace Delegation with Inheritance | Delegasyon her metoda mekanik |
| Form Template Method | İki subclass benzer algoritma, ortak parça superclass'a |
code-reviewer agent APPROVE (kanıtla)User: /refactor services/api/orders/processor.py
Agent (refactor-specialist):
1. Read file: 412 satır, OrderProcessor sınıfı.
2. Test paketi: tests/api/orders/test_processor.py — coverage %62. Kabul.
3. Statik tara:
- radon cc -s -a → ortalama CC 14, max 38 (process_order fn).
- radon mi → 41 (D bandı, refactor adayı).
4. Smell tespit:
- Long Method: process_order 187 sat (CC 38).
- Switch Statement: order_type için 8-yol if/elif.
- Feature Envy: order.customer.address.* zinciri 4 yerde.
5. Refactor planı:
a) RENAME `proc_order` → `process_order` (consistency) [commit 1]
b) Extract Method: payment validation → `_validate_payment` [commit 2]
c) Extract Method: shipping calc → `_calc_shipping` [commit 3]
d) Replace Conditional with Polymorphism: OrderTypeStrategy [commit 4]
e) Hide Delegate: customer.address.zip → customer.zip_code [commit 5]
6. Her adımda: pytest -q tests/api/orders/ + benchmark sapma kontrol.
7. Code-reviewer agent her commit'i bağımsız review.
8. Output: 5 commit'lik PR (mantıken 5 ayrı PR olabilir).
# Refactor: <path>
## Mevcut Durum
- LOC, CC, MI, smell listesi
- Test coverage
## Critical / High / Medium / Low (smell başına)
- [ ] ...
## Plan (sıralı)
1. <pattern> — <hedef> — <commit subject>
2. ...
## Doğrulama
- Test paketi
- Benchmark
- Public API contract
## Riskler
- ...