AGENT SKILL

code-quality

Drive static-analysis code quality in pi-agent-dashboard with Biome (analyze → fix → test), in changed-files or whole-repo mode. Use when asked to "improve code quality", "lint and fix", "clean up warnings", "fix Biome issues", "run static analysis", or when setting a code-quality goal. Skip for one-line edits.

License 许可
MIT
最近更新
2026-11-12
Stars
★ 348
Forks
56

01 前言 Front Matter

name
code-quality
description
Drive static-analysis code quality in pi-agent-dashboard with Biome (analyze → fix → test), in changed-files or whole-repo mode. Use when asked to "improve code quality", "lint and fix", "clean up warnings", "fix Biome issues", "run static analysis", or when setting a code-quality goal. Skip for one-line edits.

02 资源文件 1

03 SKILL.md 正文

Code Quality (Biome)

Analyze → fix → test, drivable by the goal-plugin's judge loop. The skill is the HOW; the goal is the WHEN-TO-STOP (judge reads one exit code).

Pick the mode

flowchart TD
    Q{Driving a goal /<br/>cleaning your own work?}
    Q -->|default| C[CHANGED-FILES MODE<br/>goal loop · git diff vs develop<br/>surgical, low blast radius]
    Q -->|explicit cleanup| W[WHOLE-REPO MODE<br/>human-gated · one package,<br/>one rule-group per turn]
    C --> CC[npm run quality:changed]
    W --> WW["biome lint &lt;pkg&gt; --only=&lt;group&gt;"]

When unsure, use changed-files mode. Never turn whole-repo autofix loose inside a goal loop.

The oracle (what the judge reads)

One command, one exit code:

npm run quality:changed
# = biome check --changed --error-on-warnings --write  (safe-fix the diff)
#   && node scripts/tsc7.mjs --noEmit                   (type gate, TypeScript 7)
#   && npm test                                         (test gate)
  • exit 0 → Biome clean (warn+error) on changed files, types compile, tests green → goal achieved.
  • non-zero → fix the reported issues, run again. The judge says continue.

