dev-booster 1.5.0 → 1.7.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/README.md CHANGED
@@ -23,6 +23,7 @@ Unlike generic agent folders, **Dev Booster** uses a manual, activation-first mo
23
23
  - most boosters use lazy loading instead of loading the full kit immediately
24
24
  - context is pulled only when the task, artifact, or pain point actually requires it
25
25
  - each booster has a distinct operational role, instead of behaving like a generic prompt blob
26
+ - many boosters act as continuous document generators (Artifact Engine), maintaining structured state files in the background to prevent context loss during long conversations
26
27
 
27
28
  This gives the kit a stronger product identity and helps avoid unnecessary context bloat.
28
29
 
@@ -31,20 +32,36 @@ After running the command, your project gets:
31
32
  ```
32
33
  .devbooster/
33
34
  ├── MANIFEST.md ← inventory of all agents, skills, and boosters
34
- ├── boosters/ ← 25 expert activators (debug, review, design, deploy...)
35
+ ├── boosters/ ← 26 expert activators (debug, review, design, deploy...)
35
36
  ├── hub/ ← 40+ skills and operational scripts
36
37
  └── rules/
37
38
  ├── PROTOCOL.md ← governance and conduct rules
38
39
  ├── PROJECT.md ← whitelabel → auto-fills with your architecture
39
40
  ├── FRONTEND.md ← whitelabel → auto-fills with your frontend stack
40
41
  ├── BACKEND.md ← whitelabel → auto-fills with your backend stack
41
- ├── COMERCIAL.md ← whitelabel → auto-fills with your business model
42
+ ├── COMMERCIAL.md ← whitelabel → auto-fills with your business model
42
43
  └── USER_PREFERENCES.md
43
44
  DEVBOOSTER_INIT.md ← bootstrap orchestrator (read below)
44
45
  ```
45
46
 
46
47
  ---
47
48
 
49
+ ## Safe Testing (`--dry-run`)
50
+
51
+ If you want to see exactly what Dev Booster will install or update in your project without actually making any changes, you can use the `--dry-run` flag:
52
+
53
+ ```bash
54
+ npx dev-booster --dry-run
55
+ ```
56
+ For updates:
57
+ ```bash
58
+ npx dev-booster update --dry-run
59
+ ```
60
+
61
+ This will run a full simulation of the command and print a detailed report of which files would be created, updated, or preserved, giving you complete peace of mind before executing the real installation.
62
+
63
+ ---
64
+
48
65
  ## Bootstrap: DEVBOOSTER_INIT.md
49
66
 
50
67
  After installation, open your AI assistant and say:
@@ -92,7 +109,8 @@ Boosters are expert activators you invoke manually during development.
92
109
  | `internal-documentation.md` | Internal project map with absolute paths, files, assets, scripts, and edit boundaries |
93
110
  | `discovery.md` | Product brainstorm |
94
111
  | `performance.md` | Core Web Vitals / bundle issues |
95
- | + 13 more | See `.devbooster/MANIFEST.md` |
112
+ | `code-audit.md` | Strict Code Auditor (Syntax, React Doctor) before PR |
113
+ | + 14 more | See `.devbooster/MANIFEST.md` |
96
114
 
97
115
  The practical activation flow is simple:
98
116
  - drag a booster file into the chat
@@ -106,11 +124,42 @@ Many boosters now use a two-step flow:
106
124
 
107
125
  ---
108
126
 
127
+ ## The Artifact Engine
128
+
129
+ Dev Booster operates an internal **Artifact Engine** (Shadow Memory). As boosters execute, they automatically generate and update machine-readable `.md` files in the background to track history, audits, and architectural decisions.
130
+
131
+ This creates a persistent "paper trail" that ensures the AI never loses context, even if you continue the work in a brand new chat session.
132
+
133
+ Files are systematically organized in the `@booster-generated/` root directory:
134
+ - `@booster-generated/contexts/` (Continuous save state for conversation continuity)
135
+ - `@booster-generated/plans/` (Implementation roadmaps and risk mapping)
136
+ - `@booster-generated/troubleshooting/` (Systematic RCA and bug fix logs)
137
+ - `@booster-generated/audits/` (Security, accessibility, and performance reports)
138
+
139
+ ### Manual Triggers
140
+
141
+ While the AI updates these files automatically, you can also take manual control at any time using explicit Chat Triggers:
142
+
143
+ - **`@SaveState`**: Forces the AI to instantly summarize the current conversation context and update the active booster's state file. Perfect for explicitly bookmarking complex decisions before continuing in a fresh chat.
144
+ - **`@SavePattern`**: Instructs the AI to extract a newly resolved technical rule or code pattern and persist it to `.devbooster/rules/USER_PREFERENCES.md`.
145
+ - **`@LogTask`**: Tells the AI to capture a pending technical task mentioned in the chat and document it systematically in your operational backlog at `@booster-generated/tasks.md`.
146
+
147
+ ---
148
+
109
149
  ## Smart Usage Patterns
110
150
 
