@massa-ai/cursor-plugin 1.56.0 → 1.57.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 (62) hide show
  1. package/.cursor-plugin/plugin.json +1 -1
  2. package/package.json +1 -1
  3. package/skills/agents/architecture-specialist/SKILL.md +1 -1
  4. package/skills/agents/audit-specialist/SKILL.md +1 -1
  5. package/skills/agents/builder/SKILL.md +1 -1
  6. package/skills/agents/context-curator/SKILL.md +1 -1
  7. package/skills/agents/designer/SKILL.md +1 -1
  8. package/skills/agents/documentation-agent/SKILL.md +1 -1
  9. package/skills/agents/furps-analyst/SKILL.md +1 -1
  10. package/skills/agents/investigator/SKILL.md +1 -1
  11. package/skills/agents/judge/SKILL.md +1 -1
  12. package/skills/agents/meta-judge/SKILL.md +1 -1
  13. package/skills/agents/mobile-specialist/SKILL.md +1 -1
  14. package/skills/agents/navigator/SKILL.md +1 -1
  15. package/skills/agents/plan-critic/SKILL.md +1 -1
  16. package/skills/agents/planner/SKILL.md +1 -1
  17. package/skills/agents/requirements-analyst/SKILL.md +1 -1
  18. package/skills/agents/reviewer/SKILL.md +1 -1
  19. package/skills/agents/test-engineer/SKILL.md +1 -1
  20. package/skills/agents/verification-agent/SKILL.md +1 -1
  21. package/skills/massa-ai/SKILL.md +2 -1
  22. package/skills/massa-ai/references/agent-orchestration.md +41 -4
  23. package/skills/massa-ai/references/audit-scope.md +1 -1
  24. package/skills/massa-ai/references/code-quality-lens.md +107 -0
  25. package/skills/massa-ai/references/code-reuse-scan.md +0 -1
  26. package/skills/massa-ai/references/implementation-delivery.md +6 -3
  27. package/skills/massa-ai/references/skill-architect/authoring-principles.md +37 -0
  28. package/skills/massa-ai/references/verification-ladder.md +2 -0
  29. package/skills/massa-ai/scripts/check_commit.ts +4 -1
  30. package/skills/massa-ai/scripts/ensure_worktree.ts +311 -0
  31. package/skills/massa-ai/scripts/resolve_scope.ts +263 -0
  32. package/skills/massa-ai/scripts/size_change.ts +227 -0
  33. package/skills/massa-ai/workflows/architecture/architecture-audit.md +1 -15
  34. package/skills/massa-ai/workflows/architecture/architecture-fix.md +1 -8
  35. package/skills/massa-ai/workflows/bugs/bugs-audit.md +1 -13
  36. package/skills/massa-ai/workflows/bugs/bugs-fix.md +1 -9
  37. package/skills/massa-ai/workflows/code-quality/code-quality-audit.md +3 -34
  38. package/skills/massa-ai/workflows/code-quality/code-quality-fix.md +3 -17
  39. package/skills/massa-ai/workflows/commit.md +6 -6
  40. package/skills/massa-ai/workflows/debug.md +2 -9
  41. package/skills/massa-ai/workflows/design.md +0 -6
  42. package/skills/massa-ai/workflows/exploration.md +0 -1
  43. package/skills/massa-ai/workflows/feature.md +2 -15
  44. package/skills/massa-ai/workflows/general.md +1 -16
  45. package/skills/massa-ai/workflows/implementation/implementation-audit.md +0 -1
  46. package/skills/massa-ai/workflows/implementation/implementation-fix.md +1 -15
  47. package/skills/massa-ai/workflows/judge-with-debate.md +0 -2
  48. package/skills/massa-ai/workflows/maestro/maestro-fix.md +1 -8
  49. package/skills/massa-ai/workflows/mobile-figma/mobile-figma-audit.md +0 -6
  50. package/skills/massa-ai/workflows/mobile-figma/mobile-figma-fix.md +1 -14
  51. package/skills/massa-ai/workflows/pr-review.md +0 -3
  52. package/skills/massa-ai/workflows/refactor.md +2 -9
  53. package/skills/massa-ai/workflows/refinement/furps-refinement.md +0 -1
  54. package/skills/massa-ai/workflows/requirements/requirements-audit.md +1 -13
  55. package/skills/massa-ai/workflows/requirements/requirements-fix.md +1 -8
  56. package/skills/massa-ai/workflows/security/security-audit.md +1 -13
  57. package/skills/massa-ai/workflows/security/security-fix.md +1 -9
  58. package/skills/massa-ai/workflows/skill-architect.md +7 -39
  59. package/skills/massa-ai/workflows/spec-driven.md +0 -11
  60. package/skills/massa-ai/workflows/tests/tests-audit.md +1 -13
  61. package/skills/massa-ai/workflows/tests/tests-fix.md +1 -8
  62. package/skills/massa-ai/workflows/to-prd.md +0 -1
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "massa-ai",
3
- "version": "1.56.0",
3
+ "version": "1.57.0",
4
4
  "description": "massa-ai — semantic code search, memory, and context compression for Cursor"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massa-ai/cursor-plugin",
