From 1b31040acdacc3e5566925eef9f8d885ab6f82f5 Mon Sep 17 00:00:00 2001 From: Elber Domingos Date: Sun, 16 Aug 2026 21:37:02 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20guard=20do=20/onboarding=20invertido=20(?= =?UTF-8?q?project-mode=20s=C3=B3=20diz=20brownfield=20ap=C3=B3s=20o=20abs?= =?UTF-8?q?orb)=20+=20rotas=20de=20sistema=20nunca=20onboardado=20apontam?= =?UTF-8?q?=20/onboarding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- pi-templates/.pi/prompts/feature.md | 2 +- pi-templates/.pi/prompts/guide.md | 3 ++- pi-templates/.pi/prompts/idea.md | 3 ++- pi-templates/.pi/prompts/onboarding.md | 15 +++++++++++---- src/lib/stack.js | 2 +- src/steps/stack.js | 2 +- 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/pi-templates/.pi/prompts/feature.md b/pi-templates/.pi/prompts/feature.md index 77822aa..389dff3 100644 --- a/pi-templates/.pi/prompts/feature.md +++ b/pi-templates/.pi/prompts/feature.md @@ -4,7 +4,7 @@ argument-hint: "\"what you want to build\"" --- Read `.pi/skills/fia/SKILL.md`. Prerequisite: `ai-docs/map.yaml` — if it doesn't exist (existing system not yet absorbed), stop and ask me to run -/absorb first. +/onboarding first (or /absorb alone for just the map). Request: $@ diff --git a/pi-templates/.pi/prompts/guide.md b/pi-templates/.pi/prompts/guide.md index ba56606..be5c744 100644 --- a/pi-templates/.pi/prompts/guide.md +++ b/pi-templates/.pi/prompts/guide.md @@ -20,7 +20,8 @@ there does not exist for you). Then orient me. My goal, if I already gave one: $ mostly done or my goal is going live. 5. The one thing the scripts cannot see (code cannot tell a starter from a product): a real hand-built application that `ai-docs/` never absorbed → - the route starts with `/absorb`, before anything else. + the route starts with `/onboarding` (the guided `/absorb` → `/stack` → + `/kit` pass), before anything else. **Step 1 — ONE question.** Tell me where I stand in two lines, citing the scripts' evidence — then ask my goal with your recommendation embedded ("My diff --git a/pi-templates/.pi/prompts/idea.md b/pi-templates/.pi/prompts/idea.md index a99f395..10fc500 100644 --- a/pi-templates/.pi/prompts/idea.md +++ b/pi-templates/.pi/prompts/idea.md @@ -15,7 +15,8 @@ full of `{{placeholders}}` do NOT make a project brownfield; it already knows): full interview and rewrite the PRD (git + decision logs keep the old version). - `brownfield` → **Module mode** (below). - In greenfield/ideation, if the code holds a real application that `ai-docs/` - never absorbed (not the installer's starter), stop and suggest `/absorb` first. + never absorbed (not the installer's starter), stop and suggest `/onboarding` + first (the guided `/absorb` → `/stack` → `/kit` pass). Interview rules (follow them to the letter): diff --git a/pi-templates/.pi/prompts/onboarding.md b/pi-templates/.pi/prompts/onboarding.md index e64ca82..b98bec6 100644 --- a/pi-templates/.pi/prompts/onboarding.md +++ b/pi-templates/.pi/prompts/onboarding.md @@ -12,10 +12,17 @@ here (the only exception is /kit's `/ui-components` page, per its own prompt). Focus/flags (optional; the focus goes to the /absorb stage): $@ 0. **Guard + resume rail + announce** — run - `node imp/scripts/project-mode.mjs --json` and trust it. Not `brownfield` - → stop: there is nothing to absorb; route in one line — no PRD yet → - /idea (discover the product), PRD exists but nothing built → /grill then - /map. Brownfield → the tour keeps a resume rail in the decision log + `node imp/scripts/project-mode.mjs --json` for the evidence, then decide + the entry question YOURSELF — by design the script leaves it to you (a + fresh install on a real app still reports `greenfield`: code cannot tell + a starter from a product). Does this folder hold a REAL application + (hand-built code, not the installer's starter)? + - No real app → stop: there is nothing to absorb; route in one line — no + real PRD → /idea (discover the product), real PRD but nothing built → + /grill then /map. + - Real app → proceed (`brownfield` — already absorbed — is fine too: the + stages detect existing artifacts and offer to skip). + The tour keeps a resume rail in the decision log (cookbook `.pi/skills/fia/cookbooks/decision-log.md`): - `node imp/scripts/decision-log.mjs latest onboarding --json` FIRST. An `open` log = an interrupted tour: read its stage notes, confirm the diff --git a/src/lib/stack.js b/src/lib/stack.js index 1a7847c..ba76f00 100644 --- a/src/lib/stack.js +++ b/src/lib/stack.js @@ -163,7 +163,7 @@ const SOURCE_LABEL = { template: 'ready-made template (IAI recommended stack)', custom: 'stack assembled in the installer', discover: 'to be decided — talk to Pi (/idea extracts PRD + stack)', - brownfield: 'existing project — run /absorb so the system maps the real stack', + brownfield: 'existing project — run /onboarding (or /absorb) so the system maps the real stack', }; /** diff --git a/src/steps/stack.js b/src/steps/stack.js index 1110c71..62dee05 100644 --- a/src/steps/stack.js +++ b/src/steps/stack.js @@ -31,7 +31,7 @@ export async function collectStack(ctx) { } if (ctx.stackPath === 'brownfield') { ctx.stack = { ...applyStackRules({}), source: 'brownfield' }; - ui.info('Existing project: /absorb will map the real stack and fill in ai-docs/stack.md.'); + ui.info('Existing project: /onboarding (its /absorb stage) will map the real stack and fill in ai-docs/stack.md.'); return; } if (ctx.stackPath === 'discover') {