@massa-ai/claude-plugin 1.63.1 → 1.64.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.
Files changed (43) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/agent-profiles/balanced/code-explorer.md +1 -1
  3. package/agent-profiles/cheap/code-explorer.md +1 -1
  4. package/agent-profiles/heavy/code-explorer.md +1 -1
  5. package/agent-profiles/home/code-explorer.md +1 -1
  6. package/agent-profiles/work/code-explorer.md +1 -1
  7. package/agents/code-explorer.md +1 -1
  8. package/commands/the-fool.md +1 -1
  9. package/package.json +1 -1
  10. package/skills/agents/code-explorer/SKILL.md +1 -1
  11. package/skills/bootstrap/SKILL.md +6 -6
  12. package/skills/massa-ai/SKILL.md +9 -8
  13. package/skills/massa-ai/references/agent-orchestration.md +7 -10
  14. package/skills/massa-ai/references/architecture-lenses.md +1 -21
  15. package/skills/massa-ai/references/artifact-persistence.md +2 -0
  16. package/skills/massa-ai/references/codebase-investigation.md +29 -9
  17. package/skills/massa-ai/references/conversation-feedback.md +18 -38
  18. package/skills/massa-ai/references/create-rfc/quality-and-lifecycle.md +1 -1
  19. package/skills/massa-ai/references/create-tdd/quality-and-lifecycle.md +1 -1
  20. package/skills/massa-ai/references/decision-engine.md +4 -8
  21. package/skills/massa-ai/references/design-implementation.md +27 -26
  22. package/skills/massa-ai/references/lessons.md +13 -20
  23. package/skills/massa-ai/references/mcp-tools.md +11 -24
  24. package/skills/massa-ai/references/mobile-figma-matcher/repository-detection.md +13 -1
  25. package/skills/massa-ai/references/pr-task-fix.md +5 -13
  26. package/skills/massa-ai/references/spec-driven/code-analysis.md +10 -7
  27. package/skills/massa-ai/references/spec-driven/coding-principles.md +14 -49
  28. package/skills/massa-ai/references/spec-driven/memory.md +6 -15
  29. package/skills/massa-ai/references/spec-driven/tasks.md +1 -1
  30. package/skills/massa-ai/references/spec-driven/validate.md +2 -2
  31. package/skills/massa-ai/references/synapse-policy.md +3 -4
  32. package/skills/massa-ai/workflows/create-adr.md +1 -1
  33. package/skills/massa-ai/workflows/create-rfc.md +1 -1
  34. package/skills/massa-ai/workflows/create-tdd.md +1 -1
  35. package/skills/massa-ai/workflows/design.md +1 -1
  36. package/skills/massa-ai/workflows/exploration.md +2 -4
  37. package/skills/massa-ai/workflows/refactor.md +1 -1
  38. package/skills/massa-ai/workflows/refinement/furps-refinement.md +1 -1
  39. package/skills/massa-ai/workflows/spec-driven.md +3 -3
  40. package/skills/massa-ai/workflows/the-fool.md +16 -19
  41. package/skills/massa-ai/references/furps/analyst-role.md +0 -49
  42. package/skills/massa-ai/references/hook-enforcement.md +0 -133
  43. package/skills/massa-ai/references/spec-driven/lessons.md +0 -5
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "massa-ai",
3
- "version": "1.63.1",
3
+ "version": "1.64.0",
4
4
  "description": "massa-ai — semantic code search, durable memory, symbol graph, and context compression",
