@massa-ai/cursor-plugin 1.6.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 (172) hide show
  1. package/.cursor-plugin/plugin.json +5 -0
  2. package/README.md +87 -0
  3. package/agents/massa-ai-architecture-specialist.md +65 -0
  4. package/agents/massa-ai-audit-specialist.md +81 -0
  5. package/agents/massa-ai-builder.md +67 -0
  6. package/agents/massa-ai-context-curator.md +67 -0
  7. package/agents/massa-ai-documentation-agent.md +65 -0
  8. package/agents/massa-ai-furps-analyst.md +71 -0
  9. package/agents/massa-ai-investigator.md +68 -0
  10. package/agents/massa-ai-mobile-specialist.md +82 -0
  11. package/agents/massa-ai-navigator.md +75 -0
  12. package/agents/massa-ai-plan-critic.md +90 -0
  13. package/agents/massa-ai-planner.md +65 -0
  14. package/agents/massa-ai-requirements-analyst.md +64 -0
  15. package/agents/massa-ai-reviewer.md +66 -0
  16. package/agents/massa-ai-test-engineer.md +66 -0
  17. package/agents/massa-ai-verification-agent.md +65 -0
  18. package/hooks/hooks.json +26 -0
  19. package/hooks/massa-ai-hook +298 -0
  20. package/install.sh +413 -0
  21. package/package.json +30 -0
  22. package/skills/agents/architecture-specialist/SKILL.md +69 -0
  23. package/skills/agents/audit-specialist/SKILL.md +85 -0
  24. package/skills/agents/builder/SKILL.md +71 -0
  25. package/skills/agents/context-curator/SKILL.md +71 -0
  26. package/skills/agents/documentation-agent/SKILL.md +69 -0
  27. package/skills/agents/furps-analyst/SKILL.md +74 -0
  28. package/skills/agents/investigator/SKILL.md +72 -0
  29. package/skills/agents/mobile-specialist/SKILL.md +86 -0
  30. package/skills/agents/navigator/SKILL.md +79 -0
  31. package/skills/agents/plan-critic/SKILL.md +93 -0
  32. package/skills/agents/planner/SKILL.md +69 -0
  33. package/skills/agents/requirements-analyst/SKILL.md +68 -0
  34. package/skills/agents/reviewer/SKILL.md +70 -0
  35. package/skills/agents/test-engineer/SKILL.md +70 -0
  36. package/skills/agents/verification-agent/SKILL.md +69 -0
  37. package/skills/def/SKILL.md +17 -0
  38. package/skills/find/SKILL.md +19 -0
  39. package/skills/graph/SKILL.md +16 -0
  40. package/skills/index/SKILL.md +19 -0
  41. package/skills/map/SKILL.md +24 -0
  42. package/skills/massa-ai/SKILL.md +315 -0
  43. package/skills/massa-ai/personas/README.md +35 -0
  44. package/skills/massa-ai/personas/ai-native-nodejs-cli-architect.md +76 -0
  45. package/skills/massa-ai/personas/catalog.json +157 -0
  46. package/skills/massa-ai/personas/context-skill-harness-engineer-architect.md +74 -0
  47. package/skills/massa-ai/personas/product-manager.md +67 -0
  48. package/skills/massa-ai/personas/senior-mobile-engineer.md +74 -0
  49. package/skills/massa-ai/personas/senior-mobile-qa-automation-engineer.md +75 -0
  50. package/skills/massa-ai/references/adr-authoring.md +189 -0
  51. package/skills/massa-ai/references/agent-orchestration.md +221 -0
  52. package/skills/massa-ai/references/architecture-coupling-lens.md +239 -0
  53. package/skills/massa-ai/references/architecture-deepening-lens.md +136 -0
  54. package/skills/massa-ai/references/architecture-domain-lens.md +186 -0
  55. package/skills/massa-ai/references/architecture-lenses.md +108 -0
  56. package/skills/massa-ai/references/audit-report-io.md +459 -0
  57. package/skills/massa-ai/references/audit-scope.md +103 -0
  58. package/skills/massa-ai/references/code-annotation.md +111 -0
  59. package/skills/massa-ai/references/codebase-investigation.md +96 -0
  60. package/skills/massa-ai/references/context-firewall.md +62 -0
  61. package/skills/massa-ai/references/conversation-feedback.md +104 -0
  62. package/skills/massa-ai/references/debug-diagnosis-loop.md +140 -0
  63. package/skills/massa-ai/references/decision-engine.md +73 -0
  64. package/skills/massa-ai/references/evidence-gate.md +53 -0
  65. package/skills/massa-ai/references/furps/analyst-role.md +49 -0
  66. package/skills/massa-ai/references/furps/checklist.md +92 -0
  67. package/skills/massa-ai/references/furps/intake.md +104 -0
  68. package/skills/massa-ai/references/furps/report-contract.md +140 -0
  69. package/skills/massa-ai/references/hook-enforcement.md +137 -0
  70. package/skills/massa-ai/references/implementation-delivery.md +101 -0
  71. package/skills/massa-ai/references/installation.md +110 -0
  72. package/skills/massa-ai/references/lessons.md +119 -0
  73. package/skills/massa-ai/references/maestro/artifacts-reports.md +69 -0
  74. package/skills/massa-ai/references/maestro/cli-device.md +65 -0
  75. package/skills/massa-ai/references/maestro/cloud.md +67 -0
  76. package/skills/massa-ai/references/maestro/config-env-output.md +76 -0
  77. package/skills/massa-ai/references/maestro/fact-ledger.md +71 -0
  78. package/skills/massa-ai/references/maestro/js-scripting.md +70 -0
  79. package/skills/massa-ai/references/maestro/mcp.md +59 -0
  80. package/skills/massa-ai/references/maestro/patterns.md +96 -0
  81. package/skills/massa-ai/references/maestro/selectors.md +91 -0
  82. package/skills/massa-ai/references/maestro/workspace-execution.md +81 -0
  83. package/skills/massa-ai/references/maestro/yaml-commands.md +203 -0
  84. package/skills/massa-ai/references/maestro.md +47 -0
  85. package/skills/massa-ai/references/mcp-tools.md +296 -0
  86. package/skills/massa-ai/references/memory-policy.md +103 -0
  87. package/skills/massa-ai/references/mobile-context.md +113 -0
  88. package/skills/massa-ai/references/mobile-diagnosis.md +106 -0
  89. package/skills/massa-ai/references/mobile-figma-matcher/ATTRIBUTION.md +5 -0
  90. package/skills/massa-ai/references/mobile-figma-matcher/android-compose.md +13 -0
  91. package/skills/massa-ai/references/mobile-figma-matcher/android-views.md +13 -0
  92. package/skills/massa-ai/references/mobile-figma-matcher/core.md +117 -0
  93. package/skills/massa-ai/references/mobile-figma-matcher/ios-swiftui.md +12 -0
  94. package/skills/massa-ai/references/mobile-figma-matcher/ios-uikit.md +12 -0
  95. package/skills/massa-ai/references/mobile-figma-matcher/kmp-compose-multiplatform.md +14 -0
  96. package/skills/massa-ai/references/mobile-figma-matcher/repository-detection.md +77 -0
  97. package/skills/massa-ai/references/naming-standards.md +47 -0
  98. package/skills/massa-ai/references/pr-task-fix.md +80 -0
  99. package/skills/massa-ai/references/project-context.md +76 -0
  100. package/skills/massa-ai/references/rfc/ATTRIBUTION.md +5 -0
  101. package/skills/massa-ai/references/rfc/discovery-and-sizing.md +120 -0
  102. package/skills/massa-ai/references/rfc/document-contract.md +85 -0
  103. package/skills/massa-ai/references/rfc/quality-and-lifecycle.md +101 -0
  104. package/skills/massa-ai/references/root-cause-scripts.md +97 -0
  105. package/skills/massa-ai/references/spec-driven/artifact-store.md +98 -0
  106. package/skills/massa-ai/references/spec-driven/code-analysis.md +119 -0
  107. package/skills/massa-ai/references/spec-driven/coding-principles.md +80 -0
  108. package/skills/massa-ai/references/spec-driven/context-limits.md +64 -0
  109. package/skills/massa-ai/references/spec-driven/design.md +257 -0
  110. package/skills/massa-ai/references/spec-driven/discuss.md +182 -0
  111. package/skills/massa-ai/references/spec-driven/execute.md +471 -0
  112. package/skills/massa-ai/references/spec-driven/lessons.md +5 -0
  113. package/skills/massa-ai/references/spec-driven/memory.md +214 -0
  114. package/skills/massa-ai/references/spec-driven/specify.md +283 -0
  115. package/skills/massa-ai/references/spec-driven/sub-agents.md +151 -0
  116. package/skills/massa-ai/references/spec-driven/tasks.md +494 -0
  117. package/skills/massa-ai/references/spec-driven/validate.md +397 -0
  118. package/skills/massa-ai/references/subagent-design.md +132 -0
  119. package/skills/massa-ai/references/synapse-policy.md +160 -0
  120. package/skills/massa-ai/references/tdd/calibrated-examples.md +54 -0
  121. package/skills/massa-ai/references/tdd/discovery-and-sizing.md +83 -0
  122. package/skills/massa-ai/references/tdd/document-contract.md +136 -0
  123. package/skills/massa-ai/references/tdd/quality-and-lifecycle.md +83 -0
  124. package/skills/massa-ai/references/the-fool/cognitive-bias-inventory.md +103 -0
  125. package/skills/massa-ai/references/the-fool/dialectic-synthesis.md +170 -0
  126. package/skills/massa-ai/references/the-fool/evidence-audit.md +202 -0
  127. package/skills/massa-ai/references/the-fool/mode-selection-guide.md +113 -0
  128. package/skills/massa-ai/references/the-fool/pre-mortem-analysis.md +200 -0
  129. package/skills/massa-ai/references/the-fool/red-team-adversarial.md +206 -0
  130. package/skills/massa-ai/references/the-fool/socratic-questioning.md +153 -0
  131. package/skills/massa-ai/references/ticket/atlassian-fix.md +130 -0
  132. package/skills/massa-ai/references/ticket/intake-and-sources.md +65 -0
  133. package/skills/massa-ai/references/ticket/templates-and-quality.md +129 -0
  134. package/skills/massa-ai/references/verification-ladder.md +62 -0
  135. package/skills/massa-ai/scripts/lessons.py +590 -0
  136. package/skills/massa-ai/workflows/adr.md +33 -0
  137. package/skills/massa-ai/workflows/architecture/architecture-audit.md +125 -0
  138. package/skills/massa-ai/workflows/architecture/architecture-fix.md +110 -0
  139. package/skills/massa-ai/workflows/bugs/bugs-audit.md +113 -0
  140. package/skills/massa-ai/workflows/bugs/bugs-fix.md +97 -0
  141. package/skills/massa-ai/workflows/code-quality/code-quality-audit.md +154 -0
  142. package/skills/massa-ai/workflows/code-quality/code-quality-fix.md +99 -0
  143. package/skills/massa-ai/workflows/commit.md +61 -0
  144. package/skills/massa-ai/workflows/debug.md +86 -0
  145. package/skills/massa-ai/workflows/design.md +54 -0
  146. package/skills/massa-ai/workflows/exploration.md +119 -0
  147. package/skills/massa-ai/workflows/feature.md +52 -0
  148. package/skills/massa-ai/workflows/general.md +46 -0
  149. package/skills/massa-ai/workflows/implementation/implementation-audit.md +87 -0
  150. package/skills/massa-ai/workflows/implementation/implementation-fix.md +90 -0
  151. package/skills/massa-ai/workflows/long-session.md +44 -0
  152. package/skills/massa-ai/workflows/maestro/maestro-audit.md +56 -0
  153. package/skills/massa-ai/workflows/maestro/maestro-fix.md +74 -0
  154. package/skills/massa-ai/workflows/maestro/maestro.md +68 -0
  155. package/skills/massa-ai/workflows/mobile-figma/mobile-figma-audit.md +68 -0
  156. package/skills/massa-ai/workflows/mobile-figma/mobile-figma-fix.md +74 -0
  157. package/skills/massa-ai/workflows/onboarding.md +23 -0
  158. package/skills/massa-ai/workflows/refactor.md +47 -0
  159. package/skills/massa-ai/workflows/refinement/furps-refinement.md +81 -0
  160. package/skills/massa-ai/workflows/requirements/requirements-audit.md +114 -0
  161. package/skills/massa-ai/workflows/requirements/requirements-fix.md +93 -0
  162. package/skills/massa-ai/workflows/rfc.md +55 -0
  163. package/skills/massa-ai/workflows/security/security-audit.md +113 -0
  164. package/skills/massa-ai/workflows/security/security-fix.md +97 -0
  165. package/skills/massa-ai/workflows/spec-driven.md +217 -0
  166. package/skills/massa-ai/workflows/tdd.md +71 -0
  167. package/skills/massa-ai/workflows/tests/tests-audit.md +114 -0
  168. package/skills/massa-ai/workflows/tests/tests-fix.md +96 -0
  169. package/skills/massa-ai/workflows/the-fool.md +82 -0
  170. package/skills/massa-ai/workflows/ticket.md +42 -0
  171. package/skills/persona-router/SKILL.md +158 -0
  172. package/skills/status/SKILL.md +15 -0
