@massa-ai/codex-plugin 1.26.0 → 1.29.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 (156) hide show
  1. package/.codex-plugin/plugin.json +1 -1
  2. package/agent-profiles/balanced/massa-ai-judge.toml +5 -8
  3. package/agent-profiles/balanced/massa-ai-meta-judge.toml +2 -5
  4. package/agent-profiles/balanced/massa-ai-navigator.toml +1 -1
  5. package/agent-profiles/cheap/massa-ai-judge.toml +5 -8
  6. package/agent-profiles/cheap/massa-ai-meta-judge.toml +2 -5
  7. package/agent-profiles/cheap/massa-ai-navigator.toml +1 -1
  8. package/agent-profiles/heavy/massa-ai-judge.toml +5 -8
  9. package/agent-profiles/heavy/massa-ai-meta-judge.toml +2 -5
  10. package/agent-profiles/heavy/massa-ai-navigator.toml +1 -1
  11. package/agent-profiles/home/massa-ai-judge.toml +5 -8
  12. package/agent-profiles/home/massa-ai-meta-judge.toml +2 -5
  13. package/agent-profiles/home/massa-ai-navigator.toml +1 -1
  14. package/agent-profiles/work/massa-ai-judge.toml +5 -8
  15. package/agent-profiles/work/massa-ai-meta-judge.toml +2 -5
  16. package/agent-profiles/work/massa-ai-navigator.toml +1 -1
  17. package/agents/massa-ai-judge.toml +5 -8
  18. package/agents/massa-ai-meta-judge.toml +2 -5
  19. package/agents/massa-ai-navigator.toml +1 -1
  20. package/install.sh +32 -0
  21. package/package.json +1 -1
  22. package/skills/agents/judge/SKILL.md +6 -9
  23. package/skills/agents/meta-judge/SKILL.md +3 -6
  24. package/skills/agents/navigator/SKILL.md +2 -2
  25. package/skills/massa-ai/SKILL.md +6 -17
  26. package/skills/massa-ai/references/adr-authoring.md +3 -3
  27. package/skills/massa-ai/references/agent-orchestration.md +18 -3
  28. package/skills/massa-ai/references/architecture-coupling-lens.md +1 -1
  29. package/skills/massa-ai/references/architecture-deepening-lens.md +1 -1
  30. package/skills/massa-ai/references/architecture-domain-lens.md +1 -1
  31. package/skills/massa-ai/references/architecture-lenses.md +1 -1
  32. package/skills/massa-ai/references/audit-report-io.md +32 -2
  33. package/skills/massa-ai/references/audit-scope.md +22 -1
  34. package/skills/massa-ai/references/code-annotation.md +5 -5
  35. package/skills/massa-ai/references/codebase-investigation.md +1 -1
  36. package/skills/massa-ai/references/coding-guidelines.md +67 -0
  37. package/skills/massa-ai/references/context-firewall.md +2 -1
  38. package/skills/massa-ai/references/conversation-feedback.md +1 -1
  39. package/skills/massa-ai/references/debug-diagnosis-loop.md +1 -1
  40. package/skills/massa-ai/references/decision-engine.md +1 -1
  41. package/skills/massa-ai/references/evidence-gate.md +1 -1
  42. package/skills/massa-ai/references/figma-pre-analysis.md +3 -3
  43. package/skills/massa-ai/references/furps/analyst-role.md +1 -1
  44. package/skills/massa-ai/references/furps/checklist.md +1 -1
  45. package/skills/massa-ai/references/furps/intake.md +1 -1
  46. package/skills/massa-ai/references/furps/report-contract.md +1 -1
  47. package/skills/massa-ai/references/graceful-degradation.md +22 -0
  48. package/skills/massa-ai/references/hook-enforcement.md +3 -3
  49. package/skills/massa-ai/references/implementation-delivery.md +4 -4
  50. package/skills/massa-ai/references/installation.md +1 -1
  51. package/skills/massa-ai/references/lessons.md +2 -2
  52. package/skills/massa-ai/references/maestro/artifacts-reports.md +1 -1
  53. package/skills/massa-ai/references/maestro/cli-device.md +1 -1
  54. package/skills/massa-ai/references/maestro/cloud.md +1 -1
  55. package/skills/massa-ai/references/maestro/config-env-output.md +1 -1
  56. package/skills/massa-ai/references/maestro/fact-ledger.md +1 -1
  57. package/skills/massa-ai/references/maestro/js-scripting.md +1 -1
  58. package/skills/massa-ai/references/maestro/mcp.md +1 -1
  59. package/skills/massa-ai/references/maestro/patterns.md +1 -1
  60. package/skills/massa-ai/references/maestro/selectors.md +1 -1
  61. package/skills/massa-ai/references/maestro/workspace-execution.md +1 -1
  62. package/skills/massa-ai/references/maestro/yaml-commands.md +1 -1
  63. package/skills/massa-ai/references/maestro.md +1 -1
  64. package/skills/massa-ai/references/mcp-tools.md +2 -2
  65. package/skills/massa-ai/references/memory-policy.md +2 -2
  66. package/skills/massa-ai/references/mobile-context.md +9 -5
  67. package/skills/massa-ai/references/mobile-diagnosis.md +2 -2
  68. package/skills/massa-ai/references/mobile-figma-matcher/android-compose.md +1 -1
  69. package/skills/massa-ai/references/mobile-figma-matcher/android-views.md +1 -1
  70. package/skills/massa-ai/references/mobile-figma-matcher/core.md +1 -1
  71. package/skills/massa-ai/references/mobile-figma-matcher/ios-swiftui.md +1 -1
  72. package/skills/massa-ai/references/mobile-figma-matcher/ios-uikit.md +1 -1
  73. package/skills/massa-ai/references/mobile-figma-matcher/kmp-compose-multiplatform.md +1 -1
  74. package/skills/massa-ai/references/mobile-figma-matcher/repository-detection.md +1 -1
  75. package/skills/massa-ai/references/naming-standards.md +1 -1
  76. package/skills/massa-ai/references/pr-task-fix.md +2 -2
  77. package/skills/massa-ai/references/project-context.md +2 -2
  78. package/skills/massa-ai/references/repo-rules-discovery.md +4 -4
  79. package/skills/massa-ai/references/rfc/discovery-and-sizing.md +1 -1
  80. package/skills/massa-ai/references/rfc/document-contract.md +1 -1
  81. package/skills/massa-ai/references/rfc/quality-and-lifecycle.md +1 -1
  82. package/skills/massa-ai/references/root-cause-scripts.md +2 -2
  83. package/skills/massa-ai/references/skill-architect/examples.md +256 -0
  84. package/skills/massa-ai/references/skill-architect/patterns.md +317 -0
  85. package/skills/massa-ai/references/skill-architect/quality-checklist.md +70 -0
  86. package/skills/massa-ai/references/sonarqube-mcp.md +73 -0
  87. package/skills/massa-ai/references/spec-driven/artifact-store.md +1 -1
  88. package/skills/massa-ai/references/spec-driven/brownfield-mapping.md +16 -0
  89. package/skills/massa-ai/references/spec-driven/code-analysis.md +1 -1
  90. package/skills/massa-ai/references/spec-driven/coding-principles.md +1 -1
  91. package/skills/massa-ai/references/spec-driven/context-limits.md +1 -1
  92. package/skills/massa-ai/references/spec-driven/design.md +22 -1
  93. package/skills/massa-ai/references/spec-driven/discuss.md +1 -1
  94. package/skills/massa-ai/references/spec-driven/execute.md +3 -1
  95. package/skills/massa-ai/references/spec-driven/memory.md +1 -1
  96. package/skills/massa-ai/references/spec-driven/specify.md +3 -3
  97. package/skills/massa-ai/references/spec-driven/sub-agents.md +1 -1
  98. package/skills/massa-ai/references/spec-driven/tasks.md +1 -1
  99. package/skills/massa-ai/references/spec-driven/validate.md +1 -1
  100. package/skills/massa-ai/references/subagent-design.md +4 -4
  101. package/skills/massa-ai/references/synapse-policy.md +1 -1
  102. package/skills/massa-ai/references/tdd/calibrated-examples.md +1 -1
  103. package/skills/massa-ai/references/tdd/discovery-and-sizing.md +1 -1
  104. package/skills/massa-ai/references/tdd/document-contract.md +1 -1
  105. package/skills/massa-ai/references/tdd/quality-and-lifecycle.md +1 -1
  106. package/skills/massa-ai/references/the-fool/cognitive-bias-inventory.md +1 -1
  107. package/skills/massa-ai/references/the-fool/dialectic-synthesis.md +1 -1
  108. package/skills/massa-ai/references/the-fool/evidence-audit.md +1 -1
  109. package/skills/massa-ai/references/the-fool/pre-mortem-analysis.md +1 -1
  110. package/skills/massa-ai/references/the-fool/red-team-adversarial.md +1 -1
  111. package/skills/massa-ai/references/the-fool/socratic-questioning.md +1 -1
  112. package/skills/massa-ai/references/ticket/atlassian-fix.md +1 -1
  113. package/skills/massa-ai/references/ticket/intake-and-sources.md +1 -1
  114. package/skills/massa-ai/references/ticket/templates-and-quality.md +1 -1
  115. package/skills/massa-ai/references/verification-ladder.md +1 -1
  116. package/skills/massa-ai/scripts/validate_audit_report.ts +382 -0
  117. package/skills/massa-ai/scripts/validate_design.ts +264 -0
  118. package/skills/massa-ai/scripts/validate_skill.ts +364 -0
  119. package/skills/massa-ai/workflows/adr.md +16 -8
  120. package/skills/massa-ai/workflows/architecture/architecture-audit.md +23 -40
  121. package/skills/massa-ai/workflows/architecture/architecture-fix.md +14 -6
  122. package/skills/massa-ai/workflows/bugs/bugs-audit.md +19 -35
  123. package/skills/massa-ai/workflows/bugs/bugs-fix.md +13 -5
  124. package/skills/massa-ai/workflows/code-quality/code-quality-audit.md +25 -41
  125. package/skills/massa-ai/workflows/code-quality/code-quality-fix.md +13 -5
  126. package/skills/massa-ai/workflows/commit.md +13 -5
  127. package/skills/massa-ai/workflows/debug.md +11 -3
  128. package/skills/massa-ai/workflows/design.md +15 -7
  129. package/skills/massa-ai/workflows/exploration.md +12 -4
  130. package/skills/massa-ai/workflows/feature.md +14 -13
  131. package/skills/massa-ai/workflows/general.md +13 -8
  132. package/skills/massa-ai/workflows/implementation/implementation-audit.md +15 -15
  133. package/skills/massa-ai/workflows/implementation/implementation-fix.md +13 -5
  134. package/skills/massa-ai/workflows/judge-with-debate.md +12 -4
  135. package/skills/massa-ai/workflows/long-session.md +10 -2
  136. package/skills/massa-ai/workflows/maestro/maestro-audit.md +11 -3
  137. package/skills/massa-ai/workflows/maestro/maestro-fix.md +12 -4
  138. package/skills/massa-ai/workflows/maestro/maestro.md +12 -4
  139. package/skills/massa-ai/workflows/mobile-figma/mobile-figma-audit.md +11 -3
  140. package/skills/massa-ai/workflows/mobile-figma/mobile-figma-fix.md +12 -4
  141. package/skills/massa-ai/workflows/onboarding.md +10 -2
  142. package/skills/massa-ai/workflows/refactor.md +12 -4
  143. package/skills/massa-ai/workflows/refinement/furps-refinement.md +12 -4
  144. package/skills/massa-ai/workflows/requirements/requirements-audit.md +19 -36
  145. package/skills/massa-ai/workflows/requirements/requirements-fix.md +13 -5
  146. package/skills/massa-ai/workflows/rfc.md +10 -2
  147. package/skills/massa-ai/workflows/security/security-audit.md +19 -35
  148. package/skills/massa-ai/workflows/security/security-fix.md +13 -5
  149. package/skills/massa-ai/workflows/skill-architect.md +393 -0
  150. package/skills/massa-ai/workflows/spec-driven.md +20 -23
  151. package/skills/massa-ai/workflows/tdd.md +10 -2
  152. package/skills/massa-ai/workflows/tests/tests-audit.md +19 -35
  153. package/skills/massa-ai/workflows/tests/tests-fix.md +13 -5
  154. package/skills/massa-ai/workflows/the-fool.md +11 -3
  155. package/skills/massa-ai/workflows/ticket.md +10 -2
  156. package/skills/massa-ai/workflows/to-prd.md +81 -0
