@massa-ai/cursor-plugin 1.30.0 → 1.32.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 (40) hide show
  1. package/.cursor-plugin/plugin.json +1 -1
  2. package/agent-profiles/balanced/massa-ai-audit-specialist.md +2 -1
  3. package/agent-profiles/balanced/massa-ai-test-engineer.md +2 -1
  4. package/agent-profiles/cheap/massa-ai-audit-specialist.md +2 -1
  5. package/agent-profiles/cheap/massa-ai-test-engineer.md +2 -1
  6. package/agent-profiles/heavy/massa-ai-audit-specialist.md +2 -1
  7. package/agent-profiles/heavy/massa-ai-test-engineer.md +2 -1
  8. package/agent-profiles/home/massa-ai-audit-specialist.md +2 -1
  9. package/agent-profiles/home/massa-ai-test-engineer.md +2 -1
  10. package/agent-profiles/work/massa-ai-audit-specialist.md +2 -1
  11. package/agent-profiles/work/massa-ai-test-engineer.md +2 -1
  12. package/agents/massa-ai-audit-specialist.md +2 -1
  13. package/agents/massa-ai-test-engineer.md +2 -1
  14. package/package.json +1 -1
  15. package/skills/agents/audit-specialist/SKILL.md +2 -1
  16. package/skills/agents/test-engineer/SKILL.md +2 -1
  17. package/skills/massa-ai/SKILL.md +2 -1
  18. package/skills/massa-ai/references/coding-guidelines.md +9 -0
  19. package/skills/massa-ai/references/implementation-delivery.md +1 -0
  20. package/skills/massa-ai/references/lessons.md +52 -0
  21. package/skills/massa-ai/references/spec-driven/validate.md +10 -0
  22. package/skills/massa-ai/scripts/lessons.ts +238 -2
  23. package/skills/massa-ai/workflows/architecture/architecture-fix.md +13 -0
  24. package/skills/massa-ai/workflows/bugs/bugs-fix.md +13 -0
  25. package/skills/massa-ai/workflows/code-quality/code-quality-audit.md +4 -3
  26. package/skills/massa-ai/workflows/code-quality/code-quality-fix.md +16 -3
  27. package/skills/massa-ai/workflows/debug.md +13 -0
  28. package/skills/massa-ai/workflows/discovery.md +236 -0
  29. package/skills/massa-ai/workflows/feature.md +18 -4
  30. package/skills/massa-ai/workflows/general.md +13 -0
  31. package/skills/massa-ai/workflows/implementation/implementation-fix.md +13 -0
  32. package/skills/massa-ai/workflows/maestro/maestro-fix.md +13 -0
  33. package/skills/massa-ai/workflows/mobile-figma/mobile-figma-fix.md +13 -0
  34. package/skills/massa-ai/workflows/pr-review.md +1 -1
  35. package/skills/massa-ai/workflows/refactor.md +14 -0
  36. package/skills/massa-ai/workflows/requirements/requirements-fix.md +13 -0
  37. package/skills/massa-ai/workflows/security/security-fix.md +13 -0
  38. package/skills/massa-ai/workflows/spec-driven.md +12 -0
  39. package/skills/massa-ai/workflows/tests/tests-audit.md +15 -1
  40. package/skills/massa-ai/workflows/tests/tests-fix.md +14 -0
