dotdog 0.3.5 → 0.4.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
@@ -1,76 +1,130 @@
1
- # spec-platform
1
+ # dotdog
2
2
 
3
- Monorepo for the Spec Platform — a knowledge graph system where specs ARE the database and LLMs ARE the query engine.
3
+ [![npm version](https://img.shields.io/npm/v/dotdog)](https://www.npmjs.com/package/dotdog)
4
+ [![npm downloads](https://img.shields.io/npm/dm/dotdog)](https://www.npmjs.com/package/dotdog)
5
+ [![License: MIT](https://img.shields.io/npm/l/dotdog)](https://github.com/specdog/dotdog/blob/main/LICENSE)
6
+ [![CI](https://github.com/specdog/dotdog/actions/workflows/test.yml/badge.svg)](https://github.com/specdog/dotdog/actions)
4
7
 
5
- ## The Flywheel
8
+ > **Feed the dog. Ship with specs.** Write .dog specs. Dog checks them. AI agents fetch them.
6
9
 
7
- ```
8
- spec → validate → app → data → better spec → better app → ...
10
+ ## Install
11
+
12
+ ```bash
13
+ npm install -g dotdog
9
14
  ```
10
15
 
11
- The spec describes the platform. The platform validates the spec. The validation report improves the spec. Each cycle adds granularity.
16
+ Requires Node.js >= 20.
12
17
 
13
- ## Structure
18
+ ## Quick Start
14
19
 
20
+ ```bash
21
+ dotdog init my-project # scaffold a spec genome
22
+ dotdog validate # score completeness (0-100%)
23
+ dotdog analyze # deep analysis : gaps, suggestions, entity audit
15
24
  ```
16
- spec-platform/
17
- ├── packages/
18
- │ ├── spec-engine/ # Core types and ontology (shared by everything)
19
- │ ├── spec-mcp/ # MCP Server — AI agents query specs via stdio
20
- │ └── spec-cli/ # CLI — spec validate, init, simulate, list
21
- ├── projects/ # Spec genomes (dogfooding)
22
- │ └── spec-platform/
23
- │ └── specs/
24
- │ ├── SPEC.dog # Product spec screens, flows, stories
25
- │ ├── constitution.dog # Immutable rules
26
- │ └── data-model.dog # Graph ontology nodes, edges, tasks, predictions, vectors
27
- ├── templates/ # Spec genome templates for new projects
28
- └── package.json # Bun workspace root
25
+
26
+ ## Commands
27
+
28
+ | Command | Description |
29
+ |---------|-------------|
30
+ | `dotdog validate [dir]` | Score spec completeness. Checks file existence, entity descriptions, section counts. |
31
+ | `dotdog analyze [dir]` | Deep analysis. Detects domain, stack, gaps with severity, entity quality audit. |
32
+ | `dotdog parse <file>` | Parse a `.dog` file into sections. |
33
+ | `dotdog compile [dir]` | Compile `.dog` files into a `.dag` graph (JSON). |
34
+ | `dotdog visualize [dir]` | Output Mermaid graph from `.dag`. `--save` writes `.md` for GitHub rendering. |
35
+ | `dotdog serve [dir]` | Start MCP server over stdio. AI agents query specs without hallucination. |
36
+ | `dotdog staleness [dir]` | Detect drift between spec and reality. Compares plan.dog tasks against code. |
37
+ | `dotdog generate [dir]` | Generate missing spec files from SPEC.dog (data-model, COPY, INDEX). |
38
+ | `dotdog simulate <scenario>` | Run a simulation scenario. Reads SPEC.dog scenarios, checks pre/postconditions. |
39
+ | `dotdog init <project>` | Scaffold a new spec genome project with templates. |
40
+ | `dotdog list` | List all projects and their `.dog` file counts. |
41
+
42
+ ## File Formats
43
+
44
+ ### `.dog` : Human-Written Spec Genome
45
+
46
+ Markdown prose + YAML structured blocks. Free and open source. Define entities, relationships, events, predictions, and copy in a single format that both humans and parsers understand.
47
+
48
+ ```markdown
49
+ ### Entity: User
50
+
51
+ A person who uses the app.
52
+
53
+ ` ``yaml
54
+ entity: User
55
+ type: entity
56
+ properties:
57
+ id:
58
+ type: string
59
+ required: true
60
+ email:
61
+ type: string
62
+ required: true
63
+ states: [active, suspended]
64
+ lifecycle: active → suspended
65
+ ` ``
29
66
  ```
30
67
 
31
- ## Quick Start
68
+ ### `.dag` : Machine-Compiled Graph
32
69
 
33
- ```bash
34
- bun install
35
- cd projects/spec-platform/specs
70
+ JSON graph compiled from `.dog` files. Nodes, edges, properties, and states in a deterministic structure. 85% token savings vs raw `.dog` files for AI agents.
36
71
 
37
- # Validate our own spec (dogfood)
38
- bun ../../../packages/spec-cli/src/index.ts validate ../..
72
+ ## MCP Server : AI Agent Integration
39
73
 
40
- # List projects
41
- bun ../../../packages/spec-cli/src/index.ts list
42
- ```
74
+ `dotdog serve` exposes specs to any MCP-compatible AI agent over stdio. Six tools:
43
75
 
44
- ## $0 Stack
76
+ | Tool | Description |
77
+ |------|-------------|
78
+ | `getEntity` | Exact entity with properties, states, lifecycle, and connected edges |
79
+ | `traverse` | BFS subgraph from any starting node to any depth |
80
+ | `search` | Find entities by name or type |
81
+ | `schema` | Property definitions only : zero prose, agent-optimized |
82
+ | `summary` | Node count, edge count, file count, compile time |
83
+ | `listProjects` | Array of project names |
45
84
 
46
- | Component | Technology | Cost |
47
- |-----------|-----------|------|
48
- | Runtime | Bun | $0 |
49
- | Database | bun:sqlite (embedded) | $0 |
50
- | Types | TypeScript (strict) | $0 |
51
- | CLI | Commander.js + chalk | $0 |
52
- | MCP Server | @modelcontextprotocol/sdk (stdio) | $0 |
53
- | Embeddings | all-MiniLM-L6-v2 (local) | $0 |
54
- | Hosting | None needed (local-first) | $0 |
85
+ Agent workflow: `listProjects` `getEntity` `traverse` graph.
55
86
 
56
- ## The Spec Graph
87
+ ## Dogfood
57
88
 
58
- The spec is not a document. It's a knowledge graph.
89
+ dotdog validates its own specs. Every PR:
90
+
91
+ ```
92
+ dotdog validate → find gaps → fix spec → PR → merge → tag → CI publish
93
+ ```
59
94
 
60
- - **Nodes**: entities, tasks, predictions, screens, constraints, user stories
61
- - **Edges**: contains, depends_on, implements, references, calls, precedes
62
- - **Vectors**: every section embedded for semantic search, contradiction detection, staleness checks
63
- - **Predictions**: forecasts with triggers, timeframes, confidence, and actual outcome tracking
95
+ Eat your own dogfood. The tool is the project.
64
96
 
65
- LLMs traverse the graph at query time. They don't read prose and guess — they get exact typed values.
97
+ ## VS Code Extension
66
98
 
67
- ## Score
99
+ Syntax highlighting for `.dog` files. Install:
68
100
 
101
+ ```bash
102
+ cp -r extensions/vscode ~/.vscode/extensions/dotdog
69
103
  ```
70
- spec validate → 43% complete
71
104
 
72
- SPEC.dog
73
- ✓ constitution.dog
74
- data-model.dog
75
- COPY.dog, DESIGN-SYSTEM.dog, plan.dog, INDEX.dog
105
+ ## Format Specifications
106
+
107
+ - [`.dog` format spec](spec/format-spec.dog) : language definition, EBNF grammar, validation rules
108
+ - [`.dag` format spec](spec/format-spec-dag.dog) : graph definition, MCP API, token efficiency
109
+
110
+ ## Links
111
+
112
+ - **GitHub:** [specdog/dotdog](https://github.com/specdog/dotdog)
113
+ - **npm:** [dotdog](https://www.npmjs.com/package/dotdog)
114
+ - **Docs:** [GitHub Pages](https://specdog.github.io/dotdog)
115
+ - **llms.txt:** [llms.txt](llms.txt) : structured for AI agent discovery
116
+ - **AGENTS.md:** [AGENTS.md](AGENTS.md) : instructions for AI coding agents
117
+
118
+ ## Spec-Driven Development
119
+
120
+ dotdog is built for SDD. Write your spec first. Validate it. Compile it. Let AI agents query it. The spec is the source of truth.
121
+
122
+ ```
123
+ spec → validate → compile → serve → AI agent queries
76
124
  ```
125
+
126
+ No more specs that rot in a wiki. No more agents guessing from prose. One source. Zero ambiguity.
127
+
128
+ ## License
129
+
130
+ MIT