@@ -0,0 +1,317 @@
1
+ # Skill Patterns Reference
2
+
3
+ This document details the five proven patterns for skill architecture.
4
+ Read this when deciding how to structure a skill's workflow during the
5
+ Architecture phase.
6
+
7
+ ## Table of Contents
8
+
9
+ 1. Sequential Workflow Orchestration (line ~20)
10
+ 2. Multi-MCP Coordination (line ~70)
11
+ 3. Iterative Refinement (line ~120)
12
+ 4. Context-Aware Tool Selection (line ~170)
13
+ 5. Domain-Specific Intelligence (line ~210)
14
+ 6. Choosing Between Patterns (line ~250)
15
+ 7. Combining Patterns (line ~280)
16
+
17
+ ---
18
+
19
+ ## 1. Sequential Workflow Orchestration
20
+
21
+ **Use when:** Users need multi-step processes executed in a specific order,
22
+ where each step depends on the previous one.
23
+
24
+ **Problem-first framing:** "I need to onboard a new customer" → Skill
25
+ orchestrates the right calls in the right sequence.
26
+
27
+ **Key characteristics:**
28
+
29
+ - Explicit step ordering with dependencies between steps
30
+ - Validation gates between steps (don't proceed if step N fails)
31
+ - Rollback instructions for failures
32
+ - Data flows from earlier steps to later ones
33
+
34
+ **Structure template:**
35
+
36
+ ```markdown
37
+ ## Workflow: [Name]
38
+
39
+ ### Step 1: [Action]
40
+ Call tool: `tool_name`
41
+ Parameters: [what's needed]
42
+ Validation: [how to know it succeeded]
43
+ On failure: [what to do]
44
+
45
+ ### Step 2: [Action]
46
+ Depends on: Step 1 (uses [specific output])
47
+ Call tool: `tool_name`
48
+ Parameters: [include output from Step 1]
49
+ Validation: [check]
50
+
51
+ ### Step 3: [Action]
52
+ ...
53
+ ```
54
+
55
+ **When to choose this pattern:**
56
+
57
+ - The workflow has a natural linear order
58
+ - Steps have clear dependencies
59
+ - Skipping a step would break the workflow
60
+ - Users currently do these steps manually in sequence
61
+
62
+ **Watch out for:**
63
+
64
+ - Rigid ordering when some steps could be parallel
65
+ - Missing rollback logic (what if step 3 fails after step 1 and 2 succeeded?)
66
+ - Not validating between steps
67
+
68
+ ---
69
+
70
+ ## 2. Multi-MCP Coordination
71
+
72
+ **Use when:** Workflows span multiple external services, each connected
73
+ via its own MCP server.
74
+
75
+ **Key characteristics:**
76
+
77
+ - Clear phase separation by service
78
+ - Data passing between MCP servers
79
+ - Validation before moving to next phase
80
+ - Centralized error handling across services
81
+
82
+ **Structure template:**
83
+
84
+ ```markdown
85
+ ## Workflow: [Name]
86
+
87
+ ### Phase 1: [Service A] ([MCP name])
88
+ 1. [Action using Service A tools]
89
+ 2. [Action using Service A tools]
90
+ Output: [data needed by Phase 2]
91
+
92
+ ### Phase 2: [Service B] ([MCP name])
93
+ Input: [data from Phase 1]
94
+ 1. [Action using Service B tools]
95
+ 2. [Action using Service B tools]
96
+ Output: [data needed by Phase 3]
97
+
98
+ ### Phase 3: [Service C] ([MCP name])
99
+ ...
100
+
101
+ ## Error Handling
102
+ - If Phase 1 fails: [action]
103
+ - If Phase 2 fails but Phase 1 succeeded: [action]
104
+ ```
105
+
106
+ **When to choose this pattern:**
107
+
108
+ - The workflow crosses service boundaries
109
+ - Multiple MCP servers are involved
110
+ - Data needs to flow between services
111
+ - Users currently switch between tools manually
112
+
113
+ **Watch out for:**
114
+
115
+ - Assuming all MCPs are connected (check availability first)
116
+ - Not handling partial failures (Phase 2 fails but Phase 1 already ran)
117
+ - Tight coupling between phases (prefer passing data explicitly)
118
+
119
+ ---
120
+
121
+ ## 3. Iterative Refinement
122
+
123
+ **Use when:** Output quality improves through multiple review-and-fix cycles.
124
+
125
+ **Key characteristics:**
126
+
127
+ - Initial draft generation
128
+ - Quality check against explicit criteria
129
+ - Refinement loop with clear stopping conditions
130
+ - Finalization step
131
+
132
+ **Structure template:**
133
+
134
+ ```markdown
135
+ ## Workflow: [Name]
136
+
137
+ ### Initial Draft
138
+ 1. Gather input data
139
+ 2. Generate first version
140
+ 3. Save to working file
141
+
142
+ ### Quality Check
143
+ Run validation: `scripts/[check_quality].py`
144
+ Criteria:
145
+ - [Criterion 1]: [how to check]
146
+ - [Criterion 2]: [how to check]
147
+ - [Criterion 3]: [how to check]
148
+
149
+ ### Refinement Loop
150
+ For each issue found:
151
+ 1. Identify the specific problem
152
+ 2. Fix it
153
+ 3. Re-validate
154
+
155
+ STOP when:
156
+ - All criteria pass, OR
157
+ - 3 iterations completed (diminishing returns), OR
158
+ - User signals satisfaction
159
+
160
+ ### Finalization
161
+ 1. Apply final formatting
162
+ 2. Generate summary of changes
163
+ 3. Save final version
164
+ ```
165
+
166
+ **When to choose this pattern:**
167
+
168
+ - Output quality is subjective or multi-dimensional
169
+ - First drafts are usually "close but not quite"
170
+ - Users currently review and ask for revisions manually
171
+ - There are explicit quality criteria to check against
172
+
173
+ **Watch out for:**
174
+
175
+ - Infinite loops (always define stopping conditions)
176
+ - Over-polishing (3 iterations is usually enough)
177
+ - Vague quality criteria (make them checkable)
178
+
179
+ ---
180
+
181
+ ## 4. Context-Aware Tool Selection
182
+
183
+ **Use when:** The same goal can be achieved with different tools depending
184
+ on the input or context.
185
+
186
+ **Key characteristics:**
187
+
188
+ - Decision tree based on input properties
189
+ - Fallback options when primary choice isn't available
190
+ - Transparency about why a particular path was chosen
191
+
192
+ **Structure template:**
193
+
194
+ ```markdown
195
+ ## Workflow: [Name]
196
+
197
+ ### Analyze Input
198
+ Check: [what properties to examine]
199
+ - Property A: [value range or type]
200
+ - Property B: [value range or type]
201
+
202
+ ### Decision Tree
203
+ IF [condition 1]:
204
+ → Use [Tool/Approach A]
205
+ Rationale: [why this is better for this case]
206
+ ELIF [condition 2]:
207
+ → Use [Tool/Approach B]
208
+ Rationale: [why]
209
+ ELSE:
210
+ → Use [Tool/Approach C] (default)
211
+
212
+ ### Execute
213
+ Based on decision, execute using the selected approach.
214
+
215
+ ### Explain Choice
216
+ Tell the user which approach was selected and why.
217
+ ```
218
+
219
+ **When to choose this pattern:**
220
+
221
+ - Multiple valid approaches exist for the same goal
222
+ - The "best" approach depends on input characteristics
223
+ - Users don't know (or shouldn't need to know) which tool is optimal
224
+
225
+ **Watch out for:**
226
+
227
+ - Decision criteria that overlap (ambiguous routing)
228
+ - Missing fallback for edge cases
229
+ - Not explaining the choice to the user
230
+
231
+ ---
232
+
233
+ ## 5. Domain-Specific Intelligence
234
+
235
+ **Use when:** The skill's value comes from specialized knowledge, not just
236
+ tool orchestration.
237
+
238
+ **Key characteristics:**
239
+
240
+ - Domain rules and constraints embedded in logic
241
+ - Compliance or validation checks before action
242
+ - Comprehensive audit trails
243
+ - Expert-level decision making
244
+
245
+ **Structure template:**
246
+
247
+ ```markdown
248
+ ## Workflow: [Name]
249
+
250
+ ### Pre-Check ([Domain] Rules)
251
+ Before proceeding, verify:
252
+ 1. [Domain rule 1]: [how to check]
253
+ 2. [Domain rule 2]: [how to check]
254
+ 3. [Domain rule 3]: [how to check]
255
+
256
+ IF any rule fails:
257
+ → [Escalation or alternative path]
258
+ → Document the failure
259
+
260
+ ### Execute
261
+ Only if pre-checks pass:
262
+ 1. [Action with domain context]
263
+ 2. [Action with domain context]
264
+
265
+ ### Audit Trail
266
+ Log:
267
+ - All checks performed and results
268
+ - Decisions made and rationale
269
+ - Actions taken
270
+ ```
271
+
272
+ **When to choose this pattern:**
273
+
274
+ - The skill needs expert knowledge to execute correctly
275
+ - There are compliance, safety, or quality rules to enforce
276
+ - Getting it wrong has significant consequences
277
+ - Users benefit from the skill's "expertise" more than its automation
278
+
279
+ **Watch out for:**
280
+
281
+ - Outdated domain knowledge (plan for updates)
282
+ - Over-encoding rules that change frequently (reference external docs instead)
283
+ - Not documenting the reasoning for decisions
284
+
285
+ ---
286
+
287
+ ## 6. Choosing Between Patterns
288
+
289
+ | Signal | Suggested Pattern |
290
+ |--------|------------------|
291
+ | "Do A, then B, then C" | Sequential Workflow |
292
+ | "Get data from X, send to Y, notify in Z" | Multi-MCP Coordination |
293
+ | "Make it good, then review and improve" | Iterative Refinement |
294
+ | "Handle PDFs differently from CSVs" | Context-Aware Selection |
295
+ | "Follow our compliance rules" | Domain-Specific Intelligence |
296
+ | Steps have no dependencies | Consider parallel execution |
297
+ | User says "it depends" a lot | Context-Aware Selection |
298
+ | Quality is subjective | Iterative Refinement |
299
+
300
+ ---
301
+
302
+ ## 7. Combining Patterns
303
+
304
+ Most real skills combine patterns. Common combinations:
305
+
306
+ - **Sequential + Domain Intelligence:** Follow steps in order, but embed
307
+ expert checks at critical points (e.g., compliance check before payment)
308
+ - **Multi-MCP + Iterative:** Coordinate across services, then refine the
309
+ combined output
310
+ - **Context-Aware + Sequential:** Choose the right tool first, then follow
311
+ a sequential workflow specific to that tool
312
+ - **Domain Intelligence + Iterative:** Apply domain rules, generate output,
313
+ review against domain criteria, refine
314
+
315
+ When combining, identify the PRIMARY pattern (the one that shapes the
316
+ overall flow) and SECONDARY patterns (the ones that apply within specific
317
+ steps).
@@ -0,0 +1,70 @@
1
+ # Quality Checklist
2
+
3
+ Use this checklist at the end of the Validate phase to ensure the skill
4
+ meets all quality criteria before delivery.
5
+
6
+ ---
7
+
8
+ ## Structural Checks (Pass/Fail)
9
+
10
+ These are hard requirements. Any failure must be fixed.
11
+
12
+ - [ ] SKILL.md exists with exact casing
13
+ - [ ] YAML frontmatter has opening and closing `---` delimiters
14
+ - [ ] `name` field is present and kebab-case
15
+ - [ ] `name` matches the folder name
16
+ - [ ] `description` field is present
17
+ - [ ] `description` is under 1024 characters
18
+ - [ ] `description` contains no XML angle brackets (< >)
19
+ - [ ] `name` does not contain "claude" or "anthropic"
20
+ - [ ] No README.md inside the skill folder
21
+ - [ ] Folder name is kebab-case (no spaces, no capitals, no underscores)
22
+
23
+ ## Description Quality (Score 1-5)
24
+
25
+ Rate each and target 4+ on all:
26
+
27
+ - [ ] **Specificity (1-5):** Does it describe a concrete capability?
28
+ - [ ] **Trigger clarity (1-5):** Would the agent know when to load this?
29
+ - [ ] **User language (1-5):** Does it use phrases a user would actually say?
30
+ - [ ] **Scope boundaries (1-5):** Is it clear what this skill does NOT do?
31
+ - [ ] **Pushiness (1-5):** Is it assertive enough to avoid undertriggering?
32
+
33
+ ## Instruction Quality (Score 1-5)
34
+
35
+ - [ ] **Actionability (1-5):** Can the agent follow every step without ambiguity?
36
+ - [ ] **Specificity (1-5):** Are instructions concrete (not "validate properly")?
37
+ - [ ] **Examples (1-5):** Are there realistic input/output examples?
38
+ - [ ] **Error handling (1-5):** Are common failures addressed?
39
+ - [ ] **Progressive disclosure (1-5):** Is SKILL.md focused, with details in refs?
40
+ - [ ] **Composability (1-5):** Does it play well with other skills?
41
+
42
+ ## Trigger Testing
43
+
44
+ ### Should trigger (test 3-5 phrases)
45
+
46
+ 1. [ ] "[Obvious request]" → triggers? Y/N
47
+ 2. [ ] "[Paraphrased request]" → triggers? Y/N
48
+ 3. [ ] "[Informal request]" → triggers? Y/N
49
+
50
+ ### Should NOT trigger (test 3-5 phrases)
51
+
52
+ 1. [ ] "[Unrelated task]" → stays silent? Y/N
53
+ 2. [ ] "[Similar but different scope]" → stays silent? Y/N
54
+ 3. [ ] "[Generic question]" → stays silent? Y/N
55
+
56
+ ## Performance Targets
57
+
58
+ Aspirational benchmarks (adapt to your skill):
59
+
60
+ - [ ] Triggers on ≥90% of relevant queries
61
+ - [ ] Completes workflow without user correction
62
+ - [ ] Consistent results across separate sessions
63
+ - [ ] No failed tool/API calls per workflow
64
+ - [ ] Users don't need to prompt the agent about next steps
65
+
66
+ ## Final Sign-Off
67
+
68
+ - [ ] User has reviewed the skill
69
+ - [ ] Test phrases produce expected behavior
70
+ - [ ] Skill is packaged and ready for upload
@@ -0,0 +1,73 @@
1
+ # SonarQube MCP Protocol
2
+
3
+ Use from `workflows/implementation/implementation-audit.md` and
4
+ `workflows/implementation/implementation-fix.md` when SonarQube MCP tools may
5
+ be available for the current implementation scope.
6
+
7
+ ## Detection And Availability
8
+
9
+ Check whether SonarQube MCP is available and useful for the implementation
10
+ scope:
11
+
12
+ - Detect callable SonarQube MCP tools at runtime, such as project discovery,
13
+ issue search, file/snippet analysis, advanced code analysis, duplicated-file
14
+ search, component measures, security hotspots, guidelines, or quality gate
15
+ status.
16
+ - If SonarQube MCP is unavailable, no project key can be resolved, required
17
+ credentials/configuration are missing, or the target files are outside the
18
+ configured SonarQube project, record `SonarQube MCP: not evaluated` with the
19
+ skipped-check reason and continue normal lens synthesis.
20
+
21
+ ## Firewall And Invocation
22
+
23
+ If available, use `references/context-firewall.md` and pass only the
24
+ immutable implementation scope packet, resolved files, branch/PR identifiers,
25
+ project key, and minimal file contents or paths the selected SonarQube tools
26
+ require.
27
+
28
+ Wait for SonarQube MCP execution to finish when a tool starts analysis,
29
+ capture quality gate status when available, and summarize raw
30
+ issues/measures/hotspots instead of copying raw tool output into the report.
31
+
32
+ ## Normalization Areas
33
+
34
+ Normalize actionable SonarQube results into only these implementation audit
35
+ areas: Architecture, Correctness/Bugs, Code Quality, Security, and Tests. Do
36
+ not create a Requirements finding from SonarQube output.
37
+
38
+ ## Preserved Fields
39
+
40
+ Preserve Sonar issue key, rule key, tool name, severity/impact, file/line,
41
+ quality gate condition, and evidence summary inside the normalized finding.
42
+
43
+ ## ID Mapping
44
+
45
+ Use normal source-qualified implementation IDs after normalization, such as
46
+ `Architecture/ARCH-1`, `Correctness/BUG-1`, `Code Quality/CQ-1`,
47
+ `Security/SEC-1`, or `Tests/TST-1`; do not invent `SONAR-*` executable finding
48
+ IDs. The canonical area/prefix table and discipline live in
49
+ `references/audit-report-io.md` (Source-Qualified Finding IDs).
50
+
51
+ ## Exclusion Rules
52
+
53
+ Keep unmapped, duplicate, low-context, or out-of-scope SonarQube results in
54
+ Scope And Evidence or skipped checks, not in Findings or Execution Handoff.
55
+
56
+ ## Reporting Integration
57
+
58
+ - Include SonarQube MCP as evidence in the coverage matrix or Scope And
59
+ Evidence, with quality gate status when available.
60
+ - Sonar-derived findings enter the execution handoff only after normalization
61
+ to one supported source lens ID, with enough evidence for
62
+ `implementation-fix` to revalidate from the saved markdown report.
63
+ - Do not persist raw SonarQube output; persist only normalized, durable
64
+ patterns after Importance Calibration.
65
+
66
+ ## Fix-Time Consumption
67
+
68
+ Treat SonarQube-derived items as actionable only when the saved
69
+ implementation report already normalized them to a supported source-qualified
70
+ ID with source lens, original ID, Sonar issue/rule evidence, location,
71
+ impact, and verification suggestion. Never execute directly from raw
72
+ SonarQube MCP output, quality gate summaries, chat summaries, or remembered
73
+ Sonar findings.
@@ -1,6 +1,6 @@
1
1
  # Spec-Driven Artifact Store
