pdlc-lint
Solid代码质量检查与自动修复
AI & Automation 16 stars
2 forks Updated yesterday MIT
Install
Quality Score: 85/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# 代码质量检查与自动修复
<!-- @include templates/prompts/iron-law.md(已内联于下方,无需另读) -->
⛔ **IRON LAW · 不可违反的硬门禁**
以下规则为**不可协商**的执行约束:
1. **文件必须落盘**:所有带编号(功能ID / 缺陷ID)的文档,必须作为实际文件写入磁盘,不可仅在对话中输出。
2. **阶段必须落章**:每个阶段完成后必须在状态机 `docs/.pdlc-state/<feature-id>.json` 追加 history,不可跳过。
3. **测试必须存在**:进入 `/pdlc-implement` 前,对应测试必须存在且处于红灯状态。违反则中止。
4. **自检必须执行**:段二自检为强制步骤,不得以"已经很好了"为由跳过。
5. **防循环**:段三修复为单次,不递归。无法自动修复的问题记录到报告,继续往下走。
6. **状态必推进**:成功执行某 phase 后 `current_stage` 必须变更。收尾时若发现 `current_stage` 未推进,视为失败并报错,**不得静默返回**(防止外层循环拿滞后的状态空转烧额度)。唯一例外:命中人工点主动 block 时,`current_stage` 保持不变但必须写 `last_phase_result.ok=false` + `blocked_reason`。
**违反任一条 = 立即中止当前命令,输出违规详情,等待人工介入。**
<!-- @include-end templates/prompts/iron-law.md -->
对项目代码执行静态分析、风格检查和质量度量,自动修复可安全修复的问题,输出结构化报告。
## 子命令解析
从本命令的参数中解析子命令和选项:
| 子命令 | 格式 | 说明 |
|--------|------|------|
| `check [目标]` | 运行全量检查,输出报告(默认子命令) |
| `fix [目标]` | 自动修复可安全修复的问题 |
| `setup` | 为项目配置 lint 工具链(检测技术栈,生成配置文件) |
- `目标` 可选,支持:服务名、应用名、目录路径、文件路径。不传则检查整个项目。
- 如果未提供子命令,默认执行 `check`。
---
## 工具链自动探测
扫描项目目录,按以下优先级检测已有的 lint 工具:
### 前端 / Node.js 项目
按优先级检测(找到第一个可用的即停止):
| 工具 | 检测方式 | 运行命令 |
|------|---------|---------|
| ESLint(flat config) | `eslint.config.*` 存在 | `npx eslint .` |
| ESLint(legacy) | `.eslintrc*` 存在 | `npx eslint .` |
| Biome | `biome.json` 或 `biome.jsonc` 存在 | `npx biome check .` |
| oxlint | `package.json` 含 `oxlint` 依赖 | `npx oxlint .` |
样式检查(与上述并行):
| 工具 | 检测方式 | 运行命令 |
|------|---------|---------|
| Stylelint | `.stylelintrc*` 或 `stylelint.conf...
Details
- Author
- kanfu-panda
- Repository
- kanfu-panda/pdlc-skills
- Created
- 4 months ago
- Last Updated
- yesterday
- Language
- Shell
- License
- MIT
Bundled in these plugins
Similar Skills
Semantically similar based on skill content — not just same category
Code & Development Featured
eslint-fix
安全诊断并修复 ESLint error、warning 和配置兼容问题。用于用户要求运行 lint、解释 ESLint 报错、限定范围自动修复或迁移 ESLint 配置时;优先使用项目锁定的包管理器与版本,先预检再修改,不自动下载最新版或批量改写无关源码。
869 Updated 4 days ago
laolaoshiren AI & Automation Listed
pdlc-adopt
旧项目接入 PDLC
16 Updated yesterday
kanfu-panda AI & Automation Listed
forge-health
Use when running periodic repository health inspection, code debt scanning, or pre-milestone codebase audits.
1 Updated 1 months ago
gldu