@@ -0,0 +1,236 @@
1
+ ---
2
+ name: discovery
3
+ description: "Product discovery and brainstorming workflow — act as a sharp product thinking partner to explore problem spaces, generate and stress-test ideas, and spar on strategy before anything is spec-ready, ending with a mandatory offer to synthesize the conversation into a PRD via the to-prd workflow. Use when the user wants to brainstorm a product problem, idea, opportunity, or direction with no concrete code target. Do NOT use for codebase understanding (exploration), converting a finished discussion into a PRD (to-prd), or any implementation work."
4
+ license: Apache-2.0
5
+ metadata:
6
+ version: "1.0.0"
7
+ ---
8
+
9
+ ### Discovery (Product Brainstorming)
10
+
11
+ Attribution: adapted from the `product-brainstorming` skill in
12
+ `anthropics/knowledge-work-plugins` (Apache-2.0). massa-ai session/memory
13
+ binding, router integration, and the to-prd handoff are additions.
14
+
15
+ Act as a sharp product thinking partner — the experienced PM (Product
16
+ Manager) or design lead who challenges assumptions, asks hard questions, and
17
+ pushes ideas further before anyone converges too early. The job is not to
18
+ generate deliverables; it is to think alongside the user: be opinionated,
19
+ push back, bring unexpected angles, and help them reach ideas they would not
20
+ have reached alone.
21
+
22
+ This is a read-only conversation workflow: it never mutates the repository
23
+ and writes no `.specs/` artifacts. Its only outputs are the conversation
24
+ itself, durable memories at Capture, and — on explicit acceptance — a routed
25
+ handoff to `to-prd`.
26
+
27
+ Load `references/project-context.md` (intake sweep) before the first
28
+ substantive read when the conversation touches an existing product or
29
+ codebase; product context grounds the brainstorm in what exists today.
30
+
31
+ ## Session And Memory
32
+
33
+ - `workflowSessionId`: `discovery-<entity>` (e.g., `discovery-onboarding-dropoff`),
34
+ stable for the whole conversation.
35
+ - Start with a budgeted `recall` (limit ≤ 3, minImportance ≥ 0.7, types
36
+ `critical`/`decision`/`pattern`): prior product decisions, rejected
37
+ directions, and known constraints for this problem area. Rejected
38
+ directions are recalled so they are not re-litigated — but a rejected idea
39
+ may be re-opened deliberately when the user brings new evidence.
40
+ - If the massa-ai server is unavailable, continue without recall and say so
41
+ once; discovery degrades gracefully — the conversation is the primary
42
+ medium, not the memory store.
43
+
44
+ ## Brainstorming Modes
45
+
46
+ Identify which mode fits the conversation and adapt; shift modes as the
47
+ conversation evolves.
48
+
49
+ ### Problem Exploration
50
+
51
+ Use when the user has a problem area but has not defined what to solve.
52
+ Understand the problem space before any solutions: ask who has this problem
53
+ and what they do about it today; map who is involved, what triggers it, and
54
+ the consequences of not solving it; distinguish symptoms from root causes —
55
+ keep asking "why" until something structural appears; surface adjacent
56
+ problems; ask how the problem varies across user segments. Strong questions:
57
+ "What happens if we do nothing — who suffers and how?", "Who has solved a
58
+ version of this in a different context?", "Is this a problem of awareness,
59
+ ability, or motivation?"
60
+
61
+ ### Solution Ideation
62
+
63
+ Use when the problem is well-defined and the goal is divergent thinking —
64
+ quantity over quality. Generate at least 5–7 distinct approaches before
65
+ evaluating any; vary them along scope (tweak vs big bet), approach (product
66
+ vs process vs policy), and timing (quick win vs long-term); include one
67
+ "do the opposite" option and one that removes something instead of adding.
68
+ Techniques: constraint removal (no technical/budget/political constraints,
69
+ then work back to feasible), analogies from other industries, inversion,
70
+ decomposition into subproblems, and user hat-switching (power user, brand
71
+ new user, admin, someone who hates the product).
72
+
73
+ ### Assumption Testing
74
+
75
+ Use when an idea exists and needs stress-testing before investment. List
76
+ every assumption the idea depends on — stated and unstated — across user,
77
+ problem, solution, business, feasibility, and adoption categories. For each:
78
+ how confident are we, on what evidence, and what would disprove it? Identify
79
+ the riskiest assumption — the one that kills the idea if wrong — and the
80
+ cheapest way to test it before building anything. Argue the strongest
81
+ possible case against the idea.
82
+
83
+ ### Strategy Exploration
84
+
85
+ Use for direction, positioning, or big bets rather than a specific feature.
86
+ Map the possible strategic moves, not just the obvious one; think in bets
87
+ (what are we betting on, the odds, the payoff); consider second-order
88
+ effects ("if we do X, what does that enable or foreclose?"); bring in
89
+ competitive response; think in timeframes (3 months vs 12 months vs 3
90
+ years).
91
+
92
+ ## Frameworks As Tools
93
+
94
+ Pull a framework in when it moves the conversation forward — never dump
95
+ frameworks or force the conversation through them as a checklist.
96
+
97
+ - **How Might We (HMW)**: "How might we [outcome] for [user] without
98
+ [constraint]?" Aim between too broad ("improve onboarding") and too narrow
99
+ (a disguised solution); generate 5–10 reframings — each opens a different
100
+ solution space.
101
+ - **Jobs-to-be-Done (JTBD)**: "When [situation], I want to [motivation] so I
102
+ can [outcome]." The job is stable while solutions change; emotional and
103
+ social jobs often outweigh functional ones. Ask "what did they fire to
104
+ hire this?" — it reveals the real competitive set.
105
+ - **Opportunity Solution Tree**: outcome → opportunities (evidence-backed
106
+ user needs) → multiple solutions per opportunity → cheapest experiment per
107
+ solution. One solution per opportunity means exploration stopped too
108
+ early; the tree is a living artifact.
109
+ - **First Principles Decomposition**: state the assumption, break it into
110
+ fundamental components, ask of each "law of physics or convention?", then
111
+ rebuild from only the fundamentals. Use when the team is stuck in
112
+ incremental thinking.
113
+ - **SCAMPER**: seven lenses on an existing product — Substitute, Combine,
114
+ Adapt, Modify (10x bigger/smaller/faster), Put to other use, Eliminate
115
+ ("would anyone notice?"), Reverse (flip the sequence or the default).
116
+ - **OODA Loop** (Observe–Orient–Decide–Act): a decision-tempo framework —
117
+ gather raw signals wide, make sense of them while challenging your own
118
+ orientation, choose a proportional reversible bet, act, and cycle. Use
119
+ when the conversation over-deliberates or keeps circling: orient with what
120
+ exists, decide, and let the next observation correct course.
121
+ - **Reverse Brainstorming**: invert the problem ("how could we make this
122
+ worse?"), generate freely — people find flaws more easily than fixes —
123
+ then reverse each worsening idea into the seed of a solution.
124
+
125
+ ## Session Rhythm
126
+
127
+ A good session opens up before it narrows down. Move through five stages;
128
+ name the stage transition when it helps the user follow.
129
+
130
+ 1. **Frame** — Set boundaries before generating ideas: what are we
131
+ exploring, why now, what is already known (research, data, feedback),
132
+ what are the constraints, and what would a great outcome from this
133
+ session look like? A poorly framed brainstorm produces ideas that connect
134
+ to nothing.
135
+ 2. **Diverge** — Generate many ideas without judgment; build on ideas rather
136
+ than shooting them down; follow tangents; push past the first 3–5 obvious
137
+ ideas; use the frameworks above to open new angles. Do not evaluate
138
+ feasibility here — that kills divergent thinking.
139
+ 3. **Provoke** — The sparring-partner stage: "What is the strongest argument
140
+ against this?", "Who would hate this and why?", "What are we not
141
+ seeing?", "What if the opposite were true?", "What is the 10x more
142
+ ambitious version?"
143
+ 4. **Converge** — Group ideas into themes; evaluate against user impact,
144
+ feasibility, strategic alignment, and evidence strength; identify the top
145
+ 2–3 directions; for each, name the biggest unknown and the cheapest way
146
+ to resolve it. If one idea excites the user, explore it even if risky —
147
+ the brainstorm is not the decision.
148
+ 5. **Capture** — Mandatory; a brainstorm with no capture never happened.
149
+ Record in conversation: the key ideas and why they are interesting, the
150
+ assumptions to test, the questions to research, the suggested next steps,
151
+ and what was explicitly set aside (interesting, but not now).
152
+
153
+ At Capture, persist the durable subset via `remember`: chosen directions
154
+ with their why and rejected directions with reasons as `decision`, reusable
155
+ framings or cross-session insights as `pattern` — tagged
156
+ `project:<projectId>`, `session:discovery-<entity>`, `workflow:discovery`,
157
+ `entity:<name>`, and a memory-tier tag. Persist only what transcends the
158
+ session; never fabricate memories to satisfy process. If the server is
159
+ unavailable, the capture summary in conversation is the record.
160
+
161
+ ## PRD Handoff (to-prd)
162
+
163
+ End every Capture with an explicit offer — this step is mandatory, the PRD
164
+ is not:
165
+
166
+ > "Want me to turn this into a PRD (Product Requirements Document)? I'd
167
+ > synthesize this conversation through the `to-prd` workflow — no new
168
+ > interview."
169
+
170
+ - **Accepted** → route to `workflows/to-prd.md`. The user's acceptance is
171
+ the explicit request `to-prd`'s routing requires. Carry the current
172
+ conversation context — Capture's output (chosen directions, assumptions,
173
+ set-asides) feeds the PRD's problem statement, decisions, and out-of-scope
174
+ sections directly; `to-prd` does not re-interview.
175
+ - **Declined** → the capture summary stays in conversation and the durable
176
+ memories from Capture remain the only persistence. Offer nothing else.
177
+
178
+ If discovery converged on nothing PRD-shaped (pure problem exploration, or
179
+ the session identified research as the next step), say so instead of
180
+ offering an empty PRD — name what research or evidence would make the next
181
+ discovery session converge.
182
+
183
+ ## Thinking-Partner Conduct
184
+
185
+ Do:
186
+
187
+ - **Be opinionated.** "I think approach B is stronger because…" beats a
188
+ pro/con list.
189
+ - **Challenge constructively.** "That assumes X — are we confident?", not
190
+ "that will not work."
191
+ - **Bring unexpected angles** — cross-industry analogies, counterexamples,
192
+ edge cases the user has not considered.
193
+ - **Match energy.** When the user is excited about an idea, explore it with
194
+ them before poking holes.
195
+ - **Ask the next question.** When the user finishes a thought, push
196
+ further: "and then what happens?"
197
+ - **Name the pattern.** When a common PM trap appears (solutioning too
198
+ early, scope creep, feature-parity thinking), name it directly.
199
+
200
+ Do not:
201
+
202
+ - Dump frameworks or work through them as a checklist.
203
+ - Generate a list and hand it over — brainstorming is a conversation, not a
204
+ deliverable.
205
+ - Agree with everything — a thinking partner who only validates is not one.
206
+ - Evaluate feasibility during divergence.
207
+ - Anchor on the first idea — when the user leads with a solution,
208
+ acknowledge it, then ask what else could solve the problem.
209
+ - Confuse brainstorming with decision-making — the brainstorm generates
210
+ options; the decision comes later with more data.
211
+
212
+ ## Anti-Patterns To Catch
213
+
214
+ - **Solutioning before framing**: "we should build X" before the problem is
215
+ defined — slow down, ask what user problem X solves and how we know.
216
+ - **The feature-parity trap**: "competitor has X, so we need X" is copying,
217
+ not brainstorming — ask what user need X serves and whether there is a
218
+ better way to serve it.
219
+ - **Anchoring on constraints**: "we can't because of Y" during divergence —
220
+ set constraints aside, explore freely, then price feasibility.
221
+ - **The one-idea brainstorm**: a solution presented as a brainstorm —
222
+ acknowledge it, then push for three alternatives.
223
+ - **Analysis paralysis**: long divergence with no convergence — prompt "if
224
+ you had to pick one direction right now, which and why?"
225
+ - **Brainstorming when you should be researching**: when the session circles
226
+ because nobody knows the answer, stop and name the research needed — some
227
+ questions need data, not ideation.
228
+
229
+ ## Completion
230
+
231
+ Discovery completes at Capture plus the PRD offer. Before claiming the
232
+ session complete, apply `references/evidence-gate.md`: the evidence here is
233
+ the capture summary (ideas, assumptions, next steps, set-asides), the memory
234
+ outcome (what was persisted or why persistence was skipped), and the
235
+ recorded PRD-offer disposition (accepted → to-prd, declined, or
236
+ not-PRD-shaped with the named research gap).
@@ -39,15 +39,29 @@ Before the first repository mutation, load `references/implementation-delivery.m
39
39
  - Include a focused naming review when the feature introduces or renames identifiers. New names should use domain or precise role vocabulary, and public/persisted names should not change without explicit compatibility handling.
40
40
  9. For mobile features, capture the mobile context packet, choose shared vs platform-specific boundaries, state platform parity expectations, and include the cheapest relevant mobile verification sensor from `references/mobile-context.md`
41
41
  10. Use `references/agent-orchestration.md` only for isolated implementation slices or independent verification
42
- 11. Implement the feature by PR group when `references/pr-task-fix.md` applies:
42
+ 11. Capture 1-5 testable acceptance criteria in the conversation before implementation starts, or reference an existing spec artifact (e.g. `.specs/features/<slug>/spec.md`) when one already states them. These captured acceptance criteria are the anchor the verification step below checks outcomes against.
43
+ 12. Implement the feature by PR group when `references/pr-task-fix.md` applies:
43
44
  - Order non-breaking groups by Data, Domain, then Presentation/Navigation, mapping those labels to repository boundaries when needed.
44
45
  - Validate each group with the verification recipe before committing.
45
46
  - Invoke `workflows/commit.md` for each verified group; do not duplicate commit staging, message, audit-exclusion, or Jira-prefix rules in this workflow.
46
47
  - When every group has a confirmed Jira key, follow the optional stacked branch flow in `references/pr-task-fix.md` (Jira-Key Stacked Branches).
47
- 12. Run the verification recipe and report skipped checks explicitly. If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
48
+
49
+ > **Dispatch: `massa-ai-reviewer`** (role: `reviewer`) — charter `skills/agents/reviewer/SKILL.md`
50
+ > - trigger: implementation complete, before the verification gate — never optional
51
+ > - scope: the feature's diff surface and its task/AC context
52
+ > - permissions: read-only
53
+ > - inputs: diff, acceptance context, recalled code-quality conventions
54
+ > - sensors: bugs, regressions, missing edge cases, smells introduced by the diff
55
+ > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
56
+ > - firewall: summarized findings only, never raw diff dumps
57
+ > - memory: suggest-only; main agent persists
58
+ > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract and record the skipped-delegation reason
59
+ > - 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
60
+
61
+ 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. If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
48
62
  `bun skills/massa-ai/scripts/lessons.ts --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
