Add template support for issue creation (bd-164b)
- Built-in templates: epic, bug, feature (embedded in binary) - Custom templates in .beads/templates/ (override built-ins) - Commands: bd template list/show/create - Flag: bd create --from-template <name> "Title" - Template fields: description, type, priority, labels, design, acceptance - Security: sanitize template names to prevent path traversal - Flag precedence: explicit flags override template defaults - Tests: template loading, security, flag precedence - Docs: commands/template.md and README.md updated Closes bd-164b Amp-Thread-ID: https://ampcode.com/threads/T-118fe54f-b112-4f99-a3d9-b7df53fb7284 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
56
cmd/bd/templates/bug.yaml
Normal file
56
cmd/bd/templates/bug.yaml
Normal file
@@ -0,0 +1,56 @@
|
||||
# Built-in template for bug reports
|
||||
name: bug
|
||||
description: |
|
||||
## Summary
|
||||
|
||||
[Brief description of the bug]
|
||||
|
||||
## Steps to Reproduce
|
||||
|
||||
1. Step 1
|
||||
2. Step 2
|
||||
3. Step 3
|
||||
|
||||
## Expected Behavior
|
||||
|
||||
[What should happen]
|
||||
|
||||
## Actual Behavior
|
||||
|
||||
[What actually happens]
|
||||
|
||||
## Environment
|
||||
|
||||
- OS: [e.g., macOS 15.7.1]
|
||||
- Version: [e.g., bd 0.20.1]
|
||||
- Additional context: [any relevant details]
|
||||
|
||||
## Additional Context
|
||||
|
||||
[Screenshots, logs, or other relevant information]
|
||||
|
||||
type: bug
|
||||
priority: 1
|
||||
labels:
|
||||
- bug
|
||||
|
||||
design: |
|
||||
## Root Cause Analysis
|
||||
|
||||
[Describe the underlying cause once identified]
|
||||
|
||||
## Proposed Fix
|
||||
|
||||
[Outline the solution approach]
|
||||
|
||||
## Impact Assessment
|
||||
|
||||
- Affected features: [list]
|
||||
- Breaking changes: [yes/no and details]
|
||||
- Migration needed: [yes/no and details]
|
||||
|
||||
acceptance_criteria: |
|
||||
- [ ] Bug no longer reproduces with original steps
|
||||
- [ ] Regression tests added
|
||||
- [ ] Related edge cases tested
|
||||
- [ ] Documentation updated if behavior changed
|
||||
51
cmd/bd/templates/epic.yaml
Normal file
51
cmd/bd/templates/epic.yaml
Normal file
@@ -0,0 +1,51 @@
|
||||
# Built-in template for creating epics
|
||||
name: epic
|
||||
description: |
|
||||
## Overview
|
||||
|
||||
[Describe the high-level goal and scope of this epic]
|
||||
|
||||
## Success Criteria
|
||||
|
||||
- [ ] Criteria 1
|
||||
- [ ] Criteria 2
|
||||
- [ ] Criteria 3
|
||||
|
||||
## Background
|
||||
|
||||
[Provide context and motivation]
|
||||
|
||||
## Scope
|
||||
|
||||
**In Scope:**
|
||||
- Item 1
|
||||
- Item 2
|
||||
|
||||
**Out of Scope:**
|
||||
- Item 1
|
||||
- Item 2
|
||||
|
||||
type: epic
|
||||
priority: 1
|
||||
labels:
|
||||
- epic
|
||||
|
||||
design: |
|
||||
## Architecture
|
||||
|
||||
[Describe the overall architecture and approach]
|
||||
|
||||
## Components
|
||||
|
||||
- Component 1: [description]
|
||||
- Component 2: [description]
|
||||
|
||||
## Dependencies
|
||||
|
||||
[List external dependencies or constraints]
|
||||
|
||||
acceptance_criteria: |
|
||||
- [ ] All child issues are completed
|
||||
- [ ] Integration tests pass
|
||||
- [ ] Documentation is updated
|
||||
- [ ] Code review completed
|
||||
60
cmd/bd/templates/feature.yaml
Normal file
60
cmd/bd/templates/feature.yaml
Normal file
@@ -0,0 +1,60 @@
|
||||
# Built-in template for feature requests
|
||||
name: feature
|
||||
description: |
|
||||
## Feature Request
|
||||
|
||||
[Describe the desired feature]
|
||||
|
||||
## Motivation
|
||||
|
||||
[Why is this feature needed? What problem does it solve?]
|
||||
|
||||
## Use Cases
|
||||
|
||||
1. **Use Case 1**: [description]
|
||||
2. **Use Case 2**: [description]
|
||||
|
||||
## Proposed Solution
|
||||
|
||||
[High-level approach to implementing this feature]
|
||||
|
||||
## Alternatives Considered
|
||||
|
||||
- **Alternative 1**: [description and why not chosen]
|
||||
- **Alternative 2**: [description and why not chosen]
|
||||
|
||||
type: feature
|
||||
priority: 2
|
||||
labels:
|
||||
- feature
|
||||
|
||||
design: |
|
||||
## Technical Design
|
||||
|
||||
[Detailed technical approach]
|
||||
|
||||
## API Changes
|
||||
|
||||
[New commands, flags, or APIs]
|
||||
|
||||
## Data Model Changes
|
||||
|
||||
[Database schema changes if any]
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
- Note 1
|
||||
- Note 2
|
||||
|
||||
## Testing Strategy
|
||||
|
||||
- Unit tests: [scope]
|
||||
- Integration tests: [scope]
|
||||
- Manual testing: [steps]
|
||||
|
||||
acceptance_criteria: |
|
||||
- [ ] Feature implements all described use cases
|
||||
- [ ] All tests pass
|
||||
- [ ] Documentation updated (README, commands)
|
||||
- [ ] Examples added if applicable
|
||||
- [ ] No performance regressions
|
||||
Reference in New Issue
Block a user