@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,110 @@
1
+ # Massa-ai Installation And Diagnostics
2
+
3
+ Load this only for installing, configuring, validating, or troubleshooting the
4
+ massa-ai stack. Ordinary workflow routing should use MCP tools instead.
5
+
6
+ ## Install And Upgrade
7
+
8
+ Current recommended installer:
9
+
10
+ ```bash
11
+ curl -fsSL https://raw.githubusercontent.com/luizgmassa/massa-ai/main/install.sh | bash
12
+ ```
13
+
14
+ Interactive modes:
15
+
16
+ | Mode | Requires | Intended use |
17
+ |---|---|---|
18
+ | Docker | Docker | Default production/quick-start path. |
19
+ | Docker build | Docker and Git | Local changes and custom images. |
20
+ | Source | Git and Bun | Development and contribution. |
21
+
22
+ Non-interactive installs may set `MASSA_AI_MODE`, `MASSA_AI_API_PORT`, and
23
+ `MASSA_AI_NO_START`. Review the downloaded script and environment before using the
24
+ one-line installer in sensitive environments.
25
+
26
+ Manual source setup:
27
+
28
+ ```bash
29
+ git clone https://github.com/luizgmassa/massa-ai.git
30
+ cd massa-ai
31
+ bun install
32
+ ./scripts/setup-local-first.sh
33
+ bun run build
34
+ bun run start:api
35
+ ```
36
+
37
+ `setup-local-first.sh` configures Ollama, pulls the embedding model, creates
38
+ defaults, and runs diagnostics. Confirm the selected mode and current upstream
39
+ instructions before upgrades.
40
+
41
+ ## Configuration
42
+
43
+ Relevant settings include:
44
+
45
+ - `DATABASE_URL` and `POSTGRES_PASSWORD` for PostgreSQL/pgvector.
46
+ - Embedding provider, model, dimensions, API key, and provider base URL.
47
+ - `MASSA_AI_API_URL` for MCP/REST clients.
48
+ - `MASSA_AI_API_KEY` for API protection; REST clients send it as `x-api-key`.
49
+ - Search tuning such as `SEARCH_DISABLE_KEYWORD`, `SEARCH_MIN_SCORE`,
50
+ `RRF_KEYWORD_BOOST`, `RRF_VECTOR_WEIGHT`, and
51
+ `RRF_MAX_CHUNKS_PER_FILE`.
52
+ - Synapse toggles including `SYNAPSE_ENABLED` and
53
+ `SYNAPSE_ATTENTION_ENABLED`.
54
+
55
+ Current config CLI:
56
+
57
+ ```bash
58
+ npx @massa-ai/mcp-client --config-show
59
+ npx @massa-ai/mcp-client --config-path
60
+ npx @massa-ai/mcp-client --config-dir
61
+ npx @massa-ai/mcp-client --config-init
62
+ npx @massa-ai/mcp-client --config-set embedding.dimensions 4096
63
+ ```
64
+
65
+ Provider initialization supports Ollama plus `--mistral` and `--openai`
66
+ credentials. Never place provider keys in committed config.
67
+
68
+ Never print, persist, commit, or include API keys in memory or status output.
69
+
70
+ ## Validation And Diagnostics
71
+
72
+ Use the installation's supported CLI diagnostics when present, including
73
+ `bun run diagnose` and current config commands documented upstream. Also check:
74
+
75
+ ```bash
76
+ docker compose ps
77
+ rtk curl -sS http://localhost:3333/health
78
+ rtk curl -sS http://localhost:3333/api/v1/system/status
79
+ rtk curl -sS http://localhost:3333/api/v1/system/health/local
80
+ rtk curl -sS http://localhost:3333/api/v1/system/ollama
81
+ ```
82
+
83
+ Add `x-api-key` for protected deployments without echoing the value. Swagger is
84
+ served at `/swagger`; its machine-readable contract is `/swagger/json`.
85
+
86
+ Swagger response schemas may be empty and its displayed API version may lag the
87
+ package release. Use it to inspect routes/request fields, then verify important
88
+ behavior through MCP declarations and non-destructive runtime probes.
89
+
90
+ ## Deployment Notes
91
+
92
+ - WSL/Linux Docker setups may need `host.docker.internal:host-gateway`.
93
+ - Standard Docker startup should run migrations before the API process.
94
+ - Confirm the embedding provider is reachable from inside the API container.
95
+ - Do not reset vectors, symbols, or memories unless explicit destructive intent
96
+ exists. Prefer normal indexing or the verified full-index fallback.
97
+
98
+ ## Client Integrations
99
+
100
+ - Preferred: `bash scripts/install-agents.sh --agent <host>` — the single writer
101
+ of host MCP config (Claude Code, Claude Desktop, Codex, Cursor, OpenCode).
102
+ Plugin installers call it; nothing else writes an MCP entry.
103
+ - OpenCode: local MCP package via `bunx @massa-ai/mcp-client`, or
104
+ `@massa-ai/opencode-plugin` (which registers tools in-process, so
105
+ `install-agents.sh` skips the MCP entry when that plugin is present).
106
+ - VS Code/Antigravity: `.vscode/mcp.json` or `./scripts/setup-vscode.sh`.
107
+ - Docker: run the `mcp` service through `docker compose run --rm -i mcp`.
108
+
109
+ All MCP clients need the correct `MASSA_AI_API_URL`; protected deployments also
110
+ need `MASSA_AI_API_KEY` in the client environment.
@@ -0,0 +1,119 @@
1
+ # Lessons
2
+
3
+ Use this reference when loading confirmed project lessons during startup, or recording grounded reusable failures after verification, across any workflow that produces verifiable outcomes.
4
+
5
+ ## Artifacts
6
+
7
+ - `.specs/lessons.json` — canonical machine-owned lesson state. Read it; do not hand-edit.
8
+ - `.specs/LESSONS.md` — rendered playbook generated by the script. Read it; do not hand-edit.
9
+ - `skills/massa-ai/scripts/lessons.py` — deterministic bookkeeping script.
10
+
11
+ ## Lesson Signal Table
12
+
13
+ | Signal | Use When | Do Not Use For |
14
+ |---|---|---|
15
+ | `ac_gap` | Acceptance criterion was too vague, missing, or not testable. | One-off user clarification already captured in a spec. |
16
+ | `surviving_mutant` | A discrimination sensor or mutation-style check survived. | A mutation could not run for environmental reasons. |
17
+ | `spec_precision_gap` | Validation could not identify the exact expected value or state. | Implementation bug with a precise existing criterion. |
18
+ | `spec_deviation` | Implementation intentionally diverged from approved spec and needs future prevention. | Unapproved scope expansion that should be reverted now. |
19
+ | `gate_fail` | A deterministic gate failed because the workflow missed a reusable convention. | Transient tool, network, credential, or sandbox failure. |
20
+
21
+ ## Capture
22
+
23
+ After a workflow's verification step finds a concrete reusable signal, record it:
24
+
25
+ ```bash
26
+ python3 skills/massa-ai/scripts/lessons.py --root . add \
27
+ --feature "<feature-slug>" \
28
+ --signal "<ac_gap|surviving_mutant|spec_precision_gap|spec_deviation|gate_fail>" \
29
+ --source "<validation.md source, AC id, file:line, mutant id, or SPEC_DEVIATION ref>" \
30
+ --text "<one terse reusable lesson>" \
31
+ --scope "<optional path/layer/tag>" \
32
+ --project "<projectId>" --session "<workflowSessionId>" \
33
+ --workflow "<active workflow type>" --entity "<entity>"
34
+ ```
35
+
36
+ `--project`/`--session`/`--workflow`/`--entity` carry the active massa-ai
37
+ context onto the lesson so the file store and massa-ai memory stay in the same
38
+ recall namespace. They are optional for manual runs but supplied by the
39
+ continuous-learning hook loop.
40
+
41
+ Do not record one-off tool failures, transient environment issues, methodology opinions, or chat summaries as lessons.
42
+
43
+ ## Distill
44
+
45
+ The script owns IDs, recurrence, candidate promotion, pruning, quarantine, and rendering. Lessons promote only after repeated distinct-feature evidence (default: 2 distinct features). A clean `Pass` with no signal records nothing.
46
+
47
+ Run this self-check after verification: if a failed acceptance criterion, surviving mutant, spec-precision gap, `SPEC_DEVIATION`, or gate failure was found but no lesson was recorded, state the skipped reason.
48
+
49
+ ## Loading
50
+
51
+ During startup of any applicable workflow, load confirmed lessons when `.specs/lessons.json` exists:
52
+
53
+ ```bash
54
+ python3 skills/massa-ai/scripts/lessons.py --root . list --status confirmed [--scope <relevant>]
55
+ ```
56
+
57
+ - Use `--scope` or `--query` to keep the loaded set small.
58
+ - Do not load `candidate` or `quarantined` lessons as guidance.
59
+ - Keep lesson content compact; do not turn it into a parallel memory system.
60
+
61
+ ## Promotion Lifecycle
62
+
63
+ | Status | Condition |
64
+ |---|---|
65
+ | `candidate` | Recorded once from one feature's verification |
66
+ | `confirmed` | Same normalized lesson seen across ≥`promote_threshold` (default 2) distinct features |
67
+ | `quarantined` | A confirmed lesson penalized ≥`quarantine_threshold` times (failed when applied) |
68
+ | **pruned** | A `candidate` that never recurred within `window_days` (default 45) |
69
+
70
+ ## No-Script Fallback
71
+
72
+ If `lessons.py` is unavailable or cannot run, record `Lessons: skipped - script unavailable` in the validation report or evidence gate, keep the raw signal in the report, and do not hand-edit `lessons.json` or `LESSONS.md`. A future run with the script can import the validated signal.
73
+
74
+ ## Continuous-Learning Loop (hook-fed)
75
+
76
+ The lessons layer is a closed loop, not manual-only. Two runtime hooks
77
+ (`scripts/hooks/`, installed for Claude Code by the installer) feed it:
78
+
79
+ 1. **observe** — `observe_runner.py` (PostToolUse) captures raw tool-use
80
+ observations into the gitignored `.specs/observations.json` buffer. Grounding
81
+ is NOT assigned here.
82
+ 2. **evaluate** — `continuous_learning_evaluate.py` (Stop) reads the active
83
+ massa-ai context from `.specs/project/STATE.md` and the observations
84
+ buffer. For each observation that already carries grounded fields
85
+ (`signal`, `text`, `source`, `feature`), it calls `lessons.py add` with the
86
+ `--project`/`--session`/`--workflow`/`--entity` context. Ungrounded
87
+ observations are left in the buffer for agent input and logged as skipped.
88
+
89
+ ### massa-ai Dual-Write
90
+
91
+ `lessons.py add` and `import` best-effort write massa-ai memory so the file store
92
+ and durable memory stay consistent:
93
+
94
+ - **type** is always `pattern` (lessons are procedural knowledge). `procedural`
95
+ is a **tag**, never a type (references/mcp-tools.md).
96
+ - **tags** carry the full massa-ai persistence contract: `project:<id>`,
97
+ `session:<workflowSessionId>`, `workflow:<type>`, `entity:<name>`,
98
+ `memory:procedural`. This puts lessons in the same recall namespace as
99
+ massa-ai decisions/patterns, so future `recall` surfaces them at
100
+ Specify/Design.
101
+ - massa-ai MCP is agent-side only; the hook/CLI subprocess writes via REST
102
+ (`MASSA_AI_API_URL`). When REST is unavailable, the lesson still lands in
103
+ `lessons.json` and the skipped memory write is logged (graceful degradation).
104
+
105
+ ### Round-Trip
106
+
107
+ ```bash
108
+ python3 skills/massa-ai/scripts/lessons.py --root . export --out lessons.export.json
109
+ python3 skills/massa-ai/scripts/lessons.py --root . import --in lessons.export.json
110
+ ```
111
+
112
+ `export`/`import` round-trip the file store; `import` re-emits massa-ai memory
113
+ best-effort. An ungrounded lesson is refused by both `add` and the massa-ai write.
114
+
115
+ ### Self-Check
116
+
117
+ After verification: if a reusable signal was found but no lesson was recorded,
118
+ state the skipped reason. The hook loop logs every skip to
119
+ `scripts/hooks-state/skip.log`.
@@ -0,0 +1,69 @@
1
+ # Maestro Artifacts And Reports Reference
2
+
3
+ Use this when running, auditing, or fixing flows that need report paths, artifact directories, screenshots, videos, debug output, or recording.
4
+
5
+ ## Reports
6
+
7
+ Report generation is CLI-dependent. Use `--format` and `--output`; do not put report generation in `config.yaml`.
8
+
9
+ Supported report formats from current official docs/live help:
10
+
11
+ - `junit`
12
+ - `html`
13
+ - `html-detailed` when supported by current CLI help
14
+ - `noop`/default no report when no format is selected
15
+
16
+ JUnit reports default to `report.xml` in the current working directory when `--output` is omitted. Prefer explicit report paths in CI.
17
+
18
+ ```bash
19
+ maestro test --format junit --output build/maestro/report.xml .maestro
20
+ ```
21
+
22
+ ## Artifact Directories
23
+
24
+ `--test-output-dir` captures screenshots, videos, `commands-*.json`, and AI report files. `--debug-output` captures `maestro.log` and debug-oriented output.
25
+
26
+ If both flags point to the same directory, artifacts consolidate there. If they differ, `maestro.log` stays in `--debug-output` while screenshots/videos/commands/AI reports stay in `--test-output-dir`.
27
+
28
+ ```bash
29
+ maestro test \
30
+ --format junit \
31
+ --output build/maestro/report.xml \
32
+ --test-output-dir build/maestro/artifacts \
33
+ --debug-output build/maestro/debug \
34
+ .maestro
35
+ ```
36
+
37
+ ## Common Artifact Fields
38
+
39
+ Record these in audit/fix reports and closure summaries:
40
+
41
+ - command
42
+ - exit status
43
+ - JUnit or HTML report path
44
+ - artifact directory
45
+ - debug output directory
46
+ - `maestro.log` path when JS logging matters
47
+ - `commands-*.json` presence or absence
48
+ - screenshots/videos presence or absence
49
+ - AI report path when `--analyze` or AI commands run
50
+ - device/platform/app build/flavor
51
+ - skipped-check reason
52
+
53
+ ## Recording
54
+
55
+ Use `maestro record --local` when a local MP4 recording is requested. Current official docs/live help mark local rendering as beta and restrict the optional output file to local rendering.
56
+
57
+ ```bash
58
+ maestro record --local flows/checkout.yaml build/maestro/checkout.mp4
59
+ ```
60
+
61
+ Remote recording behavior is not a normative contract here. Prefer `--local` for privacy and repeatability unless repository convention says otherwise.
62
+
63
+ ## AI Reports
64
+
65
+ AI analysis via `maestro test --analyze` and AI assertion commands is experimental and Cloud-auth-backed. It can produce HTML/JSON insight reports in artifacts. Do not replace missing AI execution with model self-evaluation.
66
+
67
+ ## No-Coverage Rule
68
+
69
+ A passing flow proves the flow's selected path on the selected device/platform. It does not prove full scenario coverage, Figma parity, accessibility compliance, or absence of app bugs unless those claims have separate deterministic evidence.
@@ -0,0 +1,65 @@
1
+ # Maestro CLI And Device Reference
2
+
3
+ Use this for CLI preflight, local command syntax, device/platform readiness, and local execution constraints.
4
+
5
+ ## Mandatory Preflight
6
+
7
+ Before tracked Maestro flow edits, executable audit runs, or `MST-*` fixes:
8
+
9
+ 1. Run `command -v maestro`.
10
+ 2. Run `maestro --version` or `maestro --help`.
11
+ 3. Run relevant subcommand help for the surface: `maestro test --help`, `maestro cloud --help`, `maestro record --help`, or MCP startup/help.
12
+ 4. Check device/emulator readiness through repository convention when one exists; otherwise record `device-readiness: not available` with reason.
13
+
14
+ Required transcript fields: command, exit code, stdout summary, stderr summary. If `maestro --version` or `maestro --help` fails, block mutation and executable audit/fix runs; do not install or repair Maestro automatically.
15
+
16
+ ## CLI Shape
17
+
18
+ Official CLI pattern: `maestro [options] [subcommand] [subcommand options]`.
19
+
20
+ Global options include `--[no-]ansi`, `--[no-]color`, `--device`/`--udid`, `--platform`, `--verbose`, `--version`, and `--help`. Prefer putting global `--device` before the subcommand for clarity, while noting live `maestro test --help` may also expose `--device`.
21
+
22
+ Current official subcommands include `test`, `cloud`, `record`, `download-samples`, `login`, `logout`, `start-device`, `list-devices`, `list-cloud-devices`, `chat`, `bugreport`, `driver-setup`, and `mcp`. Treat subcommands visible only in live help, such as `hierarchy`, as `live-help` unless official docs also list them. Treat `maestro query` as `excluded/unverified` unless official docs or live help confirms it in the active environment.
23
+
24
+ ## `maestro test`
25
+
26
+ Use for local simulator/emulator/device/web execution.
27
+
28
+ Important options from official docs/live help:
29
+
30
+ - `--config=<configFile>`: workspace config override.
31
+ - `-e`, `--env=<Key=Value>`: inject flow variables.
32
+ - `--include-tags` and `--exclude-tags`: run or remove flows by tag filters.
33
+ - `--format=<format>` and `--output=<path>`: report generation and report path.
34
+ - `--test-output-dir=<dir>`: screenshots, videos, command JSON, and AI report artifacts.
35
+ - `--debug-output=<dir>`: `maestro.log` and debug outputs.
36
+ - `--flatten-debug-output`: CI-friendly debug output layout.
37
+ - `--headless` and `--screen-size`: web-only.
38
+ - `--shards`, `--shard-all`, `--shard-split`: local sharding/parallel distribution across connected devices.
39
+ - `--test-suite-name`: report suite name.
40
+ - `--device`/`--udid` and `--platform`: target selection.
41
+ - `--analyze`: beta AI analysis, requiring Maestro Cloud-backed authentication.
42
+
43
+ Do not document unsupported aliases such as `--flavor`, singular `--shard`, or generic `--debug` as valid unless current live help confirms them. Use `--debug-output`, `--shards`, `--shard-all`, or `--shard-split` instead when supported.
44
+
45
+ ## Device And Platform Readiness
46
+
47
+ Official platform support:
48
+
49
+ - Android: emulators and physical devices; physical devices need USB debugging; app must already be installed.
50
+ - iOS: Xcode-managed simulators; target app uses Bundle ID and simulator-compatible `.app`.
51
+ - Web: beta support for Chromium-based browser automation; web flows use `url` instead of `appId`.
52
+
53
+ For local sharding, require explicit device inventory before planning parallel local runs. Do not claim exact failure behavior for device-count mismatch unless a live run, official docs, or repo convention proves it.
54
+
55
+ If a WSL caveat matters, verify it against official docs or repository convention first. Otherwise record WSL details as `excluded/unverified`.
56
+
57
+ ## Execution Command Template
58
+
59
+ Prefer repository-specific wrappers when present. Otherwise use explicit outputs:
60
+
61
+ ```bash
62
+ maestro test --format junit --output <report.xml> --test-output-dir <artifact-dir> <flow-or-directory>
63
+ ```
64
+
65
+ Add `--debug-output <debug-dir>` when JavaScript logging or `maestro.log` is needed. Use `--no-ansi` in CI when supported by current CLI help or repo convention.
@@ -0,0 +1,67 @@
1
+ # Maestro Cloud Reference
2
+
3
+ Use this only when a Maestro task touches Cloud execution, CI upload, Cloud devices, Cloud-auth-backed AI, or app binary reuse.
4
+
5
+ ## Cloud Command
6
+
7
+ Maestro Cloud uses the normal Maestro CLI `cloud` subcommand, not a separate Cloud CLI.
8
+
9
+ Prefer named parameters:
10
+
11
+ ```bash
12
+ maestro cloud \
13
+ --app-file app/build/outputs/apk/debug/app-debug.apk \
14
+ --flows .maestro \
15
+ --format junit \
16
+ --output build/maestro/cloud-report.xml
17
+ ```
18
+
19
+ Named parameters such as `--app-file` and `--flows` can appear in any order and are safer for CI scripts than positional arguments.
20
+
21
+ ## Auth And Plan Requirements
22
+
23
+ - Cloud test execution requires Maestro Cloud access and a Cloud plan.
24
+ - Cloud CLI calls need API key/login/project configuration according to repo convention.
25
+ - AI commands and `maestro test --analyze` are Cloud-infrastructure-backed but can be enabled with a free account; do not confuse that with Cloud device execution plan requirements.
26
+
27
+ Never commit API keys. Use `maestro login`, `MAESTRO_CLOUD_API_KEY`, or CI secrets according to repository policy.
28
+
29
+ ## App Binary Eligibility
30
+
31
+ Android Cloud requirements:
32
+
33
+ - Upload APK, not AAB.
34
+ - APK must be ARM-compatible or multi-architecture; x86-only APKs fail in Cloud.
35
+ - Debug and release builds are supported.
36
+
37
+ iOS Cloud requirements:
38
+
39
+ - Upload `.app` bundle.
40
+ - Build for iOS Simulator, not physical iOS devices.
41
+
42
+ Project-specific build steps are authoritative. Check README, build scripts, and CI before inventing build commands.
43
+
44
+ ## Reuse And Device Selection
45
+
46
+ Use `--app-binary-id` to reuse a previously uploaded binary when official docs/repo convention expose the ID.
47
+
48
+ Cloud device flags:
49
+
50
+ - `--device-model`
51
+ - `--device-os`
52
+ - `--device-locale`
53
+ - `maestro list-cloud-devices` for supported pairs
54
+
55
+ Do not hardcode model/OS values unless requested or repo convention fixes them.
56
+
57
+ ## Cloud Limits
58
+
59
+ Official Cloud limit: 15-minute soft execution limit per test execution. After that, a test may be stopped at any time. Split long suites into smaller, parallelizable flows.
60
+
61
+ ## Cloud Output And Async
62
+
63
+ `maestro cloud` can block until analyses complete by default; current live help exposes `--async` to submit and exit immediately. Record upload/dashboard output when available, but do not invent dashboard polling schemas unless official docs, live MCP metadata, or repo convention provides them.
64
+
65
+ ## Cloud Boundary
66
+
67
+ Use Cloud for hosted device execution, device matrix coverage, PR checks, and Cloud-only platform settings. Keep local CLI checks, static YAML checks, and repository validation as separate evidence.
@@ -0,0 +1,76 @@
1
+ # Maestro Config, Env, And Output Boundaries
2
+
3
+ Use this when deciding whether a fact belongs in a Flow header, `config.yaml`, CLI invocation, report metadata, or artifact output.
4
+
5
+ ## Boundary Matrix
6
+
7
+ | Surface | Owns | Does not own |
8
+ |---|---|---|
9
+ | Flow header | `appId` or `url`, `name`, `tags`, `env`, hooks, JUnit `properties` | Workspace discovery policy for all flows |
10
+ | `config.yaml` | `flows`, `testOutputDir`, global tags, `executionOrder`, platform config, Cloud notifications/baseline | JUnit/HTML report generation |
11
+ | CLI flags | `--env`, `--config`, `--format`, `--output`, `--test-output-dir`, `--debug-output`, tag overrides, device/platform | Persistent source truth |
12
+ | Report file | JUnit/HTML result selected by `--format` and `--output` | Screenshots/videos/debug logs by default |
13
+ | Artifact dirs | screenshots, videos, `commands-*.json`, AI reports, and optionally `maestro.log` | Test result XML unless explicitly written there by `--output` |
14
+
15
+ ## Flow Header Fields
16
+
17
+ ```yaml
18
+ appId: com.example.app
19
+ name: Checkout Critical Path
20
+ tags:
21
+ - smoke
22
+ env:
23
+ REGION: us
24
+ onFlowStart:
25
+ - runFlow: setup/user.yaml
26
+ onFlowComplete:
27
+ - runFlow: cleanup/user.yaml
28
+ properties:
29
+ junitId: TC-CHECKOUT-001
30
+ junitClassname: com.example.CheckoutE2E
31
+ ---
32
+ - launchApp
33
+ ```
34
+
35
+ Use `properties` for JUnit metadata. `junitId` and `junitClassname` are reserved report attributes; other properties are emitted as JUnit properties.
36
+
37
+ ## Env Injection
38
+
39
+ Pass runtime values through CLI or flow/subflow/script env:
40
+
41
+ ```bash
42
+ maestro test -e APP_ID=com.example.android -e USER_KIND=admin flows/login.yaml
43
+ ```
44
+
45
+ ```yaml
46
+ - runFlow:
47
+ file: login.yaml
48
+ env:
49
+ USER_KIND: admin
50
+ - runScript:
51
+ file: setupUser.js
52
+ env:
53
+ role: admin
54
+ ```
55
+
56
+ Do not hardcode secrets in YAML. Use repo-approved secret injection, Maestro Cloud secrets, or CI environment variables.
57
+
58
+ ## Output Rules
59
+
60
+ - `--format junit --output <path>` creates CI-readable JUnit XML.
61
+ - `--format html` or `--format html-detailed` creates HTML reports.
62
+ - `--test-output-dir` stores screenshots, videos, `commands-*.json`, and AI reports.
63
+ - `--debug-output` stores `maestro.log`; when same as `--test-output-dir`, outputs consolidate.
64
+ - config.yaml cannot configure report generation; it can configure `testOutputDir`.
65
+
66
+ ## Closure Evidence
67
+
68
+ Every Maestro closure should include:
69
+
70
+ - command and exit status
71
+ - report format and report path
72
+ - `--test-output-dir`
73
+ - `--debug-output` when used or skipped reason
74
+ - app/platform/device
75
+ - environment source, with secrets redacted
76
+ - validation assets protected
@@ -0,0 +1,71 @@
1
+ # Maestro Fact Ledger
2
+
3
+ Use this before making Maestro claims. It defines source authority, fact tags, local transcript requirements, and quarantine rules for unsupported checklist items.
4
+
5
+ ## Authority Order
6
+
7
+ 1. `official-doc`: current official Maestro documentation, preferably `.md` pages under `https://docs.maestro.dev/`.
8
+ 2. `live-help`: successful local CLI transcript from the installed Maestro binary, including command, exit code, stdout, and stderr.
9
+ 3. `repo-convention`: current repository flows, config, CI, scripts, report paths, and existing naming/tag patterns.
10
+ 4. `excluded/unverified`: NotebookLM answers, `/Users/luizmassa/Downloads/questions.md`, blog posts, memory, or assumptions that are not confirmed by the first three sources.
11
+
12
+ If sources conflict, prefer `official-doc` for product behavior and `live-help` for installed CLI syntax. Mention version drift when `live-help` differs from docs.
13
+
14
+ ## Fact Tag Rules
15
+
16
+ Every normative statement in Maestro workflows, reports, or implementation notes must carry a source class in the agent's working notes:
17
+
18
+ - `official-doc`: cite the page URL or title.
19
+ - `live-help`: include command, exit code, stdout summary, stderr summary, and Maestro version when available.
20
+ - `repo-convention`: cite local path or command evidence.
21
+ - `excluded/unverified`: name the unsupported claim and do not use it as a requirement, fix direction, or verification gate.
22
+
23
+ Do not copy long transcripts into final reports. Summarize exact evidence and keep raw logs behind context-firewall boundaries.
24
+
25
+ ## Required Live CLI Transcript Gate
26
+
27
+ Before using a live CLI fact, capture:
28
+
29
+ | Probe | Required evidence |
30
+ |---|---|
31
+ | `command -v maestro` | command, exit code, stdout path, stderr |
32
+ | `maestro --version` | command, exit code, stdout version, stderr |
33
+ | `maestro --help` | command, exit code, stdout subcommand/global option summary, stderr |
34
+ | Relevant subcommand help | command, exit code, stdout option summary, stderr |
35
+
36
+ Run relevant subcommand help for the surface in use: `maestro test --help`, `maestro cloud --help`, `maestro record --help`, `maestro mcp` or supported MCP help shape, and any repo-specific command wrapper.
37
+
38
+ If PATH cannot resolve `maestro`, mark local CLI validation blocked. If the binary exists but cannot start, record the failure and avoid claiming executable readiness. Do not install Maestro automatically.
39
+
40
+ ## Coverage Checklist Handling
41
+
42
+ Use `/Users/luizmassa/Downloads/questions.md` as a checklist to ask "did we cover this surface?" Never cite it as source truth.
43
+
44
+ Checklist-only facts that must stay non-normative unless independently verified:
45
+
46
+ - `maestro query` as a CLI subcommand.
47
+ - Dashboard polling URL or API response shape not found in official docs or Maestro MCP tool metadata.
48
+ - Unsupported flags such as `--flavor`, singular `--shard`, generic `--debug`, or non-web `--headless` when current docs/live help do not support them.
49
+ - Obsolete BYO AI guidance such as `MAESTRO_CLI_AI_KEY` or `MAESTRO_CLI_AI_MODEL`.
50
+ - WSL-specific caveats unless official docs or repo convention explicitly establish them for the target project.
51
+
52
+ ## Current Source Anchors
53
+
54
+ Use these pages first:
55
+
56
+ - CLI command matrix: https://docs.maestro.dev/maestro-cli/maestro-cli-commands-and-options.md
57
+ - YAML commands: https://docs.maestro.dev/reference/commands-available.md
58
+ - Selectors: https://docs.maestro.dev/reference/selectors.md
59
+ - Workspace config: https://docs.maestro.dev/reference/workspace-configuration.md
60
+ - Reports/artifacts: https://docs.maestro.dev/maestro-flows/workspace-management/test-reports-and-artifacts.md
61
+ - JavaScript: https://docs.maestro.dev/maestro-flows/javascript/run-and-debug-javascript.md
62
+ - Cloud build: https://docs.maestro.dev/maestro-cloud/build-your-app-for-the-cloud.md
63
+ - Cloud limits: https://docs.maestro.dev/maestro-cloud/limits.md
64
+ - MCP: https://docs.maestro.dev/get-started/maestro-mcp.md
65
+
66
+ ## Failure Handling
67
+
68
+ - Missing official page: use the docs query interface or `llms.txt`; otherwise tag the fact `excluded/unverified`.
69
+ - Live help blocked by sandbox or permissions: retry only when allowed, then record blocked reason and proceed with official-doc facts only.
70
+ - Repo has no Maestro flows: ask for the target test root before creating one.
71
+ - Repo convention conflicts with official docs: preserve repo behavior for existing suites, but do not generalize it beyond that repository without a source tag.
@@ -0,0 +1,70 @@
1
+ # Maestro JavaScript Reference
2
+
3
+ Use this for `evalScript`, `runScript`, inline expressions, generated data, shared state, and JavaScript logging.
4
+
5
+ ## Execution Methods
6
+
7
+ Maestro supports three JavaScript paths:
8
+
9
+ 1. Inline `${...}` expressions inside YAML command values.
10
+ 2. `evalScript` for short logic-only steps.
11
+ 3. `runScript` for external `.js` files with reusable or complex logic.
12
+
13
+ ```yaml
14
+ - inputText: ${'User_' + faker.name().firstName()}
15
+ - evalScript: ${output.timestamp = new Date().getTime()}
16
+ - runScript:
17
+ file: setupUser.js
18
+ env:
19
+ role: admin
20
+ ```
21
+
22
+ ## Shared State
23
+
24
+ Use `output` for data shared between scripts and later flow steps.
25
+
26
+ ```yaml
27
+ - evalScript: ${output.email = 'qa_' + Date.now() + '@example.com'}
28
+ - inputText: ${output.email}
29
+ ```
30
+
31
+ Keep output values small and non-secret. Do not put tokens, raw PII, or credentials into logs or artifact reports.
32
+
33
+ ## Script Env
34
+
35
+ ```yaml
36
+ - runScript:
37
+ file: setupUser.js
38
+ env:
39
+ userRole: admin
40
+ ```
41
+
42
+ ```javascript
43
+ const role = userRole;
44
+ console.log('Setting up role: ' + role);
45
+ ```
46
+
47
+ ## Logging
48
+
49
+ `console.log` output is captured in `maestro.log` with a JavaScript console prefix. `maestro.log` belongs to `--debug-output`, not `--test-output-dir`, unless both flags point at the same directory.
50
+
51
+ Limitations from official docs:
52
+
53
+ - Multiple `console.log` arguments are not supported; concatenate or use template literals in external files.
54
+ - Template literals do not work inside `evalScript` the way they do in external `.js` files because `evalScript` already uses `${...}` syntax.
55
+
56
+ ```yaml
57
+ - evalScript: '${console.log("Value: " + output.email)}'
58
+ ```
59
+
60
+ ## When To Use JS
61
+
62
+ Use JS for:
63
+
64
+ - generated test data
65
+ - lightweight derived values
66
+ - setup/teardown API calls when the repo already permits them
67
+ - assertions via `assertTrue`
68
+ - reusable selector constants when the repository has that convention
69
+
70
+ Avoid JS when a native Maestro command is clearer. Keep helpers deterministic and committed with the flow when they are part of the test contract.