plugins/stv/skills/work/SKILL.md
STV Phase 3: Implementation (GREEN) + Trace Verify loop. Implements code to pass contract tests, then verifies implementation matches trace document. Supports non-linear flow — returning to spec/trace when implementation reveals errors in earlier artifacts.
npx skillsauth add 2lab-ai/oh-my-claude workInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
STV Phase 3: trace.md → GREEN implementation + Trace Verify Write code that passes contract tests, then verify implementation matches the trace document.
stv:trace firstRepeat for each scenario:
for each scenario in trace.md:
1. Re-read the scenario's trace
2. Implement code based on the trace's 7 sections
- Follow Layer Flow parameter transformation rules exactly
- Follow Side Effects exactly
- Follow Error Paths exactly
3. Run contract tests for this scenario
4. if GREEN → next scenario
5. if RED → fix based on trace, re-run (fix against trace)
Trace is the Source of Truth
GREEN one scenario at a time
Side-Effect accuracy
┌─────────────────────────────────────────────┐
│ Primary Gate (fast and stable) │
│ │
│ Trace-Driven Contract/Component Tests │
│ - Happy path, Sad path, Side-effect, │
│ Contract (parameter transformation) tests │
│ - Execution time: seconds to minutes │
│ - Stability: high (minimal external deps) │
│ - PR merge blocking criterion │
│ │
├─────────────────────────────────────────────┤
│ Secondary Gate (minimal count) │
│ │
│ E2E Tests │
│ - Only test what can only be verified in │
│ deployment env (network, permissions, │
│ deployment config, etc.) │
│ - Execution time: minutes to tens of mins │
│ - Stability: low (potentially flaky) │
│ - Pre-deployment check, not merge blocking │
│ │
└─────────────────────────────────────────────┘
Why Contract Tests are the primary gate: E2E tests are slow, fragile, flaky, and require dedicated environments. Contract Tests are fast, stable, and run locally.
After all scenarios are GREEN, verify alignment between trace document and actual implementation.
Before detailed trace verification, run a quick gap detection pass against the original spec:
assumption_injection: Added behavior not in spec?scope_creep: Features beyond what spec asked for?direction_drift: Overall approach diverges from spec intent?missing_core: Any spec requirement not implemented?over_engineering: Abstraction disproportionate to the problem?If gap detected:
Verify each scenario in trace.md against the 7-section criteria:
### Scenario {N} Verify: {title}
**Section 1 — API Entry:**
- [ ] HTTP method + route match
- [ ] Auth/authz method matches
**Section 2 — Input:**
- [ ] Request payload fields match
- [ ] Validation rules implemented
**Section 3 — Layer Flow:**
- [ ] Controller: Request → Command transformation rules match
- [ ] Service: Command → Entity transformation rules match
- Domain decision logic matches trace
- Derived values (ID generation, timestamps, etc.) follow trace rules
- [ ] Repository/DB: Entity → Row mapping matches
- Transaction boundaries match trace
- Constraints (FK, UNIQUE, etc.) exist in schema
- [ ] Parameter transformation arrow end-to-end verification
- Request.X → Command.Y → Entity.Z → table.col chain matches
**Section 4 — Side Effects:**
- [ ] All INSERT/UPDATE/DELETE specified in trace exist in code
- [ ] No unexpected DB changes beyond trace
- [ ] Event publishing/cache changes match trace
**Section 5 — Error Paths:**
- [ ] Each error condition → exception type matches
- [ ] Exception → HTTP status mapping matches
- [ ] DB rollback/no-change guaranteed on error
**Section 6 — Output:**
- [ ] Success status code matches
- [ ] Response DTO fields match
**Section 7 — Observability (if applicable):**
- [ ] Log fields included
- [ ] Span naming matches
When a mismatch is found, follow this protocol:
Mismatch found →
1. If trace is wrong (implementation is better):
→ Update trace.md → Update related tests → Re-verify
2. If code is wrong (trace is correct):
→ Fix code → Re-run tests → Re-verify
3. If judgment is difficult:
→ Ask the user
★ Either way, trace and code must always be synchronized.
★ Record modification history in the Trace Deviations section of trace.md.
while (unverified scenarios exist):
1. Select next unverified scenario
2. Read code and compare against trace using 7-section criteria
3. Mismatch → apply Mismatch Handling Protocol
4. After fixes, re-run related tests
5. GREEN + trace aligned → mark as Verified
After all scenarios pass the 7-section verify:
git diff --name-only to confirm modification★ Tests are a subset of the spec. File Map is the full modification surface.
After all scenarios are GREEN + Verified:
## Implementation Status
| Scenario | Trace | Tests | Verify | Status |
|----------|-------|-------|--------|--------|
| 1. {title} | done | GREEN | Verified | Complete |
| 2. {title} | done | GREEN | Verified | Complete |
## Trace Deviations
{Parts that deviated from trace during implementation and reasons. "None" if empty}
## Verified At
{date} — All {N} scenarios GREEN + Verified
## STV Work Complete: {feature}
{N}/{N} scenarios GREEN
{N}/{N} scenarios Trace Verified
{N} trace deviations (documented in trace.md)
### Test Results
- Total: {N} tests
- Passed: {N}
- Failed: 0
### Files Modified
{modified file list}
### File Map Coverage
- Trace File Map: {N} files
- Modified: {N}/{N}
- Unmodified: {list or "none"}
### Next Steps
- [ ] Code review
- [ ] Commit & PR
During implementation, you may discover that the trace or spec contains errors, missing scenarios, or wrong assumptions. Going back is not failure — it is the Feedback Loop invariant in action.
During implementation, if:
1. A spec assumption is wrong (business rule doesn't hold)
→ Backtrack to SPEC: re-invoke stv:spec in update mode
2. A trace section is wrong (transformation logic incorrect, missing error path)
→ Backtrack to TRACE: update trace.md in-place + apply Delta Protocol
3. A new scenario is discovered (not in trace)
→ Backtrack to TRACE: add scenario via Delta Protocol (ADDED)
4. The entire approach is wrong (architecture mismatch)
→ Backtrack to SPEC: Update vs New decision tree applies
Is the issue in trace only (implementation detail)?
├── YES → Fix trace.md in-place
│ ├── Apply Delta Protocol (MODIFIED)
│ ├── Update contract tests
│ └── Continue implementation
└── NO → Issue is in spec (requirement/architecture level)
├── Is it a small correction (switching cost < medium)?
│ ├── YES → Fix spec.md + trace.md in-place
│ └── Continue implementation
└── Is it a fundamental change (switching cost >= medium)?
├── Apply Update vs New decision tree
├── If UPDATE → re-invoke stv:spec, then stv:trace
└── If NEW → stop current work, start new spec
development
Problem space exploration mode. Stance, not workflow. Read-only codebase investigation before committing to spec. Triggers on 'explore this', 'investigate', 'understand the problem', 'what are we dealing with', 'before we spec this'.
tools
유저의 요구가 불명확할때 트리거. 애매한 요청, 다의적 지시, 범위 불분명한 작업에서 Context Brief를 생성하여 명확화한다.
testing
Triggers on "check the PR", "is it implemented per the issue", "compare spec vs implementation", "compare JIRA and PR", "verify", "validate". Final checkpoint before PR merge using 3-dimensional verification (Completeness, Correctness, Coherence).
development
STV Phase 2: spec.md -> vertical trace + RED contract tests. Traces every API scenario through all layers with 7-section format and parameter transformation arrows. Supports Delta Specs change tracking for trace evolution over time.