--changed compares the committed branch state against develop (the repo's integration branch, set as vcs.defaultBranch in biome.json). Uncommitted or untracked files are NOT scoped by --changed — commit your work first, or pass an explicit path.

Procedure (every turn)

1. ANALYZE
   npm run quality:changed        # or: biome lint . --reporter=json (whole-repo)
   Read the JSON. Group issues: safe-fixable vs unsafe vs manual.

2. FIX  (surgical — only files in the diff)
   - Safe fixes are already applied by `--write`. Confirm they're sane.
   - Type errors + unsafe-rule + manual issues: edit by hand, minimally.
   - DO NOT run `--unsafe` in the loop. Surface unsafe fixes as a report.
   - DO NOT touch files outside the diff (AGENTS.md surgical rule).

3. TEST  (the gate)
   node scripts/tsc7.mjs --noEmit && npm test
   - Red? REVERT this fix batch. Never stack broken autofixes.
   - Green + 0 issues on scope? Done. Else loop.

Safe vs unsafe fixes (Biome 2.x)

biome check --write applies safe fixes only. Some of this repo's enabled rules are unsafe and need a human (or --unsafe, never in a loop):

  • Safe (auto-applied by --write): useConst, useImportType, noUnusedImports.
  • Unsafe (surfaced as a report, fix by hand): useTemplate, useOptionalChain, noUnusedVariables (and any rule Biome marks FIXABLE but doesn't apply under plain --write).

If --write reports a warning as FIXABLE yet leaves it, the fix is unsafe. Apply it manually with judgment; do not blanket --unsafe.

Guardrails (non-negotiable)

  1. Scope — changed-files by default (--changed). Whole-repo only when explicitly asked, and then scoped to one package + one rule-group per turn.
  2. Test gate — node scripts/tsc7.mjs --noEmit (the TypeScript 7 type-check) + npm test after every fix batch; revert on red.
  3. Safe-first — auto-apply safe fixes only; unsafe + manual → reported, not auto-applied in a loop.
  4. No scope creep — never "improve" files outside the diff.

Whole-file-on-touch (the rough edge)

Biome lints whole files, not diff lines. Touch one line in a legacy file → all its warn-tier issues surface. Default policy: grandfather — fix only the diff, // biome-ignore unavoidable legacy lines, leave the rest. Do NOT rewrite a whole legacy file to chase warnings (violates surgical rule) unless the user asks for boy-scout cleanup.

Set it as a goal

Daily driver (changed files):

/goal "Use the code-quality skill in changed-files mode. Done when
       `npm run quality:changed` exits 0. Pause and report if a fix needs a
       non-mechanical judgment call. Never edit files outside the diff."

Scoped cleanup (one package):

/goal "Use the code-quality skill, whole-repo mode, scoped to <pkg>. Drive
       `biome lint <pkg> --only=<group>` to 0 while keeping tests green. One
       rule-group per turn; stop after each so I can review the diff."

The ratchet (why warnings don't always block)

Severity = gate strength. warn shows but exits 0 (soft); error exits non-zero (hard). CI runs plain biome lint . → only error-tier blocks. The goal loop adds --error-on-warnings → warn+error both block on YOUR files. So legacy warn-tier noise never fails CI, but new/touched code is held to the full bar. See docs/code-quality.md for the tier ladder + graduation rules.

Commands cheat-sheet

npm run quality:changed   # the oracle: fix diff + tsc + test (goal loop)
npm run fix:changed       # safe-fix the diff only, no test gate
npm run lint:biome        # analyze whole repo (no fixes)
npm run quality:report    # whole-repo GitHub-annotation report (advisory)
biome lint <path> --only=<group>/<rule> --reporter=json   # targeted cleanup

04 同仓库更多 Skills

BlackBeltTechnology
BlackBeltTechnology/pi-agent-dashboard

youtube-srt

Download YouTube subtitles (SRT + timestamped TXT) for a channel, playlist or video via yt-dlp, no media download; optionally mine them into a categorized catalog (e.g. AI models by function, open weights, local runnability, hardware tier). Use on "download the srt of this video", "transcripts of channel X for the last N months", "catalog the models AI Search talked about", "update docs/models".

★ 348
BlackBeltTechnology
BlackBeltTechnology/pi-agent-dashboard

video-transcription

Transcribe video and audio files to SRT subtitles with speaker diarization using the Soniox (default) or AssemblyAI API. Use when the user wants to transcribe meetings, videos, or audio files. Supports MKV, MP4, MOV, M4A, MP3. Triggers on "/transcribe", "transcribe my meetings", "transcribe videos in ~/Movies", or any request to convert audio/video to text.

★ 348
BlackBeltTechnology
BlackBeltTechnology/pi-agent-dashboard

speaker-id

Name anonymous diarized SRT speakers from a persistent local voiceprint library and repair speaker drift; local, CPU-only, no API key. Triggers "who is speaker 2", "put names on the transcript", "label the meeting SRT", "the diarization split one person into three", "enroll my voice". Backed by the pi-voiceid CLI.

★ 348
BlackBeltTechnology
BlackBeltTechnology/pi-agent-dashboard

veo-showreel-production-kit

Turn a video timeline + voiceover into a reproducible, sliceable Veo 3.1 prompt package with a consistency anchor and AI storyboard sketches.

★ 348
BlackBeltTechnology
BlackBeltTechnology/pi-agent-dashboard

veo-generator

Render a scripted video project into mp4 clips with the Google Veo 3.1 API. Reads a project's shot package (shots/*.md), one clip per camera cut, reusing each shot's prompt and sketch — world anchor only with `--with-reference`, seed unless `--no-seed`. Use on "render the Veo video for <project>", "generate the videos from the shot scripts", "make the clips with Veo".

★ 348
BlackBeltTechnology
BlackBeltTechnology/pi-agent-dashboard

hyperframes-showreel

Turn real screen and site footage into a rhythmic showreel rendered with HyperFrames: sampling, edit script, redacted clips, a generated composition, Veo only as additive FX, music edit + camera punches, delivery render and export QA. Use on "make a showreel from these recordings", "build the HyperFrames video", "assemble the footage edit", "render and QA the showreel".

★ 348