@reservine/dx 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/.claude-plugin/marketplace.json +22 -0
- package/README.md +303 -0
- package/bin/cli.ts +549 -0
- package/package.json +26 -0
- package/plugins/reservine-dx/.claude-plugin/plugin.json +8 -0
- package/plugins/reservine-dx/commands/cherry-pick-pr.md +221 -0
- package/plugins/reservine-dx/commands/cleanup.md +297 -0
- package/plugins/reservine-dx/commands/commit.md +118 -0
- package/plugins/reservine-dx/docker/worktree/docker-compose.isolated.template.yaml +144 -0
- package/plugins/reservine-dx/docker/worktree/seed-snapshot.sh +74 -0
- package/plugins/reservine-dx/scripts/_core.sh +330 -0
- package/plugins/reservine-dx/scripts/setup-worktree-be.sh +501 -0
- package/plugins/reservine-dx/scripts/setup-worktree-fe.sh +244 -0
- package/plugins/reservine-dx/scripts/setup-worktree.sh +59 -0
- package/plugins/reservine-dx/skills/cross-plan/SKILL.md +339 -0
- package/plugins/reservine-dx/skills/implement-plan/SKILL.md +512 -0
- package/plugins/reservine-dx/skills/implement-plan/references/plugin-contract.md +82 -0
- package/plugins/reservine-dx/skills/new-feature-planning/SKILL.md +544 -0
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reservine-dx:implement-plan
|
|
3
|
+
description: >
|
|
4
|
+
Universal feature implementation orchestrator for the Reservine ecosystem. Works in both
|
|
5
|
+
FE (Angular) and BE (Laravel) repos by auto-detecting the stack and loading a local
|
|
6
|
+
plugin.md for stack-specific phases. Handles GitHub issue tracking, checkpoint resume,
|
|
7
|
+
label management, worktree setup, PR creation, code review, and security audit.
|
|
8
|
+
Triggers: "implement issue", "build feature #N", "implement plan", issue number or
|
|
9
|
+
intent file path argument.
|
|
10
|
+
argument-hint: <issue-number-or-intent-file>
|
|
11
|
+
allowed-tools:
|
|
12
|
+
- Bash
|
|
13
|
+
- Read
|
|
14
|
+
- Write
|
|
15
|
+
- Edit
|
|
16
|
+
- Glob
|
|
17
|
+
- Grep
|
|
18
|
+
- Skill
|
|
19
|
+
- AskUserQuestion
|
|
20
|
+
- Agent
|
|
21
|
+
- ToolSearch
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# Reservine — Implement Plan (Shared Orchestrator)
|
|
25
|
+
|
|
26
|
+
End-to-end feature orchestrator that works in both the Angular frontend and Laravel backend
|
|
27
|
+
repos. Auto-detects the current stack, loads the local `plugin.md` for stack-specific phases,
|
|
28
|
+
and orchestrates the full feature lifecycle from issue to PR.
|
|
29
|
+
|
|
30
|
+
`ToolSearch` is required because Playwright MCP tools (used in FE plugin) are deferred.
|
|
31
|
+
|
|
32
|
+
## Stack Detection
|
|
33
|
+
|
|
34
|
+
At startup, detect the current stack:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
if [[ -f "angular.json" ]] || [[ -f "nx.json" ]]; then
|
|
38
|
+
STACK="angular"
|
|
39
|
+
elif [[ -f "artisan" ]] || [[ -f "composer.json" ]]; then
|
|
40
|
+
STACK="laravel"
|
|
41
|
+
else
|
|
42
|
+
# AskUserQuestion: "Which stack is this repo? (angular / laravel)"
|
|
43
|
+
fi
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Then load the local plugin:
|
|
47
|
+
```bash
|
|
48
|
+
cat .claude/skills/implement-plan/plugin.md
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The plugin provides stack-specific configuration for phases delegated below.
|
|
52
|
+
|
|
53
|
+
## GitHub Issue Tracking
|
|
54
|
+
|
|
55
|
+
The GitHub issue is the **single source of truth** for plan progress. Throughout execution,
|
|
56
|
+
post structured comments to the issue so progress is visible to anyone watching.
|
|
57
|
+
|
|
58
|
+
**All commits** in the worktree MUST be prefixed with `[#<issue>]`:
|
|
59
|
+
```
|
|
60
|
+
[#<issue>] feat(<scope>): <description>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Progress comments** are posted at these checkpoints:
|
|
64
|
+
|
|
65
|
+
| Checkpoint | Comment Contains | Label Applied |
|
|
66
|
+
|------------|-----------------|---------------|
|
|
67
|
+
| After Phase 1 | Dependencies checked, codebase scan results | `status:in-progress` |
|
|
68
|
+
| After Phase 2 | Specification (questionnaire/critique results) | `status:design-decided` (FE) / `status:architecture-decided` (BE) |
|
|
69
|
+
| After Phase 3 | Branch name + worktree created | — |
|
|
70
|
+
| After Phase 5 | Build/test verification results | `status:build-passing` (FE) / `status:tests-passing` (BE) |
|
|
71
|
+
| After Phase 6 | Stack-specific verification results | `status:tests-passing` |
|
|
72
|
+
| After Phase 7 | PR link | `status:pr-ready` |
|
|
73
|
+
| After Phase 8 | Code review verdict + findings | — |
|
|
74
|
+
| After Phase 9 | Security audit findings | — |
|
|
75
|
+
| After Phase 10 | Fix list + deferred items | `status:review-passed` |
|
|
76
|
+
|
|
77
|
+
Comment format:
|
|
78
|
+
```bash
|
|
79
|
+
gh issue comment <issue> --repo <GITHUB_REPO> --body "..."
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Use collapsible `<details>` blocks for long content.
|
|
83
|
+
|
|
84
|
+
**Note:** When input is an `.intent.md` file instead of an issue number, skip issue tracking
|
|
85
|
+
(no issue to comment on). The PR will still reference the intent file.
|
|
86
|
+
|
|
87
|
+
### Progress Labels
|
|
88
|
+
|
|
89
|
+
Apply labels to the issue as phases complete:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
gh issue edit <issue> --repo <GITHUB_REPO> --add-label "status:in-progress"
|
|
93
|
+
gh issue edit <issue> --repo <GITHUB_REPO> --remove-label "status:in-progress" --add-label "status:design-decided"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Labels are cumulative except `status:*` which replaces the previous status.
|
|
97
|
+
|
|
98
|
+
**IMPORTANT**: `gh issue edit --add-label` does NOT auto-create labels. Create them first:
|
|
99
|
+
```bash
|
|
100
|
+
gh label create "status:in-progress" --repo <GITHUB_REPO> --color "0E8A16" --description "Implementation in progress" 2>/dev/null || true
|
|
101
|
+
gh label create "status:design-decided" --repo <GITHUB_REPO> --color "0E8A16" --description "Design/architecture decisions finalized" 2>/dev/null || true
|
|
102
|
+
gh label create "status:architecture-decided" --repo <GITHUB_REPO> --color "1D76DB" --description "Architecture decisions finalized" 2>/dev/null || true
|
|
103
|
+
gh label create "status:build-passing" --repo <GITHUB_REPO> --color "0E8A16" --description "Build passes" 2>/dev/null || true
|
|
104
|
+
gh label create "status:tests-passing" --repo <GITHUB_REPO> --color "0E8A16" --description "All tests passing" 2>/dev/null || true
|
|
105
|
+
gh label create "status:pr-ready" --repo <GITHUB_REPO> --color "FBCA04" --description "PR created and ready for review" 2>/dev/null || true
|
|
106
|
+
gh label create "status:review-passed" --repo <GITHUB_REPO> --color "0E8A16" --description "Code review and security audit passed" 2>/dev/null || true
|
|
107
|
+
gh label create "status:blocked" --repo <GITHUB_REPO> --color "B60205" --description "Blocked by dependency" 2>/dev/null || true
|
|
108
|
+
```
|
|
109
|
+
Run this label bootstrap in **Phase 1** (once per repo — labels persist).
|
|
110
|
+
|
|
111
|
+
### Blocked Status
|
|
112
|
+
|
|
113
|
+
If the skill encounters a blocker at any phase:
|
|
114
|
+
|
|
115
|
+
1. Apply label:
|
|
116
|
+
```bash
|
|
117
|
+
gh issue edit <issue> --repo <GITHUB_REPO> --remove-label "status:in-progress" --add-label "status:blocked"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
2. Post blocking comment:
|
|
121
|
+
```bash
|
|
122
|
+
gh issue comment <issue> --repo <GITHUB_REPO> --body "## Blocked
|
|
123
|
+
|
|
124
|
+
**Reason:** <description>
|
|
125
|
+
**Blocked by:** <linked issue(s) or external dependency>
|
|
126
|
+
**Technical details:** <what needs to happen before unblocking>
|
|
127
|
+
**Impact:** <what phases can't proceed>
|
|
128
|
+
|
|
129
|
+
**To unblock:** Resolve the above, then re-run \`/reservine-dx:implement-plan <issue>\` to resume from checkpoint."
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
3. Save checkpoint and exit gracefully.
|
|
133
|
+
|
|
134
|
+
When resuming after unblock:
|
|
135
|
+
```bash
|
|
136
|
+
gh issue edit <issue> --repo <GITHUB_REPO> --remove-label "status:blocked" --add-label "status:in-progress"
|
|
137
|
+
gh issue comment <issue> --repo <GITHUB_REPO> --body "Unblocked — resuming implementation from Phase <N>."
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Phase Timing
|
|
141
|
+
|
|
142
|
+
Record wall-clock time for each phase. At the start of the skill, capture `START_TIME=$(date +%s)`.
|
|
143
|
+
Before each phase, capture phase start time. After each phase, compute duration.
|
|
144
|
+
|
|
145
|
+
Post cumulative timing to the issue in the final PR comment.
|
|
146
|
+
|
|
147
|
+
### Checkpoint Resume
|
|
148
|
+
|
|
149
|
+
Save execution state after each phase to `.worktrees/<branch>/.checkpoint.json`:
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"issue": 114,
|
|
154
|
+
"stack": "angular",
|
|
155
|
+
"milestone": "v2.5",
|
|
156
|
+
"branch": "feat/voucher-management-114",
|
|
157
|
+
"currentPhase": 5,
|
|
158
|
+
"completedPhases": [1, 2, 3, 4],
|
|
159
|
+
"specification": { ... },
|
|
160
|
+
"timing": { "phase1": 15, "phase2": 130, ... },
|
|
161
|
+
"featureScope": "voucher-management",
|
|
162
|
+
"codeReview": { "critical": [], "important": [], "minor": [], "verdict": "Ready" },
|
|
163
|
+
"securityAudit": { "critical": [], "important": [], "advisory": [] }
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**On startup (Phase 1)**, before loading the issue, check for an existing checkpoint:
|
|
168
|
+
```bash
|
|
169
|
+
ls .worktrees/*/.checkpoint.json 2>/dev/null
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
If found, present to user via `AskUserQuestion`:
|
|
173
|
+
- **Resume from Phase N** — continue where we left off
|
|
174
|
+
- **Start fresh** — ignore checkpoint, begin from Phase 1
|
|
175
|
+
- **View checkpoint** — show saved state before deciding
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Phase 1: Load Feature Context
|
|
180
|
+
|
|
181
|
+
1. Read `.claude/config` + `.claude/config.local` for project variables:
|
|
182
|
+
- `DEVELOPMENT_BRANCH` — base branch for worktree + PR target
|
|
183
|
+
- `GITHUB_REPO` — org/repo for `gh` commands
|
|
184
|
+
- `BACKEND_DIR` / `FRONTEND_DIR` — sibling repo paths
|
|
185
|
+
|
|
186
|
+
2. Determine input type from `$ARGUMENTS`:
|
|
187
|
+
- **If a number**: Load GitHub issue:
|
|
188
|
+
```bash
|
|
189
|
+
gh issue view $ARGUMENTS --repo <GITHUB_REPO> --json title,body,labels,number,milestone
|
|
190
|
+
```
|
|
191
|
+
- **If a file path**: Read the `.intent.md` file from `.claude/plans/future/`
|
|
192
|
+
|
|
193
|
+
3. Check for companion files in the sibling repo:
|
|
194
|
+
- Intent files in `<SIBLING_DIR>/.claude/plans/future/`
|
|
195
|
+
- Existing plans in `.claude/plans/active/`
|
|
196
|
+
|
|
197
|
+
4. Extract: feature description, data shapes, endpoint paths, requirements
|
|
198
|
+
|
|
199
|
+
### Implementation Checklist Detection
|
|
200
|
+
|
|
201
|
+
Check if the issue body contains an "Implementation Checklist" section:
|
|
202
|
+
```bash
|
|
203
|
+
BODY=$(gh issue view <issue> --repo <GITHUB_REPO> --json body --jq '.body')
|
|
204
|
+
if echo "$BODY" | grep -q "## Implementation Checklist"; then
|
|
205
|
+
echo "Implementation Checklist found — will check off items as phases complete"
|
|
206
|
+
fi
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
5. **Dependency check** — scan issue body and linked issues for blockers:
|
|
210
|
+
```bash
|
|
211
|
+
gh api repos/<GITHUB_REPO>/issues/<issue>/timeline --jq '.[] | select(.event=="cross-referenced")'
|
|
212
|
+
```
|
|
213
|
+
If dependencies found (open blocking issues), warn user via `AskUserQuestion`:
|
|
214
|
+
- **Proceed anyway** — dependency may not be strictly required
|
|
215
|
+
- **Abort** — wait for dependencies to be resolved
|
|
216
|
+
|
|
217
|
+
6. **Pre-flight codebase scan** — auto-detect existing related code:
|
|
218
|
+
- Use patterns from the loaded plugin (FE searches `apps/`, BE searches `app/`)
|
|
219
|
+
- Present scan results: "Found N related files. Pre-filling questionnaire answers."
|
|
220
|
+
|
|
221
|
+
7. **Auto-link sibling issue/PR** — find the corresponding issue in the sibling repo:
|
|
222
|
+
```bash
|
|
223
|
+
gh search issues "<feature-keyword>" --repo <SIBLING_GITHUB_REPO> --json number,title,state --limit 5
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
8. **Bootstrap labels** (idempotent) and **post to issue**:
|
|
227
|
+
```bash
|
|
228
|
+
gh issue edit <issue> --repo <GITHUB_REPO> --add-label "status:in-progress"
|
|
229
|
+
gh issue comment <issue> --repo <GITHUB_REPO> --body "## Implementation Plan Started
|
|
230
|
+
|
|
231
|
+
**Dependencies:** <none / list with status>
|
|
232
|
+
**Related code found:** <N files>
|
|
233
|
+
**Sibling reference:** <link or 'none found'>
|
|
234
|
+
**Mode:** <New / Extension>"
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Phase 2: Specification (DELEGATED TO PLUGIN)
|
|
238
|
+
|
|
239
|
+
**Read the plugin's `## Specification Phase` section** and execute it.
|
|
240
|
+
|
|
241
|
+
The plugin defines what questionnaire or critique to run:
|
|
242
|
+
- **Angular plugin**: Apple Design Director critique via Playwright MCP + UI/UX questionnaire (14 questions)
|
|
243
|
+
- **Laravel plugin**: Architecture questionnaire (14 questions about data model, API scope, permissions, etc.)
|
|
244
|
+
|
|
245
|
+
After the plugin's specification phase completes:
|
|
246
|
+
1. Compile answers into a specification document
|
|
247
|
+
2. Present to user for confirmation via `AskUserQuestion`
|
|
248
|
+
3. Post specification to issue as a collapsible `<details>` comment
|
|
249
|
+
4. Apply the appropriate status label (`status:design-decided` or `status:architecture-decided`)
|
|
250
|
+
|
|
251
|
+
## Phase 3: Branch & Worktree Setup
|
|
252
|
+
|
|
253
|
+
1. Derive branch name: `feat/<kebab-slug>-<issue>` (max 50 char slug)
|
|
254
|
+
- Confirm with user via `AskUserQuestion`
|
|
255
|
+
2. Pre-flight:
|
|
256
|
+
```bash
|
|
257
|
+
git fetch origin <DEVELOPMENT_BRANCH>
|
|
258
|
+
git rev-parse --verify --quiet <branch>
|
|
259
|
+
git ls-remote --exit-code --heads origin <branch>
|
|
260
|
+
```
|
|
261
|
+
3. Create worktree:
|
|
262
|
+
```bash
|
|
263
|
+
git worktree add .worktrees/<branch> origin/<DEVELOPMENT_BRANCH> -b <branch>
|
|
264
|
+
```
|
|
265
|
+
4. **Run stack-specific worktree setup** from the plugin:
|
|
266
|
+
- Angular: Copy SSL certs, symlink node_modules, copy proxy config
|
|
267
|
+
- Laravel: Copy .env, setup vendor (symlink or install), run migrations
|
|
268
|
+
|
|
269
|
+
5. Verify worktree initialization (Critical Operation):
|
|
270
|
+
```bash
|
|
271
|
+
[[ -d .worktrees/<branch> ]] && echo "OK: worktree" || echo "FAIL: worktree missing"
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
6. **Post to issue**:
|
|
275
|
+
```bash
|
|
276
|
+
gh issue comment <issue> --repo <GITHUB_REPO> --body "## Branch Created
|
|
277
|
+
|
|
278
|
+
**Branch:** \`<branch>\`
|
|
279
|
+
**Worktree:** \`.worktrees/<branch>\`"
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
## Phase 4: Implementation (DELEGATED TO PLUGIN)
|
|
283
|
+
|
|
284
|
+
**Read the plugin's `## Implementation Phase` section** and execute it.
|
|
285
|
+
|
|
286
|
+
The plugin defines which skills to invoke and how to implement:
|
|
287
|
+
- **Angular plugin**: Invokes `reservine:design`, `reservine:angular`, `reservine:i18n`, implements
|
|
288
|
+
components/services/routes, runs build verification loops
|
|
289
|
+
- **Laravel plugin**: Invokes `reservine:api` for full vertical slice (migration, model, service,
|
|
290
|
+
DTOs, controller, routes), creates FE cross-plan intent file
|
|
291
|
+
|
|
292
|
+
All implementation work happens inside the worktree directory.
|
|
293
|
+
|
|
294
|
+
## Phase 5: Build Verification
|
|
295
|
+
|
|
296
|
+
**Read the plugin's `## Build Commands` section** for the correct commands.
|
|
297
|
+
|
|
298
|
+
Run the build verification commands from the plugin:
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
Angular: bun run build:reservine:prod && nx lint reservine
|
|
302
|
+
Laravel: vendor/bin/phpstan analyze <changed-files> && vendor/bin/sail test
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### Self-Improvement Loop
|
|
306
|
+
|
|
307
|
+
If build fails:
|
|
308
|
+
1. Read the error output
|
|
309
|
+
2. Fix the issues in the worktree
|
|
310
|
+
3. Re-run the build commands
|
|
311
|
+
4. Repeat until ALL pass (max 5 iterations)
|
|
312
|
+
5. If still failing after 5 iterations, `AskUserQuestion` for guidance
|
|
313
|
+
|
|
314
|
+
Post build results to issue:
|
|
315
|
+
```bash
|
|
316
|
+
gh issue edit <issue> --repo <GITHUB_REPO> --add-label "status:build-passing"
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## Phase 6: Verification (DELEGATED TO PLUGIN)
|
|
320
|
+
|
|
321
|
+
**Read the plugin's `## Verification Phase` section** and execute it.
|
|
322
|
+
|
|
323
|
+
### Worktree Port Resolution
|
|
324
|
+
|
|
325
|
+
Before running any verification, resolve the worktree dev server port:
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
# Read from worktree config (set by setup-worktree-fe.sh)
|
|
329
|
+
WORKTREE_PORT=$(grep '^MCP_WORKTREE_PORT=' .claude/config.local 2>/dev/null | cut -d= -f2)
|
|
330
|
+
WORKTREE_PORT=${WORKTREE_PORT:-4200}
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Save `WORKTREE_PORT` in `.checkpoint.json` for resume.
|
|
334
|
+
|
|
335
|
+
The plugin defines stack-specific verification:
|
|
336
|
+
- **Angular plugin**: Auto-starts dev server on `$WORKTREE_PORT`, runs Playwright MCP
|
|
337
|
+
(which reads `MCP_WORKTREE_PORT` from config.local via init-page.ts), generates E2E tests
|
|
338
|
+
from issue body + git diff, runs Classify → Fix → Retest loop (max 5), design heuristic audit
|
|
339
|
+
- **Laravel plugin**: PHPUnit test suite (happy + edge + error + obscure paths), API response
|
|
340
|
+
type verification, E2E integration checks
|
|
341
|
+
|
|
342
|
+
### Self-Improvement Loop (Classify → Fix → Retest)
|
|
343
|
+
|
|
344
|
+
When verification fails, use the structured fix loop:
|
|
345
|
+
|
|
346
|
+
1. **Classify** each failure:
|
|
347
|
+
- **Implementation bug** — source code is wrong → fix component/service/template
|
|
348
|
+
- **Test bug** — selector or assertion is wrong → fix the test
|
|
349
|
+
- **Timing issue** — element not ready → add wait/retry
|
|
350
|
+
2. **Fix** only the classified category, commit with appropriate prefix
|
|
351
|
+
3. **Retest** only the previously-failing tests (not the full suite)
|
|
352
|
+
4. **Repeat** until all pass (max 5 iterations)
|
|
353
|
+
5. If still failing → `AskUserQuestion` for guidance
|
|
354
|
+
|
|
355
|
+
Post verification results to issue:
|
|
356
|
+
```bash
|
|
357
|
+
gh issue edit <issue> --repo <GITHUB_REPO> --add-label "status:tests-passing"
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
## Phase 7: Create PR
|
|
361
|
+
|
|
362
|
+
1. Stage and commit any remaining changes
|
|
363
|
+
2. Push the branch:
|
|
364
|
+
```bash
|
|
365
|
+
cd .worktrees/<branch>
|
|
366
|
+
git push -u origin <branch>
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
3. **Read the plugin's `## PR Template Extras` section** for additional PR body content.
|
|
370
|
+
|
|
371
|
+
4. Create the PR:
|
|
372
|
+
```bash
|
|
373
|
+
cd .worktrees/<branch>
|
|
374
|
+
gh pr create --base <DEVELOPMENT_BRANCH> --title "<PR title>" --body "$(cat <<'EOF'
|
|
375
|
+
## Summary
|
|
376
|
+
<1-3 sentences describing the feature>
|
|
377
|
+
|
|
378
|
+
## Changes
|
|
379
|
+
<bullet list of what changed>
|
|
380
|
+
|
|
381
|
+
## Related
|
|
382
|
+
- Issue: #<issue>
|
|
383
|
+
- <sibling repo references>
|
|
384
|
+
|
|
385
|
+
<PLUGIN PR EXTRAS>
|
|
386
|
+
|
|
387
|
+
## Implementation Timing
|
|
388
|
+
<phase timing table>
|
|
389
|
+
|
|
390
|
+
## Test Plan
|
|
391
|
+
- [ ] <test items from plugin>
|
|
392
|
+
EOF
|
|
393
|
+
)"
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
5. Post to issue:
|
|
397
|
+
```bash
|
|
398
|
+
gh issue edit <issue> --repo <GITHUB_REPO> --add-label "status:pr-ready"
|
|
399
|
+
gh issue comment <issue> --repo <GITHUB_REPO> --body "## PR Created
|
|
400
|
+
|
|
401
|
+
<PR-URL>"
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
## Phase 8: Code Review
|
|
405
|
+
|
|
406
|
+
Self-review the changes against these categories:
|
|
407
|
+
|
|
408
|
+
### Review Checklist
|
|
409
|
+
|
|
410
|
+
| Category | Check |
|
|
411
|
+
|----------|-------|
|
|
412
|
+
| **Architecture** | Single responsibility, proper layering, no circular deps |
|
|
413
|
+
| **Security** | Input validation, auth checks, no secrets in code |
|
|
414
|
+
| **Performance** | No N+1 queries, proper indexing, lazy loading |
|
|
415
|
+
| **Error Handling** | Graceful failures, user-facing messages, logging |
|
|
416
|
+
| **Testing** | Coverage of happy + edge + error paths |
|
|
417
|
+
| **Code Quality** | Naming, DRY, no dead code, consistent patterns |
|
|
418
|
+
|
|
419
|
+
Also check plugin-specific items from `## Review Extras` (if defined).
|
|
420
|
+
|
|
421
|
+
### Findings Classification
|
|
422
|
+
|
|
423
|
+
| Severity | Action |
|
|
424
|
+
|----------|--------|
|
|
425
|
+
| **Critical** | Must fix before merge — security, data loss, crashes |
|
|
426
|
+
| **Important** | Should fix — logic errors, missing validation, bad UX |
|
|
427
|
+
| **Minor** | Nice to have — naming, formatting, minor refactors |
|
|
428
|
+
| **Positive** | Call out well-done patterns |
|
|
429
|
+
|
|
430
|
+
Post findings to issue comment.
|
|
431
|
+
|
|
432
|
+
## Phase 9: Security Audit
|
|
433
|
+
|
|
434
|
+
Spawn a security-auditor agent to review the changes:
|
|
435
|
+
|
|
436
|
+
### OWASP Top 10 Check
|
|
437
|
+
- Injection (SQL, XSS, command)
|
|
438
|
+
- Broken authentication
|
|
439
|
+
- Sensitive data exposure
|
|
440
|
+
- Security misconfiguration
|
|
441
|
+
- Known vulnerabilities in deps
|
|
442
|
+
|
|
443
|
+
### Multi-tenant / GDPR Check (Reservine-specific)
|
|
444
|
+
- Tenant isolation — no cross-tenant data leaks
|
|
445
|
+
- Personal data handling — consent, deletion, export
|
|
446
|
+
- Session management — proper token handling
|
|
447
|
+
- Permission enforcement — RBAC consistency
|
|
448
|
+
|
|
449
|
+
Post findings to issue comment.
|
|
450
|
+
|
|
451
|
+
## Phase 10: Retro Fixes
|
|
452
|
+
|
|
453
|
+
Fix all **Critical** and **Important** findings from Phases 8-9.
|
|
454
|
+
|
|
455
|
+
1. For each finding:
|
|
456
|
+
- Fix the code in the worktree
|
|
457
|
+
- Commit with message: `[#<issue>] fix(<scope>): <finding description>`
|
|
458
|
+
2. Re-run build verification (Phase 5 commands)
|
|
459
|
+
3. Re-run relevant verification (Phase 6 — only affected tests)
|
|
460
|
+
4. Push fixes
|
|
461
|
+
5. Update PR description with fix summary
|
|
462
|
+
|
|
463
|
+
### Deferred Items
|
|
464
|
+
|
|
465
|
+
For **Minor** findings that aren't worth fixing now:
|
|
466
|
+
1. List them in the PR description under "## Deferred"
|
|
467
|
+
2. Optionally create follow-up issues
|
|
468
|
+
|
|
469
|
+
Post final status to issue:
|
|
470
|
+
```bash
|
|
471
|
+
gh issue edit <issue> --repo <GITHUB_REPO> --add-label "status:review-passed"
|
|
472
|
+
gh issue comment <issue> --repo <GITHUB_REPO> --body "## Implementation Complete
|
|
473
|
+
|
|
474
|
+
**Fixes applied:** <count>
|
|
475
|
+
**Deferred:** <count>
|
|
476
|
+
**PR:** <url>
|
|
477
|
+
|
|
478
|
+
**Timing:**
|
|
479
|
+
<phase timing table>"
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
---
|
|
483
|
+
|
|
484
|
+
## Plugin Contract
|
|
485
|
+
|
|
486
|
+
The local `plugin.md` file (at `.claude/skills/implement-plan/plugin.md`) MUST follow the
|
|
487
|
+
contract defined in `references/plugin-contract.md`. See that file for the required sections
|
|
488
|
+
and format.
|
|
489
|
+
|
|
490
|
+
## Config Variables
|
|
491
|
+
|
|
492
|
+
| Variable | Source | Purpose |
|
|
493
|
+
|----------|--------|---------|
|
|
494
|
+
| `GITHUB_REPO` | `.claude/config` | Current repo for `gh` commands |
|
|
495
|
+
| `DEVELOPMENT_BRANCH` | `.claude/config` | Base branch for PR |
|
|
496
|
+
| `FRONTEND_DIR` / `BACKEND_DIR` | `.claude/config` | Sibling repo path |
|
|
497
|
+
| `*_ABSOLUTE` variants | `.claude/config.local` | Worktree-safe absolute paths |
|
|
498
|
+
| `MCP_*` variables | `.claude/config` + `.claude/config.local` | Dev/E2E server access |
|
|
499
|
+
|
|
500
|
+
## Error Recovery
|
|
501
|
+
|
|
502
|
+
| Phase | Failure | Recovery |
|
|
503
|
+
|-------|---------|----------|
|
|
504
|
+
| 1 | Issue not found | Check number, verify repo access |
|
|
505
|
+
| 1 | Sibling config not found | Use defaults |
|
|
506
|
+
| 2 | User cancels questionnaire | Save partial checkpoint, exit |
|
|
507
|
+
| 3 | Worktree creation fails | Delete existing branch, retry |
|
|
508
|
+
| 4 | Implementation error | Fix, commit, continue |
|
|
509
|
+
| 5 | Build fails after 5 retries | AskUserQuestion for guidance |
|
|
510
|
+
| 6 | Tests fail after 5 retries | AskUserQuestion for guidance |
|
|
511
|
+
| 7 | PR creation fails | Check auth, verify branch pushed |
|
|
512
|
+
| Any | Unexpected blocker | Apply blocked label, save checkpoint |
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Implement-Plan Plugin Contract
|
|
2
|
+
|
|
3
|
+
Version: 1
|
|
4
|
+
|
|
5
|
+
The shared `reservine-dx:implement-plan` orchestrator delegates stack-specific phases to a
|
|
6
|
+
local `plugin.md` file at `.claude/skills/implement-plan/plugin.md` in each repo.
|
|
7
|
+
|
|
8
|
+
## Required Sections
|
|
9
|
+
|
|
10
|
+
Your `plugin.md` MUST contain these sections with the exact heading names:
|
|
11
|
+
|
|
12
|
+
### `## Stack`
|
|
13
|
+
|
|
14
|
+
Single line: `angular` or `laravel`
|
|
15
|
+
|
|
16
|
+
### `## Specification Phase`
|
|
17
|
+
|
|
18
|
+
Define the questionnaire or critique to run during Phase 2:
|
|
19
|
+
- What questions to ask (table format)
|
|
20
|
+
- Any pre-specification steps (e.g., Playwright screenshots for design critique)
|
|
21
|
+
- How to compile results into a specification document
|
|
22
|
+
|
|
23
|
+
### `## Implementation Phase`
|
|
24
|
+
|
|
25
|
+
Define how to implement the feature during Phase 4:
|
|
26
|
+
- Which skills to invoke (e.g., `reservine:api`, `reservine:design`)
|
|
27
|
+
- Implementation patterns and conventions
|
|
28
|
+
- File creation/modification guidelines
|
|
29
|
+
|
|
30
|
+
### `## Build Commands`
|
|
31
|
+
|
|
32
|
+
Key-value pairs for build verification (Phase 5):
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
build: <command>
|
|
36
|
+
lint: <command>
|
|
37
|
+
typecheck: <command>
|
|
38
|
+
test: <command>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### `## Verification Phase`
|
|
42
|
+
|
|
43
|
+
Define stack-specific verification during Phase 6:
|
|
44
|
+
- Visual checks (screenshots, design audit)
|
|
45
|
+
- E2E tests (Playwright for FE, PHPUnit for BE)
|
|
46
|
+
- Type verification, API response checks
|
|
47
|
+
|
|
48
|
+
### `## PR Template Extras`
|
|
49
|
+
|
|
50
|
+
Additional sections to include in the PR body (Phase 7):
|
|
51
|
+
- Stack-specific test results
|
|
52
|
+
- Design screenshots
|
|
53
|
+
- Type generation status
|
|
54
|
+
|
|
55
|
+
### `## Review Extras` (optional)
|
|
56
|
+
|
|
57
|
+
Additional code review checklist items specific to the stack.
|
|
58
|
+
|
|
59
|
+
## Example Plugin Structure
|
|
60
|
+
|
|
61
|
+
```markdown
|
|
62
|
+
## Stack
|
|
63
|
+
angular
|
|
64
|
+
|
|
65
|
+
## Specification Phase
|
|
66
|
+
<instructions>
|
|
67
|
+
|
|
68
|
+
## Implementation Phase
|
|
69
|
+
<instructions>
|
|
70
|
+
|
|
71
|
+
## Build Commands
|
|
72
|
+
build: bun run build:reservine:prod
|
|
73
|
+
lint: nx lint reservine
|
|
74
|
+
typecheck: nx run reservine:typecheck
|
|
75
|
+
test: pnpm test
|
|
76
|
+
|
|
77
|
+
## Verification Phase
|
|
78
|
+
<instructions>
|
|
79
|
+
|
|
80
|
+
## PR Template Extras
|
|
81
|
+
<content>
|
|
82
|
+
```
|