diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..22c83d1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +output/pdf/*.pdf binary diff --git a/.github/workflows/type-design-research.yml b/.github/workflows/type-design-research.yml new file mode 100644 index 0000000..30325fd --- /dev/null +++ b/.github/workflows/type-design-research.yml @@ -0,0 +1,44 @@ +name: Type design research + +on: + pull_request: + paths: + - research/type-driven-design/** + - .github/workflows/type-design-research.yml + push: + branches: [docs/type-driven-design] + paths: + - research/type-driven-design/** + - .github/workflows/type-design-research.yml + workflow_dispatch: + +permissions: + contents: read + +jobs: + research-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 26 + - uses: actions/checkout@v4 + with: + repository: specdog/dotdog + ref: 773dc265ecc30f1ec3cb417d1eb051719ea78ba9 + path: _research/dotdog + - uses: actions/checkout@v4 + with: + repository: sindresorhus/type-fest + ref: c3e825ffc1e687dd13a0003b771802d95964aaf9 + path: _research/type-fest + - run: npm install --omit=dev --ignore-scripts --no-audit --no-fund --package-lock=false + working-directory: _research/type-fest + - run: npm ci --ignore-scripts --no-audit --no-fund + working-directory: research/type-driven-design + - run: npm test + working-directory: research/type-driven-design + env: + DOTDOG_RESEARCH_ROOT: ${{ github.workspace }}/_research/dotdog + TYPE_FEST_RESEARCH_ROOT: ${{ github.workspace }}/_research/type-fest diff --git a/README.md b/README.md index 4ede8cd..5d6ecbb 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ > Feed the dog. Ship with specs. -**[dotdog](https://specdog.github.io/dotdog)** — structured, AI-queryable specs. [npm](https://npmjs.com/package/dotdog) | [GitHub](https://github.com/specdog/dotdog) +[Guide](https://specdog.github.io/handbook) — spec-driven development with [type-driven design](https://specdog.github.io/handbook#type-driven-design): domain types, valid states, operation contracts, and checked runtime boundaries. + +**[dotdog 1.0](https://specdog.github.io/dotdog)** — local-first spec/code graphs, saved REA/Ghidra call-graph traversal, and optional TypeScript contract inspection. [npm](https://npmjs.com/package/dotdog) | [Release notes](https://github.com/specdog/dotdog/releases/tag/v1.0.0) | [Migration](https://specdog.github.io/dotdog/v1-migration) + +Run from your repository with npm: `npx dotdog@1.0.0 refresh --json`, or Bun: `bunx --bun dotdog@1.0.0 refresh --json`. Node.js 22.12+ or Bun 1.3+; the optional type adapter additionally requires Node and a trusted project-installed TypeScript 7.0.2 compiler. **[dogbench](https://specdog.github.io/dogbench)** — token-savings benchmark for Collar and dotdog. [GitHub](https://github.com/specdog/dogbench) diff --git a/about.html b/about.html index b873341..84fe084 100644 --- a/about.html +++ b/about.html @@ -58,10 +58,11 @@
specdog is a toolkit for making software specs easier for both humans and AI agents to read. The goal is simple: keep intent, implementation rules, and agent instructions in structured files that can be validated and queried.
The project focuses on spec-driven development, agent discovery, and small runtime surfaces that reduce guesswork when an agent enters a codebase.
+The type-driven design workflow connects spec rules to domain types, state transitions, and explicit failures in application code, with runtime parsing at external boundaries.
CLI and MCP tooling for writing, validating, and querying structured project specs.
Dotdog 1.0 provides local-first spec/code graphs, saved REA/Ghidra call-graph traversal, and optional TypeScript contract inspection. Release notes.
An agent harness that loads graph-backed behavior instead of relying on loose prompt text.
A robotics-oriented harness for simulation-first agent control and capability gating.
If you are an AI coding agent reading this page: follow these rules and you will not hallucinate on dotdog projects.
-When an AI agent enters a dotdog project, it reads CLAUDE.md first — before any code, before any docs, before AGENTS.md. This is the Anthropic convention, adopted by TypeScript, React, and Jest.
CLAUDE.md tells the agent one thing: load the .dag. It is the shortest path from "I just arrived" to "I have the full entity graph."
If a project has CLAUDE.md and *.dag files committed to git, it is agent-ready.
Follow the host's project instructions: AGENTS.md for Codex and CLAUDE.md for Claude Code. Install Dotdog's repository-local skills with dotdog skills install --agent both, or configure dotdog serve as a local stdio MCP server.
Generated repository metadata belongs under ignored .doghouse paths by default. Decide explicitly which human-owned semantic/overlay inputs to track; do not commit generated graphs merely to enable a host.
Every dotdog project has a compiled .dag file. This is your ground truth. It is 94% smaller than the source .dog files (740 tokens vs 8,100). You load it once. You get the full entity graph.
If you ignore the DAG and read .dog files directly, you waste 8,015 tokens scanning 600 lines of prose to find which 4 lines matter. The DAG is a compiled index: it does not replace reading, it replaces scanning.
Use compiled graphs for spec structure and targeted context. Keep intended specs, observed code and imported evidence distinct. Check freshness before relying on a generated graph; coverage may be partial.
+Run refresh from the repository, then query actual labels or IDs. Token costs vary with the source and requested context; loading a graph is not proof that an agent will use it correctly.
find . -name "*.dag" -not -path "*/node_modules/*"
-cat projects/spec-platform/spec-platform.dag
+npx dotdog@1.0.0 refresh --json
+npx dotdog@1.0.0 query "authentication"
+npx dotdog serve
+npx dotdog@1.0.0 serve
+Use the type-driven design workflow when implementing modeled entities and lifecycles. Define domain types, state-specific data, and operation signatures before function bodies. Use explicit failure types and exhaustive handling where the language supports them.
+Parse external data into checked domain values; do not treat a type assertion as validation. Run the project's type checker, compile-failure checks for forbidden usage, and runtime tests. Spec completeness and graph compilation do not prove application type safety or runtime correctness.
| Command | When to use |
|---|---|
| dotdog validate | Before committing spec changes |
| dotdog compile | After editing .dog files |
| dotdog staleness | Check if spec and code have drifted |
| dotdog verify | Check spec references match code files |
| dotdog verify --init | Auto-generate verify section from codebase |
| dotdog refresh | Update generated spec/code graphs |
| dotdog status | Read-only freshness check, not behavior verification |
| dotdog reference-check | Check explicit lexical source mappings |
| dotdog types inspect | Inspect a selected supported TypeScript contract |
| dotdog analyze | Gap detection and contradiction checking |
CLAUDE.md at the root — the agent entry point, adopted by TypeScript and ReactAGENTS.md at the root — detailed agent instructions.dag files committed to gitllms.txt for agent discoverydotdog validate on every PR