Skip to main content

codebase-health-audit

Audit consistency, performance, and style issues across the wiki codebase; apply fixes only when the user explicitly authorizes remediation. Use when reviewing code quality, preparing releases, onboarding contributors, or after bulk changes to TypeScript components, MDX docs, CSS, or imports.

来源信息

仓库
z-shell/wiki
最近来源活动
2026年9月11日 17:20
检测到的 SKILL.md 语言
英语
星标
20
分支
9

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
4 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
codebase-health-audit
description
Audit consistency, performance, and style issues across the wiki codebase; apply fixes only when the user explicitly authorizes remediation. Use when reviewing code quality, preparing releases, onboarding contributors, or after bulk changes to TypeScript components, MDX docs, CSS, or imports.
argument-hint
File path, directory glob, or 'all' for full scan
# Codebase Health Audit ## When to Use - After bulk changes to components, docs, or styles - Before releases or significant merges - During contributor onboarding to align with project conventions - When ESLint or Stylelint report issues and you want a guided fix pass - Periodic codebase hygiene checks ## Authorization Health evaluations and review requests are read-only. Report findings and recommended remedies; edit files only when the user explicitly requests fixes within a defined scope. This boundary also applies to linked checklists, prompts, and skills: mutation wording there does not authorize changes. Do not run formatters in write mode or content generators during a read-only review. Read `AGENTS.md` and applicable scoped instructions first. Their current rules and repository validators take precedence over checklist examples. ## Procedure ### Phase 1: Scope Determine what to scan based on the user's input: | Input | Action | | ---------------------------------- | ---------------------------------------------------- | | File path | Audit that single file | | Directory glob (`src/components/`) | Scan all matching files | | `all` or omitted | Scan `src/`, `docs/`, `community/`, `ecosystem/` | | `changed` | Use `get_changed_files` to scope to git changes only | ### Phase 2: Classify & Audit Route each file to the appropriate checklist: | File pattern | Checklist | | ------------------------------------- | ------------------------------------------------------ | | `src/**/*.{ts,tsx}` | [TypeScript & React](./references/typescript-react.md) | | `{docs,community,ecosystem}/**/*.mdx` | [MDX Docs](./references/mdx-docs.md) | | `src/**/*.css` | [CSS & Styling](./references/css-styling.md) | | Other | Skip with note | Cross-cutting checks applied to all file types: - **Imports**: correct order, no unused imports (see [import ordering](./references/typescript-react.md#import-ordering)) - **Performance**: lazy loading for heavy components, `@theme/IdealImage` for images ### Phase 3: Findings and authorized remediation For each issue found, report its severity, file path, concrete consequence, and recommended remedy. With explicit remediation authority, apply only in-scope fixes, keeping each change reviewable. Otherwise continue to validation and reporting without editing files. ### Phase 4: Validate Run relevant non-destructive checks to substantiate findings and, when authorized, verify fixes: ```sh pnpm lint --quiet ``` Report remaining issues and distinguish failures from unavailable or skipped checks. Fix remaining issues and rerun validation only within the authorized remediation scope. ### Phase 5: Report Summarize results: ```text ## Audit Summary - Files scanned: N - Issues found: N - Issues fixed: N - Lint status: ✅ clean / ❌ N remaining ### Findings by category - TypeScript/React: N files - MDX docs: N files - CSS: N files ``` ## Decision Points - **Flat vs. subdirectory component**: Keep flat (`Component.tsx`) unless co-located assets (`.module.css`, tests) exist. Convert to `Component/index.tsx` only when adding co-located files. - **Missing frontmatter fields**: Report missing required fields using the canonical docs-authoring rules. Add defaults only during authorized remediation, and flag inferred values for user review. - **Ambiguous import order**: Follow the canonical order in [typescript-react.md](./references/typescript-react.md#import-ordering). ## Related Customizations - Skill: [docs-release-readiness](../docs-release-readiness/SKILL.md): docs-specific QA - Hook: [lint-on-edit](../../hooks/lint-on-edit.json): workspace hook that runs lint after file-mutation tool calls in VS Code agent sessions
在 GitHub 查看