@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,393 @@
1
+ ---
2
+ name: skill-architect
3
+ description: 'Expert guide for designing and building high-quality skills from scratch through structured conversation. Use when someone wants to create a new skill, build a skill, design a skill, or asks for help making Agents do something consistently. Also use when someone says "turn this into a skill", "I want to automate this workflow", "how do I teach my Agent to do X", or mentions creating SKILL.md files. Covers standalone skills and MCP-enhanced workflows. Do NOT use for specialized runtime subagent definitions or technical design documents; use the tdd workflow.'
4
+ license: CC-BY-4.0
5
+ metadata:
6
+ version: "1.0.0"
7
+ ---
8
+
9
+ Attribution: adapted from the `skill-architect` skill by Felipe Rodrigues
10
+ (github.com/felipfr), source Useful-Agent-Skills, licensed CC-BY-4.0.
11
+
12
+ # Skill Architect
13
+
14
+ You are a senior skill architect. Your job is to guide users through building the best possible skill for their needs — not by dumping a template, but by deeply understanding their problem first, then crafting a precise solution. Think of yourself as a consultant: you ask the right questions, challenge assumptions, suggest approaches the user hasn't considered, and only write the skill once you have a clear picture.
15
+
16
+ Load `references/project-context.md` (intake sweep) before the first substantive read.
17
+
18
+ ## Core Philosophy
19
+
20
+ 1. **Understand before building.** Never generate a SKILL.md until you've completed Discovery and Architecture phases. A bad skill is worse than no skill — it triggers incorrectly, gives inconsistent results, and erodes trust.
21
+
22
+ 2. **Progressive disclosure is everything.** The three-level system (frontmatter → SKILL.md body → linked files) exists for a reason: token economy. A bloated skill degrades performance for every conversation it loads into.
23
+
24
+ 3. **Composability over completeness.** Skills coexist with other skills. Never assume yours is the only one loaded. Be a good neighbor.
25
+
26
+ 4. **Specificity beats verbosity.** One precise instruction outperforms three paragraphs of vague guidance. Code beats prose for deterministic checks.
27
+
28
+ 5. **Skills are for agents, not humans.** No README.md inside the skill folder. No onboarding documentation. Write for an LLM that needs clear, actionable instructions.
29
+
30
+ ---
31
+
32
+ ## Workflow Overview
33
+
34
+ ```
35
+ DISCOVERY → ARCHITECTURE → CRAFT → VALIDATE → DELIVER
36
+ ```
37
+
38
+ Move through phases sequentially. Never skip Discovery. Each phase has
39
+ explicit exit criteria before you advance.
40
+
41
+ ---
42
+
43
+ ## Phase 1: Discovery
44
+
45
+ **Goal:** Build a mental model of what the user needs, why they need it, and
46
+ what "success" looks like.
47
+
48
+ ### 1.1 — Understand the Problem
49
+
50
+ Start by asking about the OUTCOME, not the implementation. Key questions
51
+ (ask conversationally, not as a checklist dump):
52
+
53
+ - **What workflow do you want to make consistent?** Get a concrete example
54
+ of what they do today, step by step.
55
+ - **What goes wrong without the skill?** Understand the pain: inconsistency,
56
+ forgotten steps, wasted time re-explaining, wrong outputs.
57
+ - **Who will use this skill?** Just them? Their team? Public distribution?
58
+ This affects naming, documentation depth, and description specificity.
59
+ - **What tools are involved?** Built-in Agents capabilities (code execution,
60
+ file creation, artifacts) or external services via MCP?
61
+
62
+ ### 1.2 — Define Use Cases
63
+
64
+ Nail down 2-3 concrete use cases. For each, capture:
65
+
66
+ ```
67
+ Use Case: [Name]
68
+ Trigger: What the user would say or do
69
+ Steps: The sequence of actions
70
+ Tools: Built-in or MCP tools needed
71
+ Result: What success looks like (specific output)
72
+ ```
73
+
74
+ If the user is vague, give them examples to react to. It's easier to refine
75
+ a concrete proposal than to articulate needs from scratch.
76
+
77
+ ### 1.3 — Identify the Category
78
+
79
+ Determine which category fits best (consult `references/skill-architect/patterns.md` for
80
+ detailed pattern guidance):
81
+
82
+ | Category | When to use | Example |
83
+ | ------------------------- | --------------------------------------- | ------------------------------------------ |
84
+ | Document & Asset Creation | Consistent output generation | Reports, presentations, code, designs |
85
+ | Workflow Automation | Multi-step processes with methodology | Sprint planning, onboarding, deployments |
86
+ | MCP Enhancement | Workflow guidance on top of tool access | Sentry code review, Linear sprint planning |
87
+
88
+ ### 1.4 — Establish Success Criteria
89
+
90
+ Before moving on, agree on how they'll know the skill works:
91
+
92
+ - **Trigger accuracy:** What should trigger it? What should NOT?
93
+ - **Output quality:** What does a good result look like concretely?
94
+ - **Efficiency:** How many interactions should it take?
95
+
96
+ **Exit criteria for Discovery:**
97
+
98
+ - [ ] 2-3 use cases defined with triggers, steps, and expected results
99
+ - [ ] Category identified
100
+ - [ ] Success criteria agreed upon
101
+ - [ ] Tools/dependencies identified
102
+
103
+ ---
104
+
105
+ ## Phase 2: Architecture
106
+
107
+ **Goal:** Make structural decisions before writing a single line of the skill.
108
+
109
+ ### 2.1 — Choose the Pattern
110
+
111
+ Based on Discovery findings, select the primary pattern from
112
+ `references/skill-architect/patterns.md`:
113
+
114
+ 1. **Sequential Workflow** — Steps in a specific order with dependencies
115
+ 2. **Multi-MCP Coordination** — Workflows spanning multiple services
116
+ 3. **Iterative Refinement** — Output quality improves through cycles
117
+ 4. **Context-Aware Selection** — Same goal, different tools based on context
118
+ 5. **Domain-Specific Intelligence** — Specialized knowledge beyond tool access
119
+
120
+ Most skills combine patterns. Identify the primary one and note any secondary.
121
+
122
+ ### 2.2 — Plan the Folder Structure
123
+
124
+ Decide what goes where:
125
+
126
+ ```
127
+ skill-name/
128
+ ├── SKILL.md # Core instructions (target: under 500 lines)
129
+ ├── scripts/ # Only if deterministic checks are needed
130
+ ├── references/ # Only if domain docs exceed what fits in SKILL.md
131
+ └── assets/ # Only if templates or static files are used in output
132
+ ```
133
+
134
+ **Decision criteria:**
135
+
136
+ - Is there logic that MUST be deterministic? → Put it in `scripts/`
137
+ - Is there reference material over ~100 lines? → Put it in `references/`
138
+ - Does the output use templates, fonts, or icons? → Put it in `assets/`
139
+ - Everything else → Keep it in SKILL.md
140
+
141
+ ### 2.3 — Design the Description (Critical)
142
+
143
+ The description field is the most important piece of the entire skill. It
144
+ controls when the agent loads the skill. Draft it now following this structure:
145
+
146
+ ```
147
+ [What it does] + [When to use it with specific trigger phrases] + [What NOT to use it for]
148
+ ```
149
+
150
+ Consult `references/skill-architect/examples.md` for good and bad description examples.
151
+
152
+ **Key principles:**
153
+
154
+ - Include actual phrases users would say
155
+ - Include relevant file types if applicable
156
+ - Add negative triggers if overlap with other skills is likely
157
+ - Lean slightly "pushy" — agents tend to undertrigger. Better to load and
158
+ not need it than to miss a relevant query.
159
+
160
+ ### 2.4 — Plan Progressive Disclosure
161
+
162
+ Map content to the three levels:
163
+
164
+ | Level | What goes here | Token budget |
165
+ | ----------------- | ---------------------------------------- | --------------- |
166
+ | L1: Frontmatter | name + description | ~100 words max |
167
+ | L2: SKILL.md body | Core workflow, steps, examples | Under 500 lines |
168
+ | L3: Linked files | Deep reference, API docs, large examples | As needed |
169
+
170
+ SKILL.md should reference linked files clearly with guidance on WHEN to read
171
+ them, so the agent doesn't load everything upfront.
172
+
173
+ **Exit criteria for Architecture:**
174
+
175
+ - [ ] Primary pattern selected (with rationale)
176
+ - [ ] Folder structure planned
177
+ - [ ] Description field drafted
178
+ - [ ] Content mapped to disclosure levels
179
+
180
+ ---
181
+
182
+ ## Phase 3: Craft
183
+
184
+ **Goal:** Write the skill with precision.
185
+
186
+ ### 3.1 — Write the Frontmatter
187
+
188
+ ```yaml
189
+ ---
190
+ name: kebab-case-name # Must match folder name
191
+ description: [What + When + Not-when, all on this single line]
192
+ license: CC-BY-4.0
193
+ metadata:
194
+ author: [ask the user if unknown]
195
+ version: 1.0.0
196
+ ---
197
+ ```
198
+
199
+ **Hard rules:**
200
+
201
+ - name: kebab-case only, no spaces, no capitals
202
+ - name: never use "claude" or "anthropic" (reserved)
203
+ - description: under 1024 characters
204
+ - description: no XML angle brackets (< >)
205
+ - description: must be a single inline line — do NOT use YAML multiline operators (`>`, `|`, `>-`). Write `description: Your text here` all on one line.
206
+ - license: always `CC-BY-4.0`
207
+ - Delimiters: exactly `---` on their own lines
208
+
209
+ ### 3.2 — Write the Instructions
210
+
211
+ Use imperative form. Be specific and actionable. Structure:
212
+
213
+ ```markdown
214
+ # Skill Name
215
+
216
+ Brief purpose statement (1-2 sentences).
217
+
218
+ ## Instructions
219
+
220
+ ### Step 1: [Action]
221
+
222
+ Specific instructions with examples.
223
+ Expected output: [what success looks like]
224
+
225
+ ### Step 2: [Action]
226
+
227
+ ...
228
+
229
+ ## Examples
230
+
231
+ ### Example 1: [Common scenario]
232
+
233
+ User says: "..."
234
+ Actions: [numbered steps]
235
+ Result: [specific output]
236
+
237
+ ## Troubleshooting
238
+
239
+ ### Error: [message]
240
+
241
+ Cause: [why]
242
+ Solution: [fix]
243
+ ```
244
+
245
+ **Writing principles:**
246
+
247
+ - Prefer explaining WHY over heavy-handed MUSTs
248
+ - Use code/scripts for deterministic validations instead of prose instructions
249
+ - Include 2-3 realistic examples of user inputs and expected outputs
250
+ - Put critical instructions at the top — not buried in middle sections
251
+ - Keep instructions concise; move detailed reference to separate files
252
+ - If referencing files, state exactly WHEN the agent should read them
253
+ - **Never wrap prose lines at arbitrary column widths** (e.g. 80 chars). Let each sentence or paragraph be a single long line. Some UIs and markdown renderers treat hard line breaks mid-paragraph as visual breaks, corrupting the output. Code blocks are exempt — those can wrap for readability.
254
+
255
+ ### 3.3 — Write Supporting Files
256
+
257
+ For each file in `references/` or `scripts/`:
258
+
259
+ - Reference it clearly from SKILL.md
260
+ - State the condition under which the agent should load/run it
261
+ - For reference files over 300 lines, include a table of contents
262
+
263
+ ### 3.4 — Anti-Patterns to Avoid
264
+
265
+ Consult `references/skill-architect/examples.md` for the full anti-pattern list. The critical ones:
266
+
267
+ - ❌ Vague instructions: "validate things properly"
268
+ - ❌ Instructions too verbose (wall of text the agent will skim)
269
+ - ❌ No examples (agents need concrete input/output pairs)
270
+ - ❌ README.md inside the skill folder
271
+ - ❌ SKILL.MD or skill.md (must be exactly SKILL.md)
272
+ - ❌ Spaces or capitals in folder name
273
+ - ❌ XML angle brackets in frontmatter
274
+ - ❌ Assuming the skill is the only one loaded
275
+
276
+ **Exit criteria for Craft:**
277
+
278
+ - [ ] Frontmatter passes all hard rules
279
+ - [ ] Instructions are specific and actionable
280
+ - [ ] Examples included for common scenarios
281
+ - [ ] Error handling documented
282
+ - [ ] Files referenced with clear load conditions
283
+ - [ ] Under 500 lines for SKILL.md body
284
+
285
+ ---
286
+
287
+ ## Phase 4: Validate
288
+
289
+ **Goal:** Verify the skill before delivery.
290
+
291
+ ### 4.1 — Structural Validation
292
+
293
+ Run the full checklist from `references/skill-architect/quality-checklist.md` and execute
294
+ `bun scripts/validate_skill.ts <skill-folder>` against the generated skill to check:
295
+
296
+ - SKILL.md exists with correct casing
297
+ - Frontmatter has required fields with correct format
298
+ - Folder naming is kebab-case
299
+ - No README.md in the skill folder
300
+ - No XML angle brackets in frontmatter
301
+ - Description includes trigger phrases
302
+
303
+ IF the script cannot run (no code-execution tool available) THEN skip
304
+ `scripts/validate_skill.ts` and run the
305
+ `references/skill-architect/quality-checklist.md` checklist manually instead.
306
+
307
+ ### 4.2 — Trigger Testing
308
+
309
+ Propose 3-5 test phrases and verify mentally:
310
+
311
+ **Should trigger:**
312
+
313
+ - Obvious task requests
314
+ - Paraphrased versions
315
+ - Partial/informal requests
316
+
317
+ **Should NOT trigger:**
318
+
319
+ - Unrelated topics
320
+ - Tasks handled by other skills
321
+ - Generic questions
322
+
323
+ If the description is too broad or too narrow, refine it now.
324
+
325
+ ### 4.3 — Instruction Quality Review
326
+
327
+ Read the skill as if you're an agent encountering it for the first time:
328
+
329
+ - Can you follow every step without ambiguity?
330
+ - Are there missing decision points?
331
+ - Would you know when to stop?
332
+ - Are the examples realistic and complete?
333
+
334
+ ### 4.4 — Present Findings
335
+
336
+ Share the validation results with the user. If issues exist, fix them
337
+ before delivery. If everything passes, move to delivery.
338
+
339
+ **Exit criteria for Validate:**
340
+
341
+ - [ ] Structural validation passes
342
+ - [ ] Trigger phrases tested
343
+ - [ ] Instructions are unambiguous
344
+ - [ ] User confirms quality
345
+
346
+ ---
347
+
348
+ ## Phase 5: Deliver
349
+
350
+ **Goal:** Package and present the completed skill.
351
+
352
+ ### 5.1 — Package
353
+
354
+ Create the final skill folder structure in the project's skills directory.
355
+
356
+ ### 5.2 — Present
357
+
358
+ Use `present_files` to share the packaged skill. Include a brief summary:
359
+
360
+ - What the skill does
361
+ - How to install it in the user's preferred AI agent or IDE
362
+ - Suggested test phrase to try first
363
+
364
+ ### 5.3 — Next Steps
365
+
366
+ Suggest:
367
+
368
+ - Test with the suggested phrases
369
+ - If results aren't right, bring the conversation back and iterate
370
+ - For formal evaluation, use the `skill-creator` skill's eval and benchmark modes
371
+
372
+ ---
373
+
374
+ ## Conversation Style
375
+
376
+ - Ask questions one area at a time — don't dump all Discovery questions at once
377
+ - Give concrete suggestions the user can react to ("Would something like X work?")
378
+ - If the user provides a vague request, propose a specific interpretation and ask
379
+ if it matches their intent
380
+ - If the conversation already contains a workflow (user says "turn this into a
381
+ skill"), extract what you can from history FIRST, then fill gaps with questions
382
+ - Match the user's technical level — explain terms if they seem non-technical
383
+ - Be direct about tradeoffs: if a design choice has a downside, say so
384
+
385
+ ## Important Boundaries
386
+
387
+ - This skill is for CREATING new skills. For improving, evaluating, or
388
+ benchmarking existing skills, direct users to the `skill-creator` skill.
389
+ - Never generate a SKILL.md without completing Discovery and Architecture.
390
+ If the user insists on skipping, explain why these phases matter and offer
391
+ a compressed version rather than skipping entirely.
392
+ - If the user's needs are better served by a simple system prompt or project
393
+ instruction rather than a full skill, say so. Not everything needs to be a skill.
@@ -1,10 +1,18 @@
1
+ ---
2
+ name: spec-driven
3
+ description: "Use this workflow for explicit spec-driven requests and broad, ambiguous, migration-heavy, or cross-boundary delivery needing requirements-through-verification control."
4
+ license: MIT
5
+ metadata:
6
+ version: "1.1.0"
7
+ ---
8
+
1
9
  ### Spec-Driven
2
10
 
3
- Use this workflow for explicit spec-driven requests and broad, ambiguous, migration-heavy, cross-boundary, public-contract, or long-running delivery that needs requirements-through-verification control. Ordinary localized fixes and clear small features stay in `debug`, `feature`, `refactor`, or `general` unless the user explicitly requests this workflow.
11
+ Use for explicit spec-driven requests and broad, ambiguous, migration-heavy, cross-boundary, public-contract, or long-running delivery that needs requirements-through-verification control. Ordinary localized fixes and clear small features stay in `debug`, `feature`, `refactor`, or `general` unless the user explicitly requests this workflow.
4
12
 
5
- Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
13
+ Load `references/project-context.md` (intake sweep) before the first substantive read.
6
14
 
7
- Before the first repository mutation, load `references/implementation-delivery.md` for worktree isolation, atomic commits, PR creation, CI watch, and the merge gate, and `references/code-annotation.md` for doc blocks, rationale comments, and test coverage on every created or updated unit, and `references/repo-rules-discovery.md` to discover and enforce the target repository's own `.claude/`, `.cursor/`, and module/unit-test/testing-area conventions. If two consecutive fix attempts fail on the same symptom, stop editing and load `references/root-cause-scripts.md`.
15
+ Before the first repository mutation, load `references/implementation-delivery.md` (delivery chain: worktree, atomic commits, PR, CI watch, merge gate), `references/code-annotation.md` (doc blocks, rationale, test coverage), and `references/repo-rules-discovery.md` (enforce the target repo's own `.claude/`/`.cursor/` and module/test conventions). After two consecutive failed fixes on one symptom, stop editing and load `references/root-cause-scripts.md`.
8
16
 
9
17
  ## TLC v3 Flow
10
18
 
@@ -40,7 +48,7 @@ Complexity determines depth, not a fixed pipeline. Assess scope first, apply onl
40
48
  | Large | >10 tasks OR multi-component feature | Full spec + requirement IDs | Architecture + components | Full breakdown + deps | Implement + verify per task |
41
49
  | Complex | Ambiguity or new domain (unfamiliar vocabulary, no prior pattern) | Full spec + discuss gray areas | Research + architecture | Breakdown + phase plan | Implement + interactive UAT |
42
50
 
43
- A "Phase" is an ordered group of Tasks sharing a dependency boundary or a checkpoint commit — it is distinct from a single Task or atomic step. Report sizing in the uniform vocabulary: `1 Phase = X Tasks`; the whole plan is `Y Phases = Z Tasks`. The sub-agent offer fires when a formal `tasks.md` has more than 3 Tasks — packing itself still uses ~7-Task Phase groups; a 4–8-Task feature is offered as a single Phase-group worker.
51
+ A "Phase" is an ordered group of Tasks sharing a dependency boundary or a checkpoint commit — distinct from a single Task or atomic step. Report sizing in the uniform vocabulary: `1 Phase = X Tasks`; the whole plan is `Y Phases = Z Tasks`. The sub-agent offer fires when a formal `tasks.md` has more than 3 Tasks — packing itself still uses ~7-Task Phase groups; a 4–8-Task feature is offered as a single Phase-group worker.
44
52
 
45
53
  - Specify and Execute are always required.
46
54
  - Design is skipped when straightforward (no architectural decisions, no new patterns).
@@ -50,7 +58,7 @@ A "Phase" is an ordered group of Tasks sharing a dependency boundary or a checkp
50
58
 
51
59
  ## Quick Mode Guardrails
52
60
 
53
- Quick mode is the Small/auto-sized path: a single change touching **max 3 files** with no new dependency and no design decision. It is the fast lane, not a parallel pipeline — it still closes requirements and runs the Execute gate.
61
+ Quick mode is the Small/auto-sized path: a single change touching **max 3 files** with no new dependency and no design decision. Fast lane, not a parallel pipeline — it still closes requirements and runs the Execute gate.
54
62
 
55
63
  Enter Quick mode only when **all** hold:
56
64
 
@@ -74,7 +82,7 @@ Quick artifacts live under `.specs/quick/NNN-slug/` with a `TASK.md` (one-line i
74
82
  2. Restore context before planning:
75
83
  - `recall` for exact-session continuity, durable decisions, rejected approaches, patterns, blockers, and handoffs.
76
84
  - Load `references/spec-driven/artifact-store.md` before reading or writing feature registry, state, handoff, phase artifacts, validation reports, or lessons.
77
- - Load `references/synapse-policy.md` when two or more related searches are expected. When the investigation involves multi-search, call `synapse_task_begin` with `id` (the `synapseSessionId`) and `taskContext` before the first search to open a task envelope; call `synapse_prefetch` with `id` and `filePath` after opening a file for deep investigation to warm the buffer; call `synapse_task_end` with `id` when the investigation phase completes. `synapse_task_begin`/`synapse_task_end` require an existing `synapse_session` id.
85
+ - Load `references/synapse-policy.md` when two or more related searches are expected. For multi-search investigations, run the Synapse task envelope per that reference: `synapse_task_begin` before the first search, `synapse_prefetch` on deep file open, `synapse_task_end` at completion (both `task` calls require an existing `synapse_session` id).
78
86
  - Load `references/context-firewall.md` before broad source inspection, generated reports, external research, or verbose tool output.
79
87
  - Keep the loaded context budget under the `references/spec-driven/context-limits.md` target; summarize or narrow before loading bulky artifacts.
80
88
  - Use `references/spec-driven/code-analysis.md` when source inspection needs structural search or tool fallback.
@@ -85,19 +93,18 @@ Quick artifacts live under `.specs/quick/NNN-slug/` with a `TASK.md` (one-line i
85
93
  3. Run `Specify` with `references/spec-driven/specify.md`.
86
94
  - Capture stable requirement IDs, testable acceptance criteria, edge cases, and explicit out-of-scope items.
87
95
  - Run `references/spec-driven/discuss.md` inside Specify when gray areas, implicit requirements, persistence/state, external calls, auth, payments, concurrency, or state transitions affect behavior.
88
- - For Android, iOS, or KMP Compose Multiplatform UI work, load `references/mobile-context.md` and run the optional design-source gate: ask for one or more Figma links, node IDs, a readable desktop selection, supplied screenshots, or explicit `none`; record `Figma Source: none by user choice` when declined. When Figma links or node IDs are supplied, load `references/figma-pre-analysis.md` and run its two-stage sequential retrieval protocol before consuming the design evidence. Screenshots are context-only unless paired with structured Figma evidence. For unsupported targets, record the source as outside mobile Figma scope and do not run mobile Figma.
96
+ - For Android, iOS, or KMP Compose Multiplatform UI work, run the optional design-source intake gate from `references/mobile-context.md` (Design-Source Intake Gate).
89
97
  - Apply the Requirement Closure Gate: every open requirement question is resolved with the user or recorded as an accepted assumption before execution begins.
90
- 4. Decide whether `Design` is required. If yes, run `references/spec-driven/design.md`; if no, record why the skip is valid. When Design is skipped and a design concern appears later, stop and create `design.md` before continuing.
98
+ 4. Decide whether `Design` is required. If yes, run `references/spec-driven/design.md`, including its deterministic validation before presenting `design.md` for confirmation; if no, record why the skip is valid. When Design is skipped and a design concern appears later, stop and create `design.md` before continuing.
91
99
  5. Decide whether `Tasks` is required. If yes, run `references/spec-driven/tasks.md`; if no, list the inline atomic execution steps before editing. If the inline list reveals more than 5 steps or complex dependencies, stop and create `tasks.md` — the Tasks phase was wrongly skipped (safety valve).
92
100
  6. Run `Execute` with `references/spec-driven/execute.md`.
93
101
  - Load `references/spec-driven/coding-principles.md` before implementation.
94
102
  - Run repo-rules discovery from `references/repo-rules-discovery.md` before the first repository mutation: record the harness sources loaded (or `repo-rules: none present`), and implement so every new or changed file conforms to the target repo's module layout, unit-test location, and testing-area conventions. A repo rule wins over a skill default for placement and gate commands; record any deviation with an explicit reason. Never fabricate rules or create `.claude/`/`.cursor/` directories the repo lacks.
95
103
  - Use the Test Coverage Matrix and Gate Check Commands from `tasks.md`, or state their inline equivalents when Tasks was skipped.
96
104
  - Ask the MCP and skill question in Tasks or inline Execute when tool choice can change correctness or verification.
97
- - If a formal `tasks.md` has more than 3 Tasks, present the sub-agent offer from `references/spec-driven/sub-agents.md` before starting Execute — even when packing yields a single Phase group (a 4–8-Task feature is offered as one Phase-group worker). Offer-then-confirm — never auto-spawn; the user must accept before any sub-agent is dispatched. One worker per Phase group (~7 Tasks, whole Phases): each worker executes all its Tasks in order (implement → gate → atomic commit), then reports a compact summary (Tasks done, commit hashes, test counts, deviations). Workers never spawn further sub-agents.
105
+ - If a formal `tasks.md` has more than 3 Tasks, present the sub-agent offer from `references/spec-driven/sub-agents.md` before starting Execute — even when packing yields a single Phase group (a 4–8-Task feature is offered as one Phase-group worker).
98
106
  - Implement one atomic step or approved task at a time.
99
- - For 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.
100
- - 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.
107
+ - For long-running task sequences, use the checkpoint mechanism in `references/spec-driven/execute.md` (Pause / End of Session) so progress is resumable after interruption.
101
108
  - Use per-task commits when the environment and user permissions allow commits; otherwise record the skipped reason.
102
109
  - Keep validation assets protected.
103
110
  - Update logical feature artifacts in `.specs/features/<slug>/` and `.specs/project/STATE.md` after meaningful progress.
@@ -117,7 +124,7 @@ Quick artifacts live under `.specs/quick/NNN-slug/` with a `TASK.md` (one-line i
117
124
  - The verification-agent re-derives coverage independently using evidence-or-zero and does not inherit the author's mental model.
118
125
  - The fix → re-verify loop is capped at 3 iterations before escalating to `Blocked`.
119
126
  - Distill lesson signals through `references/lessons.md` when validation produces grounded reusable failures.
120
- 7. Before the delivery chain's Propose stage (PR creation), write and commit `.specs/project/STATE.md`, `.specs/HANDOFF.md`, and `.specs/project/FEATURES.json` on the branch — not merely "after meaningful progress" during Execute, but committed before `gh pr create`. **Deterministic backing (run it, do not eyeball it):** `bun skills/massa-ai/scripts/check_specs_delivered.ts <feature> [--root .]` — a non-zero exit blocks Propose (see `references/implementation-delivery.md` stage 3.5 and GATE-02). If no code-execution tool is available, run the same checks by reading the artifact (graceful degradation preserved). Record `references/spec-driven/memory.md` decisions, blockers, handoff, and completion evidence per that reference's write triggers.
127
+ 7. Before the delivery chain's Propose stage (PR creation), write and commit `.specs/project/STATE.md`, `.specs/HANDOFF.md`, and `.specs/project/FEATURES.json` on the branch — not merely "after meaningful progress" during Execute, but committed before `gh pr create`. **Deterministic backing (run it, do not eyeball it):** `bun skills/massa-ai/scripts/check_specs_delivered.ts <feature> [--root .]` — a non-zero exit blocks Propose (see `references/implementation-delivery.md` stage 3.5 and GATE-02). If no code-execution tool is available, run the same checks by reading the artifact (graceful degradation preserved). Record decisions, blockers, handoff, and completion evidence per `references/spec-driven/memory.md`'s write triggers.
121
128
  8. When the user splits planning and implementation across clean chats, resume from the canonical `.specs/` artifacts — `.specs/project/STATE.md`, `.specs/project/FEATURES.json`, `.specs/HANDOFF.md`, and the feature's phase files. This workflow owns the spec phase contracts on both sides of the split; there is no separate save/load procedure.
122
129
  9. Complete the configured Plan Challenge Gate for non-trivial plans and complete `references/evidence-gate.md` before claiming completion.
123
130
 
@@ -166,17 +173,7 @@ Step 5: Flag as uncertain → "I'm not certain about X — here's my reasoning,
166
173
 
167
174
  ## Brownfield Onboarding — 7-Doc Codebase Mapping
168
175
 
169
- When the spec-driven work targets a codebase the agent has not yet mapped (brownfield, new repo, or cold project), derive a 7-doc codebase map before Specify closes. The map is the shared factual ground for requirements, design, and task derivation; it is not busywork — each doc feeds a downstream phase.
170
-
171
- | Doc | Derives | Feeds |
172
- | --- | --- | --- |
173
- | `STACK.md` | languages, runtimes, frameworks, key libraries | Design constraints, verification commands |
174
- | `ARCHITECTURE.md` | layers, modules, boundaries, data flow | Design, risk surface |
175
- | `CONVENTIONS.md` | naming, file layout, commit/test conventions | Tasks, Execute |
176
- | `STRUCTURE.md` | directory map, where new code goes | Tasks, file placement |
177
- | `TESTING.md` | test runner, how to run gates, coverage tooling | Gate Check Commands, verification recipe |
178
- | `INTEGRATIONS.md` | external services, APIs, contracts, auth | Discuss, risk escalation |
179
- | `CONCERNS.md` | known risks, tech debt, migration landmines, security/privacy hotspots | Risk-domain escalation, validation focus |
176
+ When the spec-driven work targets a codebase the agent has not yet mapped (brownfield, new repo, or cold project), derive the 7-doc codebase map from `references/spec-driven/brownfield-mapping.md` before Specify closes — not busywork, each doc feeds a downstream phase.
180
177
 
181
178
  Minimum bar: derive at least **`CONCERNS.md`** (risk surface — drives risk-domain escalation and validation focus) and **`TESTING.md`** (gate derivation — exact commands the Execute gate will run). If time or access is constrained, these two are non-negotiable; the other five are derived as the work needs them. Record the map under `.specs/features/<slug>/` (or the project onboarding dir) and confirm it against current source, not memory or external summaries.
182
179
 
@@ -1,8 +1,16 @@
1
+ ---
2
+ name: tdd
3
+ description: "Use this workflow to write a Technical Design Document once one product direction is selected and no unresolved API, data, security, or rollout decision blocks implementation."
4
+ license: MIT
5
+ metadata:
6
+ version: "1.1.0"
7
+ ---
8
+
1
9
  ### TDD (Technical Design Document)
2
10
 
3
- Use this workflow when the readiness checklist is true: one product direction is selected, a named requirements source exists, and no unresolved API, data, security/privacy, migration, rollout, or public compatibility decision blocks implementation design. Route unresolved proposals or competing directions to `workflows/rfc.md`, isolated finalized architecture decisions to `workflows/adr.md`, and broad requirements-to-delivery work to `workflows/spec-driven.md`.
11
+ Use when the readiness checklist is true: one product direction is selected, a named requirements source exists, and no unresolved API, data, security/privacy, migration, rollout, or public compatibility decision blocks implementation design. Route unresolved proposals or competing directions to `workflows/rfc.md`, isolated finalized architecture decisions to `workflows/adr.md`, and broad requirements-to-delivery work to `workflows/spec-driven.md`.
4
12
 
5
- Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
13
+ Load `references/project-context.md` (intake sweep) before the first substantive read.
6
14
 
7
15
  ## Workflow
8
16
 
@@ -1,12 +1,20 @@
1
+ ---
2
+ name: tests-audit
3
+ description: "Findings-only audit of test coverage, regression protection, assertion quality, fixture reliability, and missing deterministic sensors in a concrete target."
4
+ license: MIT
5
+ metadata:
6
+ version: "1.1.0"
7
+ ---
8
+
1
9
  ### Tests Audit
2
10
 
3
- Use this workflow for findings-only audit of test coverage, regression protection, assertion quality, fixture reliability, and missing deterministic sensors in a concrete target: modified files, explicit files/globs, commit ranges, branch comparisons, modules/packages, symbols/classes/functions, feature/runtime flows, explicitly requested whole-repo scope, or an implementation scope packet supplied by `workflows/implementation/implementation-audit.md`.
11
+ Findings-only audit of test coverage, regression protection, assertion quality, fixture reliability, and missing deterministic sensors, scoped to a concrete target: modified files, explicit files/globs, commit ranges, branch comparisons, modules/packages, symbols/classes/functions, feature/runtime flows, explicitly requested whole-repo scope, or an implementation scope packet supplied by `workflows/implementation/implementation-audit.md`.
4
12
 
5
- Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
13
+ Load `references/project-context.md` (intake sweep) before the first substantive read.
6
14
 
7
- Do not use this workflow to write, run, or fix test findings as the main task; route that to `workflows/tests/tests-fix.md`. Do not use it for generic correctness, security, architecture, code quality, or requirements findings; route those to the dedicated workflows.
15
+ Not to write, run, or fix test findings as the main task — route to `workflows/tests/tests-fix.md`. Not for generic correctness, security, architecture, code quality, or requirements findings — route to the dedicated workflows.
8
16
 
9
- This workflow is findings-only. Do not edit code unless the user separately asks for fixes.
17
+ Findings-only: do not edit code unless the user separately asks for fixes.
10
18
 
11
19
  1. Resolve/reuse `workflowSessionId`: `test-audit-[entity]`
12
20
  2. Load shared references:
@@ -31,32 +39,8 @@ This workflow is findings-only. Do not edit code unless the user separately asks
31
39
  - Implementation parent scope: use only when `workflows/implementation/implementation-audit.md` invokes this workflow with a concrete implementation scope packet.
32
40
  - If the target focus is missing, vague, or too broad, ask for a concrete target from the supported scope types in `references/audit-scope.md`.
33
41
  - Build the shared scope packet from `references/audit-scope.md` and carry it into the report.
34
- 5. For modified files scope:
35
- - Include staged and unstaged tracked files from the working tree.
36
- - Include untracked non-generated source, test, fixture, schema, config, and docs files only when they can affect runtime, validation, or test behavior.
37
- - Exclude deleted files unless their deletion can break test coverage, imports, exports, routing, migrations, config, tests, or packaging.
38
- - Exclude generated, dependency, build, log, cache, temporary, and secret paths per repo rules.
39
- - Inspect diffs first, then tests and surrounding code needed to understand regression risk.
40
- 6. For commit range scope:
41
- - If the user supplied explicit commits or a revision range, use that exact range.
42
- - If the user asked for commits made by me, resolve author identity from `git config user.email`; if empty, use `git config user.name`.
43
- - For branch-relative commit scopes, resolve the branch base from the upstream merge-base first, then fall back in order to `origin/main`, `origin/master`, `main`, and `master`.
44
- - If the user asked for commits made by me, review branch-unique commits authored by the resolved identity.
45
- - If no explicit range, required author identity, or branch base can be resolved, ask the user for the missing value before proceeding.
46
- - Inspect changed files and diffs from those commits, then tests, fixtures, config, schemas, and prior bug patterns only as needed.
47
- 7. For codebase area scope:
48
- - Require a concrete path, module, package, feature area, or glob.
49
- - If the target area is missing, ask for it before proceeding.
50
- - Follow the shared retrieval order from `references/codebase-investigation.md` to find production entry points, tests, fixtures, mocks, test commands, and coverage-sensitive config.
51
- 8. For explicit files/globs, branch comparison, symbol/class/function, feature/flow, or explicitly requested whole-repo scope:
52
- - Resolve the target with `references/audit-scope.md` and record the resolution method, base/head when relevant, resolved files, exclusions, and freshness timestamp.
53
- - For symbol/class/function targets, inspect definitions, call paths, behavior contracts, tests, fixtures, mocks, and test commands only as needed.
54
- - For feature/flow targets, map changed or targeted behavior to existing tests and deterministic harnesses.
55
- - If whole-repo scope is requested, map major test surfaces first and report skipped depth checks rather than implying exhaustive coverage.
56
- 9. For implementation parent scope:
57
- - Accept the exact scope packet from `implementation-audit`; do not broaden beyond resolved files, nearby tests, fixtures, config, and callers needed to verify regression protection.
58
- - Return compact findings to the parent implementation audit; do not write broad project memories unless explicitly assigned.
59
- 10. Investigation pass. Dispatch `audit-specialist` per `references/agent-orchestration.md` when the scope justifies an isolated read-only subagent:
42
+ 5. Resolve the selected branch's mechanics (modified files, commit range, codebase area, explicit-files/branch/symbol/feature/whole-repo, or implementation parent scope) per `references/audit-scope.md` (Lens Audit Scope Resolution Procedure, Tests row of Per-Lens Scope Deltas).
43
+ 6. Investigation pass. Dispatch `audit-specialist` per `references/agent-orchestration.md` when the scope justifies an isolated read-only subagent:
60
44
 
61
45
  > **Dispatch: `massa-ai-audit-specialist`** (role: `audit-specialist`) — charter `skills/agents/audit-specialist/SKILL.md`
62
46
  > - trigger: large scope, explicit parallel/subagent request, PR subagent invocation, or independent verification of high-impact finding
@@ -74,17 +58,17 @@ This workflow is findings-only. Do not edit code unless the user separately asks
74
58
  - For mobile scopes, check KMP shared and platform-specific `actual` tests, Android/iOS harnesses, native bridge payload coverage, permissions, lifecycle, offline sync, deep links, push/background flows, UI snapshots/screenshots, device-matrix assumptions, and platform parity claims from `references/mobile-context.md`.
75
59
  - Check weak assertions, tests that only assert implementation details, fixture drift, nondeterminism, hidden network/time/filesystem dependencies, skipped tests, and weakened snapshots.
76
60
  - For each candidate finding, record the concrete claim, source evidence, impacted behavior, likely regression path, provisional severity, and what would disprove it.
77
- 11. False-positive pass:
61
+ 7. False-positive pass:
78
62
  - Try to disprove every candidate before reporting it.
79
63
  - Check existing unit, integration, e2e, contract, snapshot, fixture, and harness coverage; also check framework-generated coverage and accepted exceptions.
80
64
  - If a deterministic test command is cheap and in scope, run it as a sensor; if not, report the skipped command and reason.
81
65
  - Drop candidates disproven by evidence, downgrade candidates with partial mitigation, and mark low-confidence findings explicitly.
82
- 12. Severity rules (apply the countable threshold first, then the qualitative clause):
66
+ 8. Severity rules (apply the countable threshold first, then the qualitative clause):
83
67
  - `critical`: missing or broken tests around data loss, auth/privacy, migration, deployment-blocking, irreversible corruption risk, OR >10 affected files; otherwise use the qualitative clause below.
84
68
  - `high`: missing or weak tests around a core flow, public contract, persistence behavior, validation, security boundary, or severe regression risk.
85
69
  - `medium`: missing edge-flow coverage, flaky or nondeterministic test risk, fixture drift, weak assertions, or missing regression coverage around changed logic (<=10 affected files).
86
70
  - `low`: minor coverage gap, low-impact assertion hardening, incomplete evidence, or weakly supported concern.
87
- 13. Final report:
71
+ 9. Final report:
88
72
  - Findings first, ordered by severity: `critical`, `high`, `medium`, `low`.
89
73
  - Each finding must use `TST-<N>` and include the canonical fields from `references/audit-report-io.md`: severity, confidence, file/line, evidence, impacted behavior, regression risk, simplest test direction, deterministic sensor, and verification suggestion.
90
74
  - If no test audit findings are found, say that clearly and list scope checked plus skipped checks.
@@ -93,11 +77,11 @@ This workflow is findings-only. Do not edit code unless the user separately asks
93
77
  - Include the Verification/Test Fidelity Checklist from `references/audit-report-io.md`; tie every `TST-*` finding or no-finding claim to deterministic sensors, commands/artifacts, results, validation assets, or skipped-check reasons. Model judgment alone cannot satisfy verification/testing all-clear.
94
78
  - For direct top-level invocation, use the Plan Mode save rule and canonical report contract from `references/audit-report-io.md` for `audits/tests/<YYYY-MM-DD tests-audit>.md`.
95
79
  - For implementation audit child invocation, return compact findings to the parent unless the parent explicitly requests saved audit artifacts.
96
- 14. Persist only durable knowledge:
80
+ 10. Persist only durable knowledge:
97
81
  - Do not persist one-off findings.
98
82
  - Persist repeated test gap patterns, project-specific testing conventions, accepted exceptions, flaky-test patterns, or reusable verification recipes after scoring with the Importance Calibration System.
99
83
  - Use required tags: `project:<projectId>`, `session:<workflowSessionId>`, `workflow:tests-audit`, `entity:<entity>`, and one `memory:<tier>` tag.
100
- 15. Complete the Evidence Gate from `references/evidence-gate.md`.
84
+ 11. Complete the Evidence Gate from `references/evidence-gate.md`.
101
85
 
102
86
  ## Examples
103
87