@structured-vibe-coding/core 0.5.3 → 0.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/README.md
CHANGED
|
@@ -30,7 +30,7 @@ const change = await createChange({
|
|
|
30
30
|
await advanceStage(root, config, change.id);
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
See the [repository README](https://github.com/structured-vibe-coding/spec-driven-development) for workflows, customization, and CLI docs.
|
|
33
|
+
See the [docs hub](https://github.com/structured-vibe-coding/spec-driven-development/blob/main/docs/README.md) and [repository README](https://github.com/structured-vibe-coding/spec-driven-development) for workflows, customization, and CLI docs.
|
|
34
34
|
|
|
35
35
|
## License
|
|
36
36
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Documentation map
|
|
2
|
+
|
|
3
|
+
Parent page for **stable** project docs. Humans and coding agents: start here, then open only what you need.
|
|
4
|
+
|
|
5
|
+
| Kind | Where | Lifetime |
|
|
6
|
+
|------|--------|----------|
|
|
7
|
+
| **This map + memory** | `memory/*.md` | Long-lived |
|
|
8
|
+
| **Active change** | `changes/<id>/` (see `.sdd/active-context.md`) | Until complete |
|
|
9
|
+
| **Finished work** | `archive/<id>/` | History |
|
|
10
|
+
| **Optional domains** | `domains/` | Long-lived by area |
|
|
11
|
+
|
|
12
|
+
## Stable docs
|
|
13
|
+
|
|
14
|
+
| Topic | File |
|
|
15
|
+
|-------|------|
|
|
16
|
+
| Product / vision | [product.md](product.md) |
|
|
17
|
+
| Architecture | [architecture.md](architecture.md) |
|
|
18
|
+
| Coding & process conventions | [conventions.md](conventions.md) |
|
|
19
|
+
|
|
20
|
+
Add rows here when you introduce new durable docs (e.g. `security.md`, `ops.md`).
|
|
21
|
+
|
|
22
|
+
## Active work
|
|
23
|
+
|
|
24
|
+
1. Run `sdd status` (or open `.sdd/active-context.md`).
|
|
25
|
+
2. Read stage artifacts under the active change folder only.
|
|
26
|
+
3. Prefer small updates to change packs; **promote** lasting decisions into `memory/` after `sdd complete`.
|
|
27
|
+
|
|
28
|
+
## Ownership (suggested)
|
|
29
|
+
|
|
30
|
+
| Area | Owner |
|
|
31
|
+
|------|--------|
|
|
32
|
+
| `memory/*` | Tech lead / architect |
|
|
33
|
+
| Current `changes/<id>/` | Author of the change (PR owner) |
|
|
34
|
+
| `domains/<name>/` | Domain owner (if used) |
|
|
35
|
+
|
|
36
|
+
Keep this map short. Link out; do not paste large designs here.
|
|
@@ -594,6 +594,7 @@ async function buildAgentPrompt(ctx, config, projectRoot) {
|
|
|
594
594
|
parts.push("");
|
|
595
595
|
parts.push(`## Artifacts to read`);
|
|
596
596
|
const memoryHint = join3(projectRoot, config.memory_path);
|
|
597
|
+
parts.push(`- Documentation map (if present): ${memoryHint}/index.md`);
|
|
597
598
|
parts.push(`- Memory: ${memoryHint}/`);
|
|
598
599
|
for (const s of ctx.stages) {
|
|
599
600
|
for (const a of s.artifacts) {
|
|
@@ -638,6 +639,20 @@ var AGENT_INTEGRATIONS = [
|
|
|
638
639
|
installUrl: "https://docs.anthropic.com/en/docs/claude-code",
|
|
639
640
|
rolePath: (roleId) => `.claude/agents/${roleId}.md`,
|
|
640
641
|
agentsMdRow: "| Claude Code | `.claude/agents/` (`sdd`, `sdd-planner`, `sdd-implementer`, `sdd-reviewer`) |"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
id: "grok",
|
|
645
|
+
key: "grok",
|
|
646
|
+
aliases: ["grok-build", "grokbuild", "xai", "xai-grok"],
|
|
647
|
+
label: "Grok Build",
|
|
648
|
+
hint: ".grok/rules/sdd.md + AGENTS.md (terminal TUI from xAI)",
|
|
649
|
+
requiresCli: false,
|
|
650
|
+
cliBinary: "grok",
|
|
651
|
+
installUrl: "https://docs.x.ai",
|
|
652
|
+
// Single rules file: Grok auto-loads all .grok/rules/*.md
|
|
653
|
+
rolePath: () => `.grok/rules/sdd.md`,
|
|
654
|
+
rolesToInstall: ["sdd"],
|
|
655
|
+
agentsMdRow: "| Grok Build | `.grok/rules/sdd.md` + `AGENTS.md` (reads protocol + active-context; run `sdd` in shell) |"
|
|
641
656
|
}
|
|
642
657
|
];
|
|
643
658
|
var ALL_AGENT_TARGETS = AGENT_INTEGRATIONS.map((i) => i.id);
|
|
@@ -680,7 +695,7 @@ function parseIntegration(raw) {
|
|
|
680
695
|
}
|
|
681
696
|
if (IDE_NAMES.has(p)) {
|
|
682
697
|
throw new Error(
|
|
683
|
-
`"${p}" is an IDE, not an AI coding agent. Choose:
|
|
698
|
+
`"${p}" is an IDE, not an AI coding agent. Choose: ${AGENT_INTEGRATIONS.map((i) => i.key).join(", ")}.`
|
|
684
699
|
);
|
|
685
700
|
}
|
|
686
701
|
for (const integ of AGENT_INTEGRATIONS) {
|
|
@@ -760,7 +775,8 @@ async function installAgentIntegration(opts) {
|
|
|
760
775
|
};
|
|
761
776
|
await write(join4(".sdd", "protocol.md"), PROTOCOL_MD);
|
|
762
777
|
await refreshActiveAgentContext(root);
|
|
763
|
-
|
|
778
|
+
const roles = integ.rolesToInstall?.length ? SDD_AGENT_ROLES.filter((r) => integ.rolesToInstall.includes(r.id)) : SDD_AGENT_ROLES;
|
|
779
|
+
for (const role of roles) {
|
|
764
780
|
await write(integ.rolePath(role.id), renderThinAgent(role));
|
|
765
781
|
}
|
|
766
782
|
await write("AGENTS.md", renderAgentsMd(integ));
|
|
@@ -885,7 +901,7 @@ This repo uses **Structured Vibe Coding** (\`sdd\`). Agents must follow this fil
|
|
|
885
901
|
|------|--------|
|
|
886
902
|
| Process state | \`changes/<id>/meta.yaml\` (workflow, stage, gates) |
|
|
887
903
|
| Current task snapshot | \`.sdd/active-context.md\` |
|
|
888
|
-
| Stable product/tech rules | \`memory/*.md\` |
|
|
904
|
+
| Stable product/tech rules | \`memory/*.md\` (start at \`memory/index.md\` if present) |
|
|
889
905
|
| Stage artifacts | files in \`changes/<id>/\` for the active change |
|
|
890
906
|
|
|
891
907
|
## Required read order
|
|
@@ -893,7 +909,7 @@ This repo uses **Structured Vibe Coding** (\`sdd\`). Agents must follow this fil
|
|
|
893
909
|
1. \`.sdd/active-context.md\`
|
|
894
910
|
2. This file (\`.sdd/protocol.md\`)
|
|
895
911
|
3. \`meta.yaml\` + artifacts for the **current stage** (and prior stages if needed)
|
|
896
|
-
4. \`memory
|
|
912
|
+
4. \`memory/index.md\` (documentation map) if present, then linked memory pages when architecture or conventions matter
|
|
897
913
|
|
|
898
914
|
## Stage behavior
|
|
899
915
|
|
|
@@ -941,6 +957,7 @@ AI coding agents are **not** the same as IDEs: VS Code, Cursor, and IntelliJ hos
|
|
|
941
957
|
|------------|--|
|
|
942
958
|
| Live task | \`.sdd/active-context.md\` |
|
|
943
959
|
| Playbook | \`.sdd/protocol.md\` |
|
|
960
|
+
| Doc map (stable) | \`memory/index.md\` if present |
|
|
944
961
|
|
|
945
962
|
| AI agent | Files |
|
|
946
963
|
|----------|--------|
|
package/dist/index.d.ts
CHANGED
|
@@ -1161,9 +1161,9 @@ declare function completeChange(projectRoot: string, config: Config, changeId: s
|
|
|
1161
1161
|
|
|
1162
1162
|
/**
|
|
1163
1163
|
* AI coding agents (not IDEs).
|
|
1164
|
-
* Speckit-style: one integration at a time; public keys
|
|
1164
|
+
* Speckit-style: one integration at a time; public keys: `copilot` | `claude` | `grok`.
|
|
1165
1165
|
*/
|
|
1166
|
-
type AgentTarget = "copilot" | "claude-code";
|
|
1166
|
+
type AgentTarget = "copilot" | "claude-code" | "grok";
|
|
1167
1167
|
/** Registry entry — add a new AI agent by appending here only. */
|
|
1168
1168
|
interface AgentIntegration {
|
|
1169
1169
|
id: AgentTarget;
|
|
@@ -1178,6 +1178,12 @@ interface AgentIntegration {
|
|
|
1178
1178
|
cliBinary?: string;
|
|
1179
1179
|
/** Relative path for a thin role agent file. */
|
|
1180
1180
|
rolePath: (roleId: string) => string;
|
|
1181
|
+
/**
|
|
1182
|
+
* Which thin roles to install. Default: all SDD_AGENT_ROLES.
|
|
1183
|
+
* Grok loads every `*.md` under `.grok/rules/`, so only install the router
|
|
1184
|
+
* role there to avoid conflicting planner/implementer instructions.
|
|
1185
|
+
*/
|
|
1186
|
+
rolesToInstall?: SddAgentRoleId[];
|
|
1181
1187
|
/** One markdown table row for AGENTS.md. */
|
|
1182
1188
|
agentsMdRow: string;
|
|
1183
1189
|
}
|
|
@@ -1245,7 +1251,7 @@ declare function renderThinAgent(role: SddAgentRole): string;
|
|
|
1245
1251
|
/** Write .sdd/active-context.md for the current change. */
|
|
1246
1252
|
declare function refreshActiveAgentContext(projectRoot: string): Promise<string | null>;
|
|
1247
1253
|
/** Single playbook — only long agent-facing content we author once. */
|
|
1248
|
-
declare const PROTOCOL_MD = "# SDD protocol\n\nThis repo uses **Structured Vibe Coding** (`sdd`). Agents must follow this file plus `.sdd/active-context.md`. Do not invent a parallel process.\n\n## Source of truth\n\n| What | Where |\n|------|--------|\n| Process state | `changes/<id>/meta.yaml` (workflow, stage, gates) |\n| Current task snapshot | `.sdd/active-context.md` |\n| Stable product/tech rules | `memory/*.md` |\n| Stage artifacts | files in `changes/<id>/` for the active change |\n\n## Required read order\n\n1. `.sdd/active-context.md`\n2. This file (`.sdd/protocol.md`)\n3. `meta.yaml` + artifacts for the **current stage** (and prior stages if needed)\n4. `memory
|
|
1254
|
+
declare const PROTOCOL_MD = "# SDD protocol\n\nThis repo uses **Structured Vibe Coding** (`sdd`). Agents must follow this file plus `.sdd/active-context.md`. Do not invent a parallel process.\n\n## Source of truth\n\n| What | Where |\n|------|--------|\n| Process state | `changes/<id>/meta.yaml` (workflow, stage, gates) |\n| Current task snapshot | `.sdd/active-context.md` |\n| Stable product/tech rules | `memory/*.md` (start at `memory/index.md` if present) |\n| Stage artifacts | files in `changes/<id>/` for the active change |\n\n## Required read order\n\n1. `.sdd/active-context.md`\n2. This file (`.sdd/protocol.md`)\n3. `meta.yaml` + artifacts for the **current stage** (and prior stages if needed)\n4. `memory/index.md` (documentation map) if present, then linked memory pages when architecture or conventions matter\n\n## Stage behavior\n\n| Stage kind | Agent focus |\n|------------|-------------|\n| intent / feature / stories | Clarify scope; write short artifacts |\n| design / lld / db / research / hl_arb | Specs and decisions; minimal product code |\n| tasks | Break work into implementable checklist |\n| implement | Code only for this change; follow tasks/acceptance |\n| local_verify | Check acceptance; fix only; prepare for complete |\n\n## Hard rules\n\n1. **Do not skip hard gates.** If blocked, tell the human to run `sdd gate approve` (or fix the gate).\n2. **Stay in scope** of the active change title/intent. No drive-by refactors or new features.\n3. **Honor constraints** in `arb-decision.md`, design, and memory non-negotiables.\n4. **Local verify** is part of done when the workflow has a verify stage: `sdd verify`.\n5. Prefer small, reviewable diffs.\n\n## Commands (human / shell)\n\n```bash\nsdd status\nsdd next\nsdd agent # print handoff\nsdd agents refresh # refresh active-context.md\nsdd verify\nsdd complete\n```\n\n## Out of scope for agents\n\n- Replacing CI/CD or team process tools\n- Deleting `.sdd` / archive history\n- Claiming complete without verify when required\n";
|
|
1249
1255
|
|
|
1250
1256
|
interface InitOptions {
|
|
1251
1257
|
projectRoot: string;
|
package/dist/index.js
CHANGED
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
workflowsDir,
|
|
74
74
|
writeText,
|
|
75
75
|
writeYaml
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-QTHYRKMK.js";
|
|
77
77
|
|
|
78
78
|
// src/change.ts
|
|
79
79
|
import { join as join2 } from "pathe";
|
|
@@ -185,7 +185,7 @@ async function createChange(input) {
|
|
|
185
185
|
await materializeStageArtifacts(projectRoot, config, id, workflow, meta, firstStage);
|
|
186
186
|
await setActiveChange(projectRoot, config, id);
|
|
187
187
|
try {
|
|
188
|
-
const { refreshActiveAgentContext: refreshActiveAgentContext2 } = await import("./agents-
|
|
188
|
+
const { refreshActiveAgentContext: refreshActiveAgentContext2 } = await import("./agents-O5ABMQJQ.js");
|
|
189
189
|
await refreshActiveAgentContext2(projectRoot);
|
|
190
190
|
} catch {
|
|
191
191
|
}
|
|
@@ -281,7 +281,7 @@ async function advanceStage(projectRoot, config, changeId, opts) {
|
|
|
281
281
|
stage
|
|
282
282
|
);
|
|
283
283
|
try {
|
|
284
|
-
const { refreshActiveAgentContext: refreshActiveAgentContext2 } = await import("./agents-
|
|
284
|
+
const { refreshActiveAgentContext: refreshActiveAgentContext2 } = await import("./agents-O5ABMQJQ.js");
|
|
285
285
|
await refreshActiveAgentContext2(projectRoot);
|
|
286
286
|
} catch {
|
|
287
287
|
}
|
|
@@ -478,6 +478,21 @@ async function initProject(opts) {
|
|
|
478
478
|
if (await pathExists(mSrc)) {
|
|
479
479
|
await copyDir(mSrc, mDest);
|
|
480
480
|
} else {
|
|
481
|
+
await writeText(
|
|
482
|
+
join4(mDest, "index.md"),
|
|
483
|
+
`# Documentation map
|
|
484
|
+
|
|
485
|
+
Parent page for **stable** project docs. Start here, then open only what you need.
|
|
486
|
+
|
|
487
|
+
| Topic | File |
|
|
488
|
+
|-------|------|
|
|
489
|
+
| Product | [product.md](product.md) |
|
|
490
|
+
| Architecture | [architecture.md](architecture.md) |
|
|
491
|
+
| Conventions | [conventions.md](conventions.md) |
|
|
492
|
+
|
|
493
|
+
Active work: \`.sdd/active-context.md\` and \`changes/<id>/\`.
|
|
494
|
+
`
|
|
495
|
+
);
|
|
481
496
|
await writeText(
|
|
482
497
|
join4(mDest, "product.md"),
|
|
483
498
|
"# Product\n\n<!-- What are you building? -->\n"
|
|
@@ -512,9 +527,13 @@ This directory configures local Spec-Driven Development for this repo.
|
|
|
512
527
|
- \`config.yaml\` \u2014 project settings and per-change policy
|
|
513
528
|
- \`workflows/\` \u2014 YAML workflow packs (customize freely)
|
|
514
529
|
- \`templates/\` \u2014 markdown templates for stage artifacts
|
|
530
|
+
- \`protocol.md\` / \`active-context.md\` \u2014 agent playbook + live task (after agent install)
|
|
515
531
|
|
|
516
532
|
Work lives in \`../changes/\` and completed work in \`../archive/\`.
|
|
517
533
|
|
|
534
|
+
**Documentation map (stable):** \`../memory/index.md\`
|
|
535
|
+
**Change-scoped docs:** \`../changes/<id>/\`
|
|
536
|
+
|
|
518
537
|
## Quick commands
|
|
519
538
|
|
|
520
539
|
\`\`\`bash
|