@massa-ai/cursor-plugin 1.26.0 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor-plugin/plugin.json +1 -1
- package/agent-profiles/balanced/massa-ai-judge.md +3 -6
- package/agent-profiles/balanced/massa-ai-meta-judge.md +2 -5
- package/agent-profiles/balanced/massa-ai-navigator.md +1 -1
- package/agent-profiles/cheap/massa-ai-judge.md +3 -6
- package/agent-profiles/cheap/massa-ai-meta-judge.md +2 -5
- package/agent-profiles/cheap/massa-ai-navigator.md +1 -1
- package/agent-profiles/heavy/massa-ai-judge.md +3 -6
- package/agent-profiles/heavy/massa-ai-meta-judge.md +2 -5
- package/agent-profiles/heavy/massa-ai-navigator.md +1 -1
- package/agent-profiles/home/massa-ai-judge.md +3 -6
- package/agent-profiles/home/massa-ai-meta-judge.md +2 -5
- package/agent-profiles/home/massa-ai-navigator.md +1 -1
- package/agent-profiles/work/massa-ai-judge.md +3 -6
- package/agent-profiles/work/massa-ai-meta-judge.md +2 -5
- package/agent-profiles/work/massa-ai-navigator.md +1 -1
- package/agents/massa-ai-judge.md +3 -6
- package/agents/massa-ai-meta-judge.md +2 -5
- package/agents/massa-ai-navigator.md +1 -1
- package/package.json +1 -1
- package/skills/agents/judge/SKILL.md +4 -7
- package/skills/agents/meta-judge/SKILL.md +3 -6
- package/skills/agents/navigator/SKILL.md +2 -2
- package/skills/massa-ai/SKILL.md +1 -16
- package/skills/massa-ai/references/adr-authoring.md +3 -3
- package/skills/massa-ai/references/agent-orchestration.md +17 -2
- package/skills/massa-ai/references/architecture-coupling-lens.md +1 -1
- package/skills/massa-ai/references/architecture-deepening-lens.md +1 -1
- package/skills/massa-ai/references/architecture-domain-lens.md +1 -1
- package/skills/massa-ai/references/architecture-lenses.md +1 -1
- package/skills/massa-ai/references/audit-report-io.md +32 -2
- package/skills/massa-ai/references/audit-scope.md +22 -1
- package/skills/massa-ai/references/code-annotation.md +5 -5
- package/skills/massa-ai/references/codebase-investigation.md +1 -1
- package/skills/massa-ai/references/context-firewall.md +2 -1
- package/skills/massa-ai/references/conversation-feedback.md +1 -1
- package/skills/massa-ai/references/debug-diagnosis-loop.md +1 -1
- package/skills/massa-ai/references/decision-engine.md +1 -1
- package/skills/massa-ai/references/evidence-gate.md +1 -1
- package/skills/massa-ai/references/figma-pre-analysis.md +3 -3
- package/skills/massa-ai/references/furps/analyst-role.md +1 -1
- package/skills/massa-ai/references/furps/checklist.md +1 -1
- package/skills/massa-ai/references/furps/intake.md +1 -1
- package/skills/massa-ai/references/furps/report-contract.md +1 -1
- package/skills/massa-ai/references/graceful-degradation.md +22 -0
- package/skills/massa-ai/references/hook-enforcement.md +3 -3
- package/skills/massa-ai/references/implementation-delivery.md +4 -4
- package/skills/massa-ai/references/installation.md +1 -1
- package/skills/massa-ai/references/lessons.md +2 -2
- package/skills/massa-ai/references/maestro/artifacts-reports.md +1 -1
- package/skills/massa-ai/references/maestro/cli-device.md +1 -1
- package/skills/massa-ai/references/maestro/cloud.md +1 -1
- package/skills/massa-ai/references/maestro/config-env-output.md +1 -1
- package/skills/massa-ai/references/maestro/fact-ledger.md +1 -1
- package/skills/massa-ai/references/maestro/js-scripting.md +1 -1
- package/skills/massa-ai/references/maestro/mcp.md +1 -1
- package/skills/massa-ai/references/maestro/patterns.md +1 -1
- package/skills/massa-ai/references/maestro/selectors.md +1 -1
- package/skills/massa-ai/references/maestro/workspace-execution.md +1 -1
- package/skills/massa-ai/references/maestro/yaml-commands.md +1 -1
- package/skills/massa-ai/references/maestro.md +1 -1
- package/skills/massa-ai/references/mcp-tools.md +2 -2
- package/skills/massa-ai/references/memory-policy.md +2 -2
- package/skills/massa-ai/references/mobile-context.md +9 -5
- package/skills/massa-ai/references/mobile-diagnosis.md +2 -2
- package/skills/massa-ai/references/mobile-figma-matcher/android-compose.md +1 -1
- package/skills/massa-ai/references/mobile-figma-matcher/android-views.md +1 -1
- package/skills/massa-ai/references/mobile-figma-matcher/core.md +1 -1
- package/skills/massa-ai/references/mobile-figma-matcher/ios-swiftui.md +1 -1
- package/skills/massa-ai/references/mobile-figma-matcher/ios-uikit.md +1 -1
- package/skills/massa-ai/references/mobile-figma-matcher/kmp-compose-multiplatform.md +1 -1
- package/skills/massa-ai/references/mobile-figma-matcher/repository-detection.md +1 -1
- package/skills/massa-ai/references/naming-standards.md +1 -1
- package/skills/massa-ai/references/pr-task-fix.md +2 -2
- package/skills/massa-ai/references/project-context.md +2 -2
- package/skills/massa-ai/references/repo-rules-discovery.md +4 -4
- package/skills/massa-ai/references/rfc/discovery-and-sizing.md +1 -1
- package/skills/massa-ai/references/rfc/document-contract.md +1 -1
- package/skills/massa-ai/references/rfc/quality-and-lifecycle.md +1 -1
- package/skills/massa-ai/references/root-cause-scripts.md +2 -2
- package/skills/massa-ai/references/sonarqube-mcp.md +73 -0
- package/skills/massa-ai/references/spec-driven/artifact-store.md +1 -1
- package/skills/massa-ai/references/spec-driven/brownfield-mapping.md +16 -0
- package/skills/massa-ai/references/spec-driven/code-analysis.md +1 -1
- package/skills/massa-ai/references/spec-driven/coding-principles.md +1 -1
- package/skills/massa-ai/references/spec-driven/context-limits.md +1 -1
- package/skills/massa-ai/references/spec-driven/design.md +22 -1
- package/skills/massa-ai/references/spec-driven/discuss.md +1 -1
- package/skills/massa-ai/references/spec-driven/execute.md +3 -1
- package/skills/massa-ai/references/spec-driven/memory.md +1 -1
- package/skills/massa-ai/references/spec-driven/specify.md +3 -3
- package/skills/massa-ai/references/spec-driven/sub-agents.md +1 -1
- package/skills/massa-ai/references/spec-driven/tasks.md +1 -1
- package/skills/massa-ai/references/spec-driven/validate.md +1 -1
- package/skills/massa-ai/references/subagent-design.md +4 -4
- package/skills/massa-ai/references/synapse-policy.md +1 -1
- package/skills/massa-ai/references/tdd/calibrated-examples.md +1 -1
- package/skills/massa-ai/references/tdd/discovery-and-sizing.md +1 -1
- package/skills/massa-ai/references/tdd/document-contract.md +1 -1
- package/skills/massa-ai/references/tdd/quality-and-lifecycle.md +1 -1
- package/skills/massa-ai/references/the-fool/cognitive-bias-inventory.md +1 -1
- package/skills/massa-ai/references/the-fool/dialectic-synthesis.md +1 -1
- package/skills/massa-ai/references/the-fool/evidence-audit.md +1 -1
- package/skills/massa-ai/references/the-fool/pre-mortem-analysis.md +1 -1
- package/skills/massa-ai/references/the-fool/red-team-adversarial.md +1 -1
- package/skills/massa-ai/references/the-fool/socratic-questioning.md +1 -1
- package/skills/massa-ai/references/ticket/atlassian-fix.md +1 -1
- package/skills/massa-ai/references/ticket/intake-and-sources.md +1 -1
- package/skills/massa-ai/references/ticket/templates-and-quality.md +1 -1
- package/skills/massa-ai/references/verification-ladder.md +1 -1
- package/skills/massa-ai/scripts/validate_audit_report.ts +382 -0
- package/skills/massa-ai/scripts/validate_design.ts +264 -0
- package/skills/massa-ai/workflows/adr.md +16 -8
- package/skills/massa-ai/workflows/architecture/architecture-audit.md +23 -40
- package/skills/massa-ai/workflows/architecture/architecture-fix.md +14 -6
- package/skills/massa-ai/workflows/bugs/bugs-audit.md +19 -35
- package/skills/massa-ai/workflows/bugs/bugs-fix.md +13 -5
- package/skills/massa-ai/workflows/code-quality/code-quality-audit.md +25 -41
- package/skills/massa-ai/workflows/code-quality/code-quality-fix.md +13 -5
- package/skills/massa-ai/workflows/commit.md +13 -5
- package/skills/massa-ai/workflows/debug.md +11 -3
- package/skills/massa-ai/workflows/design.md +15 -7
- package/skills/massa-ai/workflows/exploration.md +12 -4
- package/skills/massa-ai/workflows/feature.md +14 -13
- package/skills/massa-ai/workflows/general.md +13 -8
- package/skills/massa-ai/workflows/implementation/implementation-audit.md +15 -15
- package/skills/massa-ai/workflows/implementation/implementation-fix.md +13 -5
- package/skills/massa-ai/workflows/judge-with-debate.md +12 -4
- package/skills/massa-ai/workflows/long-session.md +10 -2
- package/skills/massa-ai/workflows/maestro/maestro-audit.md +11 -3
- package/skills/massa-ai/workflows/maestro/maestro-fix.md +12 -4
- package/skills/massa-ai/workflows/maestro/maestro.md +12 -4
- package/skills/massa-ai/workflows/mobile-figma/mobile-figma-audit.md +11 -3
- package/skills/massa-ai/workflows/mobile-figma/mobile-figma-fix.md +12 -4
- package/skills/massa-ai/workflows/onboarding.md +10 -2
- package/skills/massa-ai/workflows/refactor.md +12 -4
- package/skills/massa-ai/workflows/refinement/furps-refinement.md +12 -4
- package/skills/massa-ai/workflows/requirements/requirements-audit.md +19 -36
- package/skills/massa-ai/workflows/requirements/requirements-fix.md +13 -5
- package/skills/massa-ai/workflows/rfc.md +10 -2
- package/skills/massa-ai/workflows/security/security-audit.md +19 -35
- package/skills/massa-ai/workflows/security/security-fix.md +13 -5
- package/skills/massa-ai/workflows/spec-driven.md +20 -23
- package/skills/massa-ai/workflows/tdd.md +10 -2
- package/skills/massa-ai/workflows/tests/tests-audit.md +19 -35
- package/skills/massa-ai/workflows/tests/tests-fix.md +13 -5
- package/skills/massa-ai/workflows/the-fool.md +11 -3
- package/skills/massa-ai/workflows/ticket.md +10 -2
|
@@ -1,12 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architecture-audit
|
|
3
|
+
description: "Findings-only audit workflow for domain boundaries, bounded contexts, coupling, and architecture health against a concrete target; not for SOLID or code quality scans."
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
version: "1.1.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
1
9
|
### Architecture Audit
|
|
2
10
|
|
|
3
|
-
|
|
11
|
+
Findings-only audit of domain boundaries, bounded contexts, DDD strategic design, coupling, dependency health, architecture review, deepening opportunities, seams, adapters, module depth, and architecture-focused refactor planning, 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
|
-
|
|
13
|
+
Load `references/project-context.md` (intake sweep) before the first substantive read.
|
|
6
14
|
|
|
7
|
-
|
|
15
|
+
Not for plain SOLID, Clean Code, KISS, YAGNI, DRY, or code smell scans — use `workflows/code-quality/code-quality-audit.md` for those.
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
Findings-only: do not edit code unless the user separately asks for fixes.
|
|
10
18
|
|
|
11
19
|
1. Resolve/reuse `workflowSessionId`: `architecture-[entity]`
|
|
12
20
|
2. Load shared references:
|
|
@@ -34,34 +42,9 @@ This workflow is findings-only. Do not edit code unless the user separately asks
|
|
|
34
42
|
- Implementation parent scope: use only when `workflows/implementation/implementation-audit.md` invokes this workflow with a concrete implementation scope packet.
|
|
35
43
|
- 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`.
|
|
36
44
|
- Build the shared scope packet from `references/audit-scope.md` and carry it into the report.
|
|
37
|
-
5.
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
- Exclude deleted files unless their deletion can break imports, exports, routing, migrations, config, tests, packaging, or architecture contracts.
|
|
41
|
-
- Exclude generated, dependency, build, log, cache, temporary, and secret paths per repo rules.
|
|
42
|
-
- Inspect diffs first, then only the surrounding code needed to understand architecture behavior.
|
|
43
|
-
6. For commit range scope:
|
|
44
|
-
- If the user supplied explicit commits or a revision range, use that exact range.
|
|
45
|
-
- If the user asked for commits made by me, resolve author identity from `git config user.email`; if empty, use `git config user.name`.
|
|
46
|
-
- 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`.
|
|
47
|
-
- If the user asked for commits made by me, review branch-unique commits authored by the resolved identity.
|
|
48
|
-
- If no explicit range, required author identity, or branch base can be resolved, ask the user for the missing value before proceeding.
|
|
49
|
-
- Inspect changed files and diffs from those commits, then exported surfaces, references, dependency direction, tests, config, and ADRs only as needed.
|
|
50
|
-
7. For codebase area scope:
|
|
51
|
-
- Require a concrete path, module, package, feature area, architecture question, or glob.
|
|
52
|
-
- If the target area is missing, ask for it before proceeding.
|
|
53
|
-
- Follow the shared retrieval order from `references/codebase-investigation.md` to find target modules, entry points, exported surfaces, references, semantic hotspots, tests, and adjacent config.
|
|
54
|
-
- If scope is broad, map only top-level modules first and ask or recommend a narrower second pass.
|
|
55
|
-
8. For explicit files/globs, branch comparison, symbol/class/function, feature/flow, or explicitly requested whole-repo scope:
|
|
56
|
-
- Resolve the target with `references/audit-scope.md` and record the resolution method, base/head when relevant, resolved files, exclusions, and freshness timestamp.
|
|
57
|
-
- For symbol/class/function targets, verify definitions, references, dependency direction, exported surfaces, callers, tests, and ADRs only as needed for architecture claims.
|
|
58
|
-
- For feature/flow targets, map entry points through main transformations, contracts, and side effects before applying architecture lenses.
|
|
59
|
-
- If whole-repo scope is requested, map top-level modules first and report skipped depth checks rather than pretending exhaustive coverage.
|
|
60
|
-
9. For implementation parent scope:
|
|
61
|
-
- Accept the exact scope packet from `implementation-audit`; do not broaden beyond resolved files, surrounding code, exported surfaces, references, config, tests, and ADRs needed to verify an architecture claim.
|
|
62
|
-
- Return compact findings to the parent implementation audit; do not write broad project memories unless explicitly assigned.
|
|
63
|
-
10. Investigation pass:
|
|
64
|
-
- Call `get_architecture` with `id` (projectId) for the architecture-specific deep map: packages, entry points, routes, hotspots, communities, layers, and opt-in cycles (pass `aspects:["cycles"]` for Tarjan SCC over CALL edges). `get_architecture` is distinct from `project_map` (general overview: PageRank backbone + symbol counts) — use `get_architecture` for architecture-specific structure and `project_map` for the general overview. Both only count as evidence when the index is fresh for the current repository path and commit/worktree state; fall back to `search`/`get_references` and record reduced retrieval confidence when the index is stale or unavailable.
|
|
45
|
+
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, Architecture row of Per-Lens Scope Deltas).
|
|
46
|
+
6. Investigation pass:
|
|
47
|
+
- Call `get_architecture` with `id` (projectId) for the architecture-specific deep map: packages, entry points, routes, hotspots, communities, layers, and opt-in cycles (pass `aspects:["cycles"]` for Tarjan SCC over CALL edges). `get_architecture` differs from `project_map` (general overview: PageRank backbone + symbol counts) — use `get_architecture` for architecture-specific structure, `project_map` for the general overview. Both count as evidence only when the index is fresh for the current repository path and commit/worktree state; otherwise fall back to `search`/`get_references` and record reduced retrieval confidence.
|
|
65
48
|
- Call `impact_analysis` with `project`, `projectPath`, and `scope` (unstaged/staged/committed/all) to assess the centrality-ranked blast radius of a change set. An empty diff returns an empty impact set (not an error).
|
|
66
49
|
- Apply the smallest relevant lens set from `references/architecture-lenses.md` and load detail references only when their evidence is needed:
|
|
67
50
|
- Domain lens: subdomains, bounded contexts, ubiquitous language, cohesion score, colliding concepts, cross-domain ownership, and integration pattern fit.
|
|
@@ -70,7 +53,7 @@ This workflow is findings-only. Do not edit code unless the user separately asks
|
|
|
70
53
|
- Use `search_definitions` and `get_references` to verify exported surfaces and dependency direction where needed.
|
|
71
54
|
- Capture positive architecture patterns when they materially disprove a concern, such as versioned contracts, anti-corruption layers, cohesive local coupling, or a deep interface that concentrates tests.
|
|
72
55
|
- For each candidate finding, record the concrete claim, source evidence, lens-specific evidence, impacted boundary or module, provisional severity, tradeoff, simplest sufficient direction, and what would disprove it.
|
|
73
|
-
|
|
56
|
+
7. False-positive pass:
|
|
74
57
|
- Try to disprove every candidate before reporting it.
|
|
75
58
|
- Check ADRs, accepted exceptions, current domain docs, dependency direction, call paths, tests, package boundaries, framework constraints, git history when cheap, and prior rejected refactors.
|
|
76
59
|
- Treat recalled memories and standalone skill heuristics as leads, not proof.
|
|
@@ -78,8 +61,8 @@ This workflow is findings-only. Do not edit code unless the user separately asks
|
|
|
78
61
|
- Do not report strong coupling as a defect when strength is local, stable, or cohesive and no change friction is shown.
|
|
79
62
|
- Do not recommend ports/adapters, service extraction, VSA migration, or new seams unless evidence shows real variation, volatility, external dependency pressure, or boundary friction.
|
|
80
63
|
- Drop candidates disproven by evidence, downgrade candidates with partial mitigation, and mark judgment-heavy conclusions as `suspect`.
|
|
81
|
-
- When you reject a refactor candidate, record its load-bearing reason in ruled-out candidates; if
|
|
82
|
-
|
|
64
|
+
- When you reject a refactor candidate, record its load-bearing reason in ruled-out candidates; if likely to be re-proposed, offer an ADR via `workflows/adr.md` so the rejection is not re-litigated next audit.
|
|
65
|
+
8. Use agent orchestration only when it improves signal. Dispatch per `references/agent-orchestration.md`:
|
|
83
66
|
|
|
84
67
|
> **Dispatch: `massa-ai-architecture-specialist`** (role: `architecture-specialist`) — charter `skills/agents/architecture-specialist/SKILL.md`
|
|
85
68
|
> - trigger: large scope, explicit parallel/subagent request, PR subagent invocation, isolated audit slice, or independent verification of high-impact finding
|
|
@@ -102,26 +85,26 @@ This workflow is findings-only. Do not edit code unless the user separately asks
|
|
|
102
85
|
> - firewall: raw logs/snapshots summarized
|
|
103
86
|
> - memory: suggest-only; main agent persists reusable verification recipes
|
|
104
87
|
> - 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
|
|
105
|
-
|
|
88
|
+
9. Severity rules (apply the countable threshold first, then the qualitative clause):
|
|
106
89
|
- `critical`: architecture issue likely causes data loss, auth/privacy break, production outage, irreversible corruption, OR affects >10 files; otherwise use the qualitative clause below.
|
|
107
90
|
- `high`: strong coupling with high volatility, boundary violation, dependency inversion break, or shallow module design likely to cause major change friction or regression.
|
|
108
91
|
- `medium`: meaningful but recoverable coupling, unclear boundary, missing seam, duplicated architecture rule, or module-depth issue with localized impact (<=10 affected files, recoverable).
|
|
109
92
|
- `low`: architecture hardening opportunity, low-impact naming/layering issue, incomplete evidence, or weakly supported concern.
|
|
110
|
-
|
|
93
|
+
10. Final report:
|
|
111
94
|
- Findings first, ordered by severity.
|
|
112
95
|
- Each finding must use `ARCH-<N>` and include the canonical fields from `references/audit-report-io.md`: lens, boundary/module, tradeoff, dependency direction when relevant, severity, confidence, file/module, concrete evidence, impact, simplest sufficient fix, and verification suggestion.
|
|
113
96
|
- Mark uncertain or judgment-heavy conclusions as `suspect`.
|
|
114
97
|
- Do not relitigate ADR-backed decisions unless current evidence shows real friction worth reopening.
|
|
115
98
|
- Prefer merge, inline, move, or clarify-seam recommendations before adding new abstractions.
|
|
116
|
-
- Include lens-specific evidence in existing fields: domain findings
|
|
99
|
+
- Include lens-specific evidence in existing fields: domain findings name language/cohesion/integration evidence; coupling findings name strength/distance/volatility and dependency direction; deepening findings name interface complexity, deletion-test result, dependency category, and test-surface impact.
|
|
117
100
|
- If no architecture findings are found, say that clearly and list scope checked plus skipped checks.
|
|
118
101
|
- Include ruled-out candidates when they were plausible enough to matter.
|
|
119
102
|
- Include scope checked, deterministic evidence or skipped-check notes, memory outcome, and residual risk.
|
|
120
103
|
- Include the Verification/Test Fidelity Checklist from `references/audit-report-io.md`; tie every `ARCH-*` 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.
|
|
121
104
|
- For direct top-level invocation, use the Plan Mode save rule and canonical report contract from `references/audit-report-io.md` for `audits/architecture/<YYYY-MM-DD architecture-audit>.md`.
|
|
122
105
|
- For implementation audit child invocation, return compact findings to the parent unless the parent explicitly requests saved audit artifacts.
|
|
123
|
-
|
|
106
|
+
11. Persist only durable knowledge:
|
|
124
107
|
- Persist accepted architecture constraints, repeated coupling patterns, accepted exceptions, rejected refactors, or reusable verification recipes.
|
|
125
108
|
- Do not persist every one-off finding.
|
|
126
109
|
- Use required tags: `project:<projectId>`, `session:<workflowSessionId>`, `workflow:architecture-audit`, `entity:<entity>`, and one `memory:<tier>` tag.
|
|
127
|
-
|
|
110
|
+
12. Complete the Evidence Gate from `references/evidence-gate.md`.
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architecture-fix
|
|
3
|
+
description: "Executes fixes from a saved architecture audit report; not for findings-only review or broad new design work with missing requirements."
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
version: "1.1.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
1
9
|
### Architecture Fix
|
|
2
10
|
|
|
3
|
-
|
|
11
|
+
Execute fixes from an architecture audit markdown report only.
|
|
4
12
|
|
|
5
|
-
|
|
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`
|
|
15
|
+
Before the first repository mutation, load `references/implementation-delivery.md` (delivery chain: worktree, atomic commits, PR, CI watch, merge gate) and `references/code-annotation.md` (doc blocks, rationale, test coverage). After two consecutive failed fixes on one symptom, stop editing and load `references/root-cause-scripts.md`.
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
Not for findings-only architecture review — route to `workflows/architecture/architecture-audit.md`. Not for broad new design work with missing requirements — route to `workflows/spec-driven.md`.
|
|
10
18
|
|
|
11
19
|
1. Resolve/reuse `workflowSessionId`: `architecture-fix-[entity]`
|
|
12
20
|
2. Load shared references:
|
|
@@ -27,7 +35,7 @@ Do not use this workflow for findings-only architecture review; route that to `w
|
|
|
27
35
|
- If the user asks for "latest" or gives no path, require a concrete target focus first; do not run the latest architecture report against an unspecified target.
|
|
28
36
|
- Select the latest `audits/architecture/<YYYY-MM-DD architecture-audit>.md` only after target focus is known, using `references/audit-report-io.md`.
|
|
29
37
|
- Stop if no report exists; do not infer findings from conversation history.
|
|
30
|
-
- Validate the report
|
|
38
|
+
- Validate the report deterministically: `bun skills/massa-ai/scripts/validate_audit_report.ts <path> --family architecture` (`references/audit-report-io.md`, Deterministic Validation); non-zero exit blocks editing. Also confirm resolved files or material scope evidence and current file/module evidence; stop on stale, target-drifted, or ambiguous reports.
|
|
31
39
|
5. Extract actionable architecture findings:
|
|
32
40
|
- Keep findings with concrete `Lens`, `Boundary/Module`, `Tradeoff`, `Location`, `Evidence`, `Impact`, `Simplest Fix Direction`, and `Verification Suggestion`.
|
|
33
41
|
- Require lens-specific closure evidence: domain findings need language/ownership or integration evidence; coupling findings need strength/distance/volatility or dependency-direction evidence; deepening findings need deletion-test, seam, dependency-category, or test-surface evidence.
|
|
@@ -47,7 +55,7 @@ Do not use this workflow for findings-only architecture review; route that to `w
|
|
|
47
55
|
- Coupling: reduce strength before distance; replace internal model sharing with explicit contracts, remove cross-boundary knowledge of internals, invert dependencies at stable seams, keep cohesive local coupling close, and avoid cycles.
|
|
48
56
|
- Deepening: delete shallow pass-through modules, merge split concepts when locality improves, deepen useful interfaces by hiding invariants and ordering, test through the interface, and clarify seams only where variation, dependency direction, external I/O, or test substitution justifies it.
|
|
49
57
|
- When a deepening candidate has two or more viable interface shapes, load the Interface Design Method from `references/architecture-deepening-lens.md` (Design It Twice) and pick by leverage and locality before editing.
|
|
50
|
-
- When you decide not to apply a reported refactor, record the load-bearing reason; if
|
|
58
|
+
- When you decide not to apply a reported refactor, record the load-bearing reason; if likely to recur, offer an ADR via `workflows/adr.md` so the rejection is not re-litigated.
|
|
51
59
|
- Prefer move, merge, inline, or clarify existing seams before adding new abstractions.
|
|
52
60
|
- Use ports/adapters or anti-corruption layers only when the report evidence shows real volatility, boundary pressure, external dependency pressure, model leakage, or at least two real adapters such as production plus test.
|
|
53
61
|
- Do not turn a local code-quality concern into an architecture migration; route broad new design, VSA migration, new service boundaries, or unclear ownership to `workflows/spec-driven.md`.
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bugs-audit
|
|
3
|
+
description: "Findings-only bug discovery workflow for a concrete target; route known broken behavior to debug and code-quality concerns to code-quality-audit."
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
version: "1.1.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
1
9
|
### Bugs Audit
|
|
2
10
|
|
|
3
|
-
|
|
11
|
+
Findings-only bug discovery 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
|
-
|
|
13
|
+
Load `references/project-context.md` (intake sweep) before the first substantive read.
|
|
6
14
|
|
|
7
|
-
|
|
15
|
+
Not to fix a known broken behavior — route to `workflows/debug.md`. Not for SOLID, Clean Code, KISS, YAGNI, DRY, maintainability, or overengineering analysis — route to `workflows/code-quality/code-quality-audit.md`. For a multi-lens implementation review, route to `workflows/implementation/implementation-audit.md`. When invoked by implementation audit, this workflow is the Correctness lens only.
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
Findings-only: do not edit code unless the user separately asks for fixes.
|
|
10
18
|
|
|
11
19
|
1. Resolve/reuse `workflowSessionId`: `bugs-audit-[entity]`
|
|
12
20
|
2. Load shared references:
|
|
@@ -30,32 +38,8 @@ This workflow is findings-only. Do not edit code unless the user separately asks
|
|
|
30
38
|
- Implementation parent scope: use only when `workflows/implementation/implementation-audit.md` invokes this workflow with a concrete implementation scope packet.
|
|
31
39
|
- 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`.
|
|
32
40
|
- Build or accept the shared scope packet from `references/audit-scope.md` and carry it into the report.
|
|
33
|
-
5.
|
|
34
|
-
|
|
35
|
-
- Include untracked non-generated source, test, fixture, schema, config, and docs files only when they can affect runtime or validation behavior.
|
|
36
|
-
- Exclude deleted files unless their deletion can break imports, exports, routing, migrations, config, tests, or packaging.
|
|
37
|
-
- Exclude generated, dependency, build, log, cache, temporary, and secret paths per repo rules.
|
|
38
|
-
- Inspect diffs first, then only the surrounding code needed to understand behavior.
|
|
39
|
-
6. For commit range scope:
|
|
40
|
-
- If the user supplied explicit commits or a revision range, use that exact range.
|
|
41
|
-
- If the user asked for commits made by me, resolve author identity from `git config user.email`; if empty, use `git config user.name`.
|
|
42
|
-
- 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`.
|
|
43
|
-
- If the user asked for commits made by me, review branch-unique commits authored by the resolved identity.
|
|
44
|
-
- If no explicit range, required author identity, or branch base can be resolved, ask the user for the missing value before proceeding.
|
|
45
|
-
- Inspect changed files and diffs from those commits, then surrounding code, callers, tests, and config only as needed.
|
|
46
|
-
7. For codebase area scope:
|
|
47
|
-
- Require a concrete path, module, package, feature area, or glob.
|
|
48
|
-
- If the target area is missing, ask for it before proceeding.
|
|
49
|
-
- Follow the shared retrieval order from `references/codebase-investigation.md` to find entry points, public API, tests, and adjacent config.
|
|
50
|
-
8. For explicit files/globs, branch comparison, symbol/class/function, feature/flow, or explicitly requested whole-repo scope:
|
|
51
|
-
- Resolve the target with `references/audit-scope.md` and record the resolution method, base/head when relevant, resolved files, exclusions, and freshness timestamp.
|
|
52
|
-
- For symbol/class/function targets, inspect definitions, callers, callees, tests, contracts, and config only as needed to verify likely bugs.
|
|
53
|
-
- For feature/flow targets, trace input -> transformation -> output through the named flow.
|
|
54
|
-
- If whole-repo scope is requested, map high-risk entry points first and report skipped depth checks rather than implying exhaustive review.
|
|
55
|
-
9. For implementation parent scope:
|
|
56
|
-
- Accept the exact scope packet from `implementation-audit`; do not broaden beyond resolved files, surrounding code, callers, callees, tests, config, migrations, schemas, and public contracts needed to verify a correctness claim.
|
|
57
|
-
- Return compact Correctness findings to the parent implementation audit; do not write broad project memories unless explicitly assigned.
|
|
58
|
-
10. Investigation pass. Dispatch `audit-specialist` per `references/agent-orchestration.md` when the scope justifies an isolated read-only subagent:
|
|
41
|
+
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, Bugs row of Per-Lens Scope Deltas).
|
|
42
|
+
6. Investigation pass. Dispatch `audit-specialist` per `references/agent-orchestration.md` when the scope justifies an isolated read-only subagent:
|
|
59
43
|
|
|
60
44
|
> **Dispatch: `massa-ai-audit-specialist`** (role: `audit-specialist`) — charter `skills/agents/audit-specialist/SKILL.md`
|
|
61
45
|
> - trigger: large scope, explicit parallel/subagent request, PR subagent invocation, or independent verification of high-impact finding
|
|
@@ -72,17 +56,17 @@ This workflow is findings-only. Do not edit code unless the user separately asks
|
|
|
72
56
|
- Check diffs, surrounding code, callers and callees, tests, config, migrations, schemas, and recalled project patterns.
|
|
73
57
|
- Prioritize correctness bugs, crashes, data loss, security regressions, broken contracts, async or race issues, validation or authorization gaps, persistence and migration bugs, environment/config issues, and behavior that contradicts tests or public API contracts.
|
|
74
58
|
- For each candidate finding, record the concrete claim, bug class, source evidence, impacted flow, trigger or repro path, root-cause hypothesis, regression risk, provisional severity, and what would disprove it.
|
|
75
|
-
|
|
59
|
+
7. False-positive pass:
|
|
76
60
|
- Try to disprove every candidate before reporting it.
|
|
77
61
|
- Check guards, type checks, tests, feature flags, framework contracts, call paths, existing invariants, ADRs, and accepted exceptions.
|
|
78
62
|
- Use official docs or web research only when current external API or framework behavior matters.
|
|
79
63
|
- Drop candidates disproven by evidence, downgrade candidates with partial mitigation, and mark low-confidence findings explicitly.
|
|
80
|
-
|
|
64
|
+
8. Severity rules (apply the countable threshold first, then the qualitative clause):
|
|
81
65
|
- `critical`: likely data loss, security bypass, production outage, irreversible corruption, auth/privacy break, OR affects >10 files; otherwise use the qualitative clause below.
|
|
82
66
|
- `high`: likely crash, major regression, broken core flow, incorrect persistence, missing required validation, or severe operational risk.
|
|
83
67
|
- `medium`: real edge-flow bug, recoverable incorrect behavior (<=10 affected files), flaky async/state risk, incomplete error handling, or meaningful test gap around changed logic.
|
|
84
68
|
- `low`: minor bug, low-impact incorrect behavior, defensive hardening opportunity, incomplete evidence, or weakly supported concern.
|
|
85
|
-
|
|
69
|
+
9. Final report:
|
|
86
70
|
- Findings first, ordered by severity: `critical`, `high`, `medium`, `low`.
|
|
87
71
|
- Each finding must use `BUG-<N>` and include the canonical fields from `references/audit-report-io.md`: severity, confidence, file/line, evidence, bug class, impacted flow, trigger or repro path, root-cause hypothesis, regression risk, impact, simplest fix direction, and verification suggestion.
|
|
88
72
|
- If no bugs are found, say that clearly and list scope checked plus skipped checks.
|
|
@@ -91,11 +75,11 @@ This workflow is findings-only. Do not edit code unless the user separately asks
|
|
|
91
75
|
- Include the Verification/Test Fidelity Checklist from `references/audit-report-io.md`; tie every `BUG-*` 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.
|
|
92
76
|
- For direct top-level invocation, use the Plan Mode save rule and canonical report contract from `references/audit-report-io.md` for `audits/bugs/<YYYY-MM-DD bugs-audit>.md`.
|
|
93
77
|
- For implementation audit child invocation, return compact findings to the parent unless the parent explicitly requests saved audit artifacts.
|
|
94
|
-
|
|
78
|
+
10. Persist only durable knowledge:
|
|
95
79
|
- Do not persist one-off findings.
|
|
96
80
|
- Persist repeated bug patterns, fragile project-specific flows, accepted exceptions, or reusable verification recipes after scoring with the Importance Calibration System.
|
|
97
81
|
- Use required tags: `project:<projectId>`, `session:<workflowSessionId>`, `workflow:bugs-audit`, `entity:<entity>`, and one `memory:<tier>` tag.
|
|
98
|
-
|
|
82
|
+
11. Complete the Evidence Gate from `references/evidence-gate.md`.
|
|
99
83
|
|
|
100
84
|
## Examples
|
|
101
85
|
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bugs-fix
|
|
3
|
+
description: "Executes fixes from a saved bugs audit report; not for findings-only discovery, single known issues without a report, or broad product changes."
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
version: "1.1.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
1
9
|
### Bugs Fix
|
|
2
10
|
|
|
3
|
-
|
|
11
|
+
Execute fixes from a bugs audit markdown report only.
|
|
4
12
|
|
|
5
|
-
|
|
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`
|
|
15
|
+
Before the first repository mutation, load `references/implementation-delivery.md` (delivery chain: worktree, atomic commits, PR, CI watch, merge gate) and `references/code-annotation.md` (doc blocks, rationale, test coverage). After two consecutive failed fixes on one symptom, stop editing and load `references/root-cause-scripts.md`.
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
Not for findings-only bug discovery — route to `workflows/bugs/bugs-audit.md`. Not for one known broken behavior without an audit report — route to `workflows/debug.md`. Not for broad product/design changes — route to `workflows/spec-driven.md`.
|
|
10
18
|
|
|
11
19
|
1. Resolve/reuse `workflowSessionId`: `bugs-fix-[entity]`
|
|
12
20
|
2. Load shared references:
|
|
@@ -23,7 +31,7 @@ Do not use this workflow for findings-only bug discovery; route that to `workflo
|
|
|
23
31
|
- If the user asks for "latest" or gives no path, require a concrete target focus first; do not run the latest bugs report against an unspecified target.
|
|
24
32
|
- Select the latest `audits/bugs/<YYYY-MM-DD bugs-audit>.md` only after target focus is known, using `references/audit-report-io.md`.
|
|
25
33
|
- Stop if no report exists; do not infer findings from conversation history.
|
|
26
|
-
- Validate the report
|
|
34
|
+
- Validate the report deterministically: `bun skills/massa-ai/scripts/validate_audit_report.ts <path> --family bugs` (`references/audit-report-io.md`, Deterministic Validation); non-zero exit blocks editing. Also confirm resolved files or material scope evidence and current file/line evidence; stop on stale, target-drifted, or ambiguous reports.
|
|
27
35
|
5. Extract actionable bug findings:
|
|
28
36
|
- Keep findings with concrete `Bug Class`, `Impacted Flow`, `Trigger or Repro Path`, `Root Cause Hypothesis`, `Regression Risk`, `Location`, `Evidence`, `Simplest Fix Direction`, and `Verification Suggestion`.
|
|
29
37
|
- Ignore ruled-out candidates, no-finding sections, and low-confidence hardening ideas unless the user explicitly asks to include them.
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-quality-audit
|
|
3
|
+
description: "Findings-only audit workflow for SOLID, Clean Code, KISS, YAGNI, DRY, maintainability, and code-smell issues in a concrete target; not for architecture concerns."
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
version: "1.1.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
1
9
|
### Code Quality Audit
|
|
2
10
|
|
|
3
|
-
|
|
11
|
+
Findings-only audit of SOLID, Clean Code, KISS, YAGNI, DRY, maintainability, overengineering, code smell, or violations-check issues, 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
|
-
|
|
13
|
+
Load `references/project-context.md` (intake sweep) before the first substantive read.
|
|
6
14
|
|
|
7
|
-
|
|
15
|
+
Not for domain boundaries, bounded contexts, coupling analysis, module depth, seams, adapters, or architecture refactor opportunities — route those to `workflows/architecture/architecture-audit.md`. Keep local pass-through wrappers, unused speculation, vague names, duplicate literals, and simple overengineering here when the finding does not require architecture-lens evidence.
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
Findings-only: do not edit code unless the user separately asks for fixes.
|
|
10
18
|
|
|
11
19
|
1. Resolve/reuse `workflowSessionId`: `quality-[entity]`
|
|
12
20
|
2. Load shared references:
|
|
@@ -32,32 +40,8 @@ This workflow is findings-only. Do not edit code unless the user separately asks
|
|
|
32
40
|
- Implementation parent scope: use only when `workflows/implementation/implementation-audit.md` invokes this workflow with a concrete implementation scope packet.
|
|
33
41
|
- 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`.
|
|
34
42
|
- Build the shared scope packet from `references/audit-scope.md` and carry it into the report.
|
|
35
|
-
5.
|
|
36
|
-
|
|
37
|
-
- Include untracked non-generated source, test, fixture, schema, config, and docs files only when they can affect maintainability, validation behavior, or public contracts.
|
|
38
|
-
- Exclude deleted files unless their deletion can break imports, exports, routing, migrations, config, tests, or packaging.
|
|
39
|
-
- Exclude generated, dependency, build, log, cache, temporary, and secret paths per repo rules.
|
|
40
|
-
- Inspect diffs first, then only the surrounding code needed to understand quality claims.
|
|
41
|
-
6. For commit range scope:
|
|
42
|
-
- If the user supplied explicit commits or a revision range, use that exact range.
|
|
43
|
-
- If the user asked for commits made by me, resolve author identity from `git config user.email`; if empty, use `git config user.name`.
|
|
44
|
-
- 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`.
|
|
45
|
-
- If the user asked for commits made by me, review branch-unique commits authored by the resolved identity.
|
|
46
|
-
- If no explicit range, required author identity, or branch base can be resolved, ask the user for the missing value before proceeding.
|
|
47
|
-
- Inspect changed files and diffs from those commits, then surrounding code, callers, tests, config, and public API only as needed.
|
|
48
|
-
7. For codebase area scope:
|
|
49
|
-
- Require a concrete path, module, package, feature area, or glob.
|
|
50
|
-
- If the target area is missing, ask for it before proceeding.
|
|
51
|
-
- Follow the shared retrieval order from `references/codebase-investigation.md` to find target modules, semantic hotspots, public API, tests, and adjacent config.
|
|
52
|
-
8. For explicit files/globs, branch comparison, symbol/class/function, feature/flow, or explicitly requested whole-repo scope:
|
|
53
|
-
- Resolve the target with `references/audit-scope.md` and record the resolution method, base/head when relevant, resolved files, exclusions, and freshness timestamp.
|
|
54
|
-
- For symbol/class/function targets, inspect definitions, references, call sites, tests, and current usage evidence before reporting quality claims.
|
|
55
|
-
- For feature/flow targets, map the main code path only as far as needed to identify local maintainability or overengineering issues.
|
|
56
|
-
- If whole-repo scope is requested, report sampled/top-level coverage and skipped deep checks instead of implying exhaustive review.
|
|
57
|
-
9. For implementation parent scope:
|
|
58
|
-
- Accept the exact scope packet from `implementation-audit`; do not broaden beyond resolved files, surrounding code, public API, tests, config, and project patterns needed to verify a quality claim.
|
|
59
|
-
- Return compact findings to the parent implementation audit; do not write broad project memories unless explicitly assigned.
|
|
60
|
-
10. Input rules:
|
|
43
|
+
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, Code Quality row of Per-Lens Scope Deltas).
|
|
44
|
+
6. Input rules:
|
|
61
45
|
- SOLID inputs: non-test source files only.
|
|
62
46
|
- Clean Code inputs: test and non-test source files.
|
|
63
47
|
- KISS/YAGNI/DRY inputs: test and non-test source files, plus docs/config only when they define behavior or public contracts.
|
|
@@ -65,7 +49,7 @@ This workflow is findings-only. Do not edit code unless the user separately asks
|
|
|
65
49
|
- Keep local quality issues in this workflow when the fix is delete, inline, rename, extract a constant, collapse a trivial wrapper, simplify control flow, or consolidate duplicated local rules.
|
|
66
50
|
- Route to `workflows/architecture/architecture-audit.md` when the claim needs bounded-context language, dependency direction, strength/distance/volatility, module depth, seam placement, adapter reality, or cross-domain ownership evidence.
|
|
67
51
|
- If unsure, report as `suspect` only when concrete local maintainability evidence exists; otherwise recommend an architecture-audit follow-up instead of forcing a CQ finding.
|
|
68
|
-
|
|
52
|
+
7. Decide whether to use agent orchestration:
|
|
69
53
|
- Load it only for large PRs, codebase-wide audits, explicit parallel/subagent requests, or independent verification of judgment-heavy findings.
|
|
70
54
|
- Keep the audit local for small scopes, unresolved user intent, tightly coupled code without clear owners, or platforms that do not permit subagents.
|
|
71
55
|
- The main agent still owns scope, memory recall, static leads, synthesis, final report, persistence, and Evidence Gate.
|
|
@@ -84,7 +68,7 @@ This workflow is findings-only. Do not edit code unless the user separately asks
|
|
|
84
68
|
|
|
85
69
|
- Do not delegate every check by default; avoid duplicate source reading when one main-agent pass is cheaper.
|
|
86
70
|
- Subagents may suggest memory content, but the main agent decides what durable knowledge to persist.
|
|
87
|
-
|
|
71
|
+
8. Gather deterministic leads with static scans where useful:
|
|
88
72
|
- Type-tag branches: `switch`, `case`, `if/else if`, discriminant fields such as `type`, `kind`, `variant`, `mode`.
|
|
89
73
|
- Concrete construction: `new [A-Z]` inside class or service bodies.
|
|
90
74
|
- Half-finished surfaces: `TODO`, `implement later`, exported stubs, `return null`, empty method bodies.
|
|
@@ -97,7 +81,7 @@ This workflow is findings-only. Do not edit code unless the user separately asks
|
|
|
97
81
|
- Complexity without payoff: deep nesting, miniature state machines, or polymorphism where a direct branch or data map would preserve clarity.
|
|
98
82
|
- AI-slop surfaces: generic abstractions with no domain vocabulary, fabricated-looking type names, unnecessary factories/builders, wrappers around one call, comments that narrate obvious code, and broad configurability not supported by current requirements.
|
|
99
83
|
- Android/KMP Compose recomposition leads: `@Composable`, `remember`, `rememberSaveable`, `derivedStateOf`, `LaunchedEffect`, `DisposableEffect`, `SideEffect`, `produceState`, `snapshotFlow`, `mutableStateOf`, `SnapshotStateList`, stability annotations/config, Compose compiler reports, Compose UI tests, and screenshot tests.
|
|
100
|
-
|
|
84
|
+
9. Investigation pass:
|
|
101
85
|
- Use summary/enriched search, symbol tools, and targeted file reads to inspect target modules, semantic hotspots, public classes, interfaces, functions, and exported API surface.
|
|
102
86
|
- Apply SOLID checks to non-test source only:
|
|
103
87
|
- Single Responsibility: flag classes/modules with distinct concern groups, such as validation plus persistence or formatting plus dispatch.
|
|
@@ -113,9 +97,9 @@ This workflow is findings-only. Do not edit code unless the user separately asks
|
|
|
113
97
|
- Half-finished surfaces: flag exported TODOs, stubs, placeholder returns, and "implement later" code.
|
|
114
98
|
- Long parameter lists: flag more than 3-4 positional parameters; suggest an options object.
|
|
115
99
|
- Apply KISS/YAGNI/DRY checks:
|
|
116
|
-
- KISS: flag abstractions, layers, indirection, or control flow that
|
|
117
|
-
- YAGNI: flag speculative features, extension points, and generic infrastructure
|
|
118
|
-
- DRY: flag duplicated logic, data transformations, or domain rules
|
|
100
|
+
- KISS: flag abstractions, layers, indirection, or control flow that raise cognitive load without clearly improving readability, correctness, or constraint handling. Call out premature generalization, deep call chains, excessive configuration, and clever patterns that obscure intent. Prefer straightforward, explicit code a new reader can follow end-to-end: inline trivial abstractions, collapse unnecessary layers, choose boring solutions unless complexity is justified (real variability, hard constraints, or measured bottlenecks).
|
|
101
|
+
- YAGNI: flag speculative features, extension points, and generic infrastructure with no concrete caller, requirement, or near-term use. Call out "just in case" hooks, over-parameterization, unused toggles, and frameworks introduced ahead of need. Prefer implementing only what current use cases demand, structured to evolve when real requirements appear. Defer generalization until duplication or constraints force it, and remove dead or unused paths aggressively.
|
|
102
|
+
- DRY: flag duplicated logic, data transformations, or domain rules repeated without a strong reason (e.g., performance isolation or explicit decoupling). Highlight copy-paste patterns, parallel conditionals, and repeated constants that raise maintenance cost or inconsistency risk. Recommend consolidation into a single source of truth when it improves clarity and reduces bugs, but avoid over-abstraction that harms readability or adds indirection for trivial reuse.
|
|
119
103
|
- Prefer delete, inline, or merge recommendations over replacement abstractions when simpler code preserves behavior.
|
|
120
104
|
- Require usage evidence before calling a surface unnecessary; if evidence is incomplete, mark the item `suspect`.
|
|
121
105
|
- Do not recommend ports, adapters, bounded contexts, new service/module boundaries, or VSA migration from this workflow; hand those to architecture-audit.
|
|
@@ -126,16 +110,16 @@ This workflow is findings-only. Do not edit code unless the user separately asks
|
|
|
126
110
|
- Mark semantic recomposition claims as `suspect` unless supported by Compose compiler stability/skippability reports, existing Compose UI tests, screenshot tests, benchmark/runtime traces, or a clear deterministic static source pattern.
|
|
127
111
|
- Verification suggestions should name the cheapest available sensor: Compose compiler metrics/reports, focused Compose UI test, screenshot/golden test, instrumentation/emulator check, or static lint/build command.
|
|
128
112
|
- For each candidate finding, record the concrete claim, source evidence, impacted maintainability or change-risk flow, provisional severity, and what would disprove it.
|
|
129
|
-
|
|
113
|
+
10. False-positive pass:
|
|
130
114
|
- Try to disprove every candidate before reporting it.
|
|
131
115
|
- Check framework-required signatures, public SDK or plugin surfaces, ADR-backed extension points, test fixtures/builders, harmless local literals, intentionally tiny adapters, usage evidence, and accepted exceptions.
|
|
132
116
|
- Drop candidates disproven by evidence, downgrade candidates with partial mitigation, and mark judgment-heavy items as `suspect`.
|
|
133
|
-
|
|
117
|
+
11. Severity rules (apply the countable threshold first, then the qualitative clause):
|
|
134
118
|
- `critical`: quality issue likely causes production outage, data loss, auth/privacy break, OR affects >10 files; otherwise use the qualitative clause below.
|
|
135
119
|
- `high`: strong SOLID/Clean Code/KISS/YAGNI/DRY violation with high change volatility likely to cause major regression, repeated bugs, or high-cost change friction.
|
|
136
120
|
- `medium`: real maintainability issue, speculative surface, duplicated rule, weak naming/comment pattern, or avoidable complexity with localized impact (<=10 affected files).
|
|
137
121
|
- `low`: minor hardening opportunity, low-impact cleanup, incomplete evidence, or weakly supported concern.
|
|
138
|
-
|
|
122
|
+
12. Final report:
|
|
139
123
|
- Findings first, ordered by severity.
|
|
140
124
|
- Each finding must use `CQ-<N>` and include the canonical fields from `references/audit-report-io.md`: rule, current shape, simplest safe transformation, severity, confidence, file/line, concrete evidence, impact, simplest sufficient fix, and verification suggestion.
|
|
141
125
|
- For Android/KMP Compose recomposition findings, include whether the risk is excessive recomposition or missing/stale recomposition, the affected composable or state boundary, UX impact, confidence, and the deterministic sensor that would prove or disprove the claim.
|
|
@@ -148,8 +132,8 @@ This workflow is findings-only. Do not edit code unless the user separately asks
|
|
|
148
132
|
- Include the Verification/Test Fidelity Checklist from `references/audit-report-io.md`; tie every `CQ-*` 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.
|
|
149
133
|
- For direct top-level invocation, use the Plan Mode save rule and canonical report contract from `references/audit-report-io.md` for `audits/code-quality/<YYYY-MM-DD code-quality-audit>.md`.
|
|
150
134
|
- For implementation audit child invocation, return compact findings to the parent unless the parent explicitly requests saved audit artifacts.
|
|
151
|
-
|
|
135
|
+
13. Persist only durable knowledge:
|
|
152
136
|
- Do not persist one-off findings.
|
|
153
137
|
- Persist repeated anti-patterns, project-specific quality rules, accepted exceptions, or repeated overengineering patterns via `remember` after scoring with the Importance Calibration System.
|
|
154
138
|
- Use required tags: `project:<projectId>`, `session:<workflowSessionId>`, `workflow:code-quality-audit`, `entity:<entity>`, and one `memory:<tier>` tag.
|
|
155
|
-
|
|
139
|
+
14. Complete the Evidence Gate from `references/evidence-gate.md`.
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-quality-fix
|
|
3
|
+
description: "Executes fixes from a saved code quality audit report; not for findings-only SOLID, Clean Code, KISS, YAGNI, DRY, or overengineering analysis."
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
version: "1.1.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
1
9
|
### Code Quality Fix
|
|
2
10
|
|
|
3
|
-
|
|
11
|
+
Execute fixes from a code quality audit markdown report only.
|
|
4
12
|
|
|
5
|
-
|
|
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`
|
|
15
|
+
Before the first repository mutation, load `references/implementation-delivery.md` (delivery chain: worktree, atomic commits, PR, CI watch, merge gate) and `references/code-annotation.md` (doc blocks, rationale, test coverage). After two consecutive failed fixes on one symptom, stop editing and load `references/root-cause-scripts.md`.
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
Not for findings-only SOLID, Clean Code, KISS, YAGNI, DRY, maintainability, or overengineering analysis — route to `workflows/code-quality/code-quality-audit.md`.
|
|
10
18
|
|
|
11
19
|
1. Resolve/reuse `workflowSessionId`: `code-quality-fix-[entity]`
|
|
12
20
|
2. Load shared references:
|
|
@@ -24,7 +32,7 @@ Do not use this workflow for findings-only SOLID, Clean Code, KISS, YAGNI, DRY,
|
|
|
24
32
|
- If the user asks for "latest" or gives no path, require a concrete target focus first; do not run the latest code quality report against an unspecified target.
|
|
25
33
|
- Select the latest `audits/code-quality/<YYYY-MM-DD code-quality-audit>.md` only after target focus is known, using `references/audit-report-io.md`.
|
|
26
34
|
- Stop if no report exists; do not infer findings from conversation history.
|
|
27
|
-
- Validate the report
|
|
35
|
+
- Validate the report deterministically: `bun skills/massa-ai/scripts/validate_audit_report.ts <path> --family code-quality` (`references/audit-report-io.md`, Deterministic Validation); non-zero exit blocks editing. Also confirm resolved files or material scope evidence and current file/line evidence; stop on stale, target-drifted, or ambiguous reports.
|
|
28
36
|
5. Extract actionable findings:
|
|
29
37
|
- Keep findings with concrete `Rule`, `Current Shape`, `Simplest Safe Transformation`, `Location`, `Evidence`, `Impact`, `Simplest Fix Direction`, and `Verification Suggestion`.
|
|
30
38
|
- Ignore ruled-out candidates, no-finding sections, and `suspect` items unless the user explicitly asks to address suspects.
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: commit
|
|
3
|
+
description: "Use this workflow to draft a commit message, prepare, or commit current repository changes; not for Jira tickets, release notes, changelogs, or history rewriting."
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
version: "1.1.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
1
9
|
### Commit
|
|
2
10
|
|
|
3
|
-
Use
|
|
11
|
+
Use when the user wants to draft a commit message, prepare a commit, or commit current repository changes. Adapts the local caveman-commit rules into a safe Git workflow for changed files.
|
|
4
12
|
|
|
5
|
-
|
|
13
|
+
Load `references/project-context.md` (intake sweep) before the first substantive read.
|
|
6
14
|
|
|
7
|
-
|
|
15
|
+
Not for Jira ticket creation, release notes, changelogs, PR descriptions, or history rewriting. Route Jira issue work to `workflows/ticket.md`. Route broad release documentation to the relevant feature, RFC, or general workflow.
|
|
8
16
|
|
|
9
17
|
## Workflow
|
|
10
18
|
|
|
@@ -16,8 +24,8 @@ Do not use this workflow for Jira ticket creation, release notes, changelogs, PR
|
|
|
16
24
|
- unstaged changed paths from `git diff --name-only`
|
|
17
25
|
- status summary from `git status --short`
|
|
18
26
|
- staged diff when anything is staged; otherwise the unstaged diff for allowed paths
|
|
19
|
-
4. Extract the first Jira key from the branch with case-insensitive regex `(?<![A-Z0-9])([A-Z][A-Z0-9]{1,9}-[0-9]+)(?![A-Z0-9])`. Normalize
|
|
20
|
-
- **Phased work — one commit per task, prefixed with the task's sub-task key.** When committing phased work sourced from `workflows/ticket.md`, each Task inside a Phase/Wave is exactly **one atomic commit** (never batched; the one-commit-per-task cadence is owned by the Implementation Delivery Protocol, Stage 2).
|
|
27
|
+
4. Extract the first Jira key from the branch with case-insensitive regex `(?<![A-Z0-9])([A-Z][A-Z0-9]{1,9}-[0-9]+)(?![A-Z0-9])`. Normalize to uppercase. If no key is found, proceed without a prefix and do not ask. An explicit task key (from `workflows/ticket.md` for phased work, or from the user) takes precedence over the branch-derived key.
|
|
28
|
+
- **Phased work — one commit per task, prefixed with the task's sub-task key.** When committing phased work sourced from `workflows/ticket.md`, each Task inside a Phase/Wave is exactly **one atomic commit** (never batched; the one-commit-per-task cadence is owned by the Implementation Delivery Protocol, Stage 2). Prefix that commit's subject with the Task's Jira **sub-task** key as `[XXX-YYYY]`, e.g. `[SA-142] feat(auth): reject expired tokens` — same `[<KEY>] ` rule below, sub-task key replacing the generic branch key.
|
|
21
29
|
5. Resolve commit scope:
|
|
22
30
|
- If files are already staged, treat staged files as the user-selected commit scope and do not stage additional files.
|
|
23
31
|
- If nothing is staged and the user explicitly asked to commit, stage only allowed changed files one path at a time with pathspec-safe commands.
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debug
|
|
3
|
+
description: "Use this workflow for evidence-backed root-cause diagnosis of broken behavior, failures, regressions, or crashes; route new capabilities to feature and broad redesign to spec-driven."
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
version: "1.1.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
1
9
|
### 🔴 Debug
|
|
2
10
|
|
|
3
|
-
Use
|
|
11
|
+
Use when the user reports broken behavior, failures, regressions, crashes, unexpected output, flaky behavior, or any issue needing evidence-backed root-cause diagnosis before a fix. Not for new capabilities — route to `workflows/feature.md`. Not for broad redesign or unclear cross-boundary changes — route to `workflows/spec-driven.md`.
|
|
4
12
|
|
|
5
|
-
|
|
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`
|
|
15
|
+
Before the first repository mutation, load `references/implementation-delivery.md` (delivery chain: worktree, atomic commits, PR, CI watch, merge gate) and `references/code-annotation.md` (doc blocks, rationale, test coverage). After two consecutive failed fixes on one symptom, stop editing and load `references/root-cause-scripts.md`.
|
|
8
16
|
|
|
9
17
|
1. Generate/reuse `workflowSessionId`: `debug-[entity]`
|
|
10
18
|
2. Load shared references:
|