@@ -0,0 +1,68 @@
1
+ ### Mobile Figma Audit
2
+
3
+ Use this workflow for a findings-only audit of whether an existing Android Views XML, Android Jetpack Compose, iOS UIKit, iOS SwiftUI, KMP Compose Multiplatform, or mixed KMP/native implementation matches a specific Figma design. It compares Figma MCP evidence with a concrete feature, file set, screen, class/composable/view, commit range, branch comparison, or modified-file target.
4
+
5
+ Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
6
+
7
+ Do not edit code. Route direct design implementation to `design`. Do not use this workflow for Flutter, React Native, web styling, generic Figma exploration, or MCP troubleshooting.
8
+
9
+ 1. Resolve/reuse `workflowSessionId`: `mobile-figma-audit-[entity]`.
10
+ 2. Load shared references:
11
+ - `references/mobile-figma-matcher/repository-detection.md` before platform guidance.
12
+ - `references/mobile-figma-matcher/core.md` for Figma, assets, mapping, comparison, Maestro, and claim contracts.
13
+ - `references/mobile-context.md` for mobile boundaries, parity, and verification context.
14
+ - `references/audit-scope.md` for target resolution and freshness.
15
+ - `references/audit-report-io.md` before producing the report.
16
+ - `references/codebase-investigation.md` for unfamiliar source.
17
+ - `references/context-firewall.md` before large Figma payloads, screenshots, hierarchy dumps, logs, or reports.
18
+ - `references/synapse-policy.md` when repeated massa-ai searches are expected.
19
+ 3. `recall` -> load current component/design-system conventions, accepted Figma deviations, prior mappings, source-set boundaries, accessibility constraints, asset pipelines, and project render recipes. Apply the audit Memory Freshness Gate; memory is not proof.
20
+ 4. Require both inputs before analysis:
21
+ - Figma source: URL/node ID or an explicit desktop selection accessible through Figma MCP.
22
+ - Concrete implementation target: feature/flow, files/globs, screen name, classes/composables, commits/range, branch comparison, or modified files.
23
+ - Ask for the missing input rather than guessing or defaulting to the whole app.
24
+ 5. Resolve one immutable audit scope packet and Target Surface Packet before Figma extraction or detailed source analysis. Classify every selected target module/source set and load only applicable contracts: Android Views, Android Compose, UIKit, SwiftUI, and/or KMP Compose Multiplatform. Mixed KMP targets load native contracts only for actual native hosts, wrappers, source sets, or requested runtime targets.
25
+ 6. Verify Figma MCP and build the Figma Evidence Packet from `references/mobile-figma-matcher/core.md` using `get_metadata` when needed, `get_design_context`, `get_screenshot`, `get_variable_defs`, and current Code Connect mappings when available. Stop if the node cannot be read; do not substitute a screenshot-only design contract.
26
+ 7. Establish one Platform Comparison Configuration per selected runtime surface. Record the fields required by that stack contract. Never compare Figma pixels directly with Android `dp`/`sp`, UIKit/SwiftUI points, or rendered pixels without the recorded density/display scale and text scaling.
27
+ 8. Extract a numbered design checklist covering only visible/in-scope elements and required states:
28
+ - Structure and ordering.
29
+ - Geometry, constraints, alignment, spacing, sizing, and insets.
30
+ - Typography, text content/wrapping, colors, opacity, shapes, borders, elevation/shadows, assets, and clipping.
31
+ - Interactive/semantic states represented by the design or target implementation.
32
+ - Adaptive, locale, font-scale, dark-mode, and accessibility constraints when relevant.
33
+ 9. Resolve implementation values to final values and record resource/token/asset chains. Verify existing components by source, semantics, states, and usage; never select a resource or variant because its name resembles a Figma token.
34
+ 10. For KMP, audit common composables/resources once, classify Android-only and iOS-native boundaries separately, and create distinct runtime rows for every requested platform target. Verify `expect`/`actual`, platform adapters, safe areas/insets, resource loading, and host integration when they affect the surface.
35
+ 11. Detect and run the strongest safe existing runtime sensors using the order in `references/mobile-figma-matcher/core.md`. Do not install screenshot tooling or rewrite baselines during audit.
36
+ 12. Detect Maestro MCP, Maestro CLI, device availability, and applicable existing flows independently:
37
+ - If MCP and a safe device are available, use non-destructive launch/navigation, hierarchy inspection, and screenshots for the target state.
38
+ - If CLI and an existing applicable flow are available, run it with an explicit artifact directory and compact report output.
39
+ - Prefer existing flows; do not create tracked Maestro flows during audit.
40
+ - If Maestro, device, or flows are unavailable, mark only those checks `NOT EVALUATED` and continue.
41
+ 13. Build the complete comparison matrix using required evidence classes and statuses. Every row carries a `Surface ID`. Try to disprove each mismatch through current source, resolved aliases, runtime configuration, platform constraints, source-set ownership, and design variants before reporting it.
42
+ 14. Create actionable findings only for confirmed `MISMATCH` rows:
43
+ - IDs: `MFM-<N>`.
44
+ - Severity: `critical` only for unusable/release-blocking target states; `high` for major structural or interaction mismatch; `medium` for clear visible component/layout mismatch; `low` for localized visual drift.
45
+ - Required fields: surface ID, UI stack, source set/module, element/state, property/constraint, Figma value, resolved implementation value, runtime evidence, evidence class, platform configuration, file/line, impact, smallest fix direction, and verification suggestion.
46
+ - Preserve justified deviations and unmeasured rows separately; do not convert them into false findings.
47
+ 15. Save or propose `audits/mobile-figma/<YYYY-MM-DD mobile-figma-audit>.md` using the report contract in `references/audit-report-io.md`. Include repository classification, Target Surface Matrix, Figma packet/mappings, per-surface configurations, capability matrix, comparison matrix, findings, justified deviations, not-evaluated rows, scope/evidence, and execution handoff.
48
+ - Include the Verification/Test Fidelity Checklist from `references/audit-report-io.md` as the proof layer over the comparison/capability matrices. Tie every `MFM-*` finding or no-finding claim to deterministic sensors, commands/artifacts, results, validation assets, or skipped-check reasons. Model judgment alone cannot satisfy verification/testing all-clear.
49
+ 16. Persist only durable token/component mappings, source-set ownership rules, approved accessibility/platform deviations, asset-pipeline rules, or reusable render recipes after Importance Calibration. Use `workflow:mobile-figma-audit` and required tags. Never persist screenshots, hierarchy dumps, raw logs, device IDs, or user data.
50
+ 17. Complete `references/evidence-gate.md`. A model visual impression cannot satisfy the gate.
51
+
52
+ ## Examples
53
+
54
+ User asks: "Compare the LoginScreen Compose preview and modified files against this Figma node."
55
+
56
+ 1. Resolve the node, modified files, `LoginScreen`, theme/tokens, previews, and screenshot-test capability.
57
+ 2. Run existing preview/runtime sensors and optional Maestro evidence when available.
58
+ 3. Save a matrix-backed audit report with only confirmed mismatches as `MFM-*` findings.
59
+
60
+ User asks: "Audit `res/layout/checkout.xml` against my current Figma selection."
61
+
62
+ 1. Resolve the desktop selection, XML layout, included resources, styles, drawables, and target device configuration.
63
+ 2. Use an existing XML/runtime render sensor if available; otherwise limit the claim to static values and mark visual runtime rows `NOT EVALUATED`.
64
+
65
+ User asks: "Audit the shared checkout screen in our KMP app on Android and iOS."
66
+
67
+ 1. Detect shared Compose Multiplatform UI plus any Android/iOS hosts and map each surface to the Figma frame.
68
+ 2. Audit common composables once, then capture separate Android and iOS runtime/configuration evidence. Load native contracts only where native code participates.
@@ -0,0 +1,74 @@
1
+ ### Mobile Figma Fix
2
+
3
+ Use this workflow only to fix confirmed `MFM-*` findings from a saved mobile Figma audit report.
4
+
5
+ Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
6
+
7
+ Before the first repository mutation, load `references/implementation-delivery.md` for worktree isolation, atomic commits, PR creation, CI watch, and the merge gate, and `references/code-annotation.md` for doc blocks, rationale comments, and test coverage on every created or updated unit. If two consecutive fix attempts fail on the same symptom, stop editing and load `references/root-cause-scripts.md`.
8
+
9
+ Do not execute from chat summaries, screenshots alone, remembered findings, or an unsaved comparison table. The saved `audits/mobile-figma/<YYYY-MM-DD mobile-figma-audit>.md` report is the source of truth. Route fresh comparison work to `mobile-figma-audit`.
10
+
11
+ 1. Resolve/reuse `workflowSessionId`: `mobile-figma-fix-[entity]`.
12
+ 2. Load shared references:
13
+ - `references/mobile-figma-matcher/repository-detection.md` before platform guidance.
14
+ - `references/mobile-figma-matcher/core.md` for Figma, assets, mapping, Maestro, matrix, and claim contracts.
15
+ - `references/lessons.md` to load confirmed project lessons
16
+ - `references/mobile-context.md` for mobile boundary and verification guidance.
17
+ - `references/audit-report-io.md` before any source or validation-asset edit.
18
+ - `references/audit-scope.md` and `references/codebase-investigation.md` for freshness and current source.
19
+ - `references/verification-ladder.md` before edits.
20
+ - `references/context-firewall.md` before large design/runtime artifacts.
21
+ 3. `recall` -> load current design-system rules, accepted deviations, prior component mappings, source-set boundaries, accessibility constraints, asset-pipeline rules, and render recipes for the target.
22
+ 4. Select a report and target focus:
23
+ - Prefer an exact report path plus optional `MFM-*` IDs.
24
+ - For `latest` or omitted path, require a concrete target focus, then select only from `audits/mobile-figma/`.
25
+ - Stop if no report exists or metadata does not identify `Workflow: mobile-figma-audit`, project/session, target/focus/scope, source timestamp, repository classification, Target Surface Matrix, Figma source/node mappings/timestamp, per-surface platform configurations, capability matrix, and comparison matrix.
26
+ - Reject legacy Android-only reports without the Target Surface Matrix and `Surface ID` fields. Require a fresh audit; do not infer or migrate the missing schema.
27
+ 5. Validate report freshness before editing:
28
+ - Re-resolve the target files, rebuild the Target Surface Packet, and verify git scope/base/head when relevant.
29
+ - Stop and re-audit when current module/source-set classification no longer matches the report.
30
+ - Re-read the same Figma node/selection and verify its current identity, variants, values, and screenshot. Stop and re-audit if material design drift invalidates findings.
31
+ - Verify every platform configuration is reproducible or explicitly accept a documented substitute.
32
+ - Recheck every selected finding's surface ID, UI stack, source-set/module, source location, resolved token/resource/asset chain, evidence, and constraint rationale.
33
+ - Reject `NOT EVALUATED`, `CONSTRAINT DEVIATION`, unknown, stale, or low-confidence rows as executable findings unless the user explicitly changes scope after re-audit.
34
+ 6. Load only platform contracts named by the selected findings and current Target Surface Packet. Build a remediation matrix: finding -> surface -> element/state/property -> Figma value -> current implementation value -> shared/platform root change -> affected files -> validation assets -> runtime sensor -> optional Maestro packet -> order -> status.
35
+ 7. Size work with the Verification Ladder. Route broad design-system migrations, unclear accessibility/product conflicts, or cross-feature component redesign to `spec-driven` before editing.
36
+ 8. Apply the smallest root fix:
37
+ - Prefer existing shared components, theme tokens, resources, dimensions, typography, shapes, and state definitions before local overrides.
38
+ - Preserve stack-specific accessibility, minimum touch targets, localization, safe areas/insets, adaptive behavior, and native platform conventions.
39
+ - For KMP, apply shared root fixes before platform-local overrides when the cause is shared, then verify every affected platform target.
40
+ - 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.
41
+ - Do not weaken screenshot tests, previews, fixtures, assertions, test tags, resource IDs, content descriptions, or Maestro selectors to hide a mismatch.
42
+ - 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.
43
+ 9. Verify after each coherent finding group:
44
+ - If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
45
+ `python3 skills/massa-ai/scripts/lessons.py --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
46
+ - 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 `MFM-*` finding or coherent group.
47
+ - A finding cannot be marked `fixed` when a target-relevant command, render sensor, comparison artifact, or Maestro reproduction exists but was not attempted; if verification cannot run, mark it `blocked`, `deferred`, or `skipped` with an allowed skipped-check reason.
48
+ - Re-resolve every affected comparison row, not only the previous mismatch.
49
+ - Run focused static checks and existing preview/screenshot/instrumentation sensors.
50
+ - Re-evaluate every affected surface, including surfaces changed indirectly by a shared KMP fix.
51
+ - 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.
52
+ - If Maestro becomes unavailable, record the regression gap instead of claiming equivalent runtime verification.
53
+ 10. 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`.
54
+ 11. 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.
55
+ 12. Persist only durable token mappings, source-set ownership rules, approved constraint deviations, component reuse rules, asset-pipeline rules, or reusable verification recipes after Importance Calibration. Use `workflow:mobile-figma-fix` and required tags.
56
+ 13. Complete `references/evidence-gate.md` and report the highest Verification Ladder level reached.
57
+
58
+ ## Examples
59
+
60
+ User asks: "Fix MFM-1 and MFM-3 from the latest LoginScreen mobile Figma audit."
61
+
62
+ 1. Select the latest report matching LoginScreen and validate the Figma node, reported target surfaces, and both findings.
63
+ 2. Fix shared theme/component causes before screen-local overrides.
64
+ 3. Rebuild every affected matrix row and rerun the strongest existing runtime sensors.
65
+
66
+ User asks: "Apply the checkout mobile Figma report and verify with Maestro."
67
+
68
+ 1. Verify the report used Maestro and that the same safe device/flow remains available.
69
+ 2. Apply confirmed fixes, rerun the recorded flow, capture equivalent hierarchy/screenshots, and keep visual parity conclusions separate from flow success.
70
+
71
+ User asks: "Fix the shared KMP spacing finding and its iOS host mismatch."
72
+
73
+ 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.
74
+ 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.
@@ -0,0 +1,23 @@
1
+ ### 🟢 Onboarding (New Project / First Session)
2
+
3
+ Use this workflow for a first session, missing project context, or repo setup where the agent must resolve the project identity, establish usable memory/index state, and capture a high-level architecture overview before deeper work.
4
+
5
+ Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
6
+
7
+ 1. Resolve `projectId` and `workflowSessionId` (`onboarding-[entity]`).
8
+ 2. `recall` -> check for existing project identity and knowledge.
9
+ 3. `list_projects` -> resolve the exact registered project ID and index
10
+ status before indexing.
11
+ 4. If indexed, call `project_map` for the first architecture overview. A usable index means status is `indexed`, `project_map` succeeds, file count is >0, and symbol/chunk coverage is nonzero for code-bearing repositories.
12
+ 5. If no usable index exists, call `index` with `projectPath` and
13
+ `projectId`, then poll with the discipline in `references/mcp-tools.md`.
14
+ 6. Full reindex is allowed only when index status is `error`, `project_map` is missing/empty after indexing, or a large tracked-file change touched >50 files or >10% of tracked files since the last index timestamp. Treat `reindex` as compatibility-sensitive; fall back to `index(forceReindex=true)` with the known project path when its adapter contract is unverified.
15
+ 7. Honor root `AGENTS.md` ignored paths during context loading; if a tool cannot
16
+ accept excludes, discard ignored-path results instead of loading them.
17
+ 8. Load `references/synapse-policy.md` when architecture mapping will require
18
+ repeated searches, then follow the shared retrieval order from
19
+ `references/codebase-investigation.md`.
20
+ 9. Call `bootstrap` with `projectId` and `projectPath` to generate seed memories automatically from git log, README, docs, manifests, and centrality. `bootstrap` is idempotent (re-run is a no-op unless `force: true`); with LLM off it degrades to rule-based minimal seeds. Treat bootstrap seed memories as leads to confirm against current source, not as authoritative. If `bootstrap` is unavailable, proceed with manual `remember` calls.
21
+ 10. Persist the architectural overview via `remember` as a scored
22
+ `decision` memory with `memory:semantic`.
23
+ 11. Complete the Evidence Gate from `references/evidence-gate.md`.
@@ -0,0 +1,47 @@
1
+ ### 🔨 Refactor
2
+
3
+ Use this workflow for behavior-preserving structural cleanup, simplification, decoupling, testability improvements, and code organization changes where the intended external behavior stays the same. Do not use it for broken behavior; route that to `workflows/debug.md`. Do not use it for broad boundary redesign, migration, or unclear architecture direction; route that to `workflows/architecture/architecture-audit.md` or `workflows/spec-driven.md`.
4
+
5
+ Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
6
+
7
+ Before the first repository mutation, load `references/implementation-delivery.md` for worktree isolation, atomic commits, PR creation, CI watch, and the merge gate, and `references/code-annotation.md` for doc blocks, rationale comments, and test coverage on every created or updated unit. If two consecutive fix attempts fail on the same symptom, stop editing and load `references/root-cause-scripts.md`.
8
+
9
+ 1. Resolve/reuse `workflowSessionId`: `refactor-[entity]`
10
+ 2. `recall` → load architectural decisions and coupling patterns for the area
11
+ 3. Load shared references as needed:
12
+ - `references/codebase-investigation.md` before changing unfamiliar code
13
+ - `references/architecture-lenses.md` when the refactor is driven by coupling, seams, adapters, depth, leverage, or locality
14
+ - `references/architecture-deepening-lens.md` and its Interface Design Method when a refactor candidate has two or more viable interface shapes (Design It Twice before choosing)
15
+ - `references/mobile-context.md` when the refactor touches KMP, iOS, Android, native bridges, mobile lifecycle, offline sync, permissions, local persistence, or backend-mobile contracts
16
+ - `references/verification-ladder.md` before Quick/Standard/Spec-driven sizing or edits
17
+ - `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)
18
+ - `references/pr-task-fix.md` when the verification ladder trigger table applies
19
+ - `references/lessons.md` when `.specs/lessons.json` exists, to load confirmed project lessons before refactoring
20
+ 4. Size the refactor before editing:
21
+ - Use the exact Quick, Standard, and Spec-driven thresholds in `references/verification-ladder.md`.
22
+ - Route boundary redesign to `workflows/architecture/architecture-audit.md`; route Spec-driven threshold work to `workflows/spec-driven.md` or split into atomic tasks.
23
+ - For Standard refactors or Quick refactors over 3 files/200 LOC, load `references/pr-task-fix.md`, run its ADR/TDD input gate, decompose work into Small-first independently buildable PR groups, and keep Medium groups only when splitting would break build, tests, UI, or review coherence.
24
+ 5. Follow the shared retrieval order from `references/codebase-investigation.md`
25
+ to find related code and usages. Call `impact_analysis` with `project`, `projectPath`, and `scope` to assess the centrality-ranked blast radius of the structural change before editing. `impact_analysis` only counts as evidence when the index is fresh for the current repository path and commit/worktree state; fall back to `search`/`get_references` and record reduced retrieval confidence when the index is stale or unavailable. An empty diff returns an empty impact set (not an error).
26
+ 6. Establish current behavior before moving code: tests, exact manual command transcripts, static checks, or artifact inspection
27
+ 7. For mobile refactors, characterize current bridge/API/platform behavior before moving code:
28
+ - shared vs platform-specific boundary
29
+ - native bridge payload and compatibility expectations
30
+ - impacted and comparison platforms
31
+ - deterministic mobile sensors or skipped platform checks from `references/mobile-context.md`
32
+ 8. Focus on pragmatic refactoring:
33
+ - Identify over-abstracted code and propose Modular Monoliths
34
+ - Reduce "abstraction cost" to make code more AI-navigable
35
+ - Verify changes do not break existing behavior using the verification recipe
36
+ 9. Execute by PR group when `references/pr-task-fix.md` applies:
37
+ - Order non-breaking groups by Data, Domain, then Presentation/Navigation, mapping those labels to repository boundaries when needed.
38
+ - Validate each group with the characterization and verification recipe before committing.
39
+ - Invoke `workflows/commit.md` for each verified group; do not duplicate commit staging, message, audit-exclusion, or Jira-prefix rules in this workflow.
40
+ - When every group has a confirmed Jira key, follow the reference's optional stacked branch flow: ask whether to create stacked task branches, ask for the base branch and a branch pattern containing `<jira-task-key>` if accepted, create each next branch from the previous task branch, never push, and report branches and commits in push order.
41
+ 10. Include file-integrity checks when tests, specs, benchmarks, fixtures, or snapshots are validation assets. If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
42
+ `python3 skills/massa-ai/scripts/lessons.py --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
43
+ 11. Use `references/agent-orchestration.md` only for isolated implementation slices or independent verification
44
+ 12. At completion, persist (run the scoring rubric from `references/decision-engine.md`):
45
+ - Refactored architectural decisions via `remember` as scored `decision` memories
46
+ - Identified and decoupled anti-patterns via `remember` as scored `pattern` memories
47
+ 13. Complete the Evidence Gate from `references/evidence-gate.md`
@@ -0,0 +1,81 @@
1
+ ### FURPS+ Refinement
2
+
3
+ Use this workflow for findings-only refinement of a Product Requirements Document (PRD) and/or Architecture Decision Record (ADR) against the FURPS+ quality model, before implementation. It runs The Fool as an input-validation pre-pass, then fans out one sub-agent per FURPS+ dimension, and emits a structured refinement report with open questions, suggestions, insights, risks, and Definition-of-Ready coverage gaps.
4
+
5
+ Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
6
+
7
+ Do not use this workflow to author a new PRD (use `to-prd` or `spec-driven` Specify), author an ADR (use `adr`), propose change (use `rfc`), audit implementation against requirements (use `requirements-audit`), or audit code/security/architecture. It refines the document itself; it does not edit code.
8
+
9
+ This workflow is findings-only. Do not edit the PRD/ADR unless the user separately asks.
10
+
11
+ 1. Resolve/reuse `workflowSessionId`: `furps-refinement-[entity]`. Resolve `projectId` per the router. Budget `recall` (`limit <= 3`, `minImportance >= 0.7`, `types=["critical","decision","pattern"]`) for prior ADRs, accepted decisions, DoR, and refinement patterns.
12
+ 2. Load shared references:
13
+ - `references/furps/intake.md` before intake and sub-agent dispatch
14
+ - `references/furps/checklist.md` for the per-dimension check items
15
+ - `references/furps/report-contract.md` before writing the report
16
+ - `references/furps/analyst-role.md` and `skills/agents/furps-analyst/SKILL.md` before dispatching `massa-ai-furps-analyst`
17
+ - `references/agent-orchestration.md` and `references/context-firewall.md` before dispatch
18
+ - `references/audit-report-io.md` before writing the final report
19
+ - `references/synapse-policy.md` when repeated massa-ai searches are expected
20
+ - `references/evidence-gate.md` at completion
21
+ 3. Intake and packet build (main), per `references/furps/intake.md`:
22
+ - Detect source (file / text / Jira / Confluence). Ingest via Atlassian MCP capability discovery (read-only) or file/text fallback.
23
+ - Resolve DoR (explicit / Jira/Confluence / built-in fallback). If none, use the fallback and mark DoR-gaps accordingly.
24
+ - Apply the context-firewall; build the bounded document packet (sections/summaries, DoR, recalled facts).
25
+ - If the source is missing or ambiguous, ask once before proceeding.
26
+ 4. The Fool pre-validation (sub-agents, one per mode):
27
+ - Load `workflows/the-fool.md`. Treat the PRD/ADR as the challenged thesis (direct challenge; inherit `projectId`/`workflowSessionId`).
28
+ - Dispatch a read-only `massa-ai-plan-critic` sub-agent in `evidence_audit` mode with the document packet, DoR, and recalled facts.
29
+ - Then dispatch a `massa-ai-plan-critic` sub-agent in `pre_mortem` mode, passing the `evidence_audit` summary as input.
30
+ - Collect the compact validation: source-confidence gaps, unsourceable claims, and execution-phase failure assumptions.
31
+ - Gate: if `evidence_audit` surfaces critical gaps that block meaningful FURPS analysis, ask the user whether to proceed-with-caveats or pause for document completion. Otherwise attach the Fool summary to the FURPS packets.
32
+ 5. FURPS+ dimension analysis (sub-agents, one per dimension, parallel):
33
+ - Dispatch six `massa-ai-furps-analyst` sub-agents: F, U, R, P, S, X (X = FURPS+ Extensions).
34
+ - Each receives its `checklist.md` section, the bounded document packet, the DoR, and the Fool summary.
35
+ - Each returns per check-item status (`covered|partial|missing|unclear`), `FR-<letter>-<N>` findings, and contributions to Open Questions / Suggestions / Insights / Risks / DoR-gaps.
36
+ - Run in parallel; batch if a concurrency cap applies. Each gets its own ephemeral Synapse session only if it performs >=2 searches.
37
+ 6. Synthesis (main):
38
+ - Collect the six dimension analyses and the Fool summary.
39
+ - Deduplicate, cross-check, and reconcile cross-dimension concerns (e.g., error flows span F3+R2+U1; components span F2+S2).
40
+ - Build the DoR coverage gap list (criteria not satisfied by the document).
41
+ - Assemble the report per `references/furps/report-contract.md`; assign `FR-<letter>-<N>` IDs.
42
+ - Plan Mode save rule: in Plan Mode return the canonical path and full content; in Default mode write `audits/refinement/<YYYY-MM-DD furps-refinement>.md`.
43
+ 7. Persist only durable knowledge:
44
+ - Do not persist one-off findings.
45
+ - Persist reusable refinement patterns and durable decisions after scoring.
46
+ - Required tags: `project:<projectId>`, `session:<workflowSessionId>`, `workflow:furps-refinement`, `entity:<entity>`, and one `memory:<tier>` tag.
47
+ 8. Complete the Evidence Gate from `references/evidence-gate.md`. Report deterministic evidence, changed artifacts, memory outcome, and residual risk.
48
+
49
+ ## Graceful Degradation
50
+
51
+ | Failure | Behavior |
52
+ |---|---|
53
+ | Atlassian MCP unavailable / no matching capability | Ask for file/text; continue |
54
+ | massa-ai unavailable | Skip recall; use file reads; skip memory write and log it |
55
+ | Sub-agent spawning unavailable | Run dimensions sequentially in the main agent; record the skipped-delegation reason |
56
+ | DoR not supplied | Use the built-in fallback; mark DoR-gaps explicitly |
57
+ | Document too large | context-firewall: section summaries plus pointers to sub-agents |
58
+ | Concurrency cap on six FURPS agents | Batch dispatch; preserve order-independence |
59
+
60
+ ## Examples
61
+
62
+ User asks: "Refine this PRD against FURPS before we start building."
63
+
64
+ 1. `workflowSessionId=furps-refinement-<entity>`.
65
+ 2. Ingest the PRD file; resolve DoR from a linked Confluence page via Atlassian MCP.
66
+ 3. Run The Fool (`evidence_audit` then `pre_mortem`); proceed (no critical blocker).
67
+ 4. Fan out six `massa-ai-furps-analyst` sub-agents (F, U, R, P, S, X) in parallel.
68
+ 5. Synthesize; write `audits/refinement/<date> furps-refinement.md`; summarize in chat.
69
+
70
+ User asks: "Run a FURPS+ analysis on ADR-007."
71
+
72
+ 1. `workflowSessionId=furps-refinement-adr-007`.
73
+ 2. Ingest the ADR from `docs/adr/007-*.md`; no DoR supplied, so use the built-in fallback.
74
+ 3. Run The Fool; `evidence_audit` flags two unresolved claims, so ask the user whether to proceed with caveats.
75
+ 4. On proceed, fan out the six dimension sub-agents; synthesize and save the report.
76
+
77
+ User asks: "Check DoR coverage for this Jira epic and its Confluence ADR."
78
+
79
+ 1. `workflowSessionId=furps-refinement-<epic>`.
80
+ 2. Ingest the Jira epic plus Confluence ADR via Atlassian MCP; resolve DoR from the project DoR Confluence page.
81
+ 3. Run The Fool; fan out FURPS dimensions; emphasize the Definition of Ready — Coverage Gaps section.
@@ -0,0 +1,114 @@
1
+ ### Requirements Audit
2
+
3
+ Use this workflow for findings-only review of whether a concrete target matches stated requirements without out-of-scope drift. Accepted targets include modified files, explicit files/globs, commit ranges, branch comparisons, modules/packages, symbols/classes/functions, feature/runtime flows, explicitly requested whole-repo scope, or an implementation scope packet supplied by `workflows/implementation/implementation-audit.md`.
4
+
5
+ Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
6
+
7
+ Do not use this workflow for generic correctness bugs, security findings, architecture findings, code quality findings, or test coverage findings. Route correctness bugs to `workflows/bugs/bugs-audit.md` and route the other categories to their dedicated workflows.
8
+
9
+ This workflow is findings-only. Do not edit code unless the user separately asks for fixes.
10
+
11
+ 1. Resolve/reuse `workflowSessionId`: `requirements-[entity]`
12
+ 2. Load shared references:
13
+ - `references/codebase-investigation.md`
14
+ - `references/audit-scope.md`
15
+ - `references/audit-report-io.md` before writing the final direct audit report
16
+ - `references/context-firewall.md` before inspecting large diffs, specs, issue text, generated reports, or broad search output
17
+ - `references/synapse-policy.md` when repeated massa-ai searches are expected
18
+ - `references/agent-orchestration.md` only for large scopes, explicit parallel/subagent requests, PR subagent invocation, or independent verification of high-impact findings
19
+ 3. `recall` -> load prior product decisions, accepted requirements, ADRs, scope constraints, known regressions, project patterns, and accepted exceptions for the target area.
20
+ - Apply the Memory Freshness Gate from `references/audit-scope.md`; recalled exceptions are leads, not proof.
21
+ 4. Establish the investigation scope before proceeding:
22
+ - Modified files scope: use when the user says modified files, changed files, current changes, uncommitted changes, staged changes, or unstaged changes.
23
+ - Explicit files/globs scope: use when the user names files, directories, or globs.
24
+ - 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.
25
+ - Branch comparison scope: use when the user names base/head branches, refs, or a branch diff.
26
+ - Codebase area scope: use when the user names a path, module, package, feature area, user journey, or glob.
27
+ - Symbol/class/function scope: use when the user names public classes, functions, APIs, handlers, or exported surfaces.
28
+ - Feature/flow scope: use when the user names a runtime flow, user journey, or feature area.
29
+ - Whole-repo scope: use only when the user explicitly asks for a whole-repo requirements audit.
30
+ - Implementation parent scope: use only when `workflows/implementation/implementation-audit.md` invokes this workflow with a concrete implementation scope packet.
31
+ - 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.
32
+ - 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`.
33
+ - 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.
34
+ - Build the shared scope packet from `references/audit-scope.md` and carry it into the report.
35
+ 5. For modified files scope:
36
+ - Include staged and unstaged tracked files from the working tree.
37
+ - Include untracked non-generated source, test, fixture, schema, config, and docs files only when they can affect required behavior.
38
+ - Exclude deleted files unless their deletion can break required behavior, imports, exports, routing, migrations, config, tests, packaging, or documentation contracts.
39
+ - Exclude generated, dependency, build, log, cache, temporary, and secret paths per repo rules.
40
+ - Inspect diffs first, then only the surrounding code needed to compare implementation against requirements.
41
+ 6. For commit range scope:
42
+ - If the user supplied explicit commits or a revision range, use that exact range.
43
+ - If the user asked for commits made by me, resolve author identity from `git config user.email`; if empty, use `git config user.name`.
44
+ - For branch-relative commit scopes, resolve the branch base from the upstream merge-base first, then fall back in order to `origin/main`, `origin/master`, `main`, and `master`.
45
+ - If the user asked for commits made by me, review branch-unique commits authored by the resolved identity.
46
+ - If no explicit range, required author identity, or branch base can be resolved, ask the user for the missing value before proceeding.
47
+ - Inspect changed files and diffs from those commits, then requirements sources, callers, tests, config, schemas, and docs only as needed.
48
+ 7. For codebase area scope:
49
+ - Require a concrete path, module, package, feature area, or glob.
50
+ - If the target area is missing, ask for it before proceeding.
51
+ - Follow the shared retrieval order from `references/codebase-investigation.md` to find entry points, public API, tests, config, docs, and acceptance criteria.
52
+ 8. For explicit files/globs, branch comparison, symbol/class/function, feature/flow, or explicitly requested whole-repo scope:
53
+ - Resolve the target with `references/audit-scope.md` and record the resolution method, base/head when relevant, resolved files, exclusions, requirements source, and freshness timestamp.
54
+ - For symbol/class/function targets, inspect definitions, call paths, public contracts, tests, config, docs, and requirement links only as needed.
55
+ - For feature/flow targets, map expected behavior from the requirements source to implementation, tests, docs, and public contracts.
56
+ - If whole-repo scope is requested, map top-level requirement areas first and report skipped depth checks rather than implying exhaustive coverage.
57
+ 9. For implementation parent scope:
58
+ - Accept the exact scope packet and requirement source from `implementation-audit`.
59
+ - Do not broaden beyond resolved files, surrounding code, public contracts, tests, config, docs, and requirements needed to verify a claim.
60
+ - Return compact findings to the parent implementation audit; do not write broad project memories unless explicitly assigned.
61
+ 10. Investigation pass. Dispatch `audit-specialist` per `references/agent-orchestration.md` when the scope justifies an isolated read-only subagent:
62
+
63
+ > **Dispatch: `massa-ai-audit-specialist`** (role: `audit-specialist`) — charter `skills/agents/audit-specialist/SKILL.md`
64
+ > - trigger: large scope, explicit parallel/subagent request, PR subagent invocation, or independent verification of high-impact finding
65
+ > - scope: the requirements audit target — files, contracts, specs, acceptance criteria
66
+ > - permissions: read-only
67
+ > - inputs: shared scope packet; `lens: requirements`; requirement source, recalled requirements decisions, accepted exceptions
68
+ > - sensors: build requirement checklist from source; trace implementation vs spec; coverage gap, ambiguity, contradiction, implicit-need detection
69
+ > - output: findings with requirement gap, location, evidence, severity, confidence, simplest fix direction, verification suggestion
70
+ > - firewall: raw diffs/logs/search output summarized, not returned raw
71
+ > - memory: suggest-only; main agent persists reusable requirements patterns
72
+
73
+ - Build a requirement checklist from the source: must-have behavior, non-goals, acceptance criteria, compatibility constraints, inputs, outputs, and user-visible promises.
74
+ - Compare implementation and tests against each checklist item.
75
+ - Prioritize missing requirements, contradicted requirements, out-of-scope behavior, changed public contracts, compatibility breaks, incomplete edge cases, and docs or tests that misrepresent delivered behavior.
76
+ - For each candidate finding, record the concrete claim, source evidence, affected requirement, impacted flow, provisional severity, and what would disprove it.
77
+ 11. False-positive pass:
78
+ - Try to disprove every candidate before reporting it.
79
+ - Check requirement wording, accepted scope changes, ADRs, feature flags, compatibility notes, tests, docs, call paths, and user-provided constraints.
80
+ - Drop candidates disproven by evidence, downgrade candidates with partial mitigation, and mark low-confidence findings explicitly.
81
+ 12. Severity rules (apply the countable threshold first, then the qualitative clause):
82
+ - `critical`: implementation violates a mandatory requirement in a way that blocks release, causes data loss, breaks auth/privacy, OR affects >10 files; otherwise use the qualitative clause below.
83
+ - `high`: missing or contradictory core requirement, significant out-of-scope behavior, public contract break, or major compatibility regression.
84
+ - `medium`: incomplete edge-case requirement, unclear acceptance gap, recoverable behavior mismatch (<=10 affected files), missing required docs/test coverage around a requirement, or scoped regression.
85
+ - `low`: minor requirement ambiguity, wording mismatch, low-impact out-of-scope behavior, incomplete evidence, or weakly supported concern.
86
+ 13. Final report:
87
+ - Findings first, ordered by severity: `critical`, `high`, `medium`, `low`.
88
+ - Each finding must use `REQ-<N>` and include the canonical fields from `references/audit-report-io.md`: severity, confidence, requirement source, requirement ID or quote, requirement gap type, file/line, evidence, impact, simplest fix direction, and verification suggestion.
89
+ - If no requirements findings are found, say that clearly and list scope checked, requirement source used, and skipped checks.
90
+ - Include ruled-out candidates when they were plausible enough to matter.
91
+ - Include scope checked, deterministic evidence or skipped-check notes, memory outcome, and residual risk.
92
+ - Include the Verification/Test Fidelity Checklist from `references/audit-report-io.md`; tie every `REQ-*` finding or no-finding claim to deterministic sensors, commands/artifacts, results, validation assets, or skipped-check reasons. Model judgment alone cannot satisfy verification/testing all-clear.
93
+ - For direct top-level invocation, use the Plan Mode save rule and canonical report contract from `references/audit-report-io.md` for `audits/requirements/<YYYY-MM-DD requirements-audit>.md`.
94
+ - For implementation audit child invocation, return compact findings to the parent unless the parent explicitly requests saved audit artifacts.
95
+ 14. Persist only durable knowledge:
96
+ - Do not persist one-off findings.
97
+ - Persist durable requirements decisions, accepted scope constraints, repeated requirement-drift patterns, or reusable verification recipes after scoring with the Importance Calibration System.
98
+ - Use required tags: `project:<projectId>`, `session:<workflowSessionId>`, `workflow:requirements-audit`, `entity:<entity>`, and one `memory:<tier>` tag.
99
+ 15. Complete the Evidence Gate from `references/evidence-gate.md`.
100
+
101
+ ## Examples
102
+
103
+ User asks: "Check modified files against the task requirements."
104
+
105
+ 1. Use `workflowSessionId=requirements-modified-files`.
106
+ 2. Resolve requirements from the prompt, task file, issue, PR description, or provided spec.
107
+ 3. Scope to staged, unstaged, and relevant untracked files.
108
+ 4. Report missing requirements and out-of-scope drift by severity.
109
+
110
+ User asks: "Audit this PR against its description."
111
+
112
+ 1. Use `workflowSessionId=requirements-pr`.
113
+ 2. Scope to the PR diff and use the PR description as the requirements source.
114
+ 3. Return compact findings to the parent implementation audit when invoked as a subagent.
@@ -0,0 +1,93 @@
1
+ ### Requirements Fix
2
+
3
+ Use this workflow only to execute fixes from a requirements audit markdown report.
4
+
5
+ Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
6
+
7
+ Before the first repository mutation, load `references/implementation-delivery.md` for worktree isolation, atomic commits, PR creation, CI watch, and the merge gate, and `references/code-annotation.md` for doc blocks, rationale comments, and test coverage on every created or updated unit. If two consecutive fix attempts fail on the same symptom, stop editing and load `references/root-cause-scripts.md`.
8
+
9
+ Do not use this workflow for findings-only requirements review; route that to `workflows/requirements/requirements-audit.md`. Do not use it for broad feature design when acceptance criteria are missing; route that to `workflows/spec-driven.md`.
10
+
11
+ 1. Resolve/reuse `workflowSessionId`: `requirements-fix-[entity]`
12
+ 2. Load shared references:
13
+ - `references/audit-report-io.md` before any code change
14
+ - `references/lessons.md` to load confirmed project lessons
15
+ - `references/codebase-investigation.md` before changing unfamiliar requirement flows
16
+ - `references/verification-ladder.md` before non-trivial edits
17
+ - `references/context-firewall.md` before inspecting large specs, diffs, generated reports, or broad search output
18
+ - `references/agent-orchestration.md` only for large/high-risk findings, disjoint implementation slices, or independent verification
19
+ 3. `recall` -> load product decisions, accepted scope constraints, public contracts, compatibility rules, requirement interpretations, and verification recipes for the report target.
20
+ 4. Select the requirements audit report with execution focus:
21
+ - Establish the report selector, target focus, requirements source, and optional finding selector before selecting a report. Target focus can be a flow, feature, public contract, module, files/globs, branch comparison, commit range, symbol/class/function, or explicit whole-repo target.
22
+ - If the user gives a path, read that exact markdown file.
23
+ - If the user asks for "latest" or gives no path, require a concrete target focus first; do not run the latest requirements report against an unspecified target.
24
+ - Select the latest `audits/requirements/<YYYY-MM-DD requirements-audit>.md` only after target focus is known, using `references/audit-report-io.md`.
25
+ - Stop if no report exists; do not infer findings from conversation history.
26
+ - Validate the report with `references/audit-report-io.md`: workflow, `ProjectId`, `Target`, `Target Focus`, scope, git base/head, required fields, `REQ-` IDs, requirement source, resolved files or material scope evidence, and current file/line evidence. Stop on invalid, stale, target-drifted, or ambiguous reports before editing.
27
+ 5. Extract actionable findings:
28
+ - Keep findings with concrete `Requirement Source`, `Requirement ID or Quote`, `Requirement Gap Type`, `Location`, `Evidence`, `Impact`, `Simplest Fix Direction`, and `Verification Suggestion`.
29
+ - Ignore ruled-out candidates and no-finding sections.
30
+ - If the user supplied finding IDs, extract only those IDs after validating they exist and match the current target focus and requirements source.
31
+ - Rank by mandatory requirement severity, dependency order, user-visible impact, compatibility risk, and testability.
32
+ 6. Build a traceability matrix before editing:
33
+ - Requirement ID/source -> audit finding ID -> current implementation evidence -> desired behavior -> files likely affected -> tests/docs needed -> verification command.
34
+ - Mark each item as missing requirement, contradicted requirement, out-of-scope behavior, compatibility break, docs mismatch, or test/docs gap.
35
+ 7. Size each finding with `references/verification-ladder.md`:
36
+ - Quick: local behavior correction, docs wording fix, config default correction, or focused test alignment.
37
+ - Standard: multi-file behavior change, public API compatibility fix, UI/API contract update, or meaningful test impact; define verification recipe first.
38
+ - Spec-driven: ambiguous requirement, new feature beyond audited scope, contract redesign, migration, or stakeholder tradeoff; pause and route to `workflows/spec-driven.md` or ask for approval.
39
+ 8. Apply requirements fixing methods:
40
+ - Missing requirement: implement the smallest behavior that satisfies the source requirement and add direct acceptance coverage.
41
+ - Contradicted requirement: change behavior to match the source of truth, unless the report identifies a newer accepted decision.
42
+ - Out-of-scope behavior: remove or guard behavior that exceeds non-goals, while preserving existing supported contracts.
43
+ - Compatibility break: restore previous public contract or add a compatible bridge if the report requires compatibility.
44
+ - Docs/test mismatch: update docs or tests to reflect delivered behavior only when implementation already matches the requirement.
45
+ 9. Guard scope:
46
+ - Do not reinterpret requirements beyond the report and cited source.
47
+ - Preserve non-goals and explicit constraints.
48
+ - If a finding exposes a product decision gap, stop and ask rather than inventing policy.
49
+ 10. Use agent orchestration only when it improves signal. Dispatch per `references/agent-orchestration.md`:
50
+
51
+ > **Dispatch: `massa-ai-builder`** (role: `builder`) — charter `skills/agents/builder/SKILL.md`
52
+ > - trigger: large/high-risk finding, disjoint implementation slice, or explicit subagent request
53
+ > - scope: one isolated requirements finding with a disjoint write set
54
+ > - permissions: write (disjoint write set)
55
+ > - inputs: the finding ID, requirement source, gap/contradiction/ambiguity, and simplest fix direction
56
+ > - sensors: report's verification suggestion or equivalent deterministic command; requirements-trace check
57
+ > - output: implementation summary, commands run, test counts, deviations
58
+ > - firewall: raw diffs/logs summarized
59
+ > - memory: suggest-only; main agent persists reusable requirements patterns
60
+
61
+ > **Dispatch: `massa-ai-verification-agent`** (role: `verification-agent`) — charter `skills/agents/verification-agent/SKILL.md`
62
+ > - trigger: independent verification of a high-risk requirements fix
63
+ > - scope: the fixed finding's requirement alignment, test coverage, and report claim closure
64
+ > - permissions: read-only
65
+ > - inputs: the finding, the applied fix, the verification suggestion, and validation assets
66
+ > - sensors: deterministic command (requirements-trace check, test coverage, doc/spec alignment) and report claim closure
67
+ > - output: confirmed/disproven closure verdict with evidence
68
+ > - firewall: raw test output/logs summarized
69
+ > - memory: suggest-only; main agent persists reusable verification recipes
70
+ - Main agent owns report parsing, traceability matrix, memory writes, final synthesis, and Evidence Gate.
71
+ 11. Verify each completed finding:
72
+ - If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
73
+ `python3 skills/massa-ai/scripts/lessons.py --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
74
+ - 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.
75
+ - 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.
76
+ - Run the report's verification suggestion when available.
77
+ - Run acceptance tests, targeted unit/integration tests, docs checks, type/build checks, or manual artifact inspection relevant to the requirement.
78
+ - Update the traceability matrix status in the final report summary.
79
+ - Record command/artifact, result, skipped reason or `none`, highest Verification Ladder level reached, validation assets protected, and residual risk.
80
+ 12. At completion, persist only durable knowledge:
81
+ - Accepted requirement interpretations, scope constraints, compatibility rules, or reusable acceptance-test recipes after scoring with the Importance Calibration System.
82
+ - Use required tags: `project:<projectId>`, `session:<workflowSessionId>`, `workflow:requirements-fix`, `entity:<entity>`, and one `memory:<tier>` tag.
83
+ 13. Complete the Evidence Gate from `references/evidence-gate.md`.
84
+
85
+ ## Examples
86
+
87
+ User asks: "Use requirements-fix to fix latest audit for checkout flow."
88
+
89
+ 1. Confirm target focus is `checkout flow`, then read the latest matching `audits/requirements/* requirements-audit.md`.
90
+ 2. Validate metadata, target focus, freshness, required fields, requirement source, and current evidence before editing.
91
+ 3. Build a requirement traceability matrix.
92
+ 4. Fix mandatory gaps and contradictions before lower-severity docs/test issues.
93
+ 5. Verify against the cited requirement source.
@@ -0,0 +1,55 @@
1
+ ### RFC (Request for Comments)
2
+
3
+ Use this workflow when a significant technical, process, product, vendor, tool, or policy decision is still open and stakeholders need a structured proposal before committing to a direction. Route a finalized architecture decision to `workflows/adr.md`, settled implementation design to `workflows/tdd.md`, and broad requirements-through-delivery work to `workflows/spec-driven.md`.
4
+
5
+ Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
6
+
7
+ ## Workflow
8
+
9
+ 1. Resolve or reuse `projectId` and `workflowSessionId=rfc-[entity]`.
10
+ 2. Establish evidence before asking questions:
11
+ - `recall` relevant constraints, existing architecture or process, related proposals, prior attempts, rejected options, stakeholder expectations, and verification patterns.
12
+ - Load `references/rfc/discovery-and-sizing.md`.
13
+ - Inspect current source, project instructions, existing RFC conventions, decision records, tickets, and supplied research. Current source and approved project artifacts override stale memory.
14
+ - When supplied Figma links, nodes, desktop selections, or screenshots materially affect mobile UI options, use `workflows/design.md` as optional child context for visual feasibility only; the RFC still owns option comparison and recommendation. Screenshots are context-only unless paired with structured Figma evidence.
15
+ - Load `references/synapse-policy.md` when two or more related searches are expected and `references/context-firewall.md` before broad or verbose source inspection.
16
+ 3. Confirm workflow fit, classify the RFC type, and assign the required impact label `HIGH`, `MEDIUM`, or `LOW` using the preserved criteria in the discovery reference.
17
+ 4. Gather every missing mandatory field interactively in the user's language:
18
+ - Use the provider-specific `AskQuestion` capability and the preserved question schema when available.
19
+ - Ask concise conversational questions when `AskQuestion` is unavailable.
20
+ - Require title, background, full RACI roles, impact, urgency or due date, assumptions with confidence and invalidation triggers, weighted decision criteria, at least two options, and a recommendation.
21
+ - Reuse supplied or discoverable facts; do not ask for information already present.
22
+ 5. Load `references/rfc/document-contract.md` and draft the RFC in the same language as the user's request.
23
+ - Preserve the 7 mandatory and 4 recommended sections, numeric criterion weights, honest option comparison, generated cost and effort estimates, status quo consideration, action items, and outcome placeholder.
24
+ - Tailor conditional concerns to technical/architecture, process/workflow, product/feature, vendor/tool, or policy/compliance proposals.
25
+ - Mark generated estimates as estimates and state their assumptions when exact project data is unavailable.
26
+ 6. Choose the artifact path from an explicit user path or established project convention. Otherwise default to `docs/rfc/<entity>.md`.
27
+ - If the target exists, update it only when the user explicitly requested an update; otherwise ask before overwriting.
28
+ - When file mutation is unavailable or the user requested plan-only output, present the complete draft and intended path without writing.
29
+ 7. Run the full configured Plan Challenge Gate. Preserve all required RFC fields while revising valid critical or high findings, especially one-sided options, unsupported claims, hidden assumptions, status quo bias, weak cost estimates, and criteria chosen to justify a predetermined conclusion.
30
+ 8. Load `references/rfc/quality-and-lifecycle.md`, validate every required behavior, and resolve blocking gaps. Keep unresolved facts explicit instead of silently removing mandatory fields.
31
+ 9. Save the proposal with status `NOT STARTED` or `IN PROGRESS`. Set `COMPLETE` and fill the Outcome section only when an explicit human decision or authoritative project record is available.
32
+ 10. Persist proposal state after recall, deduplication, and scoring:
33
+ - Pending or in-review proposal: scored `conversation` memory with `memory:working`.
34
+ - Explicitly decided outcome, durable rejected options, and accepted constraints: scored `decision` memory with `memory:semantic`.
35
+ 11. Offer the preserved follow-up actions for stakeholder review, a decision deadline or meeting, Jira/Linear linkage, a downstream TDD, and Confluence publication when relevant.
36
+ 12. Complete `references/evidence-gate.md` and report the artifact path, status, RFC type, impact, options compared, challenge revisions, unresolved fields, memory outcome, and residual risk.
37
+
38
+ ## Failure Handling
39
+
40
+ - massa-ai unavailable: continue from current source and project documents; report skipped durable-memory synchronization.
41
+ - Evidence insufficient: use `AskQuestion` or concise conversation questions; do not omit a required field without naming the gap.
42
+ - Direction already settled: stop and route to ADR or TDD instead of disguising implementation documentation as an RFC.
43
+ - Only one credible option exists: research or elicit another option and compare the status quo; do not produce a one-sided proposal.
44
+ - Existing document conflicts with current evidence: surface the conflict and request resolution before replacing the authoritative statement.
45
+ - Jira, Linear, or Confluence unavailable: keep the suggested next step, but do not claim publication or linkage occurred.
46
+
47
+ ## Example
48
+
49
+ User asks: "Draft an RFC comparing self-hosted Kafka, Amazon MSK, and Confluent Cloud. Cost and vendor lock-in matter most."
50
+
51
+ 1. Recall related platform decisions and inspect current messaging usage, operational constraints, and existing RFC conventions.
52
+ 2. Classify a technical/vendor RFC and assign impact from affected systems and teams.
53
+ 3. Use `AskQuestion` for missing Driver, Approvers, Contributors, Informed parties, due date, assumptions, and criterion weights.
54
+ 4. Compare all named options plus the status quo, generate transparent estimates, run the full challenge, and save the document under the project RFC convention.
55
+ 5. Persist the pending proposal as working memory and offer review, Jira/Linear, TDD, and Confluence follow-ups.