@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,114 @@
1
+ ### Tests Audit
2
+
3
+ Use this workflow for findings-only audit of test coverage, regression protection, assertion quality, fixture reliability, and missing deterministic sensors in a concrete target: modified files, explicit files/globs, commit ranges, branch comparisons, modules/packages, symbols/classes/functions, feature/runtime flows, explicitly requested whole-repo scope, or an implementation scope packet supplied by `workflows/implementation/implementation-audit.md`.
4
+
5
+ Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
6
+
7
+ Do not use this workflow to write, run, or fix test findings as the main task; route that to `workflows/tests/tests-fix.md`. Do not use it for generic correctness, security, architecture, code quality, or requirements findings; route those to the dedicated workflows.
8
+
9
+ This workflow is findings-only. Do not edit code unless the user separately asks for fixes.
10
+
11
+ 1. Resolve/reuse `workflowSessionId`: `test-audit-[entity]`
12
+ 2. Load shared references:
13
+ - `references/codebase-investigation.md`
14
+ - `references/audit-scope.md`
15
+ - `references/audit-report-io.md` before writing the final direct audit report
16
+ - `references/mobile-context.md` when the scope touches KMP, iOS, Android, native bridges, mobile lifecycle, offline sync, permissions, local persistence, UI snapshots/screenshots, or backend-mobile contracts
17
+ - `references/context-firewall.md` before inspecting large diffs, logs, snapshots, generated reports, or broad search output
18
+ - `references/synapse-policy.md` when repeated massa-ai searches are expected
19
+ - `references/agent-orchestration.md` only for large scopes, explicit parallel/subagent requests, PR subagent invocation, or independent verification of high-impact findings
20
+ 3. `recall` -> load testing conventions, mock boundaries, prior flaky tests, known regressions, project constraints, reusable verification recipes, and accepted test exceptions for the target area.
21
+ - Apply the Memory Freshness Gate from `references/audit-scope.md`; recalled exceptions are leads, not proof.
22
+ 4. Establish the investigation scope before proceeding:
23
+ - Modified files scope: use when the user says modified files, changed files, current changes, uncommitted changes, staged changes, or unstaged changes.
24
+ - Explicit files/globs scope: use when the user names files, directories, or globs.
25
+ - Commit range scope: use when the user provides commits/ranges or asks for commits made by me, my branch commits, or test gaps introduced by branch commits.
26
+ - Branch comparison scope: use when the user names base/head branches, refs, or a branch diff.
27
+ - Codebase area scope: use when the user names a path, module, package, feature area, test suite, or glob.
28
+ - Symbol/class/function scope: use when the user names public classes, functions, APIs, handlers, or exported surfaces.
29
+ - Feature/flow scope: use when the user names a runtime flow, user journey, or feature area.
30
+ - Whole-repo scope: use only when the user explicitly asks for a whole-repo tests audit.
31
+ - Implementation parent scope: use only when `workflows/implementation/implementation-audit.md` invokes this workflow with a concrete implementation scope packet.
32
+ - If the target focus is missing, vague, or too broad, ask for a concrete target from the supported scope types in `references/audit-scope.md`.
33
+ - Build the shared scope packet from `references/audit-scope.md` and carry it into the report.
34
+ 5. For modified files scope:
35
+ - Include staged and unstaged tracked files from the working tree.
36
+ - Include untracked non-generated source, test, fixture, schema, config, and docs files only when they can affect runtime, validation, or test behavior.
37
+ - Exclude deleted files unless their deletion can break test coverage, imports, exports, routing, migrations, config, tests, or packaging.
38
+ - Exclude generated, dependency, build, log, cache, temporary, and secret paths per repo rules.
39
+ - Inspect diffs first, then tests and surrounding code needed to understand regression risk.
40
+ 6. For commit range scope:
41
+ - If the user supplied explicit commits or a revision range, use that exact range.
42
+ - If the user asked for commits made by me, resolve author identity from `git config user.email`; if empty, use `git config user.name`.
43
+ - For branch-relative commit scopes, resolve the branch base from the upstream merge-base first, then fall back in order to `origin/main`, `origin/master`, `main`, and `master`.
44
+ - If the user asked for commits made by me, review branch-unique commits authored by the resolved identity.
45
+ - If no explicit range, required author identity, or branch base can be resolved, ask the user for the missing value before proceeding.
46
+ - Inspect changed files and diffs from those commits, then tests, fixtures, config, schemas, and prior bug patterns only as needed.
47
+ 7. For codebase area scope:
48
+ - Require a concrete path, module, package, feature area, or glob.
49
+ - If the target area is missing, ask for it before proceeding.
50
+ - Follow the shared retrieval order from `references/codebase-investigation.md` to find production entry points, tests, fixtures, mocks, test commands, and coverage-sensitive config.
51
+ 8. For explicit files/globs, branch comparison, symbol/class/function, feature/flow, or explicitly requested whole-repo scope:
52
+ - Resolve the target with `references/audit-scope.md` and record the resolution method, base/head when relevant, resolved files, exclusions, and freshness timestamp.
53
+ - For symbol/class/function targets, inspect definitions, call paths, behavior contracts, tests, fixtures, mocks, and test commands only as needed.
54
+ - For feature/flow targets, map changed or targeted behavior to existing tests and deterministic harnesses.
55
+ - If whole-repo scope is requested, map major test surfaces first and report skipped depth checks rather than implying exhaustive coverage.
56
+ 9. For implementation parent scope:
57
+ - Accept the exact scope packet from `implementation-audit`; do not broaden beyond resolved files, nearby tests, fixtures, config, and callers needed to verify regression protection.
58
+ - Return compact findings to the parent implementation audit; do not write broad project memories unless explicitly assigned.
59
+ 10. Investigation pass. Dispatch `audit-specialist` per `references/agent-orchestration.md` when the scope justifies an isolated read-only subagent:
60
+
61
+ > **Dispatch: `massa-ai-audit-specialist`** (role: `audit-specialist`) — charter `skills/agents/audit-specialist/SKILL.md`
62
+ > - trigger: large scope, explicit parallel/subagent request, PR subagent invocation, or independent verification of high-impact finding
63
+ > - scope: the tests audit target — test files, fixtures, harnesses, coverage
64
+ > - permissions: read-only
65
+ > - inputs: shared scope packet; `lens: performance` (test coverage is under the performance lens); recalled testing conventions, flaky tests, known regressions
66
+ > - sensors: map behavior to tests; check missing tests for new branches, error paths, async logic, migrations; fixture health, assertion quality, flakiness root-cause
67
+ > - output: findings with missing/weak coverage type, location, evidence, regression risk, severity, simplest test direction, deterministic sensor, verification suggestion
68
+ > - firewall: raw diffs/logs/search output summarized, not returned raw
69
+ > - memory: suggest-only; main agent persists reusable testing patterns
70
+
71
+ - Map changed or targeted behavior to existing tests, fixtures, mocks, and deterministic harnesses.
72
+ - Check missing tests for new branches, error paths, auth/validation/persistence changes, async or race-prone logic, migrations, public contracts, and recalled bug patterns.
73
+ - For mobile scopes, check KMP shared and platform-specific `actual` tests, Android/iOS harnesses, native bridge payload coverage, permissions, lifecycle, offline sync, deep links, push/background flows, UI snapshots/screenshots, device-matrix assumptions, and platform parity claims from `references/mobile-context.md`.
74
+ - Check weak assertions, tests that only assert implementation details, fixture drift, nondeterminism, hidden network/time/filesystem dependencies, skipped tests, and weakened snapshots.
75
+ - For each candidate finding, record the concrete claim, source evidence, impacted behavior, likely regression path, provisional severity, and what would disprove it.
76
+ 11. False-positive pass:
77
+ - Try to disprove every candidate before reporting it.
78
+ - Check existing unit, integration, e2e, contract, snapshot, fixture, and harness coverage; also check framework-generated coverage and accepted exceptions.
79
+ - If a deterministic test command is cheap and in scope, run it as a sensor; if not, report the skipped command and reason.
80
+ - Drop candidates disproven by evidence, downgrade candidates with partial mitigation, and mark low-confidence findings explicitly.
81
+ 12. Severity rules (apply the countable threshold first, then the qualitative clause):
82
+ - `critical`: missing or broken tests around data loss, auth/privacy, migration, deployment-blocking, irreversible corruption risk, OR >10 affected files; otherwise use the qualitative clause below.
83
+ - `high`: missing or weak tests around a core flow, public contract, persistence behavior, validation, security boundary, or severe regression risk.
84
+ - `medium`: missing edge-flow coverage, flaky or nondeterministic test risk, fixture drift, weak assertions, or missing regression coverage around changed logic (<=10 affected files).
85
+ - `low`: minor coverage gap, low-impact assertion hardening, incomplete evidence, or weakly supported concern.
86
+ 13. Final report:
87
+ - Findings first, ordered by severity: `critical`, `high`, `medium`, `low`.
88
+ - Each finding must use `TST-<N>` and include the canonical fields from `references/audit-report-io.md`: severity, confidence, file/line, evidence, impacted behavior, regression risk, simplest test direction, deterministic sensor, and verification suggestion.
89
+ - If no test audit findings are found, say that clearly and list scope checked plus skipped checks.
90
+ - Include ruled-out candidates when they were plausible enough to matter.
91
+ - Include scope checked, deterministic evidence or skipped-check notes, memory outcome, and residual risk.
92
+ - Include the Verification/Test Fidelity Checklist from `references/audit-report-io.md`; tie every `TST-*` finding or no-finding claim to deterministic sensors, commands/artifacts, results, validation assets, or skipped-check reasons. Model judgment alone cannot satisfy verification/testing all-clear.
93
+ - For direct top-level invocation, use the Plan Mode save rule and canonical report contract from `references/audit-report-io.md` for `audits/tests/<YYYY-MM-DD tests-audit>.md`.
94
+ - For implementation audit child invocation, return compact findings to the parent unless the parent explicitly requests saved audit artifacts.
95
+ 14. Persist only durable knowledge:
96
+ - Do not persist one-off findings.
97
+ - Persist repeated test gap patterns, project-specific testing conventions, accepted exceptions, flaky-test patterns, or reusable verification recipes after scoring with the Importance Calibration System.
98
+ - Use required tags: `project:<projectId>`, `session:<workflowSessionId>`, `workflow:tests-audit`, `entity:<entity>`, and one `memory:<tier>` tag.
99
+ 15. Complete the Evidence Gate from `references/evidence-gate.md`.
100
+
101
+ ## Examples
102
+
103
+ User asks: "Find test gaps in modified files."
104
+
105
+ 1. Use `workflowSessionId=test-audit-modified-files`.
106
+ 2. Scope to staged, unstaged, and relevant untracked files; inspect changed behavior before tests.
107
+ 3. Map changed behavior to existing tests and deterministic harnesses.
108
+ 4. Report findings by severity with simplest test direction.
109
+
110
+ User asks: "Audit src/payments test coverage."
111
+
112
+ 1. Use `workflowSessionId=test-audit-payments`.
113
+ 2. Scope to `src/payments`, its tests, fixtures, mocks, config, and public contracts.
114
+ 3. Report missing regression coverage, weak assertions, flaky risks, and skipped checks.
@@ -0,0 +1,96 @@
1
+ ### Tests Fix
2
+
3
+ Use this workflow only to execute fixes from a tests audit markdown report.
4
+
5
+ Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
6
+
7
+ Before the first repository mutation, load `references/implementation-delivery.md` for worktree isolation, atomic commits, PR creation, CI watch, and the merge gate, and `references/code-annotation.md` for doc blocks, rationale comments, and test coverage on every created or updated unit. If two consecutive fix attempts fail on the same symptom, stop editing and load `references/root-cause-scripts.md`.
8
+
9
+ Do not use this workflow for findings-only test coverage, assertion quality, fixture health, flakiness, or regression-risk review; route that to `workflows/tests/tests-audit.md`. Do not use it for generic "write some tests" work without an audit report; route broad test planning through the relevant feature, debug, refactor, or spec-driven workflow.
10
+
11
+ 1. Resolve/reuse `workflowSessionId`: `tests-fix-[entity]`
12
+ 2. Load shared references:
13
+ - `references/audit-report-io.md` before any code or test change
14
+ - `references/lessons.md` to load confirmed project lessons
15
+ - `references/codebase-investigation.md` before changing unfamiliar tests or fixtures
16
+ - `references/mobile-context.md` when the report target touches KMP, iOS, Android, native bridges, mobile lifecycle, offline sync, permissions, local persistence, UI snapshots/screenshots, or backend-mobile contracts
17
+ - `references/verification-ladder.md` before non-trivial edits
18
+ - `references/context-firewall.md` before inspecting large logs, snapshots, generated reports, or broad search output
19
+ - `references/agent-orchestration.md` only for large/high-risk findings, disjoint implementation slices, or independent verification
20
+ 3. `recall` -> load testing conventions, mock boundaries, test frameworks, prior flaky tests, known regressions, accepted exceptions, and reusable verification recipes for the report target.
21
+ 4. Select the tests audit report with execution focus:
22
+ - Establish the report selector, target focus, and optional finding selector before selecting a report. Target focus can be a behavior, flow, module, test suite, files/globs, branch comparison, commit range, symbol/class/function, or explicit whole-repo target.
23
+ - If the user gives a path, read that exact markdown file.
24
+ - If the user asks for "latest" or gives no path, require a concrete target focus first; do not run the latest tests report against an unspecified target.
25
+ - Select the latest `audits/tests/<YYYY-MM-DD tests-audit>.md` only after target focus is known, using `references/audit-report-io.md`.
26
+ - Stop if no report exists; do not infer findings from conversation history.
27
+ - Validate the report with `references/audit-report-io.md`: workflow, `ProjectId`, `Target`, `Target Focus`, scope, git base/head, required fields, `TST-` IDs, resolved files or material scope evidence, and current file/line evidence. Stop on invalid, stale, target-drifted, or ambiguous reports before editing.
28
+ 5. Extract actionable test findings:
29
+ - Keep findings with concrete `Location`, `Evidence`, impacted behavior, regression risk, `Simplest Test Direction`, `Deterministic Sensor`, and `Verification Suggestion`.
30
+ - Ignore ruled-out candidates, no-finding sections, and low-confidence hardening ideas unless the user explicitly asks to include them.
31
+ - If the user supplied finding IDs, extract only those IDs after validating they exist and match the current target focus.
32
+ - Rank by regression risk, severity, dependency order, and determinism.
33
+ 6. Build a coverage execution map before editing:
34
+ - Finding ID -> behavior under test, missing/weak assertion, fixture/mock boundary, deterministic harness, validation asset, expected failure before fix when possible, and verification command.
35
+ - Separate missing coverage, weak assertion, fixture drift, flakiness, skipped test, and missing deterministic sensor findings.
36
+ - For mobile findings, include KMP/shared vs platform-specific boundary, native bridge payload or backend-mobile contract, Android/iOS harness, device matrix or simulator/emulator assumptions, platform parity expectation, and skipped platform checks from `references/mobile-context.md`.
37
+ 7. Size each finding with `references/verification-ladder.md`:
38
+ - Quick: local test addition, assertion strengthening, fixture field correction, or focused skipped-test restoration.
39
+ - Standard: integration harness change, shared fixture/mocking repair, flake root-cause fix, or production seam needed for deterministic testing; define verification recipe first.
40
+ - Spec-driven: test strategy redesign, broad harness migration, unclear behavior contract, or production behavior change beyond enabling deterministic tests; pause and route to `workflows/spec-driven.md` or ask for approval.
41
+ 8. Apply test fixing methods:
42
+ - Missing coverage: write the smallest deterministic test that fails on the risky behavior and passes with correct behavior.
43
+ - Weak assertions: assert externally meaningful behavior, outputs, side effects, persisted state, emitted events, or user-visible contracts rather than implementation details.
44
+ - Fixture drift: repair fixtures/builders to match current contracts while keeping them minimal and explicit.
45
+ - Flakiness: prove root cause first; control time, randomness, async scheduling, filesystem, network, and global state with deterministic seams.
46
+ - Missing sensor: add or document the focused command needed to prove the regression cannot recur.
47
+ - Mobile coverage: prefer KMP/shared tests before device loops when the behavior is shared; use Android/iOS harnesses, bridge contract tests, screenshot/snapshot checks, lifecycle or permission simulations, and parity validation when the report finding requires them.
48
+ 9. Guard validation assets:
49
+ - Never weaken assertions only to make the suite pass.
50
+ - Do not delete coverage, snapshots, fixtures, or benchmarks unless the audit report explicitly calls them obsolete and behavior remains protected elsewhere.
51
+ - Prefer production-code changes only when required to expose a deterministic seam or fix a real bug found while writing the audited test.
52
+ 10. Use strict harness sensors:
53
+ - Never rely on AI subjective evaluation.
54
+ - If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
55
+ `python3 skills/massa-ai/scripts/lessons.py --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
56
+ - Apply the Mandatory Verification Fix Gate from `references/verification-ladder.md`: run the report's Verification Suggestion or an equivalent deterministic command/artifact check for each selected finding or coherent group.
57
+ - Run the actual focused test command first, then broader relevant suites when feasible, such as `rtk yarn test`, `rtk npm test`, `rtk pytest`, or `rtk cargo test`.
58
+ - Continue only when the execution harness returns a clean exit code, or report the exact skipped-check reason.
59
+ - 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.
60
+ - Record command/artifact, result, skipped reason or `none`, highest Verification Ladder level reached, validation assets protected, and residual risk.
61
+ 11. Use agent orchestration only when it improves signal. Dispatch per `references/agent-orchestration.md`:
62
+
63
+ > **Dispatch: `massa-ai-builder`** (role: `builder`) — charter `skills/agents/builder/SKILL.md`
64
+ > - trigger: large/high-risk finding, disjoint implementation slice, or explicit subagent request
65
+ > - scope: one isolated test finding with a disjoint write set
66
+ > - permissions: write (disjoint write set)
67
+ > - inputs: the finding ID, missing/weak coverage type, fixture/mock boundary, deterministic harness, and verification command
68
+ > - sensors: focused test command (`bun test`, `pytest`, `cargo test`) with clean exit code; no weakened assertions
69
+ > - output: implementation summary, test counts, commands run, deviations
70
+ > - firewall: raw test output/logs summarized
71
+ > - memory: suggest-only; main agent persists reusable testing patterns
72
+
73
+ > **Dispatch: `massa-ai-verification-agent`** (role: `verification-agent`) — charter `skills/agents/verification-agent/SKILL.md`
74
+ > - trigger: independent verification of a high-risk test fix
75
+ > - scope: the fixed finding's assertions, fixtures, and report claim closure
76
+ > - permissions: read-only
77
+ > - inputs: the finding, the applied fix, the verification suggestion, and validation assets
78
+ > - sensors: deterministic command (focused test suite, assertion inspection, fixture-not-weakened check) and report claim closure
79
+ > - output: confirmed/disproven closure verdict with evidence
80
+ > - firewall: raw test output/logs summarized
81
+ > - memory: suggest-only; main agent persists reusable verification recipes
82
+ - Main agent owns report parsing, prioritization, memory writes, final synthesis, and Evidence Gate.
83
+ 12. At completion, persist only durable knowledge after scoring with the Importance Calibration System:
84
+ - Testing conventions, deterministic harness recipes, flaky-test root causes, accepted exceptions, or reusable edge-case coverage patterns.
85
+ - Use required tags: `project:<projectId>`, `session:<workflowSessionId>`, `workflow:tests-fix`, `entity:<entity>`, and one `memory:<tier>` tag.
86
+ 13. Complete the Evidence Gate from `references/evidence-gate.md`; do not mark tests complete without a clean deterministic exit code or explicit skipped-check reason.
87
+
88
+ ## Examples
89
+
90
+ User asks: "Use tests-fix to fix latest audit findings for report scheduling."
91
+
92
+ 1. Confirm target focus is `report scheduling`, then read the latest matching `audits/tests/* tests-audit.md`.
93
+ 2. Validate metadata, target focus, freshness, required fields, and current evidence before editing.
94
+ 3. Map each finding to missing coverage, weak assertions, fixture drift, flakiness, or missing sensor work.
95
+ 4. Add or repair deterministic tests without weakening validation assets.
96
+ 5. Run focused tests and report broader skipped checks when needed.
@@ -0,0 +1,82 @@
1
+ ### The Fool
2
+
3
+ Use this workflow for direct requests to challenge ideas, plans, decisions, proposals, architectures, evidence, or assumptions. Also use it as the configured post-plan challenge gate after other massa-ai workflows construct a plan.
4
+
5
+ Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
6
+
7
+ Do not use this workflow to build the initial plan, make the decision, or execute implementation work. It critiques and strengthens existing thinking.
8
+
9
+ ## Configuration
10
+
11
+ Read the canonical **Plan Challenge Policy** from the installed `AGENTS.md`
12
+ bootstrap block (`<!-- massa-ai:bootstrap -->`), whose single source is
13
+ `skills/AGENTS.md` in the product repo. If that
14
+ file is unavailable, use the deterministic runtime fallback: run the lite gate
15
+ with `pre_mortem` mode (do not judgment-select the gate or mode), and revise
16
+ the parent plan when critical or high findings are valid.
17
+
18
+ User prompt overrides take precedence for the current turn only, such as "skip the Fool gate", "use red-team mode", or "append critique without revising the plan".
19
+
20
+ ## Workflow
21
+
22
+ 1. Resolve/reuse context:
23
+ - Direct challenge request: use `workflowSessionId=fool-[entity]`.
24
+ - Post-plan gate: inherit the parent workflow's exact `projectId`,
25
+ `workflowSessionId`, workflow name, entity, and memory context.
26
+ 2. `recall` -> load prior decisions, rejected approaches, constraints, accepted risks, and relevant evidence for the target entity.
27
+ 3. Require a concrete proposed plan before critique. If there is no plan, return to the parent workflow and construct the plan first. After a concrete plan exists, always attempt a read-only `massa-ai-plan-critic` subagent when subagent tooling is available. If that agent is unavailable, follow the no-agent fallback in `references/agent-orchestration.md` (Name Resolution): run the critique locally against the same output contract and report the skipped delegation.
28
+ 4. Resolve gate depth:
29
+ - Post-plan lite gate: keep parent identifiers and dispatch a bounded lite checklist packet without loading The Fool mode references.
30
+ - Post-plan full gate or direct challenge: continue to mode selection and full critique.
31
+ - Direct challenge requests use `workflowSessionId=fool-[entity]`; post-plan gates keep the parent identifiers and send only a bounded packet.
32
+ 5. Lite `massa-ai-plan-critic` packet:
33
+ - Inputs: proposed plan, scope, constraints, parent workflow, compact recalled facts/evidence, known risks, verification recipe, context-firewall limits, and lite checklist.
34
+ - Output must include the strongest low-risk challenges plus `escalate_to_full: true|false` and reason.
35
+ - If `escalate_to_full: false`, synthesize the lite critique, revise or accept risk according to policy, and complete the gate without loading The Fool mode references.
36
+ - If `escalate_to_full: true`, the main agent selects full mode, loads the relevant references, and dispatches a full `massa-ai-plan-critic` pass.
37
+ 6. Select The Fool mode for full gates:
38
+ - `mode: auto`: read `references/the-fool/mode-selection-guide.md` and choose the best mode from plan content and domain.
39
+ - `mode: ask`: ask the user only when interactive input is available; otherwise fall back to `auto` and report the fallback.
40
+ - Concrete mode values map to The Fool references: `pre_mortem`, `red_team`, `evidence_audit`, `socratic`, or `dialectic`.
41
+ - Mode reference map:
42
+ - `pre_mortem` -> `references/the-fool/pre-mortem-analysis.md`
43
+ - `red_team` -> `references/the-fool/red-team-adversarial.md`
44
+ - `evidence_audit` -> `references/the-fool/evidence-audit.md`
45
+ - `socratic` -> `references/the-fool/socratic-questioning.md`
46
+ - `dialectic` -> `references/the-fool/dialectic-synthesis.md`
47
+ 7. Load only the selected The Fool reference plus `references/the-fool/cognitive-bias-inventory.md`.
48
+ 8. Dispatch the full critique:
49
+ - Load `references/agent-orchestration.md`.
50
+ - Use the `plan-critic` contract and capability-packet shape from `references/agent-orchestration.md`; dispatch under `massa-ai-plan-critic`.
51
+ - Send only the proposed plan, scope, constraints, parent workflow, recalled facts, verification recipe, known risks, selected mode, context-firewall limits, and output contract.
52
+ - If subagents are unavailable or platform policy forbids spawning, run a strict standalone fresh-eyes local critique and record the skipped delegation reason.
53
+ - Normal delegation gates in `references/agent-orchestration.md` still apply to other roles, but Plan Challenge `plan-critic` is a standing policy exception after a concrete plan exists.
54
+ 9. Critique output must include:
55
+ - selected mode
56
+ - steelmanned thesis
57
+ - 3-5 strongest challenges
58
+ - severity: `critical`, `high`, `medium`, or `low`
59
+ - affected plan section
60
+ - evidence gap or assumption at risk
61
+ - required revision or accepted-risk framing
62
+ - confidence impact
63
+ - exact next step
64
+ 10. Synthesize using `references/decision-engine.md`:
65
+ - `serious_findings: revise_plan`: revise valid `critical` or `high` findings before presenting the final plan.
66
+ - `serious_findings: append_critique`: keep the plan and attach the critique for user decision.
67
+ - `serious_findings: warn_only`: mention serious risks briefly without restructuring the plan.
68
+ 11. Persist only durable outcomes after recall and scoring:
69
+ - accepted architecture constraints, rejected approaches, durable risk decisions, or reusable critique patterns
70
+ - required tags: `project:<projectId>`, `session:<workflowSessionId>`, `workflow:the-fool` or parent workflow for post-plan gates, `entity:<entity>`, and one `memory:<tier>`
71
+ - skip one-off critique notes and subagent chatter
72
+ 12. Complete the Evidence Gate from `references/evidence-gate.md`.
73
+
74
+ ## Post-Plan Gate Output
75
+
76
+ When used as a gate, the final user-facing plan should not expose raw subagent chatter. Include only the revised plan and a compact note such as:
77
+
78
+ ```md
79
+ Plan Challenge: ran The Fool in pre-mortem mode; revised verification and rollout risks before finalizing.
80
+ ```
81
+
82
+ If the gate is skipped, state why only when it affects confidence, user expectation, or configured behavior.
@@ -0,0 +1,42 @@
1
+ ### Ticket
2
+
3
+ Use this workflow when the user wants to draft, review, create, or resume creation of Jira Epics, standard issues, or sub-tasks. Jira through Atlassian MCP is the only tracker and mutation path. Do not use Jira CLI, browser automation, another tracker, or repository backlog files as fallbacks.
4
+
5
+ Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
6
+
7
+ ## Workflow
8
+
9
+ 1. Resolve or reuse `projectId` and `workflowSessionId=ticket-<entity>`.
10
+ 2. Recall durable project conventions, prior Jira constraints, and ticket-writing decisions through `recall`. Treat recalled facts as leads until confirmed by the user or current Jira metadata.
11
+ 3. Load the focused contracts:
12
+ - `references/ticket/intake-and-sources.md` for ordered questions, reference-ticket isolation, DoR/DoD inputs, and bounded code exploration.
13
+ - `references/ticket/templates-and-quality.md` for title prefixes, built-in templates, decomposition, and draft validation.
14
+ - `references/ticket/atlassian-fix.md` before tool discovery, preflight, approval, Jira creation, resume, or cleanup.
15
+ - `references/context-firewall.md` when Jira, Confluence, supplied files, or exploration output could flood context.
16
+ 4. Discover Atlassian MCP capabilities dynamically. Require readable Jira project metadata and issue-creation capability before promising creation. If Atlassian MCP is missing or read-only, drafting may continue, but stop before approval-to-create and report the unavailable capability. Never substitute a CLI or tracker.
17
+ 5. Run ordered intake from `intake-and-sources.md`. Ask only for information not already supplied or discoverable from Atlassian metadata. Validate the exact project key without silently correcting it.
18
+ 6. When code grounding is useful, run a bounded read-only child pass using `workflows/exploration.md`, then return to the ticket session. Never search Git history, branches, commits, or repository ticket references for ticket examples or templates.
19
+ 7. Inspect the selected Jira project's issue types, required fields, parent rules, and relevant field options before finalizing the draft. A reference ticket controls format and tone only; it does not authorize copying project facts.
20
+ 8. Draft the requested hierarchy using `templates-and-quality.md`. Keep each standard issue independently understandable, use sub-tasks only for atomic work owned by one parent, and make dependencies explicit.
21
+ 9. Search the selected Jira project for potential duplicates using the proposed summary and distinctive scope terms. Record candidates in the review artifact; do not silently merge, skip, or close work.
22
+ 10. Resolve the agent-native external plans directory and create one temporary review file named `ticket-<project>-<slug>-<YYYYMMDDTHHMMSSZ>.md`. The artifact must be outside the repository and contain stable draft IDs, draft revision, approval status, creation order, Jira fields, full descriptions, duplicate candidates, open questions, and created keys or URLs when present.
23
+ 11. Run every deterministic quality gate from `templates-and-quality.md`. Present the current artifact for review. Any content or field revision increments `Draft Revision` and resets `Approval Status` to `NOT APPROVED`.
24
+ 12. Require explicit user approval for the current draft revision before any Jira mutation. Approval of an older revision, generic encouragement, or approval given before the final quality and duplicate checks is invalid.
25
+ 13. Execute the top-down creation contract from `atlassian-fix.md`: Epic first when requested, then standard issues, then sub-tasks. Persist each successful key and URL into the external review artifact before the next create call.
26
+ 14. On partial failure, stop immediately. Retain the artifact, report created and pending draft IDs, and do not delete, transition, comment on, or otherwise compensate Jira issues automatically. Resume only with fresh explicit approval after Jira state and duplicate candidates are re-fetched.
27
+ 15. After complete success, report all created keys and URLs, then delete the temporary review artifact. A cleanup failure does not invalidate Jira creation; report the retained path.
28
+ 16. Persist only durable conventions or reusable Jira constraints after scoring and deduplication. Do not persist raw ticket bodies, customer data, temporary draft state, or one-run creation results to massa-ai.
29
+ 17. Complete `references/evidence-gate.md`, including Atlassian capability used, artifact cleanup result, created issue links, skipped checks, memory outcome, and residual risk.
30
+
31
+ ## Failure Handling
32
+
33
+ - Invalid or inaccessible project key: stop intake at project validation and ask for a valid key; never guess a nearby project.
34
+ - Missing reference ticket or source document: report the failed source and ask whether to retry or use built-in templates.
35
+ - Unsupported requested issue type or required custom field: show the Jira-supported choices and ask only for the blocking selection or value.
36
+ - Missing external plans path or write permission: ask for an external writable path; never write the draft into the repository.
37
+ - Duplicate candidate: present the candidate and require a create, revise, or cancel decision before approval.
38
+ - Jira create ambiguity or timeout: search Jira before retrying. Treat an unknown result as potentially created until disproved.
39
+
40
+ ## Stop Conditions
41
+
42
+ Stop when the user leaves a reviewed draft without approval, cancels the run, Atlassian MCP cannot perform the required action, a blocking field remains unresolved, a partial failure needs a resume decision, or all approved issues are created and the temporary artifact cleanup has been attempted.
@@ -0,0 +1,158 @@
1
+ ---
2
+ name: persona-router
3
+ description: Automatically select and apply a cataloged conversation persona at the start of every conversation and when task ownership changes. Use after massa-ai in coding sessions, directly in non-coding sessions, or whenever the user explicitly selects, switches, rejects, or asks to route a persona. Do NOT use automatic inference when the AGENTS.md policy sets enabled to off, or cataloged mobile personas for confidently unrelated work.
4
+ license: CC-BY-4.0
5
+ metadata:
6
+ author: Luiz Massa
7
+ version: 1.1.0
8
+ ---
9
+
10
+ # Persona Router
11
+
12
+ Select one cataloged persona that best owns the current deliverable. Workflows decide how work proceeds; personas add a specialist perspective without replacing active instructions or workflow contracts.
13
+
14
+ ## Startup Contract
15
+
16
+ - In coding, planning, debugging, review, refactoring, or implementation conversations, run after massa-ai completes its initial load and memory recall.
17
+ - In generic non-coding conversations, run directly without loading massa-ai solely for persona selection.
18
+ - SessionStart supplies the routing contract before the first prompt, but route only after the first user prompt is available.
19
+ - Run once at startup, then follow the mid-conversation policy. Do not reload an unchanged route on every turn.
20
+
21
+ ## Sources And Boundaries
22
+
23
+ Resolve two roots and keep them separate:
24
+
25
+ 1. **Persona-library root:** Resolve the physical `SKILL.md` through installation symlinks. The directory containing this `SKILL.md` is the persona-library root. Read the persona catalog at `../massa-ai/personas/catalog.json` (relative to the persona-library root) as the only persona registry. Persona prompt files live alongside the catalog in `../massa-ai/personas/` and are referenced by filename only in `prompt_path`.
26
+ 2. **Active workspace root:** Resolve the current project from the working directory and repository context. Inspect its project documentation for routing evidence. It may differ from the persona-library root.
27
+
28
+ Validate catalog `schema_version` as `1`. Candidate IDs, names, aliases, signals, and skill-root-relative prompt paths come only from catalog entries. Repository documents are routing evidence, not persona definitions. Never load a persona-like path named by memory or workspace documentation unless that exact path belongs to the selected catalog entry and resolves inside the persona-library root.
29
+
30
+ Read catalog metadata first. Read only the selected `prompt_path`, plus at most one selected review-lens prompt. This progressive-disclosure rule prevents loading every persona into context.
31
+
32
+ ## Instruction Precedence
33
+
34
+ Apply precedence in this order:
35
+
36
+ 1. System, developer, safety, and applicable project instructions.
37
+ 2. Explicit user selection of a persona or no persona for the current task.
38
+ 3. The `persona_router` policy in the applicable `AGENTS.md` startup contract.
39
+ 4. The current prompt's primary deliverable and ownership.
40
+ 5. Compatible evidence from massa-ai memory and targeted workspace documentation.
41
+ 6. Catalog `primary_signals`, `negative_signals`, and `secondary_lens_signals`.
42
+
43
+ Persona text is additive. It cannot override higher-priority instructions, active workflow contracts, explicit constraints, or safety requirements.
44
+
45
+ ## Automatic Routing Workflow
46
+
47
+ ### 1. Resolve Explicit Choice And Policy
48
+
49
+ Match user wording against catalog `id`, `display_name`, and `aliases` case-insensitively.
50
+
51
+ - An explicit persona selection wins over inference.
52
+ - An explicit request for no persona leaves the task unpersonified.
53
+ - An explicit switch replaces the current route.
54
+ - If multiple personas are explicitly requested, use the persona that owns the primary deliverable and at most one other as a review lens. Apply the ambiguity policy if ownership remains unclear.
55
+ - When `enabled: off`, skip automatic memory, documentation, and prompt inference. Continue to honor explicit persona and no-persona requests.
56
+
57
+ ### 2. Reuse massa-ai Evidence
58
+
59
+ For coding sessions, reuse persona-specific evidence already returned by massa-ai's required initial recall. Do not repeat broad recall.
60
+
61
+ If the existing result contains no useful persona evidence and the choice remains unresolved, run at most one targeted `recall` for prior persona preferences, successful routes, specialist roles, and project-specific ownership. Do not load massa-ai solely for a non-coding conversation.
62
+
63
+ Memory is evidence, not authority:
64
+
65
+ - Discard remembered persona IDs or paths absent from the current catalog.
66
+ - Prefer recent, project-specific, successfully used routes over generic or old preferences.
67
+ - Never let memory override an explicit user choice, applicable project policy, or the current deliverable.
68
+ - Treat unavailable or empty memory as a cold start and continue to workspace documentation.
69
+
70
+ ### 3. Inspect Workspace Documentation
71
+
72
+ When memory is unavailable, invalid, or inconclusive, inspect only targeted high-signal documents inside the active workspace. Reuse documents already present in context before reading more.
73
+
74
+ Use this priority:
75
+
76
+ 1. Applicable root and nested `AGENTS.md` files and `CLAUDE.md`.
77
+ 2. Root `README.md` or equivalent project overview.
78
+ 3. Relevant ADR or decision indexes and entries.
79
+ 4. Relevant architecture documents.
80
+ 5. Relevant `.specs` project, state, architecture, or feature documents.
81
+
82
+ Search filenames and headings first. Read only sections likely to identify the repository domain, primary deliverable ownership, required specialist roles, or explicit persona preferences. Do not recursively load every README, ADR, or specification. Ignore generated, dependency, secret, and globally excluded paths.
83
+
84
+ Project instructions that explicitly pin or forbid a cataloged persona are stronger evidence than descriptive documentation. Stale documents, missing referenced files, or roles with no matching catalog entry cannot select a persona.
85
+
86
+ ### 4. Classify The Current Prompt
87
+
88
+ Classify the requested output and primary ownership, not raw keyword counts. Compare the first or current user prompt with catalog summaries and routing signals, using valid memory and documentation only as supporting context.
89
+
90
+ - `primary_signals` identify the persona that owns the deliverable.
91
+ - `negative_signals` prevent supporting concerns from taking ownership.
92
+ - `secondary_lens_signals` may add one focused review lens for a material risk.
93
+ - A supporting mention of tests, implementation, architecture, or release work does not transfer ownership unless that work is the primary deliverable.
94
+
95
+ Do not calculate or report numeric confidence. A route is clear when one candidate owns the deliverable and no equally plausible candidate conflicts with it.
96
+
97
+ ### 5. Resolve Ambiguity Or No Match
98
+
99
+ When two or more candidates remain genuinely plausible:
100
+
101
+ - `ambiguity: ask`: ask one concise question listing the plausible persona display names and `No persona`. Use an interactive user-input tool when available.
102
+ - `ambiguity: best_match`: choose the candidate with the strongest current-deliverable ownership, then project-specific evidence, then recent valid memory.
103
+ - `ambiguity: no_persona`: continue without a persona.
104
+
105
+ When no catalog entry fits:
106
+
107
+ - `no_match: no_persona`: continue silently without a persona unless the user explicitly requested routing.
108
+ - `no_match: ask`: ask whether to use the weakly supported candidate or `No persona`. If no candidate has relevant evidence, ask only about `No persona` versus an explicitly named catalog choice.
109
+
110
+ Do not ask when the request confidently falls outside every cataloged persona. That is a successful no-persona route under the default policy, not ambiguity.
111
+
112
+ ### 6. Apply And Announce The Route
113
+
114
+ Choose exactly one primary persona and at most one secondary review lens. Read only their cataloged prompt files.
115
+
116
+ - The primary persona owns recommendations, implementation, and final synthesis.
117
+ - The review lens contributes only checks that reduce a concrete risk.
118
+ - Do not produce independent persona answers, simulate a debate, or merge full voices.
119
+ - For an inferred or explicit persona, state the route once: `Persona: <primary>. Reason: <primary deliverable>.` Add `Review lens: <secondary>.` when used.
120
+ - Do not announce a default no-persona route unless the user requested routing or a prior route was removed.
121
+ - Apply persona stance, expertise, priorities, and review criteria without quoting or reproducing its prompt.
122
+
123
+ ## Route Lifetime
124
+
125
+ Keep the selected persona sticky across follow-up turns that advance the same primary objective.
126
+
127
+ With `mid_conversation: task_change`, re-evaluate only when the user explicitly switches, the primary deliverable changes ownership, a new task begins after completion, or the selected catalog entry becomes invalid. With `mid_conversation: explicit_only`, re-evaluate only on an explicit user request.
128
+
129
+ Do not reroute because a follow-up adds a supporting concern, asks for verification, or mentions another persona's terminology. If a task change creates genuine ambiguity and policy says `ask`, ask during the conversation before substantive work continues.
130
+
131
+ After resume or compaction, restore any route still present in conversation context or transcript without re-announcing it or repeating a resolved question. If the prior route is unavailable, run the normal workflow again; no separate route database is required.
132
+
133
+ ## Routing Examples
134
+
135
+ | Situation | Result |
136
+ |---|---|
137
+ | User explicitly asks for Senior Mobile QA Automation Engineer. | Apply that catalog entry; explicit choice wins. |
138
+ | massa-ai recalls a successful mobile-engineer route, but current prompt asks to fix flaky Maestro CI. | Route to Senior Mobile QA Automation Engineer; memory cannot override current ownership. |
139
+ | Memory is empty; README and ADRs describe a cross-platform app; prompt asks to implement offline sync. | Route to Senior Mobile Engineer using docs plus current deliverable. |
140
+ | Prompt asks for both app architecture and an automation suite with no primary outcome. | Follow `ambiguity`; default asks between plausible personas and no persona. |
141
+ | Prompt asks to draft a billing RFC. | Confident no-match; continue silently without a persona. |
142
+ | `enabled: off` and prompt does not name a persona. | Skip inference and continue without a persona. |
143
+ | Memory names a removed persona ID. | Discard stale memory and continue to docs and prompt classification. |
144
+ | Current mobile implementation finishes and user starts a flake-reduction task. | With `task_change`, re-evaluate and announce the new route once. |
145
+
146
+ ## Failure Handling
147
+
148
+ - **Catalog missing or invalid:** Report `Persona routing unavailable: <reason>.` Continue without a persona.
149
+ - **Unsupported schema version:** Report the found and supported versions. Continue without a persona.
150
+ - **massa-ai unavailable or empty:** Continue with targeted workspace documentation and the current prompt.
151
+ - **Workspace documentation unavailable:** Route from explicit choice and current prompt; apply ambiguity or no-match policy.
152
+ - **Remembered persona absent from catalog:** Ignore it as stale evidence; never reconstruct it.
153
+ - **Selected prompt missing, outside the persona-library root, or malformed:** Name the catalog entry and path. Continue without a persona; do not silently substitute another persona.
154
+ - **User cannot be asked interactively:** Ask one concise plain-text question when policy requires a choice; otherwise use the configured non-interactive behavior.
155
+
156
+ ## Stop Conditions
157
+
158
+ Routing is complete when one primary persona is applied, the user selects no persona, or policy intentionally produces a no-persona route. Do not invoke a separate model router, launch subagents, create subprocess orchestration, or persist a route database.
@@ -0,0 +1,15 @@
1
+ ---
2
+ description: Show massa-ai health and indexed projects status
3
+ allowed-tools: ["mcp__massa-ai__list_projects", "mcp__massa-ai__analytics"]
4
+ ---
5
+
6
+ Show a health snapshot of the massa-ai installation.
7
+
8
+ 1. Call `mcp__massa-ai__list_projects` with `status=all`.
9
+ 2. Call `mcp__massa-ai__analytics` with `type=summary`.
10
+ 3. Render:
11
+ - A table of workspaces: projectId | status | filesCount | chunksCount | lastIndexedAt
12
+ - Totals: searches performed, unique queries, cache hit rate, top queries
13
+ - Flag anything unusual: a workspace stuck in `indexing`, a workspace in `error`, or cache hit rate below 30%.
14
+
15
+ Keep it dense — one screen.