ProjectGraphAgent is a Jsonnet-driven project control system for AI agents (Cursor, Gemini, Claude, Roo, Kilocode). It documents architecture, tracks drift, generates diagrams, groups commits, and produces agent-friendly artifacts.
- Declared vs Observed: Jsonnet "declared" model + adapters "observed" model → drift
- Outputs for agents: compiled graph JSON, drift report, Mermaid diagrams, plans markdown, snapshots and events
- Automation: grouped commits, AI command sync, CI workflow
- Node.js 18+
- Jsonnet CLI (
jsonnetin PATH)
- Copy the
ProjectGraphAgent/folder into your repository root - Ensure Jsonnet is installed (Linux:
apt install jsonnet, macOS:brew install jsonnet) - Customize
ProjectGraphAgent/project_graph.jsonnetwith your project details:{ projectName: 'your-project-name', projectUrl: 'https://github.com/your-username/your-project', description: 'Your project description here.', // ... rest of configuration } - (Optional) Add npm scripts in your
package.json:{ "scripts": { "graph:audit": "node ProjectGraphAgent/scripts/graph_generator.mjs", "graph:validate": "node ProjectGraphAgent/scripts/graph_validator.mjs", "graph:commit": "node ProjectGraphAgent/scripts/ai_committer.mjs", "sync:ai-commands": "node ProjectGraphAgent/scripts/sync_ai_commands.mjs" } } - Run the generator:
Artifacts:
node ProjectGraphAgent/scripts/graph_generator.mjs --keep-compiled
ProjectGraphAgent/.cache/graph.json(includes observed + drift)memory-bank/diagrams/graph.mmdmemory-bank/drift.mdmemory-bank/plans/(markdown per-domain + digest)
Add this job to .github/workflows/*.yml:
- name: Generate Graph
run: node ProjectGraphAgent/scripts/graph_generator.mjs --keep-compiled
- name: Validate Graph
run: node ProjectGraphAgent/scripts/graph_validator.mjs- Jsonnet graph:
ProjectGraphAgent/project_graph.jsonnetimportsgraph_parts/* - Observed graph: adapters (
adapters/typescript.mjs,adapters/python.mjs) - Drift: computed automatically; summarized in README and memory-bank
- Plans: defined in Jsonnet, emitted as markdown, tracked by agents
- Adapters are heuristic (basic import scans)
- Drift is entity-level; relation severity is TBD
- Policies are shape/schema-level; rule DSL coming later
Inherits the repository license (GPL-3.0-or-later by default).