@jaimevalasek/aioson 1.17.2 → 1.17.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jaimevalasek/aioson",
3
- "version": "1.17.2",
3
+ "version": "1.17.3",
4
4
  "description": "AI operating framework for hyper-personalized software.",
5
5
  "keywords": [
6
6
  "ai",
@@ -46,6 +46,8 @@
46
46
  "ci": "npm run lint && npm test"
47
47
  },
48
48
  "dependencies": {
49
- "better-sqlite3": "^12.6.2"
49
+ "archiver": "^8.0.0",
50
+ "better-sqlite3": "^12.6.2",
51
+ "terser": "^5.48.0"
50
52
  }
51
53
  }
@@ -6,6 +6,33 @@ const { exists, ensureDir } = require('../utils');
6
6
  const { readConfig } = require('./config');
7
7
  const { readWorkspace, findProjectRoot } = require('./workspace');
8
8
 
9
+ let _terser = null;
10
+ function getTerser() {
11
+ if (!_terser) _terser = require('terser');
12
+ return _terser;
13
+ }
14
+
15
+ async function createZipBuffer(files) {
16
+ const archiver = require('archiver');
17
+ const { PassThrough } = require('stream');
18
+ return new Promise((resolve, reject) => {
19
+ const chunks = [];
20
+ const stream = new PassThrough();
21
+ stream.on('data', (chunk) => chunks.push(chunk));
22
+ stream.on('end', () => resolve(Buffer.concat(chunks)));
23
+ stream.on('error', reject);
24
+
25
+ const archive = archiver('zip', { zlib: { level: 9 } });
26
+ archive.on('error', reject);
27
+ archive.pipe(stream);
28
+
29
+ for (const [relPath, content] of Object.entries(files)) {
30
+ archive.append(content, { name: relPath });
31
+ }
32
+ archive.finalize();
33
+ });
34
+ }
35
+
9
36
  const DEFAULT_BASE_URL = 'https://aioson.com';
10
37
  const SYSTEM_PACKAGES_DIR = '.aioson/system-packages';
11
38
  const BACKUPS_DIR = '.aioson/.backups';
@@ -25,6 +52,17 @@ const SYSTEM_ALLOWED_EXTS = new Set([
25
52
  '.gitignore',
26
53
  ]);
27
54
 
55
+ const SYSTEM_BUILD_ALLOWED_EXTS = new Set([
56
+ '.js', '.jsx', '.mjs', '.cjs',
57
+ '.json', '.jsonc',
58
+ '.css',
59
+ '.html',
60
+ '.svg', '.ico',
61
+ '.sql',
62
+ '.yaml', '.yml',
63
+ '.prisma',
64
+ ]);
65
+
28
66
  // Dirs/files to skip when collecting sources
