@massa-ai/cursor-plugin 1.20.0 → 1.22.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/package.json +1 -1
- package/skills/agents/audit-specialist/SKILL.md +1 -1
- package/skills/agents/context-curator/SKILL.md +1 -1
- package/skills/agents/furps-analyst/SKILL.md +1 -1
- package/skills/agents/investigator/SKILL.md +1 -1
- package/skills/agents/mobile-specialist/SKILL.md +1 -1
- package/skills/agents/navigator/SKILL.md +1 -1
- package/skills/agents/requirements-analyst/SKILL.md +1 -1
- package/skills/agents/reviewer/SKILL.md +1 -1
- package/skills/agents/verification-agent/SKILL.md +1 -1
- package/skills/massa-ai/SKILL.md +10 -0
- package/skills/massa-ai/references/evidence-gate.md +1 -1
- package/skills/massa-ai/references/hook-enforcement.md +2 -2
- package/skills/massa-ai/references/implementation-delivery.md +12 -1
- package/skills/massa-ai/references/lessons.md +9 -10
- package/skills/massa-ai/references/mcp-tools.md +1 -1
- package/skills/massa-ai/references/project-context.md +1 -1
- package/skills/massa-ai/references/spec-driven/artifact-store.md +7 -8
- package/skills/massa-ai/references/spec-driven/coding-principles.md +16 -0
- package/skills/massa-ai/references/spec-driven/design.md +3 -3
- package/skills/massa-ai/references/spec-driven/discuss.md +35 -12
- package/skills/massa-ai/references/spec-driven/execute.md +42 -25
- package/skills/massa-ai/references/spec-driven/memory.md +12 -2
- package/skills/massa-ai/references/spec-driven/specify.md +32 -14
- package/skills/massa-ai/references/spec-driven/sub-agents.md +33 -6
- package/skills/massa-ai/references/spec-driven/tasks.md +8 -6
- package/skills/massa-ai/references/spec-driven/validate.md +17 -12
- package/skills/massa-ai/scripts/check_commit.ts +231 -0
- package/skills/massa-ai/scripts/check_specs_delivered.ts +209 -0
- package/skills/massa-ai/scripts/lessons.ts +907 -0
- package/skills/massa-ai/scripts/validate_spec.ts +413 -0
- package/skills/massa-ai/scripts/validate_state.ts +276 -0
- package/skills/massa-ai/scripts/validate_tasks.ts +498 -0
- package/skills/massa-ai/workflows/architecture/architecture-fix.md +1 -1
- package/skills/massa-ai/workflows/bugs/bugs-fix.md +1 -1
- package/skills/massa-ai/workflows/code-quality/code-quality-fix.md +1 -1
- package/skills/massa-ai/workflows/debug.md +1 -1
- package/skills/massa-ai/workflows/exploration.md +1 -1
- package/skills/massa-ai/workflows/feature.md +1 -1
- package/skills/massa-ai/workflows/general.md +2 -2
- package/skills/massa-ai/workflows/implementation/implementation-fix.md +1 -1
- package/skills/massa-ai/workflows/maestro/maestro-fix.md +1 -1
- package/skills/massa-ai/workflows/mobile-figma/mobile-figma-fix.md +1 -1
- package/skills/massa-ai/workflows/refactor.md +1 -1
- package/skills/massa-ai/workflows/requirements/requirements-fix.md +1 -1
- package/skills/massa-ai/workflows/security/security-fix.md +1 -1
- package/skills/massa-ai/workflows/spec-driven.md +7 -6
- package/skills/massa-ai/workflows/tests/tests-fix.md +1 -1
- package/skills/massa-ai/scripts/lessons.py +0 -590
package/package.json
CHANGED
package/skills/massa-ai/SKILL.md
CHANGED
|
@@ -62,6 +62,16 @@ Before reading any massa-ai file:
|
|
|
62
62
|
to remove obsolete ones.
|
|
63
63
|
- Emit concise user-facing status updates at meaningful workflow boundaries
|
|
64
64
|
when the Conversation Feedback Policy is active.
|
|
65
|
+
- Verify, don't assume: every factual claim that drives a decision is
|
|
66
|
+
verified against current codebase/command evidence or confirmed with the
|
|
67
|
+
user. Documentation of any kind — README, docs/, inline comments, external
|
|
68
|
+
summaries, even `.specs/` prose — is a lead to verify against current
|
|
69
|
+
source, never a trustable source of truth by itself. Unverifiable claims
|
|
70
|
+
become explicit assumptions the user confirms or accepts.
|
|
71
|
+
- Ask when in doubt: when genuine doubt remains after looking it up —
|
|
72
|
+
requirement meaning, scope boundaries, destructive/irreversible choices,
|
|
73
|
+
contradictory evidence — ask the user rather than choose silently. Facts
|
|
74
|
+
are looked up; decisions are asked.
|
|
65
75
|
- Complete Evidence Gate before claiming done.
|
|
66
76
|
|
|
67
77
|
Use internal references only when needed:
|
|
@@ -38,7 +38,7 @@ Use this compact shape when closing docs or skill work:
|
|
|
38
38
|
✅ [Verified] Skill validation and stale-reference scans passed.
|
|
39
39
|
🏁 [Finished] Updated massa-ai references. Memory outcome: durable decision stored. Remaining risk: none found.
|
|
40
40
|
|
|
41
|
-
Evidence: `
|
|
41
|
+
Evidence: `bun run scripts/generate-skill-artifacts.ts --check` passed; stale-reference and local-link scans passed.
|
|
42
42
|
Changed artifacts: `skills/massa-ai/SKILL.md`, `workflows/spec-driven.md`, `references/spec-driven/`, and `references/memory-policy.md`.
|
|
43
43
|
Memory outcome: wrote decision memory `dec_...`; no failed memory writes.
|
|
44
44
|
Residual risk: none found.
|
|
@@ -44,7 +44,7 @@ Every hook exits 0 on bad stdin or non-critical error. Blocking hooks are
|
|
|
44
44
|
| Hook | Event | Enforces |
|
|
45
45
|
|---|---|---|
|
|
46
46
|
| `stop_evidence_gate.py` | Stop | `references/evidence-gate.md` |
|
|
47
|
-
| `continuous_learning_evaluate.py` | Stop | `references/lessons.md`, `scripts/lessons.
|
|
47
|
+
| `continuous_learning_evaluate.py` | Stop | `references/lessons.md`, `scripts/lessons.ts` |
|
|
48
48
|
| `precompact_save_state.py` | PreCompact | `workflows/long-session.md`, `references/context-firewall.md` |
|
|
49
49
|
| `suggest_compact.py` | PreToolUse(Edit\|Write) | `references/context-firewall.md` (compaction boundary) |
|
|
50
50
|
| `gateguard_fact_force.py` | PreToolUse(Edit) | `references/context-firewall.md` (investigate-before-edit) |
|
|
@@ -100,7 +100,7 @@ absent, it falls back to the flat evidence matrix (graceful degradation).
|
|
|
100
100
|
|
|
101
101
|
The continuous-learning loop writes two stores, not one:
|
|
102
102
|
|
|
103
|
-
- `lessons.
|
|
103
|
+
- `lessons.ts add` / `import` — deterministic grounded file store
|
|
104
104
|
(`.specs/lessons.json`); refuses ungrounded lessons; promotion/quarantine.
|
|
105
105
|
- `remember` — durable memory, best-effort via REST (`MASSA_AI_API_URL`),
|
|
106
106
|
file-only fallback when REST is unavailable.
|
|
@@ -22,7 +22,8 @@ human chose to merge it".
|
|
|
22
22
|
| 1 | Isolate | `git fetch origin <base> && git worktree add -b <type>/<slug> <path> origin/<base>` | Branch name taken → suffix `-2`. Worktree path taken → reuse it only if its branch matches |
|
|
23
23
|
| 2 | Implement | one task → gate → `git commit` | Gate red → fix before committing. Never commit through a failing gate |
|
|
24
24
|
| 3 | Push | `git push -u origin <type>/<slug>` | Rejected non-fast-forward → `git fetch` + rebase, never force-push a shared branch |
|
|
25
|
-
|
|
|
25
|
+
| 3.5 | Deliver specs | `bun skills/massa-ai/scripts/check_specs_delivered.ts <feature> [--root .]` | Non-zero → commit the missing `.specs/` updates (a `docs(specs):`-type commit is normal), push, re-run. Defensive fallback — should not fire when the close-out task already committed `.specs/` before the first push |
|
|
26
|
+
| 4 | Propose — precondition: Stage 3.5 (`check_specs_delivered.ts`) green | `gh pr create --base <base> --title <t> --body <b>` | `gh` absent/unauthenticated → degraded path |
|
|
26
27
|
| 5 | Watch | `gh pr checks --watch` | No checks configured → say so; do not claim CI passed |
|
|
27
28
|
| 6 | Repair | fix on the branch, commit, return to stage 5 | Capped at 3 iterations, then stop as `Blocked` |
|
|
28
29
|
| 7 | **Ask** | report the PR URL and the green check list, then **stop** | — |
|
|
@@ -69,6 +70,16 @@ that workflow. This reference owns only the cadence: **one atomic commit per
|
|
|
69
70
|
completed task, after its gate passes.** Never batch tasks into one commit and
|
|
70
71
|
never commit a task whose gate is red.
|
|
71
72
|
|
|
73
|
+
### Stage 3 — push carries the feature's delivery authorization
|
|
74
|
+
|
|
75
|
+
One explicit delivery authorization per feature, obtained before implementation begins, covers task commits, the branch push, and `gh pr create` for that feature — a single approval, not a push-by-push confirmation. Force-push, deploy, production database changes, merges, and any other remote/externally-visible/destructive operation always require a separate explicit go-ahead, even after that authorization. Workflows that gate Execute behind a batch/delegation offer (e.g. `workflows/spec-driven.md`) obtain this authorization at that same moment.
|
|
76
|
+
|
|
77
|
+
### Stage 3.5 — deliver specs before PR (defensive fallback)
|
|
78
|
+
|
|
79
|
+
Between Push and Propose, all feature `.specs/` artifacts (`spec/context/design/tasks/validation` as applicable), `.specs/project/STATE.md`, `.specs/HANDOFF.md`, and `.specs/project/FEATURES.json` must be updated and committed on the branch. **Deterministic backing (run it, do not eyeball it):** `bun skills/massa-ai/scripts/check_specs_delivered.ts <feature> [--root .]` — a non-zero exit blocks Propose. If no code-execution tool is available, run the same checks by reading the artifact (graceful degradation preserved).
|
|
80
|
+
|
|
81
|
+
**Nominal path: this stage should never fire.** The feature's own close-out task (the last task before delivery — see `workflows/spec-driven.md` step 7) commits `.specs/` updates **before** the first push, so stage 3.5's remediation is a defensive fallback for the rare case something slipped through, not the normal place `.specs/` gets committed. On failure: commit the missing `.specs/` updates (a `docs(specs):`-type commit is normal), push, re-run this stage. No commits may land between the close-out commit and PR creation.
|
|
82
|
+
|
|
72
83
|
### Stage 4 — propose carries the phase key prefix
|
|
73
84
|
|
|
74
85
|
The PR/MR is created with `gh pr create --base <base> --title <t> --body <b>`.
|
|
@@ -4,9 +4,8 @@ Use this reference when loading confirmed project lessons during startup, or rec
|
|
|
4
4
|
|
|
5
5
|
## Artifacts
|
|
6
6
|
|
|
7
|
-
- `.specs/lessons.json` — canonical machine-owned lesson state. Read it; do not hand-edit.
|
|
8
|
-
-
|
|
9
|
-
- `skills/massa-ai/scripts/lessons.py` — deterministic bookkeeping script.
|
|
7
|
+
- `.specs/lessons.json` — canonical machine-owned lesson state, the single lessons store. Read it; do not hand-edit.
|
|
8
|
+
- `skills/massa-ai/scripts/lessons.ts` — deterministic bookkeeping script; `lessons list` is the on-demand view.
|
|
10
9
|
|
|
11
10
|
## Lesson Signal Table
|
|
12
11
|
|
|
@@ -23,7 +22,7 @@ Use this reference when loading confirmed project lessons during startup, or rec
|
|
|
23
22
|
After a workflow's verification step finds a concrete reusable signal, record it:
|
|
24
23
|
|
|
25
24
|
```bash
|
|
26
|
-
|
|
25
|
+
bun skills/massa-ai/scripts/lessons.ts --root . add \
|
|
27
26
|
--feature "<feature-slug>" \
|
|
28
27
|
--signal "<ac_gap|surviving_mutant|spec_precision_gap|spec_deviation|gate_fail>" \
|
|
29
28
|
--source "<validation.md source, AC id, file:line, mutant id, or SPEC_DEVIATION ref>" \
|
|
@@ -51,7 +50,7 @@ Run this self-check after verification: if a failed acceptance criterion, surviv
|
|
|
51
50
|
During startup of any applicable workflow, load confirmed lessons when `.specs/lessons.json` exists:
|
|
52
51
|
|
|
53
52
|
```bash
|
|
54
|
-
|
|
53
|
+
bun skills/massa-ai/scripts/lessons.ts --root . list --status confirmed [--scope <relevant>]
|
|
55
54
|
```
|
|
56
55
|
|
|
57
56
|
- Use `--scope` or `--query` to keep the loaded set small.
|
|
@@ -69,7 +68,7 @@ python3 skills/massa-ai/scripts/lessons.py --root . list --status confirmed [--s
|
|
|
69
68
|
|
|
70
69
|
## No-Script Fallback
|
|
71
70
|
|
|
72
|
-
If `lessons.
|
|
71
|
+
If `lessons.ts` is unavailable or cannot run, record `Lessons: skipped - script unavailable` in the validation report or evidence gate, keep the raw signal in the report, and do not hand-edit `lessons.json`. A future run with the script can import the validated signal.
|
|
73
72
|
|
|
74
73
|
## Continuous-Learning Loop (hook-fed)
|
|
75
74
|
|
|
@@ -82,13 +81,13 @@ The lessons layer is a closed loop, not manual-only. Two runtime hooks
|
|
|
82
81
|
2. **evaluate** — `continuous_learning_evaluate.py` (Stop) reads the active
|
|
83
82
|
massa-ai context from `.specs/project/STATE.md` and the observations
|
|
84
83
|
buffer. For each observation that already carries grounded fields
|
|
85
|
-
(`signal`, `text`, `source`, `feature`), it calls `lessons.
|
|
84
|
+
(`signal`, `text`, `source`, `feature`), it calls `lessons.ts add` with the
|
|
86
85
|
`--project`/`--session`/`--workflow`/`--entity` context. Ungrounded
|
|
87
86
|
observations are left in the buffer for agent input and logged as skipped.
|
|
88
87
|
|
|
89
88
|
### massa-ai Dual-Write
|
|
90
89
|
|
|
91
|
-
`lessons.
|
|
90
|
+
`lessons.ts add` and `import` best-effort write massa-ai memory so the file store
|
|
92
91
|
and durable memory stay consistent:
|
|
93
92
|
|
|
94
93
|
- **type** is always `pattern` (lessons are procedural knowledge). `procedural`
|
|
@@ -105,8 +104,8 @@ and durable memory stay consistent:
|
|
|
105
104
|
### Round-Trip
|
|
106
105
|
|
|
107
106
|
```bash
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
bun skills/massa-ai/scripts/lessons.ts --root . export --out lessons.export.json
|
|
108
|
+
bun skills/massa-ai/scripts/lessons.ts --root . import --in lessons.export.json
|
|
110
109
|
```
|
|
111
110
|
|
|
112
111
|
`export`/`import` round-trip the file store; `import` re-emits massa-ai memory
|
|
@@ -285,7 +285,7 @@ delay. Preferred shell pattern:
|
|
|
285
285
|
MASSA_AI_API_URL="${MASSA_AI_API_URL:-http://localhost:3333}"
|
|
286
286
|
for i in $(seq 1 40); do
|
|
287
287
|
result=$(rtk curl -s "$MASSA_AI_API_URL/api/v1/project/index/status/JOB_ID")
|
|
288
|
-
status=$(printf '%s' "$result" |
|
|
288
|
+
status=$(printf '%s' "$result" | bun -e "console.log(JSON.parse(await Bun.stdin.text()).data.status)")
|
|
289
289
|
printf '[%s] status=%s\n' "$i" "$status"
|
|
290
290
|
[ "$status" = "completed" ] || [ "$status" = "failed" ] && break
|
|
291
291
|
sleep 15
|
|
@@ -23,7 +23,7 @@ continue only when the next decision still needs more.
|
|
|
23
23
|
| 2 — Host config | `.claude/` (`settings.json`, `settings.local.json`, `commands/`, `agents/`, `skills/`, `hooks/`), `.cursor/` (`rules/`, `mcp.json`), `.github/copilot-instructions.md`, `.opencode/`, `.codex/` | Permissions, hooks, host-specific tooling, MCP registrations |
|
|
24
24
|
| 3 — Product docs | `README.md`, `CONTRIBUTING.md`, `docs/`, `ARCHITECTURE.md` | Install/run/build surface, contribution protocol, architecture |
|
|
25
25
|
| 4 — Delivery config | `.github/workflows/`, `CHANGELOG.md`, `package.json` / `Cargo.toml` / `build.gradle*` / `pyproject.toml`, `.tool-versions`, `mise.toml`, `Makefile` | CI gates, release rules, runtime and toolchain pins, task commands |
|
|
26
|
-
| 5 — Live state | `.specs/project/STATE.md`, `.specs/project/FEATURES.json`, `.specs/HANDOFF.md`, `.specs/
|
|
26
|
+
| 5 — Live state | `.specs/project/STATE.md`, `.specs/project/FEATURES.json`, `.specs/HANDOFF.md`, `.specs/lessons.json` (single store; `lessons list` is the on-demand view) | In-flight work, decisions already made, confirmed lessons |
|
|
27
27
|
|
|
28
28
|
Tier 1 and Tier 3 (`README.md`) are mandatory in every workflow. Tiers 2, 4, and
|
|
29
29
|
5 are read when the task touches host tooling, a gate/release surface, or
|
|
@@ -27,8 +27,7 @@ Use these logical paths:
|
|
|
27
27
|
- `.specs/features/<slug>/validation.md` — feature validation report
|
|
28
28
|
- `.specs/quick/NNN-slug/TASK.md` — quick-mode task (one-line intent + acceptance)
|
|
29
29
|
- `.specs/quick/NNN-slug/SUMMARY.md` — quick-mode result (files changed + gate evidence)
|
|
30
|
-
- `.specs/lessons.json` — machine-owned
|
|
31
|
-
- `.specs/LESSONS.md` — rendered lesson playbook (read-only, generated by `lessons.py`)
|
|
30
|
+
- `.specs/lessons.json` — the single lessons store, machine-owned (managed by `lessons.ts`); `lessons list` is the on-demand view
|
|
32
31
|
|
|
33
32
|
## Quick Artifacts
|
|
34
33
|
|
|
@@ -61,21 +60,21 @@ Quick tasks are also listed in the STATE.md Quick Tasks table (see `references/s
|
|
|
61
60
|
|
|
62
61
|
Load only what you need. Prefer metadata-only inspection before loading full content.
|
|
63
62
|
|
|
64
|
-
- **Feature registry status:** `
|
|
63
|
+
- **Feature registry status:** `bun -e "const d=await Bun.file('.specs/project/FEATURES.json').json(); console.log('active:', d.active_feature); for (const f of d.features??[]) console.log(f.id, f.status);"`
|
|
65
64
|
- **Full feature registry:** `cat .specs/project/FEATURES.json`
|
|
66
65
|
- **Project state:** `cat .specs/project/STATE.md`
|
|
67
66
|
- **Handoff:** `cat .specs/HANDOFF.md`
|
|
68
67
|
- **Feature spec:** `cat .specs/features/<slug>/spec.md`
|
|
69
|
-
- **Confirmed lessons:** `
|
|
68
|
+
- **Confirmed lessons:** `bun skills/massa-ai/scripts/lessons.ts --root . list --status confirmed [--scope <relevant>]`
|
|
70
69
|
|
|
71
70
|
## Writing Artifacts
|
|
72
71
|
|
|
73
|
-
Write artifacts directly to `.specs/` files. Use a here-doc or `printf` for Markdown, or `
|
|
72
|
+
Write artifacts directly to `.specs/` files. Use a here-doc or `printf` for Markdown, or `bun -e` for JSON mutations.
|
|
74
73
|
|
|
75
74
|
- **Update state:** `printf '...' > .specs/project/STATE.md`
|
|
76
75
|
- **Update handoff:** `printf '...' > .specs/HANDOFF.md`
|
|
77
76
|
- **Write feature artifact:** `printf '...' > .specs/features/<slug>/design.md`
|
|
78
|
-
- **Update feature registry:** use `
|
|
77
|
+
- **Update feature registry:** use `bun -e` to read-modify-write `FEATURES.json`
|
|
79
78
|
|
|
80
79
|
Feature activate/complete flows update `.specs/project/FEATURES.json`, `.specs/project/STATE.md`, and `.specs/HANDOFF.md` through file writes.
|
|
81
80
|
|
|
@@ -83,7 +82,7 @@ Feature activate/complete flows update `.specs/project/FEATURES.json`, `.specs/p
|
|
|
83
82
|
|
|
84
83
|
- Feature artifacts under `.specs/features/<slug>/` are versioned by design (one file per slug).
|
|
85
84
|
- `.specs/project/FEATURES.json` and `.specs/project/STATE.md` are append-only versioned by their git history.
|
|
86
|
-
- `lessons.json` versioning is managed automatically by `lessons.
|
|
85
|
+
- `lessons.json` versioning is managed automatically by `lessons.ts`.
|
|
87
86
|
- When content must be superseded (e.g., a decision), update the existing file and rely on git history for the prior version.
|
|
88
87
|
|
|
89
88
|
## Debug Exports
|
|
@@ -94,5 +93,5 @@ Exports under `.specs-exports/` are optional, untracked review aids. Use `cp -r
|
|
|
94
93
|
|
|
95
94
|
- `.specs/` directory missing or not writable: block spec-driven state mutation; do not fall back to memory or chat.
|
|
96
95
|
- Required artifact missing: create it on first write or block unless it is an approved initial creation.
|
|
97
|
-
- `lessons.
|
|
96
|
+
- `lessons.ts` unavailable: skip lessons loading/recording, record skipped reason in validation report.
|
|
98
97
|
.specs/ files
|
|
@@ -78,3 +78,19 @@ Artifact-store evidence: active artifact key, version, and checksum after write
|
|
|
78
78
|
|
|
79
79
|
Ask: "Would senior engineer call this overcomplicated?"
|
|
80
80
|
If yes → simplify before proceeding.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Writing Voice (specs, ADRs, reports, commits, summaries)
|
|
85
|
+
|
|
86
|
+
The artifacts this skill produces should read like a decided engineer wrote them, not like generated boilerplate.
|
|
87
|
+
|
|
88
|
+
- **Lead with the verdict.** Validation reports and chat summaries open with PASS/FAIL and the one thing that matters, not a warm-up paragraph.
|
|
89
|
+
- **Decisions are definitive.** An ADR or a recorded decision states what you chose: "we will", not "we might" or "we should probably". If it still hedges, it is not a decision yet.
|
|
90
|
+
- **Cut filler and mechanical hedging.** Drop "it is worth noting", "as you can see", "in order to", and reflexive "may/might/could" on claims you are actually sure about. Reserve hedging for genuine uncertainty; using it everywhere signals nothing.
|
|
91
|
+
- **One idea per sentence; short sentences.** Prefer the plain verb over the nominalization ("evaluated", not "performed an evaluation of"). Keep subject-verb-object near the front.
|
|
92
|
+
- **Do not announce the phase.** Produce the artifact; do not narrate "I will now run Specify."
|
|
93
|
+
- **Avoid the em dash as a default connector.** A comma, colon, or two sentences usually read cleaner.
|
|
94
|
+
- **Writing in Portuguese:** keep sentences short; do not carry the long, multi-clause subordinate structure of Portuguese into the artifact. Plain and direct beats formal.
|
|
95
|
+
|
|
96
|
+
None of this means dumbing down the content — only the prose carrying it.
|
|
@@ -35,7 +35,7 @@ Read `.specs/features/<slug>/spec.md` before designing. If `.specs/features/<slu
|
|
|
35
35
|
|
|
36
36
|
Silently ignoring an active decision is not an option — it creates invisible inconsistency across features.
|
|
37
37
|
|
|
38
|
-
**Also load confirmed lessons** relevant to this feature: `
|
|
38
|
+
**Also load confirmed lessons** relevant to this feature: `bun skills/massa-ai/scripts/lessons.ts list --status confirmed` (filter with `--scope`/`--query`). These are past verification failures distilled into guidance — apply them while designing. Load only `confirmed`. Skip silently if no store or no code tool. See [lessons.md](lessons.md).
|
|
39
39
|
|
|
40
40
|
### 1.5. Research (Optional but Recommended)
|
|
41
41
|
|
|
@@ -44,7 +44,7 @@ If the feature involves unfamiliar technology, patterns, or integrations, resear
|
|
|
44
44
|
Follow the **Knowledge Verification Chain** (see SKILL.md) in strict order:
|
|
45
45
|
|
|
46
46
|
```
|
|
47
|
-
Codebase → Project docs → Context7 MCP → Web search → Flag as uncertain
|
|
47
|
+
Codebase → Project docs (leads, not truth) → Context7 MCP → Web search → Flag as uncertain
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
When verifying codebase claims, prefer the massa-ai tool chain FIRST — `list_projects`, `search`, `project_map`, `optimized_context` — before falling back to ast-grep / ripgrep / grep. Apply freshness and source-precedence rules: current source code overrides a stale index, and a stale index or durable memory never overrides current evidence. When uncertain about index freshness, read the live file directly.
|
|
@@ -110,7 +110,7 @@ When the design replaces an existing decision, never delete the old entry. Appen
|
|
|
110
110
|
Use this order for technical claims:
|
|
111
111
|
|
|
112
112
|
1. Current codebase.
|
|
113
|
-
2. Project docs and approved specs.
|
|
113
|
+
2. Project docs and approved specs (leads, not truth) — verify against current source before relying.
|
|
114
114
|
3. Context7 MCP or available local MCP source for current library behavior when relevant.
|
|
115
115
|
4. Official documentation or primary source when current APIs or external services matter.
|
|
116
116
|
5. Mark uncertainty explicitly when evidence is unavailable.
|
|
@@ -60,22 +60,42 @@ Present the feature boundary (from `spec.md`) and the gray areas to the user. Le
|
|
|
60
60
|
|
|
61
61
|
Any gray area the user **declines** to discuss, or that goes undiscussed, is written to the spec's **Assumptions & Open Questions** section (agent's chosen default + rationale) — never silently dropped. This ensures the spec's closure gate can pass: every gray area is either resolved through discussion or recorded as a signed-off assumption.
|
|
62
62
|
|
|
63
|
-
### 3.
|
|
63
|
+
### 3. Choose discussion pace (once)
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
Before deep-diving, ask **one** pace question. Recommend **Guided** as the default. If the user skips, says "whatever", or "you choose", use Guided.
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
| Pace | When it fits | Cadence |
|
|
68
|
+
| ------------ | -------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
69
|
+
| **Quick** | User wants speed; trusts defaults | Propose defaults per area (rationale included); user accepts / overrides |
|
|
70
|
+
| **Guided** | Default — balances depth and turn count | Adaptive elicitation (see below) |
|
|
71
|
+
| **Detailed** | High ambiguity; user wants Socratic control | Exactly one decision per turn, dependency order |
|
|
71
72
|
|
|
72
|
-
|
|
73
|
+
Honor mid-discussion switches immediately ("go faster", "slow down", "just decide") — change pace without restarting or re-asking settled decisions.
|
|
73
74
|
|
|
74
|
-
|
|
75
|
-
- Each answer should inform the next question
|
|
76
|
-
- Include "You decide" as an option when reasonable — captures agent discretion
|
|
75
|
+
### 4. Deep-Dive Each Area
|
|
77
76
|
|
|
78
|
-
|
|
77
|
+
Shared rules for every pace:
|
|
78
|
+
|
|
79
|
+
1. Options must be concrete ("Card layout" or "Table layout" — not "Option A" or "how should it look?").
|
|
80
|
+
2. Lead with your recommended answer and one line of reasoning. You have read the codebase; the user should be able to accept or override in a word.
|
|
81
|
+
3. Offer "You decide" when reasonable — it records agent discretion explicitly.
|
|
82
|
+
4. Resolve anything discoverable from the code yourself (Knowledge Verification Chain); only put genuine product decisions to the user.
|
|
83
|
+
5. When an area is settled: "More on [area], or move on?" After all areas: "Ready to create context?"
|
|
84
|
+
|
|
85
|
+
**Quick:** For each selected gray area, present the recommended decisions for that area in one turn (defaults + short rationale). Wait for accept / override. Do not drip-feed single questions unless the user challenges a default and opens a real fork.
|
|
86
|
+
|
|
87
|
+
**Guided:** Adaptive elicitation — questions are a decision tree to prune, not a checklist to finish.
|
|
88
|
+
|
|
89
|
+
1. Classify upcoming decisions as **independent** vs **dependent**.
|
|
90
|
+
2. Low-stakes / safe-to-default → state the assumption and invite correction (no blocking question).
|
|
91
|
+
3. Independent product decisions → ask **at most 2** in the same turn, each with options + recommended default.
|
|
92
|
+
4. Dependent decisions → ask **exactly one**, wait, then continue (the earlier answer should prune later questions).
|
|
93
|
+
5. Never dump 3+ questions in one turn. Never ask what the code already answers.
|
|
94
|
+
6. Stop the area as soon as enough is decided.
|
|
95
|
+
|
|
96
|
+
**Detailed:** Walk selected gray areas as a strict decision tree — one concrete question per turn, dependency order, wait for each answer before the next. Use when the user wants maximum control or the feature is highly ambiguous.
|
|
97
|
+
|
|
98
|
+
### 5. Scope Guardrail (CRITICAL)
|
|
79
99
|
|
|
80
100
|
The feature boundary from `spec.md` is **fixed**. Discussion clarifies HOW to implement, never WHETHER to add new capabilities.
|
|
81
101
|
|
|
@@ -84,7 +104,7 @@ The feature boundary from `spec.md` is **fixed**. Discussion clarifies HOW to im
|
|
|
84
104
|
|
|
85
105
|
When user suggests scope creep: "That sounds like a separate feature. I'll note it in Deferred Ideas. Back to [current area]."
|
|
86
106
|
|
|
87
|
-
###
|
|
107
|
+
### 6. Write `context.md`
|
|
88
108
|
|
|
89
109
|
Write `.specs/features/<slug>/context.md` (see template below).
|
|
90
110
|
|
|
@@ -175,6 +195,9 @@ Discuss is done when every gray area is either resolved with the user, recorded
|
|
|
175
195
|
|
|
176
196
|
## Tips
|
|
177
197
|
|
|
198
|
+
- **Pace is a user choice; Guided is the default** — Quick for speed, Guided for balance, Detailed for Socratic depth; honor mid-discussion switches
|
|
199
|
+
- **Guided ≠ interrogation and ≠ form dump** — Assume-first when safe, ≤2 independent questions per turn, one-at-a-time only when answers depend on each other
|
|
200
|
+
- **Look it up, don't ask** — Resolve anything discoverable from the code yourself; ask only genuine product decisions
|
|
178
201
|
- **Decisions, not vision** — "Card-based layout with subtle shadows" is a decision. "Should feel modern" is not.
|
|
179
202
|
- **Scope is sacred** — Deferred Ideas captures scope creep without losing ideas
|
|
180
203
|
- **User = visionary, Agent = builder** — Ask about how they imagine it, not about technical implementation
|
|
@@ -11,7 +11,7 @@ Use this reference for the required Execute phase. Implement ONE task at a time:
|
|
|
11
11
|
- `.specs/features/<slug>/tasks.md` when Tasks was included, otherwise the inline atomic step list from `workflows/spec-driven.md`.
|
|
12
12
|
- Current `.specs/project/STATE.md`.
|
|
13
13
|
- `references/spec-driven/coding-principles.md`.
|
|
14
|
-
- `references/spec-driven/sub-agents.md` when a formal task plan
|
|
14
|
+
- `references/spec-driven/sub-agents.md` when a formal task plan has more than 3 tasks (the batch offer trigger — packing still uses ~7-task batches), or final validation needs the standalone verifier fallback.
|
|
15
15
|
|
|
16
16
|
Artifact-store evidence: active artifact key, version, and checksum after write (see `references/spec-driven/artifact-store.md`).
|
|
17
17
|
|
|
@@ -35,7 +35,7 @@ Do not proceed without stating these explicitly.
|
|
|
35
35
|
|
|
36
36
|
### Before implementing: assess sub-agent delegation (MANDATORY — before the first task)
|
|
37
37
|
|
|
38
|
-
Before implementing anything, if a formal `.specs/features/<slug>/tasks.md` with an Execution Plan exists, **count its total tasks**
|
|
38
|
+
Before implementing anything, if a formal `.specs/features/<slug>/tasks.md` with an Execution Plan exists, **count its total tasks**. If the feature has **more than 3 tasks**, you MUST present the sub-agent offer to the user and wait for their choice before starting Execute — do not silently proceed inline. Packing itself still uses task-budgeted batches (~7 tasks per worker, whole phases — see [sub-agents.md](sub-agents.md)); a 4–8-task feature packs into a single batch and is still offered as one batch worker. If the feature has 3 or fewer tasks, or the user declines the offer, execute inline. Skip this check only when you are already a batch worker executing a delegated batch (the orchestrator already made the delegation decision).
|
|
39
39
|
|
|
40
40
|
### 0. List Atomic Steps (MANDATORY when Tasks phase was skipped)
|
|
41
41
|
|
|
@@ -222,11 +222,16 @@ After the gate check passes:
|
|
|
222
222
|
|
|
223
223
|
**On any failure** → rewrite or remove the affected test(s), re-run the gate, then re-run this review.
|
|
224
224
|
|
|
225
|
-
*Honest caveat:* This is an inspection-based review (model judgment), complementary to — not a replacement for — the deterministic gate. The gate confirms the test suite runs; the feature-level discrimination sensor (step
|
|
225
|
+
*Honest caveat:* This is an inspection-based review (model judgment), complementary to — not a replacement for — the deterministic gate. The gate confirms the test suite runs; the feature-level discrimination sensor (step 9) confirms the tests can detect regressions. This review confirms the suite is meaningful and bounded.
|
|
226
226
|
|
|
227
227
|
Add the two mapping tables and a one-line adequacy verdict to the Execution Template's Post-Gate section.
|
|
228
228
|
|
|
229
|
-
### 7. Atomic
|
|
229
|
+
### 7. Status + Atomic Commit (same commit)
|
|
230
|
+
|
|
231
|
+
After the gate is green, close the task record **before** creating the commit, then commit code and status together. Never leave `tasks.md` still open after a successful task commit — a crash between those steps is how resume redoes finished work.
|
|
232
|
+
|
|
233
|
+
1. Mark the task complete in `.specs/features/<slug>/tasks.md`. Update requirement traceability in `spec.md` if requirement IDs are used. Update logical feature artifact status and `.specs/project/STATE.md` with evidence and the exact next step.
|
|
234
|
+
2. Create **one** atomic commit that includes the implementation, its tests, and those status/traceability updates.
|
|
230
235
|
|
|
231
236
|
Each task gets its own commit immediately after verification. Never batch multiple tasks into one commit. Use one atomic commit per task when the environment and user permissions allow commits; otherwise record why the commit was skipped.
|
|
232
237
|
|
|
@@ -293,9 +298,34 @@ for reuse across multiple endpoints.
|
|
|
293
298
|
|
|
294
299
|
- One task = one commit.
|
|
295
300
|
- Description references what was DONE, not what was planned.
|
|
296
|
-
- Include only files listed in the task —
|
|
301
|
+
- Include only files listed in the task — plus the `tasks.md` / `spec.md` status updates for this task.
|
|
302
|
+
- Never sneak in "while I'm here" changes.
|
|
297
303
|
- If tests are part of the task, include them in the same commit.
|
|
298
304
|
|
|
305
|
+
**Deterministic backing (run it, do not eyeball it):** `bun skills/massa-ai/scripts/check_commit.ts --message "<your message>"` before committing. A non-zero exit means fix the format first — this makes the format rule enforceable instead of memory-dependent. If no code-execution tool is available, run the same checks by reading the artifact (graceful degradation preserved).
|
|
306
|
+
|
|
307
|
+
**Optional git-level guard (git only, no agent dependency).** In a git repo the same check can run on every commit by wiring it as a `commit-msg` hook, so a malformed message is rejected regardless of who or what drives the commit:
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
# from the repo root, one time:
|
|
311
|
+
ln -sf skills/massa-ai/scripts/check_commit.ts .git/hooks/commit-msg && chmod +x .git/hooks/commit-msg
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
This is a plain git hook, not tied to any editor or assistant. Skip it if the project manages hooks its own way (for example a pre-commit framework); the manual check above still applies.
|
|
315
|
+
|
|
316
|
+
**Distill a confirmed lesson** when a task produced a reusable signal (an unexpected failure mode, a confirmed pattern, a corrected assumption):
|
|
317
|
+
|
|
318
|
+
```
|
|
319
|
+
bun skills/massa-ai/scripts/lessons.ts --root . add \
|
|
320
|
+
--feature <slug> --signal <S> --source <src> --text "<T>" --scope <O>
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
`--source` is mandatory (grounding gate). Load applicable confirmed lessons before starting a task:
|
|
324
|
+
|
|
325
|
+
```
|
|
326
|
+
bun skills/massa-ai/scripts/lessons.ts --root . list --status confirmed [--scope <relevant>]
|
|
327
|
+
```
|
|
328
|
+
|
|
299
329
|
### 8. Scope Guardrail / Scope Control
|
|
300
330
|
|
|
301
331
|
During implementation, you will notice things that could be improved, refactored, or added. **Do not act on them.** Instead:
|
|
@@ -311,24 +341,9 @@ During implementation, you will notice things that could be improved, refactored
|
|
|
311
341
|
- Do not expand task scope to opportunistic refactors.
|
|
312
342
|
- Keep changed files limited to the approved scope and validation.
|
|
313
343
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
Mark the task complete in `.specs/features/<slug>/tasks.md`. Update requirement traceability in `spec.md` if requirement IDs are used. Update logical feature artifact status and `.specs/project/STATE.md` with evidence and the exact next step.
|
|
317
|
-
|
|
318
|
-
**Distill a confirmed lesson** when a task produced a reusable signal (an unexpected failure mode, a confirmed pattern, a corrected assumption):
|
|
319
|
-
|
|
320
|
-
```
|
|
321
|
-
python3 skills/massa-ai/scripts/lessons.py --root . add \
|
|
322
|
-
--feature <slug> --signal <S> --source <src> --text "<T>" --scope <O>
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
`--source` is mandatory (grounding gate). Load applicable confirmed lessons before starting a task:
|
|
326
|
-
|
|
327
|
-
```
|
|
328
|
-
python3 skills/massa-ai/scripts/lessons.py --root . list --status confirmed [--scope <relevant>]
|
|
329
|
-
```
|
|
344
|
+
**Blast radius (approval ≠ remote authority):** Approving Execute for this feature authorizes local implementation and local commits, and covers one delivery through PR creation — branch push and `gh pr create` — under one explicit go-ahead given at Execute start. Force-push, deploy, production database changes, merges, and any other remote/externally-visible/destructive operation always require a separate explicit go-ahead, even after that authorization.
|
|
330
345
|
|
|
331
|
-
###
|
|
346
|
+
### 9. Feature-Level Validation (after the LAST task — MANDATORY, always runs)
|
|
332
347
|
|
|
333
348
|
When the task you just completed is the **last task of the feature** (or of a priority group being delivered on its own, e.g. all P1 tasks), you MUST run feature-level validation before reporting the work as done. **This is not optional and is never prompted — it runs automatically.** Do not stop at the final task's commit.
|
|
334
349
|
|
|
@@ -336,7 +351,7 @@ When the task you just completed is the **last task of the feature** (or of a pr
|
|
|
336
351
|
|
|
337
352
|
**Layering:**
|
|
338
353
|
- Per-task adequacy self-check (steps 5–6): cheap, always runs, author does it, confirms each task in isolation.
|
|
339
|
-
- Feature-level validation (step
|
|
354
|
+
- Feature-level validation (step 9): one trustworthy independent gate at completion, always-on, Verifier sub-agent does it.
|
|
340
355
|
|
|
341
356
|
**How to delegate to the Verifier:**
|
|
342
357
|
Dispatch a fresh sub-agent following the **Verifier** role described in [sub-agents.md](sub-agents.md). Provide it with:
|
|
@@ -437,7 +452,7 @@ Then run `references/spec-driven/validate.md` as the final Execute gate. The ver
|
|
|
437
452
|
**Status**: ✅ Complete | ❌ Blocked | ⚠️ Partial
|
|
438
453
|
```
|
|
439
454
|
|
|
440
|
-
**After the LAST task:** dispatch the Verifier sub-agent (see step
|
|
455
|
+
**After the LAST task:** dispatch the Verifier sub-agent (see step 9 and [sub-agents.md](sub-agents.md)) for independent feature-level validation, including the spec-anchored check and discrimination sensor. Validation always runs automatically — never prompted. Execute is not done until the Verifier reports PASS and the validation report is written, confirmed deterministically by `bun skills/massa-ai/scripts/validate_state.ts <feature> [--root .]` (exit non-zero = not done); see [validate.md](validate.md). If no code-execution tool is available, run the same checks by reading the artifact (graceful degradation preserved).
|
|
441
456
|
|
|
442
457
|
---
|
|
443
458
|
|
|
@@ -447,11 +462,13 @@ Then run `references/spec-driven/validate.md` as the final Execute gate. The ver
|
|
|
447
462
|
- **Tools matter** — Wrong MCP = wrong approach; ask the MCP and skill question when tool choice changes correctness or verification.
|
|
448
463
|
- **Reuses save tokens** — Copy patterns, don't reinvent; reach for massa-ai tooling first to locate existing reuse.
|
|
449
464
|
- **Check before commit** — Verify all criteria, then commit.
|
|
465
|
+
- **Status then commit, same commit** — Mark `tasks.md` complete before the atomic commit and include that update in it; a crash between the two steps is how resume redoes finished work.
|
|
450
466
|
- **Stay surgical** — Touch only what's necessary.
|
|
451
467
|
- **Commit per task** — Clean git history enables bisect and rollback.
|
|
452
468
|
- **Never "while I'm here"** — Scope creep during implementation is the #1 quality killer.
|
|
469
|
+
- **Approval is local** — Push, deploy, and other remote/destructive ops need an explicit go-ahead beyond Execute's initial delivery authorization.
|
|
453
470
|
- **Learn from mistakes** — If something goes wrong, distill a confirmed lesson and surface it so it informs the next task.
|
|
454
|
-
- **Don't stop at the last commit** — Feature-level validation (step
|
|
471
|
+
- **Don't stop at the last commit** — Feature-level validation (step 9) is the final step of Execute, not optional.
|
|
455
472
|
|
|
456
473
|
---
|
|
457
474
|
|
|
@@ -191,8 +191,18 @@ Both are silent data loss. The section-scoped write rule is the single correctne
|
|
|
191
191
|
|
|
192
192
|
1. Read `.specs/project/STATE.md` and `.specs/HANDOFF.md` — both.
|
|
193
193
|
2. Re-confirm active decisions from `## Decisions` — nothing superseded since last session?
|
|
194
|
-
3. Read `.specs/HANDOFF.md` —
|
|
195
|
-
4.
|
|
194
|
+
3. Read `.specs/HANDOFF.md` — treat it as a **hypothesis** for feature, phase/task, next step, blockers, uncommitted files, branch — not as ground truth by itself.
|
|
195
|
+
4. **Reconcile with git before editing anything:**
|
|
196
|
+
- Current branch vs Handoff `Branch`
|
|
197
|
+
- `git status --porcelain` (uncommitted / unexpected paths)
|
|
198
|
+
- Recent commits on the branch (messages and touched files)
|
|
199
|
+
- `tasks.md` completion marks and, when present, gate evidence / commit references
|
|
200
|
+
5. **Resolve conflicts with evidence, not narrative:**
|
|
201
|
+
- A task with a green gate and an atomic commit already on the branch → do **not** redo it; mark it complete in `tasks.md` if the file still shows it open, then continue from the next incomplete task
|
|
202
|
+
- Partial unverified work in the working tree → preserve it, re-run the relevant gate, then finish the status+commit cycle
|
|
203
|
+
- Stale or missing Handoff → rebuild next-step from git + `tasks.md`, then propose that to the user
|
|
204
|
+
- Unexplained local changes you cannot map to the current task → STOP and ask; do not discard them
|
|
205
|
+
6. Propose the reconciled next step to the user before writing any code.
|
|
196
206
|
|
|
197
207
|
---
|
|
198
208
|
|