@codified/cli 0.4.7 → 0.5.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 +125 -51
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,26 +1,15 @@
|
|
|
1
1
|
# Codify
|
|
2
2
|
|
|
3
|
-
**Living
|
|
3
|
+
**Living Context Graph for AI-Native Teams**
|
|
4
4
|
|
|
5
|
-
Codify mines your project history into a structured graph
|
|
5
|
+
Codify mines your project history into a structured context graph -- decisions, features, customer signals, code artifacts, and their relationships. Claude Code gets ambient access to that context via MCP, so your AI assistant understands not just what your code does but *why* it was built that way.
|
|
6
6
|
|
|
7
|
-
A built-in Gap Engine proactively detects missing context, stale assumptions, and untested decisions.
|
|
7
|
+
A built-in Gap Engine proactively detects missing context, stale assumptions, and untested decisions. An Autonomous Collection service fills those gaps by mining existing data and reaching out to team members. A Metabolism service continuously maintains graph health through freshness decay, semantic dedup, contradiction resolution, and structural evolution.
|
|
8
8
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
- Node.js 22+
|
|
12
|
-
- Docker (for PostgreSQL, NATS, Redis)
|
|
13
|
-
- `ANTHROPIC_API_KEY` environment variable (for bootstrap, explain, and collect commands)
|
|
14
|
-
|
|
15
|
-
## Install
|
|
9
|
+
## Quick Start
|
|
16
10
|
|
|
17
11
|
```bash
|
|
18
12
|
npm install -g @codified/cli
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Quickstart
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
13
|
cd your-project
|
|
25
14
|
codify up
|
|
26
15
|
```
|
|
@@ -31,80 +20,165 @@ codify up
|
|
|
31
20
|
2. **bootstrap** -- Mines your git history with Claude, extracting decisions, features, and relationships into the context graph.
|
|
32
21
|
3. **start** -- Launches the MCP server on stdio. Claude Code connects automatically.
|
|
33
22
|
|
|
34
|
-
After this, open Claude Code in your project. It now has full context about your codebase.
|
|
23
|
+
After this, open Claude Code in your project. It now has full context about your codebase -- 23 tools and 4 resources at its disposal.
|
|
24
|
+
|
|
25
|
+
## What Claude Code Gets
|
|
26
|
+
|
|
27
|
+
Codify auto-installs its MCP server config during `codify init`. Claude Code connects automatically -- no manual configuration required.
|
|
28
|
+
|
|
29
|
+
### MCP Tools (23)
|
|
30
|
+
|
|
31
|
+
#### Search and Navigate
|
|
32
|
+
|
|
33
|
+
| Tool | Description |
|
|
34
|
+
|------|-------------|
|
|
35
|
+
| `codify_get_context` | Get the full context surrounding a topic -- decisions, signals, gaps, relationships |
|
|
36
|
+
| `codify_search` | Search the graph using natural language (hybrid keyword + semantic) |
|
|
37
|
+
| `codify_traverse` | Walk the graph from any node following typed edges |
|
|
38
|
+
| `codify_get_decision_trail` | Trace the reasoning chain behind a decision |
|
|
39
|
+
| `codify_explain` | Claude-powered narrative synthesis from graph data |
|
|
40
|
+
| `codify_get_context_package` | Get a synthesized context briefing for a topic |
|
|
41
|
+
|
|
42
|
+
#### Gap Engine
|
|
43
|
+
|
|
44
|
+
| Tool | Description |
|
|
45
|
+
|------|-------------|
|
|
46
|
+
| `codify_get_gaps` | List detected context gaps with priority sorting |
|
|
47
|
+
| `codify_resolve_gap` | Mark a gap as resolved with evidence |
|
|
48
|
+
|
|
49
|
+
#### Collection
|
|
50
|
+
|
|
51
|
+
| Tool | Description |
|
|
52
|
+
|------|-------------|
|
|
53
|
+
| `codify_collect` | Mine evidence for open gaps from the existing graph |
|
|
54
|
+
| `codify_get_collection_plans` | View active collection plans and their status |
|
|
55
|
+
| `codify_get_collection_metrics` | Collection pipeline analytics -- response rates, fill time |
|
|
56
|
+
|
|
57
|
+
#### Metabolism and Evolution
|
|
58
|
+
|
|
59
|
+
| Tool | Description |
|
|
60
|
+
|------|-------------|
|
|
61
|
+
| `codify_get_metabolism_audit` | View the metabolism audit trail -- decay, prune, promote events |
|
|
62
|
+
| `codify_get_evolution_proposals` | View pending structural evolution proposals (type splits) |
|
|
63
|
+
| `codify_execute_evolution` | Execute an approved evolution proposal |
|
|
64
|
+
|
|
65
|
+
#### Context and Decision Support
|
|
66
|
+
|
|
67
|
+
| Tool | Description |
|
|
68
|
+
|------|-------------|
|
|
69
|
+
| `codify_decision_context` | Assemble a decision brief -- prior decisions, evidence, contradictions, risks |
|
|
70
|
+
| `codify_add_context` | Add new context nodes to the graph |
|
|
71
|
+
| `codify_status` | Graph health and statistics |
|
|
72
|
+
| `codify_bootstrap` | Trigger a bootstrap from within Claude Code |
|
|
73
|
+
| `codify_get_digest` | Daily context digest -- graph growth, gaps, metabolism activity |
|
|
74
|
+
| `codify_subscribe_events` | Configure proactive context push notification filters |
|
|
35
75
|
|
|
36
|
-
|
|
76
|
+
#### Branch Management
|
|
37
77
|
|
|
38
|
-
|
|
78
|
+
| Tool | Description |
|
|
79
|
+
|------|-------------|
|
|
80
|
+
| `codify_create_branch` | Create an exploration branch of the graph |
|
|
81
|
+
| `codify_merge_branch` | Merge a branch back into the main graph |
|
|
82
|
+
| `codify_list_branches` | List active graph branches |
|
|
83
|
+
|
|
84
|
+
### MCP Resources (4)
|
|
85
|
+
|
|
86
|
+
| Resource | Description |
|
|
87
|
+
|----------|-------------|
|
|
88
|
+
| `codify://schema` | The context graph schema -- node types, edge types, relationships |
|
|
89
|
+
| `codify://quickstart` | Quick start guide for using Codify tools |
|
|
90
|
+
| `codify://context/{topic}` | Dynamic context package for any topic (resource template) |
|
|
91
|
+
| `codify://gaps/active` | Current active gap summary -- count, top 5, clusters |
|
|
92
|
+
|
|
93
|
+
## CLI Commands (30)
|
|
94
|
+
|
|
95
|
+
### Setup
|
|
39
96
|
|
|
40
97
|
| Command | Description |
|
|
41
98
|
|---------|-------------|
|
|
42
99
|
| `codify up` | One-command setup and start (init + bootstrap + start) |
|
|
43
|
-
| `codify init` | Set up
|
|
100
|
+
| `codify init` | Set up Docker services, run migrations, install MCP config |
|
|
44
101
|
| `codify bootstrap` | Mine git history into the context graph |
|
|
45
102
|
| `codify start` | Start the MCP server for Claude Code |
|
|
103
|
+
| `codify project` | Manage multiple projects (create, list, switch) |
|
|
46
104
|
|
|
47
|
-
###
|
|
105
|
+
### Graph Operations
|
|
48
106
|
|
|
49
107
|
| Command | Description |
|
|
50
108
|
|---------|-------------|
|
|
109
|
+
| `codify search <query>` | Search the context graph (keyword + semantic) |
|
|
51
110
|
| `codify explain <question>` | Ask Claude a question about your project |
|
|
52
|
-
| `codify
|
|
111
|
+
| `codify briefing <topic>` | Get a synthesized context briefing on a topic |
|
|
112
|
+
| `codify decide <question>` | Assemble decision-point context (evidence, gaps, risks) |
|
|
53
113
|
| `codify add` | Record a decision, signal, or other context |
|
|
54
114
|
| `codify graph` | Visualize the context graph (Mermaid diagram) |
|
|
55
|
-
| `codify status` | Show project health dashboard |
|
|
56
115
|
|
|
57
|
-
###
|
|
116
|
+
### Gap Management
|
|
58
117
|
|
|
59
118
|
| Command | Description |
|
|
60
119
|
|---------|-------------|
|
|
120
|
+
| `codify status` | Show project health dashboard |
|
|
61
121
|
| `codify gaps` | Show gaps detected by the Gap Engine |
|
|
62
|
-
| `codify triage` | Interactively resolve gaps |
|
|
122
|
+
| `codify triage` | Interactively resolve gaps (with [c]ollect) |
|
|
63
123
|
| `codify collect` | Mine the graph for evidence to fill gaps |
|
|
64
|
-
| `codify check <file>` | Check files for related context (CI-ready) |
|
|
124
|
+
| `codify check <file>` | Check files for related context (CI-ready, exit code 1 on critical gaps) |
|
|
125
|
+
| `codify evolve` | Manage structural evolution proposals |
|
|
126
|
+
|
|
127
|
+
### Connectors
|
|
128
|
+
|
|
129
|
+
| Command | Description |
|
|
130
|
+
|---------|-------------|
|
|
131
|
+
| `codify connect` | Connect external data sources (Slack, GitHub, Linear, Notion, docs) |
|
|
132
|
+
| `codify connectors` | List all connectors with health status |
|
|
65
133
|
|
|
66
|
-
###
|
|
134
|
+
### Analytics
|
|
67
135
|
|
|
68
136
|
| Command | Description |
|
|
69
137
|
|---------|-------------|
|
|
70
|
-
| `codify
|
|
138
|
+
| `codify digest` | Daily context digest -- graph growth, gaps, metabolism |
|
|
139
|
+
| `codify metrics` | Collection pipeline analytics (response rates, fill time) |
|
|
140
|
+
|
|
141
|
+
### Maintenance
|
|
142
|
+
|
|
143
|
+
| Command | Description |
|
|
144
|
+
|---------|-------------|
|
|
145
|
+
| `codify audit` | Show metabolism audit trail (decay, prune, promote events) |
|
|
146
|
+
| `codify refresh-freshness` | Recalculate freshness scores for all nodes |
|
|
71
147
|
| `codify timeline` | Show what changed in the graph over time |
|
|
72
|
-
| `codify
|
|
148
|
+
| `codify cleanup` | Fix legacy data quality issues (gap descriptions, node titles) |
|
|
149
|
+
| `codify export` | Backup the graph to a JSON file |
|
|
73
150
|
| `codify import` | Restore the graph from a JSON backup |
|
|
74
|
-
| `codify watch` | Start continuous ingest polling |
|
|
75
|
-
| `codify
|
|
151
|
+
| `codify watch` | Start continuous ingest polling with heartbeat |
|
|
152
|
+
| `codify embed` | Backfill embeddings for semantic search |
|
|
76
153
|
| `codify reset` | Reset the context graph (drop all data) |
|
|
77
154
|
|
|
78
155
|
Run `codify <command> --help` for detailed options on any command.
|
|
79
156
|
|
|
80
|
-
##
|
|
157
|
+
## Architecture
|
|
81
158
|
|
|
82
|
-
Codify
|
|
159
|
+
Codify uses PostgreSQL as its single storage engine:
|
|
83
160
|
|
|
84
|
-
|
|
161
|
+
- **Apache AGE** for graph traversal (nodes, edges, typed relationships)
|
|
162
|
+
- **pgvector** for semantic search (Voyage AI embeddings, hybrid keyword + vector ranking)
|
|
163
|
+
- **NATS JetStream** for event-driven gap detection, collection, and metabolism
|
|
164
|
+
- **Redis** for caching
|
|
85
165
|
|
|
86
|
-
|
|
87
|
-
- **codify_search** -- Search the graph by keyword
|
|
88
|
-
- **codify_explain** -- Claude-powered narrative synthesis from graph data
|
|
89
|
-
- **codify_get_gaps** -- List detected context gaps
|
|
90
|
-
- **codify_resolve_gap** -- Mark a gap as resolved with evidence
|
|
91
|
-
- **codify_add_context** -- Add new context nodes to the graph
|
|
92
|
-
- **codify_get_decision_trail** -- Trace the reasoning chain behind a decision
|
|
93
|
-
- **codify_traverse** -- Walk the graph from any node
|
|
94
|
-
- **codify_status** -- Graph health and statistics
|
|
95
|
-
- **codify_collect** -- Mine evidence for open gaps
|
|
96
|
-
- **codify_get_context_package** -- Get a bundled context snapshot for a topic
|
|
166
|
+
The context graph stores nodes (Decision, Feature, CustomerSignal, CodeArtifact, Gap, Metric, Discussion, Person, Study) and typed edges representing their relationships. Five subsystems run continuously:
|
|
97
167
|
|
|
98
|
-
|
|
168
|
+
1. **Gap Engine** -- 7 proactive scan patterns detect missing context, stale assumptions, weak evidence, contradictions, orphan nodes, cross-functional blind spots, and assumption drift. Gaps auto-resolve when sufficient evidence arrives.
|
|
169
|
+
2. **Autonomous Collection** -- Mines the existing graph and connected data sources for evidence that addresses detected gaps. Sends Slack DMs to team members for tribal knowledge. Structures collected data into typed graph nodes via Claude.
|
|
170
|
+
3. **Metabolism** -- Freshness decay, semantic dedup gating, pruning of stale nodes, contradiction resolution, hot layer TTL, and structural evolution (automatic type splitting when embedding clusters diverge).
|
|
171
|
+
4. **Connector Health** -- Monitors all connected data sources, auto-reconnects with exponential backoff on transient failures, escalates to critical gaps when connectors stay dead.
|
|
172
|
+
5. **Context Push** -- Subscribes to significant graph events (critical gaps, connector failures, evolution) and pushes MCP notifications to Claude Code in real time.
|
|
99
173
|
|
|
100
|
-
|
|
174
|
+
TypeScript monorepo with 8 packages, built with pnpm workspaces and esbuild.
|
|
101
175
|
|
|
102
|
-
|
|
103
|
-
- **pgvector** for semantic search (embedding-based similarity)
|
|
104
|
-
- **NATS JetStream** for event-driven gap detection and metabolism
|
|
105
|
-
- **Redis** for caching
|
|
176
|
+
## Requirements
|
|
106
177
|
|
|
107
|
-
|
|
178
|
+
- **Node.js 22+**
|
|
179
|
+
- **Docker** (for PostgreSQL 16 + AGE 1.6 + pgvector, NATS 2.11, Redis 7)
|
|
180
|
+
- **ANTHROPIC_API_KEY** environment variable (for bootstrap, explain, briefing, decide, digest, collect)
|
|
181
|
+
- **VOYAGE_API_KEY** environment variable (optional, for semantic search embeddings)
|
|
108
182
|
|
|
109
183
|
## Links
|
|
110
184
|
|
package/dist/index.js
CHANGED
|
@@ -1225,7 +1225,7 @@ builder.objectType('MyObject', {
|
|
|
1225
1225
|
`),p_(i);try{await f_(i)}catch(m){console.error(" \u2717 Failed to start Docker services:",m.message),process.exit(1)}console.log(" \u2713 PostgreSQL on :5432"),console.log(" \u2713 NATS on :4222"),console.log(" \u2713 Redis on :6379"),console.log(" Waiting for PostgreSQL to accept connections..."),await m_(i)||(console.error(` \u2717 PostgreSQL did not become ready within 120s
|
|
1226
1226
|
`),process.exit(1)),console.log(" \u2713 PostgreSQL is ready")}console.log(`
|
|
1227
1227
|
[4/6] Database migrations`);try{let f=ml(),m=await hl(s,f),h=m.applied.length+m.skipped.length;m.applied.length>0?console.log(` \u2713 Schema applied (${m.applied.length} migration${m.applied.length>1?"s":""} applied, ${m.skipped.length} already up-to-date)`):console.log(` \u2713 Schema up-to-date (${h} migration${h>1?"s":""})`)}catch(f){console.error(" \u2717 Migration failed:",f.message),process.exit(1)}console.log(`
|
|
1228
|
-
[5/6] Project config`),x5(n,{recursive:!0});let c=ja(n,"config.json"),u={version:"0.
|
|
1228
|
+
[5/6] Project config`),x5(n,{recursive:!0});let c=ja(n,"config.json"),u={version:"0.5.0",database:s,nats:a,projectRoot:e,createdAt:new Date().toISOString()};zf(c,JSON.stringify(u,null,2)+`
|
|
1229
1229
|
`,"utf-8"),console.log(" \u2713 .codify/config.json created");let l=ja(e,".gitignore");if(GA(l)){let f=BA(l,"utf-8");f.includes(".codify")||(zf(l,f.trimEnd()+`
|
|
1230
1230
|
.codify/
|
|
1231
1231
|
`,"utf-8"),console.log(" \u2713 .codify/ added to .gitignore"))}else zf(l,`.codify/
|
|
@@ -2314,7 +2314,7 @@ builder.objectType('MyObject', {
|
|
|
2314
2314
|
ERROR: ANTHROPIC_API_KEY not set.`),console.error(` Export your API key: export ANTHROPIC_API_KEY=sk-...
|
|
2315
2315
|
`)):console.error(`
|
|
2316
2316
|
ERROR: ${n}
|
|
2317
|
-
`),process.exit(1)}});process.on("unhandledRejection",(t,e)=>{console.error("[codify] Unhandled rejection:",t)});process.on("uncaughtException",t=>{console.error("[codify] Uncaught exception:",t),process.exit(1)});var We=new ce;We.name("codify").description("Codify \u2014 Living Context Graph for AI-Native Teams").version("0.
|
|
2317
|
+
`),process.exit(1)}});process.on("unhandledRejection",(t,e)=>{console.error("[codify] Unhandled rejection:",t)});process.on("uncaughtException",t=>{console.error("[codify] Uncaught exception:",t),process.exit(1)});var We=new ce;We.name("codify").description("Codify \u2014 Living Context Graph for AI-Native Teams").version("0.5.0").option("-v, --verbose","Enable debug-level logging").option("-q, --quiet","Suppress info-level logging").hook("preAction",(t,e)=>{let n=We.opts();n.verbose&&(process.env.CODIFY_VERBOSE="1"),n.quiet&&(process.env.CODIFY_QUIET="1")}).addHelpText("after",`
|
|
2318
2318
|
Getting Started:
|
|
2319
2319
|
codify up Set up and start in one command (init+bootstrap+start)
|
|
2320
2320
|
codify init Set up infrastructure and configure project
|