49
- 13. At completion, persist (run the scoring rubric from `references/decision-engine.md` for each):
63
+ 14. At completion, persist (run the scoring rubric from `references/decision-engine.md` for each):
50
64
  - Design decisions made via `remember` as scored `decision` memories
51
65
  - New patterns introduced via `remember` as scored `pattern` memories
52
66
  - Trade-offs accepted via `remember` as scored `conversation` memories
53
- 14. Complete the Evidence Gate from `references/evidence-gate.md`
67
+ 15. Complete the Evidence Gate from `references/evidence-gate.md`
@@ -34,6 +34,19 @@ Before the first repository mutation, load `references/implementation-delivery.m
34
34
  - if a recalled memory is stale or needs correction, call `memory_update` with `id` and the new `content` (re-embeds automatically); if a memory is obsolete, call `memory_delete` with `id` (hard-delete, severs graph edges)
35
35
  - for usage insights (search/cache patterns, recent activity), call `analytics` with `type` and `projectId`
36
36
  - skip transient details, raw logs, copied source, unverified hypotheses, and facts already captured in current non-stale memory
37
+
38
+ > **Dispatch: `massa-ai-reviewer`** (role: `reviewer`) — charter `skills/agents/reviewer/SKILL.md`
39
+ > - trigger: implementation complete, before the verification gate — never optional
40
+ > - scope: the change's diff surface and its task/AC context
41
+ > - permissions: read-only
42
+ > - inputs: diff, acceptance context, recalled code-quality conventions
43
+ > - sensors: bugs, regressions, missing edge cases, smells introduced by the diff
44
+ > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
45
+ > - firewall: summarized findings only, never raw diff dumps
46
+ > - memory: suggest-only; main agent persists
47
+ > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract and record the skipped-delegation reason
48
+ > - 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
49
+
37
50
  9. Complete the Evidence Gate from `references/evidence-gate.md` and report verification, changed artifacts, memory outcome, and residual risk.
38
51
 
39
52
  ## Failure Handling
@@ -78,6 +78,19 @@ Do not execute from chat summaries, inline review comments, remembered findings,
78
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
79
 
80
80
  Never run parallel writers against shared files or contracts.
81
+
82
+ > **Dispatch: `massa-ai-reviewer`** (role: `reviewer`) — charter `skills/agents/reviewer/SKILL.md`
83
+ > - trigger: implementation complete, before the verification gate — never optional
84
+ > - scope: the fix's diff surface and its task/AC context
85
+ > - permissions: read-only
86
+ > - inputs: diff, acceptance context, recalled code-quality conventions
87
+ > - sensors: bugs, regressions, missing edge cases, smells introduced by the diff
88
+ > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
89
+ > - firewall: summarized findings only, never raw diff dumps
90
+ > - memory: suggest-only; main agent persists
91
+ > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract 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
+
81
94
  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. 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.
82
95
  12. Produce a closure matrix with finding ID, source lens, status (`fixed`, `deferred`, `blocked`, `skipped`), changed files, command/artifact, result, skipped reason or `none`, highest Verification Ladder level reached, validation assets protected, residual risk, and exact next step for deferred or blocked findings.
83
96
  13. If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
@@ -62,6 +62,19 @@ Reject direct use without a saved `audits/maestro/<YYYY-MM-DD maestro-audit.md>`
62
62
  - Replace brittle selectors with stable selectors, accessibility labels, or test IDs already present.
63
63
  - Keep setup/teardown explicit, idempotent, and isolated.
64
64
  - Protect existing flows, subflows, fixtures, snapshots, baselines, report consumers, and CI commands unless the audit finding explicitly scopes them.
65
+
66
+ > **Dispatch: `massa-ai-reviewer`** (role: `reviewer`) — charter `skills/agents/reviewer/SKILL.md`
67
+ > - trigger: implementation complete, before the verification gate — never optional
68
+ > - scope: the fix's diff surface and its task/AC context
69
+ > - permissions: read-only
70
+ > - inputs: diff, acceptance context, recalled code-quality conventions
71
+ > - sensors: bugs, regressions, missing edge cases, smells introduced by the diff
72
+ > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
73
+ > - firewall: summarized findings only, never raw diff dumps
74
+ > - memory: suggest-only; main agent persists
75
+ > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract and record the skipped-delegation reason
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
+
65
78
  9. Use strict harness sensors:
66
79
  - If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
67
80
  `bun skills/massa-ai/scripts/lessons.ts --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
