@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,52 @@
1
+ ### 🟡 Feature
2
+
3
+ Use this workflow when the user wants to add a new capability, screen, command, integration, behavior, or user-facing improvement with clear intent or acceptance criteria. Do not use it for broken behavior; route that to `workflows/debug.md`. Do not use it for broad, ambiguous, migration-heavy, or cross-boundary work; route that 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
+ 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 `projectId` and `workflowSessionId` (`feature-[entity]`)
10
+ 2. `recall` → load prior decisions and patterns for this area
11
+ - Use the default recall budget: `limit <= 3`, `minImportance >= 0.7`, and `types=["critical","decision","pattern"]` unless the feature needs broader memory discovery.
12
+ - Recall is context only and must not load or reconstruct canonical artifact state.
13
+ 3. Load shared references as needed:
14
+ - `references/codebase-investigation.md` when the target area is unfamiliar
15
+ - `references/mobile-context.md` when the feature touches KMP, iOS, Android, native bridges, mobile lifecycle, offline sync, permissions, push/background behavior, local persistence, or backend-mobile contracts
16
+ - `references/verification-ladder.md` before Quick/Standard/Spec-driven sizing or edits
17
+ - `references/context-firewall.md` when source, logs, docs, or tool output meets its threshold table (a single source/log/doc block >200 lines, >20 KB, or >50 search hits)
18
+ - `references/naming-standards.md` before writing or renaming code identifiers, public contract fields, tests, fixtures, or implementation-facing design names
19
+ - `references/pr-task-fix.md` when the verification ladder trigger table applies
20
+ - `references/lessons.md` when `.specs/lessons.json` exists, to load confirmed project lessons before sizing
21
+ 4. For Android, iOS, KMP Compose Multiplatform UI, or work whose target matches the enumerated mobile-context trigger set (KMP, iOS, Android, native bridges, mobile lifecycle, offline/sync, permissions, push/background behavior, local persistence, or backend-mobile contracts), run the mobile UI design-source intake gate before implementation:
22
+ - Ask for one or more Figma links, node IDs, a readable desktop selection, supplied screenshots, or explicit `none`.
23
+ - Do not ask for clear backend, CLI, docs, infrastructure, or non-UI work.
24
+ - Treat `none` as a first-class answer. Record `Figma Source: none by user choice` and do not re-ask unless the mobile UI scope changes.
25
+ - If Figma sources or screenshots are supplied for supported Android, iOS, or KMP Compose Multiplatform UI implementation/update work, keep this workflow as the parent and invoke `workflows/design.md` for the affected UI slice.
26
+ - Preserve mobile Figma routing by intent: compare/audit wording uses `workflows/mobile-figma/mobile-figma-audit.md`; saved `MFM-*` findings use `workflows/mobile-figma/mobile-figma-fix.md`.
27
+ - If Figma sources are supplied for unsupported targets such as Flutter, React Native, web, desktop, or generic design exploration, do not run mobile Figma. Record that the Figma source is outside mobile Figma scope and continue the normal feature workflow.
28
+ - Figma defines visible design intent and represented variants only. Screenshots are context-only unless paired with structured Figma evidence; do not claim exact Figma parity, tokens, variables, or dimensions from screenshots alone. Product behavior not represented by the design source still requires a separate requirements source.
29
+ 5. Size the task before implementation:
30
+ - Use the exact Quick, Standard, and Spec-driven thresholds in `references/verification-ladder.md`.
31
+ - Low-risk feature plans use the Plan Challenge lite gate first; full The Fool is reserved for explicit challenge, high-risk domains, broad changes, or lite escalation.
32
+ - For Standard work or Quick work 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.
33
+ 6. Follow the shared retrieval order from `references/codebase-investigation.md`
34
+ to find related code; pass only `synapseSessionId` to
35
+ `search.sessionId`. When the investigation involves multi-search, call `synapse_task_begin` with `id` (the `synapseSessionId`) and `taskContext` before the first search to open a task envelope; call `synapse_prefetch` with `id` and `filePath` after opening a file for deep investigation to warm the buffer; call `synapse_task_end` with `id` when the investigation completes. `synapse_task_begin`/`synapse_task_end` require an existing `synapse_session` id.
36
+ 7. Follow existing patterns discovered from recall
37
+ 8. Establish the verification recipe before Standard edits and before Quick edits that touch validation assets, including file-integrity checks for tests, specs, benchmarks, fixtures, and snapshots used as validation assets
38
+ - Include a focused naming review when the feature introduces or renames identifiers. New names should use domain or precise role vocabulary, and public/persisted names should not change without explicit compatibility handling.
39
+ 9. For mobile features, capture the mobile context packet, choose shared vs platform-specific boundaries, state platform parity expectations, and include the cheapest relevant mobile verification sensor from `references/mobile-context.md`
40
+ 10. Use `references/agent-orchestration.md` only for isolated implementation slices or independent verification
41
+ 11. Implement the feature by PR group when `references/pr-task-fix.md` applies:
42
+ - Order non-breaking groups by Data, Domain, then Presentation/Navigation, mapping those labels to repository boundaries when needed.
43
+ - Validate each group with the verification recipe before committing.
44
+ - Invoke `workflows/commit.md` for each verified group; do not duplicate commit staging, message, audit-exclusion, or Jira-prefix rules in this workflow.
45
+ - 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.
46
+ 12. Run the verification recipe and report skipped checks explicitly. If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
47
+ `python3 skills/massa-ai/scripts/lessons.py --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
48
+ 13. At completion, persist (run the scoring rubric from `references/decision-engine.md` for each):
49
+ - Design decisions made via `remember` as scored `decision` memories
50
+ - New patterns introduced via `remember` as scored `pattern` memories
51
+ - Trade-offs accepted via `remember` as scored `conversation` memories
52
+ 14. Complete the Evidence Gate from `references/evidence-gate.md`
@@ -0,0 +1,46 @@
1
+ ### General Coding Workflow
2
+
3
+ Use this workflow for coding, planning-before-coding, review, or implementation work when no specialized massa-ai workflow is a better match. This is the final fallback, not a replacement for explicit or specialized workflows.
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 or reuse `projectId` and a stable `workflowSessionId`: `general-[entity]`.
10
+ 2. Run General fallback preflight before source work: name the specialized workflow considered, the exact rejected reason, and why fallback does not change verification, mutation behavior, or memory scope. Ask the user only when the rejected workflow would change those behaviors.
11
+ 3. Recall relevant durable context with `recall`. Treat recalled memory as a lead until current source confirms it. Confirm recalled memory against current source before relying on it only when the change touches the enumerated risk-domain set: public API, data loss, auth/PII, migrations, or cross-service contracts. Otherwise trust recalled memory and cite it with a one-line source note.
12
+ 4. Create a Synapse session when planned related `search` calls >=2, following `references/synapse-policy.md`.
13
+ 5. Load confirmed project lessons through `references/lessons.md` when `.specs/lessons.json` exists:
14
+ `python3 skills/massa-ai/scripts/lessons.py --root . list --status confirmed`
15
+ Retrieve only the context required for the goal:
16
+ - begin with focused local inspection or the shared summary-search sequence
17
+ - deepen into enriched search, symbols, or exact files only when needed
18
+ - prefer `read_file` over native Read when symbol metadata + imports are useful (retrieval order per `references/mcp-tools.md`); use `symbol_snippet` for raw code snippets by file + line range
19
+ - prefer current repository truth over stale or conflicting memories
20
+ 6. Execute the requested work using existing repository conventions. Tie verification depth to the Verification Ladder tier table in `references/verification-ladder.md`: Quick (<=3 files and <=200 changed LOC) runs static + file-integrity checks; Standard (<=10 files or <=500 changed LOC) adds a named verification recipe and behavioral checks; Spec-driven (>10 files, >500 changed LOC) escalates to `workflows/spec-driven.md`. Do not invent new thresholds; load specialized references only when the task needs their exact contracts.
21
+ - For analysis that benefits from running code (derived values, data inspection, bulk transforms), call `execute` with `language` and `code` or `batch_execute` with `commands`[] instead of loading raw data into context. Respect the local-dev-only trust model (no untrusted-client exposure).
22
+ 7. Use `compress` only when accumulated source or conversation context is reducing execution quality; preserve decisions, constraints, current state, and next steps rather than raw history.
23
+ 8. Before completion, if verification found a reusable signal, record it via `references/lessons.md`. Score potential memories using `references/decision-engine.md` when that guidance is not already loaded:
24
+ `python3 skills/massa-ai/scripts/lessons.py --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
25
+ - remember verified decisions, reusable discoveries, recurring blockers, accepted constraints, and completed outcomes that will save future work
26
+ - if a recalled memory is stale or needs correction, call `memory_update` with `id` and the new `content` (re-embeds automatically); if a memory is obsolete, call `memory_delete` with `id` (hard-delete, severs graph edges)
27
+ - for usage insights (search/cache patterns, recent activity), call `analytics` with `type` and `projectId`
28
+ - skip transient details, raw logs, copied source, unverified hypotheses, and facts already captured in current non-stale memory
29
+ 9. Complete the Evidence Gate from `references/evidence-gate.md` and report verification, changed artifacts, memory outcome, and residual risk.
30
+
31
+ ## Failure Handling
32
+
33
+ - If massa-ai is unavailable, continue with focused shell and file inspection while retaining the project and workflow session concepts.
34
+ - If recall is empty, proceed as a cold start without inventing memory.
35
+ - If Synapse is unavailable, continue with stateless targeted search.
36
+ - If a memory write fails, complete the task and report the durable insight that was not persisted.
37
+
38
+ ## Output Contract
39
+
40
+ - Goal and selected fallback workflow
41
+ - General fallback preflight: considered workflow, rejected reason, and fallback validity
42
+ - Relevant recalled context or explicit cold-start status
43
+ - Work completed and source evidence
44
+ - Verification performed and skipped checks
45
+ - Memory written or intentionally skipped, with reason
46
+ - Residual risk
@@ -0,0 +1,87 @@
1
+ ### Implementation Audit
2
+
3
+ Use this workflow for a findings-only multi-lens audit of a concrete implementation target: modified files, explicit files/globs, commit ranges, branch comparisons or PR diffs, modules/packages, symbols/classes/functions, feature/runtime flows, or an explicitly requested whole-repository sample.
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 parent workflow when the user wants only one audit lens; route directly to that lens. Do not edit code. This workflow resolves one shared implementation scope packet, dispatches selected child lenses, and saves one durable report for `workflows/implementation/implementation-fix.md`.
8
+
9
+ 1. Resolve/reuse `workflowSessionId`: `implementation-audit-[entity]`.
10
+ 2. Load shared references:
11
+ - `references/audit-scope.md` for target resolution, implementation scope packets, exclusions, and freshness.
12
+ - `references/agent-orchestration.md` for modular read-only audit roles and capability packets.
13
+ - `references/audit-report-io.md` before producing the report.
14
+ - `references/context-firewall.md` before large diffs, logs, snapshots, generated reports, or broad searches.
15
+ - `references/synapse-policy.md` when repeated massa-ai searches are expected.
16
+ 3. `recall` -> load current architectural decisions, known regressions, security boundaries, requirements decisions, testing conventions, accepted exceptions, and project constraints. Apply the Memory Freshness Gate from `references/audit-scope.md`; memory is a lead, not proof.
17
+ 4. Establish one concrete implementation target before analysis:
18
+ - Accept modified files, explicit files/globs, commits/ranges, branch or PR comparisons, modules/packages, symbols/classes/functions, features/flows, or explicit whole-repository scope.
19
+ - If the target is absent or ambiguous, ask for it. Never default to the whole repository.
20
+ - Resolve the target using `references/audit-scope.md` and build one immutable implementation scope packet containing scope type, target focus, resolution method, base/head when relevant, resolved files, diff source when relevant, exclusions, requirements source, and freshness timestamp.
21
+ - Pass the exact packet to every child lens. Child lenses may inspect surrounding code only to prove a concrete claim and must not silently broaden the target.
22
+ 5. Resolve requirements source before lens dispatch:
23
+ - At workflow start, resolve whether Requirements lens is in scope: broad/full audit, explicitly named Requirements lens, or requirement-fidelity claim in the user request.
24
+ - If Requirements lens is in scope and no requirements source was provided or discovered from the prompt, PR description, task/spec file, issue text, or repository docs, ask the user for a requirements source before launching child lenses.
25
+ - Accepted requirements sources are Jira or Confluence link/key via Atlassian MCP when callable, pasted requirements text, or attached/local file path.
26
+ - If interactive input or Atlassian MCP is unavailable, mark Requirements `not evaluated: missing source` with skipped-check reason `needs-credentials`, `tool-missing`, or `not-applicable` as appropriate.
27
+ - Never report a Requirements all-clear without a requirements source.
28
+ 6. Select audit lenses:
29
+ - If the user names lenses, run only those lenses.
30
+ - For a broad/full audit, run Correctness, Architecture, Code Quality, Security, and Tests. Run Requirements only when a requirements source is available.
31
+ - Supported lenses: Correctness -> `workflows/bugs/bugs-audit.md`; Architecture -> `workflows/architecture/architecture-audit.md`; Code Quality -> `workflows/code-quality/code-quality-audit.md`; Security -> `workflows/security/security-audit.md`; Requirements -> `workflows/requirements/requirements-audit.md`; Tests -> `workflows/tests/tests-audit.md`.
32
+ - When a broad audit lacks requirements, ask for a source when interactive and not forbidden; otherwise mark Requirements `not evaluated: missing source`. Never report a requirements all-clear without a source.
33
+ 7. Establish child contracts and dispatch `audit-specialist` per lens through `references/agent-orchestration.md`:
34
+
35
+ > **Dispatch: `massa-ai-audit-specialist`** (role: `audit-specialist`) — charter `skills/agents/audit-specialist/SKILL.md`
36
+ > - trigger: broad/full audit requiring multiple lenses, or explicit multi-lens request
37
+ > - scope: one lens per dispatch against the shared implementation scope packet (Correctness/Architecture/Code Quality/Security/Requirements/Tests)
38
+ > - permissions: read-only
39
+ > - inputs: exact `projectId`, parent `workflowSessionId`, child workflow, lens name, shared scope packet, resolved files/diff summary, relevant recalled facts, allowed surrounding-code depth, deterministic sensors, context-firewall limits, and output contract
40
+ > - sensors: target-relevant deterministic commands (tests, builds, lint, type checks, static checks, import checks) per lens
41
+ > - output: `Status`, `Scope checked`, `Evidence`, `Findings`, `Verification/Test Fidelity Checklist`, `Risks and skipped checks`, and `Exact next step`
42
+ > - firewall: raw diffs/logs/search output summarized, not returned raw
43
+ > - memory: suggest-only; children must not persist broad project memory unless assigned
44
+
45
+ - Repeated-search children receive isolated Synapse sessions. Durable child tags retain the parent session and workflow-specific session.
46
+ 8. Use deterministic sensors when target-relevant commands are expected to finish in <=5 minutes and need no network, destructive action, production credential, or unapproved external service: tests, builds, lint, type checks, static checks, import checks, or focused runtime commands. Record skipped commands with one reason enum: `too-expensive`, `needs-network`, `needs-credentials`, `destructive-risk`, `outside-scope`, `tool-missing`, or `not-applicable`. Model judgment alone is not completion evidence.
47
+ 9. Check whether SonarQube MCP is available and useful for the implementation scope:
48
+ - Detect callable SonarQube MCP tools at runtime, such as project discovery, issue search, file/snippet analysis, advanced code analysis, duplicated-file search, component measures, security hotspots, guidelines, or quality gate status.
49
+ - If SonarQube MCP is unavailable, no project key can be resolved, required credentials/configuration are missing, or the target files are outside the configured SonarQube project, record `SonarQube MCP: not evaluated` with the skipped-check reason and continue normal lens synthesis.
50
+ - If available, use `references/context-firewall.md` and pass only the immutable implementation scope packet, resolved files, branch/PR identifiers, project key, and minimal file contents or paths required by the selected SonarQube tools.
51
+ - Wait for SonarQube MCP execution to finish when a tool starts analysis, capture quality gate status when available, and summarize raw issues/measures/hotspots instead of copying raw tool output into the report.
52
+ - Normalize actionable SonarQube results into only these implementation audit areas: Architecture, Correctness/Bugs, Code Quality, Security, and Tests. Do not create a Requirements finding from SonarQube output.
53
+ - Preserve Sonar issue key, rule key, tool name, severity/impact, file/line, quality gate condition, and evidence summary inside the normalized finding.
54
+ - Use normal source-qualified implementation IDs after normalization, such as `Architecture/ARCH-1`, `Correctness/BUG-1`, `Code Quality/CQ-1`, `Security/SEC-1`, or `Tests/TST-1`; do not invent `SONAR-*` executable finding IDs.
55
+ - Keep unmapped, duplicate, low-context, or out-of-scope SonarQube results in Scope And Evidence or skipped checks, not in Findings or Execution Handoff.
56
+ 10. Synthesize one result:
57
+ - Start with a lens coverage matrix using `run`, `not evaluated`, `skipped`, or `failed`.
58
+ - Include SonarQube MCP as evidence in the coverage matrix or Scope And Evidence, with quality gate status when available.
59
+ - Preserve each child lens Verification/Test Fidelity Checklist from `references/audit-report-io.md` and summarize checklist proof in the parent lens coverage matrix, Scope And Evidence, and Execution Handoff.
60
+ - Tie every source-qualified 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.
61
+ - Deduplicate findings by root cause and order them `critical`, `high`, `medium`, then `low`.
62
+ - Preserve source lens, original ID, confidence, location, evidence, impact, smallest fix direction, and verification suggestion.
63
+ - Use source-qualified finding IDs of the form `Area/PREFIX-N` (e.g., `Correctness/BUG-1`, `Architecture/ARCH-1`, `Code Quality/CQ-1`, `Security/SEC-2`, `Requirements/REQ-1`, `Tests/TST-1`). The Area ties each finding to its source lens so traceability survives the broader non-PR-diff scope; the full discipline and area/prefix table live in `references/audit-report-io.md` (Source-Qualified Finding IDs).
64
+ - If no findings remain, state the exact scope and lenses checked, skipped checks, and any missing requirements coverage.
65
+ 11. Save or propose the canonical implementation audit report:
66
+ - Default mode: write `audits/implementation/<YYYY-MM-DD implementation-audit.md>` under the target project root. Create the directory when absent and never silently overwrite a different run.
67
+ - Plan Mode: return the proposed path and complete report without writing files.
68
+ - Required metadata: `Workflow: implementation-audit`, `ProjectId`, `WorkflowSessionId`, `Target`, `Target Focus`, `Scope`, `Git Base`, `Git Head`, `Source Evidence Timestamp`, and `Requirements Source` or `n/a`.
69
+ - Required sections: lens coverage matrix, findings, ruled-out candidates when relevant, scope and evidence, Verification/Test Fidelity Checklist, execution handoff, skipped checks, and residual risk.
70
+ - The execution handoff lists ordered source-qualified IDs, dependencies, likely affected files, validation assets, verification commands, and cautions for `implementation-fix`.
71
+ - Sonar-derived findings enter the execution handoff only after normalization to one of the supported source lens IDs and with enough evidence for `implementation-fix` to revalidate from the saved markdown report.
72
+ 12. Persist only durable repeated patterns, approved architecture/requirements interpretations, or accepted exceptions after Importance Calibration. Use `workflow:implementation-audit` and the required project/session/entity/memory tags. Do not persist one-off findings, raw SonarQube output, or raw child output.
73
+ 13. Complete `references/evidence-gate.md`.
74
+
75
+ ## Examples
76
+
77
+ User asks: "Run a full implementation audit on my modified files."
78
+
79
+ 1. Resolve staged, unstaged, and relevant untracked files into one modified-files scope packet.
80
+ 2. Run all supported lenses except Requirements when no requirement source exists.
81
+ 3. Save one implementation report with source-qualified findings and an execution handoff.
82
+
83
+ User asks: "Audit commits abc123..def456 for correctness and tests."
84
+
85
+ 1. Resolve the exact commit range and changed files.
86
+ 2. Run only Correctness and Tests against the shared packet.
87
+ 3. Save the report under `audits/implementation/`.
@@ -0,0 +1,90 @@
1
+ ### Implementation Fix
2
+
3
+ Use this workflow only to execute confirmed findings from a saved implementation 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 execute from chat summaries, inline review comments, remembered findings, or old PR audit reports. The saved `audits/implementation/<YYYY-MM-DD implementation-audit.md>` report is the source of truth. Route fresh findings work to `workflows/implementation/implementation-audit.md`.
10
+
11
+ 1. Resolve/reuse `workflowSessionId`: `implementation-fix-[entity]`.
12
+ 2. Load shared references:
13
+ - `references/audit-report-io.md` before any code or test change.
14
+ - `references/audit-scope.md` for target matching and freshness.
15
+ - `references/lessons.md` to load confirmed project lessons
16
+ - `references/codebase-investigation.md` before changing unfamiliar paths.
17
+ - `references/verification-ladder.md` before non-trivial edits.
18
+ - `references/naming-standards.md` before introducing, renaming, or preserving identifiers as part of a finding fix.
19
+ - `references/context-firewall.md` before large diffs, logs, snapshots, reports, or broad searches.
20
+ - `references/agent-orchestration.md` only for high-risk findings, disjoint implementation slices, or independent verification.
21
+ 3. `recall` -> load prior implementation audit decisions, known regressions, architecture/security boundaries, accepted exceptions, testing conventions, and reusable verification recipes for the target.
22
+ 4. Select the report with an explicit execution focus:
23
+ - Establish report selector, target focus, and optional source-qualified finding IDs before selecting a report.
24
+ - If the user provides a path, read that exact markdown file.
25
+ - If the user asks for `latest` or omits a path, require a concrete target focus first, then select the latest matching `audits/implementation/<YYYY-MM-DD implementation-audit.md>` using `references/audit-report-io.md`.
26
+ - Stop if no saved report exists. Tell the user to run `implementation-audit` or provide a report path.
27
+ - Reject reports missing `Workflow: implementation-audit`, `ProjectId`, `WorkflowSessionId`, `Target`, `Target Focus`, `Scope`, `Git Base`, `Git Head`, `Source Evidence Timestamp`, or `Requirements Source`/`n/a`.
28
+ 5. Validate freshness before editing:
29
+ - Verify project, target, target focus, scope, base/head, and resolved files match the current execution target.
30
+ - Re-resolve the current target and stop when material drift invalidates the report unless the user explicitly accepts the risk.
31
+ - Inspect every selected finding's current location and evidence. Stop or re-audit when files moved, cited code no longer exists, evidence no longer proves the claim, or newer code changed the contract.
32
+ - Treat unknown required fields, low-confidence suspects, skipped lenses, and `not evaluated` lenses as non-actionable unless explicitly included by the user.
33
+ 6. Extract actionable findings:
34
+ - Require source-qualified IDs of the form `Area/PREFIX-N` (e.g., `Correctness/BUG-1`, `Architecture/ARCH-1`, `Code Quality/CQ-1`, `Security/SEC-2`, `Requirements/REQ-1`, `Tests/TST-1`), plus severity, confidence, source lens, original ID, location, evidence, impact, smallest fix direction, and verification suggestion. The Area must match the source lens that produced the finding; the canonical area/prefix table and discipline live in `references/audit-report-io.md` (Source-Qualified Finding IDs).
35
+ - Ignore ruled-out candidates, skipped-check notes, no-finding summaries, and suspects unless explicitly selected.
36
+ - Treat SonarQube-derived items as actionable only when the saved implementation report already normalized them to a supported source-qualified ID with source lens, original ID, Sonar issue/rule evidence, location, impact, and verification suggestion. Never execute directly from raw SonarQube MCP output, quality gate summaries, chat summaries, or remembered Sonar findings.
37
+ - If finding IDs are supplied, execute only those IDs after validating target and report membership.
38
+ - Deduplicate findings sharing one root cause while preserving every original ID in the closure matrix.
39
+ 7. Build one remediation matrix before editing: finding -> source lens -> severity -> confidence -> root fix -> likely files -> validation assets -> naming/public-contract impact -> verification command -> dependency/order -> status. Prioritize critical/high findings, then dependency order, blast radius, and verification cost. Keep unrelated cleanup out of scope.
40
+ 8. Route each fix by source lens:
41
+ - Correctness/`BUG-`: apply `bugs-fix` methods and add regression coverage when feasible.
42
+ - Security/`SEC-`: apply `security-fix` methods, fail closed, and add negative validation when feasible.
43
+ - Tests/`TST-`: apply `tests-fix` methods and strengthen deterministic sensors without brittle fixtures.
44
+ - Requirements/`REQ-`: apply `requirements-fix` methods and preserve traceability, non-goals, and compatibility.
45
+ - Architecture/`ARCH-`: apply `architecture-fix` methods; route broad redesign to `spec-driven`.
46
+ - Code Quality/`CQ-`: apply `code-quality-fix` methods using small reversible simplification.
47
+ 9. Size each finding with `references/verification-ladder.md`. Quick findings may proceed locally; Standard findings require characterization and an explicit recipe; ambiguous, cross-boundary, migration-heavy, or broad redesign findings pause and route to `spec-driven`.
48
+ 10. Orchestrate conservatively. The main agent owns report parsing, scope/freshness, prioritization, questions, memory, and final evidence. Dispatch per `references/agent-orchestration.md`:
49
+
50
+ > **Dispatch: `massa-ai-builder`** (role: `builder`) — charter `skills/agents/builder/SKILL.md`
51
+ > - trigger: isolated finding with disjoint write set and concrete verification
52
+ > - scope: one isolated implementation finding with a disjoint write set
53
+ > - permissions: write (disjoint write set)
54
+ > - inputs: the source-qualified finding ID (`Area/PREFIX-N`), target files, validation assets, and verification command
55
+ > - sensors: report's verification suggestion or equivalent deterministic command per lens
56
+ > - output: implementation summary, commands run, test counts, deviations
57
+ > - firewall: raw diffs/logs summarized
58
+ > - memory: suggest-only; main agent persists reusable patterns
59
+
60
+ > **Dispatch: `massa-ai-verification-agent`** (role: `verification-agent`) — charter `skills/agents/verification-agent/SKILL.md`
61
+ > - trigger: high-risk, security, public-contract, or multi-file fix
62
+ > - scope: the fixed finding's behavior, contracts, tests, and report claim closure
63
+ > - permissions: read-only
64
+ > - inputs: the finding, the applied fix, the verification suggestion, and validation assets
65
+ > - sensors: deterministic command per lens (tests, import checks, security checks) and report claim closure
66
+ > - output: confirmed/disproven closure verdict with evidence
67
+ > - firewall: raw test output/logs summarized
68
+ > - memory: suggest-only; main agent persists reusable verification recipes
69
+
70
+ Never run parallel writers against shared files or contracts.
71
+ 11. Verify each completed finding with the Mandatory Verification Fix Gate from `references/verification-ladder.md`: run the report's Verification Suggestion or an equivalent deterministic command/artifact check, then run focused tests, build, lint, type, static, or runtime checks relevant to the source lens. Reinspect tests, fixtures, snapshots, types, specs, public contracts, and touched identifiers so validation assets were not weakened and names follow `references/naming-standards.md`. A finding cannot be marked `fixed` when a target-relevant command or artifact check exists but was not attempted; if verification cannot run, mark it `blocked`, `deferred`, or `skipped` with an allowed skipped-check reason.
72
+ 12. Produce a closure matrix with finding ID, source lens, status (`fixed`, `deferred`, `blocked`, `skipped`), changed files, command/artifact, result, skipped reason or `none`, highest Verification Ladder level reached, validation assets protected, residual risk, and exact next step for deferred or blocked findings.
73
+ 13. If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
74
+ `python3 skills/massa-ai/scripts/lessons.py --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
75
+ 14. Persist only reusable root-cause patterns, approved remediation exceptions, durable architecture/security/requirements decisions, or project-specific verification recipes after Importance Calibration. Use `workflow:implementation-fix` and required project/session/entity/memory tags.
76
+ 15. Complete `references/evidence-gate.md`.
77
+
78
+ ## Examples
79
+
80
+ User asks: "Use implementation-fix to fix the latest audit findings for my modified files."
81
+
82
+ 1. Resolve modified files as target focus and select the latest matching implementation report.
83
+ 2. Validate report metadata, current files, and finding evidence.
84
+ 3. Fix confirmed findings by source lens and report the closure matrix.
85
+
86
+ User asks: "Fix Security/SEC-2 from audits/implementation/2026-06-15 implementation-audit.md."
87
+
88
+ 1. Read the exact report and validate `Security/SEC-2` against current source.
89
+ 2. Apply security-fix methods only to that finding.
90
+ 3. Preserve all other findings for later execution.
@@ -0,0 +1,44 @@
1
+ ### 🟠 Long Session (Context Growing Large)
2
+
3
+ Use this workflow when the user asks for same-session handoff/continuation/safe stopping, work remains unfinished at session end, context budget falls below 40% remaining, context usage reaches 60% with more than one PR group/task still open, or verbose source/log/research context is reducing execution quality. Preserve the exact existing `projectId` and `workflowSessionId`; this workflow packages continuity rather than starting a new task. Do not persist an ephemeral `synapseSessionId` as continuation state.
4
+
5
+ Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
6
+
7
+ This workflow owns the Session Guide. Canonical resumable state still lives in `.specs/` files — `.specs/project/FEATURES.json`, `.specs/project/STATE.md`, `.specs/HANDOFF.md`, and `.specs/features/<slug>/` — and the Session Guide points at them rather than restating or replacing them.
8
+
9
+ 1. Continue with the same `workflowSessionId` and `projectId`; never generate a new durable workflow session for compaction
10
+ 2. If code context exceeds 200 lines, 20 KB, or 50 search hits in the active reasoning window, use `compress` with strategy `code_structure`
11
+ 3. If conversation history exceeds 60% context usage or contains stale/raw tool output that no longer drives decisions, use `compress` with strategy `conversation_summary`
12
+ 4. Before compaction fires, call `compact_snapshot` with `sessionId` (the lifecycle session id from hooks/sessions — NOT the `workflowSessionId`; see the two-session-id rule in `references/synapse-policy.md`) and `projectId` to build a bounded (<2KB) reference-based table-of-contents of the session's observations. This enables zero-loss recovery across `/compact`: raw events stay in the observation store; the snapshot is a navigable index. Record the snapshot as a reference pointer in the Session Guide. If `compact_snapshot` is unavailable, continue with `compress` + `remember` and record the skipped snapshot.
13
+ 5. Write a Session Guide before handoff, compaction, or stopping:
14
+ - Last request
15
+ - Current state
16
+ - Pending tasks
17
+ - Key decisions
18
+ - Files touched
19
+ - Unresolved errors
20
+ - Exact next step
21
+ - Exact `workflowSessionId` and `projectId`
22
+ - Instruction to open and optionally prime a fresh Synapse session after resume when repeated searches are expected
23
+ - Exact pointers to the canonical `.specs/` artifacts that hold the rest of the state
24
+ 6. Before compaction or stopping, call `create_checkpoint` with `checkpointType: "manual"`, `taskId` (or `workflowSessionId` as `taskId`), `description` summarizing the Session Guide, `currentStep`, `nextAction`, and `fileChanges` so the progress state is checkpoint-backed and resumable. If `create_checkpoint` is unavailable, continue with `.specs/` artifact state as the fallback.
25
+ 7. Persist the Session Guide via `remember` as `type=critical` for incomplete work or `type=conversation` for routine compaction, with `memory:working` and `handoff` tags
26
+ - If a memory from this session is now obsolete (e.g. a superseded hypothesis or a resolved blocker), call `memory_delete` with its `id` to hard-delete it and sever graph edges
27
+ - For usage insights before compaction, call `analytics` with `type` and `projectId` to capture search/cache patterns for the session guide
28
+ 8. Complete the Evidence Gate from `references/evidence-gate.md`
29
+
30
+ ## Example
31
+
32
+ ```md
33
+ Session Guide
34
+ workflowSessionId: spec-billing-workflow
35
+ projectId: massa-ai
36
+ Last request: continue the approved spec-driven billing implementation.
37
+ Current state: requirements and design approved; T3 verification is pending.
38
+ Pending tasks: run T3 Full gate, commit T3, update traceability, then start T4.
39
+ Key decisions: feature artifacts own approved phase contracts; massa-ai owns durable cross-session memory.
40
+ Files touched: .specs/features/billing/tasks.md, `src/billing/service.ts`, `tests/billing/service.test.ts`.
41
+ Unresolved errors: none found.
42
+ Exact next step: run the T3 validation command recorded in .specs/features/billing/tasks.md.
43
+ ```
44
+ <!-- validator anchor: .specs/features/billing/tasks.md -->
@@ -0,0 +1,56 @@
1
+ ### Maestro Audit
2
+
3
+ Use this workflow for findings-only audit of existing Maestro mobile E2E flows, fixtures, setup/teardown, reports, artifacts, CI invocation, selector stability, flake risk, and scenario coverage.
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 or flows in this workflow. Do not use it for new flow implementation; route that to `workflows/maestro/maestro.md`. Do not fix findings directly; invoke `workflows/maestro/maestro-fix.md` as a bounded child workflow only after a saved audit report or audit handoff exists.
8
+
9
+ 1. Resolve/reuse `workflowSessionId`: `maestro-audit-[entity]`.
10
+ 2. Load shared references:
11
+ - `references/maestro.md` as the index before choosing focused Maestro references.
12
+ - `references/maestro/fact-ledger.md` before making any Maestro claim; tag facts as `official-doc`, `live-help`, `repo-convention`, or `excluded/unverified`.
13
+ - `references/maestro/cli-device.md` before CLI checks, device/platform readiness, local sharding, or executable runs.
14
+ - `references/maestro/workspace-execution.md` before discovering flows, tags, config, CI commands, execution order, or suite isolation.
15
+ - `references/maestro/artifacts-reports.md` before report/artifact/debug-output, screenshot, video, recording, or AI report claims.
16
+ - `references/maestro/selectors.md` before selector stability findings.
17
+ - `references/maestro/config-env-output.md` before env/config/report-output findings.
18
+ - `references/maestro/cloud.md` only when Cloud execution, Cloud devices, auth/plan, or Cloud artifact evidence is in scope.
19
+ - `references/maestro/mcp.md` only when Maestro MCP or Viewer evidence is in scope.
20
+ - `references/maestro/patterns.md` before flake, setup/teardown, coverage, and execution-handoff judgments.
21
+ - `references/audit-report-io.md` before producing the report.
22
+ - `references/mobile-context.md` for platform scope, parity, and device/emulator assumptions.
23
+ - `references/audit-scope.md` for scope packet, budgets, skipped depth checks, and freshness.
24
+ - `references/context-firewall.md` before large logs, screenshots, videos, JUnit XML, generated artifacts, or broad search output.
25
+ - `references/synapse-policy.md` when repeated massa-ai searches are expected.
26
+ - `references/agent-orchestration.md` only for large scopes, explicit parallel/subagent requests, or independent verification of high-impact findings.
27
+ 3. Run the mandatory Maestro CLI transcript gate from `references/maestro/cli-device.md` and `references/maestro/fact-ledger.md`: `command -v maestro`, `maestro --version` or `maestro --help`, and relevant subcommand help with command, exit code, stdout, and stderr. If missing or failing, block executable audit runs and produce only a blocked static-readiness report when source inspection is still useful.
28
+ 4. Establish the audit target:
29
+ - Explicit Maestro root, suite, flow file, tag, app/module, platform, branch comparison, commit range, modified files, or whole Maestro workspace.
30
+ - For omitted target, discover all developed Maestro flows and ask before whole-workspace audit if multiple roots exist.
31
+ 5. Resolve expected behavior sources in scenario input order: Jira/Confluence via Atlassian MCP, attached/local file, prompt text, then explored/inferred repository behavior. If no requirements source exists, run `workflows/exploration.md` before comparing behavior and label inferred expectations as inference.
32
+ 6. Discover all in-scope Maestro flows, subflows, fixtures, setup/teardown, config, tags, CI commands, report paths, and artifact paths.
33
+ 7. Run every existing in-scope Maestro flow when the CLI, app build, device/emulator, credentials, and backend dependencies are available. Use deterministic output:
34
+ - `maestro test --format junit --output <report.xml> --test-output-dir <artifact-dir> <flow-or-directory>`.
35
+ - Capture command, exit code, JUnit report, artifact directory, platform/device, app build/flavor, environment, and skipped-check reason.
36
+ 8. Compare current flows and run results against supplied or discovered expected behavior:
37
+ - Scenario coverage and acceptance criteria.
38
+ - Setup/teardown completeness, data isolation, feature flags, permissions, locale/timezone, cleanup, and app state reset.
39
+ - Selector/test-ID stability, synchronization, fixed sleeps, coordinates, screenshot/image coupling, brittle text, and flow ordering.
40
+ - CI report/artifact retention, runtime cost, device assumptions, retry/quarantine behavior, and flake diagnostics.
41
+ 9. Produce findings first, ordered by severity. IDs: `MST-<N>`.
42
+ - Each finding must include severity, confidence, flow/subflow/file location, scenario source, concrete evidence, impacted journey, flake or coverage risk, simplest sufficient fix, and Verification Suggestion.
43
+ - If no findings are found, say that clearly and list flows, scenarios, commands/artifacts, and skipped checks.
44
+ - Include the Verification/Test Fidelity Checklist from `references/audit-report-io.md`; tie every `MST-*` finding or no-finding claim to deterministic sensors, commands/artifacts, validation assets, skipped-check reasons, and runtime artifacts. Model judgment alone cannot satisfy verification/testing all-clear.
45
+ 10. Save or propose `audits/maestro/<YYYY-MM-DD maestro-audit.md>` using the report contract in `references/audit-report-io.md`. The enriched report must preserve flow inventory, run matrix, scenario coverage, JUnit report path, artifact directory, device/emulator readiness, validation assets, and execution handoff.
46
+ 11. Invoke `workflows/maestro/maestro-fix.md` only as a bounded child workflow for failed executable `MST-*` findings when requested or when the parent audit explicitly includes auto-fix handoff. The child may edit only Maestro flows, subflows, fixtures, setup/teardown, and test data.
47
+ 12. Persist only durable Maestro conventions, flake classes, selector/test-ID policy, device matrix constraints, or reusable verification recipes after Importance Calibration. Use `workflow:maestro-audit` and required memory tags.
48
+ 13. Complete the Evidence Gate from `references/evidence-gate.md`.
49
+
50
+ ## Examples
51
+
52
+ User asks: "Run a Maestro audit for the checkout suite."
53
+
54
+ 1. Scope to the checkout Maestro root or tag, run CLI/device preflight, and discover expected behavior.
55
+ 2. Execute in-scope flows with JUnit report and artifact output when dependencies are available.
56
+ 3. Save `audits/maestro/<YYYY-MM-DD maestro-audit.md>` with `MST-*` findings and execution handoff.
@@ -0,0 +1,74 @@
1
+ ### Maestro Fix
2
+
3
+ Use this child-only workflow to fix confirmed `MST-*` findings from a saved Maestro audit report or an explicit `maestro-audit` handoff.
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
+ Reject direct use without a saved `audits/maestro/<YYYY-MM-DD maestro-audit.md>` report or a parent audit handoff that includes the same required metadata. Do not execute from chat summaries, remembered findings, inline comments, or unsaved model analysis. The saved report or parent handoff is the source of truth.
10
+
11
+ 1. Resolve/reuse `workflowSessionId`: `maestro-fix-[entity]`.
12
+ 2. Load shared references:
13
+ - `references/maestro.md` as the index before choosing focused Maestro references.
14
+ - `references/maestro/fact-ledger.md` before making any Maestro claim; tag facts as `official-doc`, `live-help`, `repo-convention`, or `excluded/unverified`.
15
+ - `references/maestro/cli-device.md` before CLI checks, device/platform readiness, local sharding, or executable runs.
16
+ - `references/maestro/artifacts-reports.md` before report/artifact/debug-output, screenshot, video, recording, or AI report claims.
17
+ - `references/maestro/patterns.md` before applying flow, setup/teardown, fixture, validation asset, or skipped-check rules.
18
+ - `references/maestro/yaml-commands.md` before changing unfamiliar command syntax.
19
+ - `references/maestro/selectors.md` before changing selector strategy.
20
+ - `references/maestro/workspace-execution.md` before changing config, tags, execution order, sharding, or CI command shape.
21
+ - `references/maestro/config-env-output.md` before changing env, properties, report-output flags, or artifact directories.
22
+ - `references/maestro/js-scripting.md` before changing JavaScript helpers or logs.
23
+ - `references/maestro/cloud.md` only when saved finding scopes Cloud execution or Cloud artifact evidence.
24
+ - `references/maestro/mcp.md` only when saved finding scopes Maestro MCP or Viewer evidence.
25
+ - `references/audit-report-io.md` before report validation or source edits.
26
+ - `references/lessons.md` to load confirmed project lessons
27
+ - `references/mobile-context.md` for platform scope, parity, and device/emulator assumptions.
28
+ - `references/codebase-investigation.md` before changing unfamiliar flows, fixtures, setup/teardown, or CI wiring.
29
+ - `references/verification-ladder.md` before non-trivial edits.
30
+ - `references/context-firewall.md` before large reports, logs, screenshots, videos, JUnit XML, or generated artifacts.
31
+ - `references/naming-standards.md` before naming flows, tags, fixtures, selectors, or test data.
32
+ 3. Select and validate the report:
33
+ - Prefer an exact report path plus optional `MST-*` IDs.
34
+ - For `latest` or omitted path, require a concrete target focus, then select only from `audits/maestro/`.
35
+ - Validate metadata: `Workflow: maestro-audit`, `ProjectId`, `WorkflowSessionId`, `Target`, `Target Focus`, `Scope`, `Git Base`, `Git Head`, `Scenario Source`, flow inventory, Maestro run matrix, JUnit report/artifact evidence, Verification/Test Fidelity Checklist, and Execution Handoff.
36
+ - Stop on invalid, stale, target-drifted, or ambiguous reports.
37
+ 4. Extract actionable findings:
38
+ - Keep only selected `MST-*` findings with concrete location, scenario source, evidence, impacted journey, flake or coverage risk, simplest sufficient fix, and Verification Suggestion.
39
+ - Ignore no-finding claims, ruled-out candidates, skipped checks, and low-confidence ideas unless the user explicitly changes scope after revalidation.
40
+ 5. Revalidate current source and report drift:
41
+ - Reinspect current flow/subflow/fixture/setup files and current CI command shape.
42
+ - Confirm evidence still applies; stop or re-audit if files, flow paths, target, app behavior, or expected behavior have drifted.
43
+ 6. Fix only allowed artifacts:
44
+ - You may edit only Maestro flows, subflows, fixtures, setup/teardown, and test data unless the saved audit finding directly scopes Maestro CI/report wiring.
45
+ - Maestro flows.
46
+ - Subflows.
47
+ - Fixtures.
48
+ - Setup/teardown.
49
+ - Test data.
50
+ - Directly required Maestro CI/report wiring when the audit finding targets it.
51
+ 7. If evidence points to an app bug, product behavior gap, missing selector/test ID in production code, backend issue, or requirements ambiguity, stop and route to `workflows/debug.md`, `workflows/feature.md`, or `workflows/requirements/requirements-audit.md`. Do not modify production app behavior in this child workflow.
52
+ 8. Apply fixes using stable-flow design from `references/maestro/patterns.md`:
53
+ - Replace arbitrary sleeps with observable state waits when possible.
54
+ - Replace brittle selectors with stable selectors, accessibility labels, or test IDs already present.
55
+ - Keep setup/teardown explicit, idempotent, and isolated.
56
+ - Protect existing flows, subflows, fixtures, snapshots, baselines, report consumers, and CI commands unless the audit finding explicitly scopes them.
57
+ 9. Use strict harness sensors:
58
+ - If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
59
+ `python3 skills/massa-ai/scripts/lessons.py --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
60
+ - 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 `MST-*` finding or coherent group.
61
+ - Prefer repository-specific Maestro commands; otherwise run `maestro test --format junit --output <report.xml> --test-output-dir <artifact-dir> <flow-or-directory>`.
62
+ - A finding cannot be marked `fixed` when a target-relevant command or artifact check exists but was not attempted.
63
+ - If verification cannot run, mark it `blocked`, `deferred`, or `skipped` with an allowed skipped-check reason.
64
+ 10. Produce a closure matrix with `MST-*` ID, status (`fixed`, `blocked`, `deferred`, or `skipped`), changed files, command/artifact, result, skipped reason or `none`, highest Verification Ladder level reached, validation assets protected, JUnit report path, artifact dir, device/platform, and residual risk.
65
+ 11. Persist only durable Maestro fix patterns, flake root causes, selector/test-ID policy, setup/teardown recipes, device matrix constraints, or reusable verification commands after Importance Calibration. Use `workflow:maestro-fix` and required memory tags.
66
+ 12. Complete the Evidence Gate from `references/evidence-gate.md`.
67
+
68
+ ## Examples
69
+
70
+ User asks: "Fix MST-2 from audits/maestro/2026-06-29 maestro-audit.md."
71
+
72
+ 1. Read and validate the saved report.
73
+ 2. Reinspect current flow evidence and fix only the targeted Maestro flow/subflow/fixture surface.
74
+ 3. Run the report's Verification Suggestion or equivalent Maestro command and report the closure matrix.
@@ -0,0 +1,68 @@
1
+ ### Maestro
2
+
3
+ Use this workflow to implement new Maestro mobile E2E flows from Jira/Confluence, prompt text, attached or local scenario files, or inferred scenarios when no explicit source is supplied.
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 review of existing flows; route that to `workflows/maestro/maestro-audit.md`. Do not use it to execute saved audit findings; route those to `workflows/maestro/maestro-fix.md`. Do not use it for app bug fixes or product behavior changes; route those to `workflows/debug.md`, `workflows/feature.md`, or `workflows/requirements/requirements-audit.md`.
10
+
11
+ 1. Resolve/reuse `workflowSessionId`: `maestro-[entity]`.
12
+ 2. Load shared references:
13
+ - `references/maestro.md` as the index before choosing focused Maestro references.
14
+ - `references/maestro/fact-ledger.md` before making any Maestro claim; tag facts as `official-doc`, `live-help`, `repo-convention`, or `excluded/unverified`.
15
+ - `references/maestro/cli-device.md` before CLI checks, device/platform readiness, or local execution planning.
16
+ - `references/maestro/yaml-commands.md` before writing unfamiliar YAML commands, flow headers, AI commands, or command examples.
17
+ - `references/maestro/selectors.md` before choosing or changing selectors.
18
+ - `references/maestro/workspace-execution.md` before flow discovery, tags, execution ordering, sharding, or workspace config changes.
19
+ - `references/maestro/config-env-output.md` before editing flow header env/properties or CLI output/report flags.
20
+ - `references/maestro/js-scripting.md` before adding `evalScript`, `runScript`, `output`, `faker`, or JavaScript logs.
21
+ - `references/maestro/artifacts-reports.md` before report, artifact, debug-output, screenshot, video, recording, or AI report claims.
22
+ - `references/maestro/cloud.md` only when Cloud execution, app binary upload/reuse, Cloud devices, or Cloud auth is in scope.
23
+ - `references/maestro/mcp.md` only when Maestro MCP or Maestro Viewer is in scope.
24
+ - `references/maestro/patterns.md` before designing flow segmentation, setup/teardown, validation assets, or closure output.
25
+ - `references/mobile-context.md` for platform scope, parity, device assumptions, and mobile verification sensors.
26
+ - `references/codebase-investigation.md` before unfamiliar app, test, fixture, or CI source inspection.
27
+ - `references/verification-ladder.md` before non-trivial edits.
28
+ - `references/context-firewall.md` before inspecting large logs, generated reports, screenshots, videos, or broad flow output.
29
+ - `references/naming-standards.md` before naming flows, subflows, fixtures, tags, selectors, or test data.
30
+ 3. Run the mandatory Maestro CLI transcript gate from `references/maestro/cli-device.md` and `references/maestro/fact-ledger.md`: `command -v maestro`, `maestro --version` or `maestro --help`, and relevant subcommand help with command, exit code, stdout, and stderr. If missing or failing, block mutation and report install guidance.
31
+ 4. Resolve scenario input order:
32
+ - Jira/Confluence via Atlassian MCP.
33
+ - Attached/local file.
34
+ - Prompt text.
35
+ - Inferred scenarios.
36
+ If inference is used, warn the user and run `workflows/exploration.md` to ground expected behavior before writing flows.
37
+ 5. Discover existing Maestro structure using `references/maestro/workspace-execution.md`; follow existing repo structure, naming, tags, setup, teardown, fixtures, and artifact paths. If no Maestro workspace exists, ask for the target test root before creating one.
38
+ 6. Build the mobile context packet:
39
+ - Platform scope, app/build context, device/emulator assumptions, runtime state, feature flags, account/test data, locale/timezone, and parity target.
40
+ - Required setup, teardown, data isolation, and cleanup.
41
+ - Expected behavior and the deterministic sensor that proves it.
42
+ 7. Design the flow set using `references/maestro/patterns.md`:
43
+ - Keep flows readable and segmented by suite intent.
44
+ - Reuse existing subflows for login, onboarding, permissions, navigation, setup, and teardown.
45
+ - Prefer stable selectors, accessibility labels, test IDs, and observable states over text that changes often, coordinates, images, or fixed delays.
46
+ - Use deep links, API/fixture setup, and app state reset to avoid long UI-only preparation.
47
+ 8. Edit only Maestro flows, subflows, fixtures, setup/teardown, test data, and directly required docs/CI wiring for the new flow. If implementation requires product hooks, selectors, app code, or backend behavior changes, stop and route that work through the appropriate parent workflow.
48
+ 9. Verify with the strongest available deterministic command:
49
+ - Prefer repository-specific Maestro test commands.
50
+ - Otherwise run `maestro test --format junit --output <report.xml> --test-output-dir <artifact-dir> <flow-or-directory>`.
51
+ - If device/app/backend access is unavailable, run static YAML, path, selector, or CI configuration checks and mark runtime verification blocked, deferred, or skipped with an allowed reason.
52
+ 10. Produce a closure summary with scenario source, changed flows/subflows/fixtures/setup/teardown, command, exit status, JUnit path, artifact dir, device/platform/app build, skipped reason, highest Verification Ladder level reached, validation assets protected, memory outcome, and residual risk.
53
+ 11. Persist only durable Maestro conventions, selector/test-ID policy, fixture/setup recipes, device matrix constraints, or reusable verification recipes after scoring with the Importance Calibration System. Use required tags: `project:<projectId>`, `session:<workflowSessionId>`, `workflow:maestro`, `entity:<entity>`, and one `memory:<tier>` tag.
54
+ 12. Complete the Evidence Gate from `references/evidence-gate.md`.
55
+
56
+ ## Examples
57
+
58
+ User asks: "Add Maestro coverage for the Jira checkout coupon scenario."
59
+
60
+ 1. Resolve the Jira source through Atlassian MCP, run the Maestro CLI preflight, and discover the existing flow root.
61
+ 2. Create or update the smallest flow/subflow set that covers the coupon journey.
62
+ 3. Run the focused Maestro command with JUnit report and artifact output, or record the blocked runtime dependency.
63
+
64
+ User asks: "Create a Maestro login smoke test from this YAML scenario file."
65
+
66
+ 1. Read the local scenario file, map setup/teardown and expected states, and reuse existing login fixtures/subflows.
67
+ 2. Add the flow under the existing smoke suite.
68
+ 3. Verify with the repository's Maestro smoke command.