@massa-ai/cursor-plugin 1.56.0 → 1.57.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 (62) hide show
  1. package/.cursor-plugin/plugin.json +1 -1
  2. package/package.json +1 -1
  3. package/skills/agents/architecture-specialist/SKILL.md +1 -1
  4. package/skills/agents/audit-specialist/SKILL.md +1 -1
  5. package/skills/agents/builder/SKILL.md +1 -1
  6. package/skills/agents/context-curator/SKILL.md +1 -1
  7. package/skills/agents/designer/SKILL.md +1 -1
  8. package/skills/agents/documentation-agent/SKILL.md +1 -1
  9. package/skills/agents/furps-analyst/SKILL.md +1 -1
  10. package/skills/agents/investigator/SKILL.md +1 -1
  11. package/skills/agents/judge/SKILL.md +1 -1
  12. package/skills/agents/meta-judge/SKILL.md +1 -1
  13. package/skills/agents/mobile-specialist/SKILL.md +1 -1
  14. package/skills/agents/navigator/SKILL.md +1 -1
  15. package/skills/agents/plan-critic/SKILL.md +1 -1
  16. package/skills/agents/planner/SKILL.md +1 -1
  17. package/skills/agents/requirements-analyst/SKILL.md +1 -1
  18. package/skills/agents/reviewer/SKILL.md +1 -1
  19. package/skills/agents/test-engineer/SKILL.md +1 -1
  20. package/skills/agents/verification-agent/SKILL.md +1 -1
  21. package/skills/massa-ai/SKILL.md +2 -1
  22. package/skills/massa-ai/references/agent-orchestration.md +41 -4
  23. package/skills/massa-ai/references/audit-scope.md +1 -1
  24. package/skills/massa-ai/references/code-quality-lens.md +107 -0
  25. package/skills/massa-ai/references/code-reuse-scan.md +0 -1
  26. package/skills/massa-ai/references/implementation-delivery.md +6 -3
  27. package/skills/massa-ai/references/skill-architect/authoring-principles.md +37 -0
  28. package/skills/massa-ai/references/verification-ladder.md +2 -0
  29. package/skills/massa-ai/scripts/check_commit.ts +4 -1
  30. package/skills/massa-ai/scripts/ensure_worktree.ts +311 -0
  31. package/skills/massa-ai/scripts/resolve_scope.ts +263 -0
  32. package/skills/massa-ai/scripts/size_change.ts +227 -0
  33. package/skills/massa-ai/workflows/architecture/architecture-audit.md +1 -15
  34. package/skills/massa-ai/workflows/architecture/architecture-fix.md +1 -8
  35. package/skills/massa-ai/workflows/bugs/bugs-audit.md +1 -13
  36. package/skills/massa-ai/workflows/bugs/bugs-fix.md +1 -9
  37. package/skills/massa-ai/workflows/code-quality/code-quality-audit.md +3 -34
  38. package/skills/massa-ai/workflows/code-quality/code-quality-fix.md +3 -17
  39. package/skills/massa-ai/workflows/commit.md +6 -6
  40. package/skills/massa-ai/workflows/debug.md +2 -9
  41. package/skills/massa-ai/workflows/design.md +0 -6
  42. package/skills/massa-ai/workflows/exploration.md +0 -1
  43. package/skills/massa-ai/workflows/feature.md +2 -15
  44. package/skills/massa-ai/workflows/general.md +1 -16
  45. package/skills/massa-ai/workflows/implementation/implementation-audit.md +0 -1
  46. package/skills/massa-ai/workflows/implementation/implementation-fix.md +1 -15
  47. package/skills/massa-ai/workflows/judge-with-debate.md +0 -2
  48. package/skills/massa-ai/workflows/maestro/maestro-fix.md +1 -8
  49. package/skills/massa-ai/workflows/mobile-figma/mobile-figma-audit.md +0 -6
  50. package/skills/massa-ai/workflows/mobile-figma/mobile-figma-fix.md +1 -14
  51. package/skills/massa-ai/workflows/pr-review.md +0 -3
  52. package/skills/massa-ai/workflows/refactor.md +2 -9
  53. package/skills/massa-ai/workflows/refinement/furps-refinement.md +0 -1
  54. package/skills/massa-ai/workflows/requirements/requirements-audit.md +1 -13
  55. package/skills/massa-ai/workflows/requirements/requirements-fix.md +1 -8
  56. package/skills/massa-ai/workflows/security/security-audit.md +1 -13
  57. package/skills/massa-ai/workflows/security/security-fix.md +1 -9
  58. package/skills/massa-ai/workflows/skill-architect.md +7 -39
  59. package/skills/massa-ai/workflows/spec-driven.md +0 -11
  60. package/skills/massa-ai/workflows/tests/tests-audit.md +1 -13
  61. package/skills/massa-ai/workflows/tests/tests-fix.md +1 -8
  62. package/skills/massa-ai/workflows/to-prd.md +0 -1
@@ -31,15 +31,9 @@ Not for Flutter, React Native, web UI, generic Figma exploration, variable-only
31
31
  **Screen work — before writing or judging any user-facing screen:** when this task creates or modifies a screen, the `massa-ai-designer` dispatch below is mandatory rather than discretionary, carved out of ordinary delegation gating by the Screen Implementation Exception in `references/agent-orchestration.md`. It does not fire when the task touches no screen surface.
32
32
 
33
33
  > **Dispatch: `massa-ai-designer`** (role: `designer`) — charter `skills/agents/designer/SKILL.md`
34
- > - trigger: the task creates or modifies a user-facing screen — mandatory once that condition holds, per the Screen Implementation Exception in `references/agent-orchestration.md`; it does not fire when no screen surface is touched
35
34
  > - scope: the screens, views, components, layouts, styles, and design tokens in this task's UI surface — never the whole repository
36
35
  > - permissions: write, scoped to UI-layer files only with a disjoint write set
37
- > - inputs: exact `projectId`, parent `workflowSessionId`, Figma links/node ids or screenshots when supplied, acceptance criteria, the repository's existing UI conventions and design tokens, recalled screen patterns
38
- > - sensors: Figma MCP read when a design source exists; per-element expected-vs-actual comparison; the UI module's own build/lint; the states a design under-specifies — empty, loading, error, long text, small and large sizes
39
36
  > - output: per-element conformance table (element, expected, actual, verdict, severity) plus the UI files written; a missing or unreachable design source is listed as a skipped sensor, never a silent pass
40
- > - firewall: summarized design-source evidence and `path:line` pointers only, never raw Figma node dumps or full file bodies
41
- > - memory: suggest-only; the main agent persists durable screen and design-token conventions
42
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
43
37
 
44
38
  ## Examples
45
39
 
@@ -62,7 +62,6 @@ When researching or resolving any technical question during exploration, follow
62
62
  > - output: entry points, core flow, dependencies, data ownership, relevant contracts, exact evidence pointers (path, symbol, line), confirmed facts vs inferences
63
63
  > - firewall: raw logs, snapshots, generated reports, and broad search output summarized, not returned raw
64
64
  > - memory: suggest-only; main agent persists durable discoveries
65
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
66
65
 
67
66
  - Follow the shared retrieval order: project map, summary search, targeted
68
67
  enriched search, symbol/file tools, optimized context, then focused shell
@@ -26,7 +26,7 @@ Before the first repository mutation, load `references/implementation-delivery.m
26
26
  - `references/codebase-investigation.md` when the target area is unfamiliar
27
27
  - `references/mobile-context.md` when the feature touches KMP, iOS, Android, native bridges, mobile lifecycle, offline sync, permissions, push/background behavior, local persistence, or backend-mobile contracts
28
28
  - `references/verification-ladder.md` before Quick/Standard/Spec-driven sizing or edits
29
- - `references/context-firewall.md` when source, logs, docs, or tool output meets its threshold table (a single source/log/doc block >200 lines, >20 KB, or >50 search hits)
29
+ - `references/context-firewall.md` when source, logs, docs, or tool output meets its threshold table
30
30
  - `references/naming-standards.md` before writing or renaming code identifiers, public contract fields, tests, fixtures, or implementation-facing design names
31
31
  - `references/pr-task-fix.md` when the verification ladder trigger table applies
32
32
  - `references/lessons.md` when `.specs/lessons.json` exists, to load confirmed project lessons before sizing
@@ -57,15 +57,9 @@ Before the first repository mutation, load `references/implementation-delivery.m
57
57
  **Screen work — before writing or judging any user-facing screen:** when this task creates or modifies a screen, the `massa-ai-designer` dispatch below is mandatory rather than discretionary, carved out of ordinary delegation gating by the Screen Implementation Exception in `references/agent-orchestration.md`. It does not fire when the task touches no screen surface.