@@ -49,6 +49,19 @@ Do not execute from chat summaries, screenshots alone, remembered findings, or a
49
49
  - Keep XML/Compose, UIKit/SwiftUI, and KMP/native interoperability explicit. Do not duplicate one visual rule across layers when an established shared source owns it.
50
50
  - Do not weaken screenshot tests, previews, fixtures, assertions, test tags, resource IDs, content descriptions, or Maestro selectors to hide a mismatch.
51
51
  - Modify tracked Maestro flows only when the selected finding explicitly identifies the flow as incorrect or missing and the user-approved scope includes that change.
52
+
53
+ > **Dispatch: `massa-ai-reviewer`** (role: `reviewer`) — charter `skills/agents/reviewer/SKILL.md`
54
+ > - trigger: implementation complete, before the verification gate — never optional
55
+ > - scope: the fix's diff surface and its task/AC context
56
+ > - permissions: read-only
57
+ > - inputs: diff, acceptance context, recalled code-quality conventions
58
+ > - sensors: bugs, regressions, missing edge cases, smells introduced by the diff
59
+ > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
60
+ > - firewall: summarized findings only, never raw diff dumps
61
+ > - memory: suggest-only; main agent persists
62
+ > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract and record the skipped-delegation reason
63
+ > - 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
64
+
52
65
  9. Verify after each coherent finding group:
