@simway/spica 0.0.2 → 0.0.3

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/dist/cli.js CHANGED
@@ -7,7 +7,7 @@ import { projectKiroSpec } from "./kiroSpecProjector.js";
7
7
  import { projectOpenApi3Spec } from "./openApiProjector.js";
8
8
  import { projectDomainAggregateMap, projectSystemContextDiagram } from "./diagramProjector.js";
9
9
  import { CLAUDE_CODE_TEMPLATE, CODEX_TEMPLATE, VSCODE_SETTINGS_TEMPLATE, } from "./initTemplates.js";
10
- const VERSION = "0.0.2";
10
+ const VERSION = "0.0.3";
11
11
  function printHelp() {
12
12
  console.log(`
13
13
  Spica CLI 🌟 v${VERSION}
@@ -107,7 +107,7 @@ export function parseDddCrewMarkdown(markdown) {
107
107
  createdAt = new Date().toISOString();
108
108
  }
109
109
  if (!specVersion) {
110
- specVersion = "0.1.0";
110
+ specVersion = "0.0.0";
111
111
  }
112
112
  // Parse System Actors & External Systems from headerLines
113
113
  const headerTables = extractMarkdownTables(headerLines);
@@ -65,7 +65,7 @@ export function projectDddCrewMarkdown(model) {
65
65
  if (model.systemDescription) {
66
66
  lines.push(`- **System Description:** ${model.systemDescription}`);
67
67
  }
68
- lines.push(`- **Spec Version:** ${model.specVersion ?? "0.1.0"}`);
68
+ lines.push(`- **Spec Version:** ${model.specVersion ?? "0.0.0"}`);
69
69
  if (model.author) {
70
70
  lines.push(`- **Author:** ${model.author}`);
71
71
  }
@@ -4,7 +4,7 @@
4
4
  * Inlining these templates directly in TypeScript makes `@simway/spica` 100% self-contained,
5
5
  * eliminating runtime disk lookups, candidate path resolution, and filesystem copy dependencies.
6
6
  */
7
- export declare const CLAUDE_CODE_TEMPLATE = "# Spica Architecture & Spec-Driven Development (SDD) Guide for Claude Code\n\nWhen the user asks to plan a new feature, design state machines or entity lifecycles, establish API contracts, or refactor complex business logic:\n\n**Open ADM Root Envelope (scaffold this first):**\nEvery Open ADM document opens with a root envelope carrying spec metadata. Headless agents must include these fields or validation rejects the document:\n - specVersion \u2014 Open ADM document standard version (default \"0.1.0\").\n - author \u2014 optional attribution for who authored the ADM.\n - createdAt \u2014 ISO-8601 UTC creation timestamp (e.g. 2026-11-10T07:00:00Z).\n - domainName \u2014 the domain identifier.\n\n Minimal skeleton:\n\n {\n \"specVersion\": \"0.1.0\",\n \"author\": \"your-name\",\n \"createdAt\": \"2026-11-10T07:00:00Z\",\n \"domainName\": \"MyDomain\",\n \"aggregates\": []\n }\n\n0. **Bootstrap the Workspace (if needed):**\n - If the repository lacks Spica tooling (`CLAUDE.md`, `CODEX.md`, `.vscode/settings.json`), run:\n ```bash\n npx -y @simway/spica init\n ```\n - For durable team tooling, offer `npm i -D @simway/spica` (or `pnpm add -D @simway/spica`).\n - Always invoke the CLI zero-prompt with `npx -y @simway/spica ...` in headless/agent subshells.\n\n1. **Follow the Spica SDD Protocol:**\n - Elicit Actors, External Systems, Aggregate Roots, State Lifecycles, and Commands.\n - Model state transitions explicitly: commands declare `requiredState` and `targetState`.\n - Reference the canonical schema: `\"$schema\": \"https://spica.simway.io/schema/adm.json\"`.\n\n2. **Validate Before Implementing:**\n - Save the model as `<feature>.adm.json`.\n - Run the zero-install validator:\n ```bash\n npx -y @simway/spica validate <feature>.adm.json\n ```\n - If invariant violations are reported, resolve them before generating code or specs.\n\n3. **Project Turnkey Specs:**\n - To project AWS Kiro IDE specs:\n ```bash\n npx -y @simway/spica project-kiro <feature>.adm.json -o .kiro/specs/<feature>\n ```\n - To project OpenAPI 3.0 contracts:\n ```bash\n npx -y @simway/spica project-openapi <feature>.adm.json -o openapi.json\n ```\n - To generate a 1-click live visual preview link for the human:\n ```bash\n npx -y @simway/spica share <feature>.adm.json\n ```\n\n4. **Deliverables:**\n - Report the validation status, link to the generated `.kiro/specs/` files, and provide the `https://spica.simway.io/#spec=...` live diagram URL to the user.\n";
8
- export declare const CODEX_TEMPLATE = "# Spica Architecture & Spec-Driven Development (SDD) Guide for OpenAI Codex\n\nWhen the user asks to plan a new feature, design state machines or entity lifecycles, establish API contracts, or implement business logic against a Spica Open ADM model:\n\n**Open ADM Root Envelope (scaffold this first):**\nEvery Open ADM document opens with a root envelope carrying spec metadata. Headless agents must include these fields or validation rejects the document:\n - specVersion \u2014 Open ADM document standard version (default \"0.1.0\").\n - author \u2014 optional attribution for who authored the ADM.\n - createdAt \u2014 ISO-8601 UTC creation timestamp (e.g. 2026-11-10T07:00:00Z).\n - domainName \u2014 the domain identifier.\n\n Minimal skeleton:\n\n {\n \"specVersion\": \"0.1.0\",\n \"author\": \"your-name\",\n \"createdAt\": \"2026-11-10T07:00:00Z\",\n \"domainName\": \"MyDomain\",\n \"aggregates\": []\n }\n\n0. **Bootstrap the Workspace (if needed):**\n - If the repository lacks Spica tooling (`CLAUDE.md`, `CODEX.md`, `.vscode/settings.json`), run:\n ```bash\n npx -y @simway/spica init\n ```\n - For durable team tooling, offer `npm i -D @simway/spica` (or `pnpm add -D @simway/spica`).\n - Always invoke the CLI zero-prompt with `npx -y @simway/spica ...` in headless/agent subshells.\n\n1. **Follow the Spica SDD Protocol:**\n - Elicit Actors, External Systems, Aggregate Roots, State Lifecycles, and Commands.\n - Model state transitions explicitly: commands declare `requiredState` and `targetState`.\n - Reference the canonical schema: `\"$schema\": \"https://spica.simway.io/schema/adm.json\"`.\n\n2. **Validate Before Implementing:**\n - Save the model as `<feature>.adm.json`.\n - Run the zero-install validator:\n ```bash\n npx -y @simway/spica validate <feature>.adm.json\n ```\n - If invariant violations are reported, resolve them before writing any code.\n\n3. **Project Turnkey Specs for Test-Driven Implementation:**\n - Project AWS Kiro IDE specs (requirements + design + traceable task checklist):\n ```bash\n npx -y @simway/spica project-kiro <feature>.adm.json -o .kiro/specs/<feature>\n ```\n - Project the OpenAPI 3.0 contract for API-level tests:\n ```bash\n npx -y @simway/spica project-openapi <feature>.adm.json -o openapi.json\n ```\n\n4. **Implement with TDD Against Projected Invariants:**\n - Write a failing test first for every command handler, asserting its state-transition pre-condition (`requiredState`) and post-condition (`targetState`).\n - Respect the projected invariants: a command MUST NOT be accepted from a state other than `requiredState`, and MUST transition the aggregate to exactly `targetState`.\n - Treat `.kiro/specs/` and `openapi.json` as the source of truth for contracts; re-project them whenever the model changes.\n\n5. **Deliverables:**\n - Report the validation status, the generated spec paths, and your test results.\n - Provide the 1-click live preview URL for the human:\n ```bash\n npx -y @simway/spica share <feature>.adm.json\n ```\n";
7
+ export declare const CLAUDE_CODE_TEMPLATE = "# Spica Architecture & Spec-Driven Development (SDD) Guide for Claude Code\n\nWhen the user asks to plan a new feature, design state machines or entity lifecycles, establish API contracts, or refactor complex business logic:\n\n**Open ADM Root Envelope (scaffold this first):**\nEvery Open ADM document opens with a root envelope carrying spec metadata. Headless agents must include these fields or validation rejects the document:\n - specVersion \u2014 Open ADM document standard version (default \"0.0.0\").\n - author \u2014 optional attribution for who authored the ADM.\n - createdAt \u2014 ISO-8601 UTC creation timestamp (e.g. 2026-11-10T07:00:00Z).\n - domainName \u2014 the domain identifier.\n\n Minimal skeleton:\n\n {\n \"specVersion\": \"0.0.0\",\n \"author\": \"your-name\",\n \"createdAt\": \"2026-11-10T07:00:00Z\",\n \"domainName\": \"MyDomain\",\n \"aggregates\": []\n }\n\n0. **Bootstrap the Workspace (if needed):**\n - If the repository lacks Spica tooling (`CLAUDE.md`, `CODEX.md`, `.vscode/settings.json`), run:\n ```bash\n npx -y @simway/spica init\n ```\n - For durable team tooling, offer `npm i -D @simway/spica` (or `pnpm add -D @simway/spica`).\n - Always invoke the CLI zero-prompt with `npx -y @simway/spica ...` in headless/agent subshells.\n\n1. **Follow the Spica SDD Protocol:**\n - Elicit Actors, External Systems, Aggregate Roots, State Lifecycles, and Commands.\n - Model state transitions explicitly: commands declare `requiredState` and `targetState`.\n - Reference the canonical schema: `\"$schema\": \"https://spica.simway.io/schema/adm.json\"`.\n\n2. **Validate Before Implementing:**\n - Save the model as `<feature>.adm.json`.\n - Run the zero-install validator:\n ```bash\n npx -y @simway/spica validate <feature>.adm.json\n ```\n - If invariant violations are reported, resolve them before generating code or specs.\n\n3. **Project Turnkey Specs:**\n - To project AWS Kiro IDE specs:\n ```bash\n npx -y @simway/spica project-kiro <feature>.adm.json -o .kiro/specs/<feature>\n ```\n - To project OpenAPI 3.0 contracts:\n ```bash\n npx -y @simway/spica project-openapi <feature>.adm.json -o openapi.json\n ```\n - To generate a 1-click live visual preview link for the human:\n ```bash\n npx -y @simway/spica share <feature>.adm.json\n ```\n\n4. **Deliverables:**\n - Report the validation status, link to the generated `.kiro/specs/` files, and provide the `https://spica.simway.io/#spec=...` live diagram URL to the user.\n";
8
+ export declare const CODEX_TEMPLATE = "# Spica Architecture & Spec-Driven Development (SDD) Guide for OpenAI Codex\n\nWhen the user asks to plan a new feature, design state machines or entity lifecycles, establish API contracts, or implement business logic against a Spica Open ADM model:\n\n**Open ADM Root Envelope (scaffold this first):**\nEvery Open ADM document opens with a root envelope carrying spec metadata. Headless agents must include these fields or validation rejects the document:\n - specVersion \u2014 Open ADM document standard version (default \"0.0.0\").\n - author \u2014 optional attribution for who authored the ADM.\n - createdAt \u2014 ISO-8601 UTC creation timestamp (e.g. 2026-11-10T07:00:00Z).\n - domainName \u2014 the domain identifier.\n\n Minimal skeleton:\n\n {\n \"specVersion\": \"0.0.0\",\n \"author\": \"your-name\",\n \"createdAt\": \"2026-11-10T07:00:00Z\",\n \"domainName\": \"MyDomain\",\n \"aggregates\": []\n }\n\n0. **Bootstrap the Workspace (if needed):**\n - If the repository lacks Spica tooling (`CLAUDE.md`, `CODEX.md`, `.vscode/settings.json`), run:\n ```bash\n npx -y @simway/spica init\n ```\n - For durable team tooling, offer `npm i -D @simway/spica` (or `pnpm add -D @simway/spica`).\n - Always invoke the CLI zero-prompt with `npx -y @simway/spica ...` in headless/agent subshells.\n\n1. **Follow the Spica SDD Protocol:**\n - Elicit Actors, External Systems, Aggregate Roots, State Lifecycles, and Commands.\n - Model state transitions explicitly: commands declare `requiredState` and `targetState`.\n - Reference the canonical schema: `\"$schema\": \"https://spica.simway.io/schema/adm.json\"`.\n\n2. **Validate Before Implementing:**\n - Save the model as `<feature>.adm.json`.\n - Run the zero-install validator:\n ```bash\n npx -y @simway/spica validate <feature>.adm.json\n ```\n - If invariant violations are reported, resolve them before writing any code.\n\n3. **Project Turnkey Specs for Test-Driven Implementation:**\n - Project AWS Kiro IDE specs (requirements + design + traceable task checklist):\n ```bash\n npx -y @simway/spica project-kiro <feature>.adm.json -o .kiro/specs/<feature>\n ```\n - Project the OpenAPI 3.0 contract for API-level tests:\n ```bash\n npx -y @simway/spica project-openapi <feature>.adm.json -o openapi.json\n ```\n\n4. **Implement with TDD Against Projected Invariants:**\n - Write a failing test first for every command handler, asserting its state-transition pre-condition (`requiredState`) and post-condition (`targetState`).\n - Respect the projected invariants: a command MUST NOT be accepted from a state other than `requiredState`, and MUST transition the aggregate to exactly `targetState`.\n - Treat `.kiro/specs/` and `openapi.json` as the source of truth for contracts; re-project them whenever the model changes.\n\n5. **Deliverables:**\n - Report the validation status, the generated spec paths, and your test results.\n - Provide the 1-click live preview URL for the human:\n ```bash\n npx -y @simway/spica share <feature>.adm.json\n ```\n";
9
9
  export declare const VSCODE_SETTINGS_TEMPLATE = "{\n \"$schema\": \"vscode://schemas/settings/workspace\",\n \"json.schemas\": [\n {\n \"fileMatch\": [\"*.adm.json\"],\n \"url\": \"https://spica.simway.io/schema/adm.json\"\n }\n ]\n}\n";
10
10
  //# sourceMappingURL=initTemplates.d.ts.map
@@ -10,7 +10,7 @@ When the user asks to plan a new feature, design state machines or entity lifecy
10
10
 
11
11
  **Open ADM Root Envelope (scaffold this first):**
12
12
  Every Open ADM document opens with a root envelope carrying spec metadata. Headless agents must include these fields or validation rejects the document:
13
- - specVersion — Open ADM document standard version (default "0.1.0").
13
+ - specVersion — Open ADM document standard version (default "0.0.0").
14
14
  - author — optional attribution for who authored the ADM.
15
15
  - createdAt — ISO-8601 UTC creation timestamp (e.g. 2026-11-10T07:00:00Z).
16
16
  - domainName — the domain identifier.
@@ -18,7 +18,7 @@ Every Open ADM document opens with a root envelope carrying spec metadata. Headl
18
18
  Minimal skeleton:
19
19
 
20
20
  {
21
- "specVersion": "0.1.0",
21
+ "specVersion": "0.0.0",
22
22
  "author": "your-name",
23
23
  "createdAt": "2026-11-10T07:00:00Z",
24
24
  "domainName": "MyDomain",
@@ -69,7 +69,7 @@ When the user asks to plan a new feature, design state machines or entity lifecy
69
69
 
70
70
  **Open ADM Root Envelope (scaffold this first):**
71
71
  Every Open ADM document opens with a root envelope carrying spec metadata. Headless agents must include these fields or validation rejects the document:
72
- - specVersion — Open ADM document standard version (default "0.1.0").
72
+ - specVersion — Open ADM document standard version (default "0.0.0").
73
73
  - author — optional attribution for who authored the ADM.
74
74
  - createdAt — ISO-8601 UTC creation timestamp (e.g. 2026-11-10T07:00:00Z).
75
75
  - domainName — the domain identifier.
@@ -77,7 +77,7 @@ Every Open ADM document opens with a root envelope carrying spec metadata. Headl
77
77
  Minimal skeleton:
78
78
 
79
79
  {
80
- "specVersion": "0.1.0",
80
+ "specVersion": "0.0.0",
81
81
  "author": "your-name",
82
82
  "createdAt": "2026-11-10T07:00:00Z",
83
83
  "domainName": "MyDomain",
@@ -179,7 +179,7 @@ export function projectOpenApi3Spec(model) {
179
179
  openapi: "3.0.3",
180
180
  info: {
181
181
  title: model.systemName || model.domainName,
182
- version: model.specVersion ?? "0.1.0",
182
+ version: model.specVersion ?? "0.0.0",
183
183
  description: model.systemDescription || `API specification for ${model.domainName} domain.`
184
184
  },
185
185
  paths,
package/dist/schema.js CHANGED
@@ -199,9 +199,9 @@ export const AstRootSchema = z.preprocess(resolveLegacyDomain, z.object({
199
199
  actors: z.array(ActorNodeSchema).optional(),
200
200
  externalSystems: z.array(ExternalSystemNodeSchema).optional(),
201
201
  // #1: the Open ADM document standard is versioned by `specVersion`
202
- // (defaulting to "0.1.0") and attributed by the optional `author`. The
202
+ // (defaulting to "0.0.0") and attributed by the optional `author`. The
203
203
  // creation timestamp `createdAt` (ISO-8601 UTC) remains mandatory.
204
- specVersion: z.string().default("0.1.0"),
204
+ specVersion: z.string().default("0.0.0"),
205
205
  author: z.string().optional(),
206
206
  createdAt: z.iso.datetime("createdAt must be an ISO-8601 UTC timestamp (e.g. 2026-10-19T09:24:17Z)"),
207
207
  roles: z.array(RoleNodeSchema).optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simway/spica",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Canonical TypeScript/Zod Open ADM schema, invariant validator, multi-lens specification and diagram projectors, and DDD Crew markdown parser for Spica",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",