58
58
 
59
59
  > **Dispatch: `massa-ai-designer`** (role: `designer`) — charter `skills/agents/designer/SKILL.md`
60
- > - trigger: the task creates or modifies a user-facing screen — mandatory once that condition holds, per the Screen Implementation Exception in `references/agent-orchestration.md`; it does not fire when no screen surface is touched
61
60
  > - scope: the screens, views, components, layouts, styles, and design tokens in this task's UI surface — never the whole repository
62
61
  > - permissions: write, scoped to UI-layer files only with a disjoint write set
63
- > - inputs: exact `projectId`, parent `workflowSessionId`, Figma links/node ids or screenshots when supplied, acceptance criteria, the repository's existing UI conventions and design tokens, recalled screen patterns
64
- > - sensors: Figma MCP read when a design source exists; per-element expected-vs-actual comparison; the UI module's own build/lint; the states a design under-specifies — empty, loading, error, long text, small and large sizes
65
62
  > - output: per-element conformance table (element, expected, actual, verdict, severity) plus the UI files written; a missing or unreachable design source is listed as a skipped sensor, never a silent pass
66
- > - firewall: summarized design-source evidence and `path:line` pointers only, never raw Figma node dumps or full file bodies
67
- > - memory: suggest-only; the main agent persists durable screen and design-token conventions
68
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
69
63
 
70
64
  > **Dispatch: `massa-ai-reviewer`** (role: `reviewer`) — charter `skills/agents/reviewer/SKILL.md`
71
65
  > - trigger: implementation complete, before the verification gate — never optional
@@ -76,22 +70,18 @@ Before the first repository mutation, load `references/implementation-delivery.m
76
70
  > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
77
71
  > - firewall: summarized findings only, never raw diff dumps
78
72
  > - memory: suggest-only; main agent persists
79
- > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract and record the skipped-delegation reason
80
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
81
73
 
82
74
  > **Dispatch: `massa-ai-verification-agent`** (role: `verification-agent`) — charter `skills/agents/verification-agent/SKILL.md`
83
75
  > - trigger: Standard tier or above per the Independent Verification Mandate in `references/verification-ladder.md` — mandatory once every implemented PR group has cleared reviewer fix items; Quick tier substitutes the fallback below
84
76
  > - scope: the new code landed across this feature's PR groups from step 12, plus the tests and validation assets those groups touch
85
- > - permissions: read-only
86
77
  > - inputs: the 1-5 acceptance criteria captured in step 11 (or the referenced spec artifact) as the outcome source, the feature's diff surface across all PR groups, and its test suite
87
78
  > - sensors: check the diff and tests against each acceptance criterion; discrimination sensor per `references/discrimination-sensor.md` (mutate the feature's new code, one PR group at a time — covering tests must kill each mutant or that group is not verified)
88
79
  > - output: a pass/fail verdict per acceptance criterion, any surviving-mutant findings, and an overall verified/blocked verdict per PR group
89
80
  > - firewall: summarized per-AC and per-mutant findings only, never raw diff dumps
90
81
  > - memory: suggest-only; main agent persists feature verification outcomes
91
82
  > - fallback: if the subagent is unavailable, run a standalone fresh-eyes re-check of each AC against the diff and tests, and record the skipped-delegation reason
92
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
93
83
 
94
- If verification fails, bound the retry with the Bounded Fix→Re-verify Loop cap from `references/verification-ladder.md`: at most 3 fix→re-verify iterations on the same PR group before reporting `Blocked`. This cap governs the post-implementation review/verify cycle and is distinct from the two-consecutive-failed-fixes trigger earlier in this file that loads `references/root-cause-scripts.md`, which fires on repeated failed attempts to fix one symptom during implementation itself.
84
+ If verification fails, bound the retry with the Bounded Fix→Re-verify Loop cap from `references/verification-ladder.md`: at most 3 fix→re-verify iterations on the same PR group before reporting `Blocked`.
95
85
 
96
86
  13. Run the verification recipe and check outcomes against the captured acceptance criteria from step 11, not only against a generic verification recipe; report skipped checks explicitly. At Standard tier and above, back this with `bun skills/massa-ai/scripts/validate_state.ts <slug>` against the persisted `validation.md` — it must be real, report `PASS`, and cite `file:line` evidence per acceptance criterion. If no code-execution tool is available, run the same checks by reading the artifact (graceful degradation preserved). If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
97
87
  `bun skills/massa-ai/scripts/lessons.ts --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
@@ -100,6 +90,3 @@ If verification fails, bound the retry with the Bounded Fix→Re-verify Loop cap
100
90
  - New patterns introduced via `remember` as scored `pattern` memories
101
91
  - Trade-offs accepted via `remember` as scored `conversation` memories
102
92
  15. Complete the Evidence Gate from `references/evidence-gate.md`
103
-
104
- <!-- validator anchors: massa-ai-verification-agent dispatch block; Independent Verification Mandate (Standard tier and above); Bounded Fix→Re-verify Loop cap (3 iterations); validate_state.ts <slug> deterministic backing; graceful degradation preserved; .specs/quick/NNN-slug/TASK.md and SUMMARY.md; .specs/features/<slug>/spec.md and validation.md; one feature-level delivery go-ahead across PR groups -->
105
-
@@ -29,7 +29,7 @@ Before the first repository mutation, load `references/implementation-delivery.m
29
29
  - deepen into enriched search, symbols, or exact files only when needed
30
30
  - prefer `read_file` over native Read when symbol metadata + imports are useful (retrieval order per `references/mcp-tools.md`); use `symbol_snippet` for raw code snippets by file + line range
31
31
  - prefer current repository truth over stale or conflicting memories
32
- 6. Execute the requested work using existing repository conventions. Load `references/naming-standards.md` before introducing or renaming identifiers, screens, components, attributes, or implementation-facing names (English-conversion rule applies). Tie verification depth to the Verification Ladder tier table in `references/verification-ladder.md`: Quick (<=3 files and <=200 changed LOC) runs static + file-integrity checks; Standard (<=10 files or <=500 changed LOC) adds a named verification recipe and behavioral checks; Spec-driven (>10 files, >500 changed LOC) escalates to `workflows/spec-driven.md`. Do not invent new thresholds; load specialized references only when the task needs their exact contracts.
32
+ 6. Execute the requested work using existing repository conventions. Load `references/naming-standards.md` before introducing or renaming identifiers, screens, components, attributes, or implementation-facing names (English-conversion rule applies). Tie verification depth to the Verification Ladder tier table in `references/verification-ladder.md`, sizing the change with `bun skills/massa-ai/scripts/size_change.ts`: Quick runs static + file-integrity checks; Standard adds a named verification recipe and behavioral checks; Spec-driven escalates to `workflows/spec-driven.md`. Do not invent new thresholds; load specialized references only when the task needs their exact contracts.
33
33
  - For analysis that benefits from running code (derived values, data inspection, bulk transforms), call `execute` with `language` and `code` or `batch_execute` with `commands`[] instead of loading raw data into context. Respect the local-dev-only trust model (no untrusted-client exposure).
34
34
  - When the chosen approach leans on an external library's or API's exact behavior, resolve it through the 5-step chain in `references/knowledge-verification-chain.md` (codebase, project docs, Context7, web, flag-uncertain) before committing to that approach — the trigger is the dependence itself, not the task's Quick/Standard/Spec-driven tier.
35
35
  7. Use `compress` only when accumulated source or conversation context is reducing execution quality; preserve decisions, constraints, current state, and next steps rather than raw history.
@@ -43,15 +43,9 @@ Before the first repository mutation, load `references/implementation-delivery.m
43
43
  **Screen work — before writing or judging any user-facing screen:** when this task creates or modifies a screen, the `massa-ai-designer` dispatch below is mandatory rather than discretionary, carved out of ordinary delegation gating by the Screen Implementation Exception in `references/agent-orchestration.md`. It does not fire when the task touches no screen surface.
