Use when implementing ANY new feature or fixing bugs. Test-Driven Development - write tests BEFORE implementation code.
/plugin marketplace add sharpner/claude-agents/plugin install workflow-core@sharpner-claude-agentsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Core Rule: Write tests BEFORE implementation code.
"If you didn't watch the test fail, you don't know if it tests the right thing."
// Write this FIRST
it('should validate email format', () => {
const result = validateEmail('invalid');
expect(result.valid).toBe(false);
expect(result.error).toBe('Invalid email format');
});
Run test → MUST FAIL (for the right reason: missing feature, not typo)
// Write this SECOND - simplest code to pass
function validateEmail(email: string) {
if (!email.includes('@')) {
return { valid: false, error: 'Invalid email format' };
}
return { valid: true };
}
Run test → MUST PASS
Improve code quality while keeping tests green.
| Point | What to Check |
|---|---|
| After writing test | Test fails for correct reason (missing feature) |
| After implementing | Test passes, no other tests break |
// Bug: User with spaces in name causes crash
it('should handle names with spaces', () => {
// This MUST fail before fix
expect(() => createUser('John Doe')).not.toThrow();
});
| Excuse | Reality |
|---|---|
| "Manual testing is enough" | Manual testing doesn't catch regressions |
| "TDD slows me down" | Debugging untested code takes 10x longer |
| "This is too simple" | Simple code still needs regression protection |
| "I'll add tests later" | You won't. And you'll introduce bugs. |
When implementing:
**TDD Cycle:**
1. ✅ Test written: `validateEmail returns error for invalid format`
2. ✅ Test fails: "validateEmail is not defined" (correct reason)
3. ✅ Implementation: Added validateEmail function
4. ✅ Test passes: 1/1 assertions passed
5. ✅ No regressions: All 47 tests still pass
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.