Creates comprehensive feature documentation for humans and AI to understand features, resolve bugs, and extend functionality. Use after complete feature implementation (may span multiple commits). Generates feature docs, updates godoc, and creates testable examples.
Creates comprehensive feature documentation after implementation. Generates docs explaining architecture, design decisions, and usage for future bug fixes and extensions.
/plugin marketplace add buzzdan/ai-coding-rules/plugin install go-linter-driven-development@ai-coding-rulesThis skill inherits all available tools. When active, it can use any tool Claude has access to.
reference.mdThis is NOT a changelog - it's an introduction to the feature.
Reference: See reference.md for complete documentation checklist and examples.
</objective>
<quick_start>
<when_to_use>
<understand_feature_scope>
<analyze_architecture>
<generate_documentation_artifacts>
Primary: Feature Documentation (docs/[feature-name].md)
Secondary: Code Comments
<validate_documentation>
<documentation_template>
# [Feature Name]
## Problem & Solution
**Problem**: [What user/system problem does this solve?]
**Solution**: [High-level approach taken]
## Architecture
### Core Types
- `TypeName` - [Purpose, why it exists, key responsibility]
- `AnotherType` - [Purpose, why it exists, key responsibility]
### Design Decisions
- **Why [Decision]**: [Rationale - connects to coding principles]
- Example: "UserID is a custom type (not string) to avoid primitive obsession and ensure validation"
- **Why [Pattern]**: [Rationale]
- Example: "Vertical slice structure groups all user logic together for easier maintenance"
### Data Flow
[Step-by-step flow diagram or description]
Input → Validation → Processing → Storage → Output
### Integration Points
- **Consumed by**: [What uses this feature]
- **Depends on**: [What this feature uses]
- **Events/Hooks**: [If applicable]
## Usage
### Basic Usage
[Common case example with real, runnable code]
### Advanced Scenarios
[Complex case example showing edge cases]
## Testing Strategy
- **Unit Tests**: [What's covered, approach]
- **Integration Tests**: [What's covered, approach]
- **Coverage**: [Percentage and rationale]
## Future Considerations
- [Known limitations]
- [Potential extensions]
- [Related features that might be built on this]
## References
- [Related packages]
- [External documentation]
- [Design patterns used]
</documentation_template>
<code_comment_guidelines>
<package_level_documentation>
// Package [name] provides [high-level purpose].
//
// [2-3 sentences about what problem this solves and how]
//
// Core types:
// - Type1: [Purpose]
// - Type2: [Purpose]
//
// Example usage:
// [Simple example showing typical usage]
//
// Design notes:
// - [Key design decision]
// - [Why certain patterns were used]
package name
</package_level_documentation>
<type_level_documentation>
// TypeName represents [domain concept].
//
// [Explain why this type exists - design decision]
// [Explain validation rules if self-validating]
// [Explain thread-safety if relevant]
//
// Example:
// id, err := NewUserID("usr_123")
// if err != nil {
// // handle validation error
// }
type TypeName struct {
// ...
}
</type_level_documentation>
<testable_examples>
// Example_TypeName_Usage demonstrates typical usage of TypeName.
func Example_TypeName_Usage() {
id, _ := NewUserID("usr_123")
fmt.Println(id)
// Output: usr_123
}
// Example_TypeName_Validation shows validation behavior.
func Example_TypeName_Validation() {
_, err := NewUserID("")
fmt.Println(err != nil)
// Output: true
}
</testable_examples>
</code_comment_guidelines>
<output_format> After generating documentation:
FEATURE DOCUMENTATION COMPLETE
Feature: [Feature Name]
Generated Artifacts:
- docs/[feature-name].md (created)
- Package godoc updated in [package]/[file].go
- Type documentation for:
- TypeName1 ([file]:line)
- TypeName2 ([file]:line)
- Testable examples:
- Example_TypeName1_Usage
- Example_TypeName2_Validation
Documentation covers:
- Problem & Solution overview
- Architecture with design decisions
- Core types: [list]
- Data flow diagram
- Integration points: [list]
- Usage examples (basic + advanced)
- Testing strategy
- Future considerations
Next Steps:
1. Review docs/[feature-name].md for accuracy
2. Run `go test` to verify testable examples execute correctly
3. Consider: Does this help future you/AI understand the feature?
Would you like to:
1. Commit documentation as-is
2. Refine specific sections
3. Add more examples
4. Add testable examples to code
</output_format>
<key_principles> Documentation is NOT:
Documentation IS:
AI-Friendly Documentation: When AI tools read this documentation for bug fixes or extensions:
See reference.md for complete documentation checklist and examples. </key_principles>
<success_criteria> Documentation is complete when ALL of the following are true:
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.