44
44
 
45
45
  > **Dispatch: `massa-ai-designer`** (role: `designer`) — charter `skills/agents/designer/SKILL.md`
46
- > - trigger: the task creates or modifies a user-facing screen — mandatory once that condition holds, per the Screen Implementation Exception in `references/agent-orchestration.md`; it does not fire when no screen surface is touched
47
46
  > - scope: the screens, views, components, layouts, styles, and design tokens in this task's UI surface — never the whole repository
48
47
  > - permissions: write, scoped to UI-layer files only with a disjoint write set
49
- > - inputs: exact `projectId`, parent `workflowSessionId`, Figma links/node ids or screenshots when supplied, acceptance criteria, the repository's existing UI conventions and design tokens, recalled screen patterns
50
- > - sensors: Figma MCP read when a design source exists; per-element expected-vs-actual comparison; the UI module's own build/lint; the states a design under-specifies — empty, loading, error, long text, small and large sizes
51
48
  > - output: per-element conformance table (element, expected, actual, verdict, severity) plus the UI files written; a missing or unreachable design source is listed as a skipped sensor, never a silent pass
52
- > - firewall: summarized design-source evidence and `path:line` pointers only, never raw Figma node dumps or full file bodies
53
- > - memory: suggest-only; the main agent persists durable screen and design-token conventions
54
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
55
49
 
56
50
  > **Dispatch: `massa-ai-reviewer`** (role: `reviewer`) — charter `skills/agents/reviewer/SKILL.md`
57
51
  > - trigger: implementation complete, before the verification gate — never optional
@@ -62,20 +56,16 @@ Before the first repository mutation, load `references/implementation-delivery.m
62
56
  > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
63
57
  > - firewall: summarized findings only, never raw diff dumps
64
58
  > - memory: suggest-only; main agent persists
65
- > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract and record the skipped-delegation reason
66
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
67
59
 
68
60
  > **Dispatch: `massa-ai-verification-agent`** (role: `verification-agent`) — charter `skills/agents/verification-agent/SKILL.md`
69
61
  > - trigger: fallback work reaching Standard+ on the Verification Ladder, or any Quick-sized change inside the risk-domain set named in step 3 (public API, data loss, auth/PII, migrations, cross-service) — the Independent Verification Mandate in `references/verification-ladder.md` applies at that gate even when file/LOC counts stay Quick
70
62
  > - scope: the fallback change's diff surface plus the acceptance evidence gathered while executing step 6
71
- > - permissions: read-only
72
63
  > - inputs: diff, the General fallback preflight rationale, reviewer findings, recalled conventions
73
64
  > - sensors: independent outcome-vs-request re-check; discrimination sensor per `references/discrimination-sensor.md`, mutating the fallback change's own logic in scratch state
74
65
  > - output: PASS/FAIL verdict with per-check evidence recorded in `.specs/quick/NNN-slug/SUMMARY.md`
75
66
  > - firewall: summarized findings only, never raw diff dumps
76
67
  > - memory: suggest-only; main agent persists general-workflow verification outcomes
77
68
  > - fallback: if the subagent is unavailable, run a standalone fresh-eyes re-check of the change against its acceptance evidence and record the skipped-delegation reason
78
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
79
69
 
80
70
  9. At Standard+ size, persist `.specs/quick/NNN-slug/TASK.md` and `SUMMARY.md` using the templates in `references/artifact-persistence.md`, then run `bun skills/massa-ai/scripts/check_specs_delivered.ts <slug> --kind quick` before the Evidence Gate — a non-zero exit blocks completion. If no code-execution tool is available, run the same checks by reading the artifact (graceful degradation preserved).
81
71
  10. Complete the Evidence Gate from `references/evidence-gate.md` and report verification, changed artifacts, memory outcome, and residual risk.
@@ -87,8 +77,6 @@ On any tool/index/MCP failure, follow `references/graceful-degradation.md` (also
87
77
  - `.specs/` directory missing or not writable: block quick-artifact and onboarding-doc writes per `references/artifact-persistence.md`'s unwritable-→-block rule; do not fall back to memory or chat.
88
78
  - Verifier fix→re-verify loop reaches the cap in `references/verification-ladder.md`'s Bounded Fix→Re-verify Loop: stop with `Blocked`, preserve the evidence collected, and ask the user for direction.
89
79
 
90
- **Disambiguation — two different counters:** the loop cap above counts *verification* iterations on the fallback change as a whole. It is separate from the two-consecutive-failed-fix trigger near the top of this workflow that loads `references/root-cause-scripts.md` — that one counts *edit attempts* on a single symptom inside one iteration. Neither counter resets or consumes the other.
91
-
92
80
  ## Output Contract
93
81
 
94
82
  - Goal and selected fallback workflow
@@ -98,6 +86,3 @@ On any tool/index/MCP failure, follow `references/graceful-degradation.md` (also
98
86
  - Verification performed and skipped checks
99
87
  - Memory written or intentionally skipped, with reason
100
88
  - Residual risk
101
-
102
- <!-- validator anchors: massa-ai-verification-agent dispatch block; Independent Verification Mandate; risk-domain set named in step 3; check_specs_delivered.ts --kind quick; .specs/quick/NNN-slug/SUMMARY.md; Minimum Bar sweep; .specs/project/onboarding/; Bounded Fix→Re-verify Loop; Disambiguation — two different counters; Stage 3 delivery authorization -->
103
-
@@ -49,7 +49,6 @@ Not for a single requested audit lens — route directly to that lens. Do not ed
49
49
  > - output: `Status`, `Scope checked`, `Evidence`, `Findings`, `Verification/Test Fidelity Checklist`, `Risks and skipped checks`, and `Exact next step`
50
50
  > - firewall: raw diffs/logs/search output summarized, not returned raw
51
51
  > - memory: suggest-only; children must not persist broad project memory unless assigned
52
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
53
52
 
54
53
  - Repeated-search children receive isolated Synapse sessions. Durable child tags retain the parent session and workflow-specific session.
55
54
  8. Use deterministic sensors when target-relevant commands are expected to finish in <=5 minutes and need no network, destructive action, production credential, or unapproved external service: tests, builds, lint, type checks, static checks, import checks, or focused runtime commands. Record skipped commands with one reason enum: `too-expensive`, `needs-network`, `needs-credentials`, `destructive-risk`, `outside-scope`, `tool-missing`, or `not-applicable`. Model judgment alone is not completion evidence.
@@ -65,15 +65,9 @@ Do not execute from chat summaries, inline review comments, remembered findings,
65
65
  **Screen work — before writing or judging any user-facing screen:** when this task creates or modifies a screen, the `massa-ai-designer` dispatch below is mandatory rather than discretionary, carved out of ordinary delegation gating by the Screen Implementation Exception in `references/agent-orchestration.md`. It does not fire when the task touches no screen surface.
66
66
 
67
67
  > **Dispatch: `massa-ai-designer`** (role: `designer`) — charter `skills/agents/designer/SKILL.md`
68
- > - trigger: the task creates or modifies a user-facing screen — mandatory once that condition holds, per the Screen Implementation Exception in `references/agent-orchestration.md`; it does not fire when no screen surface is touched
69
68
  > - scope: the screens, views, components, layouts, styles, and design tokens in this task's UI surface — never the whole repository
70
69
  > - permissions: write, scoped to UI-layer files only with a disjoint write set
71
- > - inputs: exact `projectId`, parent `workflowSessionId`, Figma links/node ids or screenshots when supplied, acceptance criteria, the repository's existing UI conventions and design tokens, recalled screen patterns
72
- > - sensors: Figma MCP read when a design source exists; per-element expected-vs-actual comparison; the UI module's own build/lint; the states a design under-specifies — empty, loading, error, long text, small and large sizes
73
70
  > - output: per-element conformance table (element, expected, actual, verdict, severity) plus the UI files written; a missing or unreachable design source is listed as a skipped sensor, never a silent pass
74
- > - firewall: summarized design-source evidence and `path:line` pointers only, never raw Figma node dumps or full file bodies
75
- > - memory: suggest-only; the main agent persists durable screen and design-token conventions
76
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
77
71
 
78
72
  > **Dispatch: `massa-ai-builder`** (role: `builder`) — charter `skills/agents/builder/SKILL.md`
79
73
  > - trigger: isolated finding with disjoint write set and concrete verification
@@ -84,7 +78,6 @@ Do not execute from chat summaries, inline review comments, remembered findings,
84
78
  > - output: implementation summary, commands run, test counts, deviations
85
79
  > - firewall: raw diffs/logs summarized
86
80
  > - memory: suggest-only; main agent persists reusable patterns
87
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
88
81
 
89
82
  Never run parallel writers against shared files or contracts.
90
83
 
@@ -97,22 +90,18 @@ Do not execute from chat summaries, inline review comments, remembered findings,
97
90
  > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
98
91
  > - firewall: summarized findings only, never raw diff dumps
99
92
  > - memory: suggest-only; main agent persists
100
- > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract and record the skipped-delegation reason
101
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
102
93
 
103
94
  > **Dispatch: `massa-ai-verification-agent`** (role: `verification-agent`) — charter `skills/agents/verification-agent/SKILL.md`
104
95
  > - trigger: an `Area/PREFIX-N` finding's closure meets the verification-ladder's Independent Verification Mandate tier gate — Standard+/Spec-driven size or any high/critical-severity finding
105
96
  > - scope: the closed `Area/PREFIX-N` finding's fix diff, its source-lens claim, and the validation assets the fix touches
106
- > - permissions: read-only
107
97
  > - inputs: the source-qualified finding ID, the applied fix diff, the report's Verification Suggestion, and the pending closure-matrix row
108
98
  > - sensors: the deterministic command/artifact named in the closure row for that lens; discrimination sensor per `references/discrimination-sensor.md` (the code under the closed finding's claim)
109
99
  > - output: confirmed/disproven closure verdict per `Area/PREFIX-N` row, ladder level reached, residual risk
110
100
  > - firewall: raw test/build output and diffs summarized to verdict plus evidence pointers
111
101
  > - memory: suggest-only; main agent persists implementation-closure verification outcomes
112
102
  > - fallback: if the subagent is unavailable, run a standalone fresh-eyes re-check of each closed Area/PREFIX-N row against this output contract and record the skipped-delegation reason
113
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
114
103
 
115
- 11. Verify each completed finding with the Mandatory Verification Fix Gate from `references/verification-ladder.md`: run the report's Verification Suggestion or an equivalent deterministic command/artifact check, then run focused tests, build, lint, type, static, or runtime checks relevant to the source lens. At the tiers the ladder's Independent Verification Mandate names, also run the Discrimination Sensor (`references/discrimination-sensor.md`) against the code under the closed finding's claim; a surviving mutant marks that closure row `blocked` (not `fixed`) and emits the `surviving_mutant` lessons signal. Reinspect tests, fixtures, snapshots, types, specs, public contracts, and touched identifiers so validation assets were not weakened and names follow `references/naming-standards.md`. A finding cannot be marked `fixed` when a target-relevant command or artifact check exists but was not attempted; if verification cannot run, mark it `blocked`, `deferred`, or `skipped` with an allowed skipped-check reason. The fix→re-verify cycle is capped at the ladder's 3-iteration limit per finding — distinct from the preamble's two-consecutive-failed-fixes breaker above, which fires on edit attempts inside a single iteration and routes to `references/root-cause-scripts.md` rather than closing a finding `blocked`.
104
+ 11. Verify each completed finding with the Mandatory Verification Fix Gate from `references/verification-ladder.md`: run the report's Verification Suggestion or an equivalent deterministic command/artifact check, then run focused tests, build, lint, type, static, or runtime checks relevant to the source lens. At the tiers the ladder's Independent Verification Mandate names, also run the Discrimination Sensor (`references/discrimination-sensor.md`) against the code under the closed finding's claim; a surviving mutant marks that closure row `blocked` (not `fixed`) and emits the `surviving_mutant` lessons signal. Reinspect tests, fixtures, snapshots, types, specs, public contracts, and touched identifiers so validation assets were not weakened and names follow `references/naming-standards.md`. A finding cannot be marked `fixed` when a target-relevant command or artifact check exists but was not attempted; if verification cannot run, mark it `blocked`, `deferred`, or `skipped` with an allowed skipped-check reason. The fix→re-verify cycle is capped at the ladder's 3-iteration limit per finding.
116
105
  12. Persist the closure evidence as the Fix Closure Report defined in `references/audit-report-io.md` (Fix Closure Report Contract), at `audits/implementation/<YYYY-MM-DD implementation-fix-closure>.md`, one row per selected finding keyed by its source-qualified `Area/PREFIX-N` ID: status (`fixed`, `deferred`, `blocked`, `skipped`), changed files, command/artifact, result, skipped reason or `none`, discrimination sensor verdict, independent verifier verdict, highest Verification Ladder level reached, validation assets protected, residual risk, and exact next step for deferred or blocked findings. Run `bun skills/massa-ai/scripts/check_fix_closure.ts <closure.md> --family implementation` before Propose/Evidence Gate; a non-zero exit blocks closure. If no code-execution tool is available, run the same checks by reading the artifact (graceful degradation preserved).
117
106
  13. If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
118
107
  `bun skills/massa-ai/scripts/lessons.ts --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
