@jaimevalasek/aioson 1.22.0 → 1.23.1
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/CHANGELOG.md +932 -919
- package/docs/en/5-reference/cli-reference.md +85 -0
- package/docs/pt/4-agentes/pm.md +31 -4
- package/docs/pt/5-referencia/README.md +3 -0
- package/docs/pt/5-referencia/autopilot-handoff.md +131 -0
- package/docs/pt/5-referencia/comandos-cli.md +72 -6
- package/docs/pt/5-referencia/harness-retro.md +133 -0
- package/docs/pt/5-referencia/loop-guardrails.md +225 -0
- package/docs/pt/5-referencia/sdd-automation-scripts.md +25 -13
- package/package.json +1 -1
- package/src/agents.js +1 -1
- package/src/cli.js +70 -29
- package/src/commands/agent-epilogue.js +186 -0
- package/src/commands/context-select.js +33 -0
- package/src/commands/harness-preview.js +74 -0
- package/src/commands/harness-retro.js +221 -0
- package/src/commands/preflight-context.js +13 -9
- package/src/commands/review-cycle.js +328 -0
- package/src/commands/runtime.js +4 -4
- package/src/commands/self-implement-loop.js +12 -2
- package/src/commands/state-save.js +2 -0
- package/src/commands/workflow-execute.js +138 -28
- package/src/commands/workflow-next.js +11 -2
- package/src/commands/workflow-status.js +30 -10
- package/src/constants.js +15 -13
- package/src/context-memory.js +50 -25
- package/src/context-selector.js +394 -0
- package/src/harness/preview-artifact.js +85 -0
- package/src/i18n/messages/en.js +34 -7
- package/src/i18n/messages/es.js +34 -7
- package/src/i18n/messages/fr.js +34 -7
- package/src/i18n/messages/pt-BR.js +34 -7
- package/src/lib/retro/retro-aggregate.js +192 -0
- package/src/lib/retro/retro-render.js +185 -0
- package/src/lib/retro/retro-sources.js +624 -0
- package/src/parser.js +1 -1
- package/src/squad/preflight-context.js +26 -27
- package/template/.aioson/agents/analyst.md +41 -46
- package/template/.aioson/agents/architect.md +33 -46
- package/template/.aioson/agents/briefing.md +76 -67
- package/template/.aioson/agents/dev.md +73 -55
- package/template/.aioson/agents/deyvin.md +55 -50
- package/template/.aioson/agents/discovery-design-doc.md +35 -22
- package/template/.aioson/agents/manifests/architect.manifest.json +11 -1
- package/template/.aioson/agents/manifests/dev.manifest.json +15 -0
- package/template/.aioson/agents/manifests/pm.manifest.json +20 -0
- package/template/.aioson/agents/orchestrator.md +31 -18
- package/template/.aioson/agents/pentester.md +12 -4
- package/template/.aioson/agents/pm.md +41 -35
- package/template/.aioson/agents/product.md +116 -165
- package/template/.aioson/agents/qa.md +44 -13
- package/template/.aioson/agents/scope-check.md +46 -24
- package/template/.aioson/agents/sheldon.md +13 -0
- package/template/.aioson/agents/tester.md +28 -5
- package/template/.aioson/agents/ux-ui.md +36 -31
- package/template/.aioson/agents/validator.md +10 -2
- package/template/.aioson/config/autonomy-protocol.json +7 -0
- package/template/.aioson/design-docs/code-reuse.md +10 -5
- package/template/.aioson/design-docs/componentization.md +10 -5
- package/template/.aioson/design-docs/file-size.md +10 -5
- package/template/.aioson/design-docs/folder-structure.md +10 -5
- package/template/.aioson/design-docs/naming.md +10 -5
- package/template/.aioson/docs/autonomy-protocol.md +2 -2
- package/template/.aioson/docs/autopilot-handoff.md +82 -34
- package/template/.aioson/docs/briefing/briefing-craft.md +9 -3
- package/template/.aioson/docs/deyvin/continuity-recovery.md +18 -22
- package/template/.aioson/docs/product/conversation-playbook.md +8 -3
- package/template/.aioson/docs/product/prd-contract.md +8 -3
- package/template/.aioson/docs/product/quality-lens.md +8 -3
- package/template/.aioson/docs/product/research-loop.md +8 -3
- package/template/.aioson/docs/ux-ui/accessibility-audit.md +7 -2
- package/template/.aioson/docs/ux-ui/audit-mode.md +7 -2
- package/template/.aioson/docs/ux-ui/component-map.md +7 -2
- package/template/.aioson/docs/ux-ui/design-execution.md +7 -2
- package/template/.aioson/docs/ux-ui/design-gate.md +7 -2
- package/template/.aioson/docs/ux-ui/research-mode.md +7 -2
- package/template/.aioson/docs/ux-ui/site-delivery.md +7 -2
- package/template/.aioson/docs/ux-ui/token-contract.md +7 -2
- package/template/.aioson/rules/aioson-context-boundary.md +11 -9
- package/template/.aioson/rules/disk-first-artifacts.md +1 -1
- package/template/.aioson/skills/process/aioson-spec-driven/references/approval-gates.md +1 -1
- package/template/.aioson/skills/process/aioson-spec-driven/references/architect.md +3 -2
- package/template/.aioson/skills/process/aioson-spec-driven/references/artifact-map.md +21 -9
- package/template/.aioson/skills/process/aioson-spec-driven/references/dev.md +2 -1
- package/template/.aioson/skills/process/aioson-spec-driven/references/pm.md +2 -1
- package/template/.aioson/skills/static/web-research-cache.md +29 -8
- package/template/AGENTS.md +1 -1
- package/template/CLAUDE.md +1 -1
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
* Output: visual bar chart of context budget per component.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
const fs = require('node:fs/promises');
|
|
17
|
-
const path = require('node:path');
|
|
18
|
-
const crypto = require('node:crypto');
|
|
16
|
+
const fs = require('node:fs/promises');
|
|
17
|
+
const path = require('node:path');
|
|
18
|
+
const crypto = require('node:crypto');
|
|
19
|
+
const { selectContext } = require('../context-selector');
|
|
19
20
|
|
|
20
21
|
const SQUADS_DIR = path.join('.aioson', 'squads');
|
|
21
22
|
|
|
@@ -120,10 +121,10 @@ function formatSize(chars) {
|
|
|
120
121
|
* @param {object} options — { agent, squad, verbose }
|
|
121
122
|
* @returns {Promise<object>} — { components[], total, totalLimit, duplicates[], warnings[] }
|
|
122
123
|
*/
|
|
123
|
-
async function estimateContext(projectDir, options = {}) {
|
|
124
|
-
const { agent = 'dev', squad, verbose } = options;
|
|
125
|
-
const components = [];
|
|
126
|
-
const warnings = [];
|
|
124
|
+
async function estimateContext(projectDir, options = {}) {
|
|
125
|
+
const { agent = 'dev', squad, verbose, mode = 'planning', task = '', paths = '' } = options;
|
|
126
|
+
const components = [];
|
|
127
|
+
const warnings = [];
|
|
127
128
|
|
|
128
129
|
// 1. Agent file
|
|
129
130
|
const agentPath = path.join(projectDir, '.aioson', 'agents', `${agent}.md`);
|
|
@@ -164,26 +165,24 @@ async function estimateContext(projectDir, options = {}) {
|
|
|
164
165
|
content: ctxFile.content
|
|
165
166
|
});
|
|
166
167
|
|
|
167
|
-
// 4.
|
|
168
|
-
const
|
|
169
|
-
let
|
|
170
|
-
let
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
content: rulesContent
|
|
186
|
-
});
|
|
168
|
+
// 4. Selected context (rules/docs/design governance/memory) by mode + task.
|
|
169
|
+
const selection = await selectContext(projectDir, { agent, mode, task, paths });
|
|
170
|
+
let selectedChars = 0;
|
|
171
|
+
let selectedContent = '';
|
|
172
|
+
for (const item of selection.selected) {
|
|
173
|
+
if (item.path === '.aioson/context/project.context.md') continue;
|
|
174
|
+
const selected = await readFileChars(path.join(projectDir, item.path));
|
|
175
|
+
selectedChars += selected.chars;
|
|
176
|
+
selectedContent += selected.content + '\n';
|
|
177
|
+
}
|
|
178
|
+
components.push({
|
|
179
|
+
label: `selected context (${mode})`,
|
|
180
|
+
path: path.join(projectDir, '.aioson'),
|
|
181
|
+
chars: selectedChars,
|
|
182
|
+
limit: DEFAULT_LIMITS.rules,
|
|
183
|
+
content: selectedContent,
|
|
184
|
+
selected: selection.selected.map((item) => item.path)
|
|
185
|
+
});
|
|
187
186
|
|
|
188
187
|
// 5. Squad-specific files (if --squad provided)
|
|
189
188
|
if (squad) {
|
|
@@ -2,41 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
> **LANGUAGE BOUNDARY:** Agent instructions are canonical in English. All user-facing communication must follow `interaction_language` from project context. If it is absent, fall back to `conversation_language`.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
2. `.aioson/docs/` — load only docs whose `description` is relevant to the current analysis task, or that are referenced by a loaded rule.
|
|
14
|
-
3. `.aioson/context/design-doc*.md` — load when `scope`, `description`, or `agents:` matches the current feature or analysis task.
|
|
15
|
-
4. `.aioson/design-docs/*.md` — load only when requirements imply module boundaries, file creation, naming, reuse, or componentization. Treat loaded governance docs as structural constraints for downstream agents.
|
|
16
|
-
|
|
17
|
-
Loaded rules and governance override the default conventions in this file.
|
|
5
|
+
## Context loading modes
|
|
6
|
+
|
|
7
|
+
Use two explicit modes so analysis starts from evidence without bulk-loading rules, docs, or memories.
|
|
8
|
+
|
|
9
|
+
- **PLANNING** — inspect workflow status, project context, feature/frontmatter, dossier index, research cache summaries, and `context:select` output. Do not load full `.aioson/rules/`, `.aioson/docs/`, `.aioson/design-docs/`, or bootstrap folders.
|
|
10
|
+
- **EXECUTING** — before writing `discovery.md`, `requirements-{slug}.md`, or `spec-{slug}.md`, run `context:select --mode=executing` and load only the selected rules/docs/design governance plus the source artifacts needed for the current output.
|
|
11
|
+
|
|
12
|
+
Project rules and governance are active only when selected by frontmatter metadata, path match, task trigger, or an explicit reference from an already loaded artifact. Loaded rules override this file.
|
|
18
13
|
|
|
19
14
|
## Mission
|
|
20
15
|
Discover requirements deeply and produce implementation-ready artifacts. For new projects: `discovery.md`. For new features: `requirements-{slug}.md` + `spec-{slug}.md`.
|
|
21
16
|
|
|
22
|
-
## Bootstrap context
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- `.aioson/context/bootstrap/what-is.md` — system identity and users
|
|
26
|
-
- `.aioson/context/bootstrap/what-it-does.md` — features, business rules, constraints
|
|
27
|
-
|
|
28
|
-
Use this semantic knowledge to avoid re-discovering domain basics that are already documented.
|
|
17
|
+
## Bootstrap context
|
|
18
|
+
|
|
19
|
+
Do not read `.aioson/context/bootstrap/` wholesale. Let `context:select --mode=planning` choose `what-is.md` or `what-it-does.md` only when the current analysis needs system identity, existing features, business rules, or constraints. Never load `current-state-archive.md` at activation.
|
|
29
20
|
|
|
30
21
|
## Tool-first session preflight
|
|
31
22
|
|
|
32
23
|
Before any manual checks, run these commands if the `aioson` CLI is available:
|
|
33
24
|
|
|
34
|
-
```bash
|
|
35
|
-
aioson workflow:status . # confirm current stage and what is expected
|
|
36
|
-
aioson context:validate . # validate project.context.md; detects brownfield state
|
|
37
|
-
aioson
|
|
38
|
-
aioson
|
|
39
|
-
|
|
25
|
+
```bash
|
|
26
|
+
aioson workflow:status . # confirm current stage and what is expected
|
|
27
|
+
aioson context:validate . # validate project.context.md; detects brownfield state
|
|
28
|
+
aioson context:select . --agent=analyst --mode=planning --task="<task>" --paths="<known source files>"
|
|
29
|
+
aioson preflight:context . --agent=analyst --mode=planning --task="<task>" --paths="<known source files>"
|
|
30
|
+
aioson preflight . --agent=analyst --feature={slug} # readiness/status only; do not treat it as permission to load every listed rule
|
|
31
|
+
aioson classify . # auto-detect project classification (MICRO/SMALL/MEDIUM) for cross-reference
|
|
32
|
+
```
|
|
40
33
|
|
|
41
34
|
For feature mode with existing requirements, run before the synchronization gate:
|
|
42
35
|
```bash
|
|
@@ -70,12 +63,11 @@ If the CLI is not available, compare modification dates manually:
|
|
|
70
63
|
|
|
71
64
|
Check the following before doing anything else:
|
|
72
65
|
|
|
73
|
-
**Feature mode** — a `prd-{slug}.md` file exists in `.aioson/context/`:
|
|
74
|
-
- Read `prd-{slug}.md` to understand the feature scope.
|
|
75
|
-
- Read `design-doc.md
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
- Output: `requirements-{slug}.md` + `spec-{slug}.md`.
|
|
66
|
+
**Feature mode** — a `prd-{slug}.md` file exists in `.aioson/context/`:
|
|
67
|
+
- Read `prd-{slug}.md` to understand the feature scope.
|
|
68
|
+
- Read only selected `design-doc*`, `readiness*`, `discovery.md`, or `spec.md` when `context:select` or a dossier/PRD reference says they are needed for the current feature.
|
|
69
|
+
- Run the **Feature discovery** process below (lighter, feature-scoped).
|
|
70
|
+
- Output: `requirements-{slug}.md` + `spec-{slug}.md`.
|
|
79
71
|
|
|
80
72
|
**Project mode** — no `prd-{slug}.md`, only `prd.md` or nothing:
|
|
81
73
|
- Run the full 3-phase project discovery below.
|
|
@@ -264,14 +256,16 @@ For each new or modified entity, produce field-level detail (same format as Phas
|
|
|
264
256
|
### Output contract — feature mode
|
|
265
257
|
|
|
266
258
|
**`requirements-{slug}.md`** — implementation spec for the feature:
|
|
267
|
-
1. Feature summary (1–2 lines from prd-{slug}.md)
|
|
268
|
-
2.
|
|
269
|
-
3.
|
|
270
|
-
4.
|
|
271
|
-
5.
|
|
272
|
-
6.
|
|
273
|
-
7.
|
|
274
|
-
8.
|
|
259
|
+
1. Feature summary (1–2 lines from prd-{slug}.md)
|
|
260
|
+
2. Requirement IDs (`REQ-{slug}-01...`) with source references
|
|
261
|
+
3. Acceptance criteria IDs (`AC-{slug}-01...`) mapped to requirement IDs
|
|
262
|
+
4. New entities and fields (full table format)
|
|
263
|
+
5. Changes to existing entities
|
|
264
|
+
6. Relationships (with existing entities from discovery.md when loaded)
|
|
265
|
+
7. Migration additions (ordered)
|
|
266
|
+
8. Business rules
|
|
267
|
+
9. Edge cases
|
|
268
|
+
10. Out of scope for this feature
|
|
275
269
|
|
|
276
270
|
**`spec-{slug}.md`** — feature memory skeleton (will be enriched by @dev):
|
|
277
271
|
|
|
@@ -345,7 +339,7 @@ Generate `.aioson/context/discovery.md` with the following sections:
|
|
|
345
339
|
|
|
346
340
|
## Dev handoff producer
|
|
347
341
|
|
|
348
|
-
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:
|
|
342
|
+
Before the final `agent:epilogue`/`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:
|
|
349
343
|
|
|
350
344
|
```bash
|
|
351
345
|
aioson dev:state:write . --feature={slug} --phase=1 \
|
|
@@ -353,7 +347,9 @@ aioson dev:state:write . --feature={slug} --phase=1 \
|
|
|
353
347
|
--context=spec,requirements
|
|
354
348
|
```
|
|
355
349
|
|
|
356
|
-
`--context` accepts canonical tokens (`prd`, `requirements`, `spec`, `architecture`, `impl-plan`, `sheldon`, `design-doc`, `dossier`, `simple-plan`), max 4 entries total; missing files emit a warning and are skipped. Always include the artifacts @dev will need to start the first slice — typically `spec` + `requirements` for SMALL features. Idempotent: re-running with the same args does not duplicate state.
|
|
350
|
+
`--context` accepts canonical tokens (`prd`, `requirements`, `spec`, `architecture`, `impl-plan`, `sheldon`, `design-doc`, `readiness`, `ui-spec`, `dossier`, `simple-plan`), max 4 entries total; missing files emit a warning and are skipped. Always include the artifacts @dev will need to start the first slice — typically `spec` + `requirements` for SMALL features. Idempotent: re-running with the same args does not duplicate state.
|
|
351
|
+
|
|
352
|
+
If any workflow stage remains before `@dev` (`@scope-check`, `@architect`, `@discovery-design-doc`, or `@pm`), do not guess the final implementation package here. The last pre-dev stage writes the final `dev-state.md`; `@analyst` only produces it for direct-to-dev shortcuts.
|
|
357
353
|
|
|
358
354
|
**Handoff message:**
|
|
359
355
|
```
|
|
@@ -387,7 +383,6 @@ aioson runtime:emit . --agent=analyst --type=milestone --summary="Spec skeleton
|
|
|
387
383
|
|
|
388
384
|
At session end, register:
|
|
389
385
|
```bash
|
|
390
|
-
aioson gate:approve . --feature={slug} --gate=A 2>/dev/null || true
|
|
391
|
-
aioson
|
|
392
|
-
|
|
393
|
-
```
|
|
386
|
+
aioson gate:approve . --feature={slug} --gate=A 2>/dev/null || true
|
|
387
|
+
aioson agent:epilogue . --agent=analyst --feature={slug} --summary="Discovery <slug>: <N> entities, <N> rules" --action="Discovery completed: {N} entities, {N} rules" --next="<next agent recommendation>" --gate="Gate A: approved" 2>/dev/null || aioson agent:done . --agent=analyst --summary="Discovery <slug>: <N> entities, <N> rules" 2>/dev/null || true
|
|
388
|
+
```
|
|
@@ -2,38 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
> **LANGUAGE BOUNDARY:** Agent instructions are canonical in English. All user-facing communication must follow `interaction_language` from project context. If it is absent, fall back to `conversation_language`.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
2. `.aioson/docs/` — load only docs whose `description` is relevant to the current architecture task, or that are referenced by a loaded rule.
|
|
14
|
-
3. `.aioson/context/design-doc*.md` — load when `scope`, `description`, or `agents:` matches the current feature or architecture task.
|
|
15
|
-
4. `.aioson/design-docs/*.md` — load relevant governance docs before deciding folder structure, component boundaries, naming, reuse strategy, or file-size split guidance.
|
|
16
|
-
|
|
17
|
-
Loaded rules and governance override the default conventions in this file.
|
|
5
|
+
## Context loading modes
|
|
6
|
+
|
|
7
|
+
Use two explicit modes. Architecture needs enough evidence to decide structure, but not every rule, doc, or memory file.
|
|
8
|
+
|
|
9
|
+
- **PLANNING** — inspect workflow status, project context, Gate A status, artifact frontmatter, dossier/code-map, and `context:select` output. Do not load full `.aioson/rules/`, `.aioson/docs/`, `.aioson/design-docs/`, or bootstrap folders.
|
|
10
|
+
- **EXECUTING** — before writing `architecture.md`, run `context:select --mode=executing` with the feature goal and candidate implementation paths. Load only selected rules/design governance plus the source artifacts required for the decisions being written.
|
|
11
|
+
|
|
12
|
+
Rules and governance override this file only when selected by metadata, path match, task trigger, or explicit reference.
|
|
18
13
|
|
|
19
14
|
## Mission
|
|
20
15
|
Transform discovery into technical architecture with concrete implementation direction.
|
|
21
16
|
|
|
22
|
-
## Bootstrap context
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- `current-state.md`
|
|
28
|
-
- `how-it-works.md`
|
|
29
|
-
|
|
30
|
-
Also read when present:
|
|
31
|
-
- `what-is.md`
|
|
32
|
-
- `what-it-does.md`
|
|
33
|
-
|
|
34
|
-
This gives you full semantic understanding of the system without reading the codebase directly.
|
|
35
|
-
|
|
36
|
-
> `current-state.md` is the **hot log** (recent + active-feature entries only). Older shipped capabilities are in `current-state-archive.md` (cold) — `grep` it or run `aioson memory:search` for historical decisions before assuming a subsystem is unbuilt. Never load the archive at activation. See `.aioson/design-docs/agent-loading-contract.md`.
|
|
17
|
+
## Bootstrap context
|
|
18
|
+
|
|
19
|
+
Do not read `.aioson/context/bootstrap/` wholesale. Let `context:select --mode=planning` choose `how-it-works.md`, `what-is.md`, or `what-it-does.md` only when the architecture decision depends on system identity, existing flows, or business constraints.
|
|
20
|
+
|
|
21
|
+
> `current-state.md` is the **hot log** (recent + active-feature entries only). Older shipped capabilities are in `current-state-archive.md` (cold) — `grep` it or run `aioson memory:search` for historical decisions before assuming a subsystem is unbuilt. Never load the archive at activation. See `.aioson/design-docs/agent-loading-contract.md`.
|
|
37
22
|
|
|
38
23
|
## Feature dossier
|
|
39
24
|
|
|
@@ -68,11 +53,13 @@ Full templates: `.aioson/docs/dossier/agent-templates.md`
|
|
|
68
53
|
|
|
69
54
|
Before entering PLANNING MODE, run these commands if the `aioson` CLI is available:
|
|
70
55
|
|
|
71
|
-
```bash
|
|
72
|
-
aioson workflow:status . # confirm Gate A passed and @architect is the active stage
|
|
73
|
-
aioson context:validate . # validate project.context.md; confirms discovery.md exists
|
|
74
|
-
aioson context:health . # shows context file sizes and token costs before loading
|
|
75
|
-
|
|
56
|
+
```bash
|
|
57
|
+
aioson workflow:status . # confirm Gate A passed and @architect is the active stage
|
|
58
|
+
aioson context:validate . # validate project.context.md; confirms discovery.md exists
|
|
59
|
+
aioson context:health . # shows context file sizes and token costs before loading
|
|
60
|
+
aioson context:select . --agent=architect --mode=planning --task="<architecture task>" --paths="<candidate paths>"
|
|
61
|
+
aioson preflight:context . --agent=architect --mode=planning --task="<architecture task>" --paths="<candidate paths>"
|
|
62
|
+
```
|
|
76
63
|
|
|
77
64
|
For feature mode, also run:
|
|
78
65
|
```bash
|
|
@@ -131,14 +118,14 @@ When Gate B passes, register it via CLI:
|
|
|
131
118
|
aioson gate:approve . --feature={slug} --gate=B 2>/dev/null || true
|
|
132
119
|
```
|
|
133
120
|
|
|
134
|
-
**Handoff message:**
|
|
135
|
-
```
|
|
136
|
-
Architecture defined: .aioson/context/architecture.md
|
|
137
|
-
Gate B: {approved|blocked}
|
|
138
|
-
Next agent: @pm
|
|
139
|
-
Action:
|
|
140
|
-
```
|
|
141
|
-
> Recommended: `/clear` before activating — fresh context window.
|
|
121
|
+
**Handoff message:**
|
|
122
|
+
```
|
|
123
|
+
Architecture defined: .aioson/context/architecture.md
|
|
124
|
+
Gate B: {approved|blocked}
|
|
125
|
+
Next agent: from the workflow state machine (usually @discovery-design-doc, then @pm on MEDIUM features, then @scope-check before @dev)
|
|
126
|
+
Action: aioson workflow:next . --complete=architect --tool=<tool>
|
|
127
|
+
```
|
|
128
|
+
> Recommended: `/clear` before activating — fresh context window.
|
|
142
129
|
|
|
143
130
|
## Autopilot handoff
|
|
144
131
|
|
|
@@ -322,8 +309,9 @@ Generate `.aioson/context/architecture.md` with:
|
|
|
322
309
|
4. **Models and relationships** — concrete mapping from discovery entities
|
|
323
310
|
5. **Integration architecture** — external services and how they connect
|
|
324
311
|
6. **Cross-cutting concerns** — auth, validation, logging, error handling decisions
|
|
325
|
-
7. **Implementation sequence for `@dev`** — order in which modules should be built
|
|
326
|
-
8. **
|
|
312
|
+
7. **Implementation sequence for `@dev`** — order in which modules should be built
|
|
313
|
+
8. **Dev context triggers** — exactly when `@dev` must load `architecture.md` sections (module boundaries, integrations, auth/security, migrations, cross-cutting concerns)
|
|
314
|
+
9. **Explicit non-goals/deferred items** — what was deliberately excluded and why
|
|
327
315
|
|
|
328
316
|
When frontend quality is important, add a handoff section for `@ux-ui` covering:
|
|
329
317
|
- Key screens
|
|
@@ -359,6 +347,5 @@ aioson runtime:emit . --agent=architect --type=gate_check --summary="Gate B: {ap
|
|
|
359
347
|
|
|
360
348
|
At session end, register:
|
|
361
349
|
```bash
|
|
362
|
-
aioson
|
|
363
|
-
|
|
364
|
-
```
|
|
350
|
+
aioson agent:epilogue . --agent=architect --feature={slug} --summary="Architecture <slug>: <stack>, <N> modules" --action="Architecture defined: {stack}, {N} modules" --next="<next agent recommendation>" --gate="Gate B: approved" 2>/dev/null || aioson agent:done . --agent=architect --summary="Architecture <slug>: <stack>, <N> modules" 2>/dev/null || true
|
|
351
|
+
```
|
|
@@ -7,16 +7,20 @@
|
|
|
7
7
|
## Mission
|
|
8
8
|
Transform raw planning sketches from `plans/` into structured, enriched, and approved briefings — creating the pre-production layer that does not yet exist between "raw idea" and "committed PRD". You do not implement code, produce PRDs, or run any part of the pipeline. You produce `.aioson/briefings/{slug}/briefings.md`.
|
|
9
9
|
|
|
10
|
-
##
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
## Context loading modes
|
|
11
|
+
|
|
12
|
+
Use explicit modes instead of eager-loading rules, docs, memories, and design docs.
|
|
13
|
+
|
|
14
|
+
- **PLANNING** — inspect source lists, briefing registry, frontmatter, memory summaries, cache indexes, and `context:select`; do not load full rule/doc folders.
|
|
15
|
+
- **EXECUTING** — before writing/updating briefing files, load only selected context plus the specific craft/gap docs required by the draft.
|
|
16
|
+
|
|
17
|
+
When the CLI is available:
|
|
18
|
+
```bash
|
|
19
|
+
aioson context:select . --agent=briefing --mode=planning --task="<task>" --paths="<plans or briefing files>"
|
|
20
|
+
aioson context:select . --agent=briefing --mode=executing --task="<task>" --paths=".aioson/briefings/{slug}/briefings.md"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The selector may choose from `.aioson/rules/`, `.aioson/docs/`, `.aioson/context/design-doc*.md`, bootstrap files, dossiers, handoffs, and project vocabulary docs. Load only selected files. If the CLI is unavailable, read frontmatter first and load only files whose `agents`, `modes`, `task_types`, `triggers`, `scope`, or `description` match the current briefing decision.
|
|
20
24
|
|
|
21
25
|
## Required input
|
|
22
26
|
|
|
@@ -33,13 +37,14 @@ These directories are **optional**. Check silently — if absent or empty, move
|
|
|
33
37
|
|
|
34
38
|
Check if `.aioson/briefings/config.md` exists.
|
|
35
39
|
|
|
36
|
-
**If config.md EXISTS:**
|
|
37
|
-
- Read YAML frontmatter from `config.md` — field `briefings:` (array)
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
>
|
|
42
|
-
> -
|
|
40
|
+
**If config.md EXISTS:**
|
|
41
|
+
- Read YAML frontmatter from `config.md` — field `briefings:` (array)
|
|
42
|
+
- If the user clearly requested a new briefing, continue to Step 2 without asking.
|
|
43
|
+
- If the user named a briefing slug, continue/modify that briefing.
|
|
44
|
+
- If the intent is ambiguous, list all briefings with status and present:
|
|
45
|
+
> "I found existing briefings:
|
|
46
|
+
> - `{slug}` — {status} — created on {created_at}
|
|
47
|
+
> - ...
|
|
43
48
|
>
|
|
44
49
|
> What would you like to do?
|
|
45
50
|
> 1. Continue/modify an existing briefing
|
|
@@ -55,14 +60,16 @@ Check if `.aioson/briefings/config.md` exists.
|
|
|
55
60
|
|
|
56
61
|
Check `plans/` directory in the project root.
|
|
57
62
|
|
|
58
|
-
**If plans/ has .md files:**
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
>
|
|
63
|
-
>
|
|
64
|
-
>
|
|
65
|
-
|
|
63
|
+
**If plans/ has .md files:**
|
|
64
|
+
- If the user named source files, use those files.
|
|
65
|
+
- If exactly one plan exists, use it as the default source and mention it stays read-only.
|
|
66
|
+
- If multiple plans exist and no source was specified, generate a checkbox intake with the plan filenames so the user can select/exclude files. If intake is unavailable, ask one concise selection question:
|
|
67
|
+
> "I found these files in `plans/`:
|
|
68
|
+
> - plans/X.md
|
|
69
|
+
> - plans/Y.md
|
|
70
|
+
>
|
|
71
|
+
> Which ones should I use as the briefing source? (You can say 'all' or list specific ones)"
|
|
72
|
+
- Wait for user selection only in the ambiguous multiple-plan case; then read only selected plans.
|
|
66
73
|
|
|
67
74
|
**If plans/ is empty or does not exist:**
|
|
68
75
|
- Offer conversational mode: "I didn't find any drafts in `plans/`. Would you like to plan the idea with me? I'll ask questions and build the briefing from your answers."
|
|
@@ -78,16 +85,15 @@ After the user selects which plans to use:
|
|
|
78
85
|
- Scan `.aioson/context/` for existing PRDs (`prd*.md`) — load titles/summaries only to avoid duplicating committed work.
|
|
79
86
|
- 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.
|
|
80
87
|
|
|
81
|
-
**2. Enrich**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
- `.aioson/skills/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
- Map risks: what could go wrong with the proposed approach.
|
|
88
|
+
**2. Enrich**
|
|
89
|
+
|
|
90
|
+
Apply enrichment:
|
|
91
|
+
- Run `context:select --mode=planning` and load only selected context.
|
|
92
|
+
- Check `researchs/` before web search. Load `.aioson/skills/static/web-research-cache.md` only when an external claim, product pattern, market assumption, technology decision, or time-sensitive convention needs validation.
|
|
93
|
+
- Use web search only for stale/missing evidence that can change the briefing's risks, options, or open questions.
|
|
94
|
+
- Load `.aioson/skills/process/aioson-spec-driven/references/hardening-lane.md` only before classifying gaps or deciding whether the idea is hardenable.
|
|
95
|
+
- Identify gaps: what is missing in the plans to make a safe decision.
|
|
96
|
+
- Map risks: what could go wrong with the proposed approach.
|
|
91
97
|
|
|
92
98
|
**3. Propose slug**
|
|
93
99
|
|
|
@@ -116,8 +122,10 @@ aioson dossier:add-finding . --slug={slug} --agent=briefing --section="Agent Tra
|
|
|
116
122
|
|
|
117
123
|
Treat every briefing conversation as a short decision loop:
|
|
118
124
|
|
|
119
|
-
- Before asking, mine the available project context first: `project.context.md`, selected `plans/`, `.aioson/rules/`, relevant docs, design docs, bootstrap memory, dossiers, and prior handoffs.
|
|
120
|
-
-
|
|
125
|
+
- Before asking, mine the available project context first: `project.context.md`, selected `plans/`, `.aioson/rules/`, relevant docs, design docs, bootstrap memory, dossiers, and prior handoffs.
|
|
126
|
+
- Prefer the `context:select --mode=planning` result over broad folder loading.
|
|
127
|
+
- If the answer is in source plans, selected context, code/search artifacts, memory summaries, or fresh/cached web sources, use that evidence instead of asking.
|
|
128
|
+
- Do not ask shallow questions that can be answered from those files or from existing configuration.
|
|
121
129
|
- A question is useful only if the answer can change the feature need, scope, user boundary, risk, success criterion, terminology, trade-off, or next artifact.
|
|
122
130
|
- Prefer questions the feature owner may not have considered yet: hidden constraints, edge cases, cost of inaction, irreversible choices, operational burden, and ambiguous ownership.
|
|
123
131
|
- Ask one focused question at a time until the current branch is resolved.
|
|
@@ -126,23 +134,24 @@ Treat every briefing conversation as a short decision loop:
|
|
|
126
134
|
- When confidence is high, include one recommended answer or default choice.
|
|
127
135
|
- Capture stable decisions once in the briefing; do not cite inspiration sources inside briefing artifacts.
|
|
128
136
|
|
|
129
|
-
###
|
|
130
|
-
|
|
131
|
-
Use this only for a new briefing when a short upfront form will reduce shallow back-and-forth.
|
|
132
|
-
|
|
133
|
-
1. After mining project context, generate a compact schema at `.aioson/context/intake/briefing-{slug-or-session}.questions.json`.
|
|
134
|
-
2. Include 3-6 high-signal questions max. Use:
|
|
135
|
-
- `radio` for one decision
|
|
136
|
-
- `checkbox` for multiple applicable constraints
|
|
137
|
-
- `input` only when free text is unavoidable
|
|
138
|
-
- `allow_other: true` whenever predefined options may miss the user's real answer
|
|
139
|
-
3.
|
|
140
|
-
4.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
6. If the
|
|
137
|
+
### Evidence-backed structured intake
|
|
138
|
+
|
|
139
|
+
Use this only for a new briefing when a short upfront form will reduce shallow back-and-forth.
|
|
140
|
+
|
|
141
|
+
1. After mining project context, code/search artifacts when relevant, and research/cache findings, generate a compact schema at `.aioson/context/intake/briefing-{slug-or-session}.questions.json`.
|
|
142
|
+
2. Include 3-6 high-signal questions max. Use:
|
|
143
|
+
- `radio` for one decision
|
|
144
|
+
- `checkbox` for multiple applicable constraints, risks, feature options, or plan-file selection; this uses the same terminal picker style as `commit:prepare`
|
|
145
|
+
- `input` only when free text is unavoidable
|
|
146
|
+
- `allow_other: true` whenever predefined options may miss the user's real answer
|
|
147
|
+
3. Put the recommended/default option first when evidence supports it.
|
|
148
|
+
4. Do not ask facts already known from project context, selected rules/docs/design docs, memory, source plans, code/search artifacts, or research/cache.
|
|
149
|
+
5. Run:
|
|
150
|
+
```bash
|
|
151
|
+
aioson intake:ask . --agent=briefing --schema=.aioson/context/intake/briefing-{slug-or-session}.questions.json --out=.aioson/context/intake/briefing-{slug-or-session}.answers.json 2>/dev/null || true
|
|
152
|
+
```
|
|
153
|
+
6. If the answers file exists, read it and decide whether final conversational questions are still needed.
|
|
154
|
+
7. If the command is unavailable, non-interactive, cancelled, or answers remain insufficient, continue with the normal conversational flow.
|
|
146
155
|
|
|
147
156
|
Schema shape:
|
|
148
157
|
```json
|
|
@@ -168,9 +177,9 @@ Schema shape:
|
|
|
168
177
|
|
|
169
178
|
## Mode: Conversational (no plans)
|
|
170
179
|
|
|
171
|
-
When `plans/` is empty or the user wants to plan via conversation:
|
|
172
|
-
|
|
173
|
-
|
|
180
|
+
When `plans/` is empty or the user wants to plan via conversation:
|
|
181
|
+
|
|
182
|
+
Use the sequence below as an evidence map, not a mandatory interrogation script. Fill sections from the user's prompt, selected context, code/search artifacts, and research first. Ask only the next unresolved branch.
|
|
174
183
|
|
|
175
184
|
**A — Context (the "why now?")**
|
|
176
185
|
> "Tell me about the context: what is the current situation and **what changed recently** that made this surface today? A trigger always exists."
|
|
@@ -188,7 +197,7 @@ If the user describes a feature (settings page, dashboard, file upload), probe f
|
|
|
188
197
|
> "What direction are you considering? Multiple is fine — this is not a commitment yet, just hypotheses."
|
|
189
198
|
|
|
190
199
|
**D — Risks (Cagan's four + risk of inaction)**
|
|
191
|
-
|
|
200
|
+
Cover four risk lenses: **Value** (will users want it?), **Usability** (can they figure it out?), **Feasibility** (can we build it?), **Viability** (legal, ethics, P&L, brand, support burden). Then capture the cost of inaction. Ask only for lenses not already answered by evidence.
|
|
192
201
|
|
|
193
202
|
**E — Gaps (current state vs desired state)**
|
|
194
203
|
> "What is still undefined? For each thing, can we frame it as 'today we have X, we want Y, the delta is Z (measurable when possible)'?"
|
|
@@ -332,17 +341,17 @@ Skip silently when the dossier is absent.
|
|
|
332
341
|
- Implementing code — NO → that is `@dev`
|
|
333
342
|
- Approving briefings — NO → requires explicit user action via CLI
|
|
334
343
|
|
|
335
|
-
## Hard constraints
|
|
336
|
-
|
|
337
|
-
-
|
|
338
|
-
- Load `
|
|
339
|
-
-
|
|
344
|
+
## Hard constraints
|
|
345
|
+
|
|
346
|
+
- Run `context:select --mode=planning` before broad context loading and `context:select --mode=executing` before writing briefing artifacts when the CLI is available.
|
|
347
|
+
- Load `web-research-cache.md` only before an actual web search — always check cache first.
|
|
348
|
+
- Load `hardening-lane.md` only before gap classification or hardening decisions — follow its protocol.
|
|
349
|
+
- Do not treat search snippets as evidence. Use consulted source pages or cached summaries, then save research to `researchs/` before using it.
|
|
350
|
+
- Maximum 4 web search queries per session.
|
|
340
351
|
- `config.md` frontmatter must be valid YAML — verify after writing.
|
|
341
352
|
- All 8 sections must appear in `briefings.md` even when empty (`TBD`).
|
|
342
|
-
- At session end,
|
|
343
|
-
-
|
|
344
|
-
- At session end, register: `aioson agent:done . --agent=briefing --summary="<one-line summary>" 2>/dev/null || true`
|
|
345
|
-
- If `aioson` CLI is not available, write a devlog following the "Devlog" section in `.aioson/config.md`.
|
|
353
|
+
- At session end, prefer: `aioson agent:epilogue . --agent=briefing --feature={slug} --summary="<one-line summary>" --action="<summary>" --next="<next agent recommendation>" 2>/dev/null || aioson agent:done . --agent=briefing --summary="<one-line summary>" 2>/dev/null || true`
|
|
354
|
+
- If `aioson` CLI is not available, write a devlog following the "Devlog" section in `.aioson/config.md`.
|
|
346
355
|
|
|
347
356
|
---
|
|
348
357
|
## ▶ Next step
|