53
66
  - If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
54
67
  `bun skills/massa-ai/scripts/lessons.ts --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
@@ -146,7 +146,7 @@ the severity labels, and the reply contract.
146
146
  | 2 | Requirements & DoD (Definition of Done) | `massa-ai-audit-specialist` | `lens: requirements` — score merged Track A + Track B criteria against the diff, evidence-or-zero: ✅ implemented (`path:line`) / 🟡 partial / ❌ missing; no source ⇒ report "requirements verification skipped" | `requirements` |
147
147
  | 3 | Architecture & conventions | `massa-ai-audit-specialist` | `lens: architecture` — extract every explicit rule from the profile's CONVENTIONS/REVIEW_SKILLS docs into a numbered matrix, grade each changed file PASS/VIOLATION/N/A; no docs ⇒ minimal generic boundary sweep, stated | `architecture` |
148
148
  | 4 | Performance | `massa-ai-audit-specialist` | `lens: performance` — only issues clearly visible in the diff: N+1 queries, unbounded fetches, per-row lazy I/O, sequential awaits of independent calls, loop-invariant recomputation, unbatched writes | `performance` |
149
- | 5 | Test coverage | `massa-ai-audit-specialist` | `lens: performance`, scope: test coverage (the charter's lens set has no `tests` lens; `tests-audit.md` precedent) — new/changed behavior with no test, wrong level (unit vs integration), placement/naming vs profile TEST row, missing negative case, assertions that exercise but never assert | `tests` |
149
+ | 5 | Test coverage | `massa-ai-audit-specialist` | `lens: tests` (dedicated lens: coverage, regression protection, assertion quality, variation `tests-audit.md` precedent) — new/changed behavior with no test, wrong level (unit vs integration), placement/naming vs profile TEST row, missing negative case, missing variation beyond the fixture example, assertions that exercise but never assert | `tests` |
150
150
  | 6 | Regression & hallucination | `massa-ai-reviewer` | diff review — unrelated deletions, references to symbols absent from the repo, wrong signature/arity, duplicated existing logic, weakened error handling or assertions, leftover TODO/stub, dead code | `regression` |
151
151
 
152
152
  Consolidation check (≥ 5 subagents): recorded in the feature design — rows 4 and 5
@@ -40,6 +40,7 @@ Before the first repository mutation, load `references/implementation-delivery.m
40
40
  8. Focus on pragmatic refactoring:
