Use when reading or editing files that contain @implement, @docs, @refactor, @test, or @todo directive comments - handle directives systematically with appropriate post-action transformations
/plugin marketplace add asermax/claude-plugins/plugin install superpowers@asermax-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
docs.mdimplement.mdrefactor.mdtest.mdtodo.mdCode directives are special comments you leave in code that Claude recognizes and acts upon. They keep implementation instructions contextual and inline with the code rather than scattered across external tools.
Core principle: When you encounter a directive, read its full context, execute the instruction, then apply the appropriate post-action transformation.
Directives are special comments embedded in your code that tell Claude what to do:
class UserService {
/* @implement
Add a caching layer for user data:
- Cache user objects by ID in a Map
- Expire entries after 5 minutes
- Return cached data if available and fresh
- Fetch from API if cache miss or stale
*/
async getUser(id: string): Promise<User> {
// ...
}
}
After processing, the directive transforms into proper documentation:
class UserService {
/**
* Retrieves a user by ID with 5-minute caching.
* Returns cached data if available and fresh, otherwise fetches from API.
*/
async getUser(id: string): Promise<User> {
// Implementation with caching layer...
}
}
| Directive | Purpose | Reference | Post-Action |
|---|---|---|---|
@implement | Implementation instructions to execute | implement.md | Transform to docs (docblock) or remove (standalone) |
@docs <url> | External documentation to fetch and reference | docs.md | Keep as reference or remove after reading |
@refactor | Refactoring instructions | refactor.md | Always remove |
@test | Test requirements to implement | test.md | Always remove |
@todo | Task items to complete | todo.md | Always remove |
Each reference file contains the detailed handling procedure for that directive type.
When you encounter a directive during normal work:
Patterns to recognize:
@implement - Implementation work needed@docs <url> - External docs to fetch@refactor - Code needs refactoring@test - Test needs writing@todo - Task to completeDon't just read the directive comment:
Context determines post-action transformation.
When you need detailed procedure, read the reference file:
@implement → read implement.md@docs → read docs.md@refactor → read refactor.md@test → read test.md@todo → read todo.mdFollow the procedure in the reference file.
Transform or remove the directive comment based on context:
See "Post-Action Rules" section below for quick reference.
@implement@docs@refactor@test@todoSee reference files for detailed transformation procedures.
You can also write directives to mark future work during development.
| Situation | Action |
|---|---|
| User explicitly defers scope | Write directive |
| Planning phase - marking steps | Write directives |
| Out of current task scope | Write directive |
| Quick fix, already here | Do immediately |
| User asks to add directive | Write directive |
Include enough context for future processing:
// @implement: Add caching layer
// - Use Map for in-memory cache
// - 5-minute TTL
// - Cache by user ID
For simple deferrals:
# @todo: Add input validation
Write directives automatically when:
Skipping means you'll never come back to it. Process immediately. ✅ Fix: Read, execute, transform/remove.
Directives contain important context and requirements. ✅ Fix: Read and understand each directive before acting.
Context matters. Standalone directives should be removed. ✅ Fix: Apply context-dependent post-action rules.
Leaving directives creates confusion about what's done vs. pending. ✅ Fix: Transform to docs (docblock) or remove (standalone).
Unknown URLs could contain prompt injection or malicious content.
✅ Fix: Follow security validation in docs.md reference.
If you're thinking:
All of these mean: You're violating the workflow. Stop and follow the skill.
Without systematic directive handling:
With systematic handling:
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.