{
  "markdown": "# GraphSpec\n\n**GraphSpec** is a CLI and library for spec-driven development: author software specs as a\nknowledge graph, then build software by traversing it.\n\nA spec is an [Open Knowledge Format v0.1](https://okf.md/spec) bundle, a directory of markdown\nfiles with YAML frontmatter cross-linked by typed relations. Because the spec is a graph\nrather than a document, you can pull just the subgraph for the work in front of you, and find\nout mechanically which requirements nothing implements or tests.\n\n**Documentation: [graphspec.dev](https://graphspec.dev)**\n\nThe npm package is [`graph-spec-cli`](https://www.npmjs.com/package/graph-spec-cli). The\ncommand it installs is `graphspec`.\n\n## Quickstart\n\nWith a coding agent, install the two agent skills:\n\n```bash\nnpx skills add brandonburrus/graphspec\n```\n\nThen ask for what you want: \"spec out the checkout flow as a GraphSpec\", or \"implement the\nnext component from the spec\".\n\nOr use the CLI directly, with no install:\n\n```bash\nnpx graph-spec-cli validate spec/ --strict\nnpx graph-spec-cli coverage spec/\nnpx graph-spec-cli graph spec/ --from architecture/validator.component --depth 1\nnpx graph-spec-cli visualize spec/ --open\n```\n\nRequires Node.js 20 or newer.\n\n## What a concept looks like\n\nEach file is one concept. Its filename carries its type, and its frontmatter declares typed\nedges to other concepts.\n\n```yaml\n# specification/checkout.feature.md\n---\ntype: Feature\ntitle: Checkout\nrelations:\n  includes:\n    - /specification/payment.requirement.md\n    - /specification/tax.requirement.md\n---\n\n# Summary\n\nTake payment for a cart and issue a receipt.\n```\n\nThe vocabulary is closed: 13 node types and 16 relations. See the\n[profile reference](https://graphspec.dev/profile/node-types/).\n\n## Commands\n\n| Command | Question it answers |\n| --- | --- |\n| `validate` | Is this bundle well formed? |\n| `query` | Which concepts match these filters? |\n| `index` | Regenerate the directory listings and log |\n| `graph` | What is connected to this concept? |\n| `coverage` | What has the spec not said yet? |\n| `order` | What should be built first? |\n| `visualize` | What does the whole graph look like? |\n\nFull flags, output shapes, and exit codes: [graphspec.dev/cli/overview](https://graphspec.dev/cli/overview/).\n\n## Library\n\n```bash\nnpm install graph-spec-cli\n```\n\n```ts\nimport { loadBundle, Graph, analyzeCoverage } from \"graph-spec-cli\";\n\nconst graph = Graph.fromBundle(await loadBundle(\"spec\"));\nconsole.log(analyzeCoverage(graph).totalGaps);\n```\n\nESM only. Full surface: [graphspec.dev/library/api](https://graphspec.dev/library/api/).\n\n## Example bundle\n\n[`spec/`](spec/) is GraphSpec specified in GraphSpec, and doubles as the test fixture. It\nstays clean:\n\n```bash\nnpx graph-spec-cli validate spec/ --strict   # 27 concept(s), 0 error(s), 0 warning(s)\nnpx graph-spec-cli coverage spec/            # 0 gap(s)\n```\n\n## Development\n\n```bash\npnpm install\npnpm build       # tsc into dist/\npnpm test        # vitest\npnpm lint        # biome check\npnpm typecheck   # tsc --noEmit\n\npnpm --filter graphspec-docs dev     # docs site at localhost:4321\n```\n\nSee [AGENTS.md](AGENTS.md) for architecture and constraints.\n\n## License\n\nMIT, see [LICENSE](LICENSE).\n",
  "bytes": 3210,
  "sha": "2ce32d3b93054bf4b9c95265d7c75487aa6ba5718b5ecb8d2622405c87df8462",
  "repo_slug": "brandonburrus/graphspec",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/okf_brandonburrus_graphspec_spec_index_md_80e70319/readme"
}