@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,96 @@
1
+ # Codebase Investigation
2
+
3
+ Use this reference when understanding unfamiliar code before planning, fixing, reviewing, or refactoring.
4
+
5
+ ## Golden Rules
6
+
7
+ 1. **Never assume or invent.** Uncertainty beats fabrication.
8
+ 2. **Deserves-a-note.** Persist durable understanding, not trivia.
9
+ 3. **Pointers, not copies.** Reference source by `path`/symbol/line; do not duplicate bulk content.
10
+ 4. **Surgical precision.** Smallest sufficient read/change.
11
+ 5. **Verify against source.** Memories and indexed context are leads until confirmed.
12
+
13
+ Write and search in the user's human language. Match the user's prompt language for prose; match the codebase for identifiers, paths, and commands.
14
+
15
+ ## Mission Cycle
16
+
17
+ Follow this proportional cycle (BRIEFING → PLAN → EXECUTE → DEBRIEF):
18
+
19
+ 1. **Briefing:** define objective, success criteria, constraints, and current session.
20
+ 2. **Recon:** inspect only relevant code paths and prior memories.
21
+ 3. **Plan:** state steps with per-step `verify:` criteria (what confirms the step succeeded) before non-trivial reads or edits.
22
+ 4. **Execute:** make surgical changes only when the workflow allows mutation.
23
+ 5. **Verify:** use deterministic sensors or concrete artifact inspection.
24
+ 6. **Debrief:** persist only durable discoveries; record what was verified against source.
25
+
26
+ For exploration-only work, Recon and Debrief are the main deliverables.
27
+
28
+ ## Source Order
29
+
30
+ Prefer sources in this order:
31
+
32
+ 1. `recall` for prior decisions, patterns, failed attempts, and handoffs.
33
+ 2. `list_projects` or equivalent index metadata to verify project ID,
34
+ path, status, and freshness.
35
+ 3. `project_map` for indexed-project architecture orientation when the
36
+ index is fresh for the current repository path and worktree state.
37
+ 4. Summary search, then targeted enriched search.
38
+ 5. Symbol tools and `read_file` for exact definitions, usages, and ranges.
39
+ 6. `optimized_context` when synthesized compact context is available and more useful
40
+ than exact source.
41
+ 7. Local `.notebook/INDEX.md` only if the project already uses `.notebook/`.
42
+ 8. Focused shell search/read fallback when massa-ai is unavailable, stale, incomplete, or unindexed.
43
+ 9. Official docs or web search only when current external API behavior matters.
44
+
45
+ Project maps, search results, and optimized context are leads until confirmed
46
+ against source files read in the current session or returned with current
47
+ freshness evidence. Current repository source and approved `.specs/` artifacts
48
+ override indexed context, memories, external summaries, and old handoff notes.
49
+
50
+ For multi-search investigations, load `references/synapse-policy.md`. Keep the
51
+ durable `workflowSessionId` separate from the ephemeral Synapse session.
52
+
53
+ massa-ai remains canonical memory for massa-ai workflows. Do not introduce `.notebook/` as a default persistence layer.
54
+
55
+ ## Recon Rules
56
+
57
+ - Start from the closest entry point to the question.
58
+ - Trace input -> transformation -> output for behavior questions.
59
+ - Prefer pointers over copied code in notes and reports.
60
+ - Read signatures and high-value logic first; avoid whole-project sweeps.
61
+ - Treat generated, dependency, build, log, cache, and secret paths as out of scope unless explicitly relevant.
62
+
63
+ ## Debrief Rules
64
+
65
+ Persist only if rediscovery would cost future effort:
66
+
67
+ - project convention or repeated pattern
68
+ - architectural constraint or accepted exception
69
+ - fragile flow, gotcha, or verified root cause
70
+ - rejected approach that future agents might reintroduce
71
+ - verification recipe worth reusing
72
+
73
+ **Note-worthiness trigger:** when understanding touches 3+ files or a non-trivial flow, persist a note to the massa-ai memory layer. Below that threshold, decide per-finding.
74
+
75
+ Three-way note decision:
76
+
77
+ - **create** — new durable finding worth its own note
78
+ - **update** — existing non-stale note for the same entity
79
+ - **skip** — trivial, one-off, or already captured
80
+
81
+ Skip memory for trivial observations, one-off findings, and facts already captured in current non-stale memories.
82
+
83
+ ## Investigation Output
84
+
85
+ Use this compact shape:
86
+
87
+ ```md
88
+ Objective: ...
89
+ Scope checked: ...
90
+ Entry points: ...
91
+ Flow: input -> transformation -> output
92
+ Key evidence: `path` / symbol / command
93
+ Open questions: ...
94
+ Next step: ...
95
+ Memory: write / skip, with reason
96
+ ```
@@ -0,0 +1,62 @@
1
+ # Context Firewall
2
+
3
+ Use this reference before loading raw artifacts >200 lines, >20 KB, >50 search hits, generated reports, logs, screenshots, browser snapshots, CSVs, external research, or any source batch likely to exceed the next decision's needs.
4
+
5
+ ## Principle
6
+
7
+ Keep verbose data outside the main reasoning window. Bring back only the facts needed for the next decision.
8
+
9
+ ## Think In Code
10
+
11
+ For high-volume analysis:
12
+
13
+ - Prefer focused commands, small scripts, or structured parsers over reading large raw files into context.
14
+ - Return counts, paths, summaries, failing cases, and representative snippets.
15
+ - Include context pressure, queue/delegation state, sync or memory outcome, and
16
+ skipped-check reasons only as compact fields when they affect the next
17
+ decision.
18
+ - Keep temporary analysis outside repo-tracked files unless the task explicitly needs a reusable script.
19
+ - Use project map, summary search, targeted enriched search, symbol/file tools,
20
+ `optimized_context`, and compression before broad shell reads when
21
+ useful.
22
+ - Prefer `responseMode: "enriched"` only for a small targeted result set; it
23
+ includes full content and should not become a broad dump.
24
+
25
+ ## Thresholds
26
+
27
+ Apply the firewall before bringing any of these raw artifacts into the main context:
28
+
29
+ - Source, docs, logs, CSV, or reports over 200 lines or 20 KB.
30
+ - Search, grep, MCP, or external research output over 50 hits.
31
+ - Generated audit reports, screenshots, browser snapshots, crash/device logs, or raw NotebookLM/web research dumps.
32
+ - Any subagent output, tool transcript, or diff where only counts, paths, representative snippets, or failing cases are needed for the next decision.
33
+
34
+ ## Tool Output Discipline
35
+
36
+ - Do not paste raw logs, snapshots, huge diffs, CSVs, or long command output into the main conversation.
37
+ - Summarize the result and include exact source pointers, commands, line numbers, or artifact paths.
38
+ - Artifact, memory, and search output is metadata-and-summary by default: include keys, paths, versions, checksums, statuses, counts, short summaries, and exact next steps only.
39
+ - Do not bring raw full artifact JSON, all-version artifact dumps, raw memory dumps, raw `search` result bodies, or long command transcripts into working context unless diagnosing corruption and no smaller proof can answer the question.
40
+ - Summarize raw subagent output, raw diffs, raw search output, raw logs, raw transcripts, and external research before they reach the main context.
41
+ - If conversation feedback is active, status lines may say what is being loaded, checked, blocked, or verified, but must not include raw tool output or private reasoning.
42
+ - Re-open only the smallest raw segment needed to verify a claim.
43
+ - If output is too large to inspect safely, delegate to a subagent or run a local summarizing command.
44
+
45
+ ## Subagent Firewall
46
+
47
+ Use `references/agent-orchestration.md` for context-heavy research, verbose log inspection, or independent verification when delegation gates are met.
48
+
49
+ The main agent receives only:
50
+
51
+ - evidence
52
+ - findings
53
+ - risks and skipped checks
54
+ - exact next step
55
+
56
+ Subagents should not return raw dumps. The main agent still owns memory recall, persistence, synthesis, and the final Evidence Gate.
57
+
58
+ ## Persistence Boundary
59
+
60
+ `massa-ai` remains the canonical memory layer for massa-ai workflows. Do not introduce `.notebook/`, SQLite, generated state files, or new persistence systems unless a separate workflow explicitly requires them.
61
+
62
+ `references/conversation-feedback.md` is chat-visible progress only. It must not be treated as durable state, memory, or an event store.
@@ -0,0 +1,104 @@
1
+ # Conversation Feedback
2
+
3
+ Use this reference when a massa-ai workflow needs chat-visible status updates for routing, loading, memory, NotebookLM, subagents, divergences, errors, verification, or completion.
4
+
5
+ ## Principle
6
+
7
+ Conversation feedback is a user-facing progress layer, not a log system. Keep each update readable, factual, and short enough that it helps the user understand what is happening without dragging raw tool output into the chat.
8
+
9
+ ## Policy Source
10
+
11
+ Read the canonical Conversation Feedback Policy from the installed `AGENTS.md`
12
+ bootstrap block (`<!-- massa-ai:bootstrap -->`), whose single source is
13
+ `skills/AGENTS.md` in the product repo. If that
14
+ file is unavailable, emit concise transition updates automatically, keep each
15
+ update to 1-2 lines, and suppress chain-of-thought, raw logs, secrets, and
16
+ repeated micro-events.
17
+
18
+ ## Line Shape
19
+
20
+ Each status update must be 1-2 lines. Use an emoji, a capitalized label in square brackets, and one or two plain sentences.
21
+
22
+ Do:
23
+
24
+ ```md
25
+ 🔵 [Start] Planning visual feedback for massa-ai. Workflow: Spec Driven. Session: Visual Feedback.
26
+ 🔄 [Loading] Reading AGENTS.md and massa-ai router guidance before planning.
27
+ 🧠 [Context] Found 8 relevant massa-ai memories and queried the requested NotebookLM source.
28
+ 🤖 [Agent Running] Plan Critic is checking failure modes for the proposed design.
29
+ ⚠️ [Divergence] Expected the legacy router path, but this checkout uses skills/massa-ai/SKILL.md.
30
+ ✅ [Verified] Stale-reference checks and skill validation passed.
31
+ 🏁 [Finished] Plan complete. Changed files: none. Remaining risk: none found.
32
+ ```
33
+
34
+ Avoid terse machine-shaped status lines, lowercase labels, equals-sign syntax, and tiny abbreviations.
35
+
36
+ When relevant, compactly surface phase, loaded context, context pressure,
37
+ checks, risk, handoff state, queue/delegation state, sync outcome, memory
38
+ outcome, skipped checks, and residual risk. Omit fields that do not affect the
39
+ next user decision.
40
+
41
+ ## Supported Labels
42
+
43
+ | Label | Use When |
44
+ |---|---|
45
+ | `Start` | A coding, planning, audit, debug, handoff, ADR, RFC, or TDD workflow begins. |
46
+ | `Routing` | The workflow, entity, project, or session is selected. |
47
+ | `Loading` | Reading a rule, skill, workflow, reference, document, NotebookLM source, or other context source. |
48
+ | `Context` | Reporting memory, search, NotebookLM, source, or repo context that was found or unavailable. |
49
+ | `Decision` | A meaningful tradeoff, scope decision, workflow choice, or default has been chosen. |
50
+ | `Agent Started` | A subagent or delegated role is launched. |
51
+ | `Agent Running` | A subagent is active, waiting, or doing a bounded task. |
52
+ | `Agent Done` | A subagent returns usable evidence, findings, implementation, or verification. |
53
+ | `Agent Blocked` | A subagent cannot complete its assigned scope or needs main-thread/user action. |
54
+ | `Divergence` | Expected context, paths, plan details, user claims, or repo reality disagree. |
55
+ | `Warning` | Work can continue, but confidence or verification is limited. |
56
+ | `Error` | A command, tool, workflow, or required check failed and needs recovery. |
57
+ | `Verified` | Deterministic checks, source inspection, or artifact validation produced evidence. |
58
+ | `Finished` | The workflow closes with changed artifacts, memory outcome, and residual risk. |
59
+
60
+ ## When To Emit
61
+
62
+ Emit status updates at lifecycle boundaries and during any work phase lasting >30 seconds:
63
+
64
+ - workflow start and routing
65
+ - before loading substantial rules, workflows, references, docs, NotebookLM sources, or broad context
66
+ - after memory/search/context discovery when it changes the next step
67
+ - before and after NotebookLM, web, MCP, or shell checks expected to take >30 seconds
68
+ - after a Synapse fallback or schema divergence changes retrieval behavior;
69
+ report the behavior, not secret values or raw session payloads
70
+ - before starting a subagent, while waiting on a long-running subagent, and after it returns
71
+ - when repo reality diverges from expected paths, names, branches, files, docs, or user-provided assumptions
72
+ - when a warning, recoverable tool failure, or blocking error appears
73
+ - after deterministic verification
74
+ - at final completion
75
+
76
+ Skip updates for micro-events such as every small file read, every search retry, or repeated polling with no new state.
77
+
78
+ ## Privacy And Context Discipline
79
+
80
+ Never include private reasoning, chain-of-thought, raw logs, raw diffs, raw snapshots, raw search output, raw subagent prompts, secrets, or long tool output in feedback updates.
81
+
82
+ Use `references/context-firewall.md` when raw output is verbose. Feedback should summarize the visible state and point to evidence later in the final report.
83
+
84
+ ## Subagent Feedback
85
+
86
+ When a subagent is used, the main agent reports only the role, scope, permission mode, current task, and status. Do not expose raw subagent prompts or internal deliberation.
87
+
88
+ Examples:
89
+
90
+ ```md
91
+ 🤖 [Agent Started] Verifier is checking the docs-only change set. Scope: massa-ai references and README.
92
+ 🤖 [Agent Done] Verifier found no stale references. Skipped checks: none.
93
+ ```
94
+
95
+ ## Completion Feedback
96
+
97
+ Use `Verified` after checks pass or when the strongest available evidence is inspected. Use `Finished` only after the Evidence Gate summary is ready.
98
+
99
+ Example:
100
+
101
+ ```md
102
+ ✅ [Verified] Skill validation and stale-reference scans passed.
103
+ 🏁 [Finished] Updated conversation feedback docs. Memory outcome: durable decision stored. Remaining risk: none found.
104
+ ```
@@ -0,0 +1,140 @@
1
+ # Debug Diagnosis Loop
2
+
3
+ Use this reference when `workflows/debug.md` asks for an evidence-first diagnosis loop.
4
+
5
+ ## Principle
6
+
7
+ Debugging is a feedback-loop problem first and a code-change problem second. Before editing, establish a trustworthy way to observe the failure and later prove the fix, or document why only root-cause proof is possible.
8
+
9
+ ## Intake Packet
10
+
11
+ Capture the smallest useful issue packet before broad investigation:
12
+
13
+ - Expected behavior
14
+ - Actual behavior
15
+ - Environment: local, CI, staging, production, browser/device, service, region, tenant, or data set
16
+ - Frequency: always, intermittent, percentage, time window, or reproduction count
17
+ - Affected components and entry point
18
+ - Reproducibility: command, request, user steps, fixture, trace, or missing repro
19
+ - Recent changes: deploy, config, dependency, schema, data, feature flag, infrastructure, or permissions
20
+ - Safety constraints: production access limits, data sensitivity, allowed mutation level, and rollback constraints
21
+
22
+ If any field is unknown, continue with available evidence unless the missing field blocks a safe pass/fail loop.
23
+
24
+ ## Feedback-Loop Gate
25
+
26
+ Pick the first reproduction ladder step that preserves the original failure signal and can be rerun after the fix:
27
+
28
+ - Unit/component or CLI repro around the failing seam, including a focused failing test, regression scaffold, or command transcript
29
+ - Integration/API/service repro, including `curl`/HTTP script, API client command, route smoke check, fixture, or trace replay
30
+ - App/browser/device/simulator repro, including browser automation, UI artifact inspection, emulator/simulator/device run, or screenshot/video proof
31
+ - Trace, replay, or event fixture
32
+ - Throwaway harness in a temp location when production code is hard to reach
33
+ - Fuzz/property loop when input space is the suspected trigger
34
+ - `git bisect`, dependency diff, config diff, or differential run between known good and bad versions
35
+ - Structured human-in-the-loop (HITL) script when the user must perform a step: exact action, exact observation, exact pass/fail signal
36
+
37
+ Skipped-reason enum when no loop can run: `missing-credentials`, `missing-service`, `missing-hardware`, `unsafe-production`, `destructive-risk`, `tool-missing`, `data-unavailable`, or `not-reproducible-yet`.
38
+
39
+ Loop quality rules:
40
+
41
+ - Prefer deterministic, fast, local loops.
42
+ - Preserve the original user-facing failure signal; do not replace it with a narrower check unless the original loop is also rerun before completion.
43
+ - If the loop requires unavailable credentials, services, or data, state the missing dependency and use the strongest root-cause proof available.
44
+ - Do not edit code to "see what happens" before the loop or proof exists.
45
+
46
+ ## Non-Deterministic Failures
47
+
48
+ For flaky or production-only failures, raise the reproduction rate before root-cause guessing:
49
+
50
+ - Measure the current reproduction rate, such as `3/50` runs or "appeared twice in 20 minutes".
51
+ - Isolate entropy one source at a time: time, randomness, async scheduling, cache, filesystem, network, concurrency, global state, data ordering, environment variables, feature flags, clock/timezone, permissions, and external services.
52
+ - Add controls or probes that increase signal: fixed seeds, fake timers, serialized execution, cache reset, narrowed input set, correlation IDs, or sampled traces.
53
+ - If the failure cannot be made repeatable, keep the confidence label explicit and verify with multiple independent signals.
54
+
55
+ ## Minimize The Case
56
+
57
+ Reduce noise while preserving the failure:
58
+
59
+ - Smallest input, request body, fixture, trace, or UI step set that still fails
60
+ - Smallest module path that still contains the divergence
61
+ - Smallest environment difference or recent-change window that explains the symptom
62
+ - Smallest commit/dependency/config range when regression timing matters
63
+
64
+ Stop minimizing when further reduction would remove the actual behavior being debugged.
65
+
66
+ ## Hypothesis Board
67
+
68
+ Before testing, create 3-5 falsifiable hypotheses. Use prior memories to avoid repeating ruled-out paths.
69
+
70
+ ```md
71
+ | Rank | Hypothesis | Why plausible | Prediction | Probe | Disproof | Result |
72
+ |---|---|---|---|---|---|---|
73
+ | 1 | ... | evidence or memory | what should be true if this is root cause | command/log/assertion/inspection | what result rules it out | untested / supported / ruled out |
74
+ ```
75
+
76
+ Rules:
77
+
78
+ - Test the highest-value hypothesis first, not the easiest one if it has weak explanatory power.
79
+ - Each probe must have a clear predicted result before running it.
80
+ - Treat symptoms and root causes separately.
81
+ - Update the board after each probe; do not retry the same failing command more than twice unchanged.
82
+ - If evidence contradicts every hypothesis, revise the board instead of patching speculatively.
83
+
84
+ ## Instrumentation
85
+
86
+ Instrument to answer one question at a time:
87
+
88
+ - Prefer debugger, REPL, focused assertions, and small scripts before adding app logs.
89
+ - Add targeted tagged logs only when they answer a named hypothesis.
90
+ - Include correlation IDs, request IDs, timestamps, tenant/user-safe identifiers, or span IDs when needed to join events.
91
+ - Use structured parsers or summary commands for large logs; load `references/context-firewall.md` before bringing verbose output into context.
92
+ - Remove temporary instrumentation before completion unless the change is intentionally retained as observability, and document why it stays.
93
+
94
+ ## Production-Safe Diagnosis
95
+
96
+ Use these only when concrete tools, access, and user/project policy allow them. Do not hard-require any vendor or platform.
97
+
98
+ - OpenTelemetry spans, attributes, metrics, or trace correlation
99
+ - Feature-flagged debug logging with sampling and expiration
100
+ - Sampling profilers or read-only performance snapshots
101
+ - Protected read-only inspection through existing approved tools
102
+ - Canary, shadow traffic, replay, or staged rollout validation
103
+ - Release, config, dependency, schema, and feature-flag diffing
104
+
105
+ Production guardrails:
106
+
107
+ - Do not expose secrets, tokens, PII, or sensitive customer data in logs or memory.
108
+ - Avoid write operations against production during diagnosis unless the user explicitly approves and rollback is defined.
109
+ - Prefer canary or sampled checks over broad instrumentation.
110
+ - Record skipped production checks and why they could not run.
111
+
112
+ ## Fix And Prevention
113
+
114
+ Fix the divergence point closest to the root cause:
115
+
116
+ - Make the smallest behavior-preserving change that explains the evidence.
117
+ - Do not bundle adjacent refactors with the debug fix.
118
+ - Add regression coverage at the seam that failed: unit, integration, route, CLI, UI, contract, fixture, or monitor.
119
+ - If no valid regression seam exists, document the missing seam, provide the strongest available proof, and persist a testability or architecture note only when durable.
120
+ - Rerun the original feedback loop after the fix, plus the regression check and any validation assets from `references/verification-ladder.md`.
121
+
122
+ ## Output Contract
123
+
124
+ A completed debug workflow should report:
125
+
126
+ - Issue Summary: symptom, impact, frequency, and environment
127
+ - Feedback Loop: command, tool, artifact, or root-cause proof that showed failure and then success
128
+ - Hypothesis Board: ranked hypotheses and tested results
129
+ - Root Cause: evidence-backed diagnosis with the divergence point
130
+ - Fix + Validation: code/test strategy, verification recipe, and commands or artifacts checked
131
+ - Prevention: regression test, monitor/runbook suggestion, and memory outcome
132
+
133
+ ## Memory Guidance
134
+
135
+ Persist only durable debugging knowledge after recall and importance scoring:
136
+
137
+ - Root cause as semantic `decision` memory when future agents could repeat the mistake
138
+ - Reusable verification or diagnostic recipe as procedural `pattern` memory
139
+ - Ruled-out hypotheses as episodic `conversation` memory only when rediscovery would waste future effort
140
+ - Repeated failed tool loops as cognition lessons only when the lesson is reusable across sessions
@@ -0,0 +1,73 @@
1
+ # Decision Engine Reference
2
+
3
+ Load this when scoring memories, making a trade-off decision, or debugging with
4
+ prior attempts. Do not load for simple edits where no memory write or design
5
+ decision is needed.
6
+
7
+ ## Importance Calibration
8
+
9
+ Use named levels, then pass only `importance` to `remember`.
10
+
11
+ | Level | Float | Use when |
12
+ |---|---:|---|
13
+ | CRITICAL | 0.95 | Forgetting causes data loss, security holes, outage, or system-wide breakage. |
14
+ | HIGH | 0.8 | Forgetting causes bugs, architectural drift, or repeated wrong choices. |
15
+ | MEDIUM | 0.7 | Forgetting causes wasted effort or rediscovery. |
16
+ | LOW | 0.6 | Useful acceleration context, not essential. |
17
+ | SKIP | - | Trivial, local, duplicate, or not durable. |
18
+
19
+ Score from base 0.5:
20
+
21
+ | Question | Weight |
22
+ |---|---:|
23
+ | Would forgetting this cause a production bug/outage? | +0.15 |
24
+ | Does it affect more than one module/service/feature? | +0.10 |
25
+ | Would a future agent choose wrongly without it? | +0.15 |
26
+ | Did it take meaningful effort to discover/decide? | +0.10 |
27
+ | Is it a hard constraint rather than a preference? | +0.10 |
28
+
29
+ Map score: 0.95 CRITICAL, 0.8 HIGH, 0.7 MEDIUM, 0.6 LOW, otherwise SKIP.
30
+
31
+ ## Memory Examples
32
+
33
+ - CRITICAL: auth token algorithm constraint after a security incident.
34
+ - HIGH: project architecture pattern future agents must follow.
35
+ - MEDIUM: ruled-out hypothesis that took real investigation.
36
+ - LOW: useful but nonessential local workflow context.
37
+ - SKIP: user formatting preference or already-captured fact.
38
+
39
+ ## Trade-Off Template
40
+
41
+ ```text
42
+ Decision: <what changed>
43
+ Optimizing for: <benefit>
44
+ Sacrificing: <cost>
45
+ Reversibility: easy | hard | irreversible
46
+ Confidence: high | medium | low
47
+ Evidence: <source-backed facts>
48
+ ```
49
+
50
+ ## Product And System Checks
51
+
52
+ Before a non-trivial change, ask:
53
+
54
+ - What user problem does this solve?
55
+ - Is it core flow or edge case?
56
+ - What is the simplest solution that works?
57
+ - What coupling, maintainability, observability, or scaling tradeoff changes?
58
+
59
+ ## Debugging Heuristics
60
+
61
+ Most bugs come from state inconsistency, async/race issues, wrong data-shape
62
+ assumptions, or environment differences.
63
+
64
+ Debug loop:
65
+
66
+ 1. Recall prior attempts and known patterns.
67
+ 2. Define expected vs actual behavior.
68
+ 3. Trace input -> transformation -> output.
69
+ 4. Check recent changes first.
70
+ 5. Test one falsifiable hypothesis at a time.
71
+ 6. Persist durable lessons only after scoring.
72
+
73
+ Avoid blind whole-repo scans when a targeted recall/search path exists.
@@ -0,0 +1,53 @@
1
+ # Evidence Gate
2
+
3
+ Read this before declaring a task complete, closing a session, or handing work to another agent.
4
+
5
+ For non-trivial edits or broad workflow work, load `references/verification-ladder.md` and report the highest verification level reached.
6
+
7
+ If Conversation Feedback Policy is active, emit a `Verified` status after deterministic evidence is collected and a `Finished` status only when the completion summary is ready. Feedback lines do not replace the evidence report.
8
+
9
+ ## Required Completion Evidence
10
+
11
+ A completion report must include:
12
+
13
+ - Deterministic evidence: clean exit code, static check output, test result, build result, or concrete artifact inspection
14
+ - Verification ladder: level reached, validation assets protected, and skipped checks with reasons when applicable
15
+ - Changed artifacts: file paths changed, generated outputs, or state that no files changed
16
+ - Memory outcome: memories written, intentionally skipped with reason, duplicate skipped, forbidden payload skipped, or failed memory writes with recovery note
17
+ - Residual risk: unresolved errors, skipped checks, missing environment, or explicit `none found`
18
+
19
+ Completion reports must also state that tests, specs, fixtures, snapshots,
20
+ schemas, public contracts, and validator checks were not weakened unless the
21
+ user explicitly requested a validation-asset change.
22
+
23
+ ## Acceptable Evidence
24
+
25
+ | Work type | Minimum evidence |
26
+ |-----------|------------------|
27
+ | Docs/skill changes | `rg` stale-reference checks and file existence checks |
28
+ | Code changes | Verification recipe, relevant tests/build/lint/focused command output, and file-integrity check when validation assets are in scope |
29
+ | Debug fix | Reproduction no longer fails or root-cause path is proven |
30
+ | Audit / Implementation Audit | Concrete findings tied to files/lines, plus skipped-check notes |
31
+ | Handoff | Session Guide with exact `workflowSessionId`, `projectId`, next step, and unresolved risks; ephemeral Synapse IDs are excluded |
32
+
33
+ ## Example
34
+
35
+ Use this compact shape when closing docs or skill work:
36
+
37
+ ```md
38
+ ✅ [Verified] Skill validation and stale-reference scans passed.
39
+ 🏁 [Finished] Updated massa-ai references. Memory outcome: durable decision stored. Remaining risk: none found.
40
+
41
+ Evidence: `rtk python3 skills/skill-architect/scripts/validate_skill.py skills/massa-ai --format json` passed; stale-reference and local-link scans passed.
42
+ Changed artifacts: `skills/massa-ai/SKILL.md`, `workflows/spec-driven.md`, `references/spec-driven/`, and `references/memory-policy.md`.
43
+ Memory outcome: wrote decision memory `dec_...`; no failed memory writes.
44
+ Residual risk: none found.
45
+ ```
46
+
47
+ ## Failure Rules
48
+
49
+ - Do not claim done if the only evidence is model self-evaluation.
50
+ - Do not retry the same failing command more than twice unchanged; diagnose or instrument first.
51
+ - If deterministic checks cannot run, state exactly why and provide the strongest available manual check.
52
+ - Do not modify validation artifacts to make a check pass unless the user explicitly asked to update the validation itself.
53
+ - Treat judge, faithfulness, or semantic checks as optional higher-order evidence only when a concrete tool or command exists.
@@ -0,0 +1,49 @@
1
+ # Role: furps-analyst
2
+
3
+ Reusable sub-agent role for `workflows/refinement/furps-refinement.md`. Charter follows `references/subagent-design.md`. Registered in `references/agent-orchestration.md`.
4
+
5
+ Purpose: analyze exactly one FURPS+ dimension (F, U, R, P, S, or X) of a PRD/ADR against its checklist section and return structured refinement findings.
6
+
7
+ Trigger description:
8
+ - Use when the `furps-refinement` workflow fans out per-dimension analysis and needs isolated context plus independent verification per dimension.
9
+ - Do not use when the work is a one-off local check, needs full conversation history, requires writes, or overlaps another role (use `plan-critic` for The Fool, `investigator`/`verifier` for code claims).
10
+
11
+ Permissions:
12
+ - Default: read-only.
13
+ - No write access. No Atlassian mutation. No memory writes — suggest only.
14
+
15
+ Context inputs:
16
+ - exact `projectId`
17
+ - exact parent `workflowSessionId` and a child session tag; an ephemeral Synapse session only if the role performs >=2 `search` calls
18
+ - workflow name (`furps-refinement`) and role name (`furps-analyst`)
19
+ - assigned dimension letter and its `references/furps/checklist.md` section
20
+ - bounded document packet (sections/summaries, DoR, recalled facts, Fool summary)
21
+ - exclusions: other dimensions (flag, do not expand), sibling-workflow targets
22
+ - allowed tools: read-only file, read-only MCP, `search`
23
+ - context-firewall limits: summarize the document; return evidence/findings only
24
+
25
+ Process:
26
+ 1. Confirm the assigned dimension and refusal conditions (do not analyze other dimensions; do not write files).
27
+ 2. For each check item in the dimension's section, locate evidence in the document (quote plus section) or confirm absence.
28
+ 3. Assign status: `covered` | `partial` | `missing` | `unclear`.
29
+ 4. Produce `FR-<letter>-<N>` findings for every `missing`/`unclear` item and for `partial` items when the gap is non-trivial.
30
+ 5. Tag each finding's contribution to Open Questions / Suggestions / Insights / Risks / DoR-gaps.
31
+ 6. Return compact findings — no raw document dumps.
32
+
33
+ Output contract:
34
+ - Status: Complete | Partial | Blocked
35
+ - Scope checked: dimension plus check items evaluated
36
+ - Evidence: quotes/section IDs per check item
37
+ - Findings: `FR-<letter>-<N>` with severity, confidence, status, impact, simplest fix direction, verification suggestion
38
+ - Contributions: open questions / suggestions / insights / risks / DoR-gaps
39
+ - Risks and skipped checks
40
+ - Exact next step
41
+
42
+ Validation sensors:
43
+ - source-location proof (quote plus section) for every `covered`/`partial` claim
44
+ - absent-claim detection for every `missing` claim
45
+ - no self-evaluation: every finding ties to a concrete check item and document evidence
46
+
47
+ Memory boundary:
48
+ - Suggest durable memories only when a reusable refinement pattern is discovered.
49
+ - Do not persist broad project memory. The main agent persists after synthesis.