@esneiderbravo/speclaw 1.0.0 → 2.0.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/README.md +70 -56
- package/dist/cli/commands/cortex.js +49 -0
- package/dist/cli/commands/init.js +21 -15
- package/dist/cli/commands/lawbook.js +34 -1
- package/dist/cli/commands/update.js +25 -2
- package/dist/cli/index.js +10 -1
- package/dist/modules/cortex/brief.js +75 -0
- package/dist/modules/cortex/harness.js +270 -0
- package/dist/modules/cortex/register.js +49 -0
- package/dist/modules/foundation/assets/AGENTS.template.md +13 -6
- package/dist/modules/foundation/assets/CLAUDE.template.md +15 -11
- package/dist/modules/foundation/assets/docs/standards/lawbook.template.md +24 -37
- package/dist/modules/foundation/assets/laws/laws-manifest.json +16 -7
- package/dist/modules/foundation/assets/workflows/speclaw.yml +1 -1
- package/dist/modules/foundation/compile-laws.js +5 -7
- package/dist/modules/foundation/context-budget.js +2 -0
- package/dist/modules/foundation/graph.js +7 -3
- package/dist/modules/foundation/laws.js +30 -32
- package/dist/modules/foundation/scaffold.js +9 -6
- package/dist/modules/foundation/seed-laws.js +263 -0
- package/dist/modules/foundation/setup-tool.js +3 -2
- package/dist/modules/foundation/verify.js +2 -2
- package/dist/modules/lawbook/assets/agents/archiver.md +19 -0
- package/dist/modules/lawbook/assets/agents/explorer.md +24 -0
- package/dist/modules/lawbook/assets/agents/implementer.md +20 -0
- package/dist/modules/lawbook/assets/agents/planner.md +27 -0
- package/dist/modules/lawbook/assets/agents/reviewer.md +25 -0
- package/dist/modules/lawbook/assets/agents/tester.md +21 -0
- package/dist/modules/lawbook/assets/commands/cortex.md +11 -0
- package/dist/modules/lawbook/assets/rules/spec-tasks-mandatory-steps.md +11 -10
- package/dist/modules/lawbook/assets/skills/build/steps/03-implement.md +1 -1
- package/dist/modules/lawbook/assets/skills/build/steps/04-hand-off.md +17 -0
- package/dist/modules/lawbook/assets/skills/cortex/SKILL.md +13 -0
- package/dist/modules/lawbook/assets/skills/cortex/steps/01-load-or-start.md +25 -0
- package/dist/modules/lawbook/assets/skills/cortex/steps/02-dispatch-loop.md +19 -0
- package/dist/modules/lawbook/assets/skills/cortex/steps/03-complete.md +10 -0
- package/dist/modules/lawbook/assets/skills/test/SKILL.md +11 -0
- package/dist/modules/lawbook/assets/skills/{build/steps/04-quality-gates.md → test/steps/01-quality-gates.md} +1 -1
- package/dist/modules/lawbook/assets/skills/{build/steps/05-manual-verification.md → test/steps/02-manual-verification.md} +1 -1
- package/dist/modules/lawbook/assets/skills/{build/steps/06-discipline-reports.md → test/steps/03-discipline-reports.md} +5 -2
- package/dist/modules/lawbook/change-tool.js +22 -0
- package/dist/modules/lawbook/engine.js +4 -0
- package/dist/modules/lawbook/levels.js +9 -3
- package/dist/modules/lawbook/register.js +7 -0
- package/dist/modules/tools/assets/packs.json +1 -6
- package/dist/server.js +4 -1
- package/dist/shared/agents.js +3 -3
- package/dist/shared/exposure.js +2 -2
- package/dist/shared/tool-catalog.js +3 -2
- package/package.json +2 -2
- package/dist/modules/lawbook/assets/skills/build/steps/07-hand-off.md +0 -9
- package/dist/modules/tools/assets/packs/agents/backend-developer.md +0 -61
- package/dist/modules/tools/assets/packs/agents/frontend-developer.md +0 -62
- package/dist/modules/tools/assets/packs/agents/product-strategy-analyst.md +0 -56
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Load or start Cortex
|
|
2
|
+
|
|
3
|
+
- Confirm the change name with the user (or draft/quick first if none exists).
|
|
4
|
+
- Run the `cortex` MCP tool with `action: status` (or
|
|
5
|
+
`speclaw cortex status --change <name>`). Prefer `action: brief` when you
|
|
6
|
+
need the role + skill hints for the current stage.
|
|
7
|
+
- If missing, `action: start`.
|
|
8
|
+
- Read `ai-specs/agents/<role>.md` for the current stage's permission contract.
|
|
9
|
+
- If the host can spawn subagents (Claude Task / Cursor Task), spawn that role
|
|
10
|
+
with the contract in the prompt. If not, **adopt the role** in this session
|
|
11
|
+
but obey its allow/deny list strictly.
|
|
12
|
+
|
|
13
|
+
Stage → role:
|
|
14
|
+
|
|
15
|
+
| Stage | Role |
|
|
16
|
+
|-------|------|
|
|
17
|
+
| exploring | explorer (`explore` / `investigate` for bugs) |
|
|
18
|
+
| planning / questions | planner (`draft` / `quick`); questions always go to the human |
|
|
19
|
+
| implementing | implementer (`build` through implement hand-off) |
|
|
20
|
+
| reviewing | reviewer |
|
|
21
|
+
| testing | tester |
|
|
22
|
+
| archiving | archiver (`sync` + `archive`) |
|
|
23
|
+
| done | stop — report success |
|
|
24
|
+
|
|
25
|
+
Next: read `steps/02-dispatch-loop.md` and do only what it says.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Dispatch loop
|
|
2
|
+
|
|
3
|
+
For the current Cortex stage (`cortex` action `brief` or `status`):
|
|
4
|
+
|
|
5
|
+
1. Dispatch (spawn or adopt) the matching role with a clear handoff brief.
|
|
6
|
+
2. On role completion, call the matching Cortex op:
|
|
7
|
+
- exploring → `advance`
|
|
8
|
+
- planning with questions → `advance` + `pauseForQuestions` + `openQuestions`
|
|
9
|
+
- questions after human answers → `advance` (back to planning)
|
|
10
|
+
- planning complete → `advance` (to implementing)
|
|
11
|
+
- implementing done → `advance` (reviewing, or testing at level 0)
|
|
12
|
+
- reviewing PASS → `advance` + `verdict: PASS`; FAIL → `rework` + `verdict: FAIL`
|
|
13
|
+
- testing PASS → `advance` + `verdict: PASS`; FAIL → `rework` + `verdict: FAIL`
|
|
14
|
+
- archiving success → `advance` (to done)
|
|
15
|
+
3. Max rework is 3; if the engine rejects further rework, **ask the human**.
|
|
16
|
+
4. Coordinator never edits `src/`, never archives, never pushes, never runs
|
|
17
|
+
`laws accept`.
|
|
18
|
+
|
|
19
|
+
Next: read `steps/03-complete.md` and do only what it says.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Complete
|
|
2
|
+
|
|
3
|
+
When Cortex stage is `done` (or the human stops the run), summarize:
|
|
4
|
+
|
|
5
|
+
- Change name and final stage
|
|
6
|
+
- Review/test verdicts and iteration count
|
|
7
|
+
- Archive path if archived
|
|
8
|
+
- Anything still open for the human
|
|
9
|
+
|
|
10
|
+
No further steps remain — Cortex workflow complete.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test
|
|
3
|
+
description: Run quality gates, manual verification, and discipline reports for a change. Used by the tester Cortex role after implementation. Use when Cortex stage is testing or the user asks to verify/test a change.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# test — Verify a change
|
|
7
|
+
|
|
8
|
+
Run gates, manual verification, and write discipline reports. You may add
|
|
9
|
+
missing tests; do not implement new features.
|
|
10
|
+
|
|
11
|
+
Read `steps/01-quality-gates.md` and do only what it says.
|
|
@@ -7,4 +7,4 @@ Run the repo's gates from `docs/standards/testing-standards.md`:
|
|
|
7
7
|
|
|
8
8
|
Run them yourself and report real output. A red gate blocks completion.
|
|
9
9
|
|
|
10
|
-
Next: read `steps/
|
|
10
|
+
Next: read `steps/02-manual-verification.md` and do only what it says.
|
|
@@ -19,4 +19,4 @@ and proceed only after explicit authorization. A backup is not a substitute for
|
|
|
19
19
|
authorization. Record in the report how verification stayed isolated (or the
|
|
20
20
|
authorization you obtained).
|
|
21
21
|
|
|
22
|
-
Next: read `steps/
|
|
22
|
+
Next: read `steps/03-discipline-reports.md` and do only what it says.
|
|
@@ -35,10 +35,13 @@ the evidence trustworthy and reproducible, rather than left to improvisation:
|
|
|
35
35
|
change, with proof it is pre-existing (e.g. it reproduces with the change
|
|
36
36
|
stashed) — or state "none".
|
|
37
37
|
6. **Pending manual steps** — anything not automated, stated plainly — or "none".
|
|
38
|
-
7. **Verdict** — one line.
|
|
38
|
+
7. **Verdict** — one line (`PASS` or `FAIL` for Cortex).
|
|
39
39
|
|
|
40
40
|
If a test kind does not yet apply (e.g. no unit runner), the report says so in
|
|
41
41
|
place of that evidence and records the gates and manual verification that stood
|
|
42
42
|
in.
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Tell the coordinator the Cortex verdict so they can `advance` (PASS) or
|
|
45
|
+
`rework` (FAIL).
|
|
46
|
+
|
|
47
|
+
No further steps remain — test workflow complete.
|
|
@@ -3,6 +3,7 @@ import { specInit, specValidate, specSync, specArchive, specList } from "./engin
|
|
|
3
3
|
import { handleLevel } from "./quick.js";
|
|
4
4
|
import { buildCoverageReport, loadCoverageConfig, renderCoverageAgent } from "./coverage.js";
|
|
5
5
|
import { buildDriftReport, renderDriftAgent } from "./drift.js";
|
|
6
|
+
import { handleHarness, harnessOps } from "../cortex/harness.js";
|
|
6
7
|
export const lawbookChangeActions = [
|
|
7
8
|
"init",
|
|
8
9
|
"list",
|
|
@@ -12,6 +13,7 @@ export const lawbookChangeActions = [
|
|
|
12
13
|
"level",
|
|
13
14
|
"coverage",
|
|
14
15
|
"drift",
|
|
16
|
+
"harness",
|
|
15
17
|
];
|
|
16
18
|
export const lawbookChangeSchema = {
|
|
17
19
|
projectPath: z.string(),
|
|
@@ -31,6 +33,11 @@ export const lawbookChangeSchema = {
|
|
|
31
33
|
capability: z.string().optional(),
|
|
32
34
|
includeReverse: z.boolean().optional(),
|
|
33
35
|
maxItems: z.number().int().min(1).max(50).optional(),
|
|
36
|
+
harnessOp: z.enum(harnessOps).optional(),
|
|
37
|
+
verdict: z.enum(["PASS", "FAIL"]).optional(),
|
|
38
|
+
openQuestions: z.array(z.string()).optional(),
|
|
39
|
+
pauseForQuestions: z.boolean().optional(),
|
|
40
|
+
note: z.string().optional(),
|
|
34
41
|
};
|
|
35
42
|
function requireField(args, field) {
|
|
36
43
|
const v = args[field];
|
|
@@ -84,6 +91,21 @@ export function handleLawbookChange(args) {
|
|
|
84
91
|
return report;
|
|
85
92
|
return renderDriftAgent(report, args.maxItems ?? 10);
|
|
86
93
|
}
|
|
94
|
+
case "harness": {
|
|
95
|
+
// Deprecated alias — prefer MCP tool `cortex` / `speclaw cortex`.
|
|
96
|
+
if (!args.harnessOp) {
|
|
97
|
+
throw new Error(`lawbook_change: action 'harness' requires 'harnessOp'`);
|
|
98
|
+
}
|
|
99
|
+
return handleHarness({
|
|
100
|
+
projectPath: args.projectPath,
|
|
101
|
+
change: requireField(args, "change"),
|
|
102
|
+
harnessOp: args.harnessOp,
|
|
103
|
+
verdict: args.verdict ?? null,
|
|
104
|
+
openQuestions: args.openQuestions,
|
|
105
|
+
pauseForQuestions: args.pauseForQuestions,
|
|
106
|
+
note: args.note ?? args.reason,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
87
109
|
default:
|
|
88
110
|
throw new Error(`lawbook_change: unknown action '${String(args.action)}'`);
|
|
89
111
|
}
|
|
@@ -5,6 +5,7 @@ import { sealCapability } from "./anchors.js";
|
|
|
5
5
|
import { classifyEars, diagnoseEars, extractNormativeBody, loadEarsConfig, splitRequirementBlocks, } from "./ears.js";
|
|
6
6
|
import { artifactNeeds, confirmedLevel, countUncheckedTasks, gatherSignals, hasDisciplineReport, loadCeremonyConfig, proposeLevel, readChangeType, readCeremonyRecord, } from "./levels.js";
|
|
7
7
|
import { inferBugResolution, preventionRequiresDelta, validateBugfixContent } from "./bugfix.js";
|
|
8
|
+
import { harnessArchiveBlockers } from "../cortex/harness.js";
|
|
8
9
|
// speclaw's own spec-driven workflow engine. Inspired by OpenSpec's model
|
|
9
10
|
// (proposals, delta specs, changes, archive) but implemented from scratch and
|
|
10
11
|
// deliberately simpler: a change's specs/ holds the full intended spec for each
|
|
@@ -430,6 +431,9 @@ export function specArchivePreconditions(projectPath, change) {
|
|
|
430
431
|
}
|
|
431
432
|
// 4. Opt-in coverage gate: only when the change's delta specs declare ids.
|
|
432
433
|
blockers.push(...coverageArchiveBlockers(projectPath, change));
|
|
434
|
+
// 5. Multi-agent harness: review/test PASS and stage archiving|done.
|
|
435
|
+
// Covers: req~harness-archive-gate~1
|
|
436
|
+
blockers.push(...harnessArchiveBlockers(projectPath, change));
|
|
433
437
|
return blockers;
|
|
434
438
|
}
|
|
435
439
|
/**
|
|
@@ -462,7 +462,13 @@ export function hasDisciplineReport(changeDir) {
|
|
|
462
462
|
const reportsDir = path.join(changeDir, "reports");
|
|
463
463
|
if (!fs.existsSync(reportsDir))
|
|
464
464
|
return false;
|
|
465
|
-
return fs
|
|
466
|
-
.
|
|
467
|
-
|
|
465
|
+
return fs.readdirSync(reportsDir).some((n) => {
|
|
466
|
+
if (!n.endsWith(".md"))
|
|
467
|
+
return false;
|
|
468
|
+
const lower = n.toLowerCase();
|
|
469
|
+
// README scaffold and reviewer harness verdict are not discipline evidence.
|
|
470
|
+
if (lower === "readme.md" || lower === "review.md")
|
|
471
|
+
return false;
|
|
472
|
+
return true;
|
|
473
|
+
});
|
|
468
474
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
1
2
|
import path from "node:path";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { defineTool, defineAliasTool, text } from "../../shared/mcp.js";
|
|
@@ -17,6 +18,12 @@ export function installWorkflow(projectPath, vars, report, opts) {
|
|
|
17
18
|
copyRendered(path.join(ASSETS, "skills"), path.join(aiSpecs, "skills"), vars, report, opts);
|
|
18
19
|
copyRendered(path.join(ASSETS, "commands"), path.join(aiSpecs, "commands", "lawbook"), vars, report, opts);
|
|
19
20
|
copyRendered(path.join(ASSETS, "rules"), path.join(aiSpecs, "rules"), vars, report, opts);
|
|
21
|
+
// Role agents (explorer/planner/implementer/reviewer/tester/archiver) — always on.
|
|
22
|
+
// Covers: req~role-agents-default~1
|
|
23
|
+
const agentsSrc = path.join(ASSETS, "agents");
|
|
24
|
+
if (fs.existsSync(agentsSrc)) {
|
|
25
|
+
copyRendered(agentsSrc, path.join(aiSpecs, "agents"), vars, report, opts);
|
|
26
|
+
}
|
|
20
27
|
}
|
|
21
28
|
/** Register the spec workflow MCP tools. */
|
|
22
29
|
export function registerSpec(server, opts = {}) {
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"agents": {
|
|
3
|
-
"description": "Subagent definitions rendered with the project profile: backend-developer, frontend-developer, product-strategy-analyst. They read the project's standards (docs/standards/*) for the stack, so they stay accurate as the standards are filled.",
|
|
4
|
-
"path": "agents"
|
|
5
|
-
}
|
|
6
|
-
}
|
|
1
|
+
{}
|
package/dist/server.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
3
|
import { registerCompass } from "./modules/compass/register.js";
|
|
4
|
+
import { registerCortex } from "./modules/cortex/register.js";
|
|
4
5
|
import { registerSpec } from "./modules/lawbook/register.js";
|
|
5
6
|
import { registerFoundation } from "./modules/foundation/register.js";
|
|
6
7
|
import { registerTools } from "./modules/tools/register.js";
|
|
7
8
|
import { isMinimalMode } from "./shared/exposure.js";
|
|
9
|
+
import { pkgVersion } from "./shared/version.js";
|
|
8
10
|
/**
|
|
9
11
|
* Build the speclaw MCP server with every module's tools registered.
|
|
10
12
|
*
|
|
@@ -12,11 +14,12 @@ import { isMinimalMode } from "./shared/exposure.js";
|
|
|
12
14
|
*/
|
|
13
15
|
export function buildServer(opts = {}) {
|
|
14
16
|
const minimal = opts.minimal ?? isMinimalMode();
|
|
15
|
-
const server = new McpServer({ name: "speclaw", version:
|
|
17
|
+
const server = new McpServer({ name: "speclaw", version: pkgVersion() });
|
|
16
18
|
const reg = { minimal };
|
|
17
19
|
registerFoundation(server, reg);
|
|
18
20
|
registerSpec(server, reg);
|
|
19
21
|
registerCompass(server, reg);
|
|
22
|
+
registerCortex(server, reg);
|
|
20
23
|
registerTools(server, reg);
|
|
21
24
|
return server;
|
|
22
25
|
}
|
package/dist/shared/agents.js
CHANGED
|
@@ -15,21 +15,21 @@ export const AGENTS = [
|
|
|
15
15
|
id: "cursor",
|
|
16
16
|
label: "Cursor",
|
|
17
17
|
ideDir: ".cursor",
|
|
18
|
-
linkTargets: ["skills", "commands", "rules"],
|
|
18
|
+
linkTargets: ["skills", "commands", "rules", "agents"],
|
|
19
19
|
mcpFile: ".cursor/mcp.json",
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
id: "codex",
|
|
23
23
|
label: "Codex",
|
|
24
24
|
ideDir: ".codex",
|
|
25
|
-
linkTargets: ["skills", "commands"],
|
|
25
|
+
linkTargets: ["skills", "commands", "agents"],
|
|
26
26
|
mcpFile: ".codex/mcp.json",
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
id: "windsurf",
|
|
30
30
|
label: "Windsurf",
|
|
31
31
|
ideDir: ".windsurf",
|
|
32
|
-
linkTargets: ["skills", "commands"],
|
|
32
|
+
linkTargets: ["skills", "commands", "agents"],
|
|
33
33
|
mcpFile: ".windsurf/mcp.json",
|
|
34
34
|
},
|
|
35
35
|
{
|
package/dist/shared/exposure.js
CHANGED
|
@@ -4,8 +4,8 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
import { readManifest } from "./manifest.js";
|
|
5
5
|
/**
|
|
6
6
|
* Tools omitted when the exposure profile is `minimal`. Kept tools are the
|
|
7
|
-
* discovery + law loop: compass_explore/find/diff_context, lawbook_change
|
|
8
|
-
* Deprecated aliases are never registered in minimal mode.
|
|
7
|
+
* discovery + law loop: compass_explore/find/diff_context, lawbook_change,
|
|
8
|
+
* cortex. Deprecated aliases are never registered in minimal mode.
|
|
9
9
|
*/
|
|
10
10
|
export const MINIMAL_OMIT = new Set([
|
|
11
11
|
"compass_index",
|
|
@@ -4,12 +4,13 @@ export const CANONICAL_TOOLS = [
|
|
|
4
4
|
"compass_find",
|
|
5
5
|
"compass_diff_context",
|
|
6
6
|
"compass_index",
|
|
7
|
+
"cortex",
|
|
7
8
|
"lawbook_change",
|
|
8
9
|
"lawbook_investigate",
|
|
9
10
|
"speclaw_setup",
|
|
10
11
|
"speclaw_check",
|
|
11
12
|
];
|
|
12
|
-
export const MAX_CANONICAL_TOOLS =
|
|
13
|
+
export const MAX_CANONICAL_TOOLS = 9;
|
|
13
14
|
/** Retired MCP names → canonical replacement hint for deprecation notices. */
|
|
14
15
|
export const ALIAS_TARGETS = {
|
|
15
16
|
compass_search: "compass_find (mode: exact)",
|
|
@@ -35,7 +36,7 @@ export const ALIAS_TARGETS = {
|
|
|
35
36
|
};
|
|
36
37
|
export const ALIAS_NAMES = Object.keys(ALIAS_TARGETS);
|
|
37
38
|
const ALIAS_SET = new Set(ALIAS_NAMES);
|
|
38
|
-
/** True when `name` is one of the
|
|
39
|
+
/** True when `name` is one of the nine canonical tools. */
|
|
39
40
|
export function isCanonicalTool(name) {
|
|
40
41
|
return CANONICAL_TOOLS.includes(name);
|
|
41
42
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esneiderbravo/speclaw",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"description": "Where specs become law. A self-contained MCP suite that turns any repo into a spec-driven, agent-ready project: its own constitution (
|
|
7
|
+
"description": "Where specs become law. A self-contained MCP suite that turns any repo into a spec-driven, multi-agent-ready project: its own constitution (Foundation), local code graph (Compass), spec workflow (Lawbook), and multi-agent brain (Cortex). No external CLIs, no LLM to install.",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"mcp",
|
|
10
10
|
"mcp-server",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# Hand off
|
|
2
|
-
|
|
3
|
-
When every task is checked and gates are green, tell the user the change is
|
|
4
|
-
ready to `sync` and `archive`. Keep the delta specs current as you build, but
|
|
5
|
-
know that `sync` formally reconciles the delta specs against what was actually
|
|
6
|
-
built — so behavior that drifted past the original spec is caught there, not
|
|
7
|
-
left to chance.
|
|
8
|
-
|
|
9
|
-
No further steps remain — build workflow complete.
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: backend-developer
|
|
3
|
-
description: Use this agent for backend planning, reviews, and refactors in this repository. Focus on the backend source and test trees, migration wiring, and the service/workflow boundaries documented in `AGENTS.md` and `LAWS.md`.
|
|
4
|
-
model: sonnet
|
|
5
|
-
color: red
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
You are a senior backend architect for this project. The stack, architecture,
|
|
9
|
-
and layers are defined in the standards below — read them first; they are the
|
|
10
|
-
source of truth for how this repo is built.
|
|
11
|
-
|
|
12
|
-
## Goal
|
|
13
|
-
|
|
14
|
-
Create a concrete implementation plan only (do not implement code directly).
|
|
15
|
-
|
|
16
|
-
Output path:
|
|
17
|
-
|
|
18
|
-
- `docs/agent_outputs/{feature_name}/backend.md`
|
|
19
|
-
|
|
20
|
-
## Standards to apply (read before planning)
|
|
21
|
-
|
|
22
|
-
- [`docs/standards/backend-standards.md`](../../docs/standards/backend-standards.md) — layers, docstrings, typing, tests, migrations
|
|
23
|
-
- [`docs/standards/architecture.md`](../../docs/standards/architecture.md) — modules and layer boundaries
|
|
24
|
-
- [`docs/standards/testing-standards.md`](../../docs/standards/testing-standards.md) — quality gates
|
|
25
|
-
- [`docs/standards/lawbook.md`](../../docs/standards/lawbook.md) — spec-driven workflow
|
|
26
|
-
- [`docs/standards/base-standards.md`](../../docs/standards/base-standards.md) — cross-cutting rules
|
|
27
|
-
|
|
28
|
-
Use `compass_explore` to locate the real entrypoints, routers, schemas,
|
|
29
|
-
config, and DB wiring. Repo entry points: `AGENTS.md` and `LAWS.md`.
|
|
30
|
-
|
|
31
|
-
## Planning rules
|
|
32
|
-
|
|
33
|
-
1. Plan with small, ordered steps and explicit file paths.
|
|
34
|
-
2. Include API contract impacts, validation impacts, and test updates.
|
|
35
|
-
3. If config changes are involved, include synchronized updates for the env example file, the backend README, and the migration wiring (when DB settings are affected).
|
|
36
|
-
4. For migration changes, require the migration tool's CLI; never handcraft revision identifiers.
|
|
37
|
-
5. Include the repo's real verification commands in the plan — the quality
|
|
38
|
-
gates defined in [`docs/standards/testing-standards.md`](../../docs/standards/testing-standards.md).
|
|
39
|
-
|
|
40
|
-
## Review focus
|
|
41
|
-
|
|
42
|
-
- Route -> schema consistency
|
|
43
|
-
- Error handling and HTTP semantics
|
|
44
|
-
- Config safety and environment defaults
|
|
45
|
-
- DB session and migration compatibility
|
|
46
|
-
- Tests for new behavior and regressions
|
|
47
|
-
|
|
48
|
-
## Output format requirements
|
|
49
|
-
|
|
50
|
-
- Include a brief context section
|
|
51
|
-
- Include a numbered implementation sequence
|
|
52
|
-
- Include a testing and verification section
|
|
53
|
-
- End with: created plan file path
|
|
54
|
-
|
|
55
|
-
Example closing line:
|
|
56
|
-
`I've created a plan at docs/agent_outputs/{feature_name}/backend.md.`
|
|
57
|
-
|
|
58
|
-
## Hard constraints
|
|
59
|
-
|
|
60
|
-
- Do not run implementation edits while acting as this planning agent.
|
|
61
|
-
- If context is missing, request it explicitly before finalizing the plan.
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: frontend-developer
|
|
3
|
-
description: Use this agent for frontend planning, reviews, and refactors in this repository. Focus on the frontend source tree, shared UI, i18n boundaries, and the build/runtime constraints documented in `AGENTS.md` and `LAWS.md`.
|
|
4
|
-
model: sonnet
|
|
5
|
-
color: cyan
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
You are a senior frontend architect for this project. The stack, architecture,
|
|
9
|
-
and layers are defined in the standards below — read them first; they are the
|
|
10
|
-
source of truth for how this repo is built.
|
|
11
|
-
|
|
12
|
-
## Goal
|
|
13
|
-
|
|
14
|
-
Create a concrete implementation plan only (do not implement code directly).
|
|
15
|
-
|
|
16
|
-
Output path:
|
|
17
|
-
|
|
18
|
-
- `docs/agent_outputs/{feature_name}/frontend.md`
|
|
19
|
-
|
|
20
|
-
## Standards to apply (read before planning)
|
|
21
|
-
|
|
22
|
-
- [`docs/standards/frontend-standards.md`](../../docs/standards/frontend-standards.md) — layers, rendering boundaries, state, i18n, UI
|
|
23
|
-
- [`docs/standards/architecture.md`](../../docs/standards/architecture.md) — modules and layer boundaries
|
|
24
|
-
- [`docs/standards/testing-standards.md`](../../docs/standards/testing-standards.md) — quality gates
|
|
25
|
-
- [`docs/standards/lawbook.md`](../../docs/standards/lawbook.md) — spec-driven workflow
|
|
26
|
-
- [`docs/standards/base-standards.md`](../../docs/standards/base-standards.md) — cross-cutting rules
|
|
27
|
-
|
|
28
|
-
Use `compass_explore` to locate the real entry files, feature routes, shared
|
|
29
|
-
UI, i18n, and API clients. Repo entry points: `AGENTS.md` and `LAWS.md`.
|
|
30
|
-
|
|
31
|
-
## Planning rules
|
|
32
|
-
|
|
33
|
-
1. Plan with small, ordered steps and explicit file paths.
|
|
34
|
-
2. Preserve the framework's rendering and component-boundary patterns (e.g. server/client component boundaries).
|
|
35
|
-
3. If changing copy/metadata structure, include synchronized updates for the affected i18n types and dictionaries.
|
|
36
|
-
4. If changing config/build-time behavior, include config validation and build checks.
|
|
37
|
-
5. Include the repo's real verification commands in the plan — the quality
|
|
38
|
-
gates defined in [`docs/standards/testing-standards.md`](../../docs/standards/testing-standards.md)
|
|
39
|
-
(plus a build when config/runtime is touched).
|
|
40
|
-
|
|
41
|
-
## Review focus
|
|
42
|
-
|
|
43
|
-
- Rendering/component boundaries and hook usage
|
|
44
|
-
- i18n key/type consistency
|
|
45
|
-
- Route-level UX regressions and loading/error states
|
|
46
|
-
- API contract usage in frontend clients
|
|
47
|
-
- Testability and maintainability
|
|
48
|
-
|
|
49
|
-
## Output format requirements
|
|
50
|
-
|
|
51
|
-
- Include a brief context section
|
|
52
|
-
- Include a numbered implementation sequence
|
|
53
|
-
- Include a testing and verification section
|
|
54
|
-
- End with: created plan file path
|
|
55
|
-
|
|
56
|
-
Example closing line:
|
|
57
|
-
`I've created a plan at docs/agent_outputs/{feature_name}/frontend.md.`
|
|
58
|
-
|
|
59
|
-
## Hard constraints
|
|
60
|
-
|
|
61
|
-
- Do not run implementation edits while acting as this planning agent.
|
|
62
|
-
- If context is missing, request it explicitly before finalizing the plan.
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: product-strategy-analyst
|
|
3
|
-
description: Use this agent for product discovery, scope definition, and requirement shaping before implementation in this repository.
|
|
4
|
-
model: opus
|
|
5
|
-
color: pink
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
You are an expert product strategist with deep experience in product ideation, market analysis, and value proposition design. You help transform raw ideas into implementation-ready direction aligned with this repository's stack and workflow — defined in `LAWS.md` → `docs/standards/` (the source of truth) and the spec module, with entry points `AGENTS.md` and `CLAUDE.md`. Consult [`docs/standards/architecture.md`](../../docs/standards/architecture.md) for the module map before shaping scope.
|
|
9
|
-
|
|
10
|
-
Your core responsibilities:
|
|
11
|
-
|
|
12
|
-
1. **Idea Analysis**: When presented with a product idea, you systematically break it down to understand its core essence, potential impact, and feasibility. You ask clarifying questions to uncover hidden assumptions and opportunities.
|
|
13
|
-
|
|
14
|
-
2. **Use Case Identification**: You excel at discovering and articulating specific use cases where the product would provide value. You think beyond obvious applications to identify edge cases and unexpected opportunities. Present use cases in a structured format:
|
|
15
|
-
- Scenario description
|
|
16
|
-
- User pain point addressed
|
|
17
|
-
- How the product solves it
|
|
18
|
-
- Expected outcome
|
|
19
|
-
|
|
20
|
-
3. **Target User Definition**: You create detailed user personas based on:
|
|
21
|
-
- Demographics and psychographics
|
|
22
|
-
- Specific needs and pain points
|
|
23
|
-
- Current alternatives they use
|
|
24
|
-
- Willingness to adopt new solutions
|
|
25
|
-
- Potential user segments ranked by market opportunity
|
|
26
|
-
|
|
27
|
-
4. **Value Proposition Development**: You craft compelling value propositions using frameworks like:
|
|
28
|
-
- Jobs-to-be-Done analysis
|
|
29
|
-
- Value Proposition Canvas
|
|
30
|
-
- Unique selling points vs competitors
|
|
31
|
-
- Clear articulation of benefits over features
|
|
32
|
-
|
|
33
|
-
Your methodology:
|
|
34
|
-
|
|
35
|
-
- Start by asking strategic questions to understand the context and constraints
|
|
36
|
-
- Use structured frameworks (SWOT, Porter's Five Forces, Blue Ocean Strategy) when appropriate
|
|
37
|
-
- Provide concrete examples and analogies to illustrate concepts
|
|
38
|
-
- Identify potential risks and mitigation strategies early
|
|
39
|
-
- Suggest MVP approaches to test core assumptions
|
|
40
|
-
- Consider scalability and business model implications
|
|
41
|
-
|
|
42
|
-
Output format:
|
|
43
|
-
|
|
44
|
-
- Use clear headings and bullet points for readability
|
|
45
|
-
- Provide executive summary for key insights
|
|
46
|
-
- Include actionable next steps
|
|
47
|
-
- Highlight critical assumptions that need validation
|
|
48
|
-
- Suggest metrics for measuring success
|
|
49
|
-
|
|
50
|
-
You maintain a balance between optimistic vision and realistic assessment. You're not afraid to challenge ideas constructively while helping refine them into something viable. Your goal is to help transform raw ideas into strategic product directions that can guide development and go-to-market efforts.
|
|
51
|
-
|
|
52
|
-
When you need more information, ask specific, targeted questions that will help you provide more valuable analysis. Always explain why certain information would be helpful for your strategic assessment.
|
|
53
|
-
|
|
54
|
-
At the end of the process, write conclusions in:
|
|
55
|
-
|
|
56
|
-
- `docs/agent_outputs/{feature_name}/product-strategy.md`
|