ln-740-quality-setup by levnikolaevich/claude-code-skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-740-quality-setup路径说明: 文件路径(
shared/、references/、../ln-*)是相对于技能仓库根目录的。如果在当前工作目录未找到,请定位此 SKILL.md 文件所在目录并向上返回一级以找到仓库根目录。如果缺少shared/目录,请通过 WebFetch 从https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}获取文件。
类型: L2 领域协调器 类别: 7XX 项目引导 父级: ln-700-project-bootstrap
协调项目的代码质量工具配置。
负责:
不负责:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 触发条件 | 操作 |
|---|---|
| ln-720-structure-migrator 完成后 | 由 ln-700 自动委托 |
| 需要手动进行质量设置 | 直接调用并指定项目路径 |
| 现有项目需要质量工具 | 运行并启用现有配置检测 |
| 阶段 | 操作 | 输出 |
|---|---|---|
| 1 | 技术栈检测 | 识别出的技术 |
| 2 | 现有配置检查 | 跳过/合并/替换决策 |
| 3 | 并行委托 | 执行器调用 |
| 4 | 验证 | 可运行的质量流水线 |
检测项目使用的技术,以确定需要配置哪些质量工具。
检测规则:
| 文件模式 | 技术 | 代码检查工具栈 |
|---|---|---|
package.json + tsconfig.json | TypeScript/React | ESLint + Prettier |
*.csproj 或 *.sln | .NET | editorconfig + Roslyn |
pyproject.toml 或 requirements.txt | Python | Ruff |
| 检测到多个 | 混合 | 配置所有检测到的技术 |
操作:
在委托之前,检查已存在的配置。
需要检查的配置文件:
| 技术 | 配置文件 |
|---|---|
| TypeScript | eslint.config.*, .prettierrc*, tsconfig.json |
| .NET | .editorconfig, Directory.Build.props |
| Python | ruff.toml, pyproject.toml [tool.ruff] |
| 预提交钩子 | .husky/, .pre-commit-config.yaml |
| 测试 | vitest.config.*, pytest.ini, *.Tests.csproj |
决策矩阵:
| 现有配置 | 操作 | 确认 |
|---|---|---|
| 未找到 | 从模板创建 | 否 |
| 存在但不完整 | 扩展以匹配模板 | 否 |
| 存在且与模板匹配 | 跳过 | 通知用户 |
完整性检查(Python): 对照 ln-741 的完整性检查表(7个方面:Ruff 规则、每文件忽略项、高级设置、MyPy 严格模式、高级工具、lint 脚本、editorconfig)进行评估。如果任何方面不完整,则委托给 ln-741,并指示其进行扩展(而非替换)。
为每个质量方面调用执行器。执行器可以并行运行,因为它们配置的是独立的工具。
委托顺序:
ln-740 (本技能)
|
+---> ln-741-linter-configurator
| - ESLint/Prettier (TypeScript)
| - editorconfig/Roslyn (.NET)
| - Ruff (Python)
|
+---> ln-742-precommit-setup
| - Husky + lint-staged (Node.js)
| - pre-commit 框架 (Python)
| - commitlint
|
+---> ln-743-test-infrastructure
- Vitest (TypeScript)
- xUnit (.NET)
- pytest (Python)
通过直接调用 Skill 工具,将检测到的技术栈和现有配置传递给执行器。对于 Python:指示 ln-741 根据其完整性检查表应用完整的质量工具栈。
调用方式:
Skill(skill: "ln-741-linter-configurator", args: "{projectPath}")
Skill(skill: "ln-742-precommit-setup", args: "{projectPath}")
Skill(skill: "ln-743-test-infrastructure", args: "{projectPath}")
所有执行器完成后,验证质量流水线是否正常工作。
验证步骤:
| 检查项 | TypeScript | Python | .NET |
|---|---|---|---|
| 代码检查 | ESLint | ruff check | dotnet format --verify-no-changes |
| 格式化 | Prettier | ruff format --check | dotnet format |
| 类型检查 | tsc --noEmit | mypy | Roslyn (构建时) |
| 导入边界 | depcruise | lint-imports | -- |
| 未使用依赖 | knip | deptry | -- |
| 死代码 | knip | vulture | -- |
| 漏洞扫描 | npm audit | pip-audit | -- |
| 统一脚本 | bash scripts/lint.sh | bash scripts/lint.sh | bash scripts/lint.sh |
| 测试 | npm test | pytest | dotnet test |
| 钩子 | 创建测试提交 | 创建测试提交 | 创建测试提交 |
失败处理:
规则 1: 未经用户明确确认,绝不要覆盖现有的用户配置。
规则 2: 执行器在技术栈检测之后运行——在不知道技术栈的情况下不要调用执行器。
规则 3: 验证阶段是强制性的——在工具成功运行之前,质量设置不算完成。
规则 4: 当同时配置 ESLint 和 Prettier 时,必须使用 eslint-config-prettier。
TodoWrite 格式(强制要求):
- 调用 ln-741-linter-configurator (待处理)
- 调用 ln-742-precommit-setup (待处理)
- 调用 ln-743-test-infrastructure (待处理)
- 验证质量流水线 (待处理)
| 阶段 | 执行器 | 上下文 |
|---|---|---|
| 3a | ln-741-linter-configurator | 共享 (Skill 工具) — ESLint/Prettier, editorconfig, Ruff |
| 3b | ln-742-precommit-setup | 共享 (Skill 工具) — Husky, lint-staged, commitlint |
| 3c | ln-743-test-infrastructure | 共享 (Skill 工具) — Vitest, xUnit, pytest |
所有执行器: 通过 Skill 工具调用——执行器可以看到协调器的上下文。
强制阅读: 加载 shared/references/meta_analysis_protocol.md
技能类型:execution-orchestrator。根据协议 §7 分析本次会话。按协议格式输出。
| 文件 | 用途 |
|---|---|
| stack_detection.md | 详细的检测规则 |
| verification_checklist.md | 完整的验证清单 |
| 错误 | 原因 | 解决方案 |
|---|---|---|
| 未检测到技术栈 | 空项目 | 询问用户预期的技术栈 |
| 执行器失败 | 缺少依赖项 | 安装先决条件,重试 |
| 验证失败 | 配置错误 | 检查特定工具输出,修复 |
| 钩子不工作 | Git 未初始化 | 先运行 git init |
版本: 3.0.0 最后更新: 2026-03-18
每周安装量
150
仓库
GitHub 星标数
245
首次出现
2026年1月24日
安全审计
安装于
claude-code139
gemini-cli135
codex135
cursor135
opencode135
github-copilot130
Paths: File paths (
shared/,references/,../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. Ifshared/is missing, fetch files via WebFetch fromhttps://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.
Type: L2 Domain Coordinator Category: 7XX Project Bootstrap Parent: ln-700-project-bootstrap
Coordinates code quality tooling configuration for the project.
Does:
Does NOT:
| Trigger | Action |
|---|---|
| After ln-720-structure-migrator completes | Automatic delegation from ln-700 |
| Manual quality setup needed | Invoke directly with project path |
| Existing project needs quality tools | Run with existing config detection |
| Phase | Action | Output |
|---|---|---|
| 1 | Stack Detection | Identified technologies |
| 2 | Existing Config Check | Skip/merge/replace decisions |
| 3 | Parallel Delegation | Worker invocations |
| 4 | Verification | Working quality pipeline |
Detect project technologies to determine which quality tools to configure.
Detection Rules:
| File Pattern | Technology | Linter Stack |
|---|---|---|
package.json + tsconfig.json | TypeScript/React | ESLint + Prettier |
*.csproj or *.sln | .NET | editorconfig + Roslyn |
pyproject.toml or requirements.txt | Python | Ruff |
| Multiple detected | Mixed |
Actions:
Before delegating, check what configurations already exist.
Config Files to Check:
| Technology | Config Files |
|---|---|
| TypeScript | eslint.config.*, .prettierrc*, tsconfig.json |
| .NET | .editorconfig, Directory.Build.props |
| Python | ruff.toml, pyproject.toml [tool.ruff] |
| Pre-commit | .husky/, |
Decision Matrix:
| Existing Config | Action | Confirmation |
|---|---|---|
| None found | Create from template | No |
| Exists but incomplete | Extend to match template | No |
| Exists and matches template | Skip | Inform user |
Completeness Check (Python): evaluate against ln-741's Completeness Check table (7 aspects: Ruff rules, per-file-ignores, advanced settings, MyPy strict, advanced tools, lint script, editorconfig). If ANY aspect is incomplete, delegate to ln-741 with instruction to EXTEND (not replace).
Invoke workers for each quality aspect. Workers can run in parallel as they configure independent tools.
Delegation Order:
ln-740 (this)
|
+---> ln-741-linter-configurator
| - ESLint/Prettier (TypeScript)
| - editorconfig/Roslyn (.NET)
| - Ruff (Python)
|
+---> ln-742-precommit-setup
| - Husky + lint-staged (Node.js)
| - pre-commit framework (Python)
| - commitlint
|
+---> ln-743-test-infrastructure
- Vitest (TypeScript)
- xUnit (.NET)
- pytest (Python)
Pass detected stack and existing configs to workers via direct Skill tool invocation. For Python: instruct ln-741 to apply full quality stack per its Completeness Check table.
Invocations:
Skill(skill: "ln-741-linter-configurator", args: "{projectPath}")
Skill(skill: "ln-742-precommit-setup", args: "{projectPath}")
Skill(skill: "ln-743-test-infrastructure", args: "{projectPath}")
After all workers complete, verify the quality pipeline works.
Verification Steps:
| Check | TypeScript | Python | .NET |
|---|---|---|---|
| Lint | ESLint | ruff check | dotnet format --verify-no-changes |
| Format | Prettier | ruff format --check | dotnet format |
| Type check | tsc --noEmit | mypy | Roslyn (build) |
| Import boundaries | depcruise |
On Failure:
RULE 1: Never overwrite existing user configurations without explicit confirmation.
RULE 2: Workers run AFTER stack detection - do not invoke workers without knowing the stack.
RULE 3: Verification phase is MANDATORY - quality setup is not complete until tools run successfully.
RULE 4: eslint-config-prettier is REQUIRED when both ESLint and Prettier are configured.
TodoWrite format (mandatory):
- Invoke ln-741-linter-configurator (pending)
- Invoke ln-742-precommit-setup (pending)
- Invoke ln-743-test-infrastructure (pending)
- Verify quality pipeline (pending)
| Phase | Worker | Context |
|---|---|---|
| 3a | ln-741-linter-configurator | Shared (Skill tool) — ESLint/Prettier, editorconfig, Ruff |
| 3b | ln-742-precommit-setup | Shared (Skill tool) — Husky, lint-staged, commitlint |
| 3c | ln-743-test-infrastructure | Shared (Skill tool) — Vitest, xUnit, pytest |
All workers: Invoke via Skill tool — workers see coordinator context.
MANDATORY READ: Load shared/references/meta_analysis_protocol.md
Skill type: execution-orchestrator. Analyze this session per protocol §7. Output per protocol format.
| File | Purpose |
|---|---|
| stack_detection.md | Detailed detection rules |
| verification_checklist.md | Full verification checklist |
| Error | Cause | Resolution |
|---|---|---|
| No stack detected | Empty project | Ask user for intended stack |
| Worker failed | Missing dependencies | Install prerequisites, retry |
| Verification failed | Config error | Check specific tool output, fix |
| Hooks not working | Git not initialized | Run git init first |
Version: 3.0.0 Last Updated: 2026-03-18
Weekly Installs
150
Repository
GitHub Stars
245
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code139
gemini-cli135
codex135
cursor135
opencode135
github-copilot130
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
33,600 周安装
| Configure all detected |
.pre-commit-config.yaml| Tests | vitest.config.*, pytest.ini, *.Tests.csproj |
lint-imports |
| -- |
| Unused deps | knip | deptry | -- |
| Dead code | knip | vulture | -- |
| Vulnerability scan | npm audit | pip-audit | -- |
| Unified script | bash scripts/lint.sh | bash scripts/lint.sh | bash scripts/lint.sh |
| Tests | npm test | pytest | dotnet test |
| Hooks | Create test commit | Create test commit | Create test commit |