@@ -132,6 +121,3 @@ User asks: "Fix Security/SEC-2 from audits/implementation/2026-06-15 implementat
132
121
  1. Read the exact report and validate `Security/SEC-2` against current source.
133
122
  2. Apply security-fix methods only to that finding.
134
123
  3. Preserve all other findings for later execution.
135
-
136
- <!-- validator anchors: "Fix Closure Report defined in `references/audit-report-io.md`", "audits/implementation/<YYYY-MM-DD implementation-fix-closure>.md", "bun skills/massa-ai/scripts/check_fix_closure.ts <closure.md> --family implementation", "discrimination sensor per `references/discrimination-sensor.md`", "surviving_mutant` lessons signal", "graceful degradation preserved", "Independent Verification Exception", "brownfield-mapping.md` (Minimum Bar only)" -->
137
-
@@ -80,7 +80,6 @@ and artifact paths. Model request: `kimi-k3` (see Step 0.5).
80
80
  > - output: the evaluation-specification YAML, returned verbatim for all rounds; nothing else
81
81
  > - firewall: no artifact body quotes beyond what the rubric anchors need; no raw dumps
82
82
  > - memory: suggest-only; main agent persists
83
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
84
83
 
85
84
  This packet is a specialization of the canonical Capability Packet
86
85
  (`references/agent-orchestration.md`): the spec YAML is its `output` contract; the
@@ -120,7 +119,6 @@ the reply block:
120
119
  > - output: the YAML reply block below (strengths/weaknesses capped at ≤3 items); report file is the persisted channel — dual-channel rule, the chat return never carries the report body
121
120
  > - firewall: quoted evidence snippets only; no artifact or peer-report dumps in the reply
122
121
  > - memory: suggest-only; main agent persists
123
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
124
122
 
125
123
  This packet is a specialization of the canonical Capability Packet
126
124
  (`references/agent-orchestration.md`); the per-round additions are its `inputs` deltas.
@@ -72,14 +72,12 @@ Reject direct use without a saved `audits/maestro/<YYYY-MM-DD maestro-audit.md>`
72
72
  > **Dispatch: `massa-ai-verification-agent`** (role: `verification-agent`) — charter `skills/agents/verification-agent/SKILL.md`
73
73
  > - trigger: mandatory at Standard+/Spec-driven finding size or high/critical severity per the Independent Verification Mandate in `references/verification-ladder.md`; at Quick size, device runs are expensive, so skip the dispatch and instead run the standalone fresh-eyes self-check named in the fallback line
74
74
  > - scope: the fixed flow/subflow/fixture's `MST-*` claim closure — selector/assertion changes, stable-flow design compliance, and the JUnit report/artifact evidence for the run
75
- > - permissions: read-only
76
75
  > - inputs: the `MST-*` finding, the applied flow/fixture diff, the report's Verification Suggestion, the JUnit report path, the artifact directory, and device/platform
