@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.
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
3
+ "name": "reservine-dx",
4
+ "version": "1.0.0",
5
+ "description": "Shared developer experience skills for the Reservine ecosystem (FE + BE)",
6
+ "owner": {
7
+ "name": "Reservine",
8
+ "url": "https://github.com/Reservine/Reservine-DX"
9
+ },
10
+ "plugins": [
11
+ {
12
+ "name": "reservine-dx",
13
+ "description": "Cross-repo skills for feature planning, implementation, cherry-pick PRs, worktree setup, and commits across Reservine frontend (Angular) and backend (Laravel).",
14
+ "version": "1.0.0",
15
+ "author": { "name": "Reservine" },
16
+ "source": "./plugins/reservine-dx",
17
+ "category": "development",
18
+ "commands": ["./commands/"],
19
+ "skills": ["./skills/"]
20
+ }
21
+ ]
22
+ }
package/README.md ADDED
@@ -0,0 +1,303 @@
1
+ # Reservine-DX
2
+
3
+ Shared developer experience skills for the Reservine ecosystem (Angular frontend + Laravel backend).
4
+
5
+ A Claude Code marketplace plugin providing cross-repo skills for feature planning, implementation, cherry-pick PRs, worktree setup, and commits.
6
+
7
+ ## Quick Start
8
+
9
+ ```bash
10
+ bunx @reservine/dx install
11
+ ```
12
+
13
+ That's it. Restart Claude Code and the skills are available in any Reservine repo.
14
+
15
+ ### Other commands
16
+
17
+ ```bash
18
+ bunx @reservine/dx update # Pull latest skills from GitHub
19
+ bunx @reservine/dx doctor # Verify installation health
20
+ bunx @reservine/dx uninstall # Remove from Claude Code settings
21
+ ```
22
+
23
+ ### Manual installation
24
+
25
+ If you prefer not to use the CLI, add to your `~/.claude/settings.json`:
26
+
27
+ ```json
28
+ {
29
+ "extraKnownMarketplaces": {
30
+ "reservine-dx": {
31
+ "source": {
32
+ "source": "git",
33
+ "url": "https://github.com/Reservine/Reservine-DX.git"
34
+ }
35
+ }
36
+ },
37
+ "enabledPlugins": {
38
+ "reservine-dx@reservine-dx": true
39
+ }
40
+ }
41
+ ```
42
+
43
+ ---
44
+
45
+ ## Developer Workflow
46
+
47
+ The full feature lifecycle from idea to merged PR:
48
+
49
+ ```
50
+ ┌─────────────────────────────────────────────────────────────────┐
51
+ │ 1. PLAN │
52
+ │ /reservine-dx:new-feature-planning full: voucher management │
53
+ │ │
54
+ │ → Creates GitHub issues in FE + BE repos │
55
+ │ → Links them via sub-issues (FE = parent) │
56
+ │ → Runs interactive questionnaire (scope: fe/be/full) │
57
+ │ → Assigns milestone + priority labels │
58
+ └───────────────────────┬─────────────────────────────────────────┘
59
+
60
+ ┌───────────────────────▼─────────────────────────────────────────┐
61
+ │ 2. SETUP │
62
+ │ │
63
+ │ BE: setup-worktree-be.sh --isolated │
64
+ │ → Creates worktree, copies vendor, starts isolated Docker │
65
+ │ → Seeds DB from snapshot, runs migrations │
66
+ │ → Generates FE proxy.conf.json + config.local │
67
+ │ │
68
+ │ FE: setup-worktree-fe.sh │
69
+ │ → Symlinks node_modules, copies SSL certs │
70
+ │ → Detects BE isolated stack, sets proxy to correct port │
71
+ │ → Writes MCP_WORKTREE_PORT to config.local │
72
+ │ │
73
+ │ Result: FE worktree ←proxy→ BE isolated Docker │
74
+ │ (completely isolated from main dev environment) │
75
+ └───────────────────────┬─────────────────────────────────────────┘
76
+
77
+ ┌───────────────────────▼─────────────────────────────────────────┐
78
+ │ 3. IMPLEMENT │
79
+ │ /reservine-dx:implement-plan <issue-number> │
80
+ │ │
81
+ │ Phase 1: Load issue context + dependency check │
82
+ │ Phase 2: Questionnaire (delegated to local plugin.md) │
83
+ │ Phase 3: Branch + worktree setup │
84
+ │ Phase 4: Implementation (delegated to local plugin.md) │
85
+ │ Phase 5: Build verification (self-improvement loop, max 5) │
86
+ │ Phase 6: E2E testing (auto-start server, Playwright, fix loop)│
87
+ │ Phase 7: Create PR │
88
+ │ Phase 8-10: Code review, security audit, retro fixes │
89
+ └───────────────────────┬─────────────────────────────────────────┘
90
+
91
+ ┌───────────────────────▼─────────────────────────────────────────┐
92
+ │ 4. CLEANUP │
93
+ │ /reservine-dx:cleanup │
94
+ │ │
95
+ │ → Discovers all artifacts (worktrees, Docker, branches) │
96
+ │ → Verifies PRs are merged │
97
+ │ → Kills processes, tears down Docker, removes worktrees │
98
+ │ → Deletes local + remote branches │
99
+ │ → Cross-repo: finds and cleans sibling worktree automatically │
100
+ └─────────────────────────────────────────────────────────────────┘
101
+ ```
102
+
103
+ ---
104
+
105
+ ## How Worktree Isolation Works
106
+
107
+ Each feature gets its own isolated environment — separate from the main dev setup and from other features:
108
+
109
+ ```
110
+ Main repos (always running on standard ports):
111
+ FE: localhost:1111 → BE: localhost:80 (shared Sail)
112
+
113
+ Feature worktree (isolated):
114
+ FE: localhost:4202 → BE: localhost:8056 (own Docker stack)
115
+ ↑ ↑
116
+ │ proxy.conf.json │ docker-compose.isolated.yaml
117
+ │ auto-generated │ deterministic ports from branch hash
118
+ │ by BE setup │ own DB + Redis + Meilisearch
119
+ │ │ seeded from snapshot
120
+ ↓ ↓
121
+ .worktrees/feat/... .worktrees/feat/...
122
+ (symlinked modules) (copied vendor, isolated .env)
123
+ ```
124
+
125
+ ### Port Flow
126
+
127
+ ```
128
+ setup-worktree-fe.sh
129
+ │ scans ports 4200-4205
130
+ │ finds first free port (e.g., 4202)
131
+ │ writes MCP_WORKTREE_PORT=4202 → .claude/config.local
132
+
133
+ implement-plan (Phase 6)
134
+ │ reads MCP_WORKTREE_PORT from config.local
135
+ │ auto-starts: nx serve reservine --port 4202
136
+
137
+ Playwright MCP (init-page.ts)
138
+ │ reads MCP_WORKTREE_PORT from config.local
139
+ │ overrides baseUrl → http://localhost:4202
140
+ │ authenticates, runs E2E tests
141
+
142
+ cleanup
143
+ │ scans ports, kills nx serve on 4202
144
+ │ tears down Docker on 8056
145
+ ```
146
+
147
+ ### BE Isolated Docker Stack
148
+
149
+ Each BE worktree gets deterministic ports based on branch name hash:
150
+
151
+ ```
152
+ Branch: feat/voucher-management-114
153
+ Slug: feat-voucher-management-114
154
+ Hash: offset 42
155
+
156
+ Ports:
157
+ App: 8042 (8000 + 42)
158
+ DB: 4342 (4300 + 42)
159
+ Redis: 7342 (7300 + 42)
160
+ Adminer: 9042 (9000 + 42)
161
+ Meili: 8742 (8700 + 42)
162
+
163
+ Containers: wt-feat-voucher-management-114-{app,db,redis,adminer,meili,soketi}
164
+ ```
165
+
166
+ Collision detection: if a port is already in use by another stack, the offset increments until a free range is found.
167
+
168
+ ---
169
+
170
+ ## Self-Improvement Loops
171
+
172
+ The implement-plan skill uses structured fix loops at two levels:
173
+
174
+ ### Build Loop (Phase 5)
175
+
176
+ ```
177
+ Run: bun run build:reservine:prod && nx lint reservine
178
+ ├─ PASS → proceed to Phase 6
179
+ └─ FAIL → read error → fix code → commit → re-run (max 5x)
180
+ ```
181
+
182
+ ### E2E Test Loop (Phase 6)
183
+
184
+ ```
185
+ Run all E2E tests
186
+ ├─ ALL PASS → proceed to Phase 7
187
+ └─ FAILURES → classify each:
188
+ ├─ Implementation bug → fix source code
189
+ ├─ Test bug → fix selector/assertion
190
+ └─ Timing issue → add waitForSelector
191
+ → re-run ONLY failing tests (max 5x total)
192
+ ```
193
+
194
+ Classification heuristics:
195
+ | Error pattern | Classification |
196
+ |---------------|---------------|
197
+ | `TimeoutError: locator` | Timing issue |
198
+ | `expect(received).toBe(expected)` wrong value | Implementation bug |
199
+ | `locator resolved to 0 elements` | Test bug or impl bug |
200
+ | `net::ERR_CONNECTION_REFUSED` | Server not running |
201
+
202
+ ---
203
+
204
+ ## Skills & Commands Reference
205
+
206
+ ### Skills
207
+
208
+ | Skill | Scope prefix | Description |
209
+ |-------|-------------|-------------|
210
+ | `new-feature-planning` | `fe:` / `be:` / `full:` | Create GitHub issues with questionnaire, milestone, sub-issue linking |
211
+ | `implement-plan` | — | Universal feature orchestrator with 10 phases |
212
+ | `cross-plan` | — | Create intent files + linked issues in sibling repo |
213
+
214
+ ### Commands
215
+
216
+ | Command | Description |
217
+ |---------|-------------|
218
+ | `cherry-pick-pr` | Extract commits into a clean PR via worktree |
219
+ | `commit` | Smart commits with stack-aware pre-checks and task ID detection |
220
+ | `cleanup` | Post-merge cleanup of all artifacts across both repos |
221
+
222
+ ### Scripts
223
+
224
+ | Script | Description |
225
+ |--------|-------------|
226
+ | `setup-worktree.sh` | Entry point — auto-detects Angular/Laravel |
227
+ | `setup-worktree-fe.sh` | Angular: node_modules, SSL, proxy, port detection |
228
+ | `setup-worktree-be.sh` | Laravel: vendor, Sail, isolated Docker, snapshot seeding |
229
+ | `_core.sh` | Shared: colors, logging, env detection, branch setup, sibling lookup |
230
+
231
+ Use `--log` on any setup script to write a timestamped log file.
232
+
233
+ ---
234
+
235
+ ## Architecture
236
+
237
+ ```
238
+ Reservine-DX/ # This marketplace (shared, cross-repo)
239
+ ├── bin/
240
+ │ └── cli.ts # bunx @reservine/dx CLI (install/update/doctor)
241
+ ├── plugins/reservine-dx/
242
+ │ ├── skills/
243
+ │ │ ├── new-feature-planning # Issue creation + questionnaire
244
+ │ │ ├── cross-plan # Bidirectional intent files
245
+ │ │ └── implement-plan # Shared orchestrator
246
+ │ │ └── references/
247
+ │ │ └── plugin-contract
248
+ │ ├── commands/
249
+ │ │ ├── cherry-pick-pr # Worktree-based cherry-pick
250
+ │ │ ├── commit # Smart commits
251
+ │ │ └── cleanup # Post-merge cleanup
252
+ │ ├── scripts/
253
+ │ │ ├── _core.sh # Shared utilities
254
+ │ │ ├── setup-worktree.sh # Auto-detect entry point
255
+ │ │ ├── setup-worktree-fe.sh # Angular worktree setup
256
+ │ │ └── setup-worktree-be.sh # Laravel worktree setup
257
+ │ └── docker/worktree/
258
+ │ ├── docker-compose.isolated.template.yaml
259
+ │ └── seed-snapshot.sh
260
+
261
+ reservine/.claude/skills/ # FE-specific (stays local)
262
+ ├── implement-plan/plugin.md # Angular: design critique, E2E, Nielsen audit
263
+ ├── design/ # UI Composition Bible (83+ components)
264
+ ├── angular/ # Signal patterns, TanStack Query
265
+ ├── i18n/ # ICU MessageFormat translations
266
+ ├── layers/ # Modal/drawer system
267
+ ├── grid-engine/ # Calendar + timeslot picker
268
+ └── play/ # Playwright MCP routing
269
+
270
+ ReservineBack/.claude/skills/ # BE-specific (stays local)
271
+ ├── implement-plan/plugin.md # Laravel: API slice, PHPUnit, PHPStan
272
+ ├── api/ # Full vertical slice builder
273
+ ├── laravel/ # Best practices + patterns
274
+ ├── tdd/ # Test-driven development
275
+ └── dev-tools/ # Debugging tools (Horizon, Telescope)
276
+ ```
277
+
278
+ ## Plugin Contract
279
+
280
+ Each repo keeps `.claude/skills/implement-plan/plugin.md` following the contract in `references/plugin-contract.md`. Required sections:
281
+
282
+ | Section | Purpose |
283
+ |---------|---------|
284
+ | `## Stack` | `angular` or `laravel` |
285
+ | `## Specification Phase` | Questionnaire or design critique to run |
286
+ | `## Implementation Phase` | Which skills to invoke, how to implement |
287
+ | `## Build Commands` | `build`, `lint`, `typecheck`, `test` commands |
288
+ | `## Verification Phase` | E2E tests, visual checks, type verification |
289
+ | `## PR Template Extras` | Additional PR body sections |
290
+ | `## Review Extras` | Stack-specific reviewer checklist |
291
+
292
+ ## Config System
293
+
294
+ Both repos use `.claude/config` (committed) + `.claude/config.local` (gitignored):
295
+
296
+ | Variable | Source | Used by |
297
+ |----------|--------|---------|
298
+ | `GITHUB_REPO` | `.claude/config` | PRs, `gh` commands |
299
+ | `DEVELOPMENT_BRANCH` | `.claude/config` | Worktree base, PR target |
300
+ | `BACKEND_DIR` / `FRONTEND_DIR` | `.claude/config` | Sibling repo path |
301
+ | `MCP_WORKTREE_PORT` | `.claude/config.local` | Playwright MCP, dev server port |
302
+ | `MCP_LOCALBE_API_URL` | `.claude/config.local` | Proxy target for isolated BE |
303
+ | `MCP_DEV_EMAIL` / `PASSWORD` | `.claude/config.local` | Playwright auth credentials |