3
- "version": "1.56.0",
3
+ "version": "1.57.0",
4
4
  "description": "massa-ai plugin for Cursor — semantic code search, memory, and context compression",
5
5
  "files": [
6
6
  "agents",
@@ -3,7 +3,7 @@ name: architecture-specialist
3
3
  description: Read-only architecture guidance agent. Evaluate architecture, suggest boundaries, recommend abstractions, evaluate trade-offs, and suggest modularization. Folds the existing domain-mapper, coupling-auditor, and deepening-architect roles into one specialist. Triggers when a workflow needs architectural guidance before or during design. Never implements or rewrites code.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.0.0"
8
8
  model_tier: deep
9
9
  permission: read-only
@@ -3,7 +3,7 @@ name: audit-specialist
3
3
  description: Configurable read-only audit agent. Execute specialized audits through six lenses — bugs, architecture, security, requirements, code-quality, performance — selected via the lens field in the capability packet. Triggers when a workflow needs a findings-only audit. Never modifies implementation.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.0.0"
8
8
  model_tier: deep
9
9
  permission: read-only
@@ -3,7 +3,7 @@ name: builder
3
3
  description: Write-permitted implementation agent. Implement approved plans by modifying source code, creating files, and updating existing code while following project conventions. Triggers when a workflow has an approved plan or task with a disjoint write set. Never redesigns architecture, performs reviews, or generates implementation plans.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.0.0"
8
8
  model_tier: standard
9
9
  permission: write
@@ -3,7 +3,7 @@ name: context-curator
3
3
  description: Read-only context preparation agent. Decide which files to open, retrieve memories, use Synapse when appropriate, apply Context Firewall rules, and produce a concise Context Packet consumed by other agents. Triggers when a workflow needs the minimum high-quality context before dispatching a planner, builder, or reviewer. Never implements, reviews, or plans.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.0.0"
8
8
  model_tier: deep
9
9
  permission: read-only
@@ -3,7 +3,7 @@ name: designer
3
3
  description: Screen implementation and design-conformance agent. Verify and implement user-facing screens against their design source, reading Figma through MCP when a link or node id is supplied. Default read-only; writes only UI-layer files when explicitly scoped with a disjoint write set. Triggers whenever a task creates or modifies a screen. Owns screen-vs-design conformance only; no production logic outside the UI layer.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.0.0"
8
8
  model_tier: standard
9
9
  permission: write
@@ -3,7 +3,7 @@ name: documentation-agent
3
3
  description: Engineering documentation agent. Generate README, ADR, RFC, changelog, KDoc, and architecture documentation. Default read-only; writes only doc files when explicitly scoped with a disjoint write set. Triggers when a workflow needs documentation artifacts. Never modifies implementation.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.0.0"
8
8
  model_tier: light
9
9
  permission: write
@@ -3,7 +3,7 @@ name: furps-analyst
3
3
  description: Read-only FURPS+ dimension analyst. Analyze exactly one FURPS+ dimension (F, U, R, P, S, or X) of a PRD or ADR against its checklist section and return structured refinement findings. Triggers when the furps-refinement workflow fans out per-dimension analysis. Never analyzes other dimensions, never writes files, never mutates Atlassian issues.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.0.0"
8
8
  model_tier: deep
9
9
  permission: read-only
@@ -3,7 +3,7 @@ name: investigator
3
3
  description: Read-only codebase investigation agent. Locate implementations, trace execution flow, identify dependencies, estimate change impact, and answer engineering questions. Triggers when a workflow needs to understand existing code before planning or implementing. Never modifies code, never generates implementation, never performs reviews.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.0.0"
8
8
  model_tier: deep
9
9
  permission: read-only
@@ -3,7 +3,7 @@ name: judge
3
3
  description: Debate-panel evaluator for judge-with-debate. Score an artifact against the meta-judge's evaluation specification with quoted evidence, then defend or revise scores across up to 3 debate rounds until the panel reaches consensus. Writes only its own judge-N report file per dispatch. Never judges outside the specification, never revises without quoted evidence.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.2.0"
8
8
  model_tier: deep
9
9
  permission: write
@@ -3,7 +3,7 @@ name: meta-judge
3
3
  description: Read-only evaluation-specification author for judge-with-debate. Generate the tailored rubric, criteria, weights, and checklists that a panel of judge agents uses to evaluate an artifact through independent analysis and multi-round debate. Runs exactly once per evaluation. Never scores the artifact, never edits the specification after emission.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.1.0"
8
8
  model_tier: deep
9
9
  permission: read-only
@@ -3,7 +3,7 @@ name: mobile-specialist
3
3
  description: Conditional mobile expertise agent. Provide Android, Kotlin, Compose, KMP, Swift, iOS, Gradle, CocoaPods, performance, lifecycle, and offline-sync guidance. Invoked only when the workflow detects a mobile-related project. Read-only. Triggers on mobile detection signals; refuses non-mobile targets.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.0.0"
8
8
  model_tier: deep
9
9
  permission: read-only
@@ -3,7 +3,7 @@ name: navigator
3
3
  description: Code exploration specialist that leverages the massa-ai semantic index instead of brute-force file reads. Use when the user asks "where is X?", "how does Y work?", "who calls Z?", or for any question about an indexed codebase. Starts every investigation by consulting the massa-ai index (project map, definitions, references) before falling back to Read/Grep.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.1.0"
8
8
  model_tier: deep
9
9
  permission: read-only
@@ -3,7 +3,7 @@ name: plan-critic
3
3
  description: Read-only plan-challenge agent. Stress-test a constructed plan, surface the assumption most likely to fail, name the deterministic check that would falsify success, and return a bounded critique for the lite or full Plan Challenge gate. Triggers after a concrete plan exists. Never edits the plan, never implements, never expands scope.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.0.0"
8
8
  model_tier: deep
9
9
  permission: read-only
@@ -3,7 +3,7 @@ name: planner
3
3
  description: Read-only planning agent. Transform engineering requests into implementation plans by breaking work into steps, identifying dependencies and risks, suggesting execution order, and producing an implementation strategy. Triggers when a workflow needs a plan before implementation. Never implements or reviews code.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.0.0"
8
8
  model_tier: deep
9
9
  permission: read-only
@@ -3,7 +3,7 @@ name: requirements-analyst
3
3
  description: Read-only requirements analysis agent. Detect ambiguity, missing requirements, contradictions, implicit requirements, and uncovered scenarios before implementation. Triggers during the Specify phase when gray areas, persistence, external calls, auth, payments, concurrency, or state transitions affect behavior. Never implements.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.0.0"
8
8
  model_tier: deep
9
9
  permission: read-only
@@ -3,7 +3,7 @@ name: reviewer
3
3
  description: Read-only diff review agent. Analyze diffs to detect bugs, regressions, code smells, missing edge cases, and suggest improvements. Triggers after a builder completes a task and before the verification gate. Never implements, rewrites files, or plans features.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.0.0"
8
8
  model_tier: deep
9
9
  permission: read-only
@@ -3,7 +3,7 @@ name: test-engineer
3
3
  description: Testing strategy agent. Generate unit, integration, edge-case, negative-scenario, and acceptance-coverage test plans. Default read-only; writes only test files when explicitly scoped with a disjoint write set. Triggers when a workflow needs a test strategy or test plan. Focuses only on testing; no production code changes outside test files.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.0.0"
8
8
  model_tier: standard
9
9
  permission: write
@@ -3,7 +3,7 @@ name: verification-agent
3
3
  description: Read-only verification agent. Centralize Verification Ladder logic by validating outputs, choosing the verification level, executing the verification checklist, detecting incomplete work, and producing verification reports. Triggers as the mandatory final gate before a task is claimed complete. Never modifies implementation.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.0.0"
8
8
  model_tier: deep
9
9
  permission: read-only
@@ -3,7 +3,7 @@ name: massa-ai
3
3
  description: Default memory-backed workflow router for every coding, planning-before-coding, debugging, code review, refactoring, or implementation conversation. Always load it once per new coding session, select specialized workflows first, and use the general fallback otherwise. Handles massa-ai recall/search, durable memory, context compaction, handoff, audits, specs, ADR/RFC/TDD, and evidence gates. Do NOT use for generic non-coding chat or bulk-loading every workflow/reference.
4
4
  license: MIT
5
5
  metadata:
6
- author: S1LV4, luizgmassa
6
+ author: Luiz Massa
7
7
  version: "1.0.0"
8
8
  ---
9
9
 
@@ -297,6 +297,7 @@ Load only when a selected workflow asks for them:
297
297
  - `references/lessons.md`
298
298
  - `references/naming-standards.md`
299
299
  - `references/pr-task-fix.md`
300
+ - `references/code-quality-lens.md`
300
301
  - `references/architecture-lenses.md`
301
302
  - `references/architecture-domain-lens.md`
302
303
  - `references/architecture-coupling-lens.md`
@@ -137,8 +137,6 @@ dispatch.
137
137
 
138
138
  Before adding a new reusable role, load `references/subagent-design.md` and write a bounded role charter. For one-off tasks, use an existing role plus the prompt contract below instead of inventing a new role.
139
139
 
140
- ## Roles
141
-
142
140
  **The roster lives in one place: the Agent Table of `skills/AGENTS.md`**, which names
143
141
  every shipped specialist with its purpose, trigger, permission, and charter path. Do not
144
142
  restate it here. A second roster in this file is what let `judge` and `meta-judge` go
@@ -181,11 +179,50 @@ When dispatching a subagent, send a compact capability packet rather than a loos
181
179
  - `output`: the exact output contract
182
180
  - `firewall`: raw logs, diffs, snapshots, reports, or research that must be summarized
183
181
  - `memory`: whether the subagent may suggest memories and who persists them
184
- - `persona`: optional. The cataloged persona id in effect for the parent conversation, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions. Pass the id alone, never the persona prompt.
182
+ - `persona`: optional. The active route's cataloged persona id in effect for the parent conversation, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions. Pass the id alone, never the persona prompt. Omit the field when no persona is routed.
185
183
  - `next_use`: what the main agent will do with the result
186
184
  - `lens`: conditional — `audit-specialist` dispatches only. One of `bugs | architecture | security | requirements | code-quality | performance`.
187
185
 
188
- The named dispatch block that workflows embed (the quoted block whose header carries the prefixed agent name and role) is the block projection of this packet: `role` and `purpose` live in the block's header line, and `next_use` defaults to "the main agent synthesizes and continues the workflow" when absent. The remaining eight fields — `trigger, scope, permissions, inputs, sensors, output, firewall, memory` — appear as the block's body lines. The optional `persona` field appears there too.
186
+ The named dispatch block that workflows embed (the quoted block whose header carries the prefixed agent name and role) is the block projection of this packet: `role` and `purpose` live in the block's header line, and `next_use` defaults to "the main agent synthesizes and continues the workflow" when absent. The remaining eight fields — `trigger, scope, permissions, inputs, sensors, output, firewall, memory` — appear as the block's body lines, except where Role Defaults below already fix a field's value.
187
+
188
+ ### Role Defaults
189
+
190
+ A dispatch block carries only what varies. Every line below is that field's value
191
+ for **every** dispatch of the named role, supplied by this file rather than
192
+ restated per workflow. A block that restates one has forked the contract, which
193
+ is the failure these defaults exist to make impossible — the same field said
194
+ twice is the same field free to disagree.
195
+
196
+ Reading a workflow's dispatch block therefore means reading this section beside
197
+ it. That is the trade: the block stops being self-contained in exchange for
198
+ having exactly one place a shared value can be wrong.
199
+
200
+ **Every role, every dispatch**
201
+
202
+ - `persona` — as defined in the Capability Packet list above. It is never written
203
+ in a dispatch block; it applies to all of them.
204
+
205
+ **`massa-ai-reviewer`**
206
+
207
+ - `fallback`: if the subagent is unavailable, run a standalone fresh-eyes review against this output contract and record the skipped-delegation reason
208
+
209
+ **`massa-ai-verification-agent`**
210
+
211
+ - `permissions`: read-only
212
+
213
+ **`massa-ai-designer`** — its dispatch is mandatory-on-condition, so its trigger is
214
+ fixed here rather than per workflow; a block that reworded it would silently make
215
+ the dispatch advisory in that one file.
216
+
217
+ - `trigger`: the task creates or modifies a user-facing screen — mandatory once that condition holds, per the Screen Implementation Exception in `references/agent-orchestration.md`; it does not fire when no screen surface is touched
218
+ - `sensors`: Figma MCP read when a design source exists; per-element expected-vs-actual comparison; the UI module's own build/lint; the states a design under-specifies — empty, loading, error, long text, small and large sizes
219
+ - `inputs`: exact `projectId`, parent `workflowSessionId`, Figma links/node ids or screenshots when supplied, acceptance criteria, the repository's existing UI conventions and design tokens, recalled screen patterns
220
+ - `firewall`: summarized design-source evidence and `path:line` pointers only, never raw Figma node dumps or full file bodies
221
+ - `memory`: suggest-only; the main agent persists durable screen and design-token conventions
222
+
223
+ A designer block therefore carries only `scope`, `permissions` and `output` — the
224
+ three fields that genuinely differ between an audit that may not write and an
225
+ implementation workflow that may.
189
226
 
190
227
  ## Prompt Contract
191
228
 
@@ -4,7 +4,7 @@ Use from audit workflows, implementation audit, bug finder, mobile Figma, and ex
4
4
 
5
5
  ## Scope Packets
6
6
 
7
- Every audit scope must produce a compact scope packet before analysis:
7
+ Every audit scope must produce a compact scope packet before analysis. Resolve the mechanical half of it with `bun skills/massa-ai/scripts/resolve_scope.ts --scope modified|range|branch|files|whole`, which emits scope type, target focus, resolution method, base, head, resolved files, applied exclusions, and a freshness timestamp as JSON. It resolves files, not judgment: the ask-when-vague rule below and the per-lens evidence selection stay with the agent, and the script refuses rather than inventing a base when none can be resolved.
8
8
 
9
9
  ```text
10
10
  Scope Type: <modified files | explicit files/globs | commit range | branch comparison | codebase area | symbol/class/function | feature/flow | PR diff>
@@ -0,0 +1,107 @@
1
+ # Code Quality Lens
2
+
3
+ Load from `workflows/code-quality/code-quality-audit.md` (detection) and
4
+ `workflows/code-quality/code-quality-fix.md` (repair). Both workflows used to
5
+ carry their own copy of these rules, in different words, which is how one copy
6
+ drifts into saying something the other does not.
7
+
8
+ This file owns the rules themselves. Each workflow owns only what is genuinely
9
+ its own: the audit owns static leads, severity, and the report contract; the fix
10
+ owns sizing, the refactoring map, and behavior preservation.
11
+
12
+ ## The Split Criterion
13
+
14
+ One criterion governs every "should this be split out?" question in this lens,
15
+ whether the answer becomes a finding or an edit:
16
+
17
+ **Split only when the result yields an externally-findable named unit (locatable
18
+ by search or grep from outside the file) or measurably reduces change risk;
19
+ never split on size or "more than one thing" alone.**
20
+
21
+ The negative half is the load-bearing half. "This function does more than one
22
+ thing" and "this file is long" are observations, not defects: an extraction that
23
+ produces a helper only its single caller can find has moved the code without
24
+ making anything easier to locate, change, or delete. Splitting on an accurate
25
+ description needing the word "and" is the specific rule this replaces, and it is
26
+ not a rule here.
27
+
28
+ Apply the same criterion, unchanged, when the question is inverted — whether to
29
+ inline rather than split.
30
+
31
+ ## File Shape
32
+
33
+ Flag multi-subject files (unrelated exported surfaces bundled together) and any
34
+ file over ~600 lines, regardless of subject count — it crowds out working
35
+ context for the rest of the task (see `references/coding-guidelines.md` "File
36
+ shape for agent readers"). Do NOT flag a single-subject file for line count
37
+ alone below that bound.
38
+
39
+ ## SOLID
40
+
41
+ Non-test source only.
42
+
43
+ | Principle | Flag when | Fix direction |
44
+ |---|---|---|
45
+ | Single Responsibility | a class or module bundles distinct concern groups — validation plus persistence, formatting plus dispatch — and separating them meets the Split Criterion above, never on concern-count or size alone | separate mixed responsibilities only when the split yields an externally-findable named unit (locatable by search or grep from outside the file) or reduces change risk |
46
+ | Open/Closed | a caller-side switch or if/else chain on a type tag means adding a variant requires modifying existing files | replace with polymorphism or a data map only when new variants are real |
47
+ | Liskov | a subtype throws where the base does not, ignores required methods, or narrows the base contract | preserve base contracts |
48
+ | Interface Segregation | an interface forces implementors to define unused methods | narrow fat interfaces |
49
+ | Dependency Inversion | a hardcoded `new ConcreteType()` sits inside a class body where abstraction or injection would be natural | inject dependencies when hardcoded concretes block testing or substitution |
50
+
51
+ ## Clean Code
52
+
53
+ Test and non-test source.
54
+
55
+ | Smell | Flag when | Fix direction |
56
+ |---|---|---|
57
+ | Magic values | a meaningful bare literal repeats — strings, timeouts, thresholds, event names | replace with named constants |
58
+ | Function does more than one thing | the Split Criterion above is met | split functions only when the result yields an externally-findable named unit (locatable by search or grep from outside the file) or measurably reduces change risk — never split on size or "more than one thing" alone |
59
+ | Unqualified generic names | a name carries no domain or role qualification | name domain concepts precisely using `references/naming-standards.md` |
60
+ | What-comments | a comment restates the code | remove it; keep only why comments for constraints, workarounds, or non-obvious invariants |
61
+ | Half-finished surfaces | an exported TODO, stub, placeholder return, or "implement later" path | finish or delete it |
62
+ | Long parameter lists | more than 3-4 positional parameters | convert to an options object when it improves call-site clarity |
63
+
64
+ ## KISS, YAGNI, DRY
65
+
66
+ **KISS.** Flag abstractions, layers, indirection, or control flow that raise
67
+ cognitive load without clearly improving readability, correctness, or constraint
68
+ handling. Call out premature generalization, deep call chains, excessive
69
+ configuration, and clever patterns that obscure intent. Prefer straightforward,
70
+ explicit code a new reader can follow end-to-end: inline trivial abstractions,
71
+ collapse unnecessary layers, choose boring solutions unless complexity is
72
+ justified (real variability, hard constraints, or measured bottlenecks). When
73
+ weighing whether to split instead of inline, apply the Split Criterion above
74
+ unchanged — the direction of the question does not change the criterion.
75
+
76
+ **YAGNI.** Flag speculative features, extension points, and generic
77
+ infrastructure with no concrete caller, requirement, or near-term use. Call out
78
+ "just in case" hooks, over-parameterization, unused toggles, and frameworks
79
+ introduced ahead of need. Prefer implementing only what current use cases
80
+ demand, structured to evolve when real requirements appear. Defer generalization
81
+ until duplication or constraints force it, and remove dead or unused paths
82
+ aggressively.
83
+
84
+ **DRY.** Flag duplicated logic, data transformations, or domain rules repeated
85
+ without a strong reason (e.g., performance isolation or explicit decoupling).
86
+ Highlight copy-paste patterns, parallel conditionals, and repeated constants
87
+ that raise maintenance cost or inconsistency risk. Recommend consolidation into
88
+ a single source of truth when it improves clarity and reduces bugs, but avoid
89
+ over-abstraction that harms readability or adds indirection for trivial reuse.
90
+
91
+ **AI-slop surfaces.** Generic abstractions with no domain vocabulary,
92
+ fabricated-looking type names, unnecessary factories/builders, wrappers around
93
+ one call, comments that narrate obvious code, and broad configurability not
94
+ supported by current requirements. Remove them when current usage evidence does
95
+ not justify them.
96
+
97
+ ## Standing Rules
98
+
99
+ - Prefer delete, inline, or merge over a replacement abstraction whenever simpler
100
+ code preserves behavior.
101
+ - Require usage evidence before calling a surface unnecessary. When the evidence
102
+ is incomplete, mark the item `suspect` rather than reporting it as a defect.
103
+ - **Architecture boundary.** Do not report, recommend, or introduce ports,
104
+ adapters, bounded contexts, new service/module boundaries, or VSA-style folder
105
+ migration from this lens. Those need dependency-direction, strength, distance,
106
+ volatility, module-depth, or cross-domain ownership evidence this lens does not
107
+ gather — hand them to `workflows/architecture/architecture-audit.md`.
@@ -39,7 +39,6 @@ implementation code is planned or written:
39
39
  > - output: the reuse map (below), evidence-or-zero when nothing reusable is found
40
40
  > - firewall: summarized candidates and pointers only, never raw file dumps
41
41
  > - memory: suggest-only; main agent persists durable reuse findings
42
- > - persona: optional — the active route's cataloged id only, never the persona prompt, passed as advisory framing only — it never overrides the agent's charter Restrictions, scope, or permissions; omit when no persona is routed
43
42
 
44
43
  Dispatch one subagent per coherent target area; dispatch more than one only
45
44
  when the areas are independent enough to scope separately.
@@ -18,8 +18,8 @@ human chose to merge it".
18
18
 
19
19
  | # | Stage | Command | On failure |
20
20
  | --- | --- | --- | --- |
21
- | 0 | Preflight | `git rev-parse --is-inside-work-tree`; `command -v gh`; `gh auth status` | Record which capabilities are absent and select the degraded path below |
22
- | 1 | Isolate | `git fetch origin <base> && git worktree add -b <type>/<slug> <path> origin/<base>` | Branch name taken → suffix `-2`. Worktree path taken → reuse it only if its branch matches |
21
+ | 0 | Preflight | `bun skills/massa-ai/scripts/ensure_worktree.ts` runs this: `git rev-parse --is-inside-work-tree`; `command -v gh`; `gh auth status` | Record which capabilities are absent and select the degraded path below |
22
+ | 1 | Isolate | `bun skills/massa-ai/scripts/ensure_worktree.ts --branch <type>/<slug> [--base <base>] [--path <path>]`, which runs `git fetch origin <base> && git worktree add -b <type>/<slug> <path> origin/<base>` | Branch name taken → suffix `-2`. Worktree path taken → reuse it only if its branch matches. The script applies both rules and prints the resulting path + branch |
23
23
  | 1.5 | Summarize | present the pre-implementation change summary (see Stage 1.5) | Summary skipped → stop and present it before the first mutation; a mutation made without it is a protocol violation to report, not to hide |
24
24
  | 2 | Implement | one task → gate → `git commit` | Gate red → fix before committing. Never commit through a failing gate |
25
25
  | 3 | Push | `git push -u origin <type>/<slug>` | Rejected non-fast-forward → `git fetch` + rebase, never force-push a shared branch |
@@ -45,7 +45,10 @@ The only two legal skip reasons:
45
45
  2. The user explicitly declined isolation for this task.
46
46
 
47
47
  Record the skip reason verbatim in the completion report. Any other reason is a
48
- protocol violation, not a shortcut.
48
+ protocol violation, not a shortcut. `ensure_worktree.ts` emits exactly these two
49
+ strings and no third: it detects reason 1 from the tree, and takes reason 2 only
50
+ from an explicit `--skip-declined`, because a script cannot observe a user
51
+ declining anything.
49
52
 
50
53
  **Record the isolation evidence immediately after creation:** the worktree path
51
54
  and branch name go into the session status the moment Stage 1 completes, and
@@ -0,0 +1,37 @@
1
+ # Skill Authoring Principles
2
+
3
+ Read once, before Phase 1 of `workflows/skill-architect.md`. This file carries
4
+ the principles and the conversational manner; the workflow carries the five
5
+ phases, their exit criteria, and the hard rules.
6
+
7
+ ## Core Philosophy
8
+
9
+ 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.
10
+
11
+ 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.
12
+
13
+ 3. **Composability over completeness.** Skills coexist with other skills. Never assume yours is the only one loaded. Be a good neighbor.
14
+
15
+ 4. **Specificity beats verbosity.** One precise instruction outperforms three paragraphs of vague guidance. Code beats prose for deterministic checks.
16
+
17
+ 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.
18
+
19
+ ## Phase Sequence
20
+
21
+ ```
22
+ DISCOVERY → ARCHITECTURE → CRAFT → VALIDATE → DELIVER
23
+ ```
24
+
25
+ Move through phases sequentially. Never skip Discovery. Each phase has
26
+ explicit exit criteria before you advance.
27
+
28
+ ## Conversation Style
29
+
30
+ - Ask questions one area at a time — don't dump all Discovery questions at once
31
+ - Give concrete suggestions the user can react to ("Would something like X work?")
32
+ - If the user provides a vague request, propose a specific interpretation and ask
33
+ if it matches their intent
34
+ - If the conversation already contains a workflow (user says "turn this into a
35
+ skill"), extract what you can from history FIRST, then fill gaps with questions
36
+ - Match the user's technical level — explain terms if they seem non-technical
37
+ - Be direct about tradeoffs: if a design choice has a downside, say so
@@ -10,6 +10,8 @@ Classify implementation size before editing:
10
10
  - Standard: <=10 files or <=500 changed LOC within one ownership area, or shared behavior/public API/test impact that still has clear acceptance criteria and no unresolved architecture decision.
11
11
  - Spec-driven: >10 files, >500 changed LOC, multiple ownership areas, unclear acceptance criteria, new dependency, migration, irreversible operation, security/privacy/auth, public compatibility, cross-service contract, or any unresolved architecture/product decision.
12
12
 
13
+ Get the file and LOC halves from `bun skills/massa-ai/scripts/size_change.ts` (`--staged` for the index, `--range <a>..<b>` for a range) rather than counting a diff by eye. It reports changed files, changed LOC (added + deleted), and the resulting **size floor**. The qualitative half of each bullet above — acceptance criteria, dependencies, migrations, irreversible operations, security/privacy/auth, public compatibility, cross-service contracts, unresolved decisions — is invisible to a diff, so the script's answer is a lower bound: raise it when any of those applies, never lower it.
14
+
13
15
  Quick tasks can proceed inside the active workflow. Standard tasks need an explicit verification recipe before edits. Spec-driven tasks should route to `workflows/spec-driven.md` or be split into atomic tasks.
14
16
 
15
17
  ## Shared Reference Trigger Table
@@ -33,7 +33,10 @@
33
33
 
34
34
  import { readFileSync } from "node:fs";
35
35
 
36
- const TYPES = ["feat", "fix", "refactor", "docs", "test", "style", "perf", "build", "ci", "chore"];
36
+ // `revert` is in the list because `workflows/commit.md` §8 names it in the type
37
+ // precedence order the workflow tells the agent to pick from. Without it the
38
+ // script rejected a message the workflow had just instructed the agent to write.
39
+ const TYPES = ["feat", "fix", "refactor", "docs", "test", "style", "perf", "build", "ci", "chore", "revert"];
37
40
 
38
41
  // massa-ai patch (D1c): an optional leading Jira-style key prefix, e.g.
39
42
  // "[SA-142] feat(auth): reject expired tokens" (workflows/commit.md §8). The