@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.
- package/.cursor-plugin/plugin.json +5 -0
- package/README.md +87 -0
- package/agents/massa-ai-architecture-specialist.md +65 -0
- package/agents/massa-ai-audit-specialist.md +81 -0
- package/agents/massa-ai-builder.md +67 -0
- package/agents/massa-ai-context-curator.md +67 -0
- package/agents/massa-ai-documentation-agent.md +65 -0
- package/agents/massa-ai-furps-analyst.md +71 -0
- package/agents/massa-ai-investigator.md +68 -0
- package/agents/massa-ai-mobile-specialist.md +82 -0
- package/agents/massa-ai-navigator.md +75 -0
- package/agents/massa-ai-plan-critic.md +90 -0
- package/agents/massa-ai-planner.md +65 -0
- package/agents/massa-ai-requirements-analyst.md +64 -0
- package/agents/massa-ai-reviewer.md +66 -0
- package/agents/massa-ai-test-engineer.md +66 -0
- package/agents/massa-ai-verification-agent.md +65 -0
- package/hooks/hooks.json +26 -0
- package/hooks/massa-ai-hook +298 -0
- package/install.sh +413 -0
- package/package.json +30 -0
- package/skills/agents/architecture-specialist/SKILL.md +69 -0
- package/skills/agents/audit-specialist/SKILL.md +85 -0
- package/skills/agents/builder/SKILL.md +71 -0
- package/skills/agents/context-curator/SKILL.md +71 -0
- package/skills/agents/documentation-agent/SKILL.md +69 -0
- package/skills/agents/furps-analyst/SKILL.md +74 -0
- package/skills/agents/investigator/SKILL.md +72 -0
- package/skills/agents/mobile-specialist/SKILL.md +86 -0
- package/skills/agents/navigator/SKILL.md +79 -0
- package/skills/agents/plan-critic/SKILL.md +93 -0
- package/skills/agents/planner/SKILL.md +69 -0
- package/skills/agents/requirements-analyst/SKILL.md +68 -0
- package/skills/agents/reviewer/SKILL.md +70 -0
- package/skills/agents/test-engineer/SKILL.md +70 -0
- package/skills/agents/verification-agent/SKILL.md +69 -0
- package/skills/def/SKILL.md +17 -0
- package/skills/find/SKILL.md +19 -0
- package/skills/graph/SKILL.md +16 -0
- package/skills/index/SKILL.md +19 -0
- package/skills/map/SKILL.md +24 -0
- package/skills/massa-ai/SKILL.md +315 -0
- package/skills/massa-ai/personas/README.md +35 -0
- package/skills/massa-ai/personas/ai-native-nodejs-cli-architect.md +76 -0
- package/skills/massa-ai/personas/catalog.json +157 -0
- package/skills/massa-ai/personas/context-skill-harness-engineer-architect.md +74 -0
- package/skills/massa-ai/personas/product-manager.md +67 -0
- package/skills/massa-ai/personas/senior-mobile-engineer.md +74 -0
- package/skills/massa-ai/personas/senior-mobile-qa-automation-engineer.md +75 -0
- package/skills/massa-ai/references/adr-authoring.md +189 -0
- package/skills/massa-ai/references/agent-orchestration.md +221 -0
- package/skills/massa-ai/references/architecture-coupling-lens.md +239 -0
- package/skills/massa-ai/references/architecture-deepening-lens.md +136 -0
- package/skills/massa-ai/references/architecture-domain-lens.md +186 -0
- package/skills/massa-ai/references/architecture-lenses.md +108 -0
- package/skills/massa-ai/references/audit-report-io.md +459 -0
- package/skills/massa-ai/references/audit-scope.md +103 -0
- package/skills/massa-ai/references/code-annotation.md +111 -0
- package/skills/massa-ai/references/codebase-investigation.md +96 -0
- package/skills/massa-ai/references/context-firewall.md +62 -0
- package/skills/massa-ai/references/conversation-feedback.md +104 -0
- package/skills/massa-ai/references/debug-diagnosis-loop.md +140 -0
- package/skills/massa-ai/references/decision-engine.md +73 -0
- package/skills/massa-ai/references/evidence-gate.md +53 -0
- package/skills/massa-ai/references/furps/analyst-role.md +49 -0
- package/skills/massa-ai/references/furps/checklist.md +92 -0
- package/skills/massa-ai/references/furps/intake.md +104 -0
- package/skills/massa-ai/references/furps/report-contract.md +140 -0
- package/skills/massa-ai/references/hook-enforcement.md +137 -0
- package/skills/massa-ai/references/implementation-delivery.md +101 -0
- package/skills/massa-ai/references/installation.md +110 -0
- package/skills/massa-ai/references/lessons.md +119 -0
- package/skills/massa-ai/references/maestro/artifacts-reports.md +69 -0
- package/skills/massa-ai/references/maestro/cli-device.md +65 -0
- package/skills/massa-ai/references/maestro/cloud.md +67 -0
- package/skills/massa-ai/references/maestro/config-env-output.md +76 -0
- package/skills/massa-ai/references/maestro/fact-ledger.md +71 -0
- package/skills/massa-ai/references/maestro/js-scripting.md +70 -0
- package/skills/massa-ai/references/maestro/mcp.md +59 -0
- package/skills/massa-ai/references/maestro/patterns.md +96 -0
- package/skills/massa-ai/references/maestro/selectors.md +91 -0
- package/skills/massa-ai/references/maestro/workspace-execution.md +81 -0
- package/skills/massa-ai/references/maestro/yaml-commands.md +203 -0
- package/skills/massa-ai/references/maestro.md +47 -0
- package/skills/massa-ai/references/mcp-tools.md +296 -0
- package/skills/massa-ai/references/memory-policy.md +103 -0
- package/skills/massa-ai/references/mobile-context.md +113 -0
- package/skills/massa-ai/references/mobile-diagnosis.md +106 -0
- package/skills/massa-ai/references/mobile-figma-matcher/ATTRIBUTION.md +5 -0
- package/skills/massa-ai/references/mobile-figma-matcher/android-compose.md +13 -0
- package/skills/massa-ai/references/mobile-figma-matcher/android-views.md +13 -0
- package/skills/massa-ai/references/mobile-figma-matcher/core.md +117 -0
- package/skills/massa-ai/references/mobile-figma-matcher/ios-swiftui.md +12 -0
- package/skills/massa-ai/references/mobile-figma-matcher/ios-uikit.md +12 -0
- package/skills/massa-ai/references/mobile-figma-matcher/kmp-compose-multiplatform.md +14 -0
- package/skills/massa-ai/references/mobile-figma-matcher/repository-detection.md +77 -0
- package/skills/massa-ai/references/naming-standards.md +47 -0
- package/skills/massa-ai/references/pr-task-fix.md +80 -0
- package/skills/massa-ai/references/project-context.md +76 -0
- package/skills/massa-ai/references/rfc/ATTRIBUTION.md +5 -0
- package/skills/massa-ai/references/rfc/discovery-and-sizing.md +120 -0
- package/skills/massa-ai/references/rfc/document-contract.md +85 -0
- package/skills/massa-ai/references/rfc/quality-and-lifecycle.md +101 -0
- package/skills/massa-ai/references/root-cause-scripts.md +97 -0
- package/skills/massa-ai/references/spec-driven/artifact-store.md +98 -0
- package/skills/massa-ai/references/spec-driven/code-analysis.md +119 -0
- package/skills/massa-ai/references/spec-driven/coding-principles.md +80 -0
- package/skills/massa-ai/references/spec-driven/context-limits.md +64 -0
- package/skills/massa-ai/references/spec-driven/design.md +257 -0
- package/skills/massa-ai/references/spec-driven/discuss.md +182 -0
- package/skills/massa-ai/references/spec-driven/execute.md +471 -0
- package/skills/massa-ai/references/spec-driven/lessons.md +5 -0
- package/skills/massa-ai/references/spec-driven/memory.md +214 -0
- package/skills/massa-ai/references/spec-driven/specify.md +283 -0
- package/skills/massa-ai/references/spec-driven/sub-agents.md +151 -0
- package/skills/massa-ai/references/spec-driven/tasks.md +494 -0
- package/skills/massa-ai/references/spec-driven/validate.md +397 -0
- package/skills/massa-ai/references/subagent-design.md +132 -0
- package/skills/massa-ai/references/synapse-policy.md +160 -0
- package/skills/massa-ai/references/tdd/calibrated-examples.md +54 -0
- package/skills/massa-ai/references/tdd/discovery-and-sizing.md +83 -0
- package/skills/massa-ai/references/tdd/document-contract.md +136 -0
- package/skills/massa-ai/references/tdd/quality-and-lifecycle.md +83 -0
- package/skills/massa-ai/references/the-fool/cognitive-bias-inventory.md +103 -0
- package/skills/massa-ai/references/the-fool/dialectic-synthesis.md +170 -0
- package/skills/massa-ai/references/the-fool/evidence-audit.md +202 -0
- package/skills/massa-ai/references/the-fool/mode-selection-guide.md +113 -0
- package/skills/massa-ai/references/the-fool/pre-mortem-analysis.md +200 -0
- package/skills/massa-ai/references/the-fool/red-team-adversarial.md +206 -0
- package/skills/massa-ai/references/the-fool/socratic-questioning.md +153 -0
- package/skills/massa-ai/references/ticket/atlassian-fix.md +130 -0
- package/skills/massa-ai/references/ticket/intake-and-sources.md +65 -0
- package/skills/massa-ai/references/ticket/templates-and-quality.md +129 -0
- package/skills/massa-ai/references/verification-ladder.md +62 -0
- package/skills/massa-ai/scripts/lessons.py +590 -0
- package/skills/massa-ai/workflows/adr.md +33 -0
- package/skills/massa-ai/workflows/architecture/architecture-audit.md +125 -0
- package/skills/massa-ai/workflows/architecture/architecture-fix.md +110 -0
- package/skills/massa-ai/workflows/bugs/bugs-audit.md +113 -0
- package/skills/massa-ai/workflows/bugs/bugs-fix.md +97 -0
- package/skills/massa-ai/workflows/code-quality/code-quality-audit.md +154 -0
- package/skills/massa-ai/workflows/code-quality/code-quality-fix.md +99 -0
- package/skills/massa-ai/workflows/commit.md +61 -0
- package/skills/massa-ai/workflows/debug.md +86 -0
- package/skills/massa-ai/workflows/design.md +54 -0
- package/skills/massa-ai/workflows/exploration.md +119 -0
- package/skills/massa-ai/workflows/feature.md +52 -0
- package/skills/massa-ai/workflows/general.md +46 -0
- package/skills/massa-ai/workflows/implementation/implementation-audit.md +87 -0
- package/skills/massa-ai/workflows/implementation/implementation-fix.md +90 -0
- package/skills/massa-ai/workflows/long-session.md +44 -0
- package/skills/massa-ai/workflows/maestro/maestro-audit.md +56 -0
- package/skills/massa-ai/workflows/maestro/maestro-fix.md +74 -0
- package/skills/massa-ai/workflows/maestro/maestro.md +68 -0
- package/skills/massa-ai/workflows/mobile-figma/mobile-figma-audit.md +68 -0
- package/skills/massa-ai/workflows/mobile-figma/mobile-figma-fix.md +74 -0
- package/skills/massa-ai/workflows/onboarding.md +23 -0
- package/skills/massa-ai/workflows/refactor.md +47 -0
- package/skills/massa-ai/workflows/refinement/furps-refinement.md +81 -0
- package/skills/massa-ai/workflows/requirements/requirements-audit.md +114 -0
- package/skills/massa-ai/workflows/requirements/requirements-fix.md +93 -0
- package/skills/massa-ai/workflows/rfc.md +55 -0
- package/skills/massa-ai/workflows/security/security-audit.md +113 -0
- package/skills/massa-ai/workflows/security/security-fix.md +97 -0
- package/skills/massa-ai/workflows/spec-driven.md +217 -0
- package/skills/massa-ai/workflows/tdd.md +71 -0
- package/skills/massa-ai/workflows/tests/tests-audit.md +114 -0
- package/skills/massa-ai/workflows/tests/tests-fix.md +96 -0
- package/skills/massa-ai/workflows/the-fool.md +82 -0
- package/skills/massa-ai/workflows/ticket.md +42 -0
- package/skills/persona-router/SKILL.md +158 -0
- package/skills/status/SKILL.md +15 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
# massa-ai Tool Contracts (52 Tools)
|
|
2
|
+
|
|
3
|
+
Load this reference when exact MCP schemas, REST fallbacks, response modes, or
|
|
4
|
+
polling rules are needed. Prefer the active tool declaration over copied
|
|
5
|
+
examples. The canonical tool list and order is defined in
|
|
6
|
+
`apps/mcp-client/src/tool-definitions.ts` CANONICAL_ORDER.
|
|
7
|
+
|
|
8
|
+
## Contract Precedence
|
|
9
|
+
|
|
10
|
+
1. Active MCP schema for MCP calls.
|
|
11
|
+
2. Live `/swagger/json` schema for direct REST calls.
|
|
12
|
+
3. Release notes and README for intended behavior.
|
|
13
|
+
4. Non-destructive runtime probes when the surfaces disagree.
|
|
14
|
+
|
|
15
|
+
Swagger currently exposes empty response schemas and reports API version
|
|
16
|
+
`1.0.0`; use it for request contracts and routes, not as proof of response
|
|
17
|
+
shape or package version.
|
|
18
|
+
|
|
19
|
+
## MCP Capability Matrix — Indexing & Search
|
|
20
|
+
|
|
21
|
+
| Tool | Primary use | Important contract note |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `index` | Start background project indexing | Requires `projectPath`; may return `jobId`. |
|
|
24
|
+
| `index_status` | Poll indexing progress | Poll after a real delay, never in a tight loop. |
|
|
25
|
+
| `reindex` | Force workspace reindex | Compatibility-sensitive; see Reindex And Reset below. |
|
|
26
|
+
| `reset_project` | Delete vectors/symbols/memories | Destructive; explicit user intent required. |
|
|
27
|
+
| `list_projects` | Resolve exact project IDs and index status | Use before indexing or project-map calls. |
|
|
28
|
+
| `project_map` | General architecture/stats/PageRank overview | Uses `id`, not `projectId`. Returns stats, top files by PageRank, symbol counts, extension distribution, recent files. |
|
|
29
|
+
| `get_architecture` | Architecture-specific deep map | Uses `id`. Returns packages, entry points, routes, hotspots, communities, layers, and opt-in cycles (Tarjan SCC). Pass `aspects:["cycles"]` for call cycles. Distinct from `project_map` (general overview vs architecture-specific). |
|
|
30
|
+
| `search` | Semantic + keyword code search | Supports `summary`, `full`, `enriched`, and optional Synapse `sessionId`. |
|
|
31
|
+
| `optimized_context` | Search plus compression | Has no `sessionId`; do not invent one. |
|
|
32
|
+
| `read_file` | Targeted file/range read with symbols/imports | Relative paths may resolve against the server checkout; see below. Prefer over native Read when symbol metadata is useful. |
|
|
33
|
+
| `symbol_snippet` | Read exact code lines by range | Requires `projectId` and relative `file` with `lineStart`/`lineEnd`. |
|
|
34
|
+
| `fetch_and_index` | Fetch URL(s) → HTML→markdown/JSON → index | SSRF-guarded, TTL-cached. Req: `url` or `requests`[]. Opt: `source`, `concurrency`, `force`, `ttl`. |
|
|
35
|
+
|
|
36
|
+
## MCP Capability Matrix — Symbol Graph
|
|
37
|
+
|
|
38
|
+
| Tool | Primary use | Important contract note |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| `search_definitions` | Find symbol definitions | Search field is `search`; installed v2.0.2 may ignore search/kind filters. |
|
|
41
|
+
| `get_references` | Find symbol usages | Use `fqn` when names are ambiguous. |
|
|
42
|
+
| `go_to_definition` | Resolve a symbol from caller context | Optional `fromFile` improves disambiguation. |
|
|
43
|
+
| `trace_path` | Trace call/data-flow/cross-service path (BFS) | Req: `function_name` or `qualifiedName`, `project`. Opt: `direction`, `mode`, `depth`, `include_tests`, `edge_types`[]. Only counts as evidence when index is fresh for current path/commit. |
|
|
44
|
+
| `impact_analysis` | Git-diff → impacted symbols (centrality-ranked) | Req: `project`, `projectPath`. Opt: `scope`, `base_branch`, `since`, `depth`, `paths`[]. Only counts as evidence when index is fresh. Empty diff → empty impact set (not an error). |
|
|
45
|
+
|
|
46
|
+
## MCP Capability Matrix — Memory & Lifecycle
|
|
47
|
+
|
|
48
|
+
| Tool | Primary use | Important contract note |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| `remember` | Persist durable knowledge | Supported types: critical, conversation, code, decision, pattern. |
|
|
51
|
+
| `recall` | Semantic memory retrieval | Use `projectId` for project-scoped decisions. |
|
|
52
|
+
| `memory_list` | Chronological memory audit | Treat as unscoped until runtime proves project filtering. |
|
|
53
|
+
| `memory_update` | Update a memory by id; re-embeds on content change | Req: `id`. Opt: `content`, `importance`, `tags`, `mergeTags`, `format`. |
|
|
54
|
+
| `memory_delete` | Hard-delete a memory by id; severs graph edges | Req: `id`. Opt: `format`. |
|
|
55
|
+
| `compress` | Compress large context | Pick a strategy from the table below; do not persist output automatically. |
|
|
56
|
+
| `analytics` | Inspect search/cache usage | Requires analytics `type` (summary, project, query, cache, recent). |
|
|
57
|
+
| `compact_snapshot` | Bounded (<2KB) session compaction snapshot | Req: `sessionId` (lifecycle session id, NOT workflowSessionId). Opt: `projectId`, `persist`. Zero-loss table-of-contents for /compact recovery. |
|
|
58
|
+
|
|
59
|
+
### Compression Strategies
|
|
60
|
+
|
|
61
|
+
`compress` takes one explicit `strategy`. Match the strategy to the input shape;
|
|
62
|
+
the reduction ranges are observed, not guaranteed.
|
|
63
|
+
|
|
64
|
+
| Strategy | Use case | Reduction |
|
|
65
|
+
|---|---|---|
|
|
66
|
+
| `code_structure` | Source code | 70-90% |
|
|
67
|
+
| `conversation_summary` | Chat history | 80-95% |
|
|
68
|
+
| `semantic_dedup` | Repetitive content | 50-70% |
|
|
69
|
+
| `hierarchical` | Structured docs | 60-80% |
|
|
70
|
+
|
|
71
|
+
Compress before persisting a large artifact into memory, not after. Compressed
|
|
72
|
+
output is a lead, not a source of truth: re-read the original file when a claim
|
|
73
|
+
depends on exact content.
|
|
74
|
+
|
|
75
|
+
## MCP Capability Matrix — Synapse (Cognitive Layer)
|
|
76
|
+
|
|
77
|
+
| Tool | Primary use | Important contract note |
|
|
78
|
+
|---|---|---|
|
|
79
|
+
| `synapse_session` | Create an ephemeral cognitive session | Supply explicit agent/workspace/context/TTL. Omit `sessionId` for server-generated ID. |
|
|
80
|
+
| `synapse_get` | Inspect session state | Use to confirm state or diagnose expiry. |
|
|
81
|
+
| `synapse_update` | Replace session task context | Use after a major focus shift (investigate → fix). |
|
|
82
|
+
| `synapse_end` | End a session | Free resources after completion when practical. |
|
|
83
|
+
| `synapse_prime` | Prime Synapse buffer | Adapter is compatibility-sensitive; may fail with 422. REST fallback or skip. |
|
|
84
|
+
| `synapse_access` | Record a consumed hit for affinity | Verified adapter may fail path binding; REST fallback with `memoryId` works. |
|
|
85
|
+
| `synapse_prefetch` | Warm buffer for a file about to be investigated | Req: `id` (session), `filePath`. Opt: `symbols`, `chains`, `maxResults`, `minImportance`, `entries`. |
|
|
86
|
+
| `synapse_list` | List active session count | Debug aid. |
|
|
87
|
+
| `synapse_task_begin` | Begin a task envelope within a session | Req: `id` (session id from `synapse_session`). Opt: `taskContext`. Requires existing session. |
|
|
88
|
+
| `synapse_task_end` | End a task envelope within a session | Req: `id` (session id). Requires existing task envelope. |
|
|
89
|
+
|
|
90
|
+
## MCP Capability Matrix — Checkpoints
|
|
91
|
+
|
|
92
|
+
| Tool | Primary use | Important contract note |
|
|
93
|
+
|---|---|---|
|
|
94
|
+
| `create_checkpoint` | Save task progress for later resumption | Req: `taskId`, `description`. Opt: `status`, `currentStep`, `progressPercent`, `totalSteps`, `completedSteps`, `checkpointType` (manual/milestone), `agentId`, `projectId`, `memoryIds`, `fileChanges`, `decisions`, `learnings`, `nextAction`, `pendingValidations`, `format`. |
|
|
95
|
+
| `list_checkpoints` | List saved checkpoints | Opt: `taskId`, `projectId`, `checkpointType`, `includeExpired`, `limit`, `format`. |
|
|
96
|
+
| `restore_checkpoint` | Restore a checkpoint and return state + integrity | Opt: `checkpointId` or `taskId` (restore latest for task), `format`. |
|
|
97
|
+
|
|
98
|
+
## MCP Capability Matrix — Cross-session Handoffs
|
|
99
|
+
|
|
100
|
+
| Tool | Primary use | Important contract note |
|
|
101
|
+
|---|---|---|
|
|
102
|
+
| `handoff_begin` | Begin a cross-session handoff; dual-writes searchable memory | Req: `projectId`. Opt: `sourceSessionId`, `targetAgent`, `summary`, `openQuestions`, `nextSteps`, `files`. |
|
|
103
|
+
| `handoff_accept` | Accept an open handoff (open→accepted) | Req: `id`. Opt: `projectId`. |
|
|
104
|
+
| `handoff_cancel` | Cancel/expire an open handoff | Req: `id`. Opt: `projectId`. |
|
|
105
|
+
| `handoff_list_pending` | List open handoffs, oldest-first | Req: `projectId`. Opt: `targetAgent`. |
|
|
106
|
+
|
|
107
|
+
## MCP Capability Matrix — Auto-improvement (Proposals)
|
|
108
|
+
|
|
109
|
+
| Tool | Primary use | Important contract note |
|
|
110
|
+
|---|---|---|
|
|
111
|
+
| `list_proposals` | List pending auto-improvement proposals, newest-first | Req: `projectId`. |
|
|
112
|
+
| `approve_proposal` | Approve a proposal; applies the memory edit | Req: `id`. Opt: `projectId`, `source`. |
|
|
113
|
+
| `reject_proposal` | Reject a proposal (no edit applied) | Req: `id`. Opt: `projectId`, `reason`. |
|
|
114
|
+
|
|
115
|
+
## MCP Capability Matrix — Passive Capture
|
|
116
|
+
|
|
117
|
+
| Tool | Primary use | Important contract note |
|
|
118
|
+
|---|---|---|
|
|
119
|
+
| `hook_ingest` | Passively ingest lifecycle events as Observations | Req: `events`[]. Used by host hook scripts, not agent workflows directly. |
|
|
120
|
+
|
|
121
|
+
## MCP Capability Matrix — Project Bootstrap
|
|
122
|
+
|
|
123
|
+
| Tool | Primary use | Important contract note |
|
|
124
|
+
|---|---|---|
|
|
125
|
+
| `bootstrap` | Scan a project and create seed memories | Req: `projectId`. Opt: `projectPath`, `force`. Idempotent; LLM-off degrades to rule-based. |
|
|
126
|
+
|
|
127
|
+
## MCP Capability Matrix — Code Execution (Sandbox)
|
|
128
|
+
|
|
129
|
+
| Tool | Primary use | Important contract note |
|
|
130
|
+
|---|---|---|
|
|
131
|
+
| `execute` | Run code in a detected runtime | Req: `language`, `code`. Opt: `timeout`, `background`, `cwd`, `intent`. Local-dev only. |
|
|
132
|
+
| `execute_file` | Read a file into a sandboxed var and run code over it | Req: `path`, `language`, `code`. Opt: `timeout`, `intent`. Avoids loading full file into context. |
|
|
133
|
+
| `batch_execute` | Run N shell commands in parallel | Req: `commands`[]. Opt: `queries`, `timeout`, `concurrency`, `cwd`, `query_scope`. Concurrency-capped at 256. |
|
|
134
|
+
|
|
135
|
+
## MCP Capability Matrix — Project Lifecycle (Admin)
|
|
136
|
+
|
|
137
|
+
| Tool | Primary use | Important contract note |
|
|
138
|
+
|---|---|---|
|
|
139
|
+
| `rename_project` | Rename a project identity transactionally | Req: `sourceProjectId`, `targetProjectId`. Default `dryRun=true`; apply with `dryRun=false` + `operationId` + `expectedPlanHash`. Administrative, not workflow-recurring. |
|
|
140
|
+
| `merge_projects` | Merge one project identity into another | Req: `sourceProjectId`, `targetProjectId`. Same dryRun/planHash contract as `rename_project`. Administrative, not workflow-recurring. |
|
|
141
|
+
|
|
142
|
+
## Retrieval Order
|
|
143
|
+
|
|
144
|
+
1. `list_projects` or equivalent index metadata to verify project ID,
|
|
145
|
+
path, status, and `lastIndexedAt` before treating indexed context as current.
|
|
146
|
+
2. `project_map` for general architecture orientation when the index is fresh for the current repository path and worktree state.
|
|
147
|
+
3. `get_architecture` for architecture-specific deep maps (packages, routes, hotspots, communities, cycles) when the index is fresh.
|
|
148
|
+
4. `search(responseMode="summary", maxResults=10)` for broad discovery.
|
|
149
|
+
5. `search(responseMode="enriched", maxResults=3)` for targeted deep reads with `fileImports`, `parentSymbol`, and chunk navigation metadata; raise to `maxResults=5` only when 4-5 exact files, symbols, or report finding IDs are already named.
|
|
150
|
+
6. Symbol tools (`search_definitions`, `get_references`, `go_to_definition`) and `read_file` for exact source evidence.
|
|
151
|
+
7. `symbol_snippet` for raw code snippets by file + line range.
|
|
152
|
+
8. `trace_path` for typed-edge BFS call/data-flow path tracing (fresh index only).
|
|
153
|
+
9. `impact_analysis` for git-diff centrality-ranked impact (fresh index only).
|
|
154
|
+
10. `optimized_context` for compact synthesized context when available.
|
|
155
|
+
11. Focused `rg`/file reads when massa-ai is unavailable, stale, incomplete, or misses obvious local truth.
|
|
156
|
+
|
|
157
|
+
Do not use `full` or `enriched` for broad whole-project sweeps. Attempt REST fallback exactly once after a documented MCP schema, adapter, or missing-operation failure; if REST also fails, continue with MCP/local fallback and record the skipped reason.
|
|
158
|
+
|
|
159
|
+
Graph tools (`trace_path`, `impact_analysis`, `get_architecture`) only count as
|
|
160
|
+
evidence when the index is fresh for the current repository path and
|
|
161
|
+
commit/worktree state. When the index is stale, incomplete, missing the target
|
|
162
|
+
path, or older than relevant local changes, fall back to `search`/`get_references`
|
|
163
|
+
and record the reduced retrieval confidence.
|
|
164
|
+
|
|
165
|
+
Project maps, search hits, and optimized context are discovery leads until
|
|
166
|
+
confirmed against source files read in the current session or returned with
|
|
167
|
+
freshness evidence for the current worktree. When index status is stale,
|
|
168
|
+
incomplete, missing the target path, or older than relevant local changes, use
|
|
169
|
+
focused source reads as proof and record the reduced retrieval confidence.
|
|
170
|
+
|
|
171
|
+
## Common MCP Calls
|
|
172
|
+
|
|
173
|
+
```js
|
|
174
|
+
search({
|
|
175
|
+
query: "authentication middleware",
|
|
176
|
+
projectId: "<projectId>",
|
|
177
|
+
maxResults: 10,
|
|
178
|
+
responseMode: "summary",
|
|
179
|
+
autoReindex: false,
|
|
180
|
+
sessionId: "<synapseSessionId>"
|
|
181
|
+
})
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Omit `sessionId` for one-shot or stateless search.
|
|
185
|
+
|
|
186
|
+
```js
|
|
187
|
+
optimized_context({
|
|
188
|
+
query: "session:<workflowSessionId> payment ownership",
|
|
189
|
+
projectId: "<projectId>",
|
|
190
|
+
maxTokens: 4000,
|
|
191
|
+
maxResults: 5
|
|
192
|
+
})
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
```js
|
|
196
|
+
remember({
|
|
197
|
+
content: "<durable fact or decision>",
|
|
198
|
+
type: "decision",
|
|
199
|
+
importance: 0.8,
|
|
200
|
+
projectId: "<projectId>",
|
|
201
|
+
sessionId: "<workflowSessionId>",
|
|
202
|
+
tags: [
|
|
203
|
+
"project:<projectId>",
|
|
204
|
+
"session:<workflowSessionId>",
|
|
205
|
+
"workflow:<type>",
|
|
206
|
+
"entity:<name>",
|
|
207
|
+
"memory:semantic"
|
|
208
|
+
],
|
|
209
|
+
format: "toon"
|
|
210
|
+
})
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
```js
|
|
214
|
+
create_checkpoint({
|
|
215
|
+
taskId: "auth-refactor",
|
|
216
|
+
description: "Token rotation mid-flight",
|
|
217
|
+
progressPercent: 60,
|
|
218
|
+
currentStep: "rotateToken",
|
|
219
|
+
nextAction: "finish rotateToken in src/auth.ts",
|
|
220
|
+
fileChanges: ["src/auth.ts"],
|
|
221
|
+
checkpointType: "manual"
|
|
222
|
+
})
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
```js
|
|
226
|
+
handoff_begin({
|
|
227
|
+
projectId: "<projectId>",
|
|
228
|
+
summary: "Auth refactor in progress; token rotation unfinished",
|
|
229
|
+
nextSteps: ["finish rotateToken in auth.ts", "add tests"],
|
|
230
|
+
files: ["src/auth.ts", "src/token.ts"]
|
|
231
|
+
})
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Verified MCP/REST Differences
|
|
235
|
+
|
|
236
|
+
| Area | MCP surface | REST/Swagger surface | Policy |
|
|
237
|
+
|---|---|---|---|
|
|
238
|
+
| Search session | `sessionId` | `sessionId` | Value is ephemeral `synapseSessionId`. |
|
|
239
|
+
| Search output | No `format` field in active MCP | REST supports `format` | Keep `format` out of MCP search calls. |
|
|
240
|
+
| Optimized context | No session field | No session field | Preserve workflow context in query text/tags. |
|
|
241
|
+
| Memory store | No `linkTo` in active MCP | REST exposes `linkTo` | REST-only until MCP adds it. |
|
|
242
|
+
| Memory recall | No `includeRelated` in active MCP | REST exposes `includeRelated` | REST-only until MCP adds it. |
|
|
243
|
+
| Memory list | MCP declares `projectId` | REST body has no `projectId` | Do not trust it for project scoping. |
|
|
244
|
+
| File read | MCP has line range/compress/symbol/import fields | REST also has offset/limit/targetRatio/format | Keep REST-only fields out of MCP. |
|
|
245
|
+
| Synapse create | MCP fields are broadly optional | REST requires `agentId` | Always provide explicit agent/workspace/context/TTL. |
|
|
246
|
+
| Synapse prime | MCP declares `{id, results}` | REST requires `{entries}` | Verified adapter may fail with 422; use REST fallback or skip. |
|
|
247
|
+
| Synapse access | MCP permits `memoryId` or `filePath` | REST requires `memoryId` | Verified MCP path binding failed; use REST fallback with `memoryId`. |
|
|
248
|
+
| Reindex | MCP declares `{id, forceReindex}` | REST requires path `id` plus body `projectPath` | Probe only on disposable workspace; otherwise use full index fallback. |
|
|
249
|
+
| File read path | MCP permits relative or absolute `filePath` | REST reads server filesystem | If relative resolution fails, combine registered workspace path with the indexed relative path. |
|
|
250
|
+
| Definition filters | MCP exposes `search`, `kind`, `file`, `exportedOnly` | REST documents query filters | If filters are ignored, client-filter results or use `go_to_definition`. |
|
|
251
|
+
|
|
252
|
+
## REST-Only Operations
|
|
253
|
+
|
|
254
|
+
Use `MASSA_AI_API_URL` and optional `x-api-key: $MASSA_AI_API_KEY`. Never expose the
|
|
255
|
+
key in output or persistence.
|
|
256
|
+
|
|
257
|
+
- System diagnostics: `/health`, `/api/v1/system/status`,
|
|
258
|
+
`/api/v1/system/health/local`, `/api/v1/system/ollama`.
|
|
259
|
+
- Remote upload/index: `POST /api/v1/project/upload-and-index`.
|
|
260
|
+
- Index events: `GET /api/v1/events`.
|
|
261
|
+
- Workspace details/removal: `GET|DELETE /api/v1/workspace/:id`.
|
|
262
|
+
- File centrality: `GET /api/v1/symbol/centrality/:projectId`.
|
|
263
|
+
- Synapse inspect/update/delete/prefetch/list routes documented in
|
|
264
|
+
`references/synapse-policy.md`.
|
|
265
|
+
|
|
266
|
+
Do not use API-only routes merely because they exist. Prefer MCP unless the
|
|
267
|
+
required operation is absent or its adapter is proven broken.
|
|
268
|
+
|
|
269
|
+
## Reindex And Reset
|
|
270
|
+
|
|
271
|
+
- Prefer `search(autoReindex=true)` for small stale-index refreshes.
|
|
272
|
+
- Use `reindex` only after verifying its installed adapter contract on a
|
|
273
|
+
disposable workspace.
|
|
274
|
+
- Fallback for a known path: `index({ projectPath, projectId,
|
|
275
|
+
forceReindex: true })` and poll its job.
|
|
276
|
+
- Never call `reset_project` as routine reindex preparation. It can delete
|
|
277
|
+
memories by default and requires explicit destructive intent.
|
|
278
|
+
|
|
279
|
+
## Polling Discipline
|
|
280
|
+
|
|
281
|
+
Never call `index_status` in a tight turn-by-turn loop. Poll after a real
|
|
282
|
+
delay. Preferred shell pattern:
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
MASSA_AI_API_URL="${MASSA_AI_API_URL:-http://localhost:3333}"
|
|
286
|
+
for i in $(seq 1 40); do
|
|
287
|
+
result=$(rtk curl -s "$MASSA_AI_API_URL/api/v1/project/index/status/JOB_ID")
|
|
288
|
+
status=$(printf '%s' "$result" | python3 -c "import sys,json; print(json.load(sys.stdin)['data']['status'])")
|
|
289
|
+
printf '[%s] status=%s\n' "$i" "$status"
|
|
290
|
+
[ "$status" = "completed" ] || [ "$status" = "failed" ] && break
|
|
291
|
+
sleep 15
|
|
292
|
+
done
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
When shell polling is inappropriate, call status once, wait for a natural turn
|
|
296
|
+
or scheduled wakeup, then poll again.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Memory Policy
|
|
2
|
+
|
|
3
|
+
Read this when writing, updating, pruning, promoting, or resolving conflicting massa-ai memories.
|
|
4
|
+
|
|
5
|
+
## Tiers
|
|
6
|
+
|
|
7
|
+
| Tier | Use | Persist as | Required tag |
|
|
8
|
+
|------|-----|------------|--------------|
|
|
9
|
+
| Working | Active task state, pending local intent, temporary context | Usually skip; use `conversation` only for handoff | `memory:working` |
|
|
10
|
+
| Episodic | Timestamped attempts, observations, command evidence, ruled-out hypotheses | `conversation` or `code` | `memory:episodic` |
|
|
11
|
+
| Semantic | Durable project facts, constraints, decisions, architecture patterns | `critical`, `decision`, or `pattern` | `memory:semantic` |
|
|
12
|
+
| Procedural | Reusable workflow, command, verification recipe, debugging protocol | `pattern` or `decision` | `memory:procedural` |
|
|
13
|
+
|
|
14
|
+
Supported massa-ai types are only `critical`, `conversation`, `code`, `decision`, and `pattern`.
|
|
15
|
+
|
|
16
|
+
## Observational Memory
|
|
17
|
+
|
|
18
|
+
Observational Memory is not a new storage layer. It is the discipline for deciding which execution observations become massa-ai memories.
|
|
19
|
+
|
|
20
|
+
- Observer mode: capture only high-signal events, decisions, failed attempts, ruled-out hypotheses, and verification recipes.
|
|
21
|
+
- Reflector mode: when the same lesson appears in 3+ independent sessions, promote it to semantic or procedural memory.
|
|
22
|
+
- Episodic observations stay lightweight: date, fact, evidence, why it matters, and what not to repeat.
|
|
23
|
+
- Failed or repeated tool loops become compact cognition lessons only when reusable.
|
|
24
|
+
|
|
25
|
+
A cognition lesson should use this shape:
|
|
26
|
+
|
|
27
|
+
```md
|
|
28
|
+
Trigger: ...
|
|
29
|
+
Failure pattern: ...
|
|
30
|
+
Prevention rule: ...
|
|
31
|
+
Evidence: ...
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Persist cognition lessons as `pattern` memories with `memory:procedural` when they would prevent future repeated failures. Skip one-off tool noise.
|
|
35
|
+
|
|
36
|
+
## Allowed And Forbidden Payloads
|
|
37
|
+
|
|
38
|
+
Persist only durable decisions, rejected approaches, reusable patterns,
|
|
39
|
+
verification recipes, repeated lessons, and high-signal gotchas. Do not persist
|
|
40
|
+
raw transcripts, raw logs, copied source, raw search output, raw subagent output,
|
|
41
|
+
customer data, secrets, one-off observations, already-captured facts, or noisy
|
|
42
|
+
command output.
|
|
43
|
+
|
|
44
|
+
## Required Tags
|
|
45
|
+
|
|
46
|
+
Every persisted memory must include:
|
|
47
|
+
|
|
48
|
+
- `project:<projectId>`
|
|
49
|
+
- `session:<workflowSessionId>`
|
|
50
|
+
- `workflow:<type>`
|
|
51
|
+
- `entity:<name>`
|
|
52
|
+
- `memory:<tier>`
|
|
53
|
+
|
|
54
|
+
Add focused domain tags only when they improve future retrieval, such as `auth`, `mobile`, `tests`, `issue`, `handoff`, or `stale`.
|
|
55
|
+
|
|
56
|
+
## Write Protocol
|
|
57
|
+
|
|
58
|
+
1. Recall first using the project, entity, and likely fact name.
|
|
59
|
+
2. Classify the memory tier and supported massa-ai type.
|
|
60
|
+
3. Score importance with `references/decision-engine.md`.
|
|
61
|
+
4. Do not write duplicates. If the same fact already exists and still applies, reuse it.
|
|
62
|
+
5. If a new fact supersedes an old memory, write a replacement containing the date, the new fact, and why it supersedes the old one. Add `stale-replaces:<memoryId>` to the replacement; do not mark the replacement itself as `stale`.
|
|
63
|
+
6. If recall shows the same lesson in 3+ independent sessions, promote it to semantic or procedural memory as `pattern` or `decision`; include source memory IDs in the content.
|
|
64
|
+
7. Report the memory outcome in completion or handoff evidence as one of:
|
|
65
|
+
written, intentionally skipped with reason, duplicate skipped, forbidden payload skipped, or failed write with recovery note.
|
|
66
|
+
|
|
67
|
+
## Example
|
|
68
|
+
|
|
69
|
+
Persist only after recall and scoring. Add `stale-replaces:<memoryId>` only when replacing a recalled memory.
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
remember({
|
|
73
|
+
projectId: "massa-ai",
|
|
74
|
+
sessionId: "spec-memory-routing",
|
|
75
|
+
type: "decision",
|
|
76
|
+
importance: 0.8,
|
|
77
|
+
content: "2026-06-27 workflows/spec-driven.md owns the TLC v3 Specify, optional Design, optional Tasks, and Execute flow with mandatory independent validation as Execute's final gate. Approved feature artifacts own phase contracts, .specs/project/STATE.md owns resumable session state, and massa-ai owns durable cross-session decisions and patterns.",
|
|
78
|
+
tags: [
|
|
79
|
+
"project:massa-ai",
|
|
80
|
+
"session:spec-memory-routing",
|
|
81
|
+
"workflow:spec-driven",
|
|
82
|
+
"entity:massa-ai",
|
|
83
|
+
"memory:semantic",
|
|
84
|
+
"stale-replaces:dec_old123" // omit unless this supersedes that memory
|
|
85
|
+
]
|
|
86
|
+
})
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Retrieval Policy
|
|
90
|
+
|
|
91
|
+
Prefer memories in this order:
|
|
92
|
+
|
|
93
|
+
1. Exact `session:<workflowSessionId>` memories for current task continuity
|
|
94
|
+
2. Non-stale semantic memories for project constraints and decisions
|
|
95
|
+
3. Recent episodic memories for attempts and evidence
|
|
96
|
+
4. Procedural memories for commands and verification recipes
|
|
97
|
+
|
|
98
|
+
Treat memories tagged `stale`, or old memories whose IDs are referenced by newer `stale-replaces:*` tags, as historical context rather than current truth.
|
|
99
|
+
|
|
100
|
+
Use `recall(projectId=...)` for project-scoped decisions. The v2.0.2 MCP
|
|
101
|
+
declaration exposes `projectId` on `memory_list`, but the verified REST
|
|
102
|
+
body does not; treat memory-list output as unscoped unless a runtime probe proves
|
|
103
|
+
the installed adapter applies the filter.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Mobile Context
|
|
2
|
+
|
|
3
|
+
Use this reference when a non-debug workflow touches KMP, iOS, Android, native bridges, mobile app lifecycle, offline sync, permissions, push/background work, local persistence, or backend-mobile contracts.
|
|
4
|
+
|
|
5
|
+
Mobile is a context modifier, not a primary workflow. Keep the selected workflow based on user intent:
|
|
6
|
+
|
|
7
|
+
- New capability -> `workflows/feature.md`
|
|
8
|
+
- Behavior-preserving structure change -> `workflows/refactor.md`
|
|
9
|
+
- Broken behavior, crashes, regressions, or device-specific failures -> `workflows/debug.md` plus `references/mobile-diagnosis.md`
|
|
10
|
+
- New Maestro mobile E2E flow implementation -> `workflows/maestro/maestro.md`
|
|
11
|
+
- Findings-only Maestro mobile E2E audit -> `workflows/maestro/maestro-audit.md`
|
|
12
|
+
- Child-only fix for saved Maestro audit findings -> `workflows/maestro/maestro-fix.md`
|
|
13
|
+
- Findings-only test coverage review -> `workflows/tests/tests-audit.md`
|
|
14
|
+
- Fix findings from a tests audit report -> `workflows/tests/tests-fix.md`
|
|
15
|
+
- Direct Android Views/Compose, UIKit/SwiftUI, or KMP Compose Multiplatform implementation from Figma or screenshot context -> `workflows/design.md`
|
|
16
|
+
- Findings-only platform-detected mobile comparison with Figma -> `workflows/mobile-figma/mobile-figma-audit.md`
|
|
17
|
+
- Fix saved platform-detected mobile Figma findings -> `workflows/mobile-figma/mobile-figma-fix.md`
|
|
18
|
+
- Findings-only security review -> `workflows/security/security-audit.md`
|
|
19
|
+
- Fix findings from a security audit report -> `workflows/security/security-fix.md`
|
|
20
|
+
- Broad, cross-boundary, unclear, or multi-platform implementation -> `workflows/spec-driven.md`
|
|
21
|
+
|
|
22
|
+
For `feature`, `spec-driven`, `rfc`, `adr`, and `tdd`, supported mobile UI work can use the optional design-source gate. Ask for one or more Figma links, node IDs, a readable desktop selection, supplied screenshots, or explicit `none` only when the request is Android, iOS, KMP Compose Multiplatform UI, or plausibly mobile UI. Clear backend, CLI, docs, infrastructure, and non-UI requests skip the prompt.
|
|
23
|
+
|
|
24
|
+
Maestro is a first-class mobile E2E workflow family when the primary target is flow implementation, existing-flow audit, or saved `MST-*` remediation. Generic test coverage, assertion quality, or regression-risk review still belongs to `workflows/tests/tests-audit.md` or `workflows/tests/tests-fix.md` when the target is not Maestro-specific.
|
|
25
|
+
|
|
26
|
+
When Figma sources or screenshots are supplied for supported Android, iOS, or KMP Compose Multiplatform UI implementation, keep the parent workflow as the lifecycle owner and invoke `workflows/design.md` only for the affected UI slice or visual feasibility context. Use `workflows/mobile-figma/mobile-figma-audit.md` for compare/audit intent and `workflows/mobile-figma/mobile-figma-fix.md` for saved `MFM-*` findings.
|
|
27
|
+
|
|
28
|
+
Treat `none` as a first-class answer: record `Figma Source: none by user choice` and do not re-ask unless the mobile UI scope changes. For unsupported targets such as Flutter, React Native, web, desktop, or generic design exploration, record supplied design sources as outside mobile Figma scope, do not run mobile Figma, and continue the parent workflow. Screenshots are context-only unless paired with structured Figma evidence; do not claim exact Figma parity, tokens, variables, or dimensions from screenshots alone.
|
|
29
|
+
|
|
30
|
+
## Mobile Context Packet
|
|
31
|
+
|
|
32
|
+
Capture only the fields needed for the active workflow:
|
|
33
|
+
|
|
34
|
+
- Platform scope: Android, iOS, KMP shared logic, native bridge, React Native, Flutter, webview, or backend-mobile contract
|
|
35
|
+
- Shared boundary: KMP shared code, native bridge, backend contract, local persistence, navigation, platform-only UI, or platform service
|
|
36
|
+
- App/build context: debug/release, flavor, app version/build, distribution channel, signing/profile when relevant
|
|
37
|
+
- Device matrix: impacted or targeted OS/API versions, real device vs simulator/emulator, and screen/accessibility constraints when UI is involved
|
|
38
|
+
- Runtime state: online/offline, background/foreground, process death, permissions, locale/timezone, feature flags, remote config, account/tenant, and local data/cache state when relevant
|
|
39
|
+
- Parity target: Android-only, iOS-only, shared behavior, or both platforms
|
|
40
|
+
|
|
41
|
+
Do not collect a full device matrix when the task only changes pure shared logic and deterministic shared tests are sufficient.
|
|
42
|
+
|
|
43
|
+
## Boundary Decisions
|
|
44
|
+
|
|
45
|
+
Before changing mobile behavior, decide where the change belongs:
|
|
46
|
+
|
|
47
|
+
- KMP shared logic: domain rules, shared repositories, serialization, retry/backoff, validation, state machines, and platform-neutral contracts
|
|
48
|
+
- Platform-specific code: permissions, OS APIs, lifecycle hooks, background execution, native storage, push providers, UI layout, accessibility, navigation shell, and signing/build behavior
|
|
49
|
+
- Native bridge: payload shape, nullability, serialization, threading, callback lifetime, event ordering, error mapping, and backward compatibility
|
|
50
|
+
- Backend-mobile contract: API versioning, auth refresh, pagination, schema nullability, media limits, upload retries, clock skew, and feature flag or remote config behavior
|
|
51
|
+
|
|
52
|
+
Prefer shared logic only when both platforms need the same behavior and the platform APIs can support it cleanly. Keep platform-specific behavior explicit when OS rules, permissions, lifecycle, or UI conventions differ.
|
|
53
|
+
|
|
54
|
+
## Platform Parity
|
|
55
|
+
|
|
56
|
+
Any mobile change must state:
|
|
57
|
+
|
|
58
|
+
- Impacted platform or shared boundary
|
|
59
|
+
- Expected comparison platform result
|
|
60
|
+
- Validation run for each affected platform, or skipped platform with reason
|
|
61
|
+
- Risk if one platform cannot be checked
|
|
62
|
+
|
|
63
|
+
For shared-code changes, run or document Android and iOS/KMP validation. For platform-only changes, prove the affected platform and state whether the other platform is unaffected, untested, or out of scope.
|
|
64
|
+
|
|
65
|
+
## Verification Sensors
|
|
66
|
+
|
|
67
|
+
Use the cheapest deterministic sensor that proves the workflow claim:
|
|
68
|
+
|
|
69
|
+
- KMP/shared: shared unit tests, common fixtures, platform-specific `actual` tests, serialization contract tests, or KMP compiler tasks
|
|
70
|
+
- Android: unit tests, instrumentation tests, Compose/Espresso tests, Gradle build/test tasks, emulator commands, deep-link intents, or focused lint/static checks
|
|
71
|
+
- iOS: unit tests, XCTest/UI tests, scheme build/test, simulator commands, universal/deep-link checks, or focused lint/static checks
|
|
72
|
+
- Cross-platform E2E: existing repo tools such as Maestro, Detox, Appium, XCTest UI, Espresso, or Compose UI tests
|
|
73
|
+
- Mobile artifacts: screenshots, videos, sanitized logs, crash reports, device logs, or human-in-the-loop scripts only when deterministic harnesses are unavailable
|
|
74
|
+
|
|
75
|
+
For design, mobile Figma audit, or mobile Figma fix, load `references/mobile-figma-matcher/repository-detection.md` and `references/mobile-figma-matcher/core.md`, then only the stack references selected by the Target Surface Packet. Maestro MCP/CLI is an optional runtime sensor: prefer existing safe flows and fixed device configurations, and never treat flow success or screenshots alone as parity proof.
|
|
76
|
+
|
|
77
|
+
Never rely on model self-evaluation. If device access, signing, credentials, provisioning, or hardware is unavailable, state the missing dependency and use the strongest available artifact or static proof.
|
|
78
|
+
|
|
79
|
+
## Tests Lens
|
|
80
|
+
|
|
81
|
+
When auditing or executing test work, check mobile-specific coverage for:
|
|
82
|
+
|
|
83
|
+
- KMP shared logic and platform-specific `actual` behavior
|
|
84
|
+
- Native bridge payloads, nullability, serialization, callbacks, threading, and error paths
|
|
85
|
+
- Permissions, deep links, push/background flows, lifecycle transitions, offline/online sync, local persistence, migrations, and auth refresh
|
|
86
|
+
- UI layout, accessibility font size, safe areas/notches, keyboard, rotation, navigation/back stack, and locale/timezone behavior when relevant
|
|
87
|
+
- Fixture drift between backend contracts, KMP models, Android models, and iOS bridge payloads
|
|
88
|
+
- Snapshot or screenshot assertions that were weakened, over-broadened, or made nondeterministic
|
|
89
|
+
|
|
90
|
+
## Security Lens
|
|
91
|
+
|
|
92
|
+
When auditing or executing security work, check mobile-specific trust boundaries:
|
|
93
|
+
|
|
94
|
+
- Secure storage/keychain/keystore use, token lifecycle, refresh behavior, and logout/session invalidation
|
|
95
|
+
- Permission prompts, denied/restricted states, background permission behavior, and OS-version permission changes
|
|
96
|
+
- Deep links, universal/app links, intent filters, route params, and auth guards
|
|
97
|
+
- Push tokens, APNs/FCM environment, notification tap actions, background tasks, and token privacy
|
|
98
|
+
- Biometrics, device credentials, fallback paths, and local lockout behavior
|
|
99
|
+
- Local DB/cache, offline queues, pending writes, sync conflict handling, and data retention
|
|
100
|
+
- Logs, crash reports, analytics, screenshots, and breadcrumbs for secret or personal data exposure
|
|
101
|
+
- Backend-mobile contract skew, schema nullability, media upload limits, retry idempotency, and clock skew
|
|
102
|
+
|
|
103
|
+
## Memory Guidance
|
|
104
|
+
|
|
105
|
+
Persist durable mobile lessons only after recall and importance scoring:
|
|
106
|
+
|
|
107
|
+
- KMP/shared vs platform-specific boundary decisions
|
|
108
|
+
- Native bridge payload contracts or compatibility constraints
|
|
109
|
+
- Project-specific mobile verification recipes or device matrix constraints
|
|
110
|
+
- Security boundaries involving secure storage, permissions, deep links, push, biometrics, local data, logs, or backend-mobile contracts
|
|
111
|
+
- Repeated mobile testing gaps, fixture drift patterns, or platform parity gotchas
|
|
112
|
+
|
|
113
|
+
Do not persist one-off device details, raw logs, screenshots, customer data, tokens, device IDs, or temporary debugging artifacts.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Mobile Diagnosis
|
|
2
|
+
|
|
3
|
+
Use this reference when `workflows/debug.md` handles broken behavior involving KMP, iOS, Android, native bridges, real devices, simulators, emulators, mobile app lifecycle, or device-specific failures.
|
|
4
|
+
|
|
5
|
+
This extends `references/debug-diagnosis-loop.md`. Do not use it instead of the general debug loop.
|
|
6
|
+
|
|
7
|
+
For non-debug mobile feature, refactor, tests, or security work, keep the intent-specific workflow and load `references/mobile-context.md` instead. Use `references/mobile-context.md` from Debug only when shared mobile vocabulary or non-bug parity/security/test framing is needed.
|
|
8
|
+
|
|
9
|
+
## Mobile Intake
|
|
10
|
+
|
|
11
|
+
Add these fields to the normal debug intake packet:
|
|
12
|
+
|
|
13
|
+
- Platform: Android, iOS, KMP shared logic, native bridge, React Native, Flutter, webview, or backend-mobile contract
|
|
14
|
+
- OS/API version and device model
|
|
15
|
+
- Real device vs simulator/emulator
|
|
16
|
+
- App version, build number, build flavor, distribution channel, and signing/profile context when relevant
|
|
17
|
+
- Debug, release, staging, production, or TestFlight/internal track
|
|
18
|
+
- Network state: online, offline, captive portal, cellular, Wi-Fi, VPN, proxy, low bandwidth, or packet loss
|
|
19
|
+
- Locale, timezone, calendar, text direction, region, and accessibility settings
|
|
20
|
+
- Permission state: notifications, location, camera, contacts, Bluetooth, background refresh, biometrics, files, or photos
|
|
21
|
+
- Battery, power saver, background/foreground state, app termination, process death, and cold/warm start state
|
|
22
|
+
- Account, tenant, feature flags, remote config, entitlement, and experiment bucket
|
|
23
|
+
- Data state: local DB/cache version, migration history, sync queue, pending writes, and corrupted or stale local records
|
|
24
|
+
- Crash/log artifact availability: stack trace, sanitized `logcat`, iOS device logs, crash report, screenshot, video, or repro script
|
|
25
|
+
|
|
26
|
+
If the bug is platform-specific, record the impacted platform and at least one unaffected or untested comparison platform.
|
|
27
|
+
|
|
28
|
+
## Mobile Feedback Loops
|
|
29
|
+
|
|
30
|
+
Choose the first loop that can reproduce the mobile failure, preserves the reported signal, and can later prove the fix:
|
|
31
|
+
|
|
32
|
+
- KMP shared unit tests, common test fixtures, or platform-specific `actual` tests
|
|
33
|
+
- Android unit tests, instrumentation tests, UI tests, Gradle task, emulator command, or deep-link intent command
|
|
34
|
+
- iOS unit tests, UI tests, scheme build/test, simulator command, or universal link/deep-link command
|
|
35
|
+
- Existing E2E tools already in the repo, such as Maestro, Detox, Appium, XCTest UI, Espresso, or Compose UI tests
|
|
36
|
+
- App kill/restart, cold start, background/foreground transition, rotation, keyboard, notification tap, or deep-link flow
|
|
37
|
+
- Push notification, background task, location, permission prompt, biometric, or offline/online simulation only when supported by local tools
|
|
38
|
+
- Sanitized `logcat`, iOS device logs, crash reports, breadcrumbs, screenshots, videos, or trace exports
|
|
39
|
+
- Device-farm, crash analytics, performance, or observability checks only when the project already has approved access
|
|
40
|
+
- Structured human-in-the-loop script when a real device or account state is required
|
|
41
|
+
|
|
42
|
+
Use skipped-reason enum values from `references/debug-diagnosis-loop.md` for unavailable mobile loops, especially `missing-hardware`, `missing-credentials`, `tool-missing`, `unsafe-production`, and `destructive-risk`.
|
|
43
|
+
|
|
44
|
+
Loop quality rules:
|
|
45
|
+
|
|
46
|
+
- Prefer deterministic local tests for KMP/shared logic before full-device loops.
|
|
47
|
+
- For device-only failures, keep the device matrix explicit and avoid claiming global coverage from one simulator/emulator.
|
|
48
|
+
- Preserve the original user-visible mobile failure signal, such as a crash, blank screen, lost sync item, permission failure, missing push, bad layout, or wrong navigation target.
|
|
49
|
+
- If a loop needs unavailable hardware, credentials, signing, provisioning, or production data, state the missing dependency and use the strongest root-cause proof available.
|
|
50
|
+
|
|
51
|
+
## Mobile Hypothesis Prompts
|
|
52
|
+
|
|
53
|
+
Use these prompts to build the normal 3-5 item hypothesis board:
|
|
54
|
+
|
|
55
|
+
- Lifecycle: cold start, warm start, process death, background resume, app switch, orientation, keyboard, memory pressure, or foreground service state
|
|
56
|
+
- Permissions: denied, not determined, one-time grant, restricted, background-only, OS-version permission changes, or prompt timing
|
|
57
|
+
- Native bridge: payload shape, nullability, serialization, threading, callback lifecycle, event ordering, or platform-specific type conversion
|
|
58
|
+
- KMP boundary: `expect/actual` mismatch, coroutine dispatcher, freezing/thread confinement, platform clock/filesystem/network behavior, or shared persistence abstraction
|
|
59
|
+
- Offline sync: queue ordering, conflict resolution, retry backoff, idempotency, cache invalidation, local DB migration, or partial-write recovery
|
|
60
|
+
- Navigation/deep links: auth guard, universal/app link entitlement, intent filter, route params, nested navigator state, back stack, or cold-start restoration
|
|
61
|
+
- Push/background: token registration, APNs/FCM environment mismatch, notification permission, background fetch limits, collapse keys, or tap-action routing
|
|
62
|
+
- Build/runtime config: debug vs release behavior, minification/ProGuard/R8, bitcode/symbols, signing/profile, build flavor, env file, remote config, or feature flag
|
|
63
|
+
- OS/device regression: API level, iOS version, OEM behavior, screen size, notch/safe area, locale/timezone, accessibility font size, battery saver, or low-memory behavior
|
|
64
|
+
- Backend-mobile contract: API version skew, clock skew, auth refresh, pagination, schema nullability, media upload limits, or network retry semantics
|
|
65
|
+
|
|
66
|
+
For each hypothesis, name the impacted boundary and the expected platform parity result.
|
|
67
|
+
|
|
68
|
+
## Crash And Log Discipline
|
|
69
|
+
|
|
70
|
+
Use crash and log artifacts as evidence, not as raw context:
|
|
71
|
+
|
|
72
|
+
- Keep only sanitized frames, exception names, thread names, relevant app logs, event breadcrumbs, and source pointers.
|
|
73
|
+
- Redact tokens, user IDs, device IDs, emails, phone numbers, precise locations, and customer data before memory or final output.
|
|
74
|
+
- Symbolicate or deobfuscate when concrete project tools exist; otherwise state that stack evidence is partial.
|
|
75
|
+
- Compare app frames against platform/framework frames to avoid fixing symptoms outside project code.
|
|
76
|
+
- Load `references/context-firewall.md` before inspecting verbose device logs or crash exports.
|
|
77
|
+
|
|
78
|
+
## Platform Parity
|
|
79
|
+
|
|
80
|
+
Mobile fixes need explicit parity framing:
|
|
81
|
+
|
|
82
|
+
- Impacted platform: where the failure occurs.
|
|
83
|
+
- Comparison platform: unaffected, untested, or unknown.
|
|
84
|
+
- Shared boundary: KMP shared code, native bridge, backend contract, local persistence, navigation, or platform-only UI.
|
|
85
|
+
- Required validation: impacted platform fixed, unaffected platform still passes or is explicitly not in scope.
|
|
86
|
+
|
|
87
|
+
If a shared-code change affects both platforms, run or document Android and iOS/KMP validation. If only one platform can be checked, state the skipped platform and risk.
|
|
88
|
+
|
|
89
|
+
## Output Extension
|
|
90
|
+
|
|
91
|
+
Add these fields to the normal Debug output contract:
|
|
92
|
+
|
|
93
|
+
- Device Matrix: platform, OS/API, device/simulator, app build/flavor, network, permissions, and lifecycle state checked
|
|
94
|
+
- Mobile Evidence: crash/log artifact, screenshot/video, deep-link command, device test, KMP test, or human-in-the-loop script
|
|
95
|
+
- Platform Parity: impacted platform, comparison platform, shared boundary, and skipped platform checks
|
|
96
|
+
- Mobile Prevention: regression test, device-matrix note, crash/logging improvement, runbook step, or durable mobile constraint memory
|
|
97
|
+
|
|
98
|
+
## Memory Guidance
|
|
99
|
+
|
|
100
|
+
Persist durable mobile lessons only after recall and importance scoring:
|
|
101
|
+
|
|
102
|
+
- Platform-specific root causes that future agents might misdiagnose
|
|
103
|
+
- KMP or native bridge boundary decisions
|
|
104
|
+
- Reusable device commands, simulator/emulator recipes, or log-filter commands
|
|
105
|
+
- Mobile verification matrices that prevent repeated false confidence
|
|
106
|
+
- OS-version, permission, lifecycle, or build-flavor gotchas with project impact
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Attribution
|
|
2
|
+
|
|
3
|
+
The mobile Figma guidance adapts concepts from OpenAI's `figma-implement-design` skill in `openai/skills`, including ordered Figma MCP extraction, screenshots, variables, Code Connect, asset handling, project-convention translation, component reuse, iterative validation, examples, and troubleshooting.
|
|
4
|
+
|
|
5
|
+
The upstream material is licensed under the Apache License 2.0. This repository includes that license at the root `LICENSE` file. The adapted guidance has been substantially modified for massa-ai routing, deterministic evidence, Android Views, Android Compose, UIKit, SwiftUI, Compose Multiplatform, target-module detection, temporary asset persistence, audit reports, and report-driven remediation.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Android Jetpack Compose Figma Contract
|
|
2
|
+
|
|
3
|
+
Load this reference only for Target Surface Packet rows classified as Android Jetpack Compose.
|
|
4
|
+
|
|
5
|
+
- Resolve composables, modifiers, layout primitives, Material/theme tokens, typography, shapes, painters/assets, state holders, previews/providers, navigation entry, semantics, and test tags affecting the surface.
|
|
6
|
+
- Distinguish Android-only Compose from Compose Multiplatform using module and source-set evidence.
|
|
7
|
+
- Normalize Figma pixels against density for `dp`; compare typography using `sp`, font scale, font metrics, line height, and wrapping.
|
|
8
|
+
- Record device/viewport, density, orientation, API, theme/UI mode, locale, font scale, `WindowInsets`, app variant, and content state.
|
|
9
|
+
- Verify adaptive layouts, RTL, clipping, elevation, recomposed visual states, minimum touch targets, TalkBack semantics/order, keyboard/focus behavior, and state restoration when applicable.
|
|
10
|
+
- Preserve established Navigation Compose or host navigation ownership, state hoisting, system back handling, Material interaction feedback, focus/IME behavior, and lifecycle restoration. Require product requirements for transitions or interactions not represented by Figma.
|
|
11
|
+
- Prefer existing theme tokens and shared composables when semantics, states, accessibility, and resolved values match.
|
|
12
|
+
- Use existing previews, Compose screenshot tests, Compose UI tests, instrumentation, emulator/device harnesses, and optional Maestro evidence.
|
|
13
|
+
- Do not weaken assertions, semantics, test tags, or screenshot baselines to make parity appear successful.
|