@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,92 @@
1
+ # FURPS+ Refinement Checklist
2
+
3
+ Use this reference from `workflows/refinement/furps-refinement.md` when analyzing a PRD and/or ADR against the FURPS+ quality model. One `furps-analyst` sub-agent loads only its assigned dimension section; the main agent loads the full file only when synthesizing or when no dimension split is used.
4
+
5
+ ## Source
6
+
7
+ FURPS+ — a requirements/quality classification from the Rational Unified Process (RUP). The five core categories are Functionality, Usability, Reliability, Performance, Supportability; the "+" adds Design, Implementation, Interface, and Physical requirements. Source reference: QualidadeBR, "FURPS+", 2008 (https://qualidadebr.wordpress.com/2008/07/10/furps/), derived from RUP / Rational Library / Peter Eeles (IBM Rational).
8
+
9
+ ## Status rubric (every check item)
10
+
11
+ | Status | Meaning |
12
+ |---|---|
13
+ | covered | Requirement/decision is explicitly present, source-backed, and unambiguous |
14
+ | partial | Present but incomplete, vague, or missing a non-trivial sub-aspect |
15
+ | missing | Absent from the document; execution would have to assume or invent it |
16
+ | unclear | Present but contradictory, unverifiable, or without an owner |
17
+
18
+ Every item must record: status, evidence (quote or "absent"), and the output section it feeds (Open Questions / Suggestions / Insights / Risks / DoR-gaps). `missing` and `unclear` always produce at least one `FR-<letter>-<N>` finding; `partial` produces a finding when the gap is non-trivial.
19
+
20
+ ## Dimension: F — Functionality
21
+
22
+ Functional aspects of the software and compliance with specified requirements.
23
+
24
+ - **F1 Functional completeness & compliance** — Are all required capabilities and flows present, and do they comply with the specified requirements? covered = every capability listed with acceptance criteria; missing = capabilities referenced but not defined. Feeds: Risks, DoR-gaps.
25
+ - **F2 Components** — Are components/services and their responsibilities, boundaries, and contracts defined? covered = decomposition + ownership + contracts; partial = components named without boundaries. Feeds: Suggestions, Insights.
26
+ - **F3 Error flows** — Are error states, exception paths, failure handling, and input validation defined per flow? covered = per-flow error taxonomy + user-facing messages; missing = happy-path only. Feeds: Risks, Open Questions.
27
+ - **F4 Data integrity & validation** — Validation rules, constraints, idempotency, persistence correctness. Feeds: Risks.
28
+ - **F5 Interoperability & contracts** — External API/system contracts, backward/forward compatibility. Feeds: Risks, DoR-gaps.
29
+ - **F6 Edge cases & boundaries** — Identified and handled? Feeds: Open Questions, Risks.
30
+ - **F7 Security-relevant functional requirements** — authn/authz/access-control flows (cross-ref, not duplicating security-audit). Feeds: Risks.
31
+
32
+ ## Dimension: U — Usability
33
+
34
+ User-interface quality: error prevention, aesthetics, help/docs, consistency/standards.
35
+
36
+ - **U1 Error prevention** — Does the design prevent user errors (destructive-action confirmations, validation messages, undo)? Cross-ref F3. Feeds: Suggestions.
37
+ - **U2 Aesthetics & design consistency.** Feeds: Suggestions.
38
+ - **U3 Help & documentation** — user-facing docs/help planned? Feeds: DoR-gaps.
39
+ - **U4 Consistency & standards** — design-system adherence, patterns. Feeds: Suggestions.
40
+ - **U5 Accessibility (a11y)** — WCAG, contrast, keyboard, screen-reader. Feeds: Risks, DoR-gaps.
41
+ - **U6 Internationalization/localization (i18n/l10n).** Feeds: DoR-gaps.
42
+ - **U7 Onboarding & learnability.** Feeds: Suggestions.
43
+
44
+ ## Dimension: R — Reliability
45
+
46
+ Integrity, compliance, interoperability: failure frequency/severity, recoverability, predictability, accuracy, MTBF.
47
+
48
+ - **R1 Failure frequency & severity** — assumptions stated? Feeds: Risks.
49
+ - **R2 Recoverability** — retry, idempotency, rollback, compensation. Feeds: Risks.
50
+ - **R3 Predictability** — determinism, race conditions, ordering. Feeds: Risks.
51
+ - **R4 Accuracy & precision** — guarantees stated? Feeds: Open Questions.
52
+ - **R5 MTBF / availability / SLO targets.** Feeds: DoR-gaps, Risks.
53
+ - **R6 Data-loss prevention** — backups, disaster recovery. Feeds: Risks.
54
+ - **R7 Graceful degradation** under partial failure. Feeds: Suggestions.
55
+
56
+ ## Dimension: P — Performance
57
+
58
+ Response time, memory, CPU, load capacity, availability.
59
+
60
+ - **P1 Response-time targets / SLOs.** Feeds: DoR-gaps.
61
+ - **P2 Memory-consumption bounds.** Feeds: Risks.
62
+ - **P3 CPU utilization.** Feeds: Risks.
63
+ - **P4 Load capacity / throughput / concurrency.** Feeds: DoR-gaps.
64
+ - **P5 Scalability under load** (horizontal/vertical). Feeds: Suggestions.
65
+ - **P6 Startup/warm-up, cold-start.** Feeds: Risks.
66
+ - **P7 Resource quotas/limits.** Feeds: DoR-gaps.
67
+
68
+ ## Dimension: S — Supportability
69
+
70
+ Testability, adaptability, maintainability, compatibility, configurability, installability, scalability, localizability.
71
+
72
+ - **S1 Testability** — strategy, seams, fixtures, coverage targets. Feeds: DoR-gaps.
73
+ - **S2 Maintainability** — modularity, coupling, readability, changeability. Feeds: Suggestions, Insights.
74
+ - **S3 Adaptability/flexibility/extensibility.** Feeds: Suggestions.
75
+ - **S4 Compatibility** (backward/forward, browser/OS/device). Feeds: Risks.
76
+ - **S5 Configurability** (feature flags, env config). Feeds: Suggestions.
77
+ - **S6 Installability/deployability/operability.** Feeds: DoR-gaps.
78
+ - **S7 Observability** — logging, metrics, tracing, alerting, runbooks. Feeds: Risks, DoR-gaps.
79
+ - **S8 Localizability** (cross-ref U6). Feeds: DoR-gaps.
80
+
81
+ ## Dimension: X — FURPS+ Extensions
82
+
83
+ Non-functional requirements beyond the five core ("+").
84
+
85
+ - **X1 Design requirements/constraints** — languages, frameworks, tools, libraries, process. Feeds: Insights, Risks.
86
+ - **X2 Implementation requirements** — mandatory standards, DB integrity policies, resource limits, operating environments. Feeds: Risks, DoR-gaps.
87
+ - **X3 Interface requirements** — UI/system interface specs. Feeds: Open Questions.
88
+ - **X4 Physical requirements** — hardware, device, network constraints. Feeds: Risks.
89
+
90
+ ## Cross-dimension note
91
+
92
+ Some concerns span dimensions (e.g., error flows touch F3+R2+U1; components touch F2+S2). A `furps-analyst` may flag a cross-dimension concern in its findings, but must not expand its scope into another dimension. The main agent deduplicates and reconciles cross-dimension concerns during synthesis.
@@ -0,0 +1,104 @@
1
+ # FURPS+ Refinement Intake & Sub-agent Packet Contract
2
+
3
+ Use this reference from `workflows/refinement/furps-refinement.md` during intake and before dispatching sub-agents. It defines source detection, DoR sourcing, the context-firewall, the bounded document packet, and the sub-agent packet contracts.
4
+
5
+ ## Source-type detection
6
+
7
+ Detect the input source and resolve it before analysis:
8
+
9
+ | Signal | Source type | Resolution |
10
+ |---|---|---|
11
+ | File path or glob | file | Read via file tool; apply context-firewall for large files |
12
+ | Pasted text / inline block | text | Use directly; record as "pasted text" |
13
+ | Jira issue key (`ABCD-123`) or URL | Jira | Atlassian MCP capability discovery (read-only) |
14
+ | Confluence page URL | Confluence | Atlassian MCP capability discovery (read-only) |
15
+ | Ambiguous / missing | — | Ask the user once for a concrete source (graceful degradation) |
16
+
17
+ A run may combine sources (e.g., a Jira PRD epic + a Confluence ADR). Record every source and its timestamp.
18
+
19
+ ## Atlassian MCP (read-only capability discovery)
20
+
21
+ This workflow only reads from Atlassian; it never creates issues or pages. Reuse the capability-discovery pattern from `references/ticket/atlassian-fix.md`:
22
+
23
+ 1. Inspect currently callable tools.
24
+ 2. Identify Atlassian MCP operations by capability and schema, not by provider-specific function name. Needed capabilities: Jira issue retrieval and Confluence page retrieval.
25
+ 3. Preflight availability. If no matching capability exists, fall back to file/text and state the skipped source.
26
+
27
+ Do not assemble Jira/Confluence REST calls outside the MCP, and do not use the Jira CLI or browser automation as a fallback. If the MCP is absent, ask the user for the content as file/text.
28
+
29
+ ## Definition of Ready (DoR) sourcing
30
+
31
+ DoR is optional context used to grade coverage. Resolve in order:
32
+
33
+ 1. DoR supplied explicitly in the input (file/text/inline).
34
+ 2. DoR referenced in Jira/Confluence (e.g., a DoR field or linked Confluence page) via Atlassian MCP.
35
+ 3. Built-in fallback DoR (below).
36
+
37
+ If no DoR is available, use the built-in fallback and mark every DoR-gap finding with "no DoR supplied — fallback used". Never imply a DoR was applied when it was not.
38
+
39
+ ### Built-in fallback DoR
40
+
41
+ - Clear problem statement and business value
42
+ - Acceptance criteria (testable, unambiguous)
43
+ - Scope boundaries and explicit out-of-scope
44
+ - Identified dependencies and assumptions
45
+ - Non-functional requirements (performance/reliability/security/usability) stated
46
+ - Success metrics / measurable outcomes
47
+ - Priority and ownership assigned
48
+ - Open questions and risks documented
49
+
50
+ ## Context-firewall
51
+
52
+ Before dispatching sub-agents, bound the document:
53
+
54
+ - Carry section summaries plus pointers, not full raw text, when the document exceeds context-firewall thresholds.
55
+ - Each sub-agent receives only its dimension's checklist section plus the relevant document sections plus DoR plus the Fool summary.
56
+ - Sub-agents must summarize verbose content and return evidence/findings only, never raw dumps.
57
+
58
+ ## Bounded document packet
59
+
60
+ The main agent builds one packet reused across sub-agents:
61
+
62
+ - `projectId`, parent `workflowSessionId`
63
+ - document sections (or summaries) with stable section IDs for citations
64
+ - DoR criteria (resolved source)
65
+ - recalled facts (budgeted `recall`): prior ADRs, accepted decisions, patterns
66
+ - input source plus evidence timestamp
67
+ - exclusions: out-of-scope dimensions and sibling-workflow targets
68
+
69
+ ## Sub-agent packet contracts
70
+
71
+ ### plan-critic (The Fool) — evidence_audit
72
+
73
+ - role: `plan-critic`; mode: `evidence_audit`
74
+ - purpose: grade whether the PRD/ADR claims are source-backed, complete, falsifiable
75
+ - scope: the document as the challenged thesis
76
+ - permissions: read-only
77
+ - inputs: document packet, DoR, recalled facts
78
+ - sensors: source-location proof for each claim; absent-claim detection
79
+ - output: Fool critique contract (mode, steelmanned thesis, 3-5 challenges, severity, affected section, evidence gap, required revision, confidence impact, next step)
80
+ - firewall: summarize the document; no raw dumps
81
+ - memory: suggest only
82
+
83
+ ### plan-critic (The Fool) — pre_mortem
84
+
85
+ - role: `plan-critic`; mode: `pre_mortem`
86
+ - purpose: anticipate execution-phase failures of the proposed solution
87
+ - inputs: document packet, DoR, recalled facts, AND the evidence_audit summary
88
+ - output: Fool critique contract, focused on failure narratives
89
+ - otherwise identical to evidence_audit
90
+
91
+ Dispatch `pre_mortem` after `evidence_audit` returns, so it can build on identified gaps.
92
+
93
+ ### furps-analyst — one per dimension (F, U, R, P, S, X)
94
+
95
+ - role: `furps-analyst`; dimension: `<letter>`
96
+ - purpose: analyze one FURPS+ dimension against its checklist section
97
+ - scope: the assigned dimension's check items only
98
+ - permissions: read-only
99
+ - inputs: document packet, DoR, the Fool summary, the dimension's `checklist.md` section
100
+ - sensors: quote/section citation per check item; absent-claim detection
101
+ - output: per check-item status (`covered|partial|missing|unclear`) plus `FR-<letter>-<N>` findings plus contributions to Open Questions / Suggestions / Insights / Risks / DoR-gaps
102
+ - firewall: summarize the document; no raw dumps
103
+ - memory: suggest only
104
+ - parallelism: all six dispatch in parallel; batch if a concurrency cap applies
@@ -0,0 +1,140 @@
1
+ # FURPS+ Refinement Report Contract
2
+
3
+ Use this reference from `workflows/refinement/furps-refinement.md` before writing the final report. It extends the shared `references/audit-report-io.md` single-lens contract with FURPS-specific sections and the required refinement outputs (open questions, suggestions, insights, risks, DoR coverage gaps).
4
+
5
+ ## Report path
6
+
7
+ ```text
8
+ audits/refinement/<YYYY-MM-DD furps-refinement>.md
9
+ ```
10
+
11
+ Use the local current date. Create `audits/refinement/` when missing. Same-day same-target collisions use `-2`, `-3`; never silently overwrite a different run.
12
+
13
+ ## Plan Mode save rule
14
+
15
+ In Plan Mode, do not write the report file. Return the proposed canonical path and the complete report content. In Default mode, write the canonical report.
16
+
17
+ ## Report schema
18
+
19
+ ```md
20
+ # FURPS+ Refinement Report
21
+
22
+ Date: <YYYY-MM-DD>
23
+ Workflow: furps-refinement
24
+ ProjectId: <projectId>
25
+ WorkflowSessionId: <furps-refinement-[entity]>
26
+ Target: <PRD/ADR title or id>
27
+ Target Focus: <file path, Jira key, Confluence URL, or "pasted text">
28
+ Scope: <PRD | ADR | PRD+ADR>
29
+ Input Source: <file | text | Jira:<key> | Confluence:<url>>
30
+ DoR Source: <file | Jira | Confluence | built-in fallback | none>
31
+ Source Evidence Timestamp: <YYYY-MM-DD HH:MM local, or unavailable>
32
+ The Fool Validation: <modes run, compact summary, gating decision>
33
+
34
+ ## Executive Summary
35
+
36
+ <one-paragraph readiness verdict; counts by severity; whether DoR is satisfied>
37
+
38
+ ## The Fool Pre-Validation
39
+
40
+ <evidence_audit findings + pre_mortem findings; source-confidence gaps; execution-phase failure assumptions; the gating decision (proceed / proceed-with-caveats / paused)>
41
+
42
+ ## Functionality (F)
43
+
44
+ <per check-item status; FR-F-<N> findings>
45
+
46
+ ## Usability (U)
47
+
48
+ <… FR-U-<N>>
49
+
50
+ ## Reliability (R)
51
+
52
+ <… FR-R-<N>>
53
+
54
+ ## Performance (P)
55
+
56
+ <… FR-P-<N>>
57
+
58
+ ## Supportability (S)
59
+
60
+ <… FR-S-<N>>
61
+
62
+ ## FURPS+ Extensions (X)
63
+
64
+ <Design / Implementation / Interface / Physical; FR-X-<N>>
65
+
66
+ ## Open Questions
67
+
68
+ <numbered unresolved questions for stakeholders>
69
+
70
+ ## Suggestions
71
+
72
+ <prioritized concrete improvements>
73
+
74
+ ## Insights
75
+
76
+ <non-obvious learnings or patterns surfaced>
77
+
78
+ ## Risks
79
+
80
+ <severity-ordered; each with impact and mitigation>
81
+
82
+ ## Definition of Ready — Coverage Gaps
83
+
84
+ <DoR criteria not satisfied by the document; if no DoR was supplied, state the built-in fallback used and list fallback gaps>
85
+
86
+ ## Ruled-Out Candidates
87
+
88
+ <plausible concerns disproved by evidence, or "None">
89
+
90
+ ## Scope And Evidence
91
+
92
+ <inputs inspected, DoR source, commands/searches, skipped checks, residual risk>
93
+
94
+ ## Verification/Test Fidelity Checklist
95
+
96
+ | Item | Evidence |
97
+ |---|---|
98
+ | Deterministic sensor | <command, static scan, artifact inspection, or not available with reason> |
99
+ | Result | <pass, fail, not run, or not applicable> |
100
+ | Coverage target | <FR ID, no-finding claim, check item, or validation asset> |
101
+ | Validation assets protected | <tests, specs, fixtures, acceptance criteria, or none> |
102
+ | Skipped-check reason | <none or allowed reason> |
103
+ | Execution handoff | <verification command/artifact for every actionable finding> |
104
+
105
+ ## Execution Handoff
106
+
107
+ <ordered actionable FR-* IDs, dependencies, and suggested next workflow (e.g., spec-driven to fill gaps, requirements-audit after implementation, adr/rfc for open decisions)>
108
+ ```
109
+
110
+ ## Finding fields
111
+
112
+ Every finding uses the prefix `FR-<letter>-<N>` where `<letter>` is `F|U|R|P|S|X`.
113
+
114
+ ```md
115
+ ### FR-<letter>-<N>: <short title>
116
+
117
+ Dimension: F | U | R | P | S | X
118
+ Severity: critical | high | medium | low
119
+ Confidence: high | medium | low
120
+ Check Item: <checklist item ID, e.g. F3>
121
+ Status: covered | partial | missing | unclear
122
+ Location: <PRD/ADR section or quote, or n/a>
123
+ Evidence: <concrete quote or documented absence>
124
+ Impact: <risk or cost if unaddressed>
125
+ Simplest Fix Direction: <smallest sufficient change>
126
+ Verification Suggestion: <deterministic command, test, or artifact check>
127
+ ```
128
+
129
+ If a required field is unknown, write `Unknown` and explain the evidence gap. Execution treats unknown required fields as a stop condition unless the user explicitly accepts the risk after revalidation.
130
+
131
+ ## Severity rules
132
+
133
+ - `critical`: blocks release, causes data loss, breaks auth/privacy, or invalidates core value.
134
+ - `high`: missing/contradictory core requirement, major compatibility break, or a gap that will surface as an execution-phase failure.
135
+ - `medium`: incomplete edge case, unclear acceptance gap, recoverable mismatch, or missing docs/test around a requirement.
136
+ - `low`: minor ambiguity, wording mismatch, low-impact gap, or weakly supported concern.
137
+
138
+ ## Confidence
139
+
140
+ `high` = source-backed by an explicit quote; `medium` = inferred from context; `low` = plausible but unverified. Low-confidence suspects stay in Scope And Evidence unless the user explicitly asks to investigate.
@@ -0,0 +1,137 @@
1
+ # Hook Enforcement
2
+
3
+ Maps the runtime hook layer (`scripts/hooks/`, `hooks/hooks.json`) to massa-ai
4
+ workflows and references, and documents the massa-ai dual-write/tag contract.
5
+ Hooks **enforce** existing references and the gate the router already selected;
6
+ they never re-author policy and never re-route. One canonical location per rule.
7
+
8
+ ## Platform Scoping
9
+
10
+ The full hook graph installs for **Claude Code, Codex, and Cursor**. OpenCode has
11
+ no hook model and keeps the `AGENTS.md` bootstrap only. The installer
12
+ (`scripts/agent_integrations.py`) preserves unrelated user hooks on install and
13
+ uninstall via managed-command tracking.
14
+
15
+ Platform hook formats differ; the installer translates one canonical graph
16
+ (`hooks/hooks.json`, PascalCase events) into each platform's native shape:
17
+
18
+ | Platform | Format | Event names | Matcher notes |
19
+ |---|---|---|---|
20
+ | Claude Code | nested `settings.json` `hooks.<Event>[{matcher, hooks:[{type,command}]}]` | `PreToolUse`, `PostToolUse`, `Stop`, `PreCompact`, `SessionStart` (PascalCase) | `Edit\|Write` |
21
+ | Codex | nested `hooks.json` (same shape as Claude) | same PascalCase events | same as Claude |
22
+ | Cursor | flat `hooks.json` `hooks.<event>[{command, matcher?}]` | `preToolUse`, `postToolUse`, `stop`, `preCompact`, `sessionStart` (camelCase) | tool names differ: `Edit` → `Write` (no Edit tool in Cursor) |
23
+
24
+ Blocking semantics: Claude and Codex honor the `{"decision":"block","reason"}`
25
+ JSON output. Cursor's flat protocol differs; blocking hooks (`gateguard`,
26
+ `config_protection`) still run and nudge, but Cursor's denial is best-effort.
27
+ The non-blocking hooks (observe, context_monitor, suggest_compact,
28
+ continuous_learning_evaluate, precompact_save_state, stop_evidence_gate) work
29
+ identically across all three platforms (read stdin JSON, emit JSON, stderr
30
+ nudge, exit 0).
31
+
32
+ ## Environment Flags
33
+
34
+ | Flag | Values | Effect |
35
+ |---|---|---|
36
+ | `MASSA_AI_HOOK_PROFILE` | `minimal` \| `standard` \| `strict` | `minimal`: only blocking safety hooks (gateguard, config_protection). `standard` (default): blocking + nudges + observation + stop gate as nudge. `strict`: stop gate blocks once per session to force acknowledgment. |
37
+ | `MASSA_AI_DISABLED_HOOKS` | comma-separated hook names | Skip named hooks entirely. |
38
+
39
+ Every hook exits 0 on bad stdin or non-critical error. Blocking hooks are
40
+ <200 ms and make no network calls. Observation hooks are non-blocking.
41
+
42
+ ## Hooks → Enforced Reference
43
+
44
+ | Hook | Event | Enforces |
45
+ |---|---|---|
46
+ | `stop_evidence_gate.py` | Stop | `references/evidence-gate.md` |
47
+ | `continuous_learning_evaluate.py` | Stop | `references/lessons.md`, `scripts/lessons.py` |
48
+ | `precompact_save_state.py` | PreCompact | `workflows/long-session.md`, `references/context-firewall.md` |
49
+ | `suggest_compact.py` | PreToolUse(Edit\|Write) | `references/context-firewall.md` (compaction boundary) |
50
+ | `gateguard_fact_force.py` | PreToolUse(Edit) | `references/context-firewall.md` (investigate-before-edit) |
51
+ | `config_protection.py` | PreToolUse(Edit\|Write) | `references/verification-ladder.md` (scope) |
52
+ | `observe_runner.py` | PostToolUse | `references/lessons.md` (observation buffer) |
53
+ | `context_monitor.py` | PostToolUse | `references/verification-ladder.md` (task sizing/scope) |
54
+
55
+ ## Workflow-Aware Stop Gate
56
+
57
+ `stop_evidence_gate.py` reads the active `workflow` from `.specs/project/STATE.md`
58
+ and selects the workflow-specific gate. When `workflow` is unset or STATE is
59
+ absent, it falls back to the flat evidence matrix (graceful degradation).
60
+
61
+ | Workflow | `stop_evidence_gate` applies |
62
+ |---|---|
63
+ | `architecture-fix` | verification-fix gate (`references/verification-ladder.md`) |
64
+ | `bugs-fix` | verification-fix gate |
65
+ | `code-quality-fix` | verification-fix gate |
66
+ | `implementation-fix` | verification-fix gate |
67
+ | `maestro-fix` | verification-fix gate |
68
+ | `mobile-figma-fix` | verification-fix gate |
69
+ | `requirements-fix` | verification-fix gate |
70
+ | `security-fix` | verification-fix gate |
71
+ | `tests-fix` | verification-fix gate |
72
+ | `spec-driven` | `validation.md` verdict = Pass; 3-iteration cap |
73
+ | `debug` | reproduction no longer fails |
74
+ | `feature` | lite evidence matrix (`references/evidence-gate.md`) |
75
+ | `refactor` | lite evidence matrix |
76
+ | `exploration` | no-mutation gate (read-only invariant) |
77
+ | `architecture-audit` | flat evidence matrix |
78
+ | `bugs-audit` | flat evidence matrix |
79
+ | `code-quality-audit` | flat evidence matrix |
80
+ | `implementation-audit` | flat evidence matrix |
81
+ | `maestro-audit` | flat evidence matrix |
82
+ | `mobile-figma-audit` | flat evidence matrix |
83
+ | `requirements-audit` | flat evidence matrix |
84
+ | `security-audit` | flat evidence matrix |
85
+ | `tests-audit` | flat evidence matrix |
86
+ | `furps-refinement` | flat evidence matrix (findings-only; report written + DoR coverage gaps listed) |
87
+ | `adr` | flat evidence matrix |
88
+ | `commit` | flat evidence matrix |
89
+ | `design` | flat evidence matrix |
90
+ | `general` | flat evidence matrix |
91
+ | `long-session` | flat evidence matrix |
92
+ | `maestro` | flat evidence matrix |
93
+ | `onboarding` | flat evidence matrix |
94
+ | `rfc` | flat evidence matrix |
95
+ | `tdd` | flat evidence matrix |
96
+ | `the-fool` | flat evidence matrix |
97
+ | `ticket` | flat evidence matrix |
98
+
99
+ ## massa-ai Dual-Write / Tag Contract
100
+
101
+ The continuous-learning loop writes two stores, not one:
102
+
103
+ - `lessons.py add` / `import` — deterministic grounded file store
104
+ (`.specs/lessons.json`); refuses ungrounded lessons; promotion/quarantine.
105
+ - `remember` — durable memory, best-effort via REST (`MASSA_AI_API_URL`),
106
+ file-only fallback when REST is unavailable.
107
+
108
+ **Type:** always `pattern` (lessons are procedural knowledge) or `decision`
109
+ (when a lesson captures a chosen trade-off). `procedural` is a **tag**, never a
110
+ type — massa-ai supports only `critical | conversation | code | decision | pattern`
111
+ (`references/mcp-tools.md`).
112
+
113
+ **Tags:** every massa-ai lesson write carries the full massa-ai persistence
114
+ contract: `project:<projectId>`, `session:<workflowSessionId>`,
115
+ `workflow:<type>`, `entity:<name>`, `memory:procedural`. This puts lessons in
116
+ the same recall namespace as massa-ai decisions/patterns, so future
117
+ `recall` surfaces them at Specify/Design.
118
+
119
+ `PreCompact` (`precompact_save_state.py`) writes a massa-ai `critical` memory
120
+ tagged `memory:working` for the active objective + exact next step before the
121
+ window compacts; file-only fallback when REST is unavailable.
122
+
123
+ ## No SessionStart Recall Duplication
124
+
125
+ massa-ai's router already runs budgeted `recall` on startup. The hook
126
+ layer adds **no** competing SessionStart recall. The installer keeps the
127
+ existing SessionStart bootstrap (which transports `AGENTS.md` policy); memory
128
+ recall stays owned by the router.
129
+
130
+ ## Graceful Degradation
131
+
132
+ | Failure | Behavior |
133
+ |---|---|
134
+ | massa-ai REST unavailable | lesson still lands in `lessons.json`; skipped memory write logged to `scripts/hooks-state/skip.log` |
135
+ | `.specs/STATE.md` absent / workflow unset | stop gate falls back to flat matrix |
136
+ | bad / malformed stdin | hook exits 0, never blocks |
137
+ | hook non-critical error | exit 0, approve, log skip |
@@ -0,0 +1,101 @@
1
+ # Implementation Delivery Protocol
2
+
3
+ Use this reference in every implementation workflow, before the first repository
4
+ mutation. It defines how verified work leaves the agent's hands: isolated in a
5
+ worktree, committed atomically, pushed, proposed as a pull request, watched
6
+ through CI, repaired if red — and merged only after the user says so.
7
+
8
+ Read-only workflows (`*-audit`, `exploration`, `the-fool`) never load this file.
9
+ They do not mutate, so they have nothing to deliver.
10
+
11
+ ## Principle
12
+
13
+ Work that is not isolated, not pushed, and not tested by CI is not delivered —
14
+ it is a local opinion. The protocol turns "I finished" into "CI agrees, and a
15
+ human chose to merge it".
16
+
17
+ ## The Chain
18
+
19
+ | # | Stage | Command | On failure |
20
+ | --- | --- | --- | --- |
21
+ | 0 | Preflight | `git rev-parse --is-inside-work-tree`; `command -v gh`; `gh auth status` | Record which capabilities are absent and select the degraded path below |
22
+ | 1 | Isolate | `git fetch origin <base> && git worktree add -b <type>/<slug> <path> origin/<base>` | Branch name taken → suffix `-2`. Worktree path taken → reuse it only if its branch matches |
23
+ | 2 | Implement | one task → gate → `git commit` | Gate red → fix before committing. Never commit through a failing gate |
24
+ | 3 | Push | `git push -u origin <type>/<slug>` | Rejected non-fast-forward → `git fetch` + rebase, never force-push a shared branch |
25
+ | 4 | Propose | `gh pr create --base <base> --title <t> --body <b>` | `gh` absent/unauthenticated → degraded path |
26
+ | 5 | Watch | `gh pr checks --watch` | No checks configured → say so; do not claim CI passed |
27
+ | 6 | Repair | fix on the branch, commit, return to stage 5 | Capped at 3 iterations, then stop as `Blocked` |
28
+ | 7 | **Ask** | report the PR URL and the green check list, then **stop** | — |
29
+
30
+ ### Stage 1 — worktree isolation is mandatory
31
+
32
+ Every implementation task runs in its own git worktree. There is **no size
33
+ exemption**: a one-line typo fix is isolated exactly like a twelve-file feature.
34
+ The reason is that the exemption, not the ceremony, is what costs time —
35
+ "this one is too small to isolate" is the judgment call that puts half-finished
36
+ work on a shared branch.
37
+
38
+ The only two legal skip reasons:
39
+
40
+ 1. The target is not a git repository.
41
+ 2. The user explicitly declined isolation for this task.
42
+
43
+ Record the skip reason verbatim in the completion report. Any other reason is a
44
+ protocol violation, not a shortcut.
45
+
46
+ Set up the worktree's dependencies before the first gate — a fresh worktree has
47
+ no `node_modules`, no `dist`, and no `.env`. A gate that fails only because the
48
+ worktree was never provisioned is an environment failure; say so rather than
49
+ reporting it as a code failure.
50
+
51
+ ### Stage 2 — one commit per task
52
+
53
+ Commit message content, staging rules, audit-report exclusions, and Jira
54
+ prefixes are owned by `workflows/commit.md`. Do not restate them here; invoke
55
+ that workflow. This reference owns only the cadence: **one atomic commit per
56
+ completed task, after its gate passes.** Never batch tasks into one commit and
57
+ never commit a task whose gate is red.
58
+
59
+ ### Stage 7 — merge is never automatic
60
+
61
+ Do not run `gh pr merge` without explicit user approval given in the current
62
+ session. Approval for one PR does not carry to the next. When CI is green,
63
+ report:
64
+
65
+ - the PR URL,
66
+ - the check names that passed,
67
+ - what is still unverified (skipped jobs, absent checks),
68
+
69
+ then stop and ask. If the user approves, merge with the repository's configured
70
+ strategy and delete the branch. If the repository auto-releases on merge, say so
71
+ in the same message — the user is approving a release, not just a merge.
72
+
73
+ ## Degraded Paths
74
+
75
+ | Missing capability | Behavior |
76
+ | --- | --- |
77
+ | `gh` not installed or not authenticated | Run stages 0–3, then stop. Report the pushed branch and the exact `gh pr create` command the user can run. Record `pr: skipped — gh unavailable` |
78
+ | No remote configured | Run stages 0–2. Report local commits and the branch name. Record `push: skipped — no remote` |
79
+ | Not a git repository | Run stage 2's gate discipline only. Record `isolation: skipped — not a repository` |
80
+ | Repository has no CI | Run stages 0–4, then stop at stage 7 with `ci: no checks configured` |
81
+ | CI is red after 3 repair iterations | Stop as `Blocked`. Preserve the failing check output and the hypotheses already ruled out; do not merge, do not disable the check |
82
+
83
+ A skipped stage is always reported. Silence reads as success, and a stage that
84
+ silently did not run is worse than one that loudly failed.
85
+
86
+ ## Anti-Patterns
87
+
88
+ - Committing directly to `main` or the default branch.
89
+ - Force-pushing a branch that has an open PR.
90
+ - Weakening, skipping, or deleting a test to turn CI green — see
91
+ `references/root-cause-scripts.md` when a check keeps failing.
92
+ - Merging because CI passed. CI passing is the precondition for asking, not the
93
+ approval itself.
94
+ - Reporting "done" while the branch is unpushed.
95
+
96
+ ## Completion Evidence
97
+
98
+ The delivery section of the Evidence Gate reports, in one block: worktree path,
99
+ branch, commit hashes with their tasks, PR URL, CI verdict per check, repair
100
+ iterations used, skipped stages with reasons, and the merge decision (approved,
101
+ declined, or awaiting the user).