2
2
 
3
- Use this reference before any spec-driven workflow reads or writes feature registry, progress, handoff, phase artifacts, validation reports, or lessons. `.specs/` files are the canonical state layer for spec-driven logical artifacts.
3
+ Use before any spec-driven workflow reads or writes feature registry, progress, handoff, phase artifacts, validation reports, or lessons. `.specs/` files are the canonical state layer for spec-driven logical artifacts.
4
4
 
5
5
  ## Source Of Truth
6
6
 
@@ -0,0 +1,16 @@
1
+ # Brownfield Onboarding — 7-Doc Codebase Mapping
2
+
3
+ Use from `workflows/spec-driven.md` when the target codebase
4
+ has not yet been mapped (brownfield, new repo, or cold project). The map is
5
+ the shared factual ground for requirements, design, and task derivation;
6
+ each doc feeds a downstream phase.
7
+
8
+ | Doc | Derives | Feeds |
9
+ | --- | --- | --- |
10
+ | `STACK.md` | languages, runtimes, frameworks, key libraries | Design constraints, verification commands |
11
+ | `ARCHITECTURE.md` | layers, modules, boundaries, data flow | Design, risk surface |
12
+ | `CONVENTIONS.md` | naming, file layout, commit/test conventions | Tasks, Execute |
13
+ | `STRUCTURE.md` | directory map, where new code goes | Tasks, file placement |
14
+ | `TESTING.md` | test runner, how to run gates, coverage tooling | Gate Check Commands, verification recipe |
15
+ | `INTEGRATIONS.md` | external services, APIs, contracts, auth | Discuss, risk escalation |
16
+ | `CONCERNS.md` | known risks, tech debt, migration landmines, security/privacy hotspots | Risk-domain escalation, validation focus |
@@ -1,6 +1,6 @@
1
1
  # Spec-Driven Code Analysis
