Use this whenever a downstream Vue project needs to absorb upstream Devkit Vue changes — triggers on "update stack", "sync with devkit", "merge upstream", "pull stack updates", "resolve stack conflicts". Two-phase: ISO merge (stack modules stay byte-identical to upstream) then project alignment (apply MIGRATIONS.md, diff project modules vs `tasks` reference, /verify). Stack-code failures get an issue on `pierreb-devkit/Vue`.
20 stars
0 votes
0 copies
0 views
Added September 20, 2026
developmentgobashvuenodedockergitapi
Works with
api
Security analysis
B89/100
highPerforms destructive filesystem operations
mediumInstalls packages at runtime which could introduce malicious dependencies
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Update Stack?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/pierreb-devkit-update-stack)
---
name: update-stack
description: >
Use this whenever a downstream Vue project needs to absorb upstream Devkit
Vue changes — triggers on "update stack", "sync with devkit", "merge
upstream", "pull stack updates", "resolve stack conflicts". Two-phase: ISO
merge (stack modules stay byte-identical to upstream) then project
alignment (apply MIGRATIONS.md, diff project modules vs `tasks` reference,
/verify). Stack-code failures get an issue on `pierreb-devkit/Vue`.
---
# Update Stack Skill
Two-phase workflow. Phase 1 brings the stack down ISO. Phase 2 aligns the project.
## Phase 1 — ISO merge
**Goal: stack modules exit this phase identical to upstream. Zero downstream logic in them.**
Stack scope = every file under `src/modules/`, `src/lib/`, `src/config/` that exists in `devkit-vue/master`, plus the root files `src/main.js`, `index.html`, `vite.config.js` and `Dockerfile`. Auto-discovered by the step 3ter gate; do not enumerate by hand.
Downstream code reaches the stack only through its override points, never by editing a stack file:
- **Routes + start-up side effects** → `src/modules/{project}/{project}.app.js` (eager-imported by `main.js` before the router is built; call `registerDownstreamRoutes()` there). Own home page → `home.routes.home.activated: false` + a `/` route in `coreModules`.
- **Head links** (favicon, apple-touch-icon, manifest) → `app.seo.icons` / `app.seo.manifest.enabled` in `src/config/defaults/{project}.config.js`.
- **Build plugins** → `src/modules/{project}/{project}.vite.js` (default export `(appConfig, mode) => Plugin | Plugin[]`).
- **Docker build values** → `--build-arg DEVKIT_VUE_*` (the stack `Dockerfile` declares them without defaults).
### 1. Setup remote + merge
```bash
git remote get-url devkit-vue >/dev/null 2>&1 || git remote add devkit-vue https://github.com/pierreb-devkit/Vue.git
git fetch devkit-vue
git merge devkit-vue/master
```
### 2. Resolve conflicts
| File | Rule |
|------|------|
| Stack module files (every module present in `devkit-vue/master` under `src/modules/`, incl. `app.router.js`) and `src/lib/` | `git checkout --theirs <file>` — downstream routes live in `{project}.app.js`, never in `app.router.js` |
| `src/main.js`, `index.html`, `vite.config.js`, `Dockerfile` | `git checkout --theirs <file>` — move any downstream lines to their override point first (see the red flag below) |
| `package-lock.json` | `git checkout --theirs package-lock.json` — regenerate after `package.json` is resolved |
| `ERRORS.md` | Merge stack entries + project entries — never drop lines |
| `MIGRATIONS.md` (if present) | Read it (needed for Phase 2), then `git checkout --theirs MIGRATIONS.md` |
| `src/config/defaults/<project>.js` | `git checkout --ours src/config/defaults/<project>.js` (downstream-only file) |
| `package.json` | `git checkout --ours package.json` then merge upstream version bumps |
| Downstream-only files (own modules, files carrying the project name) | Keep — `git checkout --ours <file>` if flagged. Any other downstream file inside a stack folder is handled by step 3quater (ownership rule) |
After resolving `package.json`, regenerate the lockfile with a **full install** (not `--package-lock-only`):
```bash
rm -rf node_modules package-lock.json
npm install
git add package-lock.json
```
**Why full install, not `npm install --package-lock-only`:** `--package-lock-only` writes the lockfile without actually installing, so platform-specific optional peer deps (e.g. `@emnapi/core` on darwin) can be omitted from the top-level lockfile tree. The lockfile looks fine locally but `npm ci` on the linux CI runner fails with `Missing: @emnapi/core@X.Y.Z from lock file`. A full `npm install` resolves the cross-platform optional dep tree correctly and validates the install in one go. Do not "optimize" this back to `--package-lock-only`.
Stage all resolved files and complete the merge:
```bash
git add -u
git merge --continue
```
### 3. `/verify`
Failures typically indicate regressions from conflict resolution — fix these before Phase 2. However, if failures originate from stack module code itself (see 3bis), report them upstream.
### 3bis. Report stack issues
If `/verify` failures originate from a **stack file** (any file under `src/modules/`, `src/lib/`, or `src/config/` present in `devkit-vue/master`, or a stack root file: `src/main.js`, `index.html`, `vite.config.js`, `Dockerfile`) and not from conflict resolution mistakes, open a GitHub issue on `pierreb-devkit/Vue`.
**How to determine the failure origin:**
- **Stack code failure:** error occurs in unmodified stack module files (resolved with `--theirs`)
- **Conflict resolution mistake:** error occurs in files you manually merged or in downstream-only modules
**Create the issue:**
```bash
gh issue create \
--repo pierreb-devkit/Vue \
--title "fix(scope): <short description>" \
--body "$(cat <<'BODY'
## Problem
<failing command output>
## Affected file(s)
<list>
## Steps to reproduce
<steps>
BODY
)" \
--label "Fix"
```
Proceed to Phase 2 and track the upstream fix separately — do not block downstream alignment on it.
### 3ter. Block on drift
After `/verify` passes, run a final diff sweep before starting Phase 2. Any shared non-test stack file that diverges from upstream blocks the flow. No ledger exception (user decision 2026-06-02 — drift must never happen, not be documented).
```bash
git fetch devkit-vue master --quiet
drift_found=0
while IFS= read -r f; do
# Both sides exist + differ → drift
if git cat-file -e "devkit-vue/master:$f" 2>/dev/null && git cat-file -e "HEAD:$f" 2>/dev/null; then
echo "BLOCK: drift on shared file: $f"
echo " Fix A — revert to upstream: git checkout devkit-vue/master -- $f"
echo " Fix B — promote upstream: open a devkit PR with the change, merge, /update-stack here"
echo " Fix C — relocate: move logic to a downstream-only module or src/config/defaults/<project>.config.js"
drift_found=1
# Upstream has it, local doesn't → missing-locally
elif git cat-file -e "devkit-vue/master:$f" 2>/dev/null; then
echo "BLOCK: missing locally (was on upstream): $f"
echo " Fix — restore: git checkout devkit-vue/master -- $f"
drift_found=1
fi
# Downstream-only file (not in upstream) → not drift; step 3quater checks where it lives
done < <(git diff --name-only devkit-vue/master HEAD -- src/modules src/lib src/config src/main.js index.html vite.config.js Dockerfile 2>/dev/null \
| grep -vE "/(tests|__tests__)/" | grep -vE "\.(test|spec)\.(js|jsx|ts|tsx|vue)$")
[ "$drift_found" -eq 1 ] && exit 1
echo "3ter: no drift — OK"
```
**Rules:**
- Block on ANY shared-file divergence. No "declare and skip" path — the `DOWNSTREAM_PATCHES.md` ledger model was abandoned 2026-06-02 (memory `feedback_no_dev_in_shared_modules`).
- Scan source is `git diff --name-only devkit-vue/master HEAD` (bidirectional) — catches both files that differ AND files present upstream but missing locally (deleted downstream). The previous `git ls-files` approach only saw locally-present files.
- Test files (paths containing `/tests/` or `/__tests__/`, or filenames ending `.test.{js,jsx,ts,tsx,vue}` / `.spec.{js,jsx,ts,tsx,vue}`) are excluded — downstream test adaptations are acceptable.
- E2E helpers under `src/lib/helpers/e2e/` ARE scanned — they are stack-managed. Downstream modification triggers BLOCK; use Fix B (promote upstream) if a downstream needs e2e helper changes.
- The gate also scans the root files `src/main.js`, `index.html`, `vite.config.js` and `Dockerfile`: each has an override point (see Phase 1 scope), so they stay byte-identical to upstream.
- `src/modules/app/app.router.js` stays stack-iso: downstream routes go through `registerDownstreamRoutes()` called from `src/modules/{project}/{project}.app.js`, which `main.js` imports before building the router.
- This gate runs **after** `/verify` (never blocks on transient verify failures) and **before** Phase 2 (failure is recoverable — no merge commit yet).
- Ref: the stack/downstream perfect-alignment plan, Tasks E.1 + E.2.
### 3quater. Warn on files a downstream added in stack folders
Ownership rule (`CLAUDE.md` § Downstream file ownership): inside stack folders a downstream adds only its own modules and files carrying its project name. This step **warns, it never blocks**: it always ends with exit 0, and Phase 2 starts whatever it prints.
```bash
PROJECT="<project>" # the downstream's project name, as in src/config/defaults/<project>.config.js
stack_modules=$(git ls-tree -d --name-only devkit-vue/master src/modules/ | sed 's#^src/modules/##')
stack_deleted=$(git log --no-renames --diff-filter=D --name-only --format= devkit-vue/master -- src/modules src/lib src/config | sort -u)
warn=0
while IFS= read -r f; do
git cat-file -e "devkit-vue/master:$f" 2>/dev/null && continue # stack file: step 3ter's job
if printf '%s\n' "$stack_deleted" | grep -qxF "$f"; then
echo "WARN: the stack deleted this file, it is still here: $f"
warn=1; continue
fi
case "$f" in
*/tests/*|*/__tests__/*) continue ;; # downstream test adaptations are accepted (as in 3ter)
src/modules/*/*) mod=${f#src/modules/}; mod=${mod%%/*}
printf '%s\n' "$stack_modules" | grep -qxF "$mod" || continue ;; # the project's own module
esac
case "$f" in
*."$PROJECT".*|*/"$PROJECT".*|*/"$PROJECT"/*) continue ;; # carries the project name
esac
echo "WARN: file without the project name in a stack folder: $f"
warn=1
done < <(git ls-tree -r --name-only HEAD -- src/modules src/lib src/config)
[ "$warn" -eq 1 ] && echo "3quater: warnings above — act on them in Phase 2" || echo "3quater: ownership OK"
```
`--no-renames` makes a file the stack moved count as deleted at its old path, so a leftover copy there is reported as such.
**What to do with each warning** (in Phase 2, never by reverting the merge):
- **File the stack deleted:** delete it only when it is a dead copy — nothing imports it (`grep -rn "<file basename without extension>" src`), and it is not a module a downstream router registers. Old `*.spec.js` / `*.test.js` under a stack test dir that test a deleted file go with it. A file still in use → move what it does to the project's own module first.
- **File without the project name:** generic code → upstream it to the stack (devkit PR, then `/update-stack`); project-only code → move it to the project's own module, or rename it `*.<project>.*` when it is an override.
- **Never move an existing migration file**, even when it sits in the wrong place: migrations are recorded by path, and a moved one runs again. Its warning stays on each update: that is accepted.
---
## Phase 2 — Project alignment
**Goal: project-specific modules work and match stack patterns.**
### 4. Apply MIGRATIONS.md (if present)
Read the last entries — they list breaking changes requiring updates in project modules. Apply each one to non-stack modules.
### 5. Align project modules
Diff project modules against `src/modules/tasks` (stack reference). Fix any pattern drift flagged by `ERRORS.md`.
### 6. `/verify`
---
### Red flag: drift in `src/main.js` or another root file
`src/main.js`, `index.html`, `vite.config.js` and `Dockerfile` stay byte-identical to upstream. If the merge conflicts on one of them, or the 3ter gate reports drift, do NOT keep the downstream side via `--ours`. Instead:
1. List the downstream-only lines:
```bash
git diff devkit-vue/master HEAD -- src/main.js index.html vite.config.js Dockerfile
```
2. Move each one to its override point (Phase 1 scope):
- `main.js` route registration / router patching / side-effect imports → `src/modules/{project}/{project}.app.js` (replacing `/` → `home.routes.home.activated: false` + a `/` route in `registerDownstreamRoutes({ coreModules })`).
- `index.html` icon / manifest links → `app.seo.icons`, `app.seo.manifest.enabled`.
- `vite.config.js` plugins → `src/modules/{project}/{project}.vite.js`; a docs fail-hard gate → `app.seo.docs.strict: true`.
- `Dockerfile` ARG defaults → config values, or `--build-arg` in the project's CI.
3. Take the upstream version (`git checkout devkit-vue/master -- <file>`) once the moves are committed.
Dropping a route registration this way without moving it first ships a downstream with missing routes — always move, then take upstream. MIGRATIONS.md (entry for #4876) has the step-by-step.