Code Analyzer
Analyze staged code and surrounding context for duplications, dead code, and optimization opportunities using GPT-5.2-Codex.
Usage
code
/code-analyzer → Codex high (default) /code-analyzer deep → Codex xhigh
Argument Parsing
Keywords (reserved):
- •
deep→ Use xhigh effort instead of high
Parsing Logic
code
args = split(input)
effort = "high"
for arg in args:
if arg == "deep":
effort = "xhigh"
Result Mapping
| Input | effort |
|---|---|
| (none) | high |
deep | xhigh |
Analysis Scope
| Scope | Description |
|---|---|
| Staged files | Production + test code in git staged |
| Surrounding code | Same package/directory, related modules |
Analysis Items
| Item | Description |
|---|---|
| Duplications | Similar code patterns, copy-paste code |
| Dead code | Unused functions, imports, variables |
| Optimizations | Performance improvements, inefficient patterns |
| Consistency | Pattern alignment with existing codebase |
Implementation
Invoke the 17th-code-analyzer subagent:
code
Task(
description="Analyze code quality ({effort})",
subagent_type="17th-code-analyzer",
prompt="""
Analyze code quality for staged changes and surrounding code.
Configuration:
- Effort: {effort} (high or xhigh)
- Project root: {project_root}
""",
run_in_background=true
)
Auto-Trigger
When skill auto-triggers (no args), uses defaults:
- •Effort: high
Output
- •Report:
.kkachi/{branch_name}/completed/code-analyzer-{epoch_timestamp}.md - •Summary: duplications, dead code, optimizations found
- •Recommendations: prioritized action items
Examples
| Input | effort |
|---|---|
| (none) | high |
deep | xhigh |
Notes
- •Uses GPT-5.2-Codex for all analysis
- •Analyzes staged changes + surrounding code
- •Supports Go, Python, Dart, TypeScript, JavaScript
- •Results verified before reporting
- •Ensure
.kkachi/is in.gitignore