用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Dicklesworthstone/pi_agent_rust --skill defense-in-depth命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | defense-in-depth |
| description | Multi-layer validation to catch bugs before they escape |
| version | 1.0.0 |
| author | Ariff |
| when_to_use | When making changes - validate at multiple layers |
MULTIPLE INDEPENDENT VALIDATION LAYERS
Each layer catches what others miss
One check can fail silently. Four layers rarely do.
What: Static analysis, types, linting
Catches: Typos, syntax errors, type mismatches
Run: First, before anything else
What: Individual function/module tests
Catches: Logic errors, edge cases, regressions
Run: After each code change
What: Component interaction tests
Catches: Interface mismatches, data flow errors
Run: After unit tests pass
What: Full system tests, user scenarios
Catches: Missing requirements, workflow bugs
Run: Before claiming complete
Code Change
↓
[Layer 1: Lint/Type Check]
↓ PASS?
[Layer 2: Unit Tests]
↓ PASS?
[Layer 3: Integration Tests]
↓ PASS?
[Layer 4: E2E / Manual Check]
↓ PASS?
Done
Fail at any layer → FIX before proceeding
| Without This Layer | What Escapes |
|---|---|
| No type checks | Undefined calls crash at runtime |
| No unit tests | Logic bugs slip through |
| No integration | Components don't work together |
| No E2E | User workflows broken |
1. Make change
2. Run linter immediately
3. Run affected unit tests
4. Run integration suite
5. Test the actual feature
1. Write failing test first
2. Fix the bug
3. Run all tests (regression check)
4. Verify original symptom gone
1. Write unit tests for new logic
2. Implement feature
3. Add integration tests
4. Verify against requirements
Configure per project:
layer_1:
command: "npm run lint && npm run typecheck"
when: "On save, before commit"
layer_2:
command: "npm run test:unit"
when: "After code changes"
layer_3:
command: "npm run test:integration"
when: "After unit tests pass"
layer_4:
command: "npm run test:e2e"
when: "Before claiming done"
→ Syntax/type error in your code
→ Fix immediately, don't proceed
→ Never commit with lint errors
→ Logic error or regression
→ Check: Did you break something?
→ Check: Is your new test wrong?
→ Fix root cause, not symptoms
→ Interface/contract broken
→ Check: API changes?
→ Check: State management issues?
→ May need to update multiple files
→ User-visible problem
→ Trace back through layers
→ Ask: Which layer SHOULD have caught this?
→ Add test to that layer
pre-action-verifier → Runs before each layerassumption-checker → Validates test assumptionsscope-boundary-checker → Ensures tests cover scoperollback-planner → Ready if pipeline fails