用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/sd0xdev/sd0x-dev-flow-codex --skill precommit命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Route setup using exact migration registry [{"unit":"setup/default","routing":{"negative_boundaries":["Do not run setup; only execute deterministic repository verification.","Only assess test coverage, acceptance criteria, flakiness, and verification gaps.","Only review the current code changes for correctness and defects."],"positive_triggers":["Apply the canonical setup workflow and report its evidence.","Help me run the setup workflow for this repository.","I need the canonical setup procedure with its safety boundaries."]}},{"unit":"setup/guidance","routing":{"negative_boundaries":["Do not run setup guidance mode; only execute deterministic repository verification.","Only assess test coverage, acceptance criteria, flakiness, and verification gaps.","Only review the current code changes for correctness and defects."],"positive_triggers":["Apply the canonical setup guidance mode workflow and report its evidence.","Help me run the setup guidance mode workflow for this repository.","I need the canonical setup
Route deep-research using exact migration registry [{"unit":"deep-research/default","routing":{"negative_boundaries":["Answer a narrow repository question using one file.","Implement the recommended database migration strategy.","Trace only the internal execution path without external research."],"positive_triggers":["Compare database migration strategies using official sources, repository constraints, and real-world evidence.","Conduct deep research on this technical decision from multiple independent source types.","Research the current landscape and produce a claim registry with conflicts and confidence."]}}].
Route architecture-advice using exact migration registry [{"unit":"architecture-advice/default","routing":{"negative_boundaries":["Create the feature 3-architecture.md lifecycle document.","Implement the selected architecture in production code.","Write an implementation-ready technical specification and task breakdown."],"positive_triggers":["Compare architecture options for introducing an event bus in this codebase.","Give an independent architecture second opinion on this proposed caching design.","Recommend a component boundary for the billing integration with repository evidence."]}}].
基于 SOC 职业分类
正在显示 SKILL.md
| name | precommit |
| description | Pre-commit checks — lint:fix -> build -> test |
| allowed-tools | Bash(node:*), Bash(pnpm:*), Bash(yarn:*), Bash(npm:*), Bash(npx:*), Bash(python*:*), Bash(pytest:*), Bash(ruff:*), Bash(mypy:*), Bash(cargo:*), Bash(go:*), Bash(golangci-lint:*), Bash(./gradlew:*), Bash(mvn:*), Bash(bundle:*), Bash(rubocop:*), Bash(rspec:*), Bash(git:*), Read, Grep, Glob |
/precommit-fast)/verify)| Step | Goal | Safety | Skip if Missing |
|---|---|---|---|
| lint-fix | Auto-fix code style issues | read-write | yes |
| build | Verify compilation succeeds | read-only | yes |
| test-unit | Run full test suite | read-only | yes |
Failure behavior: continue-all (run all steps, report all results)
Run pre-commit checks: lint:fix -> build -> test
Use Glob to check if .claude/scripts/precommit-runner.js exists in the project root.
node .claude/scripts/precommit-runner.js --mode full --tail 80
## Overall: ✅ PASS, use its output and skip to the Output section.## Overall: ⚠️ NO CHECKS RUN (host repo has no matching package.json scripts), do NOT treat it as a pass — fall through to Step 2 ecosystem detection so the project's real checks (ruff/pytest, cargo, go test, …) run. This is fail-closed: an all-skip run never satisfies the gate on its own.## Overall: ❌ FAIL), treat as a real precommit failure (do not silently fallback).Detect the project ecosystem to run steps manually.
Ecosystem detection:
| Manifest | Ecosystem | Lint-fix | Build | Test |
|---|---|---|---|---|
package.json | Node.js | {pm} lint:fix | {pm} build | {pm} test:ci / test / test:fast / test:unit |
pyproject.toml | Python | ruff check --fix . | — | pytest tests/unit/ |
Cargo.toml | Rust | cargo clippy --fix | cargo build | cargo test |
go.mod | Go | golangci-lint run --fix | go build ./... | go test ./... |
build.gradle | Java (Gradle) | ./gradlew spotlessApply | ./gradlew build | ./gradlew test |
pom.xml | Java (Maven) | mvn spotless:apply | mvn compile | mvn test |
Gemfile | Ruby | bundle exec rubocop -a | — | bundle exec rspec |
For Node.js projects, auto-detect package manager from lockfile.
| Step | package.json script | If missing |
|---|---|---|
| lint:fix | lint:fix | Skip with note |
| build | build | Skip with note |
| test | test:ci → test → test:fast → test:unit | Skip with note |
After lint:fix completes, run git diff --name-only to capture auto-fixed files.
## Precommit (full)
## Results
| Step | Status | Notes |
|------|--------|-------|
| lint:fix | ✅/❌/⏭️ | skipped if no script |
| build | ✅/❌/⏭️ | skipped if no script |
| test | ✅/❌/⏭️ | skipped if no script |
## Changed Files (after lint:fix)
- <files or "(none)">
## Overall: ✅ PASS / ❌ FAIL / ⚠️ NO CHECKS RUN (only when no runnable script AND no ecosystem check exists — needs human)
## Checklist
- [ ] All available checks pass
- [ ] git status reviewed