29
67
  const SKIP_DIRS = new Set([
30
68
  'node_modules', '.git', 'dist', 'build', '.turbo', '.next',
@@ -33,13 +71,21 @@ const SKIP_DIRS = new Set([
33
71
  '.aioson', '.claude', '.gemini', '.codex', 'researchs',
34
72
  ]);
35
73
 
74
+ const SKIP_DIRS_BUILD = new Set([
75
+ 'node_modules', '.git', '.turbo', '.next',
76
+ '.cache', 'coverage', '.nyc_output',
77
+ 'src', 'dashboard/src',
78
+ '.aioson', '.claude', '.gemini', '.codex', 'researchs',
79
+ ]);
80
+
36
81
  const SKIP_FILES = new Set([
37
82
  'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml',
38
83
  'bun.lockb',
39
84
  ]);
40
85
 
41
- const MAX_FILE_BYTES = 512 * 1024; // 512 KB per file
42
- const MAX_PACKAGE_BYTES = 20 * 1024 * 1024; // 20 MB total
86
+ const MAX_FILE_BYTES = 512 * 1024; // 512 KB per file (source)
87
+ const MAX_FILE_BYTES_BUILD = 2 * 1024 * 1024; // 2 MB per file (compiled bundles)
88
+ const MAX_PACKAGE_BYTES = 20 * 1024 * 1024; // 20 MB total
43
89
 
44
90
  /**
45
91
  * Parseia lista de emails autorizados a partir de:
@@ -114,15 +160,18 @@ async function storeGet(url, token) {
114
160
  * Collect all eligible source files under `dir`.
115
161
  * Returns { relativePath: content } — only text files with allowed extensions.
116
162
  */
117
- async function collectSystemFiles(dir) {
163
+ async function collectSystemFiles(dir, { buildMode = false } = {}) {
118
164
  const files = {};
119
165
  let totalBytes = 0;
120
166
  const errors = [];
167
+ const skipDirs = buildMode ? SKIP_DIRS_BUILD : SKIP_DIRS;
168
+ const allowedExts = buildMode ? SYSTEM_BUILD_ALLOWED_EXTS : SYSTEM_ALLOWED_EXTS;
121
169
 
122
170
  async function walk(current, rel) {
123
171
  const entries = await fs.readdir(current, { withFileTypes: true });
124
172
  for (const entry of entries) {
125
- if (SKIP_DIRS.has(entry.name)) continue;
173
+ if (skipDirs.has(entry.name)) continue;
174
+ if (rel && skipDirs.has(`${rel}/${entry.name}`)) continue;
126
175
  if (SKIP_FILES.has(entry.name)) continue;
127
176
 
128
177
  const fullPath = path.join(current, entry.name);
@@ -137,12 +186,12 @@ async function collectSystemFiles(dir) {
137
186
  ? `.${entry.name.split('.').pop().toLowerCase()}`
138
187
  : '';
139
188
 
140
- // Allow dotfiles with no extension (like .gitignore) that match skip list check
141
- if (!SYSTEM_ALLOWED_EXTS.has(ext) && ext !== '') continue;
189
+ if (!allowedExts.has(ext) && ext !== '') continue;
142
190
 
143
191
  try {
144
192
  const stat = await fs.stat(fullPath);
145
- if (stat.size > MAX_FILE_BYTES) {
193
+ const maxBytes = buildMode ? MAX_FILE_BYTES_BUILD : MAX_FILE_BYTES;
194
+ if (stat.size > maxBytes) {
146
195
  errors.push(`File too large (skipped): "${relPath}" (${(stat.size / 1024).toFixed(0)} KB)`);
147
196
  continue;
148
197
  }
@@ -151,7 +200,25 @@ async function collectSystemFiles(dir) {
151
200
  errors.push(`Package exceeds ${MAX_PACKAGE_BYTES / 1024 / 1024} MB limit — stop collecting.`);
152
201
  return;
153
202
  }
154
- const content = await fs.readFile(fullPath, 'utf8');
203
+ let content = await fs.readFile(fullPath, 'utf8');
204
+
205
+ if (buildMode && (ext === '.js' || ext === '.mjs' || ext === '.cjs')) {
206
+ try {
207
+ const terser = getTerser();
208
+ const result = await terser.minify(content, {
209
+ compress: { passes: 2, drop_console: false },
210
+ mangle: {
211
+ toplevel: true,
212
+ properties: { regex: /^_/ },
213
+ },
214
+ format: { comments: false },
215
+ });
216
+ if (result.code) content = result.code;
217
+ } catch {
218
+ // terser failed on this file — keep original compiled JS
219
+ }
220
+ }
221
+
155
222
  files[relPath] = content;
156
223
  } catch {
157
224
  // binary or unreadable — skip silently
@@ -231,13 +298,27 @@ async function runSystemPublish({ args, options, logger, t }) {
231
298
  const config = await readConfig();
232
299
  const token = requireToken(config, t);
233
300
  const dir = path.resolve(process.cwd(), args[0] || '.');
301
+ const buildMode = Boolean(options.build);
234
302
 
235
303
  logger.log(t('system.publish_reading_manifest'));
236
304
  const manifest = await readSystemJson(dir, t);
237
305
  logger.log(t('system.package_manifest_ok', { slug: manifest.slug, version: manifest.version, name: manifest.name }));
238
306
 
239
- logger.log(t('system.package_collecting_files'));
240
- const { files, totalBytes, errors } = await collectSystemFiles(dir);
307
+ if (buildMode) {
308
+ const buildCmd = manifest.build_command || 'npm run build';
309
+ logger.log(`Building: ${buildCmd}`);
310
+ const { execSync } = require('child_process');
311
+ try {
312
+ execSync(buildCmd, { cwd: dir, stdio: 'inherit', timeout: 300_000 });
313
+ } catch (e) {
314
+ throw new Error(`Build failed: ${e.message}`);
315
+ }
316
+ logger.log('Build complete. Collecting compiled output (source excluded)...');
317
+ } else {
318
+ logger.log(t('system.package_collecting_files'));
319
+ }
320
+
321
+ const { files, totalBytes, errors } = await collectSystemFiles(dir, { buildMode });
241
322
 
242
323
  if (errors.length > 0) {
243
324
  for (const e of errors) logger.log(` [WARN] ${e}`);
@@ -268,13 +349,20 @@ async function runSystemPublish({ args, options, logger, t }) {
268
349
  return { ok: true, dryRun: true, manifest, fileCount, totalBytes, visibility, authorizedEmails };
269
350
  }
270
351
 
352
+ logger.log('Creating ZIP package...');
353
+ const zipBuffer = await createZipBuffer(files);
354
+ const zipBase64 = zipBuffer.toString('base64');
355
+ const zipKb = (zipBuffer.length / 1024).toFixed(1);
356
+ logger.log(`ZIP: ${zipKb} KB (${fileCount} files)`);
357
+
271
358
  logger.log(t('system.publish_sending'));
272
359
  const baseUrl = resolveBaseUrl(config);
273
360
  const response = await storePost(`${baseUrl}/api/store/systems/publish`, {
274
361
  kind: 'aioson.store.system',
275
362
  slug: manifest.slug,
276
363
  version: manifest.version,
277
- files,
364
+ zipBase64,
365
+ files: buildMode ? undefined : files,
278
366
  manifest,
279
367
  visibility,
280
368
  paid,
@@ -283,7 +371,7 @@ async function runSystemPublish({ args, options, logger, t }) {
283
371
  }, token);
284
372
 
285
373
  logger.log(t('system.publish_done', { slug: manifest.slug, url: `${baseUrl}/store/systems/${manifest.slug}` }));
286
- logger.log(t('system.publish_summary', { files: fileCount, kb: (totalBytes / 1024).toFixed(1) }));
374
+ logger.log(t('system.publish_summary', { files: fileCount, kb: zipKb }));
287
375
  return { ok: true, manifest, fileCount, totalBytes, visibility, paid, response };
288
376
  }
289
377
 
@@ -331,7 +331,7 @@ Generate `.aioson/context/discovery.md` with the following sections:
331
331
 
332
332
  ## Dev handoff producer
333
333
 
334
- Before the final `agent:done` call, when the next agent in the workflow is `@dev`, produce `dev-state.md` so the next `/dev` session auto-resumes on cold start instead of pinging the user for context:
334
+ Before the final `agent:done` call, when the next agent in the workflow is `@dev`, produce `dev-state.md` so the next `/aioson:agent:dev` session auto-resumes on cold start instead of pinging the user for context:
335
335
 
336
336
  ```bash
337
337
  aioson dev:state:write . --feature={slug} --phase=1 \
@@ -66,6 +66,7 @@ After the user selects which plans to use:
66
66
  - Read each selected `plans/*.md` file fully.
67
67
  - Read `project.context.md` for project context.
68
68
  - Scan `.aioson/context/` for existing PRDs (`prd*.md`) — load titles/summaries only to avoid duplicating committed work.
69
+ - Also read `.aioson/context/done/MANIFEST.md` if present — it lists delivered (archived) features so you can dedupe against completed work without globbing the archive. Do NOT load the archived files themselves unless the user explicitly requests history.
69
70
 
70
71
  **2. Enrich**
71
72
 
@@ -229,6 +230,7 @@ Always register additional files with a note at the bottom of `briefings.md`:
229
230
  - **Never approve a briefing automatically** — approval requires explicit user action via CLI.
230
231
  - **Never overwrite an existing briefing** without confirming with the user first.
231
232
  - **Slug must be confirmed** by the user before any file is written.
233
+ - **Never recommend `@sheldon` (or any post-PRD agent) as the next step.** The only handoff from `@briefing` is `@product`. If the briefing surfaces a need for `@sheldon` / `@architect` / `@analyst` expertise, record that need inside the briefing (Risks / Open questions) as a *recommendation for `@product`'s enrichment phase*. `@product` decides when to invoke specialists after the PRD exists. See `briefing-craft.md` §1 "Mitigating weak markers" for examples.
232
234
  - Use `interaction_language` (fallback: `conversation_language`) from `project.context.md` for all interaction and output.
233
235
 
234
236
  ## Responsibility boundary
@@ -259,6 +261,6 @@ Always register additional files with a note at the bottom of `briefings.md`:
259
261
  ```bash
260
262
  aioson briefing:approve # mark as approved
261
263
  ```
262
- Then: activate `/product` — it will detect the approved briefing automatically.
264
+ Then: activate `/aioson:agent:product` — it will detect the approved briefing automatically.
263
265
  > Recommended: `/clear` first — fresh context window
264
266
  ---
@@ -25,7 +25,7 @@ understood, eliminates objections, and drives one clear action.
25
25
  ## When to activate
26
26
 
27
27
  @copywriter can be invoked:
28
- - **Standalone:** `/copywriter` or `@copywriter <context>` — write copy for a page, campaign, or feature
28
+ - **Standalone:** `/aioson:agent:copywriter` or `@copywriter <context>` — write copy for a page, campaign, or feature
29
29
  - **From @ux-ui:** automatically when `project_type=site` and copy is missing (copy gate)
30
30
  - **From @squad:** squad executors can route copy requests here
31
31
  - **From @squad executor:** a copywriter squad executor is a specialization of this agent
@@ -34,7 +34,7 @@ Use output to orient; load listed `rules`/`design_governance` before structural
34
34
 
35
35
  **Step 0.1 — Bootstrap gate (Living Memory):** read `aioson memory:status .` output. If `Bootstrap < 4/4` or the bootstrap files are older than 30 days, emit a warning at the top of your response:
36
36
 
37
- > ⚠ [bootstrap] coverage <N>/4 (or stale <D>d). Run `/discover` (or `aioson memory:refresh`) before continuing on broad work.
37
+ > ⚠ [bootstrap] coverage <N>/4 (or stale <D>d). Run `/aioson:agent:discover` (or `aioson memory:refresh`) before continuing on broad work.
38
38
 
39
39
  This is advisory — proceed with the user's task, but the warning surfaces the gap so the next session can fix it. Skip when bootstrap/ does not exist (greenfield).
40
40
 
@@ -264,7 +264,7 @@ Run `aioson` CLI yourself to keep the workflow moving:
264
264
 
265
265
  ## Auto-cycle return to @qa (corrections mode)
266
266
 
267
- If `.aioson/runtime/qa-dev-cycle.json` exists and its `slug` matches the active feature, you're in an auto-correction cycle started by `@qa`. After applying the plan in `last_plan` and tests pass: (1) update dossier + spec, (2) mark plan `status: resolved`, (3) auto-invoke `Skill(aioson:qa)` with `"re-verify after applying <plan path>"`. No user prompt — Ctrl+C interrupts. If the file is absent or slug differs, manual handoff as before.
267
+ If `.aioson/runtime/qa-dev-cycle.json` exists and its `slug` matches the active feature, you're in an auto-correction cycle started by `@qa`. After applying the plan in `last_plan` and tests pass: (1) update dossier + spec, (2) mark plan `status: resolved`, (3) auto-invoke `Skill(aioson:agent:qa)` with `"re-verify after applying <plan path>"`. No user prompt — Ctrl+C interrupts. If the file is absent or slug differs, manual handoff as before.
268
268
 
269
269
  ## Security findings consumption
270
270
 
@@ -7,14 +7,14 @@ Act as the continuity-first pair programming agent for AIOSON. Your codename is
7
7
 
8
8
  **Bootstrap gate (Living Memory) — MANDATORY first action:**
9
9
 
10
- Before any other action on `/deyvin` activation, check Living Memory coverage:
10
+ Before any other action on `/aioson:agent:deyvin` activation, check Living Memory coverage:
11
11
 
12
12
  1. **If `aioson` CLI is available**: run `aioson memory:status .` and read the output.
13
13
  2. **If `aioson` CLI is not available**: read `.aioson/context/bootstrap/*.md` directly via filesystem. Count present files (max 4: `what-is.md`, `what-it-does.md`, `how-it-works.md`, `current-state.md`) and the oldest modification date.
14
14
 
15
15
  If `Bootstrap < 4/4` OR files are older than 30 days, prefix your first reply with:
16
16
 
17
- > ⚠ [bootstrap] coverage <N>/4 (or stale <D>d). Recommend `/discover` (or `aioson memory:refresh`) before broad work.
17
+ > ⚠ [bootstrap] coverage <N>/4 (or stale <D>d). Recommend `/aioson:agent:discover` (or `aioson memory:refresh`) before broad work.
18
18
 
19
19
  This is advisory — continue with the user's task. Skip the gate only when `.aioson/context/bootstrap/` does not exist (greenfield project).
20
20
 
@@ -110,14 +110,14 @@ Apply this table deterministically after reading the user's request and consulti
110
110
  | Small slice of well-bounded code change; code already partially understood | Handle here (pair execution) |
111
111
  | Bug fix with failing test attached, or clear error message + reproducer | Handle here via `debugging-escalation.md` |
112
112
  | Diagnosis ambiguous; needs survey of >5 files or tracing a runtime flow | **Spawn sub-task scout** via `aioson scout:prep` (or CLI-less fallback — see "Sub-task scout invocation" below) |
113
- | New feature, new module, or cross-product surface | Handoff `/product` |
114
- | Decision affects multiple modules / system-wide architecture | Handoff `/architect` |
115
- | Missing domain rules, entities, or brownfield knowledge gap | Handoff `/analyst` |
116
- | PRD exists for the feature but is thin / sized wrong | Handoff `/sheldon` |
117
- | Visual direction unclear or UI system not defined | Handoff `/ux-ui` |
118
- | Vague scope, unclear readiness, contradictions | Handoff `/discovery-design-doc` |
119
- | Larger structured implementation batch that no longer fits pair conversation | Handoff `/dev` |
120
- | Formal QA / risk review or test pass requested | Handoff `/qa` |
113
+ | New feature, new module, or cross-product surface | Handoff `/aioson:agent:product` |
114
+ | Decision affects multiple modules / system-wide architecture | Handoff `/aioson:agent:architect` |
115
+ | Missing domain rules, entities, or brownfield knowledge gap | Handoff `/aioson:agent:analyst` |
116
+ | PRD exists for the feature but is thin / sized wrong | Handoff `/aioson:agent:sheldon` |
117
+ | Visual direction unclear or UI system not defined | Handoff `/aioson:agent:ux-ui` |
118
+ | Vague scope, unclear readiness, contradictions | Handoff `/aioson:agent:discovery-design-doc` |
119
+ | Larger structured implementation batch that no longer fits pair conversation | Handoff `/aioson:agent:dev` |
120
+ | Formal QA / risk review or test pass requested | Handoff `/aioson:agent:qa` |
121
121
 
122
122
  **Tie-breakers when two rows apply:**
123
123
  1. If the request is ambiguous, escalate (handoff) instead of handling.
@@ -136,7 +136,7 @@ When the rubric routes here ("Diagnosis ambiguous; needs survey of >5 files or t
136
136
  - **Claude Code**: Agent tool with `tools: [Read, Grep]`, `disallowedTools: [Bash, Edit, Write]`, `prompt = <returned string>`. Sub-agent writes JSON to the returned `output_path`.
137
137
  - **Codex MultiAgentV2**: spawn subagent with the prompt; collect JSON from `output_path`.
138
138
  - **Other harnesses lacking isolated sub-agent**: use the CLI-less fallback below.
139
- 4. `aioson scout:validate . --json --input=<output_path>`. On `schema_invalid`, re-prompt the sub-agent with `error.details`. On `retry_exhausted`, surface to user and offer manual `/architect` or `/dev` handoff.
139
+ 4. `aioson scout:validate . --json --input=<output_path>`. On `schema_invalid`, re-prompt the sub-agent with `error.details`. On `retry_exhausted`, surface to user and offer manual `/aioson:agent:architect` or `/aioson:agent:dev` handoff.
140
140
  5. `aioson scout:commit . --json --input=<output_path>` — telemetry emitted, cap counter decremented.
141
141
  6. Read `findings`/`recommendation` from the persisted JSON; fold into your reply. Parent context grew ~500 tokens (the report) instead of 5000+ (the surveyed files).
142
142
 
@@ -172,7 +172,7 @@ Dispatch via harness sub-agent with the tool whitelist `[Read, Grep]`. Read the
172
172
 
173
173
  ### Cap discipline (both paths)
174
174
 
175
- - Default: max **3 scouts per parent session**. If you've dispatched 3 and still need more, the rubric's next row applies — handoff to `/architect`.
175
+ - Default: max **3 scouts per parent session**. If you've dispatched 3 and still need more, the rubric's next row applies — handoff to `/aioson:agent:architect`.
176
176
  - Default: max **20 files per scout scope**. If a survey naturally needs more, split into two scouts with disjoint scopes.
177
177
  - Defaults are tunable in `.aioson/config/scout-engine.json`.
178
178
 
@@ -77,7 +77,7 @@ Check these in order. Stop at the first failure:
77
77
  | Features archived | `.aioson/context/done/MANIFEST.md` | If present, note delivered features summary — do NOT load the archived files unless the user explicitly requests history |
78
78
  | Bootstrap (Living Memory) | `.aioson/context/bootstrap/{what-is,what-it-does,how-it-works,current-state}.md` | If `memory:status` coverage `<4/4` or files older than 30d → flag `needs_discover`. Read `what-is.md` to enrich the project identity line. |
79
79
  | Feature dossier | `.aioson/context/features/{slug}/dossier.md` per active feature | Read Why/What + Agent Trail tail. If absent for SMALL/MEDIUM → flag `needs_dossier_init`. |
80
- | Harness contract | `.aioson/plans/{slug}/{harness-contract,progress}.json` per active feature | Check `progress.status`: `waiting_validation` → `/validator`; `circuit_open` → surface `last_error` + block; `ready_for_done_gate=true` → `/qa` → close. |
80
+ | Harness contract | `.aioson/plans/{slug}/{harness-contract,progress}.json` per active feature | Check `progress.status`: `waiting_validation` → `/aioson:agent:validator`; `circuit_open` → surface `last_error` + block; `ready_for_done_gate=true` → `/aioson:agent:qa` → close. |
81
81
  | Brains (procedural) | `.aioson/brains/_index.json` | Confirm presence + count + tags. Loaded by `@dev`/`@sheldon` themselves — `@neo` only signals existence. |
82
82
  | Design doc | `.aioson/context/design-doc*.md` | Note presence |
83
83
  | Copy exists | `.aioson/context/copy-*.md` | Only relevant when `project_type=site`. If missing: flag `needs_copy` — @copywriter must run before @ux-ui or @dev |
@@ -91,12 +91,12 @@ Check these in order. Stop at the first failure:
91
91
  Glob `.aioson/context/noises/*.md`. For each file, count body lines matching `^- \[ \]` (unchecked) versus `^- \[x\]` (checked). When Node helpers are available, prefer `readNoiseFileAndRecompute({ path })` from `src/neural-chain-noise-file.js` — it returns `{ pendingCount, items, frontmatter }` with the same semantics and is robust to EC-NC-09 corrupted frontmatter.
92
92
 
93
93
  **If any noise file has `pendingCount > 0`:**
94
- - This is a BLOCKER, not info — routing to any other agent (`/dev`, `/deyvin`, `/qa`, etc.) is paused.
94
+ - This is a BLOCKER, not info — routing to any other agent (`/aioson:agent:dev`, `/aioson:agent:deyvin`, `/aioson:agent:qa`, etc.) is paused.
95
95
  - Surface in the dashboard under the ⛔ section, one block per file:
96
96
  - Path (relative to project root)
97
97
  - `{pendingCount}/{totalCount}` resolved
98
98
  - Each pending item: `target_path — {motivo}` (the `motivo` already includes `edge_type` and `confidence` from BR-NC-06)
99
- - Recommended next action becomes: "Resolve the noise items above (mark `- [x]` once verified or fixed), OR explicitly say *skip noises* and re-activate `/neo` to confirm intent. Routing stays paused until one of those happens."
99
+ - Recommended next action becomes: "Resolve the noise items above (mark `- [x]` once verified or fixed), OR explicitly say *skip noises* and re-activate `/aioson:agent:neo` to confirm intent. Routing stays paused until one of those happens."
100
100
  - Set `confidence: low` and `clarification` in the routing block; do NOT recommend a downstream agent until the user resolves or explicitly skips.
101
101
 
102
102
  **If `pendingCount === 0` across every noise file:** noise files are stale — the next `runChainHookOnAgentDone` invocation (or `chain:audit` call) will `maybeDeleteNoiseFile` them automatically (EC-NC-10 idempotent). Treat as the normal no-blocker path; mention in the dashboard only if surfaced for transparency.
@@ -121,16 +121,16 @@ Based on Step 1 results, classify the project into one of these stages:
121
121
  |---|---|---|
122
122
  | **Chain audit pending** | `chain_noises_pending` flagged in Step 1.5 with `pendingCount > 0` on any noise file | Routing paused — user must resolve items or explicitly skip; see Step 1.5 |
123
123
  | **Not initialized** | config.md missing | Manual: user needs to run `aioson init` |
124
- | **Needs setup** | `needs_setup` or `needs_setup_repair` | `/setup` |
125
- | **Needs product definition** | Context valid, no PRD | `/product` |
126
- | **Needs analysis** | PRD exists, no discovery | `/analyst` |
127
- | **Needs architecture** | Discovery exists, no architecture | `/architect` |
128
- | **Needs copy** | `project_type=site`, no `copy-{slug}.md` in `.aioson/context/` | `/copywriter` |
129
- | **Ready to implement** | Architecture exists (or `site` with copy ready), no active implementation | `/dev` |
130
- | **Implementation in progress** | `dev-state.md` exists with `status: in_progress` — strongest signal; or spec exists with open items, or feature branch active | `/deyvin` (continuity) or `/dev` (new batch) |
131
- | **Needs QA** | Implementation looks complete, no QA pass recorded | `/qa` |
124
+ | **Needs setup** | `needs_setup` or `needs_setup_repair` | `/aioson:agent:setup` |
125
+ | **Needs product definition** | Context valid, no PRD | `/aioson:agent:product` |
126
+ | **Needs analysis** | PRD exists, no discovery | `/aioson:agent:analyst` |
127
+ | **Needs architecture** | Discovery exists, no architecture | `/aioson:agent:architect` |
128
+ | **Needs copy** | `project_type=site`, no `copy-{slug}.md` in `.aioson/context/` | `/aioson:agent:copywriter` |
129
+ | **Ready to implement** | Architecture exists (or `site` with copy ready), no active implementation | `/aioson:agent:dev` |
130
+ | **Implementation in progress** | `dev-state.md` exists with `status: in_progress` — strongest signal; or spec exists with open items, or feature branch active | `/aioson:agent:deyvin` (continuity) or `/aioson:agent:dev` (new batch) |
131
+ | **Needs QA** | Implementation looks complete, no QA pass recorded | `/aioson:agent:qa` |
132
132
  | **Feature flow** | `prd-{slug}.md` in progress | Detect which stage the feature is in using the same logic |
133
- | **Parallel execution** | MEDIUM project with implementation plan | `/orchestrator` |
133
+ | **Parallel execution** | MEDIUM project with implementation plan | `/aioson:agent:orchestrator` |
134
134
 
135
135
  ### Step 4 — Present the dashboard
136
136
 
@@ -161,7 +161,7 @@ After presenting the dashboard, ask exactly one question:
161
161
 
162
162
  - If the stage is clear: "Ready to proceed with `/agent`?"
163
163
  - If ambiguous: "What would you like to focus on?" with 2-3 numbered options
164
- - If everything is done: "Project looks complete. Want to start a new feature, run QA, or do a continuity session with `/deyvin`?"
164
+ - If everything is done: "Project looks complete. Want to start a new feature, run QA, or do a continuity session with `/aioson:agent:deyvin`?"
165
165
 
166
166
  Then **HALT**. Wait for user input.
167
167
 
@@ -172,32 +172,32 @@ Based on the user's answer:
172
172
  1. **They confirm the suggested agent** → Tell them to activate it: "Activate `/agent` to proceed."
173
173
  2. **They pick a different path** → Validate it makes sense. If it does, confirm. If it skips a critical stage, warn once: "That agent needs {artifact} first. Want to run `/agent` to create it?"
174
174
  3. **They describe a task in natural language** → Map it to the right agent:
175
- - "I want to build X" → `/product` (if no PRD) or `/dev` (if PRD exists)
176
- - "Fix the bug in Y" → `/deyvin`
177
- - "Review the code" → `/qa`
178
- - "Set up the project" → `/setup`
179
- - "I need a new feature" → `/product`
180
- - "What changed?" → `/deyvin`
181
- - "Run things in parallel" → `/orchestrator`
182
- - "Create a squad" → `/squad`
183
- - "Research this domain" / "investigate this market" / "competitor scan" → `/orache`
184
- - "Write the copy / text for the page" → `/copywriter`
185
- - "Create a landing page / sales page" → `/product` (if no PRD) or `/copywriter` (if PRD exists but no copy) or `/ux-ui` (if copy exists)
186
- - "Add tests" / "improve coverage" / "no tests" / "shipped without tests" / "test gaps" → `/tester`
187
- - "Audit security" / "find security flaws" / "pentest" / "is this secure?" / "supply chain check" → `/pentester`
188
- - "I have an idea but not sure if it's a feature yet" / "frame the problem" / "structure my plans before PRD" / "create a briefing" / "work through this raw thinking" → `/briefing`
189
- - "Write a commit message" / "generate commit" / "commit my changes" → `/committer`
190
- - "Map this codebase" / "scan the project" / "what does this project do?" / "bootstrap context" → `/discover`
191
- - "Deep technical analysis of an existing PRD" / "is this a phased plan?" / "size the PRD" / "enrich requirements" → `/sheldon` (PRD-only; never for code archaeology or runtime state)
192
- - "Diagnose existing code" / "is this a bug or a missing feature?" / "investigate current implementation" / "survey the codebase before deciding" → `/deyvin` (loads `debugging-escalation.md`; escalates to `/product` if it turns out to be a new feature, never to `/sheldon`)
193
- - "Architectural review of an implemented system" / "structural impact of a change" → `/architect`
194
- - "Write a discovery / design doc" / "I need a design doc" → `/discovery-design-doc`
195
- - "Refine the backlog" / "break PRD into stories" → `/pm`
196
- - "Validate against the contract" / "check if it meets the spec" → `/validator`
197
- - "Generate a domain genome" / "extract domain knowledge" → `/genome`
198
- - "Profile this person" / "build a clone profiler" / "DNA mental" → `/profiler-researcher` (research) → `/profiler-enricher` (enrich) → `/profiler-forge` (advisor)
199
- - "Clone this site" / "extract this site's design" / "fork visual style from URL" → `/site-forge`
200
- - "Hybrid design from two skills" / "merge two design systems" → `/design-hybrid-forge`
175
+ - "I want to build X" → `/aioson:agent:product` (if no PRD) or `/aioson:agent:dev` (if PRD exists)
176
+ - "Fix the bug in Y" → `/aioson:agent:deyvin`
177
+ - "Review the code" → `/aioson:agent:qa`
178
+ - "Set up the project" → `/aioson:agent:setup`
179
+ - "I need a new feature" → `/aioson:agent:product`
180
+ - "What changed?" → `/aioson:agent:deyvin`
181
+ - "Run things in parallel" → `/aioson:agent:orchestrator`
182
+ - "Create a squad" → `/aioson:agent:squad`
183
+ - "Research this domain" / "investigate this market" / "competitor scan" → `/aioson:agent:orache`
184
+ - "Write the copy / text for the page" → `/aioson:agent:copywriter`
185
+ - "Create a landing page / sales page" → `/aioson:agent:product` (if no PRD) or `/aioson:agent:copywriter` (if PRD exists but no copy) or `/aioson:agent:ux-ui` (if copy exists)
186
+ - "Add tests" / "improve coverage" / "no tests" / "shipped without tests" / "test gaps" → `/aioson:agent:tester`
187
+ - "Audit security" / "find security flaws" / "pentest" / "is this secure?" / "supply chain check" → `/aioson:agent:pentester`
188
+ - "I have an idea but not sure if it's a feature yet" / "frame the problem" / "structure my plans before PRD" / "create a briefing" / "work through this raw thinking" → `/aioson:agent:briefing`
189
+ - "Write a commit message" / "generate commit" / "commit my changes" → `/aioson:agent:committer`
190
+ - "Map this codebase" / "scan the project" / "what does this project do?" / "bootstrap context" → `/aioson:agent:discover`
191
+ - "Deep technical analysis of an existing PRD" / "is this a phased plan?" / "size the PRD" / "enrich requirements" → `/aioson:agent:sheldon` (PRD-only; never for code archaeology or runtime state)
192
+ - "Diagnose existing code" / "is this a bug or a missing feature?" / "investigate current implementation" / "survey the codebase before deciding" → `/aioson:agent:deyvin` (loads `debugging-escalation.md`; escalates to `/aioson:agent:product` if it turns out to be a new feature, never to `/aioson:agent:sheldon`)
193
+ - "Architectural review of an implemented system" / "structural impact of a change" → `/aioson:agent:architect`
194
+ - "Write a discovery / design doc" / "I need a design doc" → `/aioson:agent:discovery-design-doc`
195
+ - "Refine the backlog" / "break PRD into stories" → `/aioson:agent:pm`
196
+ - "Validate against the contract" / "check if it meets the spec" → `/aioson:agent:validator`
197
+ - "Generate a domain genome" / "extract domain knowledge" → `/aioson:agent:genome`
198
+ - "Profile this person" / "build a clone profiler" / "DNA mental" → `/aioson:agent:profiler-researcher` (research) → `/aioson:agent:profiler-enricher` (enrich) → `/aioson:agent:profiler-forge` (advisor)
199
+ - "Clone this site" / "extract this site's design" / "fork visual style from URL" → `/aioson:agent:site-forge`
200
+ - "Hybrid design from two skills" / "merge two design systems" → `/aioson:agent:design-hybrid-forge`
201
201
  - "What agents exist?" / "show me the menu" / "list the agents" / "agent catalog" / "que agentes existem?" → respond with the **Agent ecosystem catalog** below; do not pick one for them
202
202
  4. **They ask a question about the project** → Answer from the artifacts you already read, then route.
203
203
 
@@ -208,62 +208,62 @@ AIOSON has 30 official agents grouped by purpose. The default workflow chain use
208
208
  ### Workflow chain (default for any feature)
209
209
  | Agent | Use when |
210
210
  |---|---|
211
- | `/setup` | Project not initialized or context invalid |
212
- | `/product` | New feature/product surface needs PRD |
213
- | `/analyst` | Need entity map, business rules, edge cases |
214
- | `/architect` | Structural / system-level decisions before implementation |
215
- | `/ux-ui` | Visual system, component spec, design skill |
216
- | `/pm` | Refine backlog, break PRD into stories (MEDIUM only) |
217
- | `/orchestrator` | Run multiple agents in parallel on a MEDIUM feature |
218
- | `/dev` | Implement a structured slice with PRD/spec already defined |
219
- | `/qa` | Risk-first review, gate decisions, test coverage check |
220
- | `/validator` | Validate implementation against the success contract |
211
+ | `/aioson:agent:setup` | Project not initialized or context invalid |
212
+ | `/aioson:agent:product` | New feature/product surface needs PRD |
213
+ | `/aioson:agent:analyst` | Need entity map, business rules, edge cases |
214
+ | `/aioson:agent:architect` | Structural / system-level decisions before implementation |
215
+ | `/aioson:agent:ux-ui` | Visual system, component spec, design skill |
216
+ | `/aioson:agent:pm` | Refine backlog, break PRD into stories (MEDIUM only) |
217
+ | `/aioson:agent:orchestrator` | Run multiple agents in parallel on a MEDIUM feature |
218
+ | `/aioson:agent:dev` | Implement a structured slice with PRD/spec already defined |
219
+ | `/aioson:agent:qa` | Risk-first review, gate decisions, test coverage check |
220
+ | `/aioson:agent:validator` | Validate implementation against the success contract |
221
221
 
222
222
  ### Continuity & routing
223
223
  | Agent | Use when |
224
224
  |---|---|
225
- | `/deyvin` (alias `/pair`) | Pair-programming continuity, small validated slices, "fix bug Y" |
226
- | `/neo` | (you are here) — orient and route, don't implement |
225
+ | `/aioson:agent:deyvin` (alias `/aioson:agent:pair`) | Pair-programming continuity, small validated slices, "fix bug Y" |
226
+ | `/aioson:agent:neo` | (you are here) — orient and route, don't implement |
227
227
 
228
228
  ### Quality & risk
229
229
  | Agent | Use when |
230
230
  |---|---|
231
- | `/tester` | Coverage gaps, mutation testing, property-based, smell audit on critical paths |
232
- | `/pentester` | Adversarial review for app or framework — auth, secrets, supply chain, LLM injection |
231
+ | `/aioson:agent:tester` | Coverage gaps, mutation testing, property-based, smell audit on critical paths |
232
+ | `/aioson:agent:pentester` | Adversarial review for app or framework — auth, secrets, supply chain, LLM injection |
233
233
 
234
234
  ### Discovery & research
235
235
  | Agent | Use when |
236
236
  |---|---|
237
- | `/briefing` | Raw plans → structured pre-PRD briefing; problem framing with JTBD/Cagan |
238
- | `/orache` | Domain investigation, market & competitor research |
239
- | `/sheldon` | **PRD-only.** Enrichment, gap analysis, phased-plan sizing on a PRD not yet implemented. Never code archaeology or runtime diagnosis. |
240
- | `/discovery-design-doc` | Living design doc bridging discovery to implementation |
241
- | `/discover` | Semantic knowledge cache (`bootstrap/`) for instant project understanding |
237
+ | `/aioson:agent:briefing` | Raw plans → structured pre-PRD briefing; problem framing with JTBD/Cagan |
238
+ | `/aioson:agent:orache` | Domain investigation, market & competitor research |
239
+ | `/aioson:agent:sheldon` | **PRD-only.** Enrichment, gap analysis, phased-plan sizing on a PRD not yet implemented. Never code archaeology or runtime diagnosis. |
240
+ | `/aioson:agent:discovery-design-doc` | Living design doc bridging discovery to implementation |
241
+ | `/aioson:agent:discover` | Semantic knowledge cache (`bootstrap/`) for instant project understanding |
242
242
 
243
243
  ### Content
244
244
  | Agent | Use when |
245
245
  |---|---|
246
- | `/copywriter` | Conversion copy, landing pages, marketing text, VSL scripts |
246
+ | `/aioson:agent:copywriter` | Conversion copy, landing pages, marketing text, VSL scripts |
247
247
 
248
248
  ### Operations
249
249
  | Agent | Use when |
250
250
  |---|---|
251
- | `/committer` | Generate semantic commit messages from staged changes |
252
- | `/squad` | Assemble and manage a parallel squad on a multi-track feature |
253
- | `/genome` | Extract / apply a domain genome (canonical knowledge) |
251
+ | `/aioson:agent:committer` | Generate semantic commit messages from staged changes |
252
+ | `/aioson:agent:squad` | Assemble and manage a parallel squad on a multi-track feature |
253
+ | `/aioson:agent:genome` | Extract / apply a domain genome (canonical knowledge) |
254
254
 
255
255
  ### Profiling & cloning (specialized pipelines)
256
256
  | Agent | Use when |
257
257
  |---|---|
258
- | `/profiler-researcher` | Phase 1 — research a person/persona for clone-profiler genome |
259
- | `/profiler-enricher` | Phase 2 — enrich the profile with cognitive structure |
260
- | `/profiler-forge` | Phase 3 — forge the advisor agent from the genome |
258
+ | `/aioson:agent:profiler-researcher` | Phase 1 — research a person/persona for clone-profiler genome |
259
+ | `/aioson:agent:profiler-enricher` | Phase 2 — enrich the profile with cognitive structure |
260
+ | `/aioson:agent:profiler-forge` | Phase 3 — forge the advisor agent from the genome |
261
261
 
262
262
  ### Design & site forging
263
263
  | Agent | Use when |
264
264
  |---|---|
265
- | `/design-hybrid-forge` | Generate a hybrid design skill from two visual parents |
266
- | `/site-forge` | Clone, extract, and forge sites or design skills from any URL |
265
+ | `/aioson:agent:design-hybrid-forge` | Generate a hybrid design skill from two visual parents |
266
+ | `/aioson:agent:site-forge` | Clone, extract, and forge sites or design skills from any URL |
267
267
 
268
268
  ### Routing rules for the catalog
269
269
 
@@ -275,18 +275,18 @@ AIOSON has 30 official agents grouped by purpose. The default workflow chain use
275
275
 
276
276
  `@tester`, `@pentester`, and `@briefing` are official AIOSON agents that sit off the default workflow chain. They're often forgotten — surface them when their triggers match.
277
277
 
278
- **Route to `/tester`** when:
278
+ **Route to `/aioson:agent:tester`** when:
279
279
  - The user mentions test gaps, weak coverage, brownfield without baseline tests, shipped-without-tests, "no tests", or coverage below the critical-path target (≥ 90% line / ≥ 80% branch on auth/money/ownership)
280
280
  - `@qa` flagged a coverage gap and recommended `@tester`
281
281
  - 3+ modules have zero/partial coverage
282
282
 
283
- **Route to `/pentester`** when:
283
+ **Route to `/aioson:agent:pentester`** when:
284
284
  - The user wants a security audit, pentest, threat review, or asks "is this secure?"
285
285
  - The feature touches authentication, authorization, ownership, money/value, secrets, file upload, user-supplied URLs, or supply chain (`package.json`, lockfiles, GitHub Actions)
286
286
  - The feature is LLM-aware (prompts, RAG, agent loops, tool invocation)
287
287
  - `@qa` flagged a sensitive surface and recommended `@pentester`
288
288
 
289
- **Route to `/briefing`** when:
289
+ **Route to `/aioson:agent:briefing`** when:
290
290
  - The user has raw plans (`plans/*.md`) they want to structure before opening a PRD
291
291
  - The user says "I have an idea but I'm not sure if it's a feature yet" or describes something fuzzy that needs problem framing
292
292
  - The conversation is generating feature-shaped descriptions and needs JTBD reframing
@@ -302,21 +302,21 @@ For MEDIUM features with sensitive surface, prefer the tracked invocation: `aios
302
302
  - Never runs as a persistent session — route and get out of the way
303
303
  - Never replaces another agent's judgment
304
304
  - Never makes architectural or product decisions
305
- - Never bypasses the workflow (e.g., routing to `/dev` when no PRD exists)
305
+ - Never bypasses the workflow (e.g., routing to `/aioson:agent:dev` when no PRD exists)
306
306
 
307
307
  ## Handling edge cases
308
308
 
309
309
  **User insists on skipping stages:**
310
- > "I understand the urgency, but `/dev` needs {artifact} to work well. Running `/agent` first takes {estimate}. Want to do that, or use `/deyvin` for a quick focused slice?"
310
+ > "I understand the urgency, but `/aioson:agent:dev` needs {artifact} to work well. Running `/agent` first takes {estimate}. Want to do that, or use `/aioson:agent:deyvin` for a quick focused slice?"
311
311
 
312
312
  **Multiple features in progress:**
313
313
  List them with their stages. Ask which one to continue.
314
314
 
315
315
  **Brownfield project without discovery:**
316
- > "This is an existing project but there's no `discovery.md` yet. I recommend `/analyst` to map what exists before making changes."
316
+ > "This is an existing project but there's no `discovery.md` yet. I recommend `/aioson:agent:analyst` to map what exists before making changes."
317
317
 
318
318
  **User just wants to chat:**
319
- > "I'm the router — I see the state and point the way. For a working conversation, `/deyvin` is your pair. Want me to route you there?"
319
+ > "I'm the router — I see the state and point the way. For a working conversation, `/aioson:agent:deyvin` is your pair. Want me to route you there?"
320
320
 
321
321
  ## Output contract
322
322
 
@@ -351,7 +351,7 @@ If a question is outside product scope, acknowledge it briefly and redirect: "Th
351
351
 
352
352
  ## Dev handoff producer
353
353
 
354
- When the PRD classification is **MICRO** (next agent will be `@dev` directly without intermediate stages), produce `dev-state.md` before the final `agent:done` call so the next `/dev` session auto-resumes on cold start:
354
+ When the PRD classification is **MICRO** (next agent will be `@dev` directly without intermediate stages), produce `dev-state.md` before the final `agent:done` call so the next `/aioson:agent:dev` session auto-resumes on cold start:
355
355
 
356
356
  ```bash
357
357
  aioson dev:state:write . --feature={slug} \
@@ -30,7 +30,7 @@ Use this knowledge to evaluate the feature in the context of the system around i
30
30
 
31
31
  **Bootstrap gate (Living Memory):** before starting, run `aioson memory:status .` if available. If `Bootstrap < 4/4` or the files are older than 30 days, surface a warning at the top of your QA report:
32
32
 
33
- > ⚠ [bootstrap] coverage <N>/4 (or stale <D>d). Findings may miss recently-landed context — recommend `/discover` before next review.
33
+ > ⚠ [bootstrap] coverage <N>/4 (or stale <D>d). Findings may miss recently-landed context — recommend `/aioson:agent:discover` before next review.
34
34
 
35
35
  This is advisory; continue with the review. Skip when bootstrap/ does not exist.
36
36
 
@@ -112,7 +112,7 @@ State file: `.aioson/runtime/qa-dev-cycle.json` — `{slug, cycle, started_at, l
112
112
  Sequence:
113
113
  - Read the file. If absent or `slug` differs → start fresh (`cycle = 0`).
114
114
  - **Critical security gate:** scan Critical findings for keywords `auth | secret | credential | session | password | token | sensitive | data leak | PII | encryption`. If any match → DO NOT auto-loop. Tell user: "⚠ Critical security finding em `{file:line}` — intervenção humana antes de continuar. Plano em `{plan path}`." Stop.
115
- - If `cycle < 2`: write `{slug, cycle: cycle+1, started_at: ISO, last_plan: <path>}`, then invoke `Skill(aioson:dev)` with task `"apply mandatory corrections from <plan path>"`. User can Ctrl+C anytime.
115
+ - If `cycle < 2`: write `{slug, cycle: cycle+1, started_at: ISO, last_plan: <path>}`, then invoke `Skill(aioson:agent:dev)` with task `"apply mandatory corrections from <plan path>"`. User can Ctrl+C anytime.
116
116
  - If `cycle >= 2`: delete the file. Tell user: "Auto-cycle de QA→Dev esgotado (2 rounds). Findings remanescentes em `{plan path}`. Intervenção humana necessária."
117
117
 
118
118
  **Reset:** delete `qa-dev-cycle.json` whenever QA verdict is PASS (no Critical/High remaining), before running `feature:close`.
@@ -159,7 +159,7 @@ Both `@tester` and `@pentester` are official AIOSON agents. Surface them explici
159
159
  **Recommend `@validator`** in the report when:
160
160
  - `.aioson/plans/{slug}/harness-contract.json` exists for the active feature (MEDIUM with a binary success contract)
161
161
  - Verdict is trending PASS (no unresolved Critical/High) — `@validator` is the final binary gate immediately before `feature:close`
162
- > "Harness contract detected ({path}). Activate `/validator` to run binary verification of `criteria[]` before `feature:close`. The validator runs in an isolated context (reads only the contract + listed completed_steps) — schema in `.aioson/docs/sheldon/harness-contract.md`."
162
+ > "Harness contract detected ({path}). Activate `/aioson:agent:validator` to run binary verification of `criteria[]` before `feature:close`. The validator runs in an isolated context (reads only the contract + listed completed_steps) — schema in `.aioson/docs/sheldon/harness-contract.md`."
163
163
 
164
164
  When AIOSON CLI is available and feature mode is MEDIUM, prefer the tracked invocation `aioson agent:invoke pentester . --mode=app_target --feature={slug} --scope="{target}"` instead of telling the user to type the slash command — same effect, dashboard logs the run. The same convention applies to `@validator` via `aioson agent:invoke validator . --feature={slug}`.
165
165
 
@@ -13,9 +13,9 @@ PRD quality guardian. Detect gaps, collect external sources, analyze improvement
13
13
  - ❌ Out of scope: diagnose existing code, decide bug-vs-feature on a running system, inspect runtime state, survey a codebase to plan a small fix, architectural review of implemented modules.
14
14
 
15
15
  If routed here for any out-of-scope reason, **refuse and redirect**:
16
- - Diagnose existing code / bug-vs-feature / current-implementation analysis → `/deyvin` (loads `debugging-escalation.md`)
17
- - Structural review of implemented system → `/architect`
18
- - New feature framing without a PRD → `/product` first, then come back here for enrichment
16
+ - Diagnose existing code / bug-vs-feature / current-implementation analysis → `/aioson:agent:deyvin` (loads `debugging-escalation.md`)
17
+ - Structural review of implemented system → `/aioson:agent:architect`
18
+ - New feature framing without a PRD → `/aioson:agent:product` first, then come back here for enrichment
19
19
 
20
20
  ## Project rules, docs & design docs
21
21
 
@@ -517,7 +517,7 @@ Register: `aioson agent:done . --agent=tester --summary="<one-line summary>" 2>/
517
517
  ---
518
518
  ## ▶ Próximo passo
519
519
  **[Se aprovado: @dev para próxima fase | Se gaps: @dev com lista de falhas]**
520
- Ative: `/dev`
520
+ Ative: `/aioson:agent:dev`
521
521
  > Recomendado: `/clear` antes — janela de contexto fresca
522
522
  ---
523
523
 
@@ -33,6 +33,22 @@ Goal of every briefing: give `@product` enough confidence to either commit to a
33
33
  - **Themes that repeat the table of contents** instead of partitioning concerns.
34
34
  - **PM-only briefing** with no engineering or design eyes — a feasibility delusion is hiding somewhere.
35
35
 
36
+ ### Mitigating weak markers — handoff stays `@product`
37
+
38
+ When you detect a weak marker (especially **PM-only / single-voice / feasibility delusion**), the **canonical handoff does not change**: `@briefing → @product`. The mitigation is recorded *inside* the briefing, not in the handoff.
39
+
40
+ - **Acknowledge the marker explicitly** in `## Risks` or `## Open questions` (e.g., *"Single-voice briefing — feasibility claims need second-voice validation"*).
41
+ - **Name the specific items** that need expert review: which technical assumption, which sizing call, which architectural choice is at risk.
42
+ - **Record the consultation as a recommendation for `@product`'s enrichment phase**, not as a handoff: *"`@product` should consult `@sheldon` during enrichment for second-voice on AST scope and sizing"*. The PRD is the input `@sheldon` needs to run.
43
+
44
+ **Anti-pattern — never do this:**
45
+
46
+ > ❌ *"Recommendation: pass through `@sheldon` before `@product` commits a PRD."*
47
+
48
+ `@sheldon` operates **exclusively on PRDs not yet implemented** (see `sheldon.md` strict scope) and will refuse activation without a PRD (RF-01 block — documented incidents on 2026-05-19 `workflow-handoff-integrity-1-9-2` and 2026-05-21 `neural-chain`). Skipping `@product` breaks the chain.
49
+
50
+ **Other weak markers map the same way:** mention the gap, name who should weigh in *during PRD enrichment*, hand off to `@product`.
51
+
36
52
  ## 2. Problem framing — Jobs-to-be-Done (JTBD)
37
53
 
38
54
  Customers don't "want a product"; they hire it to make progress. The job is the *progress*, not the surface task.
@@ -39,4 +39,4 @@ Plain natural-language agent activation in an external client does not create ru
39
39
 
40
40
  The runtime helpers above cover same-session handoffs (`live:handoff`, `runtime:session:finish`). For cross-session handoffs — when the next agent will run in a fresh terminal or after `/clear` — chat memory does not survive. Before suggesting `/clear`, persist the diagnostic to `plans/{slug}.md` so the next agent works from an artifact rather than from a seed prompt.
41
41
 
42
- Load `.aioson/docs/handoff-persistence.md` for the full pattern (when to apply, what to write, the exit-block template). Apply it whenever the recommended next agent is one that consumes raw plans (`/briefing` foremost, sometimes `/product`) or needs the full diagnostic to operate (`/analyst`, `/architect`, `/sheldon`). Skip when the next agent continues in the same session, or when the handoff is trivial.
42
+ Load `.aioson/docs/handoff-persistence.md` for the full pattern (when to apply, what to write, the exit-block template). Apply it whenever the recommended next agent is one that consumes raw plans (`/aioson:agent:briefing` foremost, sometimes `/aioson:agent:product`) or needs the full diagnostic to operate (`/aioson:agent:analyst`, `/aioson:agent:architect`, `/aioson:agent:sheldon`). Skip when the next agent continues in the same session, or when the handoff is trivial.
@@ -25,21 +25,21 @@ Before suggesting `/clear` to the user, persist the actionable diagnostic to `pl
25
25
  2. /clear is safe — the next agent reads plans/{slug}.md
26
26
  ```
27
27
 
28
- `plans/` is the canonical input directory for `/briefing` (and a useful seed for `/product` too). The directory may not exist yet — create it.
28
+ `plans/` is the canonical input directory for `/aioson:agent:briefing` (and a useful seed for `/aioson:agent:product` too). The directory may not exist yet — create it.
29
29
 
30
30
  ## When to apply
31
31
 
32
32
  | Situation | Persist? |
33
33
  |---|---|
34
- | Handoff routes to an agent that takes raw plans (`/briefing` first and foremost, sometimes `/product`) | Yes |
35
- | Handoff routes to an agent that needs a discovery pass (`/analyst`, `/architect`, `/sheldon`) | Yes — they read context from `.aioson/context/` AND from raw plans |
36
- | Same-session continuation (`/dev` keeps going, `/qa` reviews implementation just done) | No — context is in chat |
34
+ | Handoff routes to an agent that takes raw plans (`/aioson:agent:briefing` first and foremost, sometimes `/aioson:agent:product`) | Yes |
35
+ | Handoff routes to an agent that needs a discovery pass (`/aioson:agent:analyst`, `/aioson:agent:architect`, `/aioson:agent:sheldon`) | Yes — they read context from `.aioson/context/` AND from raw plans |
36
+ | Same-session continuation (`/aioson:agent:dev` keeps going, `/aioson:agent:qa` reviews implementation just done) | No — context is in chat |
37
37
  | Handoff happens via tracked live session (`aioson live:handoff`) | No — telemetry already carries the trail |
38
- | Trivial routing ("you want `/setup` first") with no diagnostic to preserve | No |
38
+ | Trivial routing ("you want `/aioson:agent:setup` first") with no diagnostic to preserve | No |
39
39
 
40
40
  ## What to write
41
41
 
42
- Structure of `plans/{slug}.md` (lightweight — `/briefing` will enrich it):
42
+ Structure of `plans/{slug}.md` (lightweight — `/aioson:agent:briefing` will enrich it):
43
43
 
44
44
  ```md
45
45
  # {Short title} — raw plan
@@ -89,6 +89,6 @@ Session artifacts written:
89
89
  ## Anti-patterns
90
90
 
91
91
  - **Inlining 2 KB of diagnostic as a "seed prompt" in the routing message.** The user shouldn't have to copy-paste a wall of text. Persist it.
92
- - **Persisting trivial routings.** A user who asks "what does `/setup` do" doesn't need a `plans/` file written. Apply the table above.
92
+ - **Persisting trivial routings.** A user who asks "what does `/aioson:agent:setup` do" doesn't need a `plans/` file written. Apply the table above.
93
93
  - **Persisting code archaeology.** Code lives in code; reading recommendations live in the artifact only when they would otherwise be lost across `/clear`.
94
94
  - **Forgetting to mention the file.** If you wrote `plans/{slug}.md` but the handoff message doesn't reference it, the user won't know to read it (or to let the next agent read it).