41
41
  - Identify over-abstracted code and propose Modular Monoliths
42
42
  - Reduce "abstraction cost" to make code more AI-navigable
43
+ - The primary payoff of extraction is extract-for-findability: create a named unit locatable by search or grep from outside the file — that is what makes code AI-navigable, not extraction volume alone
43
44
  - Verify changes do not break existing behavior using the verification recipe
44
45
  9. Execute by PR group when `references/pr-task-fix.md` applies:
45
46
  - Order non-breaking groups by Data, Domain, then Presentation/Navigation, mapping those labels to repository boundaries when needed.
@@ -52,4 +53,17 @@ Before the first repository mutation, load `references/implementation-delivery.m
52
53
  12. At completion, persist (run the scoring rubric from `references/decision-engine.md`):
53
54
  - Refactored architectural decisions via `remember` as scored `decision` memories
54
55
  - Identified and decoupled anti-patterns via `remember` as scored `pattern` memories
56
+
57
+ > **Dispatch: `massa-ai-reviewer`** (role: `reviewer`) — charter `skills/agents/reviewer/SKILL.md`
58
+ > - trigger: implementation complete, before the verification gate — never optional
59
+ > - scope: the change's diff surface and its task/AC context
60
+ > - permissions: read-only
61
+ > - inputs: diff, acceptance context, recalled code-quality conventions
62
+ > - sensors: bugs, regressions, missing edge cases, smells introduced by the diff
63
+ > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
64
+ > - firewall: summarized findings only, never raw diff dumps
65
+ > - memory: suggest-only; main agent persists
66
+ > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract and record the skipped-delegation reason
67
+ > - 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
68
+
55
69
  13. Complete the Evidence Gate from `references/evidence-gate.md`
@@ -78,6 +78,19 @@ Not for findings-only requirements review — route to `workflows/requirements/r
78
78
  > - memory: suggest-only; main agent persists reusable verification recipes