111
151
  One of the main strengths of Dev Booster is that boosters can be used in sequence, not just in isolation.
112
152
 
113
- ### 1. Investigate before implementation
153
+ ### 1. Use Advisor when you are unsure
154
+
155
+ If you do not know which booster should come first:
156
+ 1. activate `advisor.md`
157
+ 2. describe the task in one message
158
+ 3. let it recommend the smallest effective booster path
159
+
160
+ The advisor recommends boosters only, keeping the path clean and focused.
161
+
162
+ ### 2. Investigate before implementation
114
163
 
115
164
  Use this when the repository is complex and you do not want the AI to jump straight into coding.
116
165
 
@@ -126,7 +175,7 @@ What this gives you:
126
175
  - the right implementation template (`simple`, `standard`, or `heavy`)
127
176
  - a stronger validation pass at the end
128
177
 
129
- ### 2. Product idea to executable plan
178
+ ### 3. Product idea to executable plan
130
179
 
131
180
  Use this when the idea is still being shaped.
132
181
 
@@ -140,7 +189,7 @@ What this gives you:
140
189
  - clarification of business rules and gaps
141
190
  - a structured path into execution only after the context is mature
142
191
 
143
- ### 3. Mature context to global technical documentation
192
+ ### 4. Mature context to global technical documentation
144
193
 
145
194
  Use this after discovery or investigation has already produced enough context.
146
195
 
@@ -155,7 +204,7 @@ What this gives you:
155
204
 
156
205
  For repository-specific internal maps with absolute paths, use `internal-documentation.md` instead of `global-documentation.md`.
157
206
 
158
- ### 4. Safe review in a fresh chat
207
+ ### 5. Safe review in a fresh chat
159
208
 
160
209
  Use this when you want a stronger validation pass with minimal prior bias.
161
210
 
@@ -169,7 +218,7 @@ What this gives you:
169
218
  - artifact-first review
170
219
  - skill/persona loading only after the review target is provided
171
220
 
172
- ### 5. Release note generation from real Git state
221
+ ### 6. Release note generation from real Git state
173
222
 
174
223
  Use this when you want changelogs based on what actually changed, not on memory.
175
224
 
@@ -186,7 +235,7 @@ What this gives you:
186
235
  - `C` = technical
187
236
  - always includes changed files and changed lines
188
237
 
189
- ### 6. Domain mode plus execution mode
238
+ ### 7. Domain mode plus execution mode
190
239
 
191
240
  Boosters can also be combined by role.
192
241
 
@@ -199,15 +248,6 @@ This works well when:
199
248
  - you know the task belongs to a domain
200
249
  - but you still want alignment and execution discipline before building
201
250
 
202
- ### 7. Use Advisor when you are unsure
203
-
204
- If you do not know which booster should come first:
205
- 1. activate `advisor.md`
206
- 2. describe the task in one message
207
- 3. let it recommend the smallest effective booster path
208
-
209
- The advisor recommends boosters only, keeping the path clean and focused.
210
-
211
251
  ---
212
252
 
213
253
  ## Requirements
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dev-booster",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "description": "Reusable AI development kit with manual boosters, governance, and project bootstrap",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -72,21 +72,27 @@ function isUpdateMode() {
72
72
  return args.includes('--update') || args.includes('update')
73
73
  }
74
74
 
75
+ function isDryRunMode() {
76
+ return args.includes('--dry-run') || args.includes('dry-run')
77
+ }
78
+
75
79
  function ensureTrailingNewline(content) {
76
80
  return content.endsWith('\n') ? content : `${content}\n`
77
81
  }
78
82
 
79
- function appendUniqueBlock(filePath, blockLines, marker) {
83
+ function appendUniqueBlock(filePath, blockLines, marker, dryRun = false) {
80
84
  const existing = fs.existsSync(filePath) ? fs.readFileSync(filePath, 'utf8') : ''
81
85
  if (existing.includes(marker)) {
82
86
  return false
83
87
  }
84
88
 
85
- const trimmedEnd = existing.replace(/\s*$/, '')
86
- const prefix = trimmedEnd.length > 0 ? `${trimmedEnd}\n\n` : ''
87
- const nextContent = `${prefix}${blockLines.join('\n')}\n`
88
- fs.mkdirSync(path.dirname(filePath), { recursive: true })
89
- fs.writeFileSync(filePath, nextContent)
89
+ if (!dryRun) {
90
+ const trimmedEnd = existing.replace(/\s*$/, '')
91
+ const prefix = trimmedEnd.length > 0 ? `${trimmedEnd}\n\n` : ''
92
+ const nextContent = `${prefix}${blockLines.join('\n')}\n`
93
+ fs.mkdirSync(path.dirname(filePath), { recursive: true })
94
+ fs.writeFileSync(filePath, nextContent)
95
+ }
90
96
  return true
91
97
  }
92
98
 
@@ -113,7 +119,7 @@ async function askYesNo(question, defaultYes = true) {
113
119
  }
114
120
  }
115
121
 