2
2
 
3
- Use this reference when Specify, Design, Tasks, Execute, or Validate needs source inspection or structural code search.
3
+ Use when Specify, Design, Tasks, Execute, or Validate needs source inspection or structural code search.
4
4
 
5
5
  <!-- validator anchors: current repository source and approved .specs/ artifacts override stale memory -->
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Spec-Driven Coding Principles
2
2
 
3
- Use this reference before writing or changing implementation, tests, fixtures, validation assets, scripts, or docs during Execute.
3
+ Use before writing or changing implementation, tests, fixtures, validation assets, scripts, or docs during Execute.
4
4
 
5
5
  Behavioral bias, not checklist. Read before every implementation.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Spec-Driven Context Limits
2
2
 
3
- Use this reference when planning context loading for a spec-driven feature or when `.specs/features/<slug>/` artifacts grow large enough to reduce implementation quality.
3
+ Use when planning context loading for a spec-driven feature or when `.specs/features/<slug>/` artifacts grow large enough to reduce implementation quality.
4
4
 
5
5
  ## Targets
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Design
2
2
 
3
- Use this reference when the spec-driven flow includes a Design phase. The output is `.specs/features/<slug>/design.md`. **Goal**: define HOW to build it — architecture, components, what to reuse.
3
+ Use when the spec-driven flow includes a Design phase. The output is `.specs/features/<slug>/design.md`. **Goal**: define HOW to build it — architecture, components, what to reuse.
4
4
 