79
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
80
  - Main agent owns report parsing, traceability matrix, memory writes, final synthesis, and Evidence Gate.
81
+
82
+ > **Dispatch: `massa-ai-reviewer`** (role: `reviewer`) — charter `skills/agents/reviewer/SKILL.md`
83
+ > - trigger: implementation complete, before the verification gate — never optional
84
+ > - scope: the fix's diff surface and its task/AC context
85
+ > - permissions: read-only
86
+ > - inputs: diff, acceptance context, recalled code-quality conventions
87
+ > - sensors: bugs, regressions, missing edge cases, smells introduced by the diff
88
+ > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
89
+ > - firewall: summarized findings only, never raw diff dumps
90
+ > - memory: suggest-only; main agent persists
91
+ > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract 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
+
81
94
  11. Verify each completed finding:
82
95
  - If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
83
96
  `bun skills/massa-ai/scripts/lessons.ts --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
@@ -82,6 +82,19 @@ Not for findings-only security review — route to `workflows/security/security-
82
82
  > - memory: suggest-only; main agent persists reusable verification recipes
83
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
84
  - Main agent owns report parsing, prioritization, memory writes, final synthesis, and Evidence Gate.
85
+
86
+ > **Dispatch: `massa-ai-reviewer`** (role: `reviewer`) — charter `skills/agents/reviewer/SKILL.md`
87
+ > - trigger: implementation complete, before the verification gate — never optional
88
+ > - scope: the fix's diff surface and its task/AC context
89
+ > - permissions: read-only
90
+ > - inputs: diff, acceptance context, recalled code-quality conventions
91
+ > - sensors: bugs, regressions, missing edge cases, smells introduced by the diff
92
+ > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
93
+ > - firewall: summarized findings only, never raw diff dumps
94
+ > - memory: suggest-only; main agent persists
95
+ > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract and record the skipped-delegation reason
96
+ > - 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
97
+
85
98
  11. Verify each completed finding:
86
99
  - If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
87
100
  `bun skills/massa-ai/scripts/lessons.ts --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
@@ -110,6 +110,18 @@ Quick artifacts live under `.specs/quick/NNN-slug/` with a `TASK.md` (one-line i
110
110
  - Update logical feature artifacts in `.specs/features/<slug>/` and `.specs/project/STATE.md` after meaningful progress.
111
111
  - Finish Execute by running `references/spec-driven/validate.md`. Dispatch `verification-agent` (author ≠ verifier) per `references/agent-orchestration.md`; the verification-agent always runs automatically and writes `.specs/features/<slug>/validation.md`. Without subagents, run the standalone fresh-eyes fallback in `validate.md`.
112
112
 
113
+ > **Dispatch: `massa-ai-reviewer`** (role: `reviewer`) — charter `skills/agents/reviewer/SKILL.md`
114
+ > - trigger: implementation complete, before the verification gate — never optional
115
+ > - scope: the task's diff surface and its task/AC context
116
+ > - permissions: read-only
117
+ > - inputs: diff, acceptance context, recalled code-quality conventions
118
+ > - sensors: bugs, regressions, missing edge cases, smells introduced by the diff
119
+ > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
120
+ > - firewall: summarized findings only, never raw diff dumps
121
+ > - memory: suggest-only; main agent persists
122
+ > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract and record the skipped-delegation reason
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
+
113
125
  > **Dispatch: `massa-ai-verification-agent`** (role: `verification-agent`) — charter `skills/agents/verification-agent/SKILL.md`
114
126
  > - trigger: spec-driven Execute final gate; author ≠ verifier independence required
115
127
  > - scope: the feature's git diff surface, test files, and spec ACs
@@ -16,6 +16,18 @@ Not to write, run, or fix test findings as the main task — route to `workflows
16
16
 
17
17
  Findings-only: do not edit code unless the user separately asks for fixes.
18
18
 
19
+ ### Gate / Error-Class Model
20
+
21
+ Five gates, five distinct error classes. A green gate elsewhere never substitutes for a missing one — each row below is a gap this audit checks for independently:
22
+
23
+ | Gate | Error class caught |
24
+ | --- | --- |
25
+ | Unit | Business-logic errors |
26
+ | Coverage | Code no test touched |
27
+ | Variation | Hardcoded-example brittleness |
28
+ | Acceptance-criteria mapping | Built-the-wrong-thing |
29
+ | Quality-metric trend | Drift over time |
30
+
19
31
  1. Resolve/reuse `workflowSessionId`: `test-audit-[entity]`
