ask-improve
Improve: Audits a codebase (correctness, security, performance, tech debt), plans and runs fixes, or does a focused refactor. Use for audits and cleanups.
- License 许可
- MIT
- 最近更新
- 2026-11-09
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- ask-improve
- triggers
- [ "improve", "audit", "tech debt", "tech debt audit", "audit codebase", "improve codebase", "direction", "audit and plan", "refactor this", "refactoren", "code cleanup", "opschonen", "simplify this code", "vereenvoudigen", "remove over-engineering", "deduplicate logic", "restructure this code", "reduce complexity", "untangle this", "clean architecture mess" ]
- description
- Improve: Audits a codebase (correctness, security, performance, tech debt), plans and runs fixes, or does a focused refactor. Use for audits and cleanups.
- execution_tier
- standard
- delegation_default
- prefer-subagent
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/audit-playbook.md13.3 KB
- 参考文档references/closing-the-loop.md7.1 KB
- 参考文档references/plan-template.md8.7 KB
03 SKILL.md 正文
ASK Improve
Structured, evidence-first codebase audit that produces executable implementation plans. Also covers focused refactoring and simplification passes. Runs once to audit and plan; re-invoke execute, reconcile, or next modes for follow-through.
When to use
Use when:
- you want a structured audit (correctness, security, performance, tech debt, deps, DX, docs, direction, user-facing text language/locale consistency)
- you have audit output and need executable implementation plans
- you need to execute, reconcile, or publish those plans as issues
- the user asks for a refactor, cleanup, simplification, or deduplication
Skip when:
- the problem is a single known bug (use
debugging) - you only need a quick code review (use
code-review)
Audit flow
- Recon: detect repo layout, conventions, commands, existing docs/ADRs, intent signals (TODOs, flags, stubs, PRDs, roadmap)
- Audit: run category audits, including code-smell scanning and applicable hard coding/style rules. Inspect every function-like construct in scope for required intent comments and run the repository's source-comment check when available; each finding is evidence-grounded (
file:line) - Plan: convert findings into self-contained, executor-ready plans with drift checks, verification gates, hard boundaries, and escape hatches
- Follow-through:
execute <plan>,reconcile,next,branch
Wide audits. When the host runs dynamic workflows and the audit is deep or repository-wide (hundreds of files, several categories), offer to run the audit as one workflow. A recon agent lists the surface; each agent takes a chunk of files or modules for one category (sized to the host's guideline) and returns schema-shaped findings with file:line; a verifier agent tries to refute each finding before it is reported, which is the false-positive validation the Rules require. The offer states the agent count, a model tier per stage, a one-directory slice first, and a rough cost, and the coordinator starts the run only after the user opts in. The audit stays read-only, and execute still dispatches a separate executor. quick, branch, and one-category audits of one module stay direct. A worker that finds the audit is this wide reports ASK_WORKFLOW_BLOCKED phase=EXECUTE with the file count, because a worker cannot start workflows; the coordinator makes the offer. In a non-interactive run, where no answer can come, continue with a delegated audit at the same evidence bar.
For significant or release-sensitive work, act as the independent audit role: inspect callers and the complete diff, challenge ownership, ambiguity, fallbacks, determinism, compatibility, and test invariants. Return concrete evidence, not generic quality advice. Use ASK_WORKFLOW_PASS phase=AUDIT, ASK_WORKFLOW_FINDINGS phase=AUDIT, ASK_WORKFLOW_BLOCKED phase=AUDIT, or ASK_WORKFLOW_FAILED phase=AUDIT.
When an audit satisfies code-review debt, include review-generation, review-scope: final-diff, review-reference, review-completed-at, and review-result: PASS metadata, followed by terminal ASK_REVIEW_COMPLETE. An audit outside final diff scope must not clear review debt.
Modes
- (bare): Full audit + plans (recon → audit → plan)
quick/deep: Audit depth modifier;quickkeeps smell scanning focused on the relevant changed surface, whiledeepexpands it across affected modules or the repository. Default toquick; escalate todeeponly when the changed surface is unknown, cross-cutting, or a quick scan already surfaced evidence a bounded scan cannot reconcile.security/perf/tests/deps/dx/docs/direction/tech-debt/text: Focus on one category. Theperfandsecuritymodes carry standing behavior rules (below), not just a scan.refactor: Focused simplification pass — not full auditexecute <plan>: Dispatch executor, review, verdict (APPROVE/REVISE/BLOCK)reconcile: Refresh plan backlog, verify DONE, investigate BLOCKEDnext/features/roadmap: Direction-only auditbranch: Diff-only audit of current branch vs default branch--issues: Publish plans as GitHub issues
Focus rules
perf: Measure before optimizing. Neutral results are reverts, not keeps; log every attempt including the reverted ones so a discarded optimization stays discarded.security: Start from a threat model. Trust follows who wrote a value, not which channel delivered it.
Refactoring pattern
- Find the actual pain point, not the most stylistically ugly code.
- Choose one high-leverage simplification in the smallest owning area.
- Implement the smallest coherent change set, then validate.
- Stop when the main complexity is gone.
- Prefer deletion over indirection, extraction over rewrites. If the best refactor is leaving code alone, leave it alone.
Rules
- Every finding cites evidence (
file:line). "Probably has N+1" is not a finding;orders/api.ts:142 issues one query per itemis. - Smell-scan findings must state concrete impact, severity, and false-positive validation. Separate defects, maintainability risks, test gaps, and intentional trade-offs.
- Hard coding and styling rules are pass/fail gates. Do not report a missing required comment as a low-priority nit, and do not mark an audit complete until the applicable automated checks passed.
- Plans are self-contained: executor has zero context beyond the plan file. Every step ends with a verification command and expected result.
- STOP conditions are explicit. Plans stamp the commit SHA they were written against for drift detection.
- Never copy secrets into plans or issues.
- Advisor never edits source code;
executedispatches a separate executor.
Use with
intakewhen the work scope is ambiguouscode-reviewfor executor diffs or standalone PRsdebuggingwhen audit finds a bug that needs tracingverificationto confirm preserved behavior or executed plans
Avoid
- Full audit on every small change (use
quick,branch, or focused category) - Broad rewrites because code "could be cleaner"
- New abstractions for a single current use case
- Style-only rewrites in untouched areas
- Publishing sensitive findings as public issues without confirmation
04 同仓库更多 Skills
ask-write-skill
Write Skill: Creates and revises skills and guardrails from reusable workflow gaps. Use when making a skill or when agent behavior exposes a routing gap.
ask-verification
Verification: Proves work is fixed or ready and cleans up changed repos. Use before claiming something works or handing off.
ask-text-writing
Text Writing: Writes emails, posts, articles, bios, READMEs, and docs that sound human and avoid AI writing patterns. Use when drafting or rewriting prose.
ask-summary
Summary: Explains what changed and what is proven, walks through code, or re-pitches unclear output. Use when work is done or the user asks what changed.
ask-session-review
Session Review: Reflects on skill usage and gaps and files GitHub issues from bugs, findings, or follow-ups. Use after completing work.
ask-research
Research: Does bounded fact-finding across the repository, docs, code, or external sources. Use when a question needs evidence before an answer or decision.