77
76
  > - sensors: the report's Verification Suggestion or equivalent `maestro test` run; flow-mutation discrimination sensor per `references/maestro/patterns.md` (single lightweight selector/assertion perturbation)
78
77
  > - output: confirmed/disproven closure verdict for the `MST-*` row, with JUnit/artifact evidence cited
79
78
  > - firewall: JUnit XML, logs, screenshots, and recordings summarized, never dumped raw
80
79
  > - memory: suggest-only; main agent persists maestro-closure verification outcomes
81
80
  > - fallback: if the subagent is unavailable, run a standalone fresh-eyes re-check of the MST closure rows and on-disk JUnit/artifact evidence, and record the skipped-delegation reason
82
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
83
81
 
84
82
  > **Dispatch: `massa-ai-reviewer`** (role: `reviewer`) — charter `skills/agents/reviewer/SKILL.md`
85
83
  > - trigger: implementation complete, before the verification gate — never optional
@@ -90,8 +88,6 @@ Reject direct use without a saved `audits/maestro/<YYYY-MM-DD maestro-audit.md>`
90
88
  > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
91
89
  > - firewall: summarized findings only, never raw diff dumps
92
90
  > - memory: suggest-only; main agent persists
93
- > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract and record the skipped-delegation reason
94
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
95
91
 
96
92
  9. Use strict harness sensors:
97
93
  - If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
@@ -101,7 +97,7 @@ Reject direct use without a saved `audits/maestro/<YYYY-MM-DD maestro-audit.md>`
101
97
  - A finding cannot be marked `fixed` when a target-relevant command or artifact check exists but was not attempted.
102
98
  - If verification cannot run, mark it `blocked`, `deferred`, or `skipped` with an allowed skipped-check reason.
103
99
  - At the tier gate that mandated the verifier dispatch above, also run the Discrimination Sensor from `references/verification-ladder.md` via the flow-mutation sensor in `references/maestro/patterns.md`; a surviving mutant on the fixed flow's selector/assertion means the finding's closure row is `blocked`, and record the `surviving_mutant` lessons signal.
104
- - Cap the fix→re-verify cycle at 3 iterations per `MST-*` finding per `references/verification-ladder.md`'s Bounded Fix→Re-verify Loop; after 3, stop with a `blocked` closure row and ask for direction. This is a verification-cycle counter, distinct from the two-consecutive-failed-fixes edit breaker above that routes to `references/root-cause-scripts.md` — neither resets or consumes the other.
100
+ - Cap the fix→re-verify cycle at 3 iterations per `MST-*` finding per `references/verification-ladder.md`'s Bounded Fix→Re-verify Loop; after 3, stop with a `blocked` closure row and ask for direction.
105
101
  10. Persist the closure matrix as the Fix Closure Report per `references/audit-report-io.md`'s Fix Closure Report Contract, at `audits/maestro/<YYYY-MM-DD maestro-fix-closure>.md`: the standard Closure Matrix columns (`MST-*` ID, status, changed files, command/artifact, result, skipped reason, Discrimination Sensor, Independent Verifier, ladder level, validation assets protected, residual risk, next step) plus the maestro extras `JUnit Report`, `Artifact Directory`, and `Device/Platform`, appended after the standard set. Before the Propose/Evidence Gate, run `bun skills/massa-ai/scripts/check_fix_closure.ts <closure.md> --family maestro`; a non-zero exit blocks closure. If no code-execution tool is available, run the same checks by reading the artifact (graceful degradation preserved).
106
102
  11. Persist only durable Maestro fix patterns, flake root causes, selector/test-ID policy, setup/teardown recipes, device matrix constraints, or reusable verification commands after Importance Calibration. Use `workflow:maestro-fix` and required memory tags.
107
103
  12. Complete the Evidence Gate from `references/evidence-gate.md`.
@@ -113,6 +109,3 @@ User asks: "Fix MST-2 from audits/maestro/2026-06-29 maestro-audit.md."
113
109
  1. Read and validate the saved report.
114
110
  2. Reinspect current flow evidence and fix only the targeted Maestro flow/subflow/fixture surface.
115
111
  3. Run the report's Verification Suggestion or equivalent Maestro command and report the closure matrix.
116
-
117
- <!-- validator anchors: references/discrimination-sensor.md | Discrimination Sensor (Flow Mutation) | references/brownfield-mapping.md (Minimum Bar only) | first fix touching an unmapped Maestro workspace | Independent Verification Mandate | Bounded Fix→Re-verify Loop | surviving_mutant lessons signal | Fix Closure Report Contract | audits/maestro/<YYYY-MM-DD maestro-fix-closure>.md | check_fix_closure.ts --family maestro | graceful degradation preserved -->
118
-
@@ -61,15 +61,9 @@ Do not edit code. Route direct design implementation to `design`. Not for Flutte
61
61
  **Screen work — before writing or judging any user-facing screen:** when this task creates or modifies a screen, the `massa-ai-designer` dispatch below is mandatory rather than discretionary, carved out of ordinary delegation gating by the Screen Implementation Exception in `references/agent-orchestration.md`. It does not fire when the task touches no screen surface.
62
62
 
63
63
  > **Dispatch: `massa-ai-designer`** (role: `designer`) — charter `skills/agents/designer/SKILL.md`
64
- > - trigger: the task creates or modifies a user-facing screen — mandatory once that condition holds, per the Screen Implementation Exception in `references/agent-orchestration.md`; it does not fire when no screen surface is touched
65
64
  > - scope: the screens, views, components, layouts, styles, and design tokens under audit — never the whole repository, and no edits
66
65
  > - permissions: read-only — this workflow is findings-only; the charter permits writes only when explicitly scoped, and its Restrictions win over the packet, so read-only governs
67
- > - inputs: exact `projectId`, parent `workflowSessionId`, Figma links/node ids or screenshots when supplied, acceptance criteria, the repository's existing UI conventions and design tokens, recalled screen patterns
68
- > - sensors: Figma MCP read when a design source exists; per-element expected-vs-actual comparison; the UI module's own build/lint; the states a design under-specifies — empty, loading, error, long text, small and large sizes
69
66
  > - output: per-element conformance table (element, expected, actual, verdict, severity) feeding `MFM-*` findings; a missing or unreachable design source is listed as a skipped sensor, never a silent pass
70
- > - firewall: summarized design-source evidence and `path:line` pointers only, never raw Figma node dumps or full file bodies
71
- > - memory: suggest-only; the main agent persists durable screen and design-token conventions
72
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
73
67
 
74
68
  ## Examples
75
69
 
@@ -63,15 +63,9 @@ Do not execute from chat summaries, screenshots alone, remembered findings, or a
63
63
  **Screen work — before writing or judging any user-facing screen:** when this task creates or modifies a screen, the `massa-ai-designer` dispatch below is mandatory rather than discretionary, carved out of ordinary delegation gating by the Screen Implementation Exception in `references/agent-orchestration.md`. It does not fire when the task touches no screen surface.
64
64
 
65
65
  > **Dispatch: `massa-ai-designer`** (role: `designer`) — charter `skills/agents/designer/SKILL.md`
66
- > - trigger: the task creates or modifies a user-facing screen — mandatory once that condition holds, per the Screen Implementation Exception in `references/agent-orchestration.md`; it does not fire when no screen surface is touched
67
66
  > - scope: the screens, views, components, layouts, styles, and design tokens in this task's UI surface — never the whole repository
68
67
  > - permissions: write, scoped to UI-layer files only with a disjoint write set
69
- > - inputs: exact `projectId`, parent `workflowSessionId`, Figma links/node ids or screenshots when supplied, acceptance criteria, the repository's existing UI conventions and design tokens, recalled screen patterns
70
- > - sensors: Figma MCP read when a design source exists; per-element expected-vs-actual comparison; the UI module's own build/lint; the states a design under-specifies — empty, loading, error, long text, small and large sizes
71
68
  > - output: per-element conformance table (element, expected, actual, verdict, severity) plus the UI files written; a missing or unreachable design source is listed as a skipped sensor, never a silent pass
72
- > - firewall: summarized design-source evidence and `path:line` pointers only, never raw Figma node dumps or full file bodies
73
- > - memory: suggest-only; the main agent persists durable screen and design-token conventions
74
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
75
69
 