5
5
  "author": {
6
6
  "name": "Luiz Massa",
@@ -72,7 +72,7 @@ Output:
72
72
  - The work is tightly coupled without a clear owner.
73
73
 
74
74
  ## massa-ai Integration
75
- - Retrieval order: `list_projects` freshness -> `project_map` -> `search(summary)` -> `search(enriched)` -> symbol tools -> `read_file` -> focused shell fallback.
75
+ - Retrieval order: index-first. This charter inherits no other context, so read `references/codebase-investigation.md` §Source Order in full rather than assume the sequence.
76
76
  - Freshness gating: `project_map`, `get_architecture`, `trace_path`, and `impact_analysis` count as evidence only when the index is fresh for the current path and commit/worktree state; otherwise fall back to `search`/`get_references` and record reduced retrieval confidence.
77
77
  - Orphaned-dims recovery: if a vector `search` returns 0 results while other dim tables hold chunks for the project, report to the parent agent that `index` with `forceReindex=true` is required. Do not run it.
78
78
  - Context Firewall: summarize search output, logs, and source reads; return only `path:line` pointers and findings.
@@ -72,7 +72,7 @@ Output:
72
72
  - The work is tightly coupled without a clear owner.
73
73
 
74
74
  ## massa-ai Integration
75
- - Retrieval order: `list_projects` freshness -> `project_map` -> `search(summary)` -> `search(enriched)` -> symbol tools -> `read_file` -> focused shell fallback.
75
+ - Retrieval order: index-first. This charter inherits no other context, so read `references/codebase-investigation.md` §Source Order in full rather than assume the sequence.
76
76
  - Freshness gating: `project_map`, `get_architecture`, `trace_path`, and `impact_analysis` count as evidence only when the index is fresh for the current path and commit/worktree state; otherwise fall back to `search`/`get_references` and record reduced retrieval confidence.
77
77
  - Orphaned-dims recovery: if a vector `search` returns 0 results while other dim tables hold chunks for the project, report to the parent agent that `index` with `forceReindex=true` is required. Do not run it.
78
78
  - Context Firewall: summarize search output, logs, and source reads; return only `path:line` pointers and findings.
@@ -72,7 +72,7 @@ Output:
72
72
  - The work is tightly coupled without a clear owner.
73
73
 
74
74
  ## massa-ai Integration
75
- - Retrieval order: `list_projects` freshness -> `project_map` -> `search(summary)` -> `search(enriched)` -> symbol tools -> `read_file` -> focused shell fallback.
75
+ - Retrieval order: index-first. This charter inherits no other context, so read `references/codebase-investigation.md` §Source Order in full rather than assume the sequence.
76
76
  - Freshness gating: `project_map`, `get_architecture`, `trace_path`, and `impact_analysis` count as evidence only when the index is fresh for the current path and commit/worktree state; otherwise fall back to `search`/`get_references` and record reduced retrieval confidence.
77
77
  - Orphaned-dims recovery: if a vector `search` returns 0 results while other dim tables hold chunks for the project, report to the parent agent that `index` with `forceReindex=true` is required. Do not run it.
78
78
  - Context Firewall: summarize search output, logs, and source reads; return only `path:line` pointers and findings.
@@ -72,7 +72,7 @@ Output:
72
72
  - The work is tightly coupled without a clear owner.
73
73
 
74
74
  ## massa-ai Integration
75
- - Retrieval order: `list_projects` freshness -> `project_map` -> `search(summary)` -> `search(enriched)` -> symbol tools -> `read_file` -> focused shell fallback.
75
+ - Retrieval order: index-first. This charter inherits no other context, so read `references/codebase-investigation.md` §Source Order in full rather than assume the sequence.
76
76
  - Freshness gating: `project_map`, `get_architecture`, `trace_path`, and `impact_analysis` count as evidence only when the index is fresh for the current path and commit/worktree state; otherwise fall back to `search`/`get_references` and record reduced retrieval confidence.
77
77
  - Orphaned-dims recovery: if a vector `search` returns 0 results while other dim tables hold chunks for the project, report to the parent agent that `index` with `forceReindex=true` is required. Do not run it.
78
78
  - Context Firewall: summarize search output, logs, and source reads; return only `path:line` pointers and findings.
@@ -72,7 +72,7 @@ Output:
72
72
  - The work is tightly coupled without a clear owner.
73
73
 
74
74
  ## massa-ai Integration
75
- - Retrieval order: `list_projects` freshness -> `project_map` -> `search(summary)` -> `search(enriched)` -> symbol tools -> `read_file` -> focused shell fallback.
75
+ - Retrieval order: index-first. This charter inherits no other context, so read `references/codebase-investigation.md` §Source Order in full rather than assume the sequence.
76
76
  - Freshness gating: `project_map`, `get_architecture`, `trace_path`, and `impact_analysis` count as evidence only when the index is fresh for the current path and commit/worktree state; otherwise fall back to `search`/`get_references` and record reduced retrieval confidence.
77
77
  - Orphaned-dims recovery: if a vector `search` returns 0 results while other dim tables hold chunks for the project, report to the parent agent that `index` with `forceReindex=true` is required. Do not run it.
78
78
  - Context Firewall: summarize search output, logs, and source reads; return only `path:line` pointers and findings.
@@ -72,7 +72,7 @@ Output:
72
72
  - The work is tightly coupled without a clear owner.
73
73
 
74
74
  ## massa-ai Integration
75
- - Retrieval order: `list_projects` freshness -> `project_map` -> `search(summary)` -> `search(enriched)` -> symbol tools -> `read_file` -> focused shell fallback.
75
+ - Retrieval order: index-first. This charter inherits no other context, so read `references/codebase-investigation.md` §Source Order in full rather than assume the sequence.
76
76
  - Freshness gating: `project_map`, `get_architecture`, `trace_path`, and `impact_analysis` count as evidence only when the index is fresh for the current path and commit/worktree state; otherwise fall back to `search`/`get_references` and record reduced retrieval confidence.
77
77
  - Orphaned-dims recovery: if a vector `search` returns 0 results while other dim tables hold chunks for the project, report to the parent agent that `index` with `forceReindex=true` is required. Do not run it.
78
78
  - Context Firewall: summarize search output, logs, and source reads; return only `path:line` pointers and findings.
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "Use this workflow for direct requests to challenge ideas, plans, decisions, or evidence, and as the configured post-plan challenge gate after other workflows construct a plan. — explicit massa-ai 'the-fool' workflow"
2
+ description: "Use this workflow for direct requests to challenge ideas, plans, decisions, or evidence, and as the post-plan challenge gate after other workflows construct a plan. — explicit massa-ai 'the-fool' workflow"
3
3
  argument-hint: "[task description]"
4
4
  ---
5
5
  <!-- massa-ai:generated workflow-command -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massa-ai/claude-plugin",
3
- "version": "1.63.1",
3
+ "version": "1.64.0",
4
4
  "description": "massa-ai plugin for Claude Code — semantic code search, durable memory, symbol graph, and context compression",
5
5
  "files": [
6
6
  "agents",
@@ -74,7 +74,7 @@ Output:
74
74
  - The work is tightly coupled without a clear owner.
75
75
 
76
76
  ## massa-ai Integration
77
- - Retrieval order: `list_projects` freshness -> `project_map` -> `search(summary)` -> `search(enriched)` -> symbol tools -> `read_file` -> focused shell fallback.
77
+ - Retrieval order: index-first. This charter inherits no other context, so read `references/codebase-investigation.md` §Source Order in full rather than assume the sequence.
78
78
  - Freshness gating: `project_map`, `get_architecture`, `trace_path`, and `impact_analysis` count as evidence only when the index is fresh for the current path and commit/worktree state; otherwise fall back to `search`/`get_references` and record reduced retrieval confidence.
79
79
  - Orphaned-dims recovery: if a vector `search` returns 0 results while other dim tables hold chunks for the project, report to the parent agent that `index` with `forceReindex=true` is required. Do not run it.
80
80
  - Context Firewall: summarize search output, logs, and source reads; return only `path:line` pointers and findings.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: bootstrap
3
- description: Inspect or toggle the massa-ai startup-contract rules (caveman, massa-ai-router, dedupe-guardrails, plan-challenge, conversation-feedback, indexing-hygiene, english-code, code-comments) that the installed MASSA-AI.md delivers to this host. Use when the user asks which startup rules are active, asks to turn one on or off, or asks why a rule is or is not being applied. Do NOT use for editing the rule text itself (that is a massa-ai repository change, not a runtime toggle) and do NOT claim a toggle is live before the user restarts the host session.
3
+ description: Inspect or toggle the massa-ai startup-contract rules (massa-ai-router, dedupe-guardrails, conversation-feedback, indexing-hygiene, english-code, code-comments) that the installed MASSA-AI.md delivers to this host. Use when the user asks which startup rules are active, asks to turn one on or off, or asks why a rule is or is not being applied. Do NOT use for editing the rule text itself (that is a massa-ai repository change, not a runtime toggle) and do NOT claim a toggle is live before the user restarts the host session.
4
4
  license: MIT
5
5
  metadata:
6
6
  author: Luiz Massa
@@ -33,18 +33,18 @@ Run `bootstrap list` before any toggle, so the reported change is against a stat
33
33
  `--target <dir>` exists for scratch homes and requires `--yes`; it redirects only where the contract is *rendered*. The preference itself is always persisted to `~/.config/massa-ai/config.json`, so under a redirected target the CLI names both paths on stderr. Do not pass `--target` unless the user asked for a specific directory.
34
34
 
35
35
  ## The Rule Ids
36
- Exactly eight ids exist, and only these are accepted. There is no protected subset — every one of them can be switched both ways, including `massa-ai-router`.
36
+ Exactly six ids exist, and only these are accepted. There is no protected subset — every one of them can be switched both ways, including `massa-ai-router`.
37
37
 
38
- - `caveman` — keep communication compressed while preserving technical accuracy. Default: enabled.
39
38
  - `massa-ai-router` — load the massa-ai skill as the workflow router before substantive work. Default: enabled.
40
39
  - `dedupe-guardrails` — reuse already-loaded massa-ai context instead of bulk-loading workflows or references. Default: enabled.
41
- - `plan-challenge` — run The Fool as a post-plan challenge gate per the configured policy. Default: enabled.
42
40
  - `conversation-feedback` — emit chat-visible status updates for massa-ai workflow progress. Default: enabled.
43
41
  - `indexing-hygiene` — ignore build output, dependency, and secret paths during indexing and context loading. Default: enabled.
44
42
  - `english-code` — write generated code, identifiers, comments, and commit-facing artifacts in English regardless of conversational language. Default: enabled.
45
43
  - `code-comments` — require API doc blocks and rationale comments on generated code. Default: **disabled**.
46
44
 
47
- Never invent an id. An unrecognised id is refused before anything is read or written, and the error names the id and lists all eight — relay that list rather than guessing what the user meant.
45
+ `caveman` and `plan-challenge` were retired: the CLI refuses them as retired, and a persisted entry for one is skipped silently. The Plan Challenge gate itself still runs — it is fixed workflow behavior in the massa-ai router, no longer a toggle.
46
+
47
+ Never invent an id. An unrecognised id is refused before anything is read or written, and the error names the id and lists all six — relay that list rather than guessing what the user meant.
48
48
 
49
49
  Disabling `massa-ai-router` is allowed and is the user's call. Say plainly that it removes the router which reads the startup contract, and that the recovery is this same CLI (`massa-ai-config bootstrap enable massa-ai-router`), which is a binary and not a rule, so it stays reachable.
50
50
 
@@ -66,7 +66,7 @@ On a dry run, say so and that no files changed.
66
66
 
67
67
  ## Restrictions
68
68
  - Never use an MCP tool for this surface; none exists. The CLI must keep working with the MCP server unreachable.
69
- - Never invent, abbreviate, or pluralise a rule id; use only the eight ids above, exactly as the engine lists them.
69
+ - Never invent, abbreviate, or pluralise a rule id; use only the six ids above, exactly as the engine lists them.
70
70
  - Never hand-edit a delivered `MASSA-AI.md`, a host's `AGENTS.md`, or `~/.config/massa-ai/config.json` to satisfy a toggle request — the engine owns those bytes, and a hand edit is overwritten by the next apply.
71
71
  - Never edit the rule text itself to satisfy a toggle request; that is a massa-ai repository change owned by a different workflow.
72
72
  - Never claim a toggle is live before the affected host's session restarts.
@@ -146,18 +146,19 @@ selected workflow asks for it.
146
146
 
147
147
  ## Plan Challenge Gate
148
148
 
149
- Apply the installed Plan Challenge Policy from `skills/AGENTS.md` (canonical
150
- source); prompt-level instructions override it for the current turn.
149
+ A prompt-level instruction (skip, a mode, append without revising) overrides
150
+ this for the current turn only.
151
151
 
152
- - **Lite** (default, low-risk `feature`/`refactor`): dispatch `judge` in `plan-critique` mode
153
- (`references/agent-modes/judge/plan-critique-lite.md`) with a bounded checklist packet (failing
152
+ - **Lite** (default: `feature`, `refactor`): dispatch `judge` in `plan-critique` mode
153
+ (`references/agent-modes/judge/plan-critique-lite.md`) with a bounded packet (failing
154
154
  assumption, falsifying check, risk/size check, `escalate_to_full:
155
155
  true|false` + reason); skip The Fool references unless it escalates.
156
- - **Full** (`spec-driven`, `design`, `create-adr`/`rfc`/`tdd`, explicit
157
- challenge, high-risk domain, >5 files/modules, or lite escalation): load
158
- `workflows/the-fool.md`, select the mode, dispatch `judge` in `plan-critique`
156
+ - **Full** (`spec-driven`, `design`, `create-adr`, `create-rfc`, `create-tdd`, explicit
157
+ challenge, a rule-5 risk domain, security, data loss, >5 files/modules, or lite escalation): load
158
+ `workflows/the-fool.md`, auto-select the mode, dispatch `judge` in `plan-critique`
159
159
  mode (`references/agent-modes/judge/plan-critique-full.md`) with `fool_mode` in the packet.
160
- - If `judge` is unavailable, run a local fresh-eyes critique and report the
160
+ - Revise the plan for each valid critical/high finding.
161
+ - If `judge` is unavailable, critique locally and report the
161
162
  skipped reason; never retry under a different agent name.
162
163
 
163
164
  ## Retrieval And Synapse
@@ -164,14 +164,12 @@ resolves to a current agent.
164
164
  | `coupling-auditor` | `code-reviewer` | folded in; `mode: audit`, `lens: architecture`, `sub-mode: coupling` |
165
165
  | `deepening-architect` | `code-reviewer` | folded in; `mode: audit`, `lens: architecture`, `sub-mode: deepening` |
166
166
 
167
- The charter names retired by the roster consolidation map to current agents in the
168
- single old→new table of `skills/AGENTS.md`; this file does not repeat it. Workflows
169
- dispatch the current `<role>` name through a named dispatch block — the legacy column
170
- is traceability only, never a dispatch target.
167
+ Workflows dispatch the current `<role>` name through a named dispatch block — the
168
+ legacy column is traceability only, never a dispatch target.
171
169
 
172
170
  ## Capability Packet
173
171
 
174
- **This section is the sole canonical Capability Packet definition.** `references/subagent-design.md` mirrors this list and the root `skills/AGENTS.md` registry points here without restating it. Bespoke packets (judge panel, `product-manager` FURPS dispatch, phase-batch worker) are declared specializations that map onto these fields in their own workflow files.
172
+ **This section is the sole canonical Capability Packet definition.** `references/subagent-design.md` and the root `skills/AGENTS.md` registry point here without restating it. Bespoke packets (judge panel, `product-manager` FURPS dispatch, phase-batch worker) are declared specializations that map onto these fields in their own workflow files.
175
173
 
176
174
  **A subagent inherits nothing from the parent session** — no skills, no loaded references, no conversation history. Everything the subagent needs is named explicitly in the packet, including the exact reference file paths it must read itself.
177
175
 
@@ -282,8 +280,8 @@ Do not expose raw subagent prompts, raw logs, private reasoning, or full output
282
280
  Example:
283
281
 
284
282
  ```md
285
- 🤖 [Agent Started] Verifier is checking the docs-only change set. Scope: massa-ai references and README.
286
- 🤖 [Agent Done] Verifier found no stale references. Skipped checks: none.
283
+ 🤖 [Agent Started] Code Reviewer (verify mode), model `<model>`, effort `<effort>`. Scope: massa-ai references and README.
284
+ 🤖 [Agent Done] Code Reviewer found no stale references. Skipped checks: none.
287
285
  ```
288
286
 
289
287
  ### Model/Effort Announcement
@@ -354,9 +352,8 @@ For `depth: full`, or after lite escalation, the main agent selects the The Fool
354
352
  - confidence impact
355
353
  - exact next step
356
354
 
357
- The main agent owns final synthesis and applies the canonical Plan Challenge
358
- Policy: the `<!-- massa-ai:bootstrap -->` block installed as `<host>/AGENTS.md`,
359
- whose single source is `skills/AGENTS.md` in the product repo.
355
+ The main agent owns final synthesis and applies the fixed Plan Challenge Gate
356
+ in `SKILL.md` §Plan Challenge Gate.
360
357
 
361
358
  ## Memory Rules
362
359
 
@@ -47,27 +47,7 @@ Do not flag strong local coupling as bad when the modules change together and lo
47
47
 
48
48
  ## Deepening Lens
49
49
 
50
- Use these terms exactly:
51
-
52
- - Module: anything with an interface and implementation.
53
- - Interface: everything a caller must know, including invariants, ordering, errors, config, and performance.
54
- - Seam: where an interface lives.
55
- - Adapter: concrete thing satisfying an interface at a seam.
56
- - Depth: leverage at the interface.
57
- - Leverage: capability callers get per unit of interface learned.
58
- - Locality: change, bugs, and verification concentrated in one place.
59
-
60
- Load `references/architecture-deepening-lens.md` when the audit target includes shallow modules, pass-through abstractions, seams, adapters, tests that reach past interfaces, or AI-navigability concerns.
61
-
62
- Check:
63
-
64
- - shallow modules whose interface is nearly as complex as implementation
65
- - pass-through wrappers
66
- - seams with only one adapter and no actual variation
67
- - test-only extraction that loses locality
68
- - concepts split across many files without leverage
69
-
70
- Deletion test: full detail in `references/architecture-deepening-lens.md`.
50
+ Load `references/architecture-deepening-lens.md` when the audit target includes shallow modules, pass-through abstractions, seams, adapters, tests that reach past interfaces, or AI-navigability concerns. That reference owns the vocabulary (Module, Interface, Seam, Adapter, Depth, Leverage, Locality), the Deepening Signals checklist, and the Deletion Test.
71
51
 
72
52
  Only recommend a new seam when variation, dependency direction, external I/O, or test substitution is real.
73
53
 
@@ -13,6 +13,8 @@ Use before any workflow reads or writes durable `.specs/` artifacts. This file o
13
13
 
14
14
  Artifact reads resolve conflicts in this strict order (first match wins): fresh user instruction > approved `.specs/` artifact > STATE/HANDOFF > massa-ai memory. massa-ai memory and external summaries are discovery, not authority. In a repository with no `.specs/project/STATE.md`/`.specs/HANDOFF.md`, the chain simply has fewer links — the ordering is unchanged.
15
15
 
16
+ If a higher source is silent, the next source decides; if a lower source contradicts a higher one, the higher source wins and the lower one is corrected. Record the resolution in STATE so the chain stays auditable.
17
+
16
18
  ## Quick Artifact Templates
17
19
 
18
20
  Quick-sized tasks persist under `.specs/quick/NNN-slug/` — `NNN` zero-padded and sequential per project, `slug` the short kebab-case intent. Exactly two files:
@@ -27,25 +27,45 @@ For exploration-only work, Recon and Debrief are the main deliverables.
27
27
 
28
28
  ## Source Order
29
29
 
30
+ This is the single ordered retrieval list for massa-ai workflows and agents.
31
+ Every other reference (`mcp-tools.md`, `spec-driven/code-analysis.md`,
32
+ `synapse-policy.md`, workflow files, agent charters) points here instead of
33
+ restating it; where a file adds tool-specific parameters, budgets, or a
34
+ tier not listed below, it says so as an explicit delta on top of this order.
35
+
30
36
  Prefer sources in this order:
31
37
 
32
38
  1. `recall` for prior decisions, patterns, failed attempts, and handoffs.
33
39
  2. `list_projects` or equivalent index metadata to verify project ID,
34
- path, status, and freshness.
35
- 3. `project_map` for indexed-project architecture orientation when the
40
+ path, status, and freshness (`lastIndexedAt`).
41
+ 3. `project_map` for indexed-project general architecture orientation when the
36
42
  index is fresh for the current repository path and worktree state.
37
- 4. Summary search, then targeted enriched search.
38
- 5. Symbol tools and `read_file` for exact definitions, usages, and ranges.
39
- 6. `optimized_context` when synthesized compact context is available and more useful
40
- than exact source.
41
- 7. Local `.notebook/INDEX.md` only if the project already uses `.notebook/`.
42
- 8. Focused shell search/read fallback when massa-ai is unavailable, stale, incomplete, or unindexed.
43
- 9. External sources only when current external library/API behavior matters — and then strictly through the ordered chain in `references/knowledge-verification-chain.md` (project docs → Context7 MCP → web search → flag-as-uncertain, unavailable steps recorded as skipped sensors).
43
+ 4. `get_architecture` for architecture-specific deep maps (packages, routes,
44
+ hotspots, communities, cycles) when the index is fresh.
45
+ 5. Summary search, then targeted enriched search. Parameters and default
46
+ budgets for these two modes are a schema delta owned by `mcp-tools.md`
47
+ §Retrieval Order.
48
+ 6. Symbol tools (`search_definitions`, `get_references`, `go_to_definition`)
49
+ and `read_file` for exact definitions, usages, and ranges.
50
+ 7. `symbol_snippet` for raw code snippets by exact file + line range.
51
+ 8. `trace_path` for typed-edge call/data-flow path tracing (fresh index only).
52
+ 9. `impact_analysis` for git-diff centrality-ranked impact (fresh index only).
53
+ 10. `optimized_context` when synthesized compact context is available and more useful
54
+ than exact source.
55
+ 11. Local `.notebook/INDEX.md` only if the project already uses `.notebook/`.
56
+ 12. Focused shell search/read fallback (`rg`, `grep`) when massa-ai is
57
+ unavailable, stale, incomplete, unindexed, or misses obvious local truth. Spec-driven code analysis
58
+ adds one tier here — `sg`/ast-grep for structural pattern search when
59
+ installed, tried before `rg`/`grep`; see
60
+ `references/spec-driven/code-analysis.md` §Tool Priority.
61
+ 13. External sources only when current external library/API behavior matters — and then strictly through the ordered chain in `references/knowledge-verification-chain.md` (project docs → Context7 MCP → web search → flag-as-uncertain, unavailable steps recorded as skipped sensors).
44
62
 
45
63
  Project maps, search results, and optimized context are leads until confirmed
46
64
  against source files read in the current session or returned with current
47
65
  freshness evidence. Current repository source and approved `.specs/` artifacts
48
66
  override indexed context, memories, external summaries, and old handoff notes.
67
+ This is the canonical statement of that rule; other references point here
68
+ instead of restating it.
49
69
 
50
70
  For multi-search investigations, load `references/synapse-policy.md`. Keep the
51
71
  durable `workflowSessionId` separate from the ephemeral Synapse session.
@@ -8,25 +8,18 @@ Conversation feedback is a user-facing progress layer, not a log system. Keep ea
8
8
 
9
9
  ## Policy Source
10
10
 
11
- Read the canonical Conversation Feedback Policy from the installed `AGENTS.md`
12
- bootstrap block (`<!-- massa-ai:bootstrap -->`), whose single source is
13
- `skills/AGENTS.md` in the product repo. If that
14
- file is unavailable, emit concise transition updates automatically, keep each
15
- update to 1-2 lines, and suppress chain-of-thought, raw logs, secrets, and
16
- repeated micro-events.
11
+ The canonical Conversation Feedback Policy — settings, supported label names,
12
+ line shape, worked example, and base rules — is the installed `AGENTS.md` bootstrap
13
+ block (`<!-- massa-ai:bootstrap -->`), whose single source is `skills/AGENTS.md`
14
+ in the product repo. It is always in context, so this file does not repeat it.
15
+ If that block is unavailable, emit concise transition updates automatically,
16
+ keep each update to 1-2 lines, and suppress chain-of-thought, raw logs,
17
+ secrets, and repeated micro-events.
17
18
 
18
- ## Line Shape
19
+ ## Label Meanings
19
20
 
20
- Each status update must be 1-2 lines. Use an emoji, a capitalized label in square brackets, and one or two plain sentences. The worked example is not repeated here — it lives in the canonical policy block named under Policy Source above, which is always in context.
21
-
22
- Avoid terse machine-shaped status lines, lowercase labels, equals-sign syntax, and tiny abbreviations.
23
-
24
- When relevant, compactly surface phase, loaded context, context pressure,
25
- checks, risk, handoff state, queue/delegation state, sync outcome, memory
26
- outcome, skipped checks, and residual risk. Omit fields that do not affect the
27
- next user decision.
28
-
29
- ## Supported Labels
21
+ The policy lists the label names; this is when each non-agent label applies. The four
22
+ `Agent *` labels are defined in `references/agent-orchestration.md`.
30
23
 
31
24
  | Label | Use When |
32
25
  |---|---|
@@ -35,16 +28,19 @@ next user decision.
35
28
  | `Loading` | Reading a rule, skill, workflow, reference, document, NotebookLM source, or other context source. |
36
29
  | `Context` | Reporting memory, search, NotebookLM, source, or repo context that was found or unavailable. |
37
30
  | `Decision` | A meaningful tradeoff, scope decision, workflow choice, or default has been chosen. |
38
- | `Agent Started` | A subagent or delegated role is launched. |
39
- | `Agent Running` | A subagent is active, waiting, or doing a bounded task. |
40
- | `Agent Done` | A subagent returns usable evidence, findings, implementation, or verification. |
41
- | `Agent Blocked` | A subagent cannot complete its assigned scope or needs main-thread/user action. |
42
31
  | `Divergence` | Expected context, paths, plan details, user claims, or repo reality disagree. |
43
32
  | `Warning` | Work can continue, but confidence or verification is limited. |
44
33
  | `Error` | A command, tool, workflow, or required check failed and needs recovery. |
45
34
  | `Verified` | Deterministic checks, source inspection, or artifact validation produced evidence. |
46
35
  | `Finished` | The workflow closes with changed artifacts, memory outcome, and residual risk. |
47
36
 
37
+ ## What To Surface
38
+
39
+ When relevant, compactly surface phase, loaded context, context pressure,
40
+ checks, risk, handoff state, queue/delegation state, sync outcome, memory
41
+ outcome, skipped checks, and residual risk. Omit fields that do not affect the
42
+ next user decision.
43
+
48
44
  ## When To Emit
49
45
 
50
46
  Emit status updates at lifecycle boundaries and during any work phase lasting >30 seconds:
@@ -71,24 +67,8 @@ Use `references/context-firewall.md` when raw output is verbose. Feedback should
71
67
 
72
68
  ## Subagent Feedback
73
69
 
74
- When a subagent is used, the main agent reports only the role, scope, permission mode, current task, and status. Do not expose raw subagent prompts or internal deliberation.
75
-
76
- The `Agent Started` line's model/effort component has one canonical definition — `references/agent-orchestration.md`'s Model/Effort Announcement — not restated here.
77
-
78
- Examples:
79
-
80
- ```md
81
- 🤖 [Agent Started] Verifier is checking the docs-only change set. Scope: massa-ai references and README.
82
- 🤖 [Agent Done] Verifier found no stale references. Skipped checks: none.
83
- ```
70
+ When a subagent is used, the main agent reports only the role, scope, permission mode, current task, and status. Do not expose raw subagent prompts or internal deliberation. The delegated-work labels and the `Agent Started` model/effort component are defined once in `references/agent-orchestration.md` (its delegated-work label list and Model/Effort Announcement), not restated here.
84
71
 
85
72
  ## Completion Feedback
86
73
 
87
74
  Use `Verified` after checks pass or when the strongest available evidence is inspected. Use `Finished` only after the Evidence Gate summary is ready.
88
-
89
- Example:
90
-
91
- ```md
92
- ✅ [Verified] Skill validation and stale-reference scans passed.
93
- 🏁 [Finished] Updated conversation feedback docs. Memory outcome: durable decision stored. Remaining risk: none found.
94
- ```
@@ -46,7 +46,7 @@ Keep focus on whether and which direction should be selected. Route detailed imp
46
46
 
47
47
  ## Plan Challenge Gate
48
48
 
49
- Run the full configured Plan Challenge Gate after the draft exists. Challenge at least:
49
+ Run the full Plan Challenge Gate after the draft exists. Challenge at least:
50
50
 
51
51
  - strongest counterargument to the recommendation
52
52
  - evidence quality and interested-party or vendor bias
@@ -31,7 +31,7 @@ If a blocking item fails, revise the draft or ask the user. Non-blocking gaps re
31
31
 
32
32
  ## Challenge Gate
33
33
 
34
- Run the configured Plan Challenge Gate after the draft exists. For the default full TDD gate, prefer pre-mortem mode unless security/adversarial risk calls for red-team or source claims call for evidence audit.
34
+ Run the Plan Challenge Gate after the draft exists. For the full TDD gate, prefer pre-mortem mode unless security/adversarial risk calls for red-team or source claims call for evidence audit.
35
35
 
36
36
  Challenge at least:
37
37
 
@@ -61,13 +61,9 @@ Before a non-trivial change, ask:
61
61
  Most bugs come from state inconsistency, async/race issues, wrong data-shape
62
62
  assumptions, or environment differences.
63
63
 
64
- Debug loop:
65
-
66
- 1. Recall prior attempts and known patterns.
67
- 2. Define expected vs actual behavior.
68
- 3. Trace input -> transformation -> output.
69
- 4. Check recent changes first.
70
- 5. Test one falsifiable hypothesis at a time.
71
- 6. Persist durable lessons only after scoring.
64
+ For the full diagnosis loop (intake, feedback-loop gate, hypothesis board,
65
+ instrumentation, fix and prevention), see `references/debug-diagnosis-loop.md`.
66
+
67
+ Persist durable lessons only after scoring.
72
68
 
73
69
  Avoid blind whole-repo scans when a targeted recall/search path exists.
@@ -1,26 +1,23 @@
1
1
  # Design-To-Code Implementation Direction
2
2
 
3
- The single normative copy of the mobile UI implementation direction set:
4
- Target Surface Packet, Figma Evidence / Screenshot Context Packet, the
5
- Design-To-Code Mapping Matrix, coherent-slice implementation rules, and
6
- per-slice verification/completion criteria.
3
+ The single normative copy of the design-route direction set on top of the
4
+ mobile-figma-matcher packets: coherent-slice implementation rules and
5
+ per-slice verification/completion criteria. Target Surface Packet
6
+ construction is owned by `references/mobile-figma-matcher/repository-detection.md`;
7
+ the Figma Evidence Packet and the Design-To-Code Mapping Matrix are owned by
8
+ `references/mobile-figma-matcher/core.md`.
7
9
 
8
10
  Loaded by `workflows/design.md` for its direct route (behavior unchanged),
9
11
  and by `spec-driven`/`feature` when Figma ingestion is enabled, so those
10
12
  workflows absorb this direction set by reference instead of restating it.
13
+ Load `references/mobile-figma-matcher/repository-detection.md` and
14
+ `references/mobile-figma-matcher/core.md` alongside this file.
11
15
 
12
16
  ## Target Surface Packet
13
17
 
14
- Build the immutable Target Surface Packet before loading stack guidance.
15
- Classify each selected surface and load only its contracts:
16
-
17
- - Android Views XML -> `references/mobile-figma-matcher/android-views.md`.
18
- - Android Jetpack Compose -> `references/mobile-figma-matcher/android-compose.md`.
19
- - iOS UIKit -> `references/mobile-figma-matcher/ios-uikit.md`.
20
- - iOS SwiftUI -> `references/mobile-figma-matcher/ios-swiftui.md`.
21
- - Shared KMP Compose Multiplatform -> `references/mobile-figma-matcher/kmp-compose-multiplatform.md`
22
- plus native contracts only for selected native source sets, hosts,
23
- wrappers, or runtime targets.
18
+ Load `references/mobile-figma-matcher/repository-detection.md` and build its
19
+ immutable Target Surface Packet before loading stack guidance; that
20
+ reference also owns the platform -> matcher-contract file map.
24
21
 
25
22
  Non-mobile targets under Figma ingestion do not have a matcher contract to
26
23
  classify against; proceed with the wiring recorded in `references/figma-wiring.md`
@@ -28,22 +25,26 @@ and a best-effort implementation contract, and record that class explicitly.
28
25
 
29
26
  ## Figma Evidence / Screenshot Context Packet
30
27
 
31
- Build the Figma Evidence Packet with metadata when needed, design context,
32
- screenshot, variables, current Code Connect mappings, variants/states,
33
- annotations, and asset inventory. For screenshot-only sources, build a
34
- Screenshot Context Packet with provenance, target state, visible constraints,
35
- uncertainty, and `Design Evidence Class: screenshot-context-only`; do not
36
- infer exact Figma tokens, dimensions, variables, variants, or parity from
37
- screenshots alone. Stop if neither structured Figma evidence nor supplied
38
- screenshot context is available.
28
+ Load `references/mobile-figma-matcher/core.md` and build its Figma Evidence
29
+ Packet: metadata when needed, design context, screenshot, variables, current
30
+ Code Connect mappings, variants/states, annotations, and asset inventory.
31
+
32
+ Unlike the audit/fix route (`core.md` Boundaries: "A screenshot or pasted
33
+ description alone is not a design contract"), the design route additionally
34
+ accepts screenshot-only sources: build a Screenshot Context Packet with
35
+ provenance, target state, visible constraints, uncertainty, and `Design
36
+ Evidence Class: screenshot-context-only`; do not infer exact Figma tokens,
37
+ dimensions, variables, variants, or parity from screenshots alone. Stop if
38
+ neither structured Figma evidence nor supplied screenshot context is
39
+ available.
39
40
 
40
41
  ## Design-To-Code Mapping Matrix
41
42
 
42
43
  Resolve current components, tokens, resources, assets, source-set ownership,
43
- platform adapters, requirements, and existing validation sensors. Create the
44
- Design-To-Code Mapping Matrix and one comparison configuration per selected
45
- runtime surface; screenshot-only rows use inferred visual intent, not
46
- `Figma Value`.
44
+ platform adapters, requirements, and existing validation sensors, then build
45
+ `references/mobile-figma-matcher/core.md`'s Design-To-Code Mapping Matrix and
46
+ one comparison configuration per selected runtime surface; screenshot-only
47
+ rows use inferred visual intent, not `Figma Value`.
47
48
 
48
49
  ## Sizing And Verification Recipe
49
50
 
@@ -34,8 +34,8 @@ bun skills/massa-ai/scripts/lessons.ts --root . add \
34
34
 
35
35
  `--project`/`--session`/`--workflow`/`--entity` carry the active massa-ai
36
36
  context onto the lesson so the file store and massa-ai memory stay in the same
37
- recall namespace. They are optional for manual runs but supplied by the
38
- continuous-learning hook loop.
37
+ recall namespace. They are optional for manual runs; pass them whenever the
38
+ active context is known.
39
39
 
40
40
  Do not record one-off tool failures, transient environment issues, methodology opinions, or chat summaries as lessons.
41
41
 
@@ -122,20 +122,12 @@ oldest-first followed by `trend: improving|stable|degrading`, or
122
122
 
123
123
  If `lessons.ts` is unavailable or cannot run, record `Lessons: skipped - script unavailable` in the validation report or evidence gate, keep the raw signal in the report, and do not hand-edit `lessons.json`. A future run with the script can import the validated signal.
124
124
 
125
- ## Continuous-Learning Loop (hook-fed)
125
+ ## Observation Buffer
126
126
 
127
- The lessons layer is a closed loop, not manual-only. Two runtime hooks
128
- (`apps/claude-plugin/hooks/`, installed for Claude Code by the plugin installer) feed it:
129
-
130
- 1. **observe** — `observe_runner.py` (PostToolUse) captures raw tool-use
131
- observations into the gitignored `.specs/observations.json` buffer. Grounding
132
- is NOT assigned here.
133
- 2. **evaluate** — `continuous_learning_evaluate.py` (Stop) reads the active
134
- massa-ai context from `.specs/project/STATE.md` and the observations
135
- buffer. For each observation that already carries grounded fields
136
- (`signal`, `text`, `source`, `feature`), it calls `lessons.ts add` with the
137
- `--project`/`--session`/`--workflow`/`--entity` context. Ungrounded
138
- observations are left in the buffer for agent input and logged as skipped.
127
+ `lessons.ts observe` appends one raw JSON observation to the gitignored
128
+ `.specs/observations.json` buffer. No host hook feeds or drains it today: the
129
+ former hook-fed observe/evaluate loop was removed, so a lesson exists only once
130
+ the agent records it with `lessons.ts add` from a grounded verification signal.
139
131
 
140
132
  ### massa-ai Dual-Write
141
133
 
@@ -149,9 +141,10 @@ and durable memory stay consistent:
149
141
  `memory:procedural`. This puts lessons in the same recall namespace as
150
142
  massa-ai decisions/patterns, so future `recall` surfaces them at
151
143
  Specify/Design.
152
- - massa-ai MCP is agent-side only; the hook/CLI subprocess writes via REST
153
- (`MASSA_AI_API_URL`). When REST is unavailable, the lesson still lands in
154
- `lessons.json` and the skipped memory write is logged (graceful degradation).
144
+ - massa-ai MCP is agent-side only; the CLI subprocess writes via REST
145
+ (`MASSA_AI_API_URL`, 1.5 s timeout). When REST is unset or unavailable, the
146
+ lesson still lands in `lessons.json` and the memory write is dropped silently —
147
+ nothing is logged and the exit code is unchanged (graceful degradation).
155
148
 
156
149
  ### Round-Trip
157
150
 
@@ -166,5 +159,5 @@ best-effort. An ungrounded lesson is refused by both `add` and the massa-ai writ
166
159
  ### Self-Check
167
160
 
168
161
  After verification: if a reusable signal was found but no lesson was recorded,
169
- state the skipped reason. Nothing else records it — the hook loop keeps no skip
170
- log on disk, so your stated reason is the only record.
162
+ state the skipped reason. Nothing else records it — no skip log exists on disk,
163
+ so your stated reason is the only record.