self-verification
Systematically verify your own implementation through layered testing. Use after completing implementation tasks, before considering the work done.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Systematically verify your own implementation through layered testing. Use after completing implementation tasks, before considering the work done.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Execute implementation plans through small, verified steps — fighting the complexity explosion that AI-assisted development naturally produces. Use throughout the entire implementation process, from first line to last commit.
Identify unvalidated technical assumptions in a design, research them against external sources (docs, APIs, community), and produce a feasibility verdict. Use after receiving requirements and before implementation planning, whenever the design depends on technologies, APIs, or platform capabilities you haven't verified.
Execute acceptance tests against completed implementation, run the full test suite, and produce a structured verification report. Use after Developer notifies implementation is complete.
Review implemented code for architectural compliance, detect entropy (bloat, duplication, boundary violations), and propose corrections. Use after Developer completes implementation, or periodically to audit codebase health.
Produce clear, actionable, reproducible bug reports. Use whenever a test fails or unexpected behavior is discovered during verification.
Read and understand a codebase's architecture, modules, boundaries, and conventions. Use when onboarding to a new project, before designing any implementation, or when the codebase has evolved significantly since last review.
| name | self-verification |
| description | Systematically verify your own implementation through layered testing. Use after completing implementation tasks, before considering the work done. |
Prove your code works — to yourself, with evidence — before anyone else sees it.
"Testing shows the presence, not the absence of bugs." — Edsger Dijkstra
If testing can only show presence, then the question is: how thoroughly have you looked? A developer who runs one happy-path test and calls it done has barely looked at all.
"I'm not a great programmer; I'm just a good programmer with great habits." — Kent Beck
Self-verification is a habit, not a talent. The discipline of checking your own work at multiple levels is what separates code that survives contact with reality from code that merely compiles.
"Code without tests is broken by design." — Jacob Kaplan-Moss
But tests themselves can be broken by design too. A test that always passes proves nothing. A test that mirrors the implementation instead of testing the behavior is just a mirror — it reflects what you wrote, not whether it's correct.
AI agents are exceptionally good at producing code that looks correct. The syntax is right. The structure is reasonable. The variable names are descriptive. And yet:
You cannot see these problems by reading. You can only find them by executing — with tests designed to expose failure, not to confirm success.
Self-verification is inside-out testing: does my code do what I intended? This is distinct from acceptance testing, which works outside-in from requirements. Both are needed, but this skill focuses on what you can verify as the implementer — using your knowledge of the code to test it more deeply than anyone else can.
Test individual functions and modules in isolation.
What to test:
Test selection rules (from the test pyramid):
Red flags in your unit tests:
Test that your modified/created modules interact correctly with their dependencies.
What to test:
When to use integration over unit:
Duplicate coverage guard — before adding an integration test, check:
Step outside your developer perspective. Pretend you're a user. Run the feature.
What to do:
This is not acceptance testing. You're not verifying every acceptance criterion. You're doing a basic sanity check: does the thing I just built actually work when used like a real user would?
Common discovery at this layer:
After all three layers, produce an honest assessment:
## Self-Verification: [Task Name]
### Unit Tests
- Tests added: [count]
- Coverage: [what's covered — functions, branches, edge cases]
- All passing: yes/no
### Integration Tests
- Tests added: [count]
- Coverage: [which module interactions verified]
- All passing: yes/no
### Smoke Verification
- Core journey tested: [describe what you did]
- Result: works / works with caveats / fails
- Issues found: [list, or "none"]
### Full Suite
- Ran complete test suite: yes/no
- Regressions found: none / [describe]
### Honest Assessment
- Confidence level: high / medium / low
- Known gaps: [anything you couldn't test and why]
- Risks for downstream verification: [what should get extra attention]
The "Honest Assessment" section is the most important part. Flagging "error handling around X has low confidence because edge cases are hard to reproduce" saves everyone time. Pretending everything is perfect when it isn't wastes everyone's time.
A test is valuable when it can fail meaningfully. Ask yourself:
| What it looks like | Why it's dangerous |
|---|---|
| Writing tests that mirror the implementation | You're testing that your code does what your code does — circular |
| Testing only the happy path | Edge cases are where bugs live |
| Mocking everything | You're testing your mocks, not your code |
| Skipping Layer 3 ("unit tests pass, it must work") | Unit tests verify pieces; they don't verify the whole |
| Reporting high confidence without running the full suite | Confidence without evidence is optimism, not verification |
| Testing framework behavior instead of your code | Don't test that Array.push works — test your logic that uses it |