pdlc-lint — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited pdlc-lint (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
<!-- @include templates/prompts/iron-law.md -->
对项目代码执行静态分析、风格检查和质量度量,自动修复可安全修复的问题,输出结构化报告。
从 $ARGUMENTS 中解析子命令和参数:
| 子命令 | 格式 | 说明 |
|---|---|---|
check [目标] | 运行全量检查,输出报告(默认子命令) | |
fix [目标] | 自动修复可安全修复的问题 | |
setup | 为项目配置 lint 工具链(检测技术栈,生成配置文件) |
目标 可选,支持:服务名、应用名、目录路径、文件路径。不传则检查整个项目。check。扫描项目目录,按以下优先级检测已有的 lint 工具:
按优先级检测(找到第一个可用的即停止):
| 工具 | 检测方式 | 运行命令 |
|---|---|---|
| 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.config.* 存在 | npx stylelint "**/*.{css,scss,less}" |
| Prettier | .prettierrc* 或 prettier.config.* 存在 | npx prettier --check . |
TypeScript 类型检查(如存在 tsconfig.json):
npx tsc --noEmit| 工具 | 检测方式 | 运行命令 |
|---|---|---|
| Checkstyle | checkstyle*.xml 或 pom.xml 含 checkstyle plugin | mvn checkstyle:check |
| SpotBugs | pom.xml 含 spotbugs plugin | mvn spotbugs:check |
| PMD | pom.xml 含 pmd plugin | mvn pmd:check |
| SonarQube | sonar-project.properties 或 pom.xml 含 sonar plugin | mvn sonar:sonar(需配置连接) |
| Spotless | pom.xml 含 spotless plugin | mvn spotless:check |
Gradle 项目检测 build.gradle / build.gradle.kts 并使用对应 gradle 命令。
| 工具 | 检测方式 | 运行命令 |
|---|---|---|
| golangci-lint | .golangci.yml 或 go.mod 存在 | golangci-lint run ./... |
| go vet | go.mod 存在 | go vet ./... |
| staticcheck | go.mod 存在 | staticcheck ./... |
| 工具 | 检测方式 | 运行命令 |
|---|---|---|
| Ruff | ruff.toml 或 pyproject.toml 含 [tool.ruff] | ruff check . |
| Flake8 | .flake8 或 setup.cfg 含 [flake8] | flake8 . |
| Pylint | .pylintrc 或 pyproject.toml 含 [tool.pylint] | pylint **/*.py |
| MyPy | mypy.ini 或 pyproject.toml 含 [tool.mypy] | mypy . |
| Black | pyproject.toml 含 [tool.black] | black --check . |
⚠️ 未检测到 lint 工具配置,正在为项目自动配置...a. 代码风格检查(ESLint / Biome / Checkstyle / golangci-lint / Ruff 等) b. 类型检查(TypeScript tsc / MyPy / go vet 等) c. 安全扫描(如有 npm audit / mvn dependency:analyze / safety check) d. 代码复杂度分析(从 lint 输出中提取,或使用工具内置规则)
| 级别 | 含义 | 示例 |
|---|---|---|
| 🔴 Error | 必须修复 | 语法错误、类型错误、安全漏洞 |
| 🟠 Warning | 应该修复 | 未使用变量、复杂度过高、潜在 Bug |
| 🟡 Info | 建议修复 | 命名不规范、缺少 JSDoc、import 排序 |
| 🔵 Style | 可自动修复 | 格式化、尾逗号、引号风格 |
## 代码质量报告
### 工具链
| 工具 | 版本 | 状态 |
|------|------|------|
| ESLint | 9.x | ✅ 已运行 |
| TypeScript | 5.x | ✅ 已运行 |
| Prettier | 3.x | ✅ 已运行 |
### 问题汇总
| 级别 | 数量 | 可自动修复 |
|------|------|-----------|
| 🔴 Error | N | N |
| 🟠 Warning | N | N |
| 🟡 Info | N | N |
| 🔵 Style | N | N |
### 问题详情(按文件分组)
#### `src/services/userService.ts`
| 行 | 级别 | 规则 | 描述 | 可修复 |
|----|------|------|------|--------|
| 23 | 🔴 | @typescript-eslint/no-explicit-any | 避免使用 any 类型 | ❌ |
| 45 | 🔵 | prettier/prettier | 格式化不一致 | ✅ |
### 质量指标
- 问题密度:X 个/千行代码
- 可自动修复比例:XX%
### 建议
👉 运行 `/pdlc-lint fix` 自动修复 N 个问题| 技术栈 | 修复命令 |
|---|---|
| ESLint | npx eslint --fix . |
| Biome | npx biome check --write . |
| Prettier | npx prettier --write . |
| Stylelint | npx stylelint --fix "**/*.{css,scss,less}" |
| Spotless (Java) | mvn spotless:apply |
| golangci-lint | golangci-lint run --fix ./... |
| Ruff | ruff check --fix . |
| Black | black . |
## 自动修复报告
### 修复结果
| 指标 | 修复前 | 修复后 | 变化 |
|------|--------|--------|------|
| 🔴 Error | N | N | -N |
| 🟠 Warning | N | N | -N |
| 🟡 Info | N | N | -N |
| 🔵 Style | N | 0 | -N |
| **总计** | N | N | **-N** |
### 修改的文件
| 文件 | 修复数 |
|------|--------|
| src/xxx.ts | N |
### 剩余需手动修复的问题
(列出无法自动修复的 Error 和 Warning)
### 建议
- 🔴 Error 需要手动修复,建议逐一处理
- 考虑将 lint 检查加入 CI:`/pdlc-ship`(发布流水线含 CI/CD 配置管理)package.json、pom.xml、build.gradle、go.mod、pyproject.toml、requirements.txt 等Node.js / 前端项目:
eslint.config.mjs(flat config,ESLint 9+).prettierrc(格式化配置)tsconfig.json 含 strict: truepackage.json 的 scripts 中追加: "lint": "eslint .",
"lint:fix": "eslint --fix . && prettier --write .",
"type-check": "tsc --noEmit"Java/Maven 项目:
pom.xml 中追加 Checkstyle + Spotless plugin(若不存在)checkstyle.xml(基于 Google Java Style 或项目已有规范)Go 项目:
.golangci.yml(含常用 linter 配置)Python 项目:
ruff.toml(推荐 Ruff 作为默认 linter) 💡 建议配置 Git pre-commit hook 自动运行 lint:
npx husky init # Node.js 项目
pre-commit install # Python 项目(需 pip install pre-commit)✅ Lint 工具链配置完成
已生成/更新的配置文件:
📄 eslint.config.mjs
📄 .prettierrc
📄 package.json (scripts)
已检测的技术栈:
- TypeScript 5.x + React 18
- Tailwind CSS 3.x
建议下一步:
/pdlc-lint check ← 运行首次全量检查
/pdlc-lint fix ← 自动修复可修复的问题
/pdlc-ship ← 将 lint 加入 CI 流水线(发布时自动配置)lint check 验证代码质量<!-- @include templates/prompts/output-language.md -->
npx / mvn 等包管理器临时调用检查目标: $ARGUMENTS
<!-- @include templates/prompts/handoff.md -->
本命令的 handoff 输出:
✅ 代码质量检查 完成
📦 产出:(lint 报告输出到控制台)
👉 下一步:(本次流程结束,无后续)~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.