From alp
Autonomous iterative optimization loop — run N iterations against a mechanical metric, learn from git history, auto-keep/discard changes. Use for improving measurable metrics (coverage, performance, bundle size, etc.) through repeated experimentation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/alp:alp-autoresearch [Goal/Metric description] or inline config block[Goal/Metric description] or inline config blockThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Constraint + Mechanical Metric + Fast Verification = Autonomous Improvement
Constraint + Mechanical Metric + Fast Verification = Autonomous Improvement
| Situation | Better Tool |
|---|---|
| Subjective goals ("make it cleaner") | alp:cook |
| Bug fixing with known root cause | alp:fix or alp:debug |
| One-shot tasks, no repetition needed | alp:cook |
| No mechanical metric to measure progress | alp:cook --interactive |
| Files outside a defined scope | manual approach |
Parsed from user message. Missing required fields trigger a batched AskUserQuestion.
| Field | Description | Example |
|---|---|---|
Goal | Human description of what to improve | "Increase test coverage in src/utils" |
Scope | Glob pattern(s) for editable files | "src/utils/**/*.ts" |
Verify | Shell command that outputs a single number | "npx jest --coverage --json | jq '.coverageMap | .. | .s? | to_entries | map(.value) | (map(select(.>0)) | length) / length * 100' | tail -1" |
| Field | Default | Description |
|---|---|---|
Guard | none | Regression check command (exit 0 = pass) |
Iterations | 10 | Maximum iterations to run |
Noise | medium | Tolerance for metric variance: low / medium / high |
Min-Delta | 0 | Minimum improvement to count as progress |
Direction | higher | Whether higher or lower metric value is better |
When required fields are missing, ask all at once:
AskUserQuestion({
questions: [
{ question: "What metric do you want to improve? (e.g. 'test coverage in src/utils')", field: "Goal" },
{ question: "Which files may be edited? (glob, e.g. 'src/utils/**/*.ts')", field: "Scope" },
{ question: "Verify command — must print a single number to stdout", field: "Verify" },
{ question: "Guard command for regression check? (optional, press Enter to skip)", field: "Guard" }
]
})
See references/autonomous-loop-protocol.md for the full 8-phase specification.
Key invariants:
git revert over git reset — preserve historyEach iteration appends a TSV line to loop-results.tsv in the working directory:
iteration commit metric delta status description
0 a1b2c3d 80.0 - baseline initial measurement
1 e4f5a6b 82.4 +2.4 keep add null checks to parser.ts
2 - 81.9 -0.5 discard extract helper function
See references/autonomous-loop-protocol.md — Phase 7 for full schema.
| Condition | Action |
|---|---|
| 5 consecutive discards | Analyze patterns → shift strategy (different files, different approach) |
| 10 consecutive discards | STOP — report findings, surface to user |
/alp:autoresearch
Goal: Increase test coverage in src/utils from ~60% to 80%
Scope: src/utils/**/*.ts, tests/utils/**/*.test.ts
Verify: npx jest tests/utils --coverage --coverageReporters=json-summary 2>/dev/null | node -e "const d=require('./coverage-summary.json');console.log(d.total.lines.pct)"
Guard: npx tsc --noEmit && npx jest --passWithNoTests
Iterations: 15
Direction: higher
/alp:autoresearch
Goal: Reduce main bundle size below 200KB
Scope: src/**/*.ts, src/**/*.tsx
Verify: npx vite build 2>/dev/null | grep "dist/index" | awk '{print $2}' | sed 's/kB//'
Guard: npx tsc --noEmit
Direction: lower
Min-Delta: 0.5
/alp:autoresearch
Goal: Drive ESLint error count to zero in src/api
Scope: src/api/**/*.ts
Verify: npx eslint src/api --format=json 2>/dev/null | node -e "const r=require('/dev/stdin');console.log(r.reduce((a,f)=>a+f.errorCount,0))" || echo 999
Direction: lower
Iterations: 20
ScopeGuard commandVerify command must complete in < 30 seconds (otherwise loop is impractical)references/autonomous-loop-protocol.md — Full 8-phase loop spec, decision matrix, anti-patternsreferences/git-memory-pattern.md — Git as cross-iteration memory, revert vs reset, commit conventionsreferences/guard-and-noise.md — Guard pattern for regression prevention, noise-aware verificationreferences/results-logging.md — TSV format spec, progressive summariesreferences/metric-library.md — Common verify commands by domainnpx claudepluginhub phucanh08/alp-pluginCreates bite-sized, testable implementation plans from specs or requirements, with file structure and task decomposition. Activates before coding multi-step tasks.