compound-workflow 0.1.1
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/.claude-plugin/marketplace.json +11 -0
- package/.claude-plugin/plugin.json +12 -0
- package/.cursor-plugin/plugin.json +12 -0
- package/README.md +155 -0
- package/package.json +22 -0
- package/scripts/install-cli.mjs +313 -0
- package/scripts/sync-into-repo.sh +103 -0
- package/src/.agents/agents/research/best-practices-researcher.md +132 -0
- package/src/.agents/agents/research/framework-docs-researcher.md +134 -0
- package/src/.agents/agents/research/git-history-analyzer.md +62 -0
- package/src/.agents/agents/research/learnings-researcher.md +288 -0
- package/src/.agents/agents/research/repo-research-analyst.md +146 -0
- package/src/.agents/agents/review/agent-native-reviewer.md +299 -0
- package/src/.agents/agents/workflow/bug-reproduction-validator.md +87 -0
- package/src/.agents/agents/workflow/lint.md +20 -0
- package/src/.agents/agents/workflow/spec-flow-analyzer.md +149 -0
- package/src/.agents/commands/assess.md +60 -0
- package/src/.agents/commands/install.md +53 -0
- package/src/.agents/commands/metrics.md +59 -0
- package/src/.agents/commands/setup.md +9 -0
- package/src/.agents/commands/sync.md +9 -0
- package/src/.agents/commands/test-browser.md +393 -0
- package/src/.agents/commands/workflow/brainstorm.md +252 -0
- package/src/.agents/commands/workflow/compound.md +142 -0
- package/src/.agents/commands/workflow/plan.md +737 -0
- package/src/.agents/commands/workflow/review-v2.md +148 -0
- package/src/.agents/commands/workflow/review.md +110 -0
- package/src/.agents/commands/workflow/triage.md +54 -0
- package/src/.agents/commands/workflow/work.md +439 -0
- package/src/.agents/references/README.md +12 -0
- package/src/.agents/references/standards/README.md +9 -0
- package/src/.agents/scripts/self-check.mjs +227 -0
- package/src/.agents/scripts/sync-opencode.mjs +355 -0
- package/src/.agents/skills/agent-browser/SKILL.md +223 -0
- package/src/.agents/skills/audit-traceability/SKILL.md +260 -0
- package/src/.agents/skills/brainstorming/SKILL.md +250 -0
- package/src/.agents/skills/compound-docs/SKILL.md +533 -0
- package/src/.agents/skills/compound-docs/assets/critical-pattern-template.md +34 -0
- package/src/.agents/skills/compound-docs/assets/resolution-template.md +97 -0
- package/src/.agents/skills/compound-docs/references/yaml-schema.md +87 -0
- package/src/.agents/skills/compound-docs/schema.project.yaml +18 -0
- package/src/.agents/skills/compound-docs/schema.yaml +119 -0
- package/src/.agents/skills/data-foundations/SKILL.md +185 -0
- package/src/.agents/skills/document-review/SKILL.md +108 -0
- package/src/.agents/skills/file-todos/SKILL.md +177 -0
- package/src/.agents/skills/file-todos/assets/todo-template.md +106 -0
- package/src/.agents/skills/financial-workflow-integrity/SKILL.md +423 -0
- package/src/.agents/skills/git-worktree/SKILL.md +268 -0
- package/src/.agents/skills/pii-protection-prisma/SKILL.md +629 -0
- package/src/.agents/skills/process-metrics/SKILL.md +46 -0
- package/src/.agents/skills/process-metrics/assets/daily-template.md +37 -0
- package/src/.agents/skills/process-metrics/assets/monthly-template.md +21 -0
- package/src/.agents/skills/process-metrics/assets/weekly-template.md +25 -0
- package/src/.agents/skills/technical-review/SKILL.md +83 -0
- package/src/AGENTS.md +213 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-worktree
|
|
3
|
+
description: Manage Git worktrees for isolated parallel development using portable git commands.
|
|
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 a base 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
|
+
- **Bootstrap new worktrees** (optional): copy env/config files + install deps (non-overwriting, portable defaults)
|
|
19
|
+
|
|
20
|
+
## Portability Notes
|
|
21
|
+
|
|
22
|
+
This skill is intentionally portable.
|
|
23
|
+
|
|
24
|
+
- It does not rely on plugin roots or external scripts.
|
|
25
|
+
- It uses standard `git worktree` commands.
|
|
26
|
+
- It will not overwrite env files when copying.
|
|
27
|
+
|
|
28
|
+
## When to Use This Skill
|
|
29
|
+
|
|
30
|
+
Use this skill in these scenarios:
|
|
31
|
+
|
|
32
|
+
1. **Code Review (`/workflow:review`)**: If NOT already on the target branch, offer worktree for isolated review
|
|
33
|
+
2. **Feature Work (`/workflow:work`)**: Offer worktree for isolated parallel development
|
|
34
|
+
3. **Parallel Development**: When working on multiple features simultaneously
|
|
35
|
+
4. **Cleanup**: After completing work in a worktree
|
|
36
|
+
|
|
37
|
+
## How to Use
|
|
38
|
+
|
|
39
|
+
### Usage
|
|
40
|
+
|
|
41
|
+
This skill can be invoked from `/workflow:work` or manually from bash.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Create a new worktree
|
|
45
|
+
git worktree add -b feature-login ".worktrees/feature-login" "HEAD"
|
|
46
|
+
|
|
47
|
+
# List all worktrees
|
|
48
|
+
git worktree list
|
|
49
|
+
|
|
50
|
+
# Remove a worktree (must not be the current worktree)
|
|
51
|
+
git worktree remove ".worktrees/feature-login"
|
|
52
|
+
|
|
53
|
+
# Prune stale worktree metadata
|
|
54
|
+
git worktree prune
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Create Workflow
|
|
58
|
+
|
|
59
|
+
Inputs:
|
|
60
|
+
|
|
61
|
+
- `branch-name` (required)
|
|
62
|
+
- `from-branch` (optional)
|
|
63
|
+
|
|
64
|
+
Default base selection (single source of truth):
|
|
65
|
+
|
|
66
|
+
- If `from-branch` is provided, use it.
|
|
67
|
+
- Otherwise, use the current active branch (or `HEAD` if detached).
|
|
68
|
+
|
|
69
|
+
Steps:
|
|
70
|
+
|
|
71
|
+
1. Resolve `worktree_dir`:
|
|
72
|
+
- Prefer `worktree_dir` from the Repo Config Block in `AGENTS.md` when present
|
|
73
|
+
- Otherwise default to `.worktrees/`
|
|
74
|
+
2. Ensure the worktree dir exists.
|
|
75
|
+
3. Ensure the worktree dir is ignored by git (add to `.gitignore` if needed).
|
|
76
|
+
4. (Optional) `git fetch origin` if you intend to base off a remote ref.
|
|
77
|
+
5. Create the worktree at `<worktree_dir>/<sanitized-branch-name>`.
|
|
78
|
+
- Sanitize branch names for paths: replace `/` with `-` (e.g. `feat/foo` → `feat-foo`)
|
|
79
|
+
6. Bootstrap (optional but recommended for `/workflow:work`):
|
|
80
|
+
- Copy env/config files (non-overwriting)
|
|
81
|
+
- Install dependencies (command from config or best-effort autodetect)
|
|
82
|
+
|
|
83
|
+
Example:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
git worktree add -b "feat/my-feature" ".worktrees/feat-my-feature" "HEAD"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## After creating a worktree
|
|
90
|
+
|
|
91
|
+
All subsequent code changes and terminal commands for this workflow MUST be executed in this worktree: use the worktree directory for all file paths and as the cwd for every command. The main repo checkout is not the implementation target.
|
|
92
|
+
|
|
93
|
+
## Bootstrap (Hybrid: config override + safe autodetect)
|
|
94
|
+
|
|
95
|
+
This skill is portable, so bootstrap is best-effort by default and configurable per repo via `AGENTS.md`.
|
|
96
|
+
|
|
97
|
+
Sources (precedence):
|
|
98
|
+
|
|
99
|
+
1. Repo Config Block (`AGENTS.md`):
|
|
100
|
+
- `worktree_copy_files`
|
|
101
|
+
- `worktree_install_command`
|
|
102
|
+
- `worktree_bootstrap_notes` (read-first prerequisites; not executed)
|
|
103
|
+
2. Safe defaults + autodetect when keys are missing.
|
|
104
|
+
|
|
105
|
+
### Copy env/config files (non-overwriting)
|
|
106
|
+
|
|
107
|
+
- Prefer `worktree_copy_files` from `AGENTS.md`.
|
|
108
|
+
- Otherwise default to copying: `.env` and `.env.*`
|
|
109
|
+
- Exclude `.env.example`, `.env.template`, `.env.sample` (and similar).
|
|
110
|
+
- Do not overwrite existing files in the target worktree.
|
|
111
|
+
|
|
112
|
+
### Install dependencies
|
|
113
|
+
|
|
114
|
+
- Prefer `worktree_install_command` from `AGENTS.md`.
|
|
115
|
+
- Otherwise auto-detect (Node-first):
|
|
116
|
+
- `pnpm-lock.yaml` → `pnpm install`
|
|
117
|
+
- `yarn.lock` → `yarn install`
|
|
118
|
+
- `package-lock.json` → `npm ci`
|
|
119
|
+
- `bun.lockb` → `bun install`
|
|
120
|
+
- `package.json` only → `npm install`
|
|
121
|
+
- If you cannot infer safely, ask once for the install command.
|
|
122
|
+
|
|
123
|
+
## List Worktrees
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
git worktree list
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Switch Worktrees
|
|
130
|
+
|
|
131
|
+
List worktrees and `cd` into the one you want.
|
|
132
|
+
|
|
133
|
+
## Cleanup
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
git worktree prune
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Remove worktree directories explicitly with `git worktree remove`.
|
|
140
|
+
|
|
141
|
+
## Workflow Examples
|
|
142
|
+
|
|
143
|
+
### Code Review with Worktree
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
git worktree add -b pr-123-feature-name ".worktrees/pr-123-feature-name" "HEAD"
|
|
147
|
+
cd .worktrees/pr-123-feature-name
|
|
148
|
+
|
|
149
|
+
# After review, remove when done:
|
|
150
|
+
cd ../..
|
|
151
|
+
git worktree remove ".worktrees/pr-123-feature-name"
|
|
152
|
+
git worktree prune
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Parallel Feature Development
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
git worktree add -b feature-login ".worktrees/feature-login" "HEAD"
|
|
159
|
+
git worktree add -b feature-notifications ".worktrees/feature-notifications" "HEAD"
|
|
160
|
+
git worktree list
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Key Design Principles
|
|
164
|
+
|
|
165
|
+
### KISS (Keep It Simple, Stupid)
|
|
166
|
+
|
|
167
|
+
- **One manager script** handles all worktree operations
|
|
168
|
+
- **Simple commands** with sensible defaults
|
|
169
|
+
- **Interactive prompts** prevent accidental operations
|
|
170
|
+
- **Clear naming** using branch names directly
|
|
171
|
+
|
|
172
|
+
### Opinionated Defaults
|
|
173
|
+
|
|
174
|
+
- Worktrees default to base branch **current active branch** (unless `from-branch` specified)
|
|
175
|
+
- Worktrees stored in **.worktrees/** directory (unless overridden by `worktree_dir`)
|
|
176
|
+
- Branch name becomes worktree directory name (sanitized for filesystem)
|
|
177
|
+
- **.gitignore** automatically managed
|
|
178
|
+
|
|
179
|
+
### Safety First
|
|
180
|
+
|
|
181
|
+
- **Confirms before creating** worktrees
|
|
182
|
+
- **Confirms before cleanup** to prevent accidental removal
|
|
183
|
+
- **Won't remove current worktree**
|
|
184
|
+
- **Clear error messages** for issues
|
|
185
|
+
|
|
186
|
+
## Integration with Workflows
|
|
187
|
+
|
|
188
|
+
- `/workflow:work` should default to a worktree (opt-out), pass `from-branch = current active branch`, and then bootstrap (copy env/config + install deps).
|
|
189
|
+
- `/workflow:review` may offer a worktree when not on the target branch.
|
|
190
|
+
|
|
191
|
+
## Troubleshooting
|
|
192
|
+
|
|
193
|
+
### "Worktree already exists"
|
|
194
|
+
|
|
195
|
+
If you see this, list worktrees and switch to the existing one:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
git worktree list
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### "Cannot remove worktree: it is the current worktree"
|
|
202
|
+
|
|
203
|
+
Switch out of the worktree first (to main repo), then cleanup:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
cd $(git rev-parse --show-toplevel)
|
|
207
|
+
git worktree prune
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Lost in a worktree?
|
|
211
|
+
|
|
212
|
+
See where you are:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
git worktree list
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Optional: Copy env files
|
|
219
|
+
|
|
220
|
+
If your repo uses env/config files and you want them in the worktree, copy from the repo root to the worktree directory.
|
|
221
|
+
|
|
222
|
+
Rules:
|
|
223
|
+
|
|
224
|
+
- Prefer `worktree_copy_files` from `AGENTS.md` when present.
|
|
225
|
+
- Otherwise default to `.env` and `.env.*` (exclude example/template files).
|
|
226
|
+
- Do not overwrite existing files.
|
|
227
|
+
|
|
228
|
+
Also consider `worktree_bootstrap_notes` from `AGENTS.md` (system deps/services/tooling) before running installs/tests.
|
|
229
|
+
|
|
230
|
+
Navigate back to main:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
cd $(git rev-parse --show-toplevel)
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Technical Details
|
|
237
|
+
|
|
238
|
+
### Directory Structure
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
.worktrees/
|
|
242
|
+
├── feature-login/ # Worktree 1
|
|
243
|
+
│ ├── .git
|
|
244
|
+
│ ├── app/
|
|
245
|
+
│ └── ...
|
|
246
|
+
├── feature-notifications/ # Worktree 2
|
|
247
|
+
│ ├── .git
|
|
248
|
+
│ ├── app/
|
|
249
|
+
│ └── ...
|
|
250
|
+
└── ...
|
|
251
|
+
|
|
252
|
+
.gitignore (updated to include .worktrees)
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### How It Works
|
|
256
|
+
|
|
257
|
+
- Uses `git worktree add` for isolated environments
|
|
258
|
+
- Each worktree has its own branch
|
|
259
|
+
- Changes in one worktree don't affect others
|
|
260
|
+
- Share git history with main repo
|
|
261
|
+
- Can push from any worktree
|
|
262
|
+
|
|
263
|
+
### Performance
|
|
264
|
+
|
|
265
|
+
- Worktrees are lightweight (just file system links)
|
|
266
|
+
- No repository duplication
|
|
267
|
+
- Shared git objects for efficiency
|
|
268
|
+
- Much faster than cloning or stashing/switching
|