116
- async function maybeAddDevBoosterToGitignore() {
122
+ async function maybeAddDevBoosterToGitignore(dryRun) {
117
123
  const shouldIgnore = await askYesNo('Add Dev Booster to your .gitignore?', true)
118
124
 
119
125
  if (!shouldIgnore) {
@@ -123,11 +129,11 @@ async function maybeAddDevBoosterToGitignore() {
123
129
  }
124
130
 
125
131
  const gitignorePath = path.join(TARGET_DIR, '.gitignore')
126
- const changed = appendUniqueBlock(gitignorePath, GITIGNORE_BLOCK, GITIGNORE_MARKER)
132
+ const changed = appendUniqueBlock(gitignorePath, GITIGNORE_BLOCK, GITIGNORE_MARKER, dryRun)
127
133
 
128
134
  console.log('▸ .gitignore')
129
135
  if (changed) {
130
- console.log(' status: updated')
136
+ console.log(` status: ${dryRun ? 'would be updated' : 'updated'}`)
131
137
  console.log(' entries: # DEV-BOOSTER, .devbooster/, DEVBOOSTER_INIT.md\n')
132
138
  } else {
133
139
  console.log(' status: already configured')
@@ -148,28 +154,28 @@ function clearIdeBridgeFallbackFlag() {
148
154
  }
149
155
  }
150
156
 
151
- function setupIdeBridgeFiles() {
157
+ function setupIdeBridgeFiles(dryRun) {
152
158
  const touchedFiles = []
153
159
 
154
160
  for (const relativeTarget of IDE_BRIDGE_TARGETS) {
155
161
  const targetPath = path.join(TARGET_DIR, relativeTarget)
156
162
  if (!fs.existsSync(targetPath)) continue
157
163
 
158
- appendUniqueBlock(targetPath, IDE_BRIDGE_BLOCK, IDE_BRIDGE_MARKER)
159
- touchedFiles.push(relativeTarget)
164
+ const wouldChange = appendUniqueBlock(targetPath, IDE_BRIDGE_BLOCK, IDE_BRIDGE_MARKER, dryRun)
165
+ if (wouldChange) touchedFiles.push(relativeTarget)
160
166
  }
161
167
 
162
168
  console.log('▸ IDE bridge files')
163
169
  if (touchedFiles.length > 0) {
164
- clearIdeBridgeFallbackFlag()
165
- console.log(' status: bridge instructions appended where applicable')
170
+ if (!dryRun) clearIdeBridgeFallbackFlag()
171
+ console.log(` status: bridge instructions ${dryRun ? 'would be appended' : 'appended'} where applicable`)
166
172
  console.log(` files: ${touchedFiles.join(', ')}\n`)
167
173
  return
168
174
  }
169
175
 
170
- writeIdeBridgeFallbackFlag()
176
+ if (!dryRun) writeIdeBridgeFallbackFlag()
171
177
  console.log(' status: no known IDE instruction file found')
172
- console.log(' action: bootstrap fallback flag created for DEVBOOSTER_INIT.md\n')
178
+ console.log(` action: bootstrap fallback flag ${dryRun ? 'would be created' : 'created'} for DEVBOOSTER_INIT.md\n`)
173
179
  }
174
180
 
175
181
  function printHeader(subtitle) {
@@ -182,7 +188,9 @@ function printHeader(subtitle) {
182
188
  }
183
189
 
184
190
  async function runInstall() {
191
+ const dryRun = isDryRunMode()
185
192
  printHeader('agentic kit installer')
193
+ if (dryRun) console.log('🔍 [DRY RUN MODE] No real changes will be made.\n')
186
194
 
187
195
  // 1. Copy the full .devbooster/ kit to the user's project
188
196
  const agentSrc = path.join(TEMPLATE_DIR, '.devbooster')
@@ -194,9 +202,9 @@ async function runInstall() {
194
202
  console.log(' action: copy skipped to avoid overwrite')
195
203
  console.log(' tip: rename or remove the folder if you want a fresh install\n')
196
204
  } else {
197
- copyDir(agentSrc, agentDest)
205
+ if (!dryRun) copyDir(agentSrc, agentDest)
198
206
  console.log('▸ .devbooster/')
199
- console.log(' status: installed successfully\n')
207
+ console.log(` status: ${dryRun ? 'would be installed' : 'installed successfully'}\n`)
200
208
  }
201
209
 
202
210
  // 2. Drop DEVBOOSTER_INIT.md at the root of the user's project
@@ -208,13 +216,13 @@ async function runInstall() {
208
216
  console.log(' status: already exists in this project')
209
217
  console.log(' action: creation skipped\n')
210
218
  } else {
211
- fs.copyFileSync(initSrc, initDest)
219
+ if (!dryRun) fs.copyFileSync(initSrc, initDest)
212
220
  console.log('▸ DEVBOOSTER_INIT.md')
213
- console.log(' status: created at project root\n')
221
+ console.log(` status: ${dryRun ? 'would be created' : 'created'} at project root\n`)
214
222
  }
215
223
 
216
- await maybeAddDevBoosterToGitignore()
217
- setupIdeBridgeFiles()
224
+ await maybeAddDevBoosterToGitignore(dryRun)
225
+ setupIdeBridgeFiles(dryRun)
218
226
 
219
227
  console.log(`
220
228
  ╭──────────────────────────────────────────────╮
@@ -230,7 +238,9 @@ The kit will configure itself based on your project's stack.
230
238
  }
231
239
 
232
240
  function runUpdate() {
241
+ const dryRun = isDryRunMode()
233
242
  printHeader('safe kit update')
243
+ if (dryRun) console.log('🔍 [DRY RUN MODE] No real changes will be made.\n')
234
244
 
235
245
  const kitRoot = path.join(TARGET_DIR, '.devbooster')
236
246
  const templateRoot = path.join(TEMPLATE_DIR, '.devbooster')
@@ -247,16 +257,31 @@ function runUpdate() {
247
257
  { name: 'hub', src: path.join(templateRoot, 'hub'), dest: path.join(kitRoot, 'hub') },
248
258
  ]
249
259
 
260
+ const coreFiles = [
261
+ { name: 'MANIFEST.md', src: path.join(templateRoot, 'MANIFEST.md'), dest: path.join(kitRoot, 'MANIFEST.md') },
262
+ { name: 'rules/GUIDE.md', src: path.join(templateRoot, 'rules', 'GUIDE.md'), dest: path.join(kitRoot, 'rules', 'GUIDE.md') },
263
+ { name: 'rules/PROTOCOL.md', src: path.join(templateRoot, 'rules', 'PROTOCOL.md'), dest: path.join(kitRoot, 'rules', 'PROTOCOL.md') },
264
+ ]
265
+
250
266
  for (const target of updateTargets) {
251
- syncDir(target.src, target.dest)
267
+ if (!dryRun) syncDir(target.src, target.dest)
252
268
  console.log(`▸ .devbooster/${target.name}/`)
253
- console.log(' status: updated successfully')
269
+ console.log(` status: ${dryRun ? 'would be updated' : 'updated successfully'}`)
270
+ }
271
+
272
+ for (const file of coreFiles) {
273
+ if (!dryRun && fs.existsSync(file.src)) {
274
+ fs.mkdirSync(path.dirname(file.dest), { recursive: true })
275
+ fs.copyFileSync(file.src, file.dest)
276
+ }
277
+ console.log(`▸ .devbooster/${file.name}`)
278
+ console.log(` status: ${dryRun ? 'would be updated' : 'updated successfully'}`)
254
279
  }
255
280
 
256
281
  console.log('')
257
- console.log('▸ rules/')
282
+ console.log('▸ rules/ (Whitelabel files)')
258
283
  console.log(' status: preserved')
259
- console.log(' action: no local files were overwritten')
284
+ console.log(' action: user-customized rules were not overwritten')
260
285
  console.log('')
261
286
  console.log('▸ DEVBOOSTER_INIT.md')
262
287
  console.log(' status: preserved')
@@ -109,7 +109,8 @@
109
109
  | `internal-documentation.md` | Generates repository-specific internal documentation with absolute paths and file/asset maps. |
110
110
  | `atomic.md` | Surgical, single-step implementation spec (final execution stage). |
111
111
  | `advisor.md` | Hub Consultant — recommends the best booster path for the user's task. |
112
- | `review.md` | Elite Auditor — multi-agent orchestration for plan validation. |
112
+ | `review.md` | Elite Auditor — multi-agent orchestration for plan and architecture validation. |
113
+ | `code-audit.md` | Strict Code Auditor — syntax, linting, and React Doctor diagnostics for the codebase. |
113
114
  | `debug.md` | Systematic Root Cause Analysis with hypothesis engine. |
114
115
  | `discovery.md` | Strategic Product Consultant — 3-path brainstorm protocol. |
115
116
  | `investigation.md` | Context Pre-Orchestrator — no-code analysis before implementation. |
@@ -177,3 +178,24 @@ When the user asks "How can the kit help?", the Advisor MUST:
177
178
  1. Scan requirements.
178
179
  2. Recommend the best **Booster** entry point for the task.
179
180
  3. Suggest supporting boosters only when the task clearly spans multiple phases or domains.
181
+
182
+ ---
183
+
184
+ ## 📂 7. ARTIFACT ENGINE (SHADOW MEMORY)
185
+ Dev Booster acts as a continuous document generator. As boosters execute, they MUST write their history, findings, audits, and implementation plans into a structured, machine-readable format. This avoids context loss in long AI conversations and builds a tangible paper trail for the developer.
186
+
187
+ **Target Root Path:** `@booster-generated/`
188
+
189
+ ### Artifact Mapping by Domain:
190
+ - `@booster-generated/contexts/` → Managed by `context.md` (Save State for conversation continuity).
191
+ - `@booster-generated/plans/` → Managed by `planning.md` (Implementation roadmap and risk mapping).
192
+ - `@booster-generated/implementations/` → Managed by `frontend.md`, `backend.md`, `mobile.md`, `atomic.md`.
193
+ - `@booster-generated/advisory/` → Managed by `advisor.md` (Architectural decisions and mentorship notes).
194
+ - `@booster-generated/discoveries/` → Managed by `investigation.md`, `discovery.md` (Brainstorms, flow mapping).
195
+ - `@booster-generated/troubleshooting/` → Managed by `debug.md` (Root Cause Analysis and bug fixes).
196
+ - `@booster-generated/audits/` → Managed by `security.md`, `performance.md`, `accessibility.md`, `seo.md`.
197
+ - `@booster-generated/reviews/` → Managed by `review.md` (Code review feedback, React Doctor JSON diagnostics).
198
+ - `@booster-generated/changelogs/` → Managed by `changelog.md` (Release notes drafts).
199
+ - `@booster-generated/rollouts/` → Managed by `deploy.md` (Pre-flight checks and deployment history).
200
+
201
+ When a booster mandates `ARTIFACT GENERATION & STATE BACKUP`, the AI MUST respect this mapping and maintain the `.md` file continuously in the background.
@@ -65,4 +65,9 @@ Analyze the user's request or the current task and recommend only the best boost
65
65
  - Do NOT expose skills, personas, or agents in the user-facing answer.
66
66
  - Do NOT execute any plan, only advise.
67
67
 
68
+ ## ARTIFACT GENERATION & STATE BACKUP
69
+ During your execution, you MUST create or update a machine-readable state file at `@booster-generated/advisory/<slug-name>.md`.
70
+ This file must continuously track the history, decisions, rules, and outcomes related to this booster's execution in a dense, non-conversational format.
71
+ You must update this file silently in the background as the context evolves or when explicitly commanded by the user.
72
+
68
73
  **Reply:** On activation only, use the armed-mode banner above, always following the global language configured for the active LLM/environment. When the user shares an idea or task, read the manifest, classify the need, and recommend the best booster path without executing it.
@@ -0,0 +1,83 @@
1
+ # 🧹 BOOSTER: CODE AUDIT (QUALITY & SYNTAX)
2
+ You are the Strict Code Auditor. Your mission is to scan, validate, and clean the codebase syntax and project standards before it is shipped or merged.
3
+
4
+ ## 0. DEV BOOSTER ACTIVATION CONTRACT
5
+ This booster behaves as a code quality inspection mode, not as an execution or logical architecture review.
6
+
7
+ If the user invokes this booster alone, or uses it only to activate the mode:
8
+ - Do NOT start auditing immediately.
9
+ - **CRITICAL PRE-FLIGHT CHECK**: Immediately check `git diff --name-only` to see if there are uncommitted changes.
10
+ - Inform the user if the working tree has uncommitted changes or if it is clean.
11
+ - Explicitly ask: "How many commits back do you want to analyze for this audit?"
12
+ - **PAUSE EXECUTION**: You MUST wait for the user to provide a number (e.g., 0, 1, 2) before proceeding.
13
+ - The activation response must follow the global language configured for the active LLM/environment.
14
+
15
+ Use this activation response format:
16
+
17
+ ```md
18
+ ## 🤖 [DEV BOOSTER // CODE AUDIT]
19
+
20
+ [Localized mode label]: Code Audit
21
+ [Localized status label]: Awaiting Git Scope
22
+
23
+ [Localized text reporting the current git diff state]
24
+ [Localized question asking how many commits back to analyze]
25
+ ```
26
+
27
+ Formatting rules for this activation:
28
+ - `Mode` and `Status` must always be rendered on separate lines.
29
+ - Do NOT merge labels into a single sentence or paragraph.
30
+ - Keep each activation block on its own line.
31
+
32
+ Only switch to execution mode after the user provides the commit scope.
33
+
34
+ ## 1. ALLOWED INVENTORY
35
+ - **Deep Context & Local Rules (Highest Priority):**
36
+ - `.devbooster/rules/FRONTEND.md` (If applicable)
37
+ - `.devbooster/rules/BACKEND.md` (If applicable)
38
+ - `.devbooster/rules/USER_PREFERENCES.md`
39
+ - **Personas (Load based on Stack Discovery):**
40
+ - `.devbooster/hub/personas/agent_frontend-specialist.md` (If frontend stack)
41
+ - `.devbooster/hub/personas/agent_backend-specialist.md` (If backend stack)
42
+ - **Quality Skills:**
43
+ - `.devbooster/hub/personas/skill_clean-code.md`
44
+ - `.devbooster/hub/personas/skill_lint-and-validate.md`
45
+
46
+ ## 2. AUDIT PHILOSOPHY: LOCAL RULES OVERRIDE GLOBAL STANDARDS
47
+ 1. **The Dev Booster Soul:** The custom rules written in `FRONTEND.md`, `BACKEND.md`, and `USER_PREFERENCES.md` represent the developer's unique project identity. They are the absolute source of truth.
48
+ 2. **Conflict Resolution:** If generic `clean-code` or `lint` standards dictate pattern X, but the developer's local files mandate pattern Y, **Pattern Y ALWAYS wins**.
49
+ 3. **Consultative Warning:** When this override happens, do NOT mark it as an error. Instead, approve the code and add a consultative note: *"This code follows your custom architecture (Pattern Y). Note: Standard generic convention suggests X, but your local override was respected."* This ensures the developer is fully aware of architectural divergences and retains total control over the codebase style.
50
+
51
+ ## 3. PRE-FLIGHT (MANDATORY)
52
+ 1. Use repository-relative paths directly from `.devbooster/` and `.devbooster/hub/`.
53
+ 2. **STACK DISCOVERY:** Quickly read `package.json` or `PROJECT.md` to determine the project's technology stack (e.g., React, Angular, Vue, Node.js).
54
+ 3. **Run Operational Audit Scripts:**
55
+ - **Mandatory when relevant:** `security_scan.py`, `type_coverage.py`, `lint_runner.py` (if they exist).
56
+ 4. **React/Next.js Frontend Triage (3-Phase Flow):** ONLY IF the project uses React/Next.js:
57
+ - **Execute & Wait**: Run `npx -y react-doctor@latest --json --diff <scope> --yes > @booster-generated/diagnostics/<slug-name-audit>.json` synchronously. You MUST wait for the command to fully complete before moving to the next step. Do not run it in the background.
58
+ - **Timeout Safety**: If the command hangs for more than 120 seconds, manually abort it (Kill/Ctrl+C) and proceed with the rest of the audit, gracefully skipping the React Doctor step.
59
+ - **Filter (Python)**: Run `.devbooster/hub/scripts/doctor_parser.py @booster-generated/diagnostics/<slug-name-audit>.json` to process the JSON.
60
+ - **Report & Decide**: Present "Immediate Actions" (Critical errors) in detail by line. Present "Cosmetic Debt" (Style rules) as a grouped numerical summary. Append "Content extracted from diagnostics.json".
61
+ - **ZERO Auto-Fix**: Do NOT modify code automatically. Ask the user: "Do you want to fix only the critical recommendations, everything, or specific items?" and wait for authorization.
62
+
63
+ ## 4. OUTPUT STRUCTURE (MANDATORY)
64
+ Your response MUST be an **Audit Report**:
65
+
66
+ ### 🧹 Code Audit Report: [Scope]
67
+
68
+ **1. Syntax & Types (Lint/TypeScript/Framework)**
69
+ - [Findings based on the project's specific stack (React, Angular, Vue, etc.)]
70
+
71
+ **2. Specialized Diagnostics**
72
+ - *(If React)*: [React Doctor Findings (Critical Issues by Line & Cosmetic Debt Summary)]
73
+ - *(If Non-React)*: [Framework-specific standard violations or architectural anti-patterns]
74
+
75
+ **3. Action Plan**
76
+ - [Waiting for user permission to apply fixes]
77
+
78
+ ## ARTIFACT GENERATION & STATE BACKUP
79
+ During your execution, you MUST create or update a machine-readable state file at `@booster-generated/audits/<slug-name>.md`.
80
+ This file must continuously track the history, decisions, rules, and outcomes related to this booster's execution in a dense, non-conversational format.
81
+ You must update this file silently in the background as the context evolves or when explicitly commanded by the user.
82
+
83
+ **Reply:** On activation only, use the armed-mode banner above and ask for the commit scope. After the user provides the scope, load the necessary scripts, perform the audit, and answer in the global language configured for the active LLM/environment.
@@ -43,15 +43,16 @@ When the first real assimilation request arrives:
43
43
  - **NO UNSOLICITED ADVICE:** You MUST NOT suggest refactorings, point out technical debt, or critique the existing architecture/clean code patterns.
44
44
  - **ZERO CODE OUTPUT:** Your role is purely receptive and structural.
45
45
  - **MEMORIZATION ONLY:** Read the files, map their imports, trace the data flow (inputs, outputs, side effects, APIs), and store this representation in your active context memory.
46
+ - **CONTINUOUS STATE BACKUP:** During your memorization, you MUST create or update a context state file at `@booster-generated/contexts/<context-name>.md`. This file must be written in dense, machine-readable format (e.g., explicit blocks like `[CURRENT_GOAL]`, `[ACTIVE_FILES]`, `[PENDING_TASKS]`, `[DECISIONS]`) with NO conversational filler. You must continuously update this file in the background as the context evolves or when explicitly commanded.
46
47
 
47
48
  ## 3. CONFIRMATION PROTOCOL
48
- Once you have fully read, parsed, and mapped the flow of the requested files:
49
+ Once you have fully read, parsed, mapped the flow, AND updated the state backup file:
49
50
  1. Clear your output of any technical jargon, file contents, code snippets, or rules explanations.
50
51
  2. Respond with an ultra-short, highly professional 1-to-2 line acknowledgment in the user's active conversation language.
51
- 3. Confirm that the context is fully mapped and memorized.
52
+ 3. Confirm that the context is fully mapped and backed up to the file.
52
53
  4. **NO PROACTIVITY:** Do NOT ask follow-up questions, do NOT suggest next steps, and do NOT ask what to do next. Simply state that the context has been absorbed and wait silently for the user's next command.
53
54
 
54
55
  Example response:
55
- > *"Fluxo mapeado com sucesso a partir dos arquivos fornecidos. O contexto técnico está armazenado na memória."*
56
+ > *"Fluxo mapeado com sucesso. O contexto técnico está armazenado na memória e com backup ativo em `@booster-generated/contexts/<nome-do-contexto>.md`. Manterei este arquivo atualizado automaticamente conforme avançamos."*
56
57
 
57
- **Reply:** On activation only, use the armed-mode banner above. On the first real task, load the allowed explorer and archaeologist personas silently, read the requested files, map the flow internally, and reply with the non-proactive, ultra-short acknowledgment protocol.
58
+ **Reply:** On activation only, use the armed-mode banner above. On the first real task, load the allowed personas silently, read the files, create/update the context backup file, map the flow internally, and reply with the non-proactive, ultra-short acknowledgment protocol.
@@ -53,3 +53,8 @@ Your response MUST use this exact format:
53
53
  ---
54
54
 
55
55
  **Response: "Elite Debugger Mode Activated. Diagnostic tools and Hypothesis engine online. Please provide the error logs and where it's happening."**
56
+ ## ARTIFACT GENERATION & STATE BACKUP
57
+ During your execution, you MUST create or update a machine-readable state file at `@booster-generated/troubleshooting/<slug-name>.md`.
58
+ This file must continuously track the history, decisions, rules, and outcomes related to this booster's execution in a dense, non-conversational format.
59
+ You must update this file silently in the background as the context evolves or when explicitly commanded by the user.
60
+
@@ -9,3 +9,8 @@ Activating Infrastructure and Continuous Delivery Specialist.
9
9
  - `.devbooster/hub/personas/skill_server-management.md`
10
10
 
11
11
  **Reply: "Deploy & DevOps Mode Activated. Production launch or infra maintenance? What do we need to run?"**
12
+ ## ARTIFACT GENERATION & STATE BACKUP
13
+ During your execution, you MUST create or update a machine-readable state file at `@booster-generated/rollouts/<slug-name>.md`.
14
+ This file must continuously track the history, decisions, rules, and outcomes related to this booster's execution in a dense, non-conversational format.
15
+ You must update this file silently in the background as the context evolves or when explicitly commanded by the user.
16
+
@@ -72,4 +72,9 @@ After presenting the options, ask the user:
72
72
  1. Which direction aligns best with your current priority?
73
73
  2. Are there any specific constraints we should consider for the chosen path?
74
74
 
75
+ ## ARTIFACT GENERATION & STATE BACKUP
76
+ During your execution, you MUST create or update a machine-readable state file at `@booster-generated/discoveries/<slug-name>.md`.
77
+ This file must continuously track the history, decisions, rules, and outcomes related to this booster's execution in a dense, non-conversational format.
78
+ You must update this file silently in the background as the context evolves or when explicitly commanded by the user.
79
+
75
80
  **Reply:** On activation only, use the armed-mode banner above and open the conversation. After the first real idea arrives, load the minimum required discovery context and continue with the discovery flow in the global language configured for the active LLM/environment.
@@ -93,4 +93,9 @@ Organize your response as follows:
93
93
  - Initially, analyze ONLY the `package.json` to understand the project structure and stack.
94
94
  - Do NOT be proactive in execution. Your goal is certainty and lack of ambiguity.
95
95
 
96
+ ## ARTIFACT GENERATION & STATE BACKUP
97
+ During your execution, you MUST create or update a machine-readable state file at `@booster-generated/discoveries/<slug-name>.md`.
98
+ This file must continuously track the history, decisions, rules, and outcomes related to this booster's execution in a dense, non-conversational format.
99
+ You must update this file silently in the background as the context evolves or when explicitly commanded by the user.
100
+
96
101
  **Reply:** On activation only, use the armed-mode banner above with a professional investigation opening. After the first real request arrives, load the minimum required investigation context and continue in the global language configured for the active LLM/environment.
@@ -89,4 +89,9 @@ On activation only:
89
89
 
90
90
  Only after the user confirms should this booster continue the alignment process and determine whether the task is ready for implementation.
91
91
 
92
+ ## ARTIFACT GENERATION & STATE BACKUP
93
+ During your execution, you MUST create or update a machine-readable state file at `@booster-generated/plans/<slug-name>.md`.
94
+ This file must continuously track the history, decisions, rules, and outcomes related to this booster's execution in a dense, non-conversational format.
95
+ You must update this file silently in the background as the context evolves or when explicitly commanded by the user.
96
+
92
97
  **Reply:** On activation only, review the current conversation context, summarize what is already defined, identify risks and gaps, and ask whether the user wants to proceed with planner alignment. Do not emit the final readiness verdict until the user confirms. Always answer in the global language configured for the active LLM/environment.
@@ -8,7 +8,6 @@ If the user invokes this booster alone, or uses it only to activate the mode:
8
8
  - Do NOT start the review immediately.
9
9
  - Do NOT load personas, skills, or scripts yet.
10
10
  - Do NOT assume the review target is already available in the conversation.
11
- - Ask the user to provide or reference the documentation or implementation to be reviewed.
12
11
  - The activation response must follow the global language configured for the active LLM/environment.
13
12
 
14
13
  Use this activation response format:
@@ -57,4 +57,9 @@ Rules:
57
57
  - `.devbooster/hub/skills/vulnerability-scanner/SKILL.md`
58
58
  - `.devbooster/hub/skills/red-team-tactics/SKILL.md`
59
59
 
60
+ ## ARTIFACT GENERATION & STATE BACKUP
61
+ During your execution, you MUST create or update a machine-readable state file at `@booster-generated/audits/<slug-name>.md`.
62
+ This file must continuously track the history, decisions, rules, and outcomes related to this booster's execution in a dense, non-conversational format.
63
+ You must update this file silently in the background as the context evolves or when explicitly commanded by the user.
64
+
60
65
  **Reply:** On activation only, use the armed-mode banner above. On the first real task, load the minimum required security context based on the user's pain, then execute.
@@ -0,0 +1,77 @@
1
+ import json
2
+ import sys
3
+ import os
4
+ from collections import defaultdict
5
+
6
+ def parse_diagnostics(file_path):
7
+ if not os.path.exists(file_path):
8
+ print(f"Relatório não encontrado em {file_path}.")
9
+ return
10
+
11
+ try:
12
+ with open(file_path, 'r', encoding='utf-8') as f:
13
+ data = json.load(f)
14
+ except Exception as e:
15
+ print(f"Erro ao ler JSON: {e}")
16
+ return
17
+
18
+ # O React Doctor pode colocar 'diagnostics' na raiz ou dentro de 'projects'
19
+ diagnostics = data.get('diagnostics', [])
20
+ if not diagnostics and 'projects' in data and len(data['projects']) > 0:
21
+ diagnostics = data['projects'][0].get('diagnostics', [])
22
+
23
+ if not diagnostics:
24
+ print("Nenhum erro encontrado no relatório. Árvore limpa!")
25
+ return
26
+
27
+ # Categorias consideradas essenciais para o funcionamento/performance
28
+ CRITICAL_CATEGORIES = {"Correctness", "Performance", "Security", "Next.js", "Bundle Size"}
29
+
30
+ # Regras que são puramente estéticas/opcionais (mesmo que caiam em Architecture)
31
+ COSMETIC_RULES_PREFIXES = ("design-", "no-pure-black-")
32
+
33
+ critical_items = defaultdict(list)
34
+ cosmetic_counts = defaultdict(int)
35
+
36
+ for diag in diagnostics:
37
+ rule = diag.get('rule', 'unknown')
38
+ category = diag.get('category', 'Unknown')
39
+ severity = diag.get('severity', 'warning')
40
+
41
+ is_cosmetic = any(rule.startswith(prefix) for prefix in COSMETIC_RULES_PREFIXES)
42
+
43
+ # Se for error de verdade ou uma categoria crítica (e não for puramente cosmético)
44
+ if (severity == 'error' or category in CRITICAL_CATEGORIES) and not is_cosmetic:
45
+ filepath = diag.get('filePath', 'unknown file')
46
+ critical_items[filepath].append(diag)
47
+ else:
48
+ # Tudo o resto entra no débito de padronização
49
+ cosmetic_counts[rule] += 1
50
+
51
+ # === GERAÇÃO DO RELATÓRIO MOLDADO ===
52
+
53
+ print("### 🔴 AÇÃO IMEDIATA (Erros Críticos)")
54
+ if not critical_items:
55
+ print("Nenhum erro crítico de performance ou lógica encontrado nas alterações.\n")
56
+ else:
57
+ for filepath, issues in critical_items.items():
58
+ print(f"**{filepath}**")
59
+ for issue in issues:
60
+ line = issue.get('line', '?')
61
+ rule = issue.get('rule', '')
62
+ msg = issue.get('message', '')
63
+ print(f"- `[Linha {line}] {rule}`: {msg}")
64
+ print("")
65
+
66
+ print("### 🎨 DÉBITO DE PADRONIZAÇÃO (Cosmético/Opcional)")
67
+ if not cosmetic_counts:
68
+ print("Nenhum débito cosmético pendente.")
69
+ else:
70
+ for rule, count in sorted(cosmetic_counts.items(), key=lambda x: x[1], reverse=True):
71
+ print(f"- `{rule}`: {count} ocorrência(s)")
72
+
73
+ print("\n*Rodapé: Conteúdo extraído do relatório gerado diagnostics.json*")
74
+
75
+ if __name__ == "__main__":
76
+ target_file = sys.argv[1] if len(sys.argv) > 1 else "@booster-generated/diagnostics/review.json"
77
+ parse_diagnostics(target_file)