76
70
  > **Dispatch: `massa-ai-builder`** (role: `builder`) — charter `skills/agents/builder/SKILL.md`
77
71
  > - trigger: a selected `MFM-*` finding spans a disjoint surface or shared-root slice, or an explicit subagent request
@@ -82,7 +76,6 @@ Do not execute from chat summaries, screenshots alone, remembered findings, or a
82
76
  > - output: implementation summary, changed files, commands run, per-surface render evidence
83
77
  > - firewall: raw diffs and screenshots summarized
84
78
  > - memory: suggest-only; main agent persists reusable token/mapping patterns
85
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
86
79
 
87
80
  > **Dispatch: `massa-ai-reviewer`** (role: `reviewer`) — charter `skills/agents/reviewer/SKILL.md`
88
81
  > - trigger: implementation complete, before the verification gate — never optional
@@ -93,20 +86,16 @@ Do not execute from chat summaries, screenshots alone, remembered findings, or a
93
86
  > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
94
87
  > - firewall: summarized findings only, never raw diff dumps
95
88
  > - memory: suggest-only; main agent persists
96
- > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract and record the skipped-delegation reason
97
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
98
89
 
99
90
  > **Dispatch: `massa-ai-verification-agent`** (role: `verification-agent`) — charter `skills/agents/verification-agent/SKILL.md`
100
91
  > - trigger: mandatory at Standard+/Spec-driven size or high/critical severity per the Independent Verification Mandate in `references/verification-ladder.md`; a Quick-tier finding runs the fallback fresh-eyes self-check below instead
101
92
  > - scope: the fixed `MFM-*` finding's surface, resolved token/value, comparison-matrix row, and closure claim
102
- > - permissions: read-only
103
93
  > - inputs: the finding, the applied fix, the comparison-matrix row, the render sensor used, and validation assets
104
94
  > - sensors: the token/value mutation sensor per `references/mobile-figma-matcher/core.md`'s Discrimination Sensor for Visual Parity section, plus the surface's existing render/snapshot/instrumentation check
105
95
  > - output: confirmed/disproven closure verdict with evidence, mutation killed/survived result
106
96
  > - firewall: raw screenshots and renders summarized
107
97
  > - memory: suggest-only; main agent persists reusable verification recipes
108
98
  > - fallback: at Quick tier, or when the subagent is unavailable, run a standalone fresh-eyes re-check of the MFM closure rows and record the skipped-delegation reason in closure evidence
109
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
110
99
 
111
100
  10. Verify after each coherent finding group:
112
101
  - If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
@@ -119,7 +108,7 @@ Do not execute from chat summaries, screenshots alone, remembered findings, or a
119
108
  - When Maestro evidence was used in audit and remains available, reproduce each recorded device/configuration/content state and rerun the same flow or navigation steps; capture equivalent hierarchy and screenshots.
120
109
  - If Maestro becomes unavailable, record the regression gap instead of claiming equivalent runtime verification.
121
110
  - Run the token/value mutation sensor from `references/mobile-figma-matcher/core.md`'s Discrimination Sensor for Visual Parity section for every critical/high-severity finding and every shared-KMP-root row; a surviving mutant marks that row's closure status `blocked` and records the `surviving_mutant` lessons signal.
122
- - Cap the fix→re-verify cycle at 3 iterations per `MFM-*` finding per `references/verification-ladder.md`'s Bounded Fix→Re-verify Loop; after 3, stop with a `blocked` closure row and ask for direction. This is a verification-cycle counter, distinct from the two-consecutive-failed-fixes edit breaker in the preamble above that routes to `references/root-cause-scripts.md` — neither resets nor consumes the other.
111
+ - Cap the fix→re-verify cycle at 3 iterations per `MFM-*` finding per `references/verification-ladder.md`'s Bounded Fix→Re-verify Loop; after 3, stop with a `blocked` closure row and ask for direction.
123
112
  11. Rebuild the final comparison matrix using fresh Figma and per-surface implementation evidence. Completion requires zero unresolved selected mismatches; all newly `NOT EVALUATED` rows remain residual risk. A passing Maestro flow does not change an unmatched visual row to `MATCH`.
124
113
  12. Produce a closure matrix with `MFM-*` ID, surface ID, status (`fixed`, `deferred`, `blocked`, `skipped`), changed files, final Figma/implementation values, command/artifact, result, skipped reason or `none`, highest Verification Ladder level reached, validation assets protected, static evidence, per-platform render evidence, optional Maestro evidence, and residual risk.
125
114
  13. Write the Fix Closure Report per `references/audit-report-io.md`'s Fix Closure Report Contract at `audits/mobile-figma/<YYYY-MM-DD mobile-figma-fix-closure>.md`, sibling of the consumed audit report — the standard Closure Matrix columns, appending the mobile-figma extras (`JUnit Report`, `Artifact Directory`, `Device/Platform`) whenever Maestro or instrumentation runtime evidence backs a row. Run `bun skills/massa-ai/scripts/check_fix_closure.ts <closure.md> --family mobile-figma` before Propose or the Evidence Gate; a non-zero exit blocks closure. If no code-execution tool is available, run the same checks by reading the artifact (graceful degradation preserved).
@@ -143,5 +132,3 @@ User asks: "Fix the shared KMP spacing finding and its iOS host mismatch."
143
132
 
144
133
  1. Re-detect the common Compose and iOS host surfaces, load KMP plus the matching UIKit or SwiftUI contract, and verify the report schema/freshness.
145
134
  2. Apply the shared fix first, then the host-specific fix only if the mismatch remains; rebuild Android/iOS rows affected by the shared change.
146
-
147
- <!-- validator anchors: Independent Verification Exception | surviving_mutant | Bounded Fix→Re-verify Loop | Fix Closure Report Contract | gate-command packet | satisfied-by-citation | graceful degradation preserved | Discrimination Sensor for Visual Parity -->
@@ -161,7 +161,6 @@ share only the lens label, not a knowledge domain; they stay separate dispatches
161
161
  > - output: structured reply block — findings rows `{path, head-line, severity, marker type, title, body ≤ 6 lines, recommendation}` + exactly one positive highlight + files-swept-clean list; when uncertain a finding is real, withhold it (the source protocol's high-confidence bar, applied qualitatively)
162
162
  > - firewall: raw diff/log/search output summarized, never returned raw
163
163
  > - memory: suggest-only; the main agent persists durable outcomes
164
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
165
164
 
166
165
  > **Dispatch: `massa-ai-reviewer`** (role: `reviewer`) — charter `skills/agents/reviewer/SKILL.md`
167
166
  > - trigger: pr-review Step 2, dimension row 6 (regression & hallucination)
@@ -172,7 +171,6 @@ share only the lens label, not a knowledge domain; they stay separate dispatches
172
171
  > - output: structured reply block — findings rows tagged `{unrelated-deletion | phantom-reference | wrong-signature | duplicate | weakened-check | dead-code}` + one positive highlight + files-swept-clean list; withhold uncertain findings
173
172
  > - firewall: raw diff/log/search output summarized, never returned raw
174
173
  > - memory: suggest-only; the main agent persists durable outcomes
175
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
176
174
 
177
175
  Severity labels (all dimensions): 🚨 Critical (bugs/logic errors that will fail) ·
178
176
  🔒 Security · ⚡ Performance · ⚠️ Warning (smells/maintainability) ·
@@ -243,4 +241,3 @@ with the metadata table intact.
243
241
  convention) with the required memory tags; do not fabricate memories.
244
242
  - Close with `references/evidence-gate.md`: counts posted vs deduped vs withheld,
245
243
  skipped dimensions/sensors with reasons, and the summary URL/reference.
