@fro.bot/systematic 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +158 -0
- package/agents/research/framework-docs-researcher.md +19 -0
- package/agents/review/architecture-strategist.md +23 -0
- package/agents/review/code-simplicity-reviewer.md +30 -0
- package/agents/review/pattern-recognition-specialist.md +24 -0
- package/agents/review/performance-oracle.md +25 -0
- package/agents/review/security-sentinel.md +25 -0
- package/commands/agent-native-audit.md +277 -0
- package/commands/create-agent-skill.md +8 -0
- package/commands/deepen-plan.md +546 -0
- package/commands/lfg.md +19 -0
- package/commands/workflows/brainstorm.md +115 -0
- package/commands/workflows/compound.md +202 -0
- package/commands/workflows/plan.md +551 -0
- package/commands/workflows/review.md +514 -0
- package/commands/workflows/work.md +363 -0
- package/dist/cli.js +360 -0
- package/dist/index-v8dhd5s2.js +194 -0
- package/dist/index.js +297 -0
- package/package.json +69 -0
- package/skills/agent-browser/SKILL.md +223 -0
- package/skills/agent-native-architecture/SKILL.md +435 -0
- package/skills/agent-native-architecture/references/action-parity-discipline.md +409 -0
- package/skills/agent-native-architecture/references/agent-execution-patterns.md +467 -0
- package/skills/agent-native-architecture/references/agent-native-testing.md +582 -0
- package/skills/agent-native-architecture/references/architecture-patterns.md +478 -0
- package/skills/agent-native-architecture/references/dynamic-context-injection.md +338 -0
- package/skills/agent-native-architecture/references/files-universal-interface.md +301 -0
- package/skills/agent-native-architecture/references/from-primitives-to-domain-tools.md +359 -0
- package/skills/agent-native-architecture/references/mcp-tool-design.md +506 -0
- package/skills/agent-native-architecture/references/mobile-patterns.md +871 -0
- package/skills/agent-native-architecture/references/product-implications.md +443 -0
- package/skills/agent-native-architecture/references/refactoring-to-prompt-native.md +317 -0
- package/skills/agent-native-architecture/references/self-modification.md +269 -0
- package/skills/agent-native-architecture/references/shared-workspace-architecture.md +680 -0
- package/skills/agent-native-architecture/references/system-prompt-design.md +250 -0
- package/skills/brainstorming/SKILL.md +190 -0
- package/skills/compound-docs/SKILL.md +510 -0
- package/skills/compound-docs/assets/critical-pattern-template.md +34 -0
- package/skills/compound-docs/assets/resolution-template.md +93 -0
- package/skills/compound-docs/references/yaml-schema.md +65 -0
- package/skills/compound-docs/schema.yaml +176 -0
- package/skills/create-agent-skills/SKILL.md +299 -0
- package/skills/create-agent-skills/references/api-security.md +226 -0
- package/skills/create-agent-skills/references/be-clear-and-direct.md +531 -0
- package/skills/create-agent-skills/references/best-practices.md +404 -0
- package/skills/create-agent-skills/references/common-patterns.md +595 -0
- package/skills/create-agent-skills/references/core-principles.md +437 -0
- package/skills/create-agent-skills/references/executable-code.md +175 -0
- package/skills/create-agent-skills/references/iteration-and-testing.md +474 -0
- package/skills/create-agent-skills/references/official-spec.md +185 -0
- package/skills/create-agent-skills/references/recommended-structure.md +168 -0
- package/skills/create-agent-skills/references/skill-structure.md +372 -0
- package/skills/create-agent-skills/references/using-scripts.md +113 -0
- package/skills/create-agent-skills/references/using-templates.md +112 -0
- package/skills/create-agent-skills/references/workflows-and-validation.md +510 -0
- package/skills/create-agent-skills/templates/router-skill.md +73 -0
- package/skills/create-agent-skills/templates/simple-skill.md +33 -0
- package/skills/create-agent-skills/workflows/add-reference.md +96 -0
- package/skills/create-agent-skills/workflows/add-script.md +93 -0
- package/skills/create-agent-skills/workflows/add-template.md +74 -0
- package/skills/create-agent-skills/workflows/add-workflow.md +120 -0
- package/skills/create-agent-skills/workflows/audit-skill.md +138 -0
- package/skills/create-agent-skills/workflows/create-domain-expertise-skill.md +605 -0
- package/skills/create-agent-skills/workflows/create-new-skill.md +191 -0
- package/skills/create-agent-skills/workflows/get-guidance.md +121 -0
- package/skills/create-agent-skills/workflows/upgrade-to-router.md +161 -0
- package/skills/create-agent-skills/workflows/verify-skill.md +204 -0
- package/skills/file-todos/SKILL.md +251 -0
- package/skills/file-todos/assets/todo-template.md +155 -0
- package/skills/git-worktree/SKILL.md +302 -0
- package/skills/git-worktree/scripts/worktree-manager.sh +345 -0
- package/skills/using-systematic/SKILL.md +94 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: file-todos
|
|
3
|
+
description: This skill should be used when managing the file-based todo tracking system in the todos/ directory. It provides workflows for creating todos, managing status and dependencies, conducting triage, and integrating with slash commands and code review processes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# File-Based Todo Tracking Skill
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
The `todos/` directory contains a file-based tracking system for managing code review feedback, technical debt, feature requests, and work items. Each todo is a markdown file with YAML frontmatter and structured sections.
|
|
11
|
+
|
|
12
|
+
This skill should be used when:
|
|
13
|
+
- Creating new todos from findings or feedback
|
|
14
|
+
- Managing todo lifecycle (pending → ready → complete)
|
|
15
|
+
- Triaging pending items for approval
|
|
16
|
+
- Checking or managing dependencies
|
|
17
|
+
- Converting PR comments or code findings into tracked work
|
|
18
|
+
- Updating work logs during todo execution
|
|
19
|
+
|
|
20
|
+
## File Naming Convention
|
|
21
|
+
|
|
22
|
+
Todo files follow this naming pattern:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
{issue_id}-{status}-{priority}-{description}.md
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Components:**
|
|
29
|
+
- **issue_id**: Sequential number (001, 002, 003...) - never reused
|
|
30
|
+
- **status**: `pending` (needs triage), `ready` (approved), `complete` (done)
|
|
31
|
+
- **priority**: `p1` (critical), `p2` (important), `p3` (nice-to-have)
|
|
32
|
+
- **description**: kebab-case, brief description
|
|
33
|
+
|
|
34
|
+
**Examples:**
|
|
35
|
+
```
|
|
36
|
+
001-pending-p1-mailer-test.md
|
|
37
|
+
002-ready-p1-fix-n-plus-1.md
|
|
38
|
+
005-complete-p2-refactor-csv.md
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## File Structure
|
|
42
|
+
|
|
43
|
+
Each todo is a markdown file with YAML frontmatter and structured sections. Use the template at [todo-template.md](./assets/todo-template.md) as a starting point when creating new todos.
|
|
44
|
+
|
|
45
|
+
**Required sections:**
|
|
46
|
+
- **Problem Statement** - What is broken, missing, or needs improvement?
|
|
47
|
+
- **Findings** - Investigation results, root cause, key discoveries
|
|
48
|
+
- **Proposed Solutions** - Multiple options with pros/cons, effort, risk
|
|
49
|
+
- **Recommended Action** - Clear plan (filled during triage)
|
|
50
|
+
- **Acceptance Criteria** - Testable checklist items
|
|
51
|
+
- **Work Log** - Chronological record with date, actions, learnings
|
|
52
|
+
|
|
53
|
+
**Optional sections:**
|
|
54
|
+
- **Technical Details** - Affected files, related components, DB changes
|
|
55
|
+
- **Resources** - Links to errors, tests, PRs, documentation
|
|
56
|
+
- **Notes** - Additional context or decisions
|
|
57
|
+
|
|
58
|
+
**YAML frontmatter fields:**
|
|
59
|
+
```yaml
|
|
60
|
+
---
|
|
61
|
+
status: ready # pending | ready | complete
|
|
62
|
+
priority: p1 # p1 | p2 | p3
|
|
63
|
+
issue_id: "002"
|
|
64
|
+
tags: [rails, performance, database]
|
|
65
|
+
dependencies: ["001"] # Issue IDs this is blocked by
|
|
66
|
+
---
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Common Workflows
|
|
70
|
+
|
|
71
|
+
### Creating a New Todo
|
|
72
|
+
|
|
73
|
+
**To create a new todo from findings or feedback:**
|
|
74
|
+
|
|
75
|
+
1. Determine next issue ID: `ls todos/ | grep -o '^[0-9]\+' | sort -n | tail -1`
|
|
76
|
+
2. Copy template: `cp assets/todo-template.md todos/{NEXT_ID}-pending-{priority}-{description}.md`
|
|
77
|
+
3. Edit and fill required sections:
|
|
78
|
+
- Problem Statement
|
|
79
|
+
- Findings (if from investigation)
|
|
80
|
+
- Proposed Solutions (multiple options)
|
|
81
|
+
- Acceptance Criteria
|
|
82
|
+
- Add initial Work Log entry
|
|
83
|
+
4. Determine status: `pending` (needs triage) or `ready` (pre-approved)
|
|
84
|
+
5. Add relevant tags for filtering
|
|
85
|
+
|
|
86
|
+
**When to create a todo:**
|
|
87
|
+
- Requires more than 15-20 minutes of work
|
|
88
|
+
- Needs research, planning, or multiple approaches considered
|
|
89
|
+
- Has dependencies on other work
|
|
90
|
+
- Requires manager approval or prioritization
|
|
91
|
+
- Part of larger feature or refactor
|
|
92
|
+
- Technical debt needing documentation
|
|
93
|
+
|
|
94
|
+
**When to act immediately instead:**
|
|
95
|
+
- Issue is trivial (< 15 minutes)
|
|
96
|
+
- Complete context available now
|
|
97
|
+
- No planning needed
|
|
98
|
+
- User explicitly requests immediate action
|
|
99
|
+
- Simple bug fix with obvious solution
|
|
100
|
+
|
|
101
|
+
### Triaging Pending Items
|
|
102
|
+
|
|
103
|
+
**To triage pending todos:**
|
|
104
|
+
|
|
105
|
+
1. List pending items: `ls todos/*-pending-*.md`
|
|
106
|
+
2. For each todo:
|
|
107
|
+
- Read Problem Statement and Findings
|
|
108
|
+
- Review Proposed Solutions
|
|
109
|
+
- Make decision: approve, defer, or modify priority
|
|
110
|
+
3. Update approved todos:
|
|
111
|
+
- Rename file: `mv {file}-pending-{pri}-{desc}.md {file}-ready-{pri}-{desc}.md`
|
|
112
|
+
- Update frontmatter: `status: pending` → `status: ready`
|
|
113
|
+
- Fill "Recommended Action" section with clear plan
|
|
114
|
+
- Adjust priority if different from initial assessment
|
|
115
|
+
4. Deferred todos stay in `pending` status
|
|
116
|
+
|
|
117
|
+
**Use slash command:** `/triage` for interactive approval workflow
|
|
118
|
+
|
|
119
|
+
### Managing Dependencies
|
|
120
|
+
|
|
121
|
+
**To track dependencies:**
|
|
122
|
+
|
|
123
|
+
```yaml
|
|
124
|
+
dependencies: ["002", "005"] # This todo blocked by issues 002 and 005
|
|
125
|
+
dependencies: [] # No blockers - can work immediately
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**To check what blocks a todo:**
|
|
129
|
+
```bash
|
|
130
|
+
grep "^dependencies:" todos/003-*.md
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**To find what a todo blocks:**
|
|
134
|
+
```bash
|
|
135
|
+
grep -l 'dependencies:.*"002"' todos/*.md
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**To verify blockers are complete before starting:**
|
|
139
|
+
```bash
|
|
140
|
+
for dep in 001 002 003; do
|
|
141
|
+
[ -f "todos/${dep}-complete-*.md" ] || echo "Issue $dep not complete"
|
|
142
|
+
done
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Updating Work Logs
|
|
146
|
+
|
|
147
|
+
**When working on a todo, always add a work log entry:**
|
|
148
|
+
|
|
149
|
+
```markdown
|
|
150
|
+
### YYYY-MM-DD - Session Title
|
|
151
|
+
|
|
152
|
+
**By:** Claude Code / Developer Name
|
|
153
|
+
|
|
154
|
+
**Actions:**
|
|
155
|
+
- Specific changes made (include file:line references)
|
|
156
|
+
- Commands executed
|
|
157
|
+
- Tests run
|
|
158
|
+
- Results of investigation
|
|
159
|
+
|
|
160
|
+
**Learnings:**
|
|
161
|
+
- What worked / what didn't
|
|
162
|
+
- Patterns discovered
|
|
163
|
+
- Key insights for future work
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Work logs serve as:
|
|
167
|
+
- Historical record of investigation
|
|
168
|
+
- Documentation of approaches attempted
|
|
169
|
+
- Knowledge sharing for team
|
|
170
|
+
- Context for future similar work
|
|
171
|
+
|
|
172
|
+
### Completing a Todo
|
|
173
|
+
|
|
174
|
+
**To mark a todo as complete:**
|
|
175
|
+
|
|
176
|
+
1. Verify all acceptance criteria checked off
|
|
177
|
+
2. Update Work Log with final session and results
|
|
178
|
+
3. Rename file: `mv {file}-ready-{pri}-{desc}.md {file}-complete-{pri}-{desc}.md`
|
|
179
|
+
4. Update frontmatter: `status: ready` → `status: complete`
|
|
180
|
+
5. Check for unblocked work: `grep -l 'dependencies:.*"002"' todos/*-ready-*.md`
|
|
181
|
+
6. Commit with issue reference: `feat: resolve issue 002`
|
|
182
|
+
|
|
183
|
+
## Integration with Development Workflows
|
|
184
|
+
|
|
185
|
+
| Trigger | Flow | Tool |
|
|
186
|
+
|---------|------|------|
|
|
187
|
+
| Code review | `/workflows:review` → Findings → `/triage` → Todos | Review agent + skill |
|
|
188
|
+
| PR comments | `/resolve_pr_parallel` → Individual fixes → Todos | gh CLI + skill |
|
|
189
|
+
| Code TODOs | `/resolve_todo_parallel` → Fixes + Complex todos | Agent + skill |
|
|
190
|
+
| Planning | Brainstorm → Create todo → Work → Complete | Skill |
|
|
191
|
+
| Feedback | Discussion → Create todo → Triage → Work | Skill + slash |
|
|
192
|
+
|
|
193
|
+
## Quick Reference Commands
|
|
194
|
+
|
|
195
|
+
**Finding work:**
|
|
196
|
+
```bash
|
|
197
|
+
# List highest priority unblocked work
|
|
198
|
+
grep -l 'dependencies: \[\]' todos/*-ready-p1-*.md
|
|
199
|
+
|
|
200
|
+
# List all pending items needing triage
|
|
201
|
+
ls todos/*-pending-*.md
|
|
202
|
+
|
|
203
|
+
# Find next issue ID
|
|
204
|
+
ls todos/ | grep -o '^[0-9]\+' | sort -n | tail -1 | awk '{printf "%03d", $1+1}'
|
|
205
|
+
|
|
206
|
+
# Count by status
|
|
207
|
+
for status in pending ready complete; do
|
|
208
|
+
echo "$status: $(ls -1 todos/*-$status-*.md 2>/dev/null | wc -l)"
|
|
209
|
+
done
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Dependency management:**
|
|
213
|
+
```bash
|
|
214
|
+
# What blocks this todo?
|
|
215
|
+
grep "^dependencies:" todos/003-*.md
|
|
216
|
+
|
|
217
|
+
# What does this todo block?
|
|
218
|
+
grep -l 'dependencies:.*"002"' todos/*.md
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Searching:**
|
|
222
|
+
```bash
|
|
223
|
+
# Search by tag
|
|
224
|
+
grep -l "tags:.*rails" todos/*.md
|
|
225
|
+
|
|
226
|
+
# Search by priority
|
|
227
|
+
ls todos/*-p1-*.md
|
|
228
|
+
|
|
229
|
+
# Full-text search
|
|
230
|
+
grep -r "payment" todos/
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Key Distinctions
|
|
234
|
+
|
|
235
|
+
**File-todos system (this skill):**
|
|
236
|
+
- Markdown files in `todos/` directory
|
|
237
|
+
- Development/project tracking
|
|
238
|
+
- Standalone markdown files with YAML frontmatter
|
|
239
|
+
- Used by humans and agents
|
|
240
|
+
|
|
241
|
+
**Rails Todo model:**
|
|
242
|
+
- Database model in `app/models/todo.rb`
|
|
243
|
+
- User-facing feature in the application
|
|
244
|
+
- Active Record CRUD operations
|
|
245
|
+
- Different from this file-based system
|
|
246
|
+
|
|
247
|
+
**TodoWrite tool:**
|
|
248
|
+
- In-memory task tracking during agent sessions
|
|
249
|
+
- Temporary tracking for single conversation
|
|
250
|
+
- Not persisted to disk
|
|
251
|
+
- Different from both systems above
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
---
|
|
2
|
+
status: pending
|
|
3
|
+
priority: p2
|
|
4
|
+
issue_id: "XXX"
|
|
5
|
+
tags: []
|
|
6
|
+
dependencies: []
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Brief Task Title
|
|
10
|
+
|
|
11
|
+
Replace with a concise title describing what needs to be done.
|
|
12
|
+
|
|
13
|
+
## Problem Statement
|
|
14
|
+
|
|
15
|
+
What is broken, missing, or needs improvement? Provide clear context about why this matters.
|
|
16
|
+
|
|
17
|
+
**Example:**
|
|
18
|
+
- Template system lacks comprehensive test coverage for edge cases discovered during PR review
|
|
19
|
+
- Email service is missing proper error handling for rate-limit scenarios
|
|
20
|
+
- Documentation doesn't cover the new authentication flow
|
|
21
|
+
|
|
22
|
+
## Findings
|
|
23
|
+
|
|
24
|
+
Investigation results, root cause analysis, and key discoveries.
|
|
25
|
+
|
|
26
|
+
- Finding 1 (with specifics: file, line number if applicable)
|
|
27
|
+
- Finding 2
|
|
28
|
+
- Key discovery with impact assessment
|
|
29
|
+
- Related issues or patterns discovered
|
|
30
|
+
|
|
31
|
+
**Example format:**
|
|
32
|
+
- Identified 12 missing test scenarios in `app/models/user_test.rb`
|
|
33
|
+
- Current coverage: 60% of code paths
|
|
34
|
+
- Missing: empty inputs, special characters, large payloads
|
|
35
|
+
- Similar issues exist in `app/models/post_test.rb` (~8 scenarios)
|
|
36
|
+
|
|
37
|
+
## Proposed Solutions
|
|
38
|
+
|
|
39
|
+
Present multiple options with pros, cons, effort estimates, and risk assessment.
|
|
40
|
+
|
|
41
|
+
### Option 1: [Solution Name]
|
|
42
|
+
|
|
43
|
+
**Approach:** Describe the solution clearly.
|
|
44
|
+
|
|
45
|
+
**Pros:**
|
|
46
|
+
- Benefit 1
|
|
47
|
+
- Benefit 2
|
|
48
|
+
|
|
49
|
+
**Cons:**
|
|
50
|
+
- Drawback 1
|
|
51
|
+
- Drawback 2
|
|
52
|
+
|
|
53
|
+
**Effort:** 2-3 hours
|
|
54
|
+
|
|
55
|
+
**Risk:** Low / Medium / High
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
### Option 2: [Solution Name]
|
|
60
|
+
|
|
61
|
+
**Approach:** Describe the solution clearly.
|
|
62
|
+
|
|
63
|
+
**Pros:**
|
|
64
|
+
- Benefit 1
|
|
65
|
+
- Benefit 2
|
|
66
|
+
|
|
67
|
+
**Cons:**
|
|
68
|
+
- Drawback 1
|
|
69
|
+
- Drawback 2
|
|
70
|
+
|
|
71
|
+
**Effort:** 4-6 hours
|
|
72
|
+
|
|
73
|
+
**Risk:** Low / Medium / High
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
### Option 3: [Solution Name]
|
|
78
|
+
|
|
79
|
+
(Include if you have alternatives)
|
|
80
|
+
|
|
81
|
+
## Recommended Action
|
|
82
|
+
|
|
83
|
+
**To be filled during triage.** Clear, actionable plan for resolving this todo.
|
|
84
|
+
|
|
85
|
+
**Example:**
|
|
86
|
+
"Implement both unit tests (covering each scenario) and integration tests (full pipeline) before merging. Estimated 4 hours total effort. Target coverage > 85% for this module."
|
|
87
|
+
|
|
88
|
+
## Technical Details
|
|
89
|
+
|
|
90
|
+
Affected files, related components, database changes, or architectural considerations.
|
|
91
|
+
|
|
92
|
+
**Affected files:**
|
|
93
|
+
- `app/models/user.rb:45` - full_name method
|
|
94
|
+
- `app/services/user_service.rb:12` - validation logic
|
|
95
|
+
- `test/models/user_test.rb` - existing tests
|
|
96
|
+
|
|
97
|
+
**Related components:**
|
|
98
|
+
- UserMailer (depends on user validation)
|
|
99
|
+
- AccountPolicy (authorization checks)
|
|
100
|
+
|
|
101
|
+
**Database changes (if any):**
|
|
102
|
+
- Migration needed? Yes / No
|
|
103
|
+
- New columns/tables? Describe here
|
|
104
|
+
|
|
105
|
+
## Resources
|
|
106
|
+
|
|
107
|
+
Links to errors, tests, PRs, documentation, similar issues.
|
|
108
|
+
|
|
109
|
+
- **PR:** #1287
|
|
110
|
+
- **Related issue:** #456
|
|
111
|
+
- **Error log:** [link to AppSignal incident]
|
|
112
|
+
- **Documentation:** [relevant docs]
|
|
113
|
+
- **Similar patterns:** Issue #200 (completed, ref for approach)
|
|
114
|
+
|
|
115
|
+
## Acceptance Criteria
|
|
116
|
+
|
|
117
|
+
Testable checklist items for verifying completion.
|
|
118
|
+
|
|
119
|
+
- [ ] All acceptance criteria checked
|
|
120
|
+
- [ ] Tests pass (unit + integration if applicable)
|
|
121
|
+
- [ ] Code reviewed and approved
|
|
122
|
+
- [ ] (Example) Test coverage > 85%
|
|
123
|
+
- [ ] (Example) Performance metrics acceptable
|
|
124
|
+
- [ ] (Example) Documentation updated
|
|
125
|
+
|
|
126
|
+
## Work Log
|
|
127
|
+
|
|
128
|
+
Chronological record of work sessions, actions taken, and learnings.
|
|
129
|
+
|
|
130
|
+
### 2025-11-12 - Initial Discovery
|
|
131
|
+
|
|
132
|
+
**By:** Claude Code
|
|
133
|
+
|
|
134
|
+
**Actions:**
|
|
135
|
+
- Identified 12 missing test scenarios
|
|
136
|
+
- Analyzed existing test coverage (file:line references)
|
|
137
|
+
- Reviewed similar patterns in codebase
|
|
138
|
+
- Drafted 3 solution approaches
|
|
139
|
+
|
|
140
|
+
**Learnings:**
|
|
141
|
+
- Similar issues exist in related modules
|
|
142
|
+
- Current test setup supports both unit and integration tests
|
|
143
|
+
- Performance testing would be valuable addition
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
(Add more entries as work progresses)
|
|
148
|
+
|
|
149
|
+
## Notes
|
|
150
|
+
|
|
151
|
+
Additional context, decisions, or reminders.
|
|
152
|
+
|
|
153
|
+
- Decision: Include both unit and integration tests for comprehensive coverage
|
|
154
|
+
- Blocker: Depends on completion of issue #001
|
|
155
|
+
- Timeline: Priority for sprint due to blocking other work
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-worktree
|
|
3
|
+
description: This skill manages Git worktrees for isolated parallel development. It handles creating, listing, switching, and cleaning up worktrees with a simple interactive interface, following KISS principles.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git Worktree Manager
|
|
7
|
+
|
|
8
|
+
This skill provides a unified interface for managing Git worktrees across your development workflow. Whether you're reviewing PRs in isolation or working on features in parallel, this skill handles all the complexity.
|
|
9
|
+
|
|
10
|
+
## What This Skill Does
|
|
11
|
+
|
|
12
|
+
- **Create worktrees** from main branch with clear branch names
|
|
13
|
+
- **List worktrees** with current status
|
|
14
|
+
- **Switch between worktrees** for parallel work
|
|
15
|
+
- **Clean up completed worktrees** automatically
|
|
16
|
+
- **Interactive confirmations** at each step
|
|
17
|
+
- **Automatic .gitignore management** for worktree directory
|
|
18
|
+
- **Automatic .env file copying** from main repo to new worktrees
|
|
19
|
+
|
|
20
|
+
## CRITICAL: Always Use the Manager Script
|
|
21
|
+
|
|
22
|
+
**NEVER call `git worktree add` directly.** Always use the `worktree-manager.sh` script.
|
|
23
|
+
|
|
24
|
+
The script handles critical setup that raw git commands don't:
|
|
25
|
+
1. Copies `.env`, `.env.local`, `.env.test`, etc. from main repo
|
|
26
|
+
2. Ensures `.worktrees` is in `.gitignore`
|
|
27
|
+
3. Creates consistent directory structure
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# ✅ CORRECT - Always use the script
|
|
31
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh create feature-name
|
|
32
|
+
|
|
33
|
+
# ❌ WRONG - Never do this directly
|
|
34
|
+
git worktree add .worktrees/feature-name -b feature-name main
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## When to Use This Skill
|
|
38
|
+
|
|
39
|
+
Use this skill in these scenarios:
|
|
40
|
+
|
|
41
|
+
1. **Code Review (`/workflows:review`)**: If NOT already on the target branch (PR branch or requested branch), offer worktree for isolated review
|
|
42
|
+
2. **Feature Work (`/workflows:work`)**: Always ask if user wants parallel worktree or live branch work
|
|
43
|
+
3. **Parallel Development**: When working on multiple features simultaneously
|
|
44
|
+
4. **Cleanup**: After completing work in a worktree
|
|
45
|
+
|
|
46
|
+
## How to Use
|
|
47
|
+
|
|
48
|
+
### In Claude Code Workflows
|
|
49
|
+
|
|
50
|
+
The skill is automatically called from `/workflows:review` and `/workflows:work` commands:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
# For review: offers worktree if not on PR branch
|
|
54
|
+
# For work: always asks - new branch or worktree?
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Manual Usage
|
|
58
|
+
|
|
59
|
+
You can also invoke the skill directly from bash:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Create a new worktree (copies .env files automatically)
|
|
63
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh create feature-login
|
|
64
|
+
|
|
65
|
+
# List all worktrees
|
|
66
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh list
|
|
67
|
+
|
|
68
|
+
# Switch to a worktree
|
|
69
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh switch feature-login
|
|
70
|
+
|
|
71
|
+
# Copy .env files to an existing worktree (if they weren't copied)
|
|
72
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh copy-env feature-login
|
|
73
|
+
|
|
74
|
+
# Clean up completed worktrees
|
|
75
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh cleanup
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Commands
|
|
79
|
+
|
|
80
|
+
### `create <branch-name> [from-branch]`
|
|
81
|
+
|
|
82
|
+
Creates a new worktree with the given branch name.
|
|
83
|
+
|
|
84
|
+
**Options:**
|
|
85
|
+
- `branch-name` (required): The name for the new branch and worktree
|
|
86
|
+
- `from-branch` (optional): Base branch to create from (defaults to `main`)
|
|
87
|
+
|
|
88
|
+
**Example:**
|
|
89
|
+
```bash
|
|
90
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh create feature-login
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**What happens:**
|
|
94
|
+
1. Checks if worktree already exists
|
|
95
|
+
2. Updates the base branch from remote
|
|
96
|
+
3. Creates new worktree and branch
|
|
97
|
+
4. **Copies all .env files from main repo** (.env, .env.local, .env.test, etc.)
|
|
98
|
+
5. Shows path for cd-ing to the worktree
|
|
99
|
+
|
|
100
|
+
### `list` or `ls`
|
|
101
|
+
|
|
102
|
+
Lists all available worktrees with their branches and current status.
|
|
103
|
+
|
|
104
|
+
**Example:**
|
|
105
|
+
```bash
|
|
106
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh list
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Output shows:**
|
|
110
|
+
- Worktree name
|
|
111
|
+
- Branch name
|
|
112
|
+
- Which is current (marked with ✓)
|
|
113
|
+
- Main repo status
|
|
114
|
+
|
|
115
|
+
### `switch <name>` or `go <name>`
|
|
116
|
+
|
|
117
|
+
Switches to an existing worktree and cd's into it.
|
|
118
|
+
|
|
119
|
+
**Example:**
|
|
120
|
+
```bash
|
|
121
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh switch feature-login
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Optional:**
|
|
125
|
+
- If name not provided, lists available worktrees and prompts for selection
|
|
126
|
+
|
|
127
|
+
### `cleanup` or `clean`
|
|
128
|
+
|
|
129
|
+
Interactively cleans up inactive worktrees with confirmation.
|
|
130
|
+
|
|
131
|
+
**Example:**
|
|
132
|
+
```bash
|
|
133
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh cleanup
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**What happens:**
|
|
137
|
+
1. Lists all inactive worktrees
|
|
138
|
+
2. Asks for confirmation
|
|
139
|
+
3. Removes selected worktrees
|
|
140
|
+
4. Cleans up empty directories
|
|
141
|
+
|
|
142
|
+
## Workflow Examples
|
|
143
|
+
|
|
144
|
+
### Code Review with Worktree
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Claude Code recognizes you're not on the PR branch
|
|
148
|
+
# Offers: "Use worktree for isolated review? (y/n)"
|
|
149
|
+
|
|
150
|
+
# You respond: yes
|
|
151
|
+
# Script runs (copies .env files automatically):
|
|
152
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh create pr-123-feature-name
|
|
153
|
+
|
|
154
|
+
# You're now in isolated worktree for review with all env vars
|
|
155
|
+
cd .worktrees/pr-123-feature-name
|
|
156
|
+
|
|
157
|
+
# After review, return to main:
|
|
158
|
+
cd ../..
|
|
159
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh cleanup
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Parallel Feature Development
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# For first feature (copies .env files):
|
|
166
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh create feature-login
|
|
167
|
+
|
|
168
|
+
# Later, start second feature (also copies .env files):
|
|
169
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh create feature-notifications
|
|
170
|
+
|
|
171
|
+
# List what you have:
|
|
172
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh list
|
|
173
|
+
|
|
174
|
+
# Switch between them as needed:
|
|
175
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh switch feature-login
|
|
176
|
+
|
|
177
|
+
# Return to main and cleanup when done:
|
|
178
|
+
cd .
|
|
179
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh cleanup
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Key Design Principles
|
|
183
|
+
|
|
184
|
+
### KISS (Keep It Simple, Stupid)
|
|
185
|
+
|
|
186
|
+
- **One manager script** handles all worktree operations
|
|
187
|
+
- **Simple commands** with sensible defaults
|
|
188
|
+
- **Interactive prompts** prevent accidental operations
|
|
189
|
+
- **Clear naming** using branch names directly
|
|
190
|
+
|
|
191
|
+
### Opinionated Defaults
|
|
192
|
+
|
|
193
|
+
- Worktrees always created from **main** (unless specified)
|
|
194
|
+
- Worktrees stored in **.worktrees/** directory
|
|
195
|
+
- Branch name becomes worktree name
|
|
196
|
+
- **.gitignore** automatically managed
|
|
197
|
+
|
|
198
|
+
### Safety First
|
|
199
|
+
|
|
200
|
+
- **Confirms before creating** worktrees
|
|
201
|
+
- **Confirms before cleanup** to prevent accidental removal
|
|
202
|
+
- **Won't remove current worktree**
|
|
203
|
+
- **Clear error messages** for issues
|
|
204
|
+
|
|
205
|
+
## Integration with Workflows
|
|
206
|
+
|
|
207
|
+
### `/workflows:review`
|
|
208
|
+
|
|
209
|
+
Instead of always creating a worktree:
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
1. Check current branch
|
|
213
|
+
2. If ALREADY on target branch (PR branch or requested branch) → stay there, no worktree needed
|
|
214
|
+
3. If DIFFERENT branch than the review target → offer worktree:
|
|
215
|
+
"Use worktree for isolated review? (y/n)"
|
|
216
|
+
- yes → call git-worktree skill
|
|
217
|
+
- no → proceed with PR diff on current branch
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### `/workflows:work`
|
|
221
|
+
|
|
222
|
+
Always offer choice:
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
1. Ask: "How do you want to work?
|
|
226
|
+
1. New branch on current worktree (live work)
|
|
227
|
+
2. Worktree (parallel work)"
|
|
228
|
+
|
|
229
|
+
2. If choice 1 → create new branch normally
|
|
230
|
+
3. If choice 2 → call git-worktree skill to create from main
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Troubleshooting
|
|
234
|
+
|
|
235
|
+
### "Worktree already exists"
|
|
236
|
+
|
|
237
|
+
If you see this, the script will ask if you want to switch to it instead.
|
|
238
|
+
|
|
239
|
+
### "Cannot remove worktree: it is the current worktree"
|
|
240
|
+
|
|
241
|
+
Switch out of the worktree first (to main repo), then cleanup:
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
cd $(git rev-parse --show-toplevel)
|
|
245
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh cleanup
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Lost in a worktree?
|
|
249
|
+
|
|
250
|
+
See where you are:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh list
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### .env files missing in worktree?
|
|
257
|
+
|
|
258
|
+
If a worktree was created without .env files (e.g., via raw `git worktree add`), copy them:
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh copy-env feature-name
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Navigate back to main:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
cd $(git rev-parse --show-toplevel)
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Technical Details
|
|
271
|
+
|
|
272
|
+
### Directory Structure
|
|
273
|
+
|
|
274
|
+
```
|
|
275
|
+
.worktrees/
|
|
276
|
+
├── feature-login/ # Worktree 1
|
|
277
|
+
│ ├── .git
|
|
278
|
+
│ ├── app/
|
|
279
|
+
│ └── ...
|
|
280
|
+
├── feature-notifications/ # Worktree 2
|
|
281
|
+
│ ├── .git
|
|
282
|
+
│ ├── app/
|
|
283
|
+
│ └── ...
|
|
284
|
+
└── ...
|
|
285
|
+
|
|
286
|
+
.gitignore (updated to include .worktrees)
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### How It Works
|
|
290
|
+
|
|
291
|
+
- Uses `git worktree add` for isolated environments
|
|
292
|
+
- Each worktree has its own branch
|
|
293
|
+
- Changes in one worktree don't affect others
|
|
294
|
+
- Share git history with main repo
|
|
295
|
+
- Can push from any worktree
|
|
296
|
+
|
|
297
|
+
### Performance
|
|
298
|
+
|
|
299
|
+
- Worktrees are lightweight (just file system links)
|
|
300
|
+
- No repository duplication
|
|
301
|
+
- Shared git objects for efficiency
|
|
302
|
+
- Much faster than cloning or stashing/switching
|