5
5
  **Skip this phase when:** The change is straightforward — no architectural decisions, no new patterns, no component interactions to plan. For simple features, design happens inline during Execute.
6
6
 
@@ -85,6 +85,22 @@ If the feature involves data, define models before implementation.
85
85
 
86
86
  ---
87
87
 
88
+ ## Deterministic Validation
89
+
90
+ Before presenting `design.md` for confirmation, run:
91
+
92
+ ```bash
93
+ bun skills/massa-ai/scripts/validate_design.ts <path-or-feature-or-root> [--root .]
94
+ ```
95
+
96
+ It checks the three structurally-required sections (`## Design Summary`,
97
+ `## Risks & Concerns`, `## Tech Decisions`, heading-prefix match) and that
98
+ every `Risks & Concerns` table row has a non-empty, non-placeholder
99
+ Mitigation cell — a `> None found` marker with zero rows is a valid empty
100
+ risk register, not an unfilled one. A non-zero exit blocks confirmation. If
101
+ no code-execution tool is available, run the same checks by reading the
102
+ artifact (graceful degradation preserved).
103
+
88
104
  ## Required Sections
89
105
 
90
106
  `design.md` must include:
@@ -100,6 +116,11 @@ If the feature involves data, define models before implementation.
100
116
  - Large/Complex approach tradeoffs: 2-3 viable approaches, same scope, recommendation first, user-confirmed chosen approach.