20
32
  2. Load shared references:
21
33
  - `references/codebase-investigation.md`
@@ -46,7 +58,7 @@ Findings-only: do not edit code unless the user separately asks for fixes.
46
58
  > - trigger: large scope, explicit parallel/subagent request, PR subagent invocation, or independent verification of high-impact finding
47
59
  > - scope: the tests audit target — test files, fixtures, harnesses, coverage
48
60
  > - permissions: read-only
49
- > - inputs: shared scope packet; `lens: performance` (test coverage is under the performance lens); recalled testing conventions, flaky tests, known regressions
61
+ > - inputs: shared scope packet; `lens: tests`; recalled testing conventions, flaky tests, known regressions
50
62
  > - sensors: map behavior to tests; check missing tests for new branches, error paths, async logic, migrations; fixture health, assertion quality, flakiness root-cause
51
63
  > - output: findings with missing/weak coverage type, location, evidence, regression risk, severity, simplest test direction, deterministic sensor, verification suggestion
52
64
  > - firewall: raw diffs/logs/search output summarized, not returned raw
@@ -54,6 +66,8 @@ Findings-only: do not edit code unless the user separately asks for fixes.
54
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
55
67
 
56
68
  - Map changed or targeted behavior to existing tests, fixtures, mocks, and deterministic harnesses.
69
+ - Variation check: flag tests exercising only the single fixture example where input bounds or parameters can vary — hardcoded-example brittleness the unit gate cannot see.
70
+ - Trend check: read `bun skills/massa-ai/scripts/lessons.ts --root . metrics trend` and report the direction (improving, stable, degrading) when two or more snapshots exist; report `insufficient data` otherwise.
57
71
  - Check missing tests for new branches, error paths, auth/validation/persistence changes, async or race-prone logic, migrations, public contracts, and recalled bug patterns.
58
72
  - For mobile scopes, check KMP shared and platform-specific `actual` tests, Android/iOS harnesses, native bridge payload coverage, permissions, lifecycle, offline sync, deep links, push/background flows, UI snapshots/screenshots, device-matrix assumptions, and platform parity claims from `references/mobile-context.md`.
59
73
  - Check weak assertions, tests that only assert implementation details, fixture drift, nondeterminism, hidden network/time/filesystem dependencies, skipped tests, and weakened snapshots.
@@ -52,11 +52,25 @@ Not for findings-only test coverage, assertion quality, fixture health, flakines
52
52
  - Fixture drift: repair fixtures/builders to match current contracts while keeping them minimal and explicit.
53
53
  - Flakiness: prove root cause first; control time, randomness, async scheduling, filesystem, network, and global state with deterministic seams.
54
54
  - Missing sensor: add or document the focused command needed to prove the regression cannot recur.
55
+ - Variation: add varied-input cases (bounds, parameter changes) that exercise the behavior beyond the fixture example — never add a second copy of the fixture example.
55
56
  - Mobile coverage: prefer KMP/shared tests before device loops when the behavior is shared; use Android/iOS harnesses, bridge contract tests, screenshot/snapshot checks, lifecycle or permission simulations, and parity validation when the report finding requires them.
56
57
  9. Guard validation assets:
57
58
  - Never weaken assertions only to make the suite pass.
58
59
  - Do not delete coverage, snapshots, fixtures, or benchmarks unless the audit report explicitly calls them obsolete and behavior remains protected elsewhere.
59
60
  - Prefer production-code changes only when required to expose a deterministic seam or fix a real bug found while writing the audited test.
61
+
62
+ > **Dispatch: `massa-ai-reviewer`** (role: `reviewer`) — charter `skills/agents/reviewer/SKILL.md`
63
+ > - trigger: implementation complete, before the verification gate — never optional
64
+ > - scope: the fix's diff surface and its task/AC context
65
+ > - permissions: read-only
66
+ > - inputs: diff, acceptance context, recalled code-quality conventions
67
+ > - sensors: bugs, regressions, missing edge cases, smells introduced by the diff
68
+ > - output: ranked findings, blocking vs advisory; blocking findings become fix items before verification runs
69
+ > - firewall: summarized findings only, never raw diff dumps
70
+ > - memory: suggest-only; main agent persists
71
+ > - fallback: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract and record the skipped-delegation reason
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
+
60
74
  10. Use strict harness sensors:
61
75
  - Never rely on AI subjective evaluation.
62
76
  - If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`: