Skip to content

Commit 8b7141e

Browse files
Merge pull request #3177 from pierreb-devkit/chore/rework-update-stack-skill
chore(update-stack): rework skill as 2-phase ISO merge, remove stack-maintainer agent
2 parents a44e2eb + c829306 commit 8b7141e

File tree

4 files changed

+48
-89
lines changed

4 files changed

+48
-89
lines changed

.claude/agents/stack-maintainer.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

.claude/skills/update-stack/SKILL.md

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,60 +5,65 @@ description: Merge the latest changes from the Devkit Node stack repository into
55

66
# Update Stack Skill
77

8-
Pure git workflow for merging stack updates while preserving downstream customizations.
8+
Two-phase workflow. Phase 1 brings the stack down ISO. Phase 2 aligns the project.
99

10-
## Steps
10+
## Phase 1 — ISO merge
1111

12-
### 1. Add the stack remote (if not already added)
12+
**Goal: stack modules and lib exit this phase identical to upstream. Zero downstream logic in them.**
13+
14+
Stack modules: `home`, `auth`, `users`, `tasks`, `uploads` — Stack core: `lib/` (existing files), `config/defaults/` (stack-owned files only)
15+
16+
### 1. Setup remote + merge
1317

1418
```bash
15-
git remote add devkit-node https://github.com/pierreb-devkit/Node.git
19+
git remote get-url devkit-node >/dev/null 2>&1 || git remote add devkit-node https://github.com/pierreb-devkit/Node.git
20+
git fetch devkit-node
21+
git merge devkit-node/master
1622
```
1723

18-
### 2. Fetch the latest stack changes
24+
### 2. Resolve conflicts
25+
26+
| File | Rule |
27+
|------|------|
28+
| Stack module (`modules/home\|auth\|users\|tasks\|uploads`) | `git checkout --theirs <file>` |
29+
| `lib/<existing-file>` | `git checkout --theirs <file>` (existing stack framework files — always ISO) |
30+
| `config/defaults/development.js`, `production.js`, etc. | `git checkout --theirs <file>` (stack-owned defaults) |
31+
| `package-lock.json` | `git checkout --theirs package-lock.json` — regenerate after `package.json` is resolved |
32+
| `ERRORS.md` | Merge stack entries + project entries — never drop lines |
33+
| `MIGRATION.md` (if present) | Read it (needed for Phase 2), then `git checkout --theirs MIGRATION.md` |
34+
| `package.json` | `git checkout --ours package.json` then merge upstream version bumps |
35+
| Downstream-only new files (new modules, helpers, lib additions, scripts) | Never delete — these do not exist in the stack, `git checkout --ours <file>` if flagged |
36+
37+
After resolving `package.json`:
1938

2039
```bash
21-
git fetch devkit-node
40+
npm install --package-lock-only
41+
git add package-lock.json
2242
```
2343

24-
### 3. Merge the stack updates
44+
Stage all resolved files and complete the merge:
2545

2646
```bash
27-
git merge devkit-node/master
47+
git add -u
48+
git merge --continue
2849
```
2950

30-
### 4. Handle conflicts
51+
### 3. `/verify`
3152

32-
Focus on these high-conflict areas:
53+
All failures here are regressions from conflict resolution. Fix before Phase 2.
3354

34-
- `config/defaults/` — Merge stack defaults carefully, preserve downstream overrides
35-
- `lib/services/` — Accept stack changes unless downstream has specific customizations
36-
- `package.json` — Keep downstream dependencies, accept stack dependency updates
37-
- `modules/*/` — Stack only ships `tasks`, `home`, `auth`, `users`, `uploads` — downstream modules are safe
55+
---
3856

39-
### 5. Verify after merge
57+
## Phase 2 — Project alignment
4058

41-
```bash
42-
npm run lint
43-
npm test
44-
```
59+
**Goal: project-specific modules work and match stack patterns.**
60+
61+
### 4. Apply MIGRATION.md (if present)
62+
63+
Read the last entries — they list breaking changes requiring updates in project modules. Apply each one to non-stack modules.
64+
65+
### 5. Align project modules
66+
67+
Diff project modules against `modules/tasks` (stack reference). Fix any pattern drift flagged by `ERRORS.md`.
4568

46-
## Conflict Strategy
47-
48-
| File/Dir | Strategy |
49-
| ---------------------- | --------------------------------------------- |
50-
| `config/defaults/` | Preserve downstream values, take stack structure |
51-
| `lib/` | Prefer stack (core framework code) |
52-
| `modules/tasks/` | Prefer stack (reference module) |
53-
| `modules/home/` | Prefer stack (core module) |
54-
| `modules/auth/` | Prefer stack (security — take updates) |
55-
| `modules/users/` | Prefer stack unless customized |
56-
| `modules/uploads/` | Prefer stack unless customized |
57-
| Custom modules | Always keep downstream |
58-
| `package.json` | Merge carefully, keep both dependency sets |
59-
60-
## Notes
61-
62-
- Stack modules (`tasks`, `home`, `auth`, `users`, `uploads`) are reference implementations — downstream may customize them
63-
- Custom modules added downstream will never conflict
64-
- After merge, check `config/defaults/development.js` to ensure new stack config keys are present
69+
### 6. `/verify`

.claude/skills/verify/SKILL.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ Run lint → tests and report results.
99

1010
## Steps
1111

12-
1. Run `npm run lint` to check code quality (read-only, no auto-fix)
13-
2. Run `npm test` to run all tests
14-
3. Summarize results:
12+
1. Read `ERRORS.md` — scan changed files for any pattern listed as wrong. Flag violations before running tooling.
13+
2. Run `npm run lint` to check code quality (read-only, no auto-fix)
14+
3. Run `npm test` to run all tests
15+
4. Summarize results:
1516
- ✅ All checks passed → ready to commit
1617
- ❌ Some checks failed → show what failed and suggest next action
1718

CLAUDE.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ It is designed to be cloned into downstream projects and kept up-to-date through
88

99
Source of truth: `README.md` + `package.json` scripts.
1010

11-
The `.claude/` folder contains embedded settings, skills, and agents that are available immediately after cloning.
11+
The `.claude/` folder contains embedded settings and skills that are available immediately after cloning.
1212

1313
## Canonical commands
1414

@@ -52,10 +52,6 @@ Use `.claude/skills/*/SKILL.md` as the primary workflow source for Claude.
5252
| `/naming` | Apply or audit naming conventions |
5353
| `/pull-request` | Full PR lifecycle: draft, CI, monitor loop, iterate |
5454

55-
## Embedded agent
56-
57-
- `stack-maintainer` (`.claude/agents/stack-maintainer.md`): quick review guard for mergeability, security, and modularity.
58-
5955
## Stack merge workflow
6056

6157
See README — stack merge workflow section.

0 commit comments

Comments
 (0)