101
117
  - Verification design, including how tests or checks prove each high-risk requirement.
102
118
  - Risks, concerns, and mitigations.
119
+ - Tech decisions (non-obvious ones only), with rationale.
120
+
121
+ `## Design Summary`, `## Risks & Concerns`, and `## Tech Decisions` are the
122
+ three headings the deterministic validator above requires structurally;
123
+ the rest of this list is enforced by review, not by the script.
103
124
 
104
125
  ## Decision Supersession
105
126
 
@@ -1,6 +1,6 @@
1
1
  # Spec-Driven Discuss Gray Areas
2
2
 
3
- Use this reference inside Specify when gray areas or implicit requirements affect behavior, scope, data, security/privacy, compatibility, or acceptance criteria. It captures HOW the user envisions the feature when the spec has ambiguous areas — it is NOT a separate phase; it triggers within Specify when the agent detects gray areas that need user input.
3
+ Use inside Specify when gray areas or implicit requirements affect behavior, scope, data, security/privacy, compatibility, or acceptance criteria. It captures HOW the user envisions the feature when the spec has ambiguous areas — it is NOT a separate phase; it triggers within Specify when the agent detects gray areas that need user input.
4
4
 
5
5
  **Goal:** Capture HOW the user envisions the feature when the spec has ambiguous areas. Specifications capture WHAT to build. Design captures the architecture. But neither captures the user's vision for ambiguous areas — layout preferences, interaction patterns, error handling style, content tone. Without this, the agent guesses. With this, the agent builds what the user actually imagined.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Spec-Driven Execute