246
- <!-- validator anchors: comment-only | added (+) diff lines | page to completion | two waves -->
@@ -29,7 +29,7 @@ Before the first repository mutation, load `references/implementation-delivery.m
29
29
  - `references/knowledge-verification-chain.md` when Design It Twice or an architecture-lens library-pattern investigation depends on external library/API behavior not already verified in this session
30
30
  - `references/mobile-context.md` when the refactor touches KMP, iOS, Android, native bridges, mobile lifecycle, offline sync, permissions, local persistence, or backend-mobile contracts
31
31
  - `references/verification-ladder.md` before Quick/Standard/Spec-driven sizing or edits
32
- - `references/context-firewall.md` when source inspection or tool output meets its threshold table (a single source/log/doc block >200 lines, >20 KB, or >50 search hits)
32
+ - `references/context-firewall.md` when source inspection or tool output meets its threshold table
33
33
  - `references/pr-task-fix.md` when the verification ladder trigger table applies
34
34
  - `references/lessons.md` when `.specs/lessons.json` exists, to load confirmed project lessons before refactoring
35
35
  4. Size the refactor before editing:
@@ -75,22 +75,18 @@ Before the first repository mutation, load `references/implementation-delivery.m
75
75
  > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
76
76
  > - firewall: summarized findings only, never raw diff dumps
77
77
  > - memory: suggest-only; main agent persists
78
- > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract and record the skipped-delegation reason
79
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
80
78
 
81
79
  > **Dispatch: `massa-ai-verification-agent`** (role: `verification-agent`) — charter `skills/agents/verification-agent/SKILL.md`
82
80
  > - trigger: Standard+ refactor sizing or any PR-group execution per the Independent Verification Mandate in `references/verification-ladder.md` — mandatory once reviewer fix items are resolved; Quick-sized refactors dispatch only when validation assets were touched, otherwise run the fresh-eyes fallback below and record the skip reason
83
81
  > - scope: the moved/transformed code across this refactor's PR groups and the characterization tests that must protect it
84
- > - permissions: read-only
85
82
  > - inputs: the characterization baseline from step 6 (and step 7 for mobile refactors), the diff of moved code per PR group, and the PR-group map from step 9
86
83
  > - sensors: confirm the characterization tests still pass against the moved code's preserved behavior; discrimination sensor per `references/discrimination-sensor.md` (mutate the moved code — never new code — in scratch, one PR group at a time; characterization tests must kill each mutant)
87
84
  > - output: a preserved/regressed verdict per PR group and any surviving-mutant findings, written to `.specs/refactors/<slug>/SENSOR.md`
88
85
  > - firewall: summarized per-group findings only, never raw diff dumps
89
86
  > - memory: suggest-only; main agent persists refactor verification outcomes
90
87
  > - fallback: if the subagent is unavailable, run a standalone fresh-eyes re-check of the characterization evidence per PR group and record the skipped-delegation reason
91
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
92
88
 
93
- - The fix→re-verify cycle for a PR group is capped by the Bounded Fix→Re-verify Loop's 3-iteration limit in `references/verification-ladder.md` (cap reached → `Blocked`); that is distinct from the two-consecutive-failed-fix edit-attempt breaker in `references/root-cause-scripts.md`, which fires on repeated failed edits against one symptom while moving code and neither consumes nor resets the verify-cycle count.
89
+ - The fix→re-verify cycle for a PR group is capped by the Bounded Fix→Re-verify Loop's 3-iteration limit in `references/verification-ladder.md` (cap reached → `Blocked`).
94
90
 
95
91
  13. Run the configured Plan Challenge Gate on the refactor plan before the first behavior-preserving edit. Low-risk refactor plans use the Plan Challenge lite gate first; full The Fool is reserved for explicit challenge, high-risk domains, plans touching more than 5 files/classes/modules, or lite escalation. Revise valid critical or high findings — for a refactor the assumption most worth challenging is that the existing tests actually pin the behavior being preserved.
96
92
  14. Complete the Evidence Gate from `references/evidence-gate.md`
@@ -99,6 +95,3 @@ Before the first repository mutation, load `references/implementation-delivery.m
99
95
 
100
96
  - `.specs/refactors/<slug>/` unwritable: block the write per `references/artifact-persistence.md`; do not fall back to memory or chat as the record of characterization evidence.
101
97
  - Discrimination sensor mutation not safely reversible: mark the claim `Blocked` unless equivalent existing deterministic mutation evidence already proves the characterization tests discriminate for that moved code.
102
-
103
- <!-- validator anchors: massa-ai-verification-agent dispatch block; Independent Verification Mandate; Independent Verification Exception; discrimination sensor mutate the moved code; characterization tests must kill it; P0 payment/auth/data-integrity/public-contract; .specs/refactors/<slug>/CHARACTERIZATION.md; .specs/refactors/<slug>/SENSOR.md; check_specs_delivered.ts --kind refactor; check_specs_delivered.ts --kind quick; graceful degradation preserved; Stage 3 delivery authorization; Bounded Fix→Re-verify Loop; two-consecutive-failed-fix edit-attempt breaker; Brownfield Minimum Bar; knowledge-verification-chain.md -->
104
-
@@ -52,7 +52,6 @@ Findings-only: do not edit the PRD/ADR unless the user separately asks.
52
52
  > - output: per check-item statuses, findings, and Open Questions / Suggestions / Insights / Risks / DoR-gap contributions — compact structured return, no document quotes beyond evidence snippets
53
53
  > - firewall: document bodies summarized; no raw section dumps in the return
54
54
  > - memory: suggest-only; main agent persists
55
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
56
55
 
57
56
  This packet is a specialization of the canonical Capability Packet (`references/agent-orchestration.md`); the per-dimension checklist section is its `scope` delta.
58
57
  6. Synthesis (main):
@@ -26,20 +26,9 @@ Findings-only: do not edit code unless the user separately asks for fixes.
26
26
  - `references/agent-orchestration.md` only for large scopes, explicit parallel/subagent requests, PR subagent invocation, or independent verification of high-impact findings
27
27
  3. `recall` -> load prior product decisions, accepted requirements, ADRs, scope constraints, known regressions, project patterns, and accepted exceptions for the target area.
28
28
  - Apply the Memory Freshness Gate from `references/audit-scope.md`; recalled exceptions are leads, not proof.
29
- 4. Establish the investigation scope before proceeding:
30
- - Modified files scope: use when the user says modified files, changed files, current changes, uncommitted changes, staged changes, or unstaged changes.
31
- - Explicit files/globs scope: use when the user names files, directories, or globs.
32
- - Commit range scope: use when the user provides commits/ranges or asks for commits made by me, my branch commits, or requirement drift introduced by branch commits.
33
- - Branch comparison scope: use when the user names base/head branches, refs, or a branch diff.
34
- - Codebase area scope: use when the user names a path, module, package, feature area, user journey, or glob.
35
- - Symbol/class/function scope: use when the user names public classes, functions, APIs, handlers, or exported surfaces.
36
- - Feature/flow scope: use when the user names a runtime flow, user journey, or feature area.
37
- - Whole-repo scope: use only when the user explicitly asks for a whole-repo requirements audit.
38
- - Implementation parent scope: use only when `workflows/implementation/implementation-audit.md` invokes this workflow with a concrete implementation scope packet.
29
+ 4. Establish the investigation scope: select the scope type and build the shared scope packet per `references/audit-scope.md`, which owns the supported scope types, the ask-when-vague rule, and the packet fields. Carry the packet into the report.
39
30
  - Requirements source scope: use provided prompt text, PR description, issue text, task file, spec, RFC, ADR, acceptance criteria, or README section as the expected behavior source.
40
- - If the target focus is missing, vague, or too broad, ask for a concrete target from the supported scope types in `references/audit-scope.md`.
41
31
  - If requirements source is missing after checking the prompt, PR description, task file, spec, issue text, and repo docs, ask for the requirements source before proceeding.
42
- - Build the shared scope packet from `references/audit-scope.md` and carry it into the report.
43
32
  5. Resolve the selected branch's mechanics (modified files, commit range, codebase area, explicit-files/branch/symbol/feature/whole-repo, or implementation parent scope) per `references/audit-scope.md` (Lens Audit Scope Resolution Procedure, Requirements row of Per-Lens Scope Deltas). Implementation parent scope additionally carries the requirement source from `implementation-audit`.
44
33
  6. Investigation pass. Dispatch `audit-specialist` per `references/agent-orchestration.md` when the scope justifies an isolated read-only subagent:
45
34
 
@@ -52,7 +41,6 @@ Findings-only: do not edit code unless the user separately asks for fixes.
52
41
  > - output: findings with requirement gap, location, evidence, severity, confidence, simplest fix direction, verification suggestion
53
42
  > - firewall: raw diffs/logs/search output summarized, not returned raw
54
43
  > - memory: suggest-only; main agent persists reusable requirements patterns
55
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
56
44
 
57
45
  - Build a requirement checklist from the source: must-have behavior, non-goals, acceptance criteria, compatibility constraints, inputs, outputs, and user-visible promises.
58
46
  - Compare implementation and tests against each checklist item.
@@ -75,7 +75,6 @@ Not for findings-only requirements review — route to `workflows/requirements/r
75
75
  > - output: implementation summary, commands run, test counts, deviations
