@massa-ai/cursor-plugin 1.22.0 → 1.23.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.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "massa-ai",
3
- "version": "1.22.0",
3
+ "version": "1.23.0",
4
4
  "description": "massa-ai — semantic code search, memory, and context compression for Cursor"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massa-ai/cursor-plugin",
3
- "version": "1.22.0",
3
+ "version": "1.23.0",
4
4
  "description": "massa-ai plugin for Cursor — semantic code search, memory, and context compression",
5
5
  "files": [
6
6
  "agents",
@@ -60,6 +60,14 @@ Before reading any massa-ai file:
60
60
  - Persist only durable, useful knowledge. Do not fabricate memories to satisfy
61
61
  process. Use `memory_update` to correct stale memories and `memory_delete`
62
62
  to remove obsolete ones.
63
+ - Expand every word abbreviation on first use in user-facing output — e.g.
64
+ "PR (Pull Request)", "AC (Acceptance Criteria)", "KMP (Kotlin Multiplatform)"
65
+ — including workflow-specific shorthands and finding-ID families.
66
+ - Use one uniform vocabulary for separating batches of work in every workflow:
67
+ a **Task** is the atomic unit; a **Phase** is an ordered group of Tasks.
68
+ Report a phase's size as `1 Phase = X Tasks` and a plan's total as
69
+ `Y Phases = Z Tasks`. Do not substitute synonyms such as batch, wave, stage,
70
+ or chunk for these units in agent prose.
63
71
  - Emit concise user-facing status updates at meaningful workflow boundaries
64
72
  when the Conversation Feedback Policy is active.
65
73
  - Verify, don't assume: every factual claim that drives a decision is
@@ -275,6 +283,7 @@ Load only when a selected workflow asks for them:
275
283
  - `references/debug-diagnosis-loop.md`
276
284
  - `references/mobile-context.md`
277
285
  - `references/mobile-diagnosis.md`
286
+ - `references/figma-pre-analysis.md`
278
287
  - `references/mobile-figma-matcher/`
279
288
  - `references/lessons.md`
280
289
  - `references/naming-standards.md`
@@ -0,0 +1,69 @@
1
+ # Figma Pre-Analysis And Sequential Retrieval
2
+
3
+ Load this reference whenever a workflow receives one or more Figma links, node
4
+ IDs, or a readable desktop selection as a design source — the Figma audit/fix
5
+ family (`mobile-figma-audit`, `mobile-figma-fix`), `design`, and the
6
+ design-source gates of implementation workflows (`feature`, `spec-driven`).
7
+ This reference owns the orchestration protocol only; Figma Evidence Packet
8
+ field contracts stay in `references/mobile-figma-matcher/core.md`.
9
+
10
+ The protocol is the single normative copy. Workflows point here; they do not
11
+ restate it.
12
+
13
+ ## Why Two Stages
14
+
15
+ Full Figma extraction on unscoped links overloads one context with mixed
16
+ screens, buries feature boundaries, and makes evidence non-attributable. A
17
+ cheap pre-analysis pass first maps what the links contain, so each retrieval
18
+ pass reads one coherent slice.
19
+
20
+ ## Stage 1 — Pre-Analysis (always first, exactly one subagent)
21
+
22
+ Dispatch one read-only subagent (investigator-class; Figma MCP — Model Context
23
+ Protocol — access, no repository mutation) over the user-provided Figma links.
24
+ Its job is understanding, **not** extraction:
25
+
26
+ - Summarize composition: pages, screens, frames, component sets, shared tokens.
27
+ - Summarize product context: what the screens are for, the features they serve,
28
+ and the user flows connecting them.
29
+ - It does not build Figma Evidence Packet fields, does not resolve variables or
30
+ exact geometry, and does not compare against source code.
31
+
32
+ Its output is a compact packet:
33
+
34
+ 1. **Context summary** — screens/features/flows in prose, sized for the main
35
+ agent's context budget.
36
+ 2. **Partition proposal** — how many retrieval subagents should read which
37
+ links/nodes/screen groups, partitioned by:
38
+ - **Size:** each slice must fit one subagent's context comfortably.
39
+ - **Coupling:** screens sharing tokens, components, or a design system
40
+ section stay in one slice.
41
+ - **Feature flow:** one user flow per slice when possible, so evidence
42
+ stays attributable to a feature.
43
+ A single small screen legitimately yields a one-slice proposal.
44
+
45
+ The main agent reviews the proposal, adjusts slice boundaries if project
46
+ knowledge contradicts them, and records the final partition before Stage 2.
47
+
48
+ ## Stage 2 — Sequential Retrieval (N subagents, one at a time)
49
+
50
+ The main agent orchestrates the retrieval subagents **strictly sequentially —
51
+ never in parallel**. For each slice, in the recorded order:
52
+
53
+ 1. Dispatch one read-only retrieval subagent scoped to that slice's
54
+ links/nodes, carrying the Stage 1 context summary and the slice's purpose.
55
+ 2. Wait for completion; fold its output into the workflow's Figma Evidence
56
+ Packet (or Screenshot Context Packet rows) before dispatching the next.
57
+ 3. Let each completed slice inform the next dispatch prompt — resolved shared
58
+ tokens, discovered variants, and naming conventions carry forward.
59
+
60
+ Sequential dispatch is a hard rule, not a tuning choice: it respects Figma MCP
61
+ session/rate limits, and it is what lets slice N+1 reuse what slice N learned.
62
+ Retrieval subagents never spawn further subagents.
63
+
64
+ ## Fallback
65
+
66
+ If subagent spawning is unavailable (forbidden, plugin missing, unknown agent
67
+ type), run both stages inline in the main agent in the same order — pre-analysis
68
+ summary first, then per-slice retrieval — and record the skipped delegation
69
+ with its reason. Do not skip Stage 1 because delegation is unavailable.
@@ -90,6 +90,18 @@ title: `[SA-100] Phase 1: search facade split`. The per-task commit prefixes on
90
90
  the branch are owned by `workflows/commit.md`; this stage owns only the PR-level
91
91
  phase prefix. Non-phased work keeps the existing PR title behavior unchanged.
92
92
 
93
+ ### Stages 3–7 — the PR description stays current
94
+
95
+ The PR description is a living artifact, not a creation-time snapshot. After
96
+ **every push requested while the PR exists** — repair iterations, follow-up
97
+ tasks, review-requested changes — update the PR description with
98
+ `gh pr edit <number> --body <b>` so it reflects the branch's current commit
99
+ set, scope, and evidence **before** returning to Watch. The description must be
100
+ current before the merge decision is requested; a merge may never be proposed
101
+ over a description that describes an older state of the branch. When generated
102
+ or bundled files are regenerated alongside source edits, the description names
103
+ that blast radius explicitly so reviewers do not undercount the diff.
104
+
93
105
  ### Stage 7 — merge is never automatic
94
106
 
95
107
  Do not run `gh pr merge` without explicit user approval given in the current
@@ -126,6 +138,8 @@ silently did not run is worse than one that loudly failed.
126
138
  - Merging because CI passed. CI passing is the precondition for asking, not the
127
139
  approval itself.
128
140
  - Reporting "done" while the branch is unpushed.
141
+ - Proposing or performing a merge while the PR description still describes an
142
+ older commit set — update it after each requested push, before merging.
129
143
 
130
144
  ## Completion Evidence
131
145
 
@@ -76,6 +76,25 @@ For design, mobile Figma audit, or mobile Figma fix, load `references/mobile-fig
76
76
 
77
77
  Never rely on model self-evaluation. If device access, signing, credentials, provisioning, or hardware is unavailable, state the missing dependency and use the strongest available artifact or static proof.
78
78
 
79
+ ## Compose Screen Previews
80
+
81
+ In every implementation workflow, when the target surface is Android Jetpack
82
+ Compose or KMP (Kotlin Multiplatform) Compose Multiplatform, every created or
83
+ updated screen-level composable ships with `@Preview` composables in the same
84
+ change:
85
+
86
+ - Cover the representative states the change touches (default content, loading,
87
+ error, and empty where they exist), using preview parameter providers when
88
+ the project already uses them.
89
+ - Follow the project's existing preview conventions (naming, placement,
90
+ multipreview annotations, theme wrappers) rather than inventing new ones.
91
+ - Previews are validation assets: never delete or weaken an existing preview to
92
+ make a change compile, and treat a screen edit that leaves its previews stale
93
+ as incomplete work.
94
+ - On KMP, place previews in the source set where the project renders them
95
+ (commonMain multiplatform previews or per-platform preview hosts), matching
96
+ established project layout.
97
+
79
98
  ## Tests Lens
80
99
 
81
100
  When auditing or executing test work, check mobile-specific coverage for:
@@ -4,7 +4,7 @@ Use this reference when `workflows/debug.md` handles broken behavior involving K
4
4
 
5
5
  This extends `references/debug-diagnosis-loop.md`. Do not use it instead of the general debug loop.
6
6
 
7
- For non-debug mobile feature, refactor, tests, or security work, keep the intent-specific workflow and load `references/mobile-context.md` instead. Use `references/mobile-context.md` from Debug only when shared mobile vocabulary or non-bug parity/security/test framing is needed.
7
+ For non-debug mobile feature, refactor, tests, or security work, keep the intent-specific workflow and load `references/mobile-context.md` instead. Use `references/mobile-context.md` from Debug only when shared mobile vocabulary or non-bug parity/security/test framing is needed — and always when a fix creates or updates a Compose screen, because its Compose Screen Previews rule (`@Preview` coverage) applies to debug-path edits too.
8
8
 
9
9
  ## Mobile Intake
10
10
 
@@ -9,7 +9,7 @@ Before the first repository mutation, load `references/implementation-delivery.m
9
9
  Do not use this workflow for Flutter, React Native, web UI, generic Figma exploration, variable-only queries, or MCP troubleshooting.
10
10
 
11
11
  1. Resolve/reuse `workflowSessionId`: `design-[entity]`.
12
- 2. Load `references/mobile-figma-matcher/repository-detection.md`, `references/mobile-figma-matcher/core.md`, `references/mobile-context.md`, `references/codebase-investigation.md`, and `references/verification-ladder.md`. Load `references/context-firewall.md` before large design/runtime artifacts and `references/synapse-policy.md` when repeated massa-ai searches are expected.
12
+ 2. Load `references/mobile-figma-matcher/repository-detection.md`, `references/mobile-figma-matcher/core.md`, `references/mobile-context.md`, `references/codebase-investigation.md`, and `references/verification-ladder.md`. When Figma links or node IDs are provided, load `references/figma-pre-analysis.md` and run its two-stage sequential retrieval protocol before building the Figma Evidence Packet. Load `references/context-firewall.md` before large design/runtime artifacts and `references/synapse-policy.md` when repeated massa-ai searches are expected.
13
13
  3. `recall` -> load current component conventions, design-system rules, approved platform/accessibility deviations, prior Figma mappings, asset pipelines, and reusable render recipes. Memory is context, not proof.
14
14
  4. Require a concrete feature/module target plus at least one design source: readable Figma node/selection or supplied screenshots. Resolve required visual and interactive states plus a requirements source for behavior not represented in the design source. Ask only when target ownership, runtime platforms, platform-frame mappings, or screenshot authority remain ambiguous after source inspection.
15
15
  5. Build the immutable Target Surface Packet before loading stack guidance. Classify each selected surface and load only its contracts:
@@ -22,7 +22,7 @@ Before the first repository mutation, load `references/implementation-delivery.m
22
22
  - Ask for one or more Figma links, node IDs, a readable desktop selection, supplied screenshots, or explicit `none`.
23
23
  - Do not ask for clear backend, CLI, docs, infrastructure, or non-UI work.
24
24
  - Treat `none` as a first-class answer. Record `Figma Source: none by user choice` and do not re-ask unless the mobile UI scope changes.
25
- - If Figma sources or screenshots are supplied for supported Android, iOS, or KMP Compose Multiplatform UI implementation/update work, keep this workflow as the parent and invoke `workflows/design.md` for the affected UI slice.
25
+ - If Figma sources or screenshots are supplied for supported Android, iOS, or KMP Compose Multiplatform UI implementation/update work, keep this workflow as the parent and invoke `workflows/design.md` for the affected UI slice. When Figma links or node IDs are supplied, load `references/figma-pre-analysis.md` and run its two-stage sequential retrieval protocol before consuming the design evidence.
26
26
  - Preserve mobile Figma routing by intent: compare/audit wording uses `workflows/mobile-figma/mobile-figma-audit.md`; saved `MFM-*` findings use `workflows/mobile-figma/mobile-figma-fix.md`.
27
27
  - If Figma sources are supplied for unsupported targets such as Flutter, React Native, web, desktop, or generic design exploration, do not run mobile Figma. Record that the Figma source is outside mobile Figma scope and continue the normal feature workflow.
28
28
  - Figma defines visible design intent and represented variants only. Screenshots are context-only unless paired with structured Figma evidence; do not claim exact Figma parity, tokens, variables, or dimensions from screenshots alone. Product behavior not represented by the design source still requires a separate requirements source.
@@ -10,6 +10,7 @@ Do not edit code. Route direct design implementation to `design`. Do not use thi
10
10
  2. Load shared references:
11
11
  - `references/mobile-figma-matcher/repository-detection.md` before platform guidance.
12
12
  - `references/mobile-figma-matcher/core.md` for Figma, assets, mapping, comparison, Maestro, and claim contracts.
13
+ - `references/figma-pre-analysis.md` when Figma links or node IDs are provided — run its two-stage sequential retrieval protocol before Figma extraction.
13
14
  - `references/mobile-context.md` for mobile boundaries, parity, and verification context.
14
15
  - `references/audit-scope.md` for target resolution and freshness.
15
16
  - `references/audit-report-io.md` before producing the report.
@@ -12,6 +12,7 @@ Do not execute from chat summaries, screenshots alone, remembered findings, or a
12
12
  2. Load shared references:
13
13
  - `references/mobile-figma-matcher/repository-detection.md` before platform guidance.
14
14
  - `references/mobile-figma-matcher/core.md` for Figma, assets, mapping, Maestro, matrix, and claim contracts.
15
+ - `references/figma-pre-analysis.md` when the findings span multiple Figma links or nodes — run its two-stage sequential retrieval protocol for the re-read.
15
16
  - `references/lessons.md` to load confirmed project lessons
16
17
  - `references/mobile-context.md` for mobile boundary and verification guidance.
17
18
  - `references/audit-report-io.md` before any source or validation-asset edit.
@@ -40,7 +40,7 @@ Complexity determines depth, not a fixed pipeline. Assess scope first, apply onl
40
40
  | Large | >10 tasks OR multi-component feature | Full spec + requirement IDs | Architecture + components | Full breakdown + deps | Implement + verify per task |
41
41
  | Complex | Ambiguity or new domain (unfamiliar vocabulary, no prior pattern) | Full spec + discuss gray areas | Research + architecture | Breakdown + phase plan | Implement + interactive UAT |
42
42
 
43
- A "phase" is a group of tasks sharing a dependency boundary or a checkpoint commit — it is distinct from a single task or atomic step. The sub-agent offer fires when a formal `tasks.md` has more than 3 tasks — packing itself still uses ~7-task batches; a 4–8-task feature is offered as a single batch worker.
43
+ A "Phase" is an ordered group of Tasks sharing a dependency boundary or a checkpoint commit — it is distinct from a single Task or atomic step. Report sizing in the uniform vocabulary: `1 Phase = X Tasks`; the whole plan is `Y Phases = Z Tasks`. The sub-agent offer fires when a formal `tasks.md` has more than 3 Tasks — packing itself still uses ~7-Task Phase groups; a 4–8-Task feature is offered as a single Phase-group worker.
44
44
 
45
45
  - Specify and Execute are always required.
46
46
  - Design is skipped when straightforward (no architectural decisions, no new patterns).
@@ -85,7 +85,7 @@ Quick artifacts live under `.specs/quick/NNN-slug/` with a `TASK.md` (one-line i
85
85
  3. Run `Specify` with `references/spec-driven/specify.md`.
86
86
  - Capture stable requirement IDs, testable acceptance criteria, edge cases, and explicit out-of-scope items.
87
87
  - Run `references/spec-driven/discuss.md` inside Specify when gray areas, implicit requirements, persistence/state, external calls, auth, payments, concurrency, or state transitions affect behavior.
88
- - For Android, iOS, or KMP Compose Multiplatform UI work, load `references/mobile-context.md` and run the optional design-source gate: ask for one or more Figma links, node IDs, a readable desktop selection, supplied screenshots, or explicit `none`; record `Figma Source: none by user choice` when declined. Screenshots are context-only unless paired with structured Figma evidence. For unsupported targets, record the source as outside mobile Figma scope and do not run mobile Figma.
88
+ - For Android, iOS, or KMP Compose Multiplatform UI work, load `references/mobile-context.md` and run the optional design-source gate: ask for one or more Figma links, node IDs, a readable desktop selection, supplied screenshots, or explicit `none`; record `Figma Source: none by user choice` when declined. When Figma links or node IDs are supplied, load `references/figma-pre-analysis.md` and run its two-stage sequential retrieval protocol before consuming the design evidence. Screenshots are context-only unless paired with structured Figma evidence. For unsupported targets, record the source as outside mobile Figma scope and do not run mobile Figma.
89
89
  - Apply the Requirement Closure Gate: every open requirement question is resolved with the user or recorded as an accepted assumption before execution begins.
90
90
  4. Decide whether `Design` is required. If yes, run `references/spec-driven/design.md`; if no, record why the skip is valid. When Design is skipped and a design concern appears later, stop and create `design.md` before continuing.
91
91
  5. Decide whether `Tasks` is required. If yes, run `references/spec-driven/tasks.md`; if no, list the inline atomic execution steps before editing. If the inline list reveals more than 5 steps or complex dependencies, stop and create `tasks.md` — the Tasks phase was wrongly skipped (safety valve).
@@ -94,7 +94,7 @@ Quick artifacts live under `.specs/quick/NNN-slug/` with a `TASK.md` (one-line i
94
94
  - Run repo-rules discovery from `references/repo-rules-discovery.md` before the first repository mutation: record the harness sources loaded (or `repo-rules: none present`), and implement so every new or changed file conforms to the target repo's module layout, unit-test location, and testing-area conventions. A repo rule wins over a skill default for placement and gate commands; record any deviation with an explicit reason. Never fabricate rules or create `.claude/`/`.cursor/` directories the repo lacks.
95
95
  - Use the Test Coverage Matrix and Gate Check Commands from `tasks.md`, or state their inline equivalents when Tasks was skipped.
96
96
  - Ask the MCP and skill question in Tasks or inline Execute when tool choice can change correctness or verification.
97
- - If a formal `tasks.md` has more than 3 tasks, present the sub-agent offer from `references/spec-driven/sub-agents.md` before starting Execute — even when packing yields a single batch (a 4–8-task feature is offered as one batch worker). Offer-then-confirm — never auto-spawn; the user must accept before any sub-agent is dispatched. One worker per batch (~7 tasks, whole phases): each batch worker executes all its tasks in order (implement → gate → atomic commit), then reports a compact summary (tasks done, commit hashes, test counts, deviations). Workers never spawn further sub-agents.
97
+ - If a formal `tasks.md` has more than 3 Tasks, present the sub-agent offer from `references/spec-driven/sub-agents.md` before starting Execute — even when packing yields a single Phase group (a 4–8-Task feature is offered as one Phase-group worker). Offer-then-confirm — never auto-spawn; the user must accept before any sub-agent is dispatched. One worker per Phase group (~7 Tasks, whole Phases): each worker executes all its Tasks in order (implement → gate → atomic commit), then reports a compact summary (Tasks done, commit hashes, test counts, deviations). Workers never spawn further sub-agents.
98
98
  - Implement one atomic step or approved task at a time.
99
99
  - For long-running task sequences, create a checkpoint via `create_checkpoint` at task boundaries with `taskId`, `description`, `progressPercent`, `currentStep`, `nextAction`, `fileChanges`, and `checkpointType: "manual"` so progress is resumable after interruption.
100
100
  - If resuming after interruption, call `list_checkpoints` with the `taskId` and `restore_checkpoint` to recover task state before continuing. If `create_checkpoint` is unavailable (e.g. `task_checkpoints` table missing), continue with `.specs/` artifact state as the fallback.