2
2
 
3
- Use this reference for the required Execute phase. Implement ONE task at a time: surgical changes, verify, commit, repeat. Validation is the mandatory final Execute gate, not a separate phase.
3
+ Use for the required Execute phase. Implement ONE task at a time: surgical changes, verify, commit, repeat. Validation is the mandatory final Execute gate, not a separate phase.
4
4
 
5
5
  <!-- validator anchors: evidence-or-zero mapping -->
6
6
 
@@ -474,6 +474,8 @@ Then run `references/spec-driven/validate.md` as the final Execute gate. The ver
474
474
 
475
475
  ## Pause / End of Session
476
476
 
477
+ **Checkpoints (long-running task sequences):** create a checkpoint via `create_checkpoint` at task boundaries with `taskId`, `description`, `progressPercent`, `currentStep`, `nextAction`, `fileChanges`, and `checkpointType: "manual"` so progress is resumable after interruption. If resuming after interruption, call `list_checkpoints` with the `taskId` and `restore_checkpoint` to recover task state before continuing. If `create_checkpoint` is unavailable (e.g. `task_checkpoints` table missing), continue with `.specs/` artifact state as the fallback.
478
+
477
479
  When work is interrupted, paused, or a session ends before the feature is complete:
478
480
 
479
481
  1. Update `.specs/project/STATE.md` — append any new decisions to the `## Decisions` section (append-only; decisions are normally written during Design, but runtime decisions discovered during Execute may be appended).
@@ -1,6 +1,6 @@
1
1
  # Spec-Driven Memory And State
2
2
 
3
- Use this reference when recording decisions, progress, blockers, handoff, or completion evidence for a spec-driven feature.
3
+ Use when recording decisions, progress, blockers, handoff, or completion evidence for a spec-driven feature.
4
4
 
5
5
  This memory layer is split across two artifacts with distinct lifecycles. Each has its own write triggers; writes are always section-scoped — never whole-file overwrites.
6
6
 
@@ -1,8 +1,8 @@
1
1
  # Spec-Driven Specify
2
2
 
3
- Use this reference for the required Specify phase. **Goal**: Capture WHAT to build with testable, traceable requirements. The output is `.specs/features/<slug>/spec.md`.
3
+ Use for the required Specify phase. **Goal**: Capture WHAT to build with testable, traceable requirements. The output is `.specs/features/<slug>/spec.md`.
4
4
 
