skills/dimon94/devflow-tdd-enforcer/SKILL.md
Enforces TDD order in TASKS.md - Tests MUST be marked complete before Implementation tasks. Blocks violations in real-time.
npx skillsauth add aiskillstore/marketplace devflow-tdd-enforcerInstall 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.
Enforce Test-First Development (TDD) order by preventing users from marking implementation tasks complete before their corresponding test tasks.
Trigger: PreToolUse hook when editing devflow/requirements/**/TASKS.md
Source: Extracted from planner agent's TDD mandate + Constitution Article VI
- [x] **T010** [US1] Implement user registration endpoint
- [ ] **T011** [US1] Test user registration with valid data
Problem: Implementation marked done BEFORE test
Regex Pattern: \[x\].*Implementation.*\n.*\[ \].*Test
- [ ] **T010** [US1] Test user registration with valid data (write FAILING test)
- [ ] **T011** [US1] Implement user registration endpoint (make test PASS)
Or after completion:
- [x] **T010** [US1] Test user registration with valid data
- [x] **T011** [US1] Implement user registration endpoint
When violation detected, PreToolUse hook returns exit code 2 (blocks file save):
⚠️ BLOCKED - TDD Violation Detected
📋 REQUIRED ACTION:
1. Re-order TASKS.md to follow TDD sequence
2. Mark test tasks [x] BEFORE implementation tasks
3. Review Constitution Article VI - Test-First Development
Reason: CC-DevFlow enforces TDD (Tests First → Implementation)
Source: planner agent mandate + Constitution Article VI
File: {file_path}
Current Issue:
Line {N}: Implementation task marked complete
Line {N+1}: Test task NOT marked complete
💡 SKIP: Add `@skip-tdd-check` comment or set SKIP_TDD_ENFORCER=1
TDD MANDATE:
- Write test FIRST (must fail)
- Implement code SECOND (make test pass)
- No implementation without corresponding test
- Test coverage ≥80%
# ❌ BLOCKED
- [x] **T020** [US2] Implement login endpoint
- [ ] **T021** [US2] Test login with valid credentials
# ✅ CORRECT
- [x] **T020** [US2] Test login with valid credentials
- [x] **T021** **T021** [US2] Implement login endpoint
Regex Pattern: \[x\].*\[US\d+\].*Implement.*\n.*\[ \].*\[US\d+\].*Test
# ❌ BLOCKED (if no corresponding test found)
- [ ] **T030** [US3] Implement password reset endpoint
# (No T029 or T031 test task found)
# ✅ CORRECT
- [ ] **T029** [US3] Test password reset with valid email
- [ ] **T030** [US3] Implement password reset endpoint
Users can bypass TDD enforcer in specific scenarios:
sessionSkillUsed: true in skill-rules.json@skip-tdd-check comment anywhere in TASKS.md<!-- @skip-tdd-check: Hotfix deployment, will add tests in follow-up -->
SKIP_TDD_ENFORCER=1Relationship: Complementary (双重保险)
In .claude/skills/skill-rules.json:
{
"devflow-tdd-enforcer": {
"type": "guardrail",
"enforcement": "block",
"priority": "critical",
"description": "Enforces TDD order, extracted from planner agent rules",
"fileTriggers": {
"pathPatterns": ["devflow/requirements/**/TASKS.md"],
"contentPatterns": [
"\\[x\\].*Implementation.*\\n.*\\[ \\].*Test",
"\\[x\\].*\\[US\\d+\\].*Implement.*\\n.*\\[ \\].*\\[US\\d+\\].*Test"
]
},
"blockMessage": "⚠️ BLOCKED - TDD Violation\n\nTasks must follow TDD order:\n1. [ ] Test (write failing test)\n2. [ ] Implementation (make test pass)\n\n📋 ACTION: Re-order TASKS.md\nSource: planner agent mandate + Constitution Article VI\n\n💡 SKIP: @skip-tdd-check or SKIP_TDD_ENFORCER=1",
"skipConditions": {
"sessionSkillUsed": true,
"fileMarkers": ["@skip-tdd-check"],
"envOverride": "SKIP_TDD_ENFORCER"
}
}
}
This guardrail does NOT contain:
This guardrail ONLY contains:
Rationale: Avoid duplication ("不重不漏" principle). planner agent owns TDD generation logic, guardrail owns real-time enforcement.
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.