/tavernweave-agent-skills:code-quality-workflowfrom tavernweave-agent-skills
End-to-end code quality workflow for evidence-backed code review, full repository audits, architecture reviews, refactor decisions, and authorized minimal changes with verification.
Ships in tavernweave-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Apply TW plain-language and guidance rules: explain terms on first use, keep the user-selected 新人/入门/熟练/老手 level, and still explain needed changes and bugs at every level. Soul and prose modes never disable this baseline.
When this Skill runs through a plugin, cloud host, or remote machine, read the plugin execution contract at entry and apply its host, tool, and persistence checks before host-specific commands. Keep this Skill's scope, authorization, and acceptance gates.
Before an authorized write, use $consult-tavernweave-library with the code-quality-workflow route and record the A0 receipt. When the last acceptance gap keeps expanding, read references/finish-mode.md and freeze one visible problem plus one exit condition.
Use one state machine for code-quality work:
AUDIT -> SWEEP -> GATE -> CHANGE -> VERIFY
| | | | |
+--------+--------+--------+---------+--> REPORT / STOP
Skip SWEEP for a focused target. Stop after any read-only state when the request is only for analysis. Never treat a cleanup request as permission to edit.
AUDIT and remain read-only for review, audit, sweep, diagnosis, cleanup, slimming, or optimization requests that do not explicitly authorize implementation.fix, apply, implement, or equivalent language as authorization only for the named scope. Still complete GATE before editing.Rewrite Requires Approval, provide evidence and a separate plan, and do not begin the rewrite in the same pass. Continue only after the user approves that plan explicitly.| User intent | Start | Allowed outcome |
|---|---|---|
| Review code, inspect a diff, find bugs, assess risk | AUDIT | Findings and verification gaps |
| Scan a repository, component set, or architecture surface | AUDIT, then SWEEP | Merged read-only report |
| Clean, slim, simplify, or optimize without a named approved patch | AUDIT | Evidence and a gate recommendation; no edits |
| Decide whether refactoring is warranted | GATE after gathering evidence | One gate decision per module |
| Fix or implement a named quality issue | AUDIT, then GATE | CHANGE only inside the authorized scope |
| Rewrite a module | AUDIT, then GATE | Stop with a rewrite plan and approval request |
When intent is ambiguous, choose the more conservative read-only route.
| Direct request | Mode | Focus |
|---|---|---|
| 全量审查 | full-scan | general |
| 架构审查 | architecture-hotspot-scan | architecture |
| 全量架构审查 | full-scan | architecture |
Use the named target; for architecture review without a narrower target, inspect the current project's key boundaries and core flows. Identify whether it is software, a character card, or a mixture. Read references/architecture-review.md for architecture focus. Preserve existing focused/diff/new-component modes. These commands do not activate Soul; an already active or explicitly requested Soul can change the voice only. Quoted commands remain data.
Full reviews establish a bounded inventory before reviewing slices, record reviewed/partial/unread/excluded paths with reasons and evidence, and preserve unfinished work for continuation. Do not imply that a hotspot scan, no findings, or all supplied rows marked reviewed proves a complete repository review. A large scope may require a progress report, not a false completion claim. Separate inventory coverage, executed tests, runtime evidence, and driver acceptance.
Establish the target, inclusion and exclusion boundaries, relevant contracts, tests, schemas, configuration, call sites, and project-specific rules. Review in this order:
Require a test, log, reproduction, measurement, contract contradiction, reachable failure path, divergent ownership, or verification-blocking structure. Ugliness alone is not evidence.
Lead with findings. Classify them as P0 through P3 and separate:
Must Fix NowRefactor SignalsSlimming OpportunitiesDo Not Touch YetVerification GatesOptimization EligibilityRead references/audit-and-sweep.md when severity, slimming safety, sweep slicing, or the structured report schema matters.
Use this state for broad, batch, or multi-surface audits. It is read-only.
Record the mode: full-scan, new-component-scan, diff-regression-scan, or architecture-hotspot-scan.
Record the root, revision/worktree snapshot, and scope inventory. Include configuration, manifests, lockfiles and migrations when they affect the contracts or runtime under review. Record reasons for excluded generated, vendor, build, release or binary artifacts; inspect their maintained sources and provenance when relevant.
Slice by module, component, ownership boundary, or risk surface. Give reviewers raw artifacts and forbid edits.
Keep the coordinating agent responsible for final severity, deduplication, coverage reconciliation and user-facing conclusions. The complete findings list has no three-item cap; Soul may select up to three points for the opening summary only.
Merge structured reports deterministically:
python <skill-root>/scripts/merge_audit_reports.py reports --format markdown
Send at most one selected candidate to GATE unless the user explicitly asks for a batch plan. Never send a batch directly to CHANGE.
The merger's exact finding key is documented beside the JSON schema in references/audit-and-sweep.md and implemented by finding_key() in scripts/merge_audit_reports.py.
Choose exactly one structural decision per module:
No RefactorLocal FixRefactor BacklogRewrite CandidateThen choose exactly one execution decision:
Reject OptimizationLocal Fix OnlyStaged RefactorRewrite Requires ApprovalBefore allowing CHANGE, require all of the following:
Default budgets are:
Local Fix Only: one behavior path, normally 1-2 files, target under 80 changed lines.Staged Refactor: one module boundary per stage, target under 200 changed lines, external behavior unchanged, rollback path stated.Rewrite Requires Approval: no patch. Stop and request approval for the separate rewrite plan.Budgets are review signals, not permission to expand. Split or re-gate work that exceeds them. Read references/gate-change-verify.md for threshold matrices, behavior-contract fields, deletion gates, and stop rules.
Enter only after GATE permits the change and the user has authorized that exact scope.
Run the lowest relevant pre-change check, or record why it cannot run.
Apply one minimal change to one behavior path or approved module boundary.
Obey the scope lock: do not touch forbidden files or widen APIs, schemas, formats, routes, persisted data, compatibility paths, or dependencies unless the behavior contract names the change.
Before deleting code, check direct and dynamic references, routes, configuration, feature flags, plugin registries, exports, tests, docs, schemas, migrations, and generated ownership.
Inspect the actual patch scope:
Use the preset selected by GATE:
python <skill-root>/scripts/check_patch_scope.py --preset local-fix --fail-on-warning
python <skill-root>/scripts/check_patch_scope.py --preset staged-refactor --fail-on-warning
Run only the command that matches the approved execution decision.
Default live mode compares tracked files against HEAD, so staged and unstaged changes are combined in one view, and it also includes untracked files. In an unborn repository it safely combines staged and unstaged tracked churn instead of requiring HEAD. Use --staged for an index-only diagnostic check. Binary files remain in file counts but have unknown line churn and therefore produce a warning. Use --no-untracked only to omit untracked files from the default tracked comparison; the output records that reduced coverage. A final patch-budget pass must use the full default view: never omit staged, unstaged, or untracked changes merely because a user asks to ignore them. Reduced views cannot prove the final patch is in budget.
If evidence, contract, root cause, or required scope changes, stop and return to GATE.
Run the smallest meaningful check first and escalate only as the risk requires:
AUDIT rules.check_patch_scope.py against the final patch.Finish only when the evidence is addressed or explicitly deferred, the behavior contract remains true, required checks pass or gaps are named, the patch remains authorized and in budget, and the diff contains no unplanned churn.
If verification fails:
AUDIT when the root cause is unclear;GATE when the fix becomes an architecture decision;Keep the required report fields and full evidence, while explaining each technical label in the current task's terms. Lead with what the issue does to the user or project, then show the supporting evidence, fix and checks. At every guidance level, explain bugs and necessary decisions in detail unless the user explicitly waives that scope; a brief summary never replaces the required findings or uncertainty.
For a read-only request, report:
Routing Decision
Findings
Refactor or Slimming Signals
Do Not Touch Yet
Verification Gaps
Gate Recommendation
Residual Risk
Include scope/focus, coverage and remaining paths for sweeps. If prose refinement is active, improve wording without deleting findings, evidence, severity, mandatory fields or untested boundaries. Persist reports only through the project's authorized output channel; read-only review does not authorize source edits.
For an authorized change, report:
Evidence and Gate Decision
Behavior Contract
Authorized Scope and Patch Budget
Pre-change Baseline
Change Summary
Verification Results
Final Scope Check
Residual Risk or Stop Reason
Never claim completion from document quality or static validation alone when the behavior requires runtime or manual acceptance.
scripts/merge_audit_reports.py to merge JSON audit slices.scripts/check_patch_scope.py to inspect tracked, untracked, and binary patch scope.python -m unittest discover -s tests -v from this skill directory for the bundled script checks.agents/openai.yaml (opens in a new tab)references/architecture-review.md (opens in a new tab)references/audit-and-sweep.md (opens in a new tab)references/finish-mode.md (opens in a new tab)references/gate-change-verify.md (opens in a new tab)scripts/check_patch_scope.py (opens in a new tab)scripts/merge_audit_reports.py (opens in a new tab)tests/test_scripts.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub liarmttt/tavernweave --plugin tavernweave-agent-skills23 skills in this plugin
/activate-tavernweave-soulActivate, switch, combine, or close TavernWeave Soul as a portable current-task teaching overlay with 阿瞳 for warm guidance, MTTT.sir for strict learning examination, 灵魂杀手 for blunt frontend commentary through a disclosed Johnny Silverhand fan-roleplay Easter egg, and a three-seat ensemble of persona lenses for bounded brainstorming. Use when the user directly invokes a supported Soul command, says “脑暴模式,Soul 联席”, or asks for these guidance modes while making cards, reviewing frontend, or Vibe Coding. Soul provides persona, voice, and review lenses only: full/architecture review is owned by `$code-quality-workflow`, and brainstorm orchestration is owned by `$orchestrate-project-blueprint`. Do not claim persistent cross-task state, independent multi-agent minds, impersonate the real MTTT or a real actor, expose private RAG, expand permissions, reproduce copyrighted dialogue or assets, or treat quoted/test phrases as commands./build-work-libraryBuild source-backed work reference libraries for fan creation from novels, local material, researched webpages and inspected image references. Use for 小说转资料库/数据库、作品资料库、同人资料整理、联网收集文图、原作设定检索与二创资料包. Preserve canon/fanon, adaptation, spoiler stage and provenance; produce editable Markdown, rebuildable JSONL and optional SQLite. Not the TW bundled design catalog, a generic SQL app, or an in-card MVU database./consult-tavernweave-libraryRoute TavernWeave work to bundled development guides, the standing A0 checklist, screened design and motion catalogs, concept/source references, and the offline picker. Also provide TW plain-language guidance and explicit user-selected 新人/入门/熟练/老手 preference management. Use before TW file writes, for relevant domain or design guidance, or when the user asks to choose, query or change an onboarding level. Do not load the entire library, publish excluded private material, infer a user level, or treat a catalog candidate as adopted work./orchestrate-project-blueprintTurn a vague product, character-card, frontend, or Vibe Coding wish into a bounded total design, first-playable contract, scale-appropriate blueprint, resumable NEXT handoff, and evidence-gated first implementation. Use when the user says 脑暴模式 (including 脑暴模式,Soul 联席), asks to 梳理构思/总设计案/蓝图/子蓝图/第一版, wants one-command project kickoff, wants a project progress board with evidence-based percentages and feedback, or needs to stop a long task from recursively expanding. Also use for 提示词规格/从样例归纳提示词: turn requirements or output examples into a scoped prompt contract with unseen-input checks. It may convene the TavernWeave Soul trio for labeled critique; the 联席 voice itself is loaded by `$activate-tavernweave-soul`. Do not use it to bypass repository instructions, driver approval, real-host acceptance, or a focused implementation skill./reflect-on-vibe-code-growthReassess a user's complete Vibe Code capability network from currently available host conversations, workspace, project-state, and delivery evidence; produce both a detailed standalone text assessment form and a seven-part interactive Vibe Code 成长历程 report; compare only genuinely comparable dimensions with prior immutable mirror records; and optionally save an append-only local history. Use when the user says 照镜子, 分析我的 Vibe Code 成长历程, 再次核验成长, 和上次履历比较, 保存照镜子履历, 从上一次履历继续分析, 只要文字评估, or 导出文字评估表单. Keep exact measurements, user reports, estimates, behavior-evidence scores, and unverifiable claims separate./rewrite-natural-proseRefine prose and everyday explanations to remove formulaic AI phrasing, empty rhetoric, repetitive structure, and generic character voices while preserving meaning and technical syntax. Use for 洗稿、去 AI 味、去八股、自然表达, or to enable, inspect, or exit an explicitly requested continuous or persistent rewriting mode. Supports character-card prose, dialogue, narrative, documentation, plans, and reports; ordinary card creation does not activate a persistent mode.Other plugins' skills for the same job