5
- If the feature has ambiguous gray areas (multiple valid approaches for user-facing behavior), the agent will automatically trigger the [discuss gray areas](discuss.md) process within this phase. For clear, well-defined features, it goes straight to the next phase.
5
+ If the feature has ambiguous gray areas (multiple valid approaches for user-facing behavior), the agent automatically triggers the [discuss gray areas](discuss.md) process within this phase. Clear, well-defined features go straight to the next phase.
6
6
 
7
7
  ## Inputs
8
8
 
@@ -67,7 +67,7 @@ The table is canonical; the prose is the applied sweep. **Large/Complex** work m
67
67
 
68
68
  **Load confirmed lessons first:** Before clarifying, load the project's confirmed lessons so past verification failures shape this spec instead of repeating. Run `bun skills/massa-ai/scripts/lessons.ts --root . list --status confirmed` (optionally `--scope [area]` or `--query [term]` for the area this feature touches) and apply what comes back as guidance. Load only `confirmed` — never `candidate` or `quarantined`. If no store exists yet or no code tool is available, skip silently. See [lessons.md](../lessons.md).
69
69
 
70
- **Lightweight context scan first (Knowledge Verification Chain Step 1):** Before asking questions, briefly scan existing code, patterns, and neighboring features relevant to this feature. Prefer massa-ai tooling first (`list_projects`, `search`, `project_map`, `optimized_context`) before `ast-grep`/`rg`/`grep`, honoring freshness and source-precedence (current source overrides stale index/memory). Use what you find to ground your clarifying questions in reality — not to constrain the spec to current implementation. Keep it lightweight (stay within the <40k token budget; reuse the chain, no new machinery). The spec captures WHAT is needed, not only what exists.
70
+ **Lightweight context scan first (Knowledge Verification Chain Step 1):** Before asking questions, briefly scan existing code, patterns, and neighboring features relevant to this feature. Prefer massa-ai tooling first (`list_projects`, `search`, `project_map`, `optimized_context`) before `ast-grep`/`rg`/`grep`, honoring freshness and source-precedence (current source overrides stale index/memory). Use what you find to ground clarifying questions in reality — not to constrain the spec to current implementation. Keep it lightweight (stay within the <40k token budget; reuse the chain, no new machinery). The spec captures WHAT is needed, not only what exists.
71
71
 
72
72
  You are a thinking partner, not an interviewer. Start open — let the user dump their mental model. Follow the energy: whatever they emphasize, dig into that.
73
73
 
@@ -1,6 +1,6 @@
1
1
  # Sub-Agent Delegation
2
2
 
3
- Use this reference during Execute when formal task planning has more than 3 tasks, when the user explicitly asks for delegation, or when final validation needs an independent verifier. Full mechanics for phase-batch workers and the Verifier sub-agent used during Execute.
3
+ Use during Execute when formal task planning has more than 3 tasks, when the user explicitly asks for delegation, or when final validation needs an independent verifier. Full mechanics for phase-batch workers and the Verifier sub-agent used during Execute.
4
4
 
5
5
  ## Phase-Batch Workers
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Tasks
2
2
 
3
- Use this reference only when the TLC v3 flow includes Tasks. The output is the `.specs/features/<slug>/tasks.md`.
3
+ Use only when the TLC v3 flow includes Tasks. The output is the `.specs/features/<slug>/tasks.md`.
4
4
 
5
5
  **Goal**: Break into GRANULAR, ATOMIC tasks. Clear dependencies. Right tools. Sequential phase execution plan.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Spec-Driven Validate
2
2
 
3
- Use this reference for the mandatory final Execute validation gate. This is not a separate phase — verification is part of every task's completion within Execute and runs automatically after the final task or inline step is complete.
3
+ Use for the mandatory final Execute validation gate. This is not a separate phase — verification is part of every task's completion within Execute and runs automatically after the final task or inline step is complete.
4
4
 
5
5
  <!-- validator anchors: reject shallow assertions | payload/conjunction rule | per-task test adequacy review summary | fix-loop iteration count | 3 verification iterations -->
6
6
 
@@ -1,8 +1,8 @@
1
1
  # Subagent Design
2
2
 
3
- Use this reference only when designing or revising a reusable subagent role, adding a new role to `references/agent-orchestration.md`, or turning repeated delegated work into a stable role charter.
3
+ Use only when designing or revising a reusable subagent role, adding a new role to `references/agent-orchestration.md`, or turning repeated delegated work into a stable role charter.
4
4
 
5
- Do not load this reference for ordinary one-off delegation. For runtime delegation, use `references/agent-orchestration.md`.
5
+ Do not load for ordinary one-off delegation. For runtime delegation, use `references/agent-orchestration.md`.
6
6
 
7
7
  ## Principle
8
8
 
@@ -30,7 +30,7 @@ Is the work recurring, specialized, context-heavy, independently verifiable, and
30
30
  -> Design a reusable subagent role with this reference.
31
31
  ```
32
32
 
33
- Prefer a skill/reference when the value is procedure or domain knowledge. Prefer a subagent when the value is isolated context, parallel work, or independent verification.
33
+ Prefer a skill/reference for procedure or domain knowledge. Prefer a subagent for isolated context, parallel work, or independent verification.
34
34
 
35
35
  Reusable role threshold:
36
36
 
@@ -94,7 +94,7 @@ Memory boundary:
94
94
  **The packet field list lives in one place: `references/agent-orchestration.md`,
95
95
  §Capability Packet.** Do not restate it here — a second copy is what let the field
96
96
  sets drift into three diverging shapes before the canonical section existed. When a
97
- workflow dispatches a reusable role, send that canonical packet rather than a loose
97
+ workflow dispatches a reusable role, send that canonical packet, not a loose
98
98
  instruction.
99
99
 
100
100
  The one field this reference still names on its own is `persona`, because a