cm-autopilot
Easy-to-use conversational CLI (Claude Code style) for non-technical users to spawn parallel AI tasks supervised by a visual web dashboard.
Code hygiene gate — detect and eliminate dead code, duplicates, naming mess, and code smells. TRIZ-powered. Run after features, before PRs, during debt sprints.
$ npx -y skills add tody-agent/codymaster --skill cm-clean-code --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/cm-clean-codeContext preview
The summary Claude sees to decide when to auto-load this skill.
Code hygiene gate — detect and eliminate dead code, duplicates, naming mess, and code smells. TRIZ-powered. Run after features, before PRs, during debt sprints.
name: cm-clean-code description: "Code hygiene gate — detect and eliminate dead code, duplicates, naming mess, and code smells. TRIZ-powered. Run after features, before PRs, during debt sprints." token_budget: 1200 compressed: true deprecated: false
> **Code that works is not enough. Code must be CLEAN.** > Inspired by Clean Code (Robert C. Martin) + Refactoring (Martin Fowler) + TRIZ.
**ALWAYS when:**
**Run automatically after:**
**Skip when:**
| # | Principle | How Applied | |---|-----------|-------------| | **#1** | Segmentation | Break large files/functions into focused units | | **#10** | Prior Action | Clean BEFORE it rots — don't wait for tech debt sprint | | **#6** | Universality | One function should serve one purpose (SRP) | | **#27** | Cheap Short-living | Quick small cleanups > expensive large refactors | | **#2** | Taking Out | Extract what doesn't belong — separate concerns |
Run this checklist on every file touched. Each point has auto-detect criteria:
┌───┬──────────────────────┬──────────────────────────────┬────────────────────────┐ │ # │ Check │ Auto-Detect │ Action │ ├───┼──────────────────────┼──────────────────────────────┼────────────────────────┤ │ 1 │ Dead Code │ Unused exports, unreachable │ DELETE — don't comment │ │ │ │ branches, commented-out code │ out, DELETE │ ├───┼──────────────────────┼──────────────────────────────┼────────────────────────┤ │ 2 │ Unused Imports │ Import not used in file │ REMOVE import line │ ├───┼──────────────────────┼──────────────────────────────┼────────────────────────┤ │ 3 │ Magic Numbers │ Literal numbers in logic │ EXTRACT to named const │ │ │ & Strings │ Repeated string literals │ │ ├───┼──────────────────────┼──────────────────────────────┼────────────────────────┤ │ 4 │ Naming │ Single-letter vars (not i,j) │ RENAME to describe │ │ │ │ Abbreviations, inconsistent │ intent clearly │ ├───┼──────────────────────┼──────────────────────────────┼────────────────────────┤ │ 5 │ Single Responsibility│ Function does 2+ things │ EXTRACT into separate │ │ │ (SRP) │ Class has 5+ public methods │ focused units │ ├───┼──────────────────────┼──────────────────────────────┼────────────────────────┤ │ 6 │ DRY (Don't Repeat) │ Similar code blocks in 2+ │ EXTRACT shared logic │ │ │ │ places │ into reusable function │ ├───┼──────────────────────┼──────────────────────────────┼────────────────────────┤ │ 7 │ Nesting Depth │ if/for/while nested > 3 │ EXTRACT, early return, │ │ │ │ levels deep │ guard clauses │ └───┴──────────────────────┴──────────────────────────────┴────────────────────────┘
> **Goal:** Find what's dirty before cleaning.
**Automated scan (file-by-file):**
For each file modified in current task:
1. SIZE CHECK:
IF lines > 300 → FLAG "Large file — consider splitting"
IF any function > 50 lines → FLAG "Long function — extract methods"
2. IMPORT CHECK:
Scan imports → cross-reference with usage in file body
Unused import → FLAG for removal
3. DEAD CODE CHECK:
Commented-out code blocks → FLAG for deletion
Functions not called anywhere → FLAG (verify with codeintell)
Unreachable code after return/throw → FLAG
4. DUPLICATION CHECK:
Similar code blocks (>5 lines identical/near-identical) → FLAG
Copy-paste patterns → FLAG
5. NAMING CHECK:
Single-char variables (except loop vars i,j,k) → FLAG
Inconsistent casing (camelCase vs snake_case in same file) → FLAG
Generic names (data, result, temp, item, value, obj) → FLAG
6. COMPLEXITY CHECK:
Nesting > 3 levels → FLAG
Function with > 4 parameters → FLAG
Cyclomatic complexity > 10 → FLAG**Output: Smell Report**
## Clean Code Scan: [filename] | # | Smell | Line | Severity | Auto-fix? | |---|-------|------|----------|-----------| | 1 | Unused import: lodash | 3 | Low | ✅ Yes | | 2 | Magic number: 86400 | 47 | Medium | ✅ Yes | | 3 | Long function: processData (78 lines) | 23-101 | High | 🔧 Manual | | 4 | Dead code: commented block | 112-125 | Low | ✅ Yes | **Total smells: 4 | Auto-fixable: 3 | Manual: 1**
> **Goal:** Fix each smell, one at a time, with tests passing between each fix.
**Rules (from refactoring.guru + Martin Fowler):** 1. **Tests first:** Ensure tests exist and pass BEFORE cleaning 2. **One change at a time:** Fix one smell → run tests → commit → next smell 3. **Behavior preservation:** Clean code MUST NOT change functionality 4. **No feature additions:** Cleaning and feature work are SEPARATE commits
**Fix patterns:**
"I can't write code. But in 6 months, I shipped 12 real products using AI. CodyMaster is everything I learned — so you don't have to repeat my mistakes." — Tody Le, Head of Product, Creator of CodyMaster 50+ skills. One install.
Repo: tody-agent/codymaster
Easy-to-use conversational CLI (Claude Code style) for non-technical users to spawn parallel AI tasks supervised by a visual web dashboard.
Strategic analysis gate for existing products — multi-dimensional evaluation (tech, product, design, business) using Design Thinking + 9 Windows (TRIZ) +…
Fallback local Playwright daemon for real-browser visual QA / screenshots / smoke. Use ONLY when the host platform has no native browser mode — prefer the host…
Full review lifecycle — request reviews, handle feedback with technical rigor, and complete branch integration. Use when completing tasks, receiving feedback,…
Unified code intelligence — routes to Skeleton Index, CodeGraph, Architecture Diagram, or Smart Context Builder based on task shape. Loads deep refs on demand.
[Deprecated] parallel execution mode. Use `cm-execution` instead.