delimit-cli 3.6.0 → 3.6.1
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 +14 -15
- package/bin/delimit-setup.js +50 -35
- package/package.json +1 -1
- package/tests/setup-onboarding.test.js +147 -0
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# delimit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Your AI Remembers. Verifies. Ships.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/delimit-cli)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Governance layer for AI coding assistants. Your AI verifies its own work -- confirms tests ran, catches breaking API changes, audits security, and enforces policies. Works with Claude Code, Codex, and Cursor.
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
@@ -13,18 +13,18 @@ Stop Describing. Start Building.
|
|
|
13
13
|
npx delimit-cli setup
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
10 seconds. No API keys. No account. Installs
|
|
16
|
+
10 seconds. No API keys. No account. Installs into your existing AI coding assistant.
|
|
17
17
|
|
|
18
|
-
## What
|
|
18
|
+
## What it does
|
|
19
19
|
|
|
20
|
-
Your AI agent
|
|
20
|
+
Your AI agent gains the ability to verify its own work:
|
|
21
21
|
|
|
22
|
-
- **Test verification**
|
|
23
|
-
- **Security audit**
|
|
24
|
-
- **API governance**
|
|
25
|
-
- **Repo analysis**
|
|
26
|
-
- **Deploy tracking**
|
|
27
|
-
- **Multi-model consensus**
|
|
22
|
+
- **Test verification** -- confirms tests actually ran, measures coverage
|
|
23
|
+
- **Security audit** -- scans dependencies, detects hardcoded secrets and anti-patterns
|
|
24
|
+
- **API governance** -- catches breaking changes in OpenAPI specs before they ship
|
|
25
|
+
- **Repo analysis** -- code quality, health checks, config validation
|
|
26
|
+
- **Deploy tracking** -- plan, build, publish, verify, rollback
|
|
27
|
+
- **Multi-model consensus** -- multiple AI models deliberate on strategic decisions
|
|
28
28
|
|
|
29
29
|
## Real examples
|
|
30
30
|
|
|
@@ -32,14 +32,13 @@ These happened in a single session:
|
|
|
32
32
|
|
|
33
33
|
| Command | Result |
|
|
34
34
|
|---------|--------|
|
|
35
|
-
| "
|
|
36
|
-
| "
|
|
37
|
-
| "run test coverage" | 299 → 1,113 tests, zero written manually |
|
|
35
|
+
| "fix the 502 error" | Traced Vercel to Caddy to Docker, found wrong IP, fixed, verified |
|
|
36
|
+
| "run test coverage" | 299 to 1,113 tests, zero written manually |
|
|
38
37
|
| "run consensus on pricing" | 3 AI models debated, reached unanimous agreement |
|
|
39
38
|
|
|
40
39
|
## Free vs Pro
|
|
41
40
|
|
|
42
|
-
**Free
|
|
41
|
+
**Free**: lint, diff, policy, semver, test coverage, security audit, repo analysis, zero-spec extraction, and more.
|
|
43
42
|
|
|
44
43
|
**Pro ($10/mo)**: governance, deploy tracking, memory/vault, multi-model deliberation, evidence collection. Activate with `delimit activate YOUR_KEY`.
|
|
45
44
|
|
package/bin/delimit-setup.js
CHANGED
|
@@ -290,48 +290,33 @@ Run full governance compliance checks. Verify security, policy compliance, evide
|
|
|
290
290
|
|
|
291
291
|
const claudeMd = path.join(os.homedir(), 'CLAUDE.md');
|
|
292
292
|
if (!fs.existsSync(claudeMd)) {
|
|
293
|
-
fs.writeFileSync(claudeMd,
|
|
294
|
-
|
|
295
|
-
Delimit governance tools are installed. On first use, try:
|
|
296
|
-
|
|
297
|
-
- "check governance health" — see the status of this project
|
|
298
|
-
- "initialize governance" — set up policies and ledger for this project
|
|
299
|
-
- "run test coverage" — measure test coverage
|
|
300
|
-
- "analyze this repo" — get a health report
|
|
301
|
-
|
|
302
|
-
## Quick Start
|
|
303
|
-
If this project hasn't been initialized for governance yet, say:
|
|
304
|
-
"initialize governance for this project"
|
|
305
|
-
|
|
306
|
-
This creates .delimit/policies.yml and a ledger directory.
|
|
307
|
-
|
|
308
|
-
## Available Agents
|
|
309
|
-
- /lint — check API specs for breaking changes
|
|
310
|
-
- /engineering — build, test, refactor with governance checks
|
|
311
|
-
- /governance — full compliance audit
|
|
312
|
-
|
|
313
|
-
## Key Tools
|
|
314
|
-
- delimit_init — bootstrap governance for a project
|
|
315
|
-
- delimit_lint — diff two OpenAPI specs
|
|
316
|
-
- delimit_test_coverage — measure test coverage
|
|
317
|
-
- delimit_gov_health — check governance status
|
|
318
|
-
- delimit_repo_analyze — full repo health report
|
|
319
|
-
`);
|
|
293
|
+
fs.writeFileSync(claudeMd, getClaudeMdContent());
|
|
320
294
|
log(` ${green('✓')} Created ${claudeMd} with first-run guidance`);
|
|
321
295
|
} else {
|
|
322
|
-
|
|
296
|
+
// Check if existing CLAUDE.md is an older Delimit version that should be upgraded
|
|
297
|
+
const existing = fs.readFileSync(claudeMd, 'utf-8');
|
|
298
|
+
if (existing.includes('# Delimit AI Guardrails') || existing.includes('delimit_init') || existing.includes('delimit_lint')) {
|
|
299
|
+
fs.writeFileSync(claudeMd, getClaudeMdContent());
|
|
300
|
+
log(` ${green('✓')} Updated ${claudeMd} with improved onboarding`);
|
|
301
|
+
} else {
|
|
302
|
+
log(` ${dim(' CLAUDE.md already exists with custom content — skipped')}`);
|
|
303
|
+
}
|
|
323
304
|
}
|
|
324
305
|
|
|
325
|
-
// Step 6:
|
|
306
|
+
// Step 6: Try it now
|
|
326
307
|
step(6, 'Done!');
|
|
327
308
|
log('');
|
|
328
|
-
log(` ${green('Delimit is installed.')} Your AI
|
|
309
|
+
log(` ${green('Delimit is installed.')} Your AI now has persistent memory and governance.`);
|
|
310
|
+
log('');
|
|
311
|
+
log(' Try it now:');
|
|
312
|
+
log(` ${bold('$ claude')}`);
|
|
313
|
+
log('');
|
|
314
|
+
log(` Then say: ${blue('"check this project\'s health"')}`);
|
|
329
315
|
log('');
|
|
330
|
-
log('
|
|
331
|
-
log(` ${dim('
|
|
332
|
-
log(` ${dim('
|
|
333
|
-
log(` ${dim('
|
|
334
|
-
log(` ${dim('4.')} Or ask: "check governance health" / "run test coverage"`);
|
|
316
|
+
log(' Or try:');
|
|
317
|
+
log(` ${dim('-')} "add to ledger: set up CI pipeline" ${dim('— start tracking tasks')}`);
|
|
318
|
+
log(` ${dim('-')} "what\'s on the ledger?" ${dim('— see what\'s pending')}`);
|
|
319
|
+
log(` ${dim('-')} "delimit help" ${dim('— see all capabilities')}`);
|
|
335
320
|
log('');
|
|
336
321
|
log(` ${dim('Config:')} ${MCP_CONFIG}`);
|
|
337
322
|
log(` ${dim('Server:')} ${actualServer}`);
|
|
@@ -342,6 +327,36 @@ This creates .delimit/policies.yml and a ledger directory.
|
|
|
342
327
|
log('');
|
|
343
328
|
}
|
|
344
329
|
|
|
330
|
+
function getClaudeMdContent() {
|
|
331
|
+
return `# Delimit
|
|
332
|
+
|
|
333
|
+
Your AI has persistent memory, verified execution, and governance.
|
|
334
|
+
|
|
335
|
+
## First time? Say one of these:
|
|
336
|
+
- "check this project's health" -- see what Delimit finds
|
|
337
|
+
- "add to ledger: [anything]" -- start tracking tasks
|
|
338
|
+
- "what's on the ledger?" -- see what's pending
|
|
339
|
+
|
|
340
|
+
## Returning? Your AI remembers:
|
|
341
|
+
- Ledger items persist across sessions
|
|
342
|
+
- Governance rules stay configured
|
|
343
|
+
- Memory carries forward
|
|
344
|
+
|
|
345
|
+
## On first session, your AI will automatically:
|
|
346
|
+
1. Diagnose the environment to verify everything is connected
|
|
347
|
+
2. Check the ledger for any pending items from previous sessions
|
|
348
|
+
3. If no governance exists yet, suggest initializing it
|
|
349
|
+
|
|
350
|
+
## Available Agents
|
|
351
|
+
- /lint -- check API specs for breaking changes
|
|
352
|
+
- /engineering -- build, test, refactor with governance checks
|
|
353
|
+
- /governance -- full compliance audit
|
|
354
|
+
|
|
355
|
+
## Need help?
|
|
356
|
+
Say "delimit help" for docs on any capability.
|
|
357
|
+
`;
|
|
358
|
+
}
|
|
359
|
+
|
|
345
360
|
function copyDir(src, dest) {
|
|
346
361
|
fs.mkdirSync(dest, { recursive: true });
|
|
347
362
|
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
package/package.json
CHANGED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
const { describe, it } = require('node:test');
|
|
2
|
+
const assert = require('node:assert');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
|
|
7
|
+
// Extract getClaudeMdContent by loading the setup script source
|
|
8
|
+
// We test the content function and upgrade logic in isolation.
|
|
9
|
+
|
|
10
|
+
function getClaudeMdContent() {
|
|
11
|
+
return `# Delimit
|
|
12
|
+
|
|
13
|
+
Your AI has persistent memory, verified execution, and governance.
|
|
14
|
+
|
|
15
|
+
## First time? Say one of these:
|
|
16
|
+
- "check this project's health" -- see what Delimit finds
|
|
17
|
+
- "add to ledger: [anything]" -- start tracking tasks
|
|
18
|
+
- "what's on the ledger?" -- see what's pending
|
|
19
|
+
|
|
20
|
+
## Returning? Your AI remembers:
|
|
21
|
+
- Ledger items persist across sessions
|
|
22
|
+
- Governance rules stay configured
|
|
23
|
+
- Memory carries forward
|
|
24
|
+
|
|
25
|
+
## On first session, your AI will automatically:
|
|
26
|
+
1. Diagnose the environment to verify everything is connected
|
|
27
|
+
2. Check the ledger for any pending items from previous sessions
|
|
28
|
+
3. If no governance exists yet, suggest initializing it
|
|
29
|
+
|
|
30
|
+
## Available Agents
|
|
31
|
+
- /lint -- check API specs for breaking changes
|
|
32
|
+
- /engineering -- build, test, refactor with governance checks
|
|
33
|
+
- /governance -- full compliance audit
|
|
34
|
+
|
|
35
|
+
## Need help?
|
|
36
|
+
Say "delimit help" for docs on any capability.
|
|
37
|
+
`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
describe('CLAUDE.md onboarding content', () => {
|
|
41
|
+
it('does not mention individual tool names', () => {
|
|
42
|
+
const content = getClaudeMdContent();
|
|
43
|
+
// These tool names should never appear in user-facing CLAUDE.md
|
|
44
|
+
const toolNames = [
|
|
45
|
+
'delimit_init',
|
|
46
|
+
'delimit_lint',
|
|
47
|
+
'delimit_diff',
|
|
48
|
+
'delimit_test_coverage',
|
|
49
|
+
'delimit_gov_health',
|
|
50
|
+
'delimit_repo_analyze',
|
|
51
|
+
'delimit_diagnose',
|
|
52
|
+
'delimit_ledger_context',
|
|
53
|
+
];
|
|
54
|
+
for (const tool of toolNames) {
|
|
55
|
+
assert.ok(
|
|
56
|
+
!content.includes(tool),
|
|
57
|
+
`CLAUDE.md should not contain tool name "${tool}"`
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('contains natural language prompts for first-time users', () => {
|
|
63
|
+
const content = getClaudeMdContent();
|
|
64
|
+
assert.ok(content.includes('check this project\'s health'), 'Should have health check prompt');
|
|
65
|
+
assert.ok(content.includes('add to ledger'), 'Should have ledger add prompt');
|
|
66
|
+
assert.ok(content.includes('what\'s on the ledger'), 'Should have ledger check prompt');
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('mentions persistent memory and governance', () => {
|
|
70
|
+
const content = getClaudeMdContent();
|
|
71
|
+
assert.ok(content.includes('persistent memory'), 'Should mention persistent memory');
|
|
72
|
+
assert.ok(content.includes('governance'), 'Should mention governance');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('includes returning user section', () => {
|
|
76
|
+
const content = getClaudeMdContent();
|
|
77
|
+
assert.ok(content.includes('Returning?'), 'Should have returning user section');
|
|
78
|
+
assert.ok(content.includes('Ledger items persist'), 'Should mention ledger persistence');
|
|
79
|
+
assert.ok(content.includes('Memory carries forward'), 'Should mention memory persistence');
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('includes automatic first-session actions', () => {
|
|
83
|
+
const content = getClaudeMdContent();
|
|
84
|
+
assert.ok(content.includes('Diagnose the environment'), 'Should mention auto-diagnose');
|
|
85
|
+
assert.ok(content.includes('Check the ledger'), 'Should mention auto-ledger check');
|
|
86
|
+
assert.ok(content.includes('suggest initializing'), 'Should mention governance init suggestion');
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('includes help instruction', () => {
|
|
90
|
+
const content = getClaudeMdContent();
|
|
91
|
+
assert.ok(content.includes('delimit help'), 'Should tell users how to get help');
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('lists agents by slash-command not tool name', () => {
|
|
95
|
+
const content = getClaudeMdContent();
|
|
96
|
+
assert.ok(content.includes('/lint'), 'Should reference /lint agent');
|
|
97
|
+
assert.ok(content.includes('/engineering'), 'Should reference /engineering agent');
|
|
98
|
+
assert.ok(content.includes('/governance'), 'Should reference /governance agent');
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
describe('CLAUDE.md upgrade detection', () => {
|
|
103
|
+
it('detects old-format CLAUDE.md with "Delimit AI Guardrails" header', () => {
|
|
104
|
+
const oldContent = '# Delimit AI Guardrails\n\nSome old content';
|
|
105
|
+
assert.ok(
|
|
106
|
+
oldContent.includes('# Delimit AI Guardrails'),
|
|
107
|
+
'Should detect old header'
|
|
108
|
+
);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('detects old-format CLAUDE.md with tool names', () => {
|
|
112
|
+
const oldContent = 'Some content with delimit_init and delimit_lint';
|
|
113
|
+
assert.ok(
|
|
114
|
+
oldContent.includes('delimit_init') || oldContent.includes('delimit_lint'),
|
|
115
|
+
'Should detect old tool name references'
|
|
116
|
+
);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it('does not upgrade custom CLAUDE.md without Delimit markers', () => {
|
|
120
|
+
const customContent = '# My Project\n\nThis is a custom CLAUDE.md for my project.';
|
|
121
|
+
const hasOldMarkers =
|
|
122
|
+
customContent.includes('# Delimit AI Guardrails') ||
|
|
123
|
+
customContent.includes('delimit_init') ||
|
|
124
|
+
customContent.includes('delimit_lint');
|
|
125
|
+
assert.ok(!hasOldMarkers, 'Custom content should not be detected as old Delimit format');
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
describe('setup script output messaging', () => {
|
|
130
|
+
it('setup script file contains try-it-now messaging', () => {
|
|
131
|
+
const setupPath = path.join(__dirname, '..', 'bin', 'delimit-setup.js');
|
|
132
|
+
const setupContent = fs.readFileSync(setupPath, 'utf-8');
|
|
133
|
+
assert.ok(setupContent.includes('Try it now:'), 'Should have "Try it now:" prompt');
|
|
134
|
+
assert.ok(setupContent.includes('$ claude'), 'Should suggest running claude');
|
|
135
|
+
assert.ok(setupContent.includes('check this project\'s health'), 'Should suggest health check');
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('setup script does not list tool names in output', () => {
|
|
139
|
+
const setupPath = path.join(__dirname, '..', 'bin', 'delimit-setup.js');
|
|
140
|
+
const setupContent = fs.readFileSync(setupPath, 'utf-8');
|
|
141
|
+
// Check that Step 6 output area does not reference internal tool names
|
|
142
|
+
const step6Onwards = setupContent.split('// Step 6')[1];
|
|
143
|
+
assert.ok(step6Onwards, 'Should have Step 6 section');
|
|
144
|
+
assert.ok(!step6Onwards.includes('delimit_init'), 'Step 6 should not mention delimit_init');
|
|
145
|
+
assert.ok(!step6Onwards.includes('delimit_gov_health'), 'Step 6 should not mention delimit_gov_health');
|
|
146
|
+
});
|
|
147
|
+
});
|