76
76
  > - firewall: raw diffs/logs summarized
77
77
  > - memory: suggest-only; main agent persists reusable requirements patterns
78
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
79
78
 
80
79
  > **Dispatch: `massa-ai-reviewer`** (role: `reviewer`) — charter `skills/agents/reviewer/SKILL.md`
81
80
  > - trigger: implementation complete, before the verification gate — never optional
@@ -86,20 +85,16 @@ Not for findings-only requirements review — route to `workflows/requirements/r
86
85
  > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
87
86
  > - firewall: summarized findings only, never raw diff dumps
88
87
  > - memory: suggest-only; main agent persists
89
- > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract and record the skipped-delegation reason
90
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
91
88
 
92
89
  > **Dispatch: `massa-ai-verification-agent`** (role: `verification-agent`) — charter `skills/agents/verification-agent/SKILL.md`
93
90
  > - trigger: mandatory at Standard+/Spec-driven REQ-fix size or high/critical requirement severity, per the Independent Verification Mandate tier gate in `references/verification-ladder.md`'s Mandatory Verification Fix Gate; a Quick-tier REQ finding takes the fallback below instead
94
91
  > - scope: the closed REQ row's Requirement Source alignment, acceptance evidence, and report claim closure
95
- > - permissions: read-only
96
92
  > - inputs: the finding, its Requirement Source and Requirement ID or Quote, the applied fix, the verification suggestion, and validation assets
97
93
  > - sensors: deterministic command (requirements-trace check, acceptance tests, doc/spec alignment) and report claim closure; discrimination sensor per `references/discrimination-sensor.md` (the code that now satisfies the Requirement Source)
98
94
  > - output: confirmed/disproven closure verdict against the Requirement Source, feeding the Fix Closure Report's Independent Verifier column
99
95
  > - firewall: raw test output/logs summarized
100
96
  > - memory: suggest-only; main agent persists requirements verification outcomes
101
97
  > - fallback: if the subagent is unavailable, run a standalone fresh-eyes re-check of each REQ closure row against its Requirement Source and record the skipped-delegation reason
102
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
103
98
  - Main agent owns report parsing, traceability matrix, memory writes, final synthesis, and Evidence Gate.
104
99
 
105
100
  11. Verify each completed finding:
@@ -108,7 +103,7 @@ Not for findings-only requirements review — route to `workflows/requirements/r
108
103
  - Apply the Mandatory Verification Fix Gate from `references/verification-ladder.md`: run the report's Verification Suggestion or an equivalent deterministic command/artifact check for each selected finding or coherent group.
109
104
  - Dispatch the verification-agent block above once a REQ finding reaches Standard+/Spec-driven size or high/critical severity; a Quick-tier finding instead runs the listed fallback self-check — the tier gate decides the hop, never the check itself.
110
105
  - A surviving mutant on the discrimination sensor blocks the row: mark the finding's Closure Matrix status `blocked` and log a `surviving_mutant` signal through `references/lessons.md`.
111
- - `references/verification-ladder.md`'s Bounded Fix→Re-verify Loop caps re-verify cycles per REQ finding at 3; exhausting it also lands `blocked`. That is a distinct counter from this file's own two-consecutive-failed-fixes breaker above, which trips inside one edit iteration rather than across re-verify cycles.
106
+ - `references/verification-ladder.md`'s Bounded Fix→Re-verify Loop caps re-verify cycles per REQ finding at 3; exhausting it also lands `blocked`.
112
107
  - A finding cannot be marked `fixed` when a target-relevant command or artifact check exists but was not attempted; if verification cannot run, mark it `blocked`, `deferred`, or `skipped` with an allowed skipped-check reason.
113
108
  - Run the report's verification suggestion when available.
114
109
  - Run acceptance tests, targeted unit/integration tests, docs checks, type/build checks, or manual artifact inspection relevant to the requirement.
@@ -129,5 +124,3 @@ User asks: "Use requirements-fix to fix latest audit for checkout flow."
129
124
  3. Build a requirement traceability matrix.
130
125
  4. Fix mandatory gaps and contradictions before lower-severity docs/test issues.
131
126
  5. Verify against the cited requirement source.
132
-
133
- <!-- validator anchors: Linked .specs/ Requirement ID | Independent Verification Exception | audits/requirements/<YYYY-MM-DD requirements-fix-closure>.md | check_fix_closure.ts <closure.md> --family requirements | surviving_mutant | Bounded Fix→Re-verify Loop | Requirement Traceability Update | graceful degradation preserved -->
@@ -27,18 +27,7 @@ Findings-only: do not edit code unless the user separately asks for fixes.
27
27
  - `references/agent-orchestration.md` only for large scopes, explicit parallel/subagent requests, PR subagent invocation, or independent verification of high-impact findings
28
28
  3. `recall` -> load prior security decisions, auth boundaries, validation rules, known regressions, project constraints, ADRs, fragile flows, and accepted exceptions for the target area.
29
29
  - Apply the Memory Freshness Gate from `references/audit-scope.md`; recalled exceptions are leads, not proof.
30
- 4. Establish the investigation scope before proceeding:
31
- - Modified files scope: use when the user says modified files, changed files, current changes, uncommitted changes, staged changes, or unstaged changes.
32
- - Explicit files/globs scope: use when the user names files, directories, or globs.
33
- - Commit range scope: use when the user provides commits/ranges or asks for commits made by me, my branch commits, or security issues introduced by branch commits.
34
- - Branch comparison scope: use when the user names base/head branches, refs, or a branch diff.
35
- - Codebase area scope: use when the user names a path, module, package, feature area, trust boundary, or glob.
36
- - Symbol/class/function scope: use when the user names handlers, middleware, validators, policies, classes, functions, or exported surfaces.
37
- - Feature/flow scope: use when the user names a runtime flow, user journey, auth path, or data boundary.
38
- - Whole-repo scope: use only when the user explicitly asks for a whole-repo security audit.
39
- - Implementation parent scope: use only when `workflows/implementation/implementation-audit.md` invokes this workflow with a concrete implementation scope packet.
40
- - If the target focus is missing, vague, or too broad, ask for a concrete target from the supported scope types in `references/audit-scope.md`.
41
- - Build the shared scope packet from `references/audit-scope.md` and carry it into the report.
30
+ 4. Establish the investigation scope: select the scope type and build the shared scope packet per `references/audit-scope.md`, which owns the supported scope types, the ask-when-vague rule, and the packet fields. Carry the packet into the report.
42
31
  5. Resolve the selected branch's mechanics (modified files, commit range, codebase area, explicit-files/branch/symbol/feature/whole-repo, or implementation parent scope) per `references/audit-scope.md` (Lens Audit Scope Resolution Procedure, Security row of Per-Lens Scope Deltas).
43
32
  6. Investigation pass. Dispatch `audit-specialist` per `references/agent-orchestration.md` when the scope justifies an isolated read-only subagent:
44
33
 
@@ -51,7 +40,6 @@ Findings-only: do not edit code unless the user separately asks for fixes.
51
40
  > - output: findings with security boundary, asset, trigger/exploit path, severity, confidence, evidence, simplest fix direction, verification suggestion
52
41
  > - firewall: raw diffs/logs/search output summarized, not returned raw
53
42
  > - memory: suggest-only; main agent persists reusable security patterns
54
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
55
43
 
56
44
  - Trace untrusted input -> validation -> authorization -> transformation -> persistence or side effect.
57
45
  - Check authn/authz, object ownership, tenant isolation, input validation, output encoding, secret handling, cryptography use, SSRF/path traversal/injection risks, logging privacy, dependency/config exposure, and security-sensitive tests.