project-check
Existing project health scan — audits Infrastructure, Security, Quality, and Harness setup. Read-only. Use when: '/project-check', 'project health check', 'project audit', 'what\\'s missing', 'analyze my project', 'check setup'. Ends with /project-init and /setup recommendations. NOT for new projects (use /project-init); project-check = shallow health scan.
AlexZio00 · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add AlexZio00/sovereign-skills --skill project-check技能说明
skill_type: analysis triggers:
- "/project-check"
- "project-check"
- "what's wrong"
name: project-check
description: "Existing project health scan — audits Infrastructure, Security, Quality, and Harness setup. Read-only. Use when: '/project-check', 'project health check', 'project audit', 'what\'s missing', 'analyze my project', 'check setup'. Ends with /project-init and /setup recommendations. NOT for new projects (use /project-init); project-check = shallow health scan."
user_invocable: true
tools: Read, Bash, Glob, Grep
depends_on:
skills: []
agents: []
files:
- CLAUDE.md
- ~/.claude/rules/project rules
- .project-check-history.json concurrency_profile: read_only: true concurrency_safe: true destructive: none not_for:
- "New project setup -> setup skill"
- "Deep, scored harness-maturity audit against a fixed multi-axis checklist -> check-harness (project-check is a shallow one-pass scan, not a maturity score)" see_also:
- skill: setup relation: "project-check=existing audit, setup=new project"
- skill: check-harness relation: "project-check=shallow one-time 4-dimension scan with no persistent scoring model, check-harness=deep multi-axis maturity scoring with trend tracking"
Project Check — Existing Project Health Scan
Dominant Variable
Discovered gaps are sorted by severity so the user knows "what to fix first" — an unsorted gap list causes information overload. A report without priority is useless.
Purpose
Scan an existing project against setup best practices across 4 dimensions: Infrastructure, Security, Quality, and Harness. Surface all gaps ordered by severity so the user knows exactly what to fix and in what order.
Dominant variable: Are 🔴 Security issues (hardcoded secrets, .env missing) displayed before all other gaps?
- Read-only skill: This skill does not modify project files. It generates a gap report only; fix recommendations are delegated to
/project-initor/setup.
Discard if: Empty directory or a freshly initialized project (git init) — nothing to scan. Use /project-init directly instead.
Discard If
Empty directory or newly initialized project (git init with no code yet) — nothing to audit. Use /project-init.
This skill audits code, infrastructure, security, and quality only.
Need a persistent, weighted maturity score with cross-axis trend tracking instead of a one-time 4-dimension pass/fail scan — use /check-harness, not this skill.
Key Assumptions
- Project root contains CLAUDE.md or .claude/ directory — if missing: recommend
/project-init. - Git repository — if not a repo: skip some Infrastructure checks.
Trigger
/project-check- "project-check"
- "what's wrong"
Workflow
Step 0: Scale Detection
Count source files to calibrate warning thresholds:
Scan: *.py, *.ts, *.tsx, *.js, *.go, *.rs, *.java, *.kt, *.swift, *.c, *.cpp, *.h
Classify:
- script: < 10 source files or < 500 LOC → minimal structure expected, skip ROADMAP/ADR warnings
- mini: 10–50 files or 500–5,000 LOC → CLAUDE.md + tests expected
- full: > 50 files or > 5,000 LOC → full structure expected, ROADMAP + docs/decisions/ recommended
Detect project name from directory name or name field in package.json / pyproject.toml / Cargo.toml if present.
Step 1: Infrastructure Scan
| Item | Check | Severity if missing/incomplete |
|---|---|---|
CLAUDE.md | Exists? Has ## Hard Rules? Has ## Secrets Policy? | ✗ missing / ⚠ incomplete |
docs/DEVELOPMENT_ROADMAP.md | Exists? (skip if scale=script) | ✗ if scale=full/mini |
.gitignore | Exists? .env actually ignored — verified via git check-ignore -v .env (see Step 2), not just string presence in the file | ✗ missing / 🔴 not ignored or already tracked (see Step 2) |
.env.example | Exists? (if API key patterns found in code) | ✗ if keys detected |
docs/decisions/ | Exists? (only check if scale=full) | ⚠ if scale=full |
For CLAUDE.md: count Hard Rules entries (lines starting with - under ## Hard Rules). Report the count.
Step 2: Security Scan
Grep these patterns across all source files (case-insensitive). Exclude: *.example, .env.example, files in tests/, __tests__/, spec/:
API_KEY\s*=\s*["'][^$({] → hardcoded API key
sk-[A-Za-z0-9]{20,} → OpenAI key (sk-...)
sk-ant-[A-Za-z0-9\-]{20,} → Anthropic key (sk-ant-api03-...)
ghp_[A-Za-z0-9]{36} → GitHub PAT
password\s*=\s*["'][^$({] → hardcoded password
secret\s*=\s*["'][^$({] → hardcoded secret
token\s*=\s*["'][^$({] → hardcoded token
Each match → 🔴 with file:line reference.
Additional checks — .env protection (skip entirely if not a git repo, per Key Assumption 2):
A string match for .env inside .gitignore is not proof of protection — the pattern can be malformed (wrong path, typo, wrong glob syntax) and never actually match, or the file can already be tracked in git, in which case .gitignore has no effect on it at all. Verify both:
git check-ignore -v .env— confirms the pattern actually matches the file. No output / non-zero exit → the listed pattern doesn't cover.env→ 🔴 ".envpresent in.gitignoretext but the pattern doesn't actually match (git check-ignore reports it as not ignored)".git ls-files --error-unmatch .env(exit 0 means tracked) — if.envis already tracked, → 🔴 ".envis already tracked in git —.gitignorecannot retroactively untrack it. Needsgit rm --cached .env(manual step; this skill does not run it)".
.envmissing from.gitignoreentirely (no string match) → 🔴 as before..env.local,.env.*.localin.gitignore→ ⚠ if missing (TypeScript/Next.js projects). Apply the samegit check-ignore -vverification when a matching line is present.
Step 3: Quality Scan
Test coverage proxy:
Count test files (test_*.py, *_test.py, `*.test.