@massa-ai/cursor-plugin 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor-plugin/plugin.json +5 -0
- package/README.md +87 -0
- package/agents/massa-ai-architecture-specialist.md +65 -0
- package/agents/massa-ai-audit-specialist.md +81 -0
- package/agents/massa-ai-builder.md +67 -0
- package/agents/massa-ai-context-curator.md +67 -0
- package/agents/massa-ai-documentation-agent.md +65 -0
- package/agents/massa-ai-furps-analyst.md +71 -0
- package/agents/massa-ai-investigator.md +68 -0
- package/agents/massa-ai-mobile-specialist.md +82 -0
- package/agents/massa-ai-navigator.md +75 -0
- package/agents/massa-ai-plan-critic.md +90 -0
- package/agents/massa-ai-planner.md +65 -0
- package/agents/massa-ai-requirements-analyst.md +64 -0
- package/agents/massa-ai-reviewer.md +66 -0
- package/agents/massa-ai-test-engineer.md +66 -0
- package/agents/massa-ai-verification-agent.md +65 -0
- package/hooks/hooks.json +26 -0
- package/hooks/massa-ai-hook +298 -0
- package/install.sh +413 -0
- package/package.json +30 -0
- package/skills/agents/architecture-specialist/SKILL.md +69 -0
- package/skills/agents/audit-specialist/SKILL.md +85 -0
- package/skills/agents/builder/SKILL.md +71 -0
- package/skills/agents/context-curator/SKILL.md +71 -0
- package/skills/agents/documentation-agent/SKILL.md +69 -0
- package/skills/agents/furps-analyst/SKILL.md +74 -0
- package/skills/agents/investigator/SKILL.md +72 -0
- package/skills/agents/mobile-specialist/SKILL.md +86 -0
- package/skills/agents/navigator/SKILL.md +79 -0
- package/skills/agents/plan-critic/SKILL.md +93 -0
- package/skills/agents/planner/SKILL.md +69 -0
- package/skills/agents/requirements-analyst/SKILL.md +68 -0
- package/skills/agents/reviewer/SKILL.md +70 -0
- package/skills/agents/test-engineer/SKILL.md +70 -0
- package/skills/agents/verification-agent/SKILL.md +69 -0
- package/skills/def/SKILL.md +17 -0
- package/skills/find/SKILL.md +19 -0
- package/skills/graph/SKILL.md +16 -0
- package/skills/index/SKILL.md +19 -0
- package/skills/map/SKILL.md +24 -0
- package/skills/massa-ai/SKILL.md +315 -0
- package/skills/massa-ai/personas/README.md +35 -0
- package/skills/massa-ai/personas/ai-native-nodejs-cli-architect.md +76 -0
- package/skills/massa-ai/personas/catalog.json +157 -0
- package/skills/massa-ai/personas/context-skill-harness-engineer-architect.md +74 -0
- package/skills/massa-ai/personas/product-manager.md +67 -0
- package/skills/massa-ai/personas/senior-mobile-engineer.md +74 -0
- package/skills/massa-ai/personas/senior-mobile-qa-automation-engineer.md +75 -0
- package/skills/massa-ai/references/adr-authoring.md +189 -0
- package/skills/massa-ai/references/agent-orchestration.md +221 -0
- package/skills/massa-ai/references/architecture-coupling-lens.md +239 -0
- package/skills/massa-ai/references/architecture-deepening-lens.md +136 -0
- package/skills/massa-ai/references/architecture-domain-lens.md +186 -0
- package/skills/massa-ai/references/architecture-lenses.md +108 -0
- package/skills/massa-ai/references/audit-report-io.md +459 -0
- package/skills/massa-ai/references/audit-scope.md +103 -0
- package/skills/massa-ai/references/code-annotation.md +111 -0
- package/skills/massa-ai/references/codebase-investigation.md +96 -0
- package/skills/massa-ai/references/context-firewall.md +62 -0
- package/skills/massa-ai/references/conversation-feedback.md +104 -0
- package/skills/massa-ai/references/debug-diagnosis-loop.md +140 -0
- package/skills/massa-ai/references/decision-engine.md +73 -0
- package/skills/massa-ai/references/evidence-gate.md +53 -0
- package/skills/massa-ai/references/furps/analyst-role.md +49 -0
- package/skills/massa-ai/references/furps/checklist.md +92 -0
- package/skills/massa-ai/references/furps/intake.md +104 -0
- package/skills/massa-ai/references/furps/report-contract.md +140 -0
- package/skills/massa-ai/references/hook-enforcement.md +137 -0
- package/skills/massa-ai/references/implementation-delivery.md +101 -0
- package/skills/massa-ai/references/installation.md +110 -0
- package/skills/massa-ai/references/lessons.md +119 -0
- package/skills/massa-ai/references/maestro/artifacts-reports.md +69 -0
- package/skills/massa-ai/references/maestro/cli-device.md +65 -0
- package/skills/massa-ai/references/maestro/cloud.md +67 -0
- package/skills/massa-ai/references/maestro/config-env-output.md +76 -0
- package/skills/massa-ai/references/maestro/fact-ledger.md +71 -0
- package/skills/massa-ai/references/maestro/js-scripting.md +70 -0
- package/skills/massa-ai/references/maestro/mcp.md +59 -0
- package/skills/massa-ai/references/maestro/patterns.md +96 -0
- package/skills/massa-ai/references/maestro/selectors.md +91 -0
- package/skills/massa-ai/references/maestro/workspace-execution.md +81 -0
- package/skills/massa-ai/references/maestro/yaml-commands.md +203 -0
- package/skills/massa-ai/references/maestro.md +47 -0
- package/skills/massa-ai/references/mcp-tools.md +296 -0
- package/skills/massa-ai/references/memory-policy.md +103 -0
- package/skills/massa-ai/references/mobile-context.md +113 -0
- package/skills/massa-ai/references/mobile-diagnosis.md +106 -0
- package/skills/massa-ai/references/mobile-figma-matcher/ATTRIBUTION.md +5 -0
- package/skills/massa-ai/references/mobile-figma-matcher/android-compose.md +13 -0
- package/skills/massa-ai/references/mobile-figma-matcher/android-views.md +13 -0
- package/skills/massa-ai/references/mobile-figma-matcher/core.md +117 -0
- package/skills/massa-ai/references/mobile-figma-matcher/ios-swiftui.md +12 -0
- package/skills/massa-ai/references/mobile-figma-matcher/ios-uikit.md +12 -0
- package/skills/massa-ai/references/mobile-figma-matcher/kmp-compose-multiplatform.md +14 -0
- package/skills/massa-ai/references/mobile-figma-matcher/repository-detection.md +77 -0
- package/skills/massa-ai/references/naming-standards.md +47 -0
- package/skills/massa-ai/references/pr-task-fix.md +80 -0
- package/skills/massa-ai/references/project-context.md +76 -0
- package/skills/massa-ai/references/rfc/ATTRIBUTION.md +5 -0
- package/skills/massa-ai/references/rfc/discovery-and-sizing.md +120 -0
- package/skills/massa-ai/references/rfc/document-contract.md +85 -0
- package/skills/massa-ai/references/rfc/quality-and-lifecycle.md +101 -0
- package/skills/massa-ai/references/root-cause-scripts.md +97 -0
- package/skills/massa-ai/references/spec-driven/artifact-store.md +98 -0
- package/skills/massa-ai/references/spec-driven/code-analysis.md +119 -0
- package/skills/massa-ai/references/spec-driven/coding-principles.md +80 -0
- package/skills/massa-ai/references/spec-driven/context-limits.md +64 -0
- package/skills/massa-ai/references/spec-driven/design.md +257 -0
- package/skills/massa-ai/references/spec-driven/discuss.md +182 -0
- package/skills/massa-ai/references/spec-driven/execute.md +471 -0
- package/skills/massa-ai/references/spec-driven/lessons.md +5 -0
- package/skills/massa-ai/references/spec-driven/memory.md +214 -0
- package/skills/massa-ai/references/spec-driven/specify.md +283 -0
- package/skills/massa-ai/references/spec-driven/sub-agents.md +151 -0
- package/skills/massa-ai/references/spec-driven/tasks.md +494 -0
- package/skills/massa-ai/references/spec-driven/validate.md +397 -0
- package/skills/massa-ai/references/subagent-design.md +132 -0
- package/skills/massa-ai/references/synapse-policy.md +160 -0
- package/skills/massa-ai/references/tdd/calibrated-examples.md +54 -0
- package/skills/massa-ai/references/tdd/discovery-and-sizing.md +83 -0
- package/skills/massa-ai/references/tdd/document-contract.md +136 -0
- package/skills/massa-ai/references/tdd/quality-and-lifecycle.md +83 -0
- package/skills/massa-ai/references/the-fool/cognitive-bias-inventory.md +103 -0
- package/skills/massa-ai/references/the-fool/dialectic-synthesis.md +170 -0
- package/skills/massa-ai/references/the-fool/evidence-audit.md +202 -0
- package/skills/massa-ai/references/the-fool/mode-selection-guide.md +113 -0
- package/skills/massa-ai/references/the-fool/pre-mortem-analysis.md +200 -0
- package/skills/massa-ai/references/the-fool/red-team-adversarial.md +206 -0
- package/skills/massa-ai/references/the-fool/socratic-questioning.md +153 -0
- package/skills/massa-ai/references/ticket/atlassian-fix.md +130 -0
- package/skills/massa-ai/references/ticket/intake-and-sources.md +65 -0
- package/skills/massa-ai/references/ticket/templates-and-quality.md +129 -0
- package/skills/massa-ai/references/verification-ladder.md +62 -0
- package/skills/massa-ai/scripts/lessons.py +590 -0
- package/skills/massa-ai/workflows/adr.md +33 -0
- package/skills/massa-ai/workflows/architecture/architecture-audit.md +125 -0
- package/skills/massa-ai/workflows/architecture/architecture-fix.md +110 -0
- package/skills/massa-ai/workflows/bugs/bugs-audit.md +113 -0
- package/skills/massa-ai/workflows/bugs/bugs-fix.md +97 -0
- package/skills/massa-ai/workflows/code-quality/code-quality-audit.md +154 -0
- package/skills/massa-ai/workflows/code-quality/code-quality-fix.md +99 -0
- package/skills/massa-ai/workflows/commit.md +61 -0
- package/skills/massa-ai/workflows/debug.md +86 -0
- package/skills/massa-ai/workflows/design.md +54 -0
- package/skills/massa-ai/workflows/exploration.md +119 -0
- package/skills/massa-ai/workflows/feature.md +52 -0
- package/skills/massa-ai/workflows/general.md +46 -0
- package/skills/massa-ai/workflows/implementation/implementation-audit.md +87 -0
- package/skills/massa-ai/workflows/implementation/implementation-fix.md +90 -0
- package/skills/massa-ai/workflows/long-session.md +44 -0
- package/skills/massa-ai/workflows/maestro/maestro-audit.md +56 -0
- package/skills/massa-ai/workflows/maestro/maestro-fix.md +74 -0
- package/skills/massa-ai/workflows/maestro/maestro.md +68 -0
- package/skills/massa-ai/workflows/mobile-figma/mobile-figma-audit.md +68 -0
- package/skills/massa-ai/workflows/mobile-figma/mobile-figma-fix.md +74 -0
- package/skills/massa-ai/workflows/onboarding.md +23 -0
- package/skills/massa-ai/workflows/refactor.md +47 -0
- package/skills/massa-ai/workflows/refinement/furps-refinement.md +81 -0
- package/skills/massa-ai/workflows/requirements/requirements-audit.md +114 -0
- package/skills/massa-ai/workflows/requirements/requirements-fix.md +93 -0
- package/skills/massa-ai/workflows/rfc.md +55 -0
- package/skills/massa-ai/workflows/security/security-audit.md +113 -0
- package/skills/massa-ai/workflows/security/security-fix.md +97 -0
- package/skills/massa-ai/workflows/spec-driven.md +217 -0
- package/skills/massa-ai/workflows/tdd.md +71 -0
- package/skills/massa-ai/workflows/tests/tests-audit.md +114 -0
- package/skills/massa-ai/workflows/tests/tests-fix.md +96 -0
- package/skills/massa-ai/workflows/the-fool.md +82 -0
- package/skills/massa-ai/workflows/ticket.md +42 -0
- package/skills/persona-router/SKILL.md +158 -0
- package/skills/status/SKILL.md +15 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
### Code Quality Audit
|
|
2
|
+
|
|
3
|
+
Use this workflow for findings-only audit of SOLID, Clean Code, KISS, YAGNI, DRY, maintainability, overengineering, code smell, or violations-check issues in a concrete target: modified files, explicit files/globs, commit ranges, branch comparisons, modules/packages, symbols/classes/functions, feature/runtime flows, explicitly requested whole-repo scope, or an implementation scope packet supplied by `workflows/implementation/implementation-audit.md`.
|
|
4
|
+
|
|
5
|
+
Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
|
|
6
|
+
|
|
7
|
+
Do not use this workflow 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
|
+
|
|
9
|
+
This workflow is findings-only. Do not edit code unless the user separately asks for fixes.
|
|
10
|
+
|
|
11
|
+
1. Resolve/reuse `workflowSessionId`: `quality-[entity]`
|
|
12
|
+
2. Load shared references:
|
|
13
|
+
- `references/codebase-investigation.md`
|
|
14
|
+
- `references/audit-scope.md`
|
|
15
|
+
- `references/audit-report-io.md` before writing the final direct audit report
|
|
16
|
+
- `references/context-firewall.md` before inspecting large diffs, logs, snapshots, generated reports, or broad search output
|
|
17
|
+
- `references/mobile-context.md` when scope includes Android Jetpack Compose or KMP Compose Multiplatform files, source sets, compiler reports, UI tests, screenshot tests, or runtime evidence
|
|
18
|
+
- `references/naming-standards.md` when evaluating generic names, domain vocabulary, public contract names, or rename recommendations
|
|
19
|
+
- `references/synapse-policy.md` when repeated massa-ai searches are expected
|
|
20
|
+
- `references/agent-orchestration.md` only for large scopes, explicit parallel/subagent requests, PR subagent invocation, or independent verification of high-impact findings
|
|
21
|
+
3. `recall` -> load project style rules, ADRs, prior quality decisions, accepted extension points, repeated anti-patterns, and accepted exceptions for the target area.
|
|
22
|
+
- Apply the Memory Freshness Gate from `references/audit-scope.md`; recalled exceptions are leads, not proof.
|
|
23
|
+
4. Establish the investigation scope before proceeding:
|
|
24
|
+
- Modified files scope: use when the user says modified files, changed files, current changes, uncommitted changes, staged changes, or unstaged changes.
|
|
25
|
+
- Explicit files/globs scope: use when the user names files, directories, or globs.
|
|
26
|
+
- Commit range scope: use when the user provides commits/ranges or asks for commits made by me, my branch commits, or quality issues introduced by branch commits.
|
|
27
|
+
- Branch comparison scope: use when the user names base/head branches, refs, or a branch diff.
|
|
28
|
+
- Codebase area scope: use when the user names a path, module, package, feature area, service layer, or glob.
|
|
29
|
+
- Symbol/class/function scope: use when the user names public classes, functions, interfaces, helpers, or exported surfaces.
|
|
30
|
+
- Feature/flow scope: use when the user names a runtime flow or feature area.
|
|
31
|
+
- Whole-repo scope: use only when the user explicitly asks for a whole-repo code quality audit.
|
|
32
|
+
- Implementation parent scope: use only when `workflows/implementation/implementation-audit.md` invokes this workflow with a concrete implementation scope packet.
|
|
33
|
+
- 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
|
+
- Build the shared scope packet from `references/audit-scope.md` and carry it into the report.
|
|
35
|
+
5. For modified files scope:
|
|
36
|
+
- Include staged and unstaged tracked files from the working tree.
|
|
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:
|
|
61
|
+
- SOLID inputs: non-test source files only.
|
|
62
|
+
- Clean Code inputs: test and non-test source files.
|
|
63
|
+
- KISS/YAGNI/DRY inputs: test and non-test source files, plus docs/config only when they define behavior or public contracts.
|
|
64
|
+
- Architecture boundary guard:
|
|
65
|
+
- 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
|
+
- 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
|
+
- 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
|
+
11. Decide whether to use agent orchestration:
|
|
69
|
+
- Load it only for large PRs, codebase-wide audits, explicit parallel/subagent requests, or independent verification of judgment-heavy findings.
|
|
70
|
+
- Keep the audit local for small scopes, unresolved user intent, tightly coupled code without clear owners, or platforms that do not permit subagents.
|
|
71
|
+
- The main agent still owns scope, memory recall, static leads, synthesis, final report, persistence, and Evidence Gate.
|
|
72
|
+
- If delegating, dispatch `audit-specialist` with `lens: code-quality` per `references/agent-orchestration.md`:
|
|
73
|
+
|
|
74
|
+
> **Dispatch: `massa-ai-audit-specialist`** (role: `audit-specialist`) β charter `skills/agents/audit-specialist/SKILL.md`
|
|
75
|
+
> - trigger: large PR, codebase-wide audit, explicit parallel/subagent request, or independent verification of judgment-heavy finding
|
|
76
|
+
> - scope: bounded read-only slice of the audit target
|
|
77
|
+
> - permissions: read-only
|
|
78
|
+
> - inputs: shared scope packet; `lens: code-quality`; quality dimensions (SOLID, Clean Code, KISS/YAGNI, DRY, maintainability)
|
|
79
|
+
> - sensors: static scans for type-tag branches, concrete construction, half-finished surfaces; source inspection
|
|
80
|
+
> - output: findings with smell category, location, evidence, severity, confidence, and simplest fix direction
|
|
81
|
+
> - firewall: raw diffs/logs/search output summarized, not returned raw
|
|
82
|
+
> - memory: suggest-only; main agent persists reusable code-quality patterns
|
|
83
|
+
|
|
84
|
+
- Do not delegate every check by default; avoid duplicate source reading when one main-agent pass is cheaper.
|
|
85
|
+
- Subagents may suggest memory content, but the main agent decides what durable knowledge to persist.
|
|
86
|
+
12. Gather deterministic leads with static scans where useful:
|
|
87
|
+
- Type-tag branches: `switch`, `case`, `if/else if`, discriminant fields such as `type`, `kind`, `variant`, `mode`.
|
|
88
|
+
- Concrete construction: `new [A-Z]` inside class or service bodies.
|
|
89
|
+
- Half-finished surfaces: `TODO`, `implement later`, exported stubs, `return null`, empty method bodies.
|
|
90
|
+
- Comments: lines starting with code-restating comments.
|
|
91
|
+
- Magic values: repeated strings, event names, timeouts, numeric thresholds, status codes.
|
|
92
|
+
- Generic names: `data`, `info`, `result`, `value`, `temp`, `manager`, `handler`, `helper` without useful qualification, using `references/naming-standards.md` to filter conventional short-scope or framework-required names.
|
|
93
|
+
- Long parameter lists: more than 3-4 positional parameters.
|
|
94
|
+
- Needlessly indirect code: pass-through wrappers, one-use abstractions, helper layers with no behavior, factories/builders that only hide one constructor call.
|
|
95
|
+
- Speculative surfaces: unused options, future-oriented hooks, extension points with one implementation, exported APIs with no evidence of use.
|
|
96
|
+
- Complexity without payoff: deep nesting, miniature state machines, or polymorphism where a direct branch or data map would preserve clarity.
|
|
97
|
+
- 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.
|
|
98
|
+
- 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.
|
|
99
|
+
13. Investigation pass:
|
|
100
|
+
- Use summary/enriched search, symbol tools, and targeted file reads to inspect target modules, semantic hotspots, public classes, interfaces, functions, and exported API surface.
|
|
101
|
+
- Apply SOLID checks to non-test source only:
|
|
102
|
+
- Single Responsibility: flag classes/modules with distinct concern groups, such as validation plus persistence or formatting plus dispatch.
|
|
103
|
+
- Open/Closed: flag caller-side switches or if/else chains on type tags where adding a variant requires modifying existing files.
|
|
104
|
+
- Liskov: flag subtypes that throw where the base does not, ignore required methods, or narrow the base contract.
|
|
105
|
+
- Interface Segregation: flag interfaces that force implementors to define unused methods.
|
|
106
|
+
- Dependency Inversion: flag hardcoded `new ConcreteType()` inside class bodies where abstraction or injection would be natural.
|
|
107
|
+
- Apply Clean Code checks to test and non-test source:
|
|
108
|
+
- Magic values: meaningful bare literals should be named constants, especially repeated strings, timeouts, thresholds, and event names.
|
|
109
|
+
- Function does more than one thing: if accurate description needs "and", recommend splitting.
|
|
110
|
+
- Unqualified generic names: flag vague names without domain or role qualification.
|
|
111
|
+
- What-comments: flag comments that restate code; keep only why comments for constraints, workarounds, or non-obvious invariants.
|
|
112
|
+
- Half-finished surfaces: flag exported TODOs, stubs, placeholder returns, and "implement later" code.
|
|
113
|
+
- Long parameter lists: flag more than 3-4 positional parameters; suggest an options object.
|
|
114
|
+
- Apply KISS/YAGNI/DRY checks:
|
|
115
|
+
- KISS: flag abstractions, layers, indirection, or control flow that increase 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 that a new reader can follow end-to-end. Simplify by inlining trivial abstractions, collapsing unnecessary layers, and choosing boring solutions unless complexity is justified (e.g., real variability, hard constraints, or measured bottlenecks).
|
|
116
|
+
- YAGNI: flag speculative features, extension points, and generic infrastructure that have 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, with code structured so it can evolve when real requirements appear. Defer generalization until duplication or constraints make it necessary, and remove dead or unused paths aggressively.
|
|
117
|
+
- DRY: flag duplicated logic, data transformations, or domain rules that appear in multiple places without a strong reason (e.g., performance isolation or explicit decoupling). Highlight copy-paste patterns, parallel conditionals, and repeated constants that increase maintenance cost or risk of inconsistency. Recommend consolidation into a single source of truth when it improves clarity and reduces bugs, but avoid over-abstraction that harms readability or introduces indirection for trivial reuse.
|
|
118
|
+
- Prefer delete, inline, or merge recommendations over replacement abstractions when simpler code preserves behavior.
|
|
119
|
+
- Require usage evidence before calling a surface unnecessary; if evidence is incomplete, mark the item `suspect`.
|
|
120
|
+
- Do not recommend ports, adapters, bounded contexts, new service/module boundaries, or VSA migration from this workflow; hand those to architecture-audit.
|
|
121
|
+
- For Android Jetpack Compose and KMP Compose Multiplatform code, apply recomposition quality checks from `references/mobile-context.md`:
|
|
122
|
+
- Excessive recomposition risk: unstable parameters, mutable collections or mutable models crossing composable boundaries, expensive work in composition, unremembered lambdas/objects, inappropriate `derivedStateOf`, broad state reads, and backwards writes after state reads.
|
|
123
|
+
- Missing recomposition or stale UI risk: non-observable mutation, missing or wrong `remember`/effect keys, stale captured lambdas that need `rememberUpdatedState`, incorrect stability annotations, and risky stability configuration entries that can make UX updates fail to happen.
|
|
124
|
+
- Keep these as `CQ-*` findings only when concrete source evidence ties the pattern to UX jank, stale UI, broken interaction feedback, accessibility/state restoration risk, or maintainability cost.
|
|
125
|
+
- 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.
|
|
126
|
+
- 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.
|
|
127
|
+
- For each candidate finding, record the concrete claim, source evidence, impacted maintainability or change-risk flow, provisional severity, and what would disprove it.
|
|
128
|
+
14. False-positive pass:
|
|
129
|
+
- Try to disprove every candidate before reporting it.
|
|
130
|
+
- 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.
|
|
131
|
+
- Drop candidates disproven by evidence, downgrade candidates with partial mitigation, and mark judgment-heavy items as `suspect`.
|
|
132
|
+
15. Severity rules (apply the countable threshold first, then the qualitative clause):
|
|
133
|
+
- `critical`: quality issue likely causes production outage, data loss, auth/privacy break, OR affects >10 files; otherwise use the qualitative clause below.
|
|
134
|
+
- `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.
|
|
135
|
+
- `medium`: real maintainability issue, speculative surface, duplicated rule, weak naming/comment pattern, or avoidable complexity with localized impact (<=10 affected files).
|
|
136
|
+
- `low`: minor hardening opportunity, low-impact cleanup, incomplete evidence, or weakly supported concern.
|
|
137
|
+
16. Final report:
|
|
138
|
+
- Findings first, ordered by severity.
|
|
139
|
+
- 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.
|
|
140
|
+
- 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.
|
|
141
|
+
- Mark judgment-heavy items as `suspect` instead of fact.
|
|
142
|
+
- Avoid false positives for framework-required signatures, public SDK or plugin surfaces, ADR-backed extension points, test fixtures/builders, harmless local literals, and intentionally tiny adapters.
|
|
143
|
+
- If a candidate turns on domain language, coupling dimensions, or seam placement, do not force it into `CQ-<N>`; list it as skipped architecture scope or recommend `architecture-audit`.
|
|
144
|
+
- If no findings, say what scope was checked and which checks were skipped.
|
|
145
|
+
- Include ruled-out candidates when they were plausible enough to matter.
|
|
146
|
+
- Include scope checked, deterministic evidence or skipped-check notes, memory outcome, and residual risk.
|
|
147
|
+
- 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.
|
|
148
|
+
- 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`.
|
|
149
|
+
- For implementation audit child invocation, return compact findings to the parent unless the parent explicitly requests saved audit artifacts.
|
|
150
|
+
17. Persist only durable knowledge:
|
|
151
|
+
- Do not persist one-off findings.
|
|
152
|
+
- Persist repeated anti-patterns, project-specific quality rules, accepted exceptions, or repeated overengineering patterns via `remember` after scoring with the Importance Calibration System.
|
|
153
|
+
- Use required tags: `project:<projectId>`, `session:<workflowSessionId>`, `workflow:code-quality-audit`, `entity:<entity>`, and one `memory:<tier>` tag.
|
|
154
|
+
18. Complete the Evidence Gate from `references/evidence-gate.md`.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
### Code Quality Fix
|
|
2
|
+
|
|
3
|
+
Use this workflow only to execute fixes from a code quality audit markdown report.
|
|
4
|
+
|
|
5
|
+
Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
|
|
6
|
+
|
|
7
|
+
Before the first repository mutation, load `references/implementation-delivery.md` for worktree isolation, atomic commits, PR creation, CI watch, and the merge gate, and `references/code-annotation.md` for doc blocks, rationale comments, and test coverage on every created or updated unit. If two consecutive fix attempts fail on the same symptom, stop editing and load `references/root-cause-scripts.md`.
|
|
8
|
+
|
|
9
|
+
Do not use this workflow for findings-only SOLID, Clean Code, KISS, YAGNI, DRY, maintainability, or overengineering analysis; route that to `workflows/code-quality/code-quality-audit.md`.
|
|
10
|
+
|
|
11
|
+
1. Resolve/reuse `workflowSessionId`: `code-quality-fix-[entity]`
|
|
12
|
+
2. Load shared references:
|
|
13
|
+
- `references/audit-report-io.md` before any code change
|
|
14
|
+
- `references/lessons.md` to load confirmed project lessons
|
|
15
|
+
- `references/codebase-investigation.md` before changing unfamiliar code
|
|
16
|
+
- `references/verification-ladder.md` before non-trivial edits
|
|
17
|
+
- `references/naming-standards.md` before renaming identifiers, introducing domain vocabulary, or changing public contract names
|
|
18
|
+
- `references/context-firewall.md` before inspecting large diffs, logs, generated reports, or broad search output
|
|
19
|
+
- `references/agent-orchestration.md` only for large/high-risk findings, disjoint implementation slices, or independent verification
|
|
20
|
+
3. `recall` -> load project style rules, accepted quality exceptions, testing conventions, prior anti-patterns, and verification recipes for the report target.
|
|
21
|
+
4. Select the code quality audit report with execution focus:
|
|
22
|
+
- Establish the report selector, target focus, and optional finding selector before selecting a report. Target focus can be a module, service layer, files/globs, branch comparison, commit range, symbol/class/function, feature/flow, or explicit whole-repo target.
|
|
23
|
+
- If the user gives a path, read that exact markdown file.
|
|
24
|
+
- 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
|
+
- 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
|
+
- Stop if no report exists; do not infer findings from conversation history.
|
|
27
|
+
- Validate the report with `references/audit-report-io.md`: workflow, `ProjectId`, `Target`, `Target Focus`, scope, git base/head, required fields, `CQ-` IDs, resolved files or material scope evidence, and current file/line evidence. Stop on invalid, stale, target-drifted, or ambiguous reports before editing.
|
|
28
|
+
5. Extract actionable findings:
|
|
29
|
+
- Keep findings with concrete `Rule`, `Current Shape`, `Simplest Safe Transformation`, `Location`, `Evidence`, `Impact`, `Simplest Fix Direction`, and `Verification Suggestion`.
|
|
30
|
+
- Ignore ruled-out candidates, no-finding sections, and `suspect` items unless the user explicitly asks to address suspects.
|
|
31
|
+
- Treat findings that require bounded-context language, dependency direction, strength/distance/volatility, seam placement, adapter design, or module-depth analysis as invalid for code-quality execution unless the report already reclassified them as local CQ cleanup. Route those to `workflows/architecture/architecture-fix.md` or ask the user to rerun architecture-audit.
|
|
32
|
+
- If the user supplied finding IDs, extract only those IDs after validating they exist and match the current target focus.
|
|
33
|
+
- Rank by severity, dependency order, behavior risk, and deletion/simplification payoff.
|
|
34
|
+
6. Build a refactoring map before editing:
|
|
35
|
+
- Finding ID -> affected code, quality rule, current behavior contract, validation assets, simplest safe transformation, and expected diff shape.
|
|
36
|
+
- Group duplicate-rule findings only when one small change fixes all of them.
|
|
37
|
+
- Keep unrelated style cleanup out of scope.
|
|
38
|
+
7. Size each finding with `references/verification-ladder.md`:
|
|
39
|
+
- Quick: rename, inline, delete unused speculation, extract constant, collapse trivial wrapper, or local parameter-object change.
|
|
40
|
+
- Standard: multi-file consolidation, shared behavior cleanup, public helper contract change, or meaningful test impact; define characterization checks first.
|
|
41
|
+
- Spec-driven: broad redesign, unclear behavior, cross-boundary migration, or user-visible behavior change; pause and route to `workflows/spec-driven.md` or ask for approval.
|
|
42
|
+
8. Apply code quality fixing methods:
|
|
43
|
+
- SOLID: separate mixed responsibilities only when the split reduces change risk; replace caller-side type switches with polymorphism or data maps only when new variants are real; preserve base contracts; narrow fat interfaces; inject dependencies when hardcoded concretes block testing or substitution.
|
|
44
|
+
- Clean Code: name domain concepts precisely using `references/naming-standards.md`, replace repeated magic values with named constants, split functions that truly do multiple things, remove code-restating comments, finish or delete stubs, and convert long positional parameter lists to options objects when it improves call-site clarity.
|
|
45
|
+
- KISS: inline shallow helpers, collapse needless layers, choose direct control flow over clever indirection, and remove configuration that hides rather than expresses behavior.
|
|
46
|
+
- YAGNI: delete unused extension points, future hooks, unused options, one-implementation factories, and speculative public APIs when usage evidence is absent.
|
|
47
|
+
- DRY: consolidate duplicated domain rules or transformations into one clear source of truth, but avoid abstractions that make trivial duplication harder to read.
|
|
48
|
+
- AI-slop cleanup: remove generic wrappers, fabricated-looking abstractions, one-call factories, code-restating comments, and unused configurability when current usage evidence does not justify them.
|
|
49
|
+
- Do not introduce ports, adapters, bounded contexts, new service/module boundaries, or VSA-style folder migration to satisfy a code-quality finding.
|
|
50
|
+
9. Preserve behavior:
|
|
51
|
+
- Run or identify characterization tests before changing behavior-adjacent code.
|
|
52
|
+
- Do not weaken tests, fixtures, snapshots, types, or public contracts to make cleanup pass.
|
|
53
|
+
- Prefer small reversible edits; verify after each finding or coherent group.
|
|
54
|
+
10. Use agent orchestration only when it improves signal. Dispatch per `references/agent-orchestration.md`:
|
|
55
|
+
|
|
56
|
+
> **Dispatch: `massa-ai-builder`** (role: `builder`) β charter `skills/agents/builder/SKILL.md`
|
|
57
|
+
> - trigger: large/high-risk finding, disjoint implementation slice, or explicit subagent request
|
|
58
|
+
> - scope: one isolated code-quality finding or disjoint file group
|
|
59
|
+
> - permissions: write (disjoint write set)
|
|
60
|
+
> - inputs: the finding ID, smell category (SOLID/Clean Code/KISS/YAGNI/DRY), location, and simplest fix direction
|
|
61
|
+
> - sensors: report's verification suggestion or equivalent deterministic command; behavior-preservation check
|
|
62
|
+
> - output: implementation summary, commands run, test counts, deviations
|
|
63
|
+
> - firewall: raw diffs/logs summarized
|
|
64
|
+
> - memory: suggest-only; main agent persists reusable code-quality patterns
|
|
65
|
+
|
|
66
|
+
> **Dispatch: `massa-ai-verification-agent`** (role: `verification-agent`) β charter `skills/agents/verification-agent/SKILL.md`
|
|
67
|
+
> - trigger: independent verification of a high-risk code-quality fix
|
|
68
|
+
> - scope: the fixed finding's behavior preservation, imports, tests, and report claim closure
|
|
69
|
+
> - permissions: read-only
|
|
70
|
+
> - inputs: the finding, the applied fix, the verification suggestion, and validation assets
|
|
71
|
+
> - sensors: deterministic command (behavior-preservation check, import graph, tests) and report claim closure
|
|
72
|
+
> - output: confirmed/disproven closure verdict with evidence
|
|
73
|
+
> - firewall: raw test output/logs summarized
|
|
74
|
+
> - memory: suggest-only; main agent persists reusable verification recipes
|
|
75
|
+
- Main agent owns report parsing, prioritization, memory writes, final synthesis, and Evidence Gate.
|
|
76
|
+
11. Verify each completed finding:
|
|
77
|
+
- If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
|
|
78
|
+
`python3 skills/massa-ai/scripts/lessons.py --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
|
|
79
|
+
- Apply the Mandatory Verification Fix Gate from `references/verification-ladder.md`: run the report's Verification Suggestion or an equivalent deterministic command/artifact check for each selected finding or coherent group.
|
|
80
|
+
- A finding cannot be marked `fixed` when a target-relevant command or artifact check exists but was not attempted; if verification cannot run, mark it `blocked`, `deferred`, or `skipped` with an allowed skipped-check reason.
|
|
81
|
+
- Run the report's verification suggestion when available.
|
|
82
|
+
- Run targeted tests, type checks, lint/static checks, or import checks relevant to touched files.
|
|
83
|
+
- Perform a focused diff review for touched identifiers and confirm generic names are either replaced with precise domain/role names or justified by narrow conventional scope.
|
|
84
|
+
- Check validation assets were not weakened unless explicitly requested.
|
|
85
|
+
- Record command/artifact, result, skipped reason or `none`, highest Verification Ladder level reached, validation assets protected, and residual risk.
|
|
86
|
+
12. At completion, persist only durable knowledge:
|
|
87
|
+
- Repeated anti-patterns, accepted quality exceptions, project-specific refactoring recipes, or reusable checks after scoring with the Importance Calibration System.
|
|
88
|
+
- Use required tags: `project:<projectId>`, `session:<workflowSessionId>`, `workflow:code-quality-fix`, `entity:<entity>`, and one `memory:<tier>` tag.
|
|
89
|
+
13. Complete the Evidence Gate from `references/evidence-gate.md`.
|
|
90
|
+
|
|
91
|
+
## Examples
|
|
92
|
+
|
|
93
|
+
User asks: "Use code-quality-fix to fix latest findings for billing services."
|
|
94
|
+
|
|
95
|
+
1. Confirm target focus is `billing services`, then read the latest matching `audits/code-quality/* code-quality-audit.md`.
|
|
96
|
+
2. Validate metadata, target focus, freshness, required fields, and current evidence before editing.
|
|
97
|
+
3. Execute confirmed non-suspect findings by severity and behavior risk.
|
|
98
|
+
4. Prefer delete/inline/rename/extract before introducing new abstractions.
|
|
99
|
+
5. Verify behavior and validation assets after each finding group.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
### Commit
|
|
2
|
+
|
|
3
|
+
Use this workflow when the user wants to draft a commit message, prepare a commit, or commit current repository changes. This workflow adapts the local caveman-commit rules into a safe Git workflow for changed files.
|
|
4
|
+
|
|
5
|
+
Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
|
|
6
|
+
|
|
7
|
+
Do not use this workflow 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
|
+
|
|
9
|
+
## Workflow
|
|
10
|
+
|
|
11
|
+
1. Resolve or reuse `projectId` and `workflowSessionId=commit-<entity>`.
|
|
12
|
+
2. Run `recall` for durable project commit conventions, branch naming patterns, and attribution requirements. Treat recalled conventions as leads until current repository evidence confirms them.
|
|
13
|
+
3. Inspect current Git state before writing a message:
|
|
14
|
+
- current branch from `git rev-parse --abbrev-ref HEAD`
|
|
15
|
+
- staged paths from `git diff --cached --name-only`
|
|
16
|
+
- unstaged changed paths from `git diff --name-only`
|
|
17
|
+
- status summary from `git status --short`
|
|
18
|
+
- 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 the key to uppercase. If no key is found, proceed without a prefix and do not ask.
|
|
20
|
+
5. Resolve commit scope:
|
|
21
|
+
- If files are already staged, treat staged files as the user-selected commit scope and do not stage additional files.
|
|
22
|
+
- 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.
|
|
23
|
+
- If the user asked only for a message, do not stage or commit. Output the message in a code block plus any excluded paths.
|
|
24
|
+
6. Exclude audit report Markdown files from commit scope:
|
|
25
|
+
- any Markdown file under `audits/`
|
|
26
|
+
- any Markdown basename matching `*-audit.md`
|
|
27
|
+
- If any excluded file is already staged, stop before committing and report the exact paths. Do not unstage user-selected files unless the user explicitly asks.
|
|
28
|
+
7. Never stage everything through a shortcut, never commit all tracked modifications automatically, and never reset, checkout, amend, squash, rebase, or rewrite history unless the user separately requests that exact operation.
|
|
29
|
+
8. Draft the commit message using caveman-commit rules:
|
|
30
|
+
- Conventional Commits format: `<type>(<scope>): <imperative summary>`, with scope optional.
|
|
31
|
+
- Type precedence when multiple apply: `fix`, `feat`, `perf`, `refactor`, `test`, `docs`, `build`, `ci`, `style`, `chore`, `revert`. Use `revert` only when the commit's primary purpose is reverting an earlier change.
|
|
32
|
+
- Subject is imperative, has no trailing period, targets 50 characters when practical, and has hard cap 72 characters including any Jira prefix.
|
|
33
|
+
- With a Jira key, prefix the subject exactly as `[<KEY>] `, for example `[SA-142] fix(auth): reject expired tokens`.
|
|
34
|
+
- Match existing project capitalization after the colon when current history or nearby commits make it clear.
|
|
35
|
+
- Body is required for breaking changes, migrations, security fixes, reverts, linked issues, or rationale not inferable from the diff. Wrap body lines at 72 characters.
|
|
36
|
+
- Do not include AI attribution unless the repository explicitly requires an attribution trailer.
|
|
37
|
+
9. If committing, run the commit with the exact drafted message only after the final staged-path audit report exclusion check passes. If the commit fails, report the exact failure and leave staging untouched.
|
|
38
|
+
10. Complete `references/evidence-gate.md`, including branch key detection result, staged path policy, excluded audit Markdown paths, command outcome, skipped checks, memory outcome, and residual risk.
|
|
39
|
+
|
|
40
|
+
## Failure Handling
|
|
41
|
+
|
|
42
|
+
- No changes: stop and report that there is nothing to commit.
|
|
43
|
+
- Only excluded audit Markdown changed: stop and report excluded paths; do not create an empty commit.
|
|
44
|
+
- Detached HEAD or unreadable branch: proceed without Jira prefix and report the branch state.
|
|
45
|
+
- Ambiguous commit type: use the type precedence list; ask only if two candidate types would materially change downstream release behavior.
|
|
46
|
+
- Excluded file already staged: stop before committing and report the exact staged audit Markdown paths.
|
|
47
|
+
- Commit command fails: report the failure, do not retry unchanged more than once, and do not alter staging to force success.
|
|
48
|
+
|
|
49
|
+
## Examples
|
|
50
|
+
|
|
51
|
+
User asks: "Use the commit workflow and commit this."
|
|
52
|
+
|
|
53
|
+
Actions: inspect branch and staged state, stage only allowed changed files if none are staged, exclude audit Markdown, generate a concise Conventional Commit message, add Jira prefix if branch contains a key, run the commit, then report evidence.
|
|
54
|
+
|
|
55
|
+
User asks: "Write a commit message."
|
|
56
|
+
|
|
57
|
+
Actions: inspect diff and branch, generate the message in a code block, list excluded audit Markdown paths, and do not stage or commit.
|
|
58
|
+
|
|
59
|
+
User asks: "Commit everything, but leave audit reports out."
|
|
60
|
+
|
|
61
|
+
Actions: stage allowed changed files individually, exclude `audits/**/*.md` and `*-audit.md`, stop if an excluded file is already staged, and commit only the allowed scope.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
### π΄ Debug
|
|
2
|
+
|
|
3
|
+
Use this workflow when the user reports broken behavior, failures, regressions, crashes, unexpected output, flaky behavior, or any issue that needs evidence-backed root-cause diagnosis before a fix. Do not use it for new capabilities; route that to `workflows/feature.md`. Do not use it for broad redesign or unclear cross-boundary changes; route that to `workflows/spec-driven.md`.
|
|
4
|
+
|
|
5
|
+
Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
|
|
6
|
+
|
|
7
|
+
Before the first repository mutation, load `references/implementation-delivery.md` for worktree isolation, atomic commits, PR creation, CI watch, and the merge gate, and `references/code-annotation.md` for doc blocks, rationale comments, and test coverage on every created or updated unit. If two consecutive fix attempts fail on the same symptom, stop editing and load `references/root-cause-scripts.md`.
|
|
8
|
+
|
|
9
|
+
1. Generate/reuse `workflowSessionId`: `debug-[entity]`
|
|
10
|
+
2. Load shared references:
|
|
11
|
+
- `references/codebase-investigation.md`
|
|
12
|
+
- `references/debug-diagnosis-loop.md`
|
|
13
|
+
- `references/mobile-diagnosis.md` when the bug target involves KMP, iOS, Android, native bridges, devices, simulators/emulators, or mobile lifecycle
|
|
14
|
+
- `references/verification-ladder.md` before Quick/Standard/Spec-driven sizing or applying fixes
|
|
15
|
+
- `references/context-firewall.md` before inspecting logs, traces, snapshots, or generated output that meet its threshold table (a single source/log/doc block >200 lines, >20 KB, or >50 search hits)
|
|
16
|
+
- `references/lessons.md` when `.specs/lessons.json` exists, to load confirmed project lessons before diagnosis
|
|
17
|
+
3. `recall` β load prior debugging attempts for this entity
|
|
18
|
+
4. IF prior attempts exist:
|
|
19
|
+
- Review what was already tried
|
|
20
|
+
- Focus on untested hypotheses
|
|
21
|
+
- Treat memories tagged `stale` or superseded by `stale-replaces:*` as historical only
|
|
22
|
+
- Do not repeat ruled-out hypotheses unless new evidence invalidates the prior result
|
|
23
|
+
5. Follow the shared retrieval order from `references/codebase-investigation.md`
|
|
24
|
+
to load relevant code. `optimized_context` has no session field; put
|
|
25
|
+
`workflowSessionId` in query text/tags and pass only `synapseSessionId` to
|
|
26
|
+
`search.sessionId`.
|
|
27
|
+
- For large files (>200 lines) or derived-value computation, call `execute_file` with `path`, `language`, and `code` to run analysis code over the file instead of loading the entire file into context. Respect the local-dev-only trust model (no untrusted-client exposure).
|
|
28
|
+
- After opening a file for deep investigation, call `synapse_prefetch` with `id` (the `synapseSessionId`) and `filePath` to warm the Synapse buffer before the next search. Requires an existing `synapse_session` id.
|
|
29
|
+
6. Build or request a trustworthy feedback loop before editing:
|
|
30
|
+
- Use the reproduction ladder in `references/debug-diagnosis-loop.md`: unit/CLI repro, integration/API repro, app/browser/device repro, then structured HITL.
|
|
31
|
+
- IF no loop can run, record a skipped-reason enum from the debug reference and collect the strongest root-cause proof available
|
|
32
|
+
7. Reproduce and minimize the user-described failure without losing the original failure signal
|
|
33
|
+
8. Rank 3-5 falsifiable hypotheses before testing:
|
|
34
|
+
- include evidence, prediction, probe, disproof criteria, and tested result
|
|
35
|
+
- test one hypothesis at a time; instrument only to answer the current hypothesis
|
|
36
|
+
- for flaky failures, measure and improve reproduction rate before root-cause guessing
|
|
37
|
+
9. Apply debugging heuristics (see `references/decision-engine.md`):
|
|
38
|
+
- Trace data flow: input β transformation β output
|
|
39
|
+
- Compare expected vs actual behavior
|
|
40
|
+
- Check recent changes first
|
|
41
|
+
- Minimize search space to relevant modules
|
|
42
|
+
- For call/data-flow path tracing, call `trace_path` with `function_name` (or `qualifiedName`), `project`, `direction` (outbound/inbound/both), `mode` (calls/data_flow/cross_service/all), and `depth` to trace typed-edge BFS paths. `trace_path` only counts 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.
|
|
43
|
+
10. Size the fix before editing:
|
|
44
|
+
- Use the exact Quick, Standard, and Spec-driven thresholds in `references/verification-ladder.md`.
|
|
45
|
+
- Refactor route applies only when the fix becomes behavior-preserving cleanup after the root cause is proven.
|
|
46
|
+
11. Define the verification recipe before changing code:
|
|
47
|
+
- reproduction or root-cause proof
|
|
48
|
+
- commands, tests, or artifact checks that prove the fix
|
|
49
|
+
- file-integrity checks for validation assets such as tests, specs, benchmarks, fixtures, and snapshots
|
|
50
|
+
12. Fix the divergence point closest to the root cause
|
|
51
|
+
13. Add regression coverage at the correct seam, or document why no valid regression seam exists
|
|
52
|
+
14. If verification found a reusable signal (`ac_gap`, `surviving_mutant`, `spec_precision_gap`, `spec_deviation`, `gate_fail`), record it via `references/lessons.md`:
|
|
53
|
+
`python3 skills/massa-ai/scripts/lessons.py --root . add --feature "<slug>" --signal "<signal>" --source "<ref>" --text "<one terse lesson>"`
|
|
54
|
+
Rerun the original feedback loop, run the verification recipe, and remove temporary instrumentation unless intentionally retained as observability
|
|
55
|
+
15. Use `references/agent-orchestration.md` only for independent verification or isolated investigation branches
|
|
56
|
+
16. IF fix found:
|
|
57
|
+
- Persist the root cause via `remember` as a scored `decision` memory with `memory:semantic`
|
|
58
|
+
- Persist the fix pattern via `remember` as a scored `pattern` memory with `memory:procedural`
|
|
59
|
+
- If a prior debugging memory for this entity is now stale or contradicted by the fix, call `memory_update` with its `id` and the corrected `content` (re-embeds automatically)
|
|
60
|
+
17. IF NOT resolved:
|
|
61
|
+
- Persist what was ruled out via `remember` as a scored `conversation` memory with `memory:episodic`
|
|
62
|
+
- Persist repeated failed tool loops as procedural cognition lessons only when they are reusable
|
|
63
|
+
- Document remaining hypotheses for future sessions
|
|
64
|
+
18. Complete the Evidence Gate from `references/evidence-gate.md`
|
|
65
|
+
|
|
66
|
+
## Output Contract
|
|
67
|
+
|
|
68
|
+
- Issue Summary: symptom, impact, frequency, and environment
|
|
69
|
+
- Feedback Loop: command, tool, artifact, or root-cause proof that showed failure and then success
|
|
70
|
+
- Hypothesis Board: ranked hypotheses and tested results
|
|
71
|
+
- Root Cause: evidence-backed diagnosis with the divergence point
|
|
72
|
+
- Fix + Validation: code/test strategy, verification recipe, and commands or artifacts checked
|
|
73
|
+
- Prevention: regression test, monitor/runbook suggestion, and memory outcome
|
|
74
|
+
- For mobile bugs: device matrix, platform parity, crash/log artifact, and impacted/unaffected platform validation
|
|
75
|
+
|
|
76
|
+
## Example
|
|
77
|
+
|
|
78
|
+
User asks: "The login route returns 500 after deploy."
|
|
79
|
+
|
|
80
|
+
1. Use `workflowSessionId=debug-login-route-500` and recall `session:debug-login-route-500 login route 500 prior attempts`.
|
|
81
|
+
2. If recall says "session expiry was ruled out on 2026-05-30", do not repeat that hypothesis unless new evidence contradicts it.
|
|
82
|
+
3. Establish the feedback loop: reproduce the 500 with the smallest route check that preserves the deploy failure signal.
|
|
83
|
+
4. Build a hypothesis board: missing env, middleware ordering, expired session lookup, or database connection regression; probe one at a time.
|
|
84
|
+
5. Trace request β auth middleware β session lookup β response, then fix the divergence point closest to the root cause.
|
|
85
|
+
6. Define the verification recipe: rerun the original route check, add or update regression coverage at the failing seam, and confirm validation assets were not weakened.
|
|
86
|
+
7. If root cause is a missing `DATABASE_URL`, persist via `remember`: a semantic decision memory for the root cause and a procedural pattern memory for the deploy-env verification command.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
### Design
|
|
2
|
+
|
|
3
|
+
Use this workflow to implement or update a concrete Android, iOS, or KMP Compose Multiplatform UI from structured Figma evidence or supplied screenshot context when no saved mobile Figma audit report is the source of truth. Route findings-only comparison to `mobile-figma-audit` and saved `MFM-*` remediation to `mobile-figma-fix`.
|
|
4
|
+
|
|
5
|
+
Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
|
|
6
|
+
|
|
7
|
+
Before the first repository mutation, load `references/implementation-delivery.md` for worktree isolation, atomic commits, PR creation, CI watch, and the merge gate, and `references/code-annotation.md` for doc blocks, rationale comments, and test coverage on every created or updated unit. If two consecutive fix attempts fail on the same symptom, stop editing and load `references/root-cause-scripts.md`.
|
|
8
|
+
|
|
9
|
+
Do not use this workflow for Flutter, React Native, web UI, generic Figma exploration, variable-only queries, or MCP troubleshooting.
|
|
10
|
+
|
|
11
|
+
1. Resolve/reuse `workflowSessionId`: `design-[entity]`.
|
|
12
|
+
2. Load `references/mobile-figma-matcher/repository-detection.md`, `references/mobile-figma-matcher/core.md`, `references/mobile-context.md`, `references/codebase-investigation.md`, and `references/verification-ladder.md`. Load `references/context-firewall.md` before large design/runtime artifacts and `references/synapse-policy.md` when repeated massa-ai searches are expected.
|
|
13
|
+
3. `recall` -> load current component conventions, design-system rules, approved platform/accessibility deviations, prior Figma mappings, asset pipelines, and reusable render recipes. Memory is context, not proof.
|
|
14
|
+
4. Require a concrete feature/module target plus at least one design source: readable Figma node/selection or supplied screenshots. Resolve required visual and interactive states plus a requirements source for behavior not represented in the design source. Ask only when target ownership, runtime platforms, platform-frame mappings, or screenshot authority remain ambiguous after source inspection.
|
|
15
|
+
5. Build the immutable Target Surface Packet before loading stack guidance. Classify each selected surface and load only its contracts:
|
|
16
|
+
- Android Views XML -> `references/mobile-figma-matcher/android-views.md`.
|
|
17
|
+
- Android Jetpack Compose -> `references/mobile-figma-matcher/android-compose.md`.
|
|
18
|
+
- iOS UIKit -> `references/mobile-figma-matcher/ios-uikit.md`.
|
|
19
|
+
- iOS SwiftUI -> `references/mobile-figma-matcher/ios-swiftui.md`.
|
|
20
|
+
- Shared KMP Compose Multiplatform -> `references/mobile-figma-matcher/kmp-compose-multiplatform.md` plus native contracts only for selected native source sets, hosts, wrappers, or runtime targets.
|
|
21
|
+
6. Build the Figma Evidence Packet with metadata when needed, design context, screenshot, variables, current Code Connect mappings, variants/states, annotations, and asset inventory. For screenshot-only sources, build a Screenshot Context Packet with provenance, target state, visible constraints, uncertainty, and `Design Evidence Class: screenshot-context-only`; do not infer exact Figma tokens, dimensions, variables, variants, or parity from screenshots alone. Stop if neither structured Figma evidence nor supplied screenshot context is available.
|
|
22
|
+
7. Resolve current components, tokens, resources, assets, source-set ownership, platform adapters, requirements, and existing validation sensors. Create the Design-To-Code Mapping Matrix and one comparison configuration for every selected runtime surface; screenshot-only rows must use inferred visual intent rather than `Figma Value`.
|
|
23
|
+
8. Size the work with the Verification Ladder. Route broad application work, unresolved architecture, cross-feature design-system migration, or implementation that will not fit one clean context window to `spec-driven`.
|
|
24
|
+
9. Establish the verification recipe before editing. Protect tests, snapshots, screenshot baselines, fixtures, previews, accessibility identifiers, test tags, and automation flows from weakening.
|
|
25
|
+
10. Implement coherent slices using the smallest correct ownership boundary:
|
|
26
|
+
- Reuse existing components and tokens only after resolving semantics, states, accessibility, and values.
|
|
27
|
+
- Save required temporary Figma-served assets into the repository's existing durable asset pipeline before referencing them.
|
|
28
|
+
- Keep shared KMP UI in common source sets only when ownership is genuinely shared; keep platform UI and adapters explicit.
|
|
29
|
+
- Apply shared KMP root fixes before platform-local overrides when the cause is shared.
|
|
30
|
+
- Preserve platform accessibility, safe areas/insets, localization, adaptive behavior, and native conventions.
|
|
31
|
+
11. After each coherent slice, rebuild affected mapping/comparison rows and run the cheapest deterministic sensors. When a shared KMP change affects Android and iOS, verify both requested targets or mark the unavailable platform `NOT EVALUATED`.
|
|
32
|
+
12. Refresh the Figma node, when available, and all selected target surfaces before completion. Completion requires zero unresolved selected `MISMATCH` rows for structured Figma evidence; `NOT EVALUATED` rows remain explicit residual risk and prohibit complete parity claims. Screenshot-only completion may claim implementation against supplied screenshot context, never exact Figma parity.
|
|
33
|
+
13. Report changed files, final per-surface matrix, saved assets, strongest verification level, skipped checks, and residual risk.
|
|
34
|
+
14. Persist only durable token/component mappings, approved deviations, source-set ownership rules, asset-pipeline rules, or reusable render recipes after Importance Calibration. Use `workflow:design` and required project/session/entity/memory tags.
|
|
35
|
+
15. Complete `references/evidence-gate.md`. Model visual judgment alone cannot satisfy completion.
|
|
36
|
+
|
|
37
|
+
## Examples
|
|
38
|
+
|
|
39
|
+
User asks: "Implement this Figma checkout screen in the app's SwiftUI module."
|
|
40
|
+
|
|
41
|
+
1. Detect the Xcode target and SwiftUI surface from build and source evidence.
|
|
42
|
+
2. Load the shared core plus SwiftUI contract, map Figma states to current styles/views/assets, implement, and verify with existing previews, snapshots, XCTest/XCUITest, or simulator sensors.
|
|
43
|
+
|
|
44
|
+
User asks: "Build this screen in our KMP app for Android and iOS."
|
|
45
|
+
|
|
46
|
+
1. Detect whether UI is shared Compose Multiplatform or native per platform.
|
|
47
|
+
2. Load the KMP contract for shared composables and add Android Compose, Android Views, UIKit, or SwiftUI contracts only for actual hosts/source sets.
|
|
48
|
+
3. Verify shared source once and runtime parity separately for Android and iOS.
|
|
49
|
+
|
|
50
|
+
User asks: "Use this screenshot as context for the Android settings screen."
|
|
51
|
+
|
|
52
|
+
1. Classify screenshot context, target surface, and uncertainty before editing.
|
|
53
|
+
2. Implement only visible/in-scope intent and preserve behavior requirements from separate sources.
|
|
54
|
+
3. Report that exact Figma parity, tokens, and variables were not evaluated.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
### π΅ Exploration
|
|
2
|
+
|
|
3
|
+
Use this workflow when the user wants to understand a codebase, module, data flow, runtime behavior, schema, dependency, or architecture area before asking for changes. Exploration is read-only: do not implement, refactor, rewrite docs, or mutate project files unless the user explicitly changes workflows or asks for edits.
|
|
4
|
+
|
|
5
|
+
Before the first substantive read, load `references/project-context.md` and run the project-context intake sweep for this repository.
|
|
6
|
+
|
|
7
|
+
## Golden Rules
|
|
8
|
+
|
|
9
|
+
Inviolable across every exploration:
|
|
10
|
+
|
|
11
|
+
1. **Never assume or invent.** Uncertainty is always preferable to fabrication; invented APIs, symbols, or patterns cascade into wrong answers.
|
|
12
|
+
2. **Deserves-a-note.** When understanding is worth persisting, record what is durable β not trivia.
|
|
13
|
+
3. **Pointers, not copies.** Link/reference source (`path`, symbol, line); do not duplicate bulk content into notes or reports.
|
|
14
|
+
4. **Surgical precision.** Make the smallest sufficient change; in Exploration, that usually means the smallest sufficient read set.
|
|
15
|
+
5. **Verify against source.** Treat indexed context, memories, and external summaries as leads until confirmed against current source.
|
|
16
|
+
|
|
17
|
+
Write and search in the user's human language. Match the language of the user's prompt for explanations, notes, and questions; match the language of the codebase for identifiers, paths, and commands.
|
|
18
|
+
|
|
19
|
+
## Knowledge Verification Chain
|
|
20
|
+
|
|
21
|
+
When researching or resolving any technical question during exploration, follow this chain in strict order. Never skip steps.
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Step 1: Codebase β existing code, conventions, patterns already in use
|
|
25
|
+
Step 2: Project docs β README, docs/, inline comments, .specs/project/STATE.md (Decisions)
|
|
26
|
+
Step 3: Context7 MCP β resolve library ID, then query for current API/patterns
|
|
27
|
+
Step 4: Web search β official docs, reputable sources, community patterns
|
|
28
|
+
Step 5: Flag as uncertain β "I'm not certain about X β here's my reasoning, but verify"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- If a chain step's tool is unavailable (Context7 MCP not registered, no web
|
|
32
|
+
access), record it as a skipped sensor with its reason and continue to the next
|
|
33
|
+
step. An unavailable step is skipped, never silently treated as answered.
|
|
34
|
+
- Never skip to Step 5 if Steps 1-4 are available.
|
|
35
|
+
- Step 5 is always flagged uncertain β never presented as fact.
|
|
36
|
+
- Never assume or fabricate. If no answer is found, say "I don't know" or "I couldn't find documentation for this". "I don't know" beats invention.
|
|
37
|
+
|
|
38
|
+
1. Resolve/reuse `projectId` and `workflowSessionId`: `explore-[entity]`.
|
|
39
|
+
2. Load shared references:
|
|
40
|
+
- `references/codebase-investigation.md` always.
|
|
41
|
+
- `references/context-firewall.md` when source inspection, logs, traces, snapshots, generated output, external research, or broad search results may flood context.
|
|
42
|
+
- `references/synapse-policy.md` when two or more related massa-ai searches are expected.
|
|
43
|
+
- `references/mobile-context.md` only for non-debug mobile exploration involving KMP, iOS, Android, native bridges, mobile lifecycle, offline sync, permissions, push/background work, local persistence, backend-mobile contracts, or runtime lazy loading.
|
|
44
|
+
- `references/agent-orchestration.md` only when an isolated read-only investigation or independent verification task is justified.
|
|
45
|
+
- Route broken mobile behavior, crashes, regressions, or device-specific failures to `workflows/debug.md` plus `references/mobile-diagnosis.md`; do not keep them in Exploration.
|
|
46
|
+
3. Brief the exploration:
|
|
47
|
+
- objective and user-facing success criteria
|
|
48
|
+
- scope and explicit out-of-scope areas
|
|
49
|
+
- constraints, target environment, and current session
|
|
50
|
+
- whether the task is pure explanation, onboarding, flow mapping, or decision support
|
|
51
|
+
4. Recall first:
|
|
52
|
+
- `recall` for prior decisions, patterns, handoffs, gotchas, and previous exploration of the entity.
|
|
53
|
+
- Filter stale, superseded, or contradicted memories before using them as current truth.
|
|
54
|
+
- Treat memory as a lead until confirmed against current source when accuracy matters.
|
|
55
|
+
5. Build a proportional investigation plan before deep reads (BRIEFING β PLAN β EXECUTE β DEBRIEF):
|
|
56
|
+
- start from the closest entry point to the question
|
|
57
|
+
- name the symbols, files, routes, commands, docs, or runtime artifacts to inspect
|
|
58
|
+
- per step, state a `verify:` criterion β what concrete evidence confirms that step succeeded (a read signature, a matched call graph, a resolved data path) before moving on
|
|
59
|
+
- define what evidence would be enough to answer the user
|
|
60
|
+
- ask only if the objective or scope cannot be inferred from local context
|
|
61
|
+
6. Recon with progressive disclosure. Dispatch `investigator` per `references/agent-orchestration.md` when the investigation justifies an isolated read-only subagent:
|
|
62
|
+
|
|
63
|
+
> **Dispatch: `massa-ai-investigator`** (role: `investigator`) β charter `skills/agents/investigator/SKILL.md`
|
|
64
|
+
> - trigger: isolated read-only investigation justified; large scope, repeated searches, or context-firewall threshold exceeded
|
|
65
|
+
> - scope: the exploration target β symbols, files, routes, commands, docs, or runtime artifacts to inspect
|
|
66
|
+
> - permissions: read-only
|
|
67
|
+
> - inputs: objective, scope, explicit out-of-scope areas, constraints, recalled facts, and the closest entry point
|
|
68
|
+
> - sensors: progressive disclosure (project map β summary search β enriched search β symbol/file tools β optimized context β focused shell); per-step `verify:` criterion
|
|
69
|
+
> - output: entry points, core flow, dependencies, data ownership, relevant contracts, exact evidence pointers (path, symbol, line), confirmed facts vs inferences
|
|
70
|
+
> - firewall: raw logs, snapshots, generated reports, and broad search output summarized, not returned raw
|
|
71
|
+
> - memory: suggest-only; main agent persists durable discoveries
|
|
72
|
+
|
|
73
|
+
- Follow the shared retrieval order: project map, summary search, targeted
|
|
74
|
+
enriched search, symbol/file tools, optimized context, then focused shell
|
|
75
|
+
fallback.
|
|
76
|
+
- When external documentation, API references, or web content is needed to answer the question, call `fetch_and_index` with `url` (or `requests`[]) to fetch, convert HTMLβmarkdown or extract JSON key-paths, and index the result into the searchable store so it can be retrieved later via `search`. SSRF-guarded, TTL-cached.
|
|
77
|
+
- Follow imports, calls, ownership boundaries, and data paths from entry point outward.
|
|
78
|
+
- For behavior questions, trace input -> transformation -> output.
|
|
79
|
+
- Read signatures and high-value logic first; avoid whole-project sweeps and large raw file reads.
|
|
80
|
+
- Use pointers (`path`, symbol, line) instead of copying code into notes or reports.
|
|
81
|
+
7. Mobile exploration extension:
|
|
82
|
+
- Capture only the minimal mobile packet needed: platform scope, shared vs platform boundary, parity target, relevant device/runtime state, and cheapest validation sensor.
|
|
83
|
+
- For runtime lazy-loading questions, trace list/media/module loading, cache and prefetch behavior, lifecycle or background constraints, offline behavior, and Android/iOS parity where relevant.
|
|
84
|
+
- State skipped platform checks and the risk of treating one platform or simulator as global proof.
|
|
85
|
+
8. Synthesize the answer:
|
|
86
|
+
- state what was checked and what was intentionally not checked
|
|
87
|
+
- identify entry points, core flow, dependencies, data ownership, and relevant contracts
|
|
88
|
+
- include exact evidence pointers: file paths, symbols, commands, or artifacts
|
|
89
|
+
- separate confirmed facts from inferences and open questions
|
|
90
|
+
- name the next best workflow if the user wants changes after the explanation (`debug`, `feature`, `refactor`, `architecture-audit`, `spec-driven`, etc.)
|
|
91
|
+
9. Debrief memory with scoring from `references/decision-engine.md`:
|
|
92
|
+
- Persist only durable discoveries that would cost future effort to rediscover: repeated project patterns, architectural constraints, fragile flows, gotchas, accepted exceptions, rejected approaches, or reusable verification recipes.
|
|
93
|
+
- **Note-worthiness trigger:** when understanding touches 3+ files or a non-trivial flow, persist a note to the massa-ai memory layer. Below that threshold, decide per-finding.
|
|
94
|
+
- Three-way note decision: **create** (new durable finding), **update** (existing non-stale note for the same entity), or **skip** (trivial, one-off, already captured). The Debrief records what was verified against source, not just what was read.
|
|
95
|
+
- Use `remember` with required tags and the correct memory tier.
|
|
96
|
+
- Keep `massa-ai` as the canonical memory layer for massa-ai workflows. Do not introduce `.notebook/`, generated state files, or copied-code notes as default persistence.
|
|
97
|
+
- Skip memory for trivial observations, one-off facts, raw logs, copied source, screenshots, customer data, tokens, device IDs, and facts already captured in current non-stale memories.
|
|
98
|
+
10. Complete the Evidence Gate from `references/evidence-gate.md`.
|
|
99
|
+
|
|
100
|
+
## Anti-Patterns
|
|
101
|
+
|
|
102
|
+
- Reading the entire project when a nearby entry point exists.
|
|
103
|
+
- Dumping raw logs, browser snapshots, generated reports, long diffs, or whole files into context.
|
|
104
|
+
- Treating stale or superseded memories as current source truth.
|
|
105
|
+
- Implementing fixes or refactors inside Exploration.
|
|
106
|
+
- Creating a new persistence system or duplicating local notebook files inside massa-ai workflows.
|
|
107
|
+
- Asking the user where code lives before searching current sources.
|
|
108
|
+
|
|
109
|
+
## Output Contract
|
|
110
|
+
|
|
111
|
+
- Objective: what question was answered
|
|
112
|
+
- Scope Checked: files, symbols, docs, commands, memories, or artifacts inspected
|
|
113
|
+
- Entry Points: closest source pointers for future navigation
|
|
114
|
+
- Flow: input -> transformation -> output, when applicable
|
|
115
|
+
- Key Evidence: exact paths, symbols, command results, or artifact pointers
|
|
116
|
+
- Mobile Context: platform, boundary, parity, and skipped checks when mobile context was loaded
|
|
117
|
+
- Confirmed Facts vs Inferences: label uncertainty explicitly
|
|
118
|
+
- Next Step: recommended workflow if the user wants changes
|
|
119
|
+
- Memory: write/skip, memory tier, and reason
|