@popoverai/dotrequirements 0.12.1 → 0.14.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 +66 -61
- package/dist/cli.js +0 -10
- package/dist/commands/init.js +167 -224
- package/dist/commands/link.d.ts +9 -10
- package/dist/commands/link.js +81 -106
- package/dist/commands/mcp-setup.js +77 -94
- package/dist/commands/pull.js +17 -45
- package/dist/commands/push.js +9 -24
- package/dist/convex.d.ts +3 -0
- package/dist/convex.js +3 -0
- package/dist/harness/cache.d.ts +0 -5
- package/dist/harness/cache.js +0 -48
- package/dist/harness/convexReporting.js +7 -14
- package/dist/harness/finalize.d.ts +8 -2
- package/dist/harness/finalize.js +48 -31
- package/dist/harness/prepare.js +7 -9
- package/dist/mcp/convexClient.d.ts +5 -1
- package/dist/mcp/convexClient.js +14 -34
- package/dist/mcp/index.js +25 -78
- package/dist/schema/conversions.d.ts +2 -2
- package/dist/schema/conversions.js +2 -3
- package/dist/schema/schemas.d.ts +14 -37
- package/dist/schema/schemas.js +7 -10
- package/dist/schema/test-schema.js +1 -1
- package/dist/templates/context-file-section.md +59 -0
- package/dist/utils/context-file.d.ts +38 -0
- package/dist/utils/context-file.js +94 -0
- package/dist/utils/env.d.ts +0 -13
- package/dist/utils/env.js +0 -19
- package/dist/utils/gitignore.d.ts +2 -2
- package/dist/utils/gitignore.js +4 -4
- package/dist/utils/oauth-flow.d.ts +0 -1
- package/dist/utils/oauth-flow.js +0 -9
- package/dist/utils/project-discovery.d.ts +3 -5
- package/dist/utils/project-discovery.js +18 -42
- package/dist/utils/project-selector.d.ts +17 -3
- package/dist/utils/project-selector.js +37 -3
- package/dist/utils/project-settings.d.ts +47 -0
- package/dist/utils/project-settings.js +110 -0
- package/dist/utils/templates.d.ts +0 -24
- package/dist/utils/templates.js +0 -39
- package/package.json +1 -1
- package/dist/harness/localReporting.d.ts +0 -6
- package/dist/harness/localReporting.js +0 -49
- package/dist/templates/antigravity-gemini.md +0 -3
- package/dist/templates/antigravity-overview-rule.md +0 -3
- package/dist/templates/antigravity-test-rule.md +0 -3
- package/dist/templates/behavioral-core.md +0 -25
- package/dist/templates/claude-code-overview-skill.md +0 -6
- package/dist/templates/claude-code-skill.md +0 -6
- package/dist/templates/claude-code-test-skill.md +0 -6
- package/dist/templates/codex-agents.md +0 -3
- package/dist/templates/codex-overview-agents.md +0 -3
- package/dist/templates/codex-test-agents.md +0 -3
- package/dist/templates/cursor-overview-rule.mdc +0 -5
- package/dist/templates/cursor-rule.mdc +0 -5
- package/dist/templates/cursor-test-rule.mdc +0 -5
- package/dist/templates/overview-core.md +0 -27
- package/dist/templates/test-writing-core.md +0 -72
- package/dist/utils/detect-existing-project.d.ts +0 -5
- package/dist/utils/detect-existing-project.js +0 -34
package/README.md
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
# dot•requirements
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**One source of truth for what your software should do.**
|
|
4
|
+
Readable. Testable. AI-accessible.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Tests prove *something* works—but nobody is certain it's the right something. Requirements live scattered across docs, issue trackers, and people's heads. They drift out of sync with actual code. And AI assistants can't access them at all.
|
|
9
|
+
|
|
10
|
+
**dot•requirements** closes this gap. Write requirements as structured Markdown, reference them directly in tests, and see coverage update automatically. When a requirement changes, the tests that validate it are one click away.
|
|
11
|
+
|
|
12
|
+
> **Alpha Software** — Under active development. Please report issues to support@popover.ca.
|
|
6
13
|
|
|
7
|
-
|
|
14
|
+
## Who Is This For?
|
|
15
|
+
|
|
16
|
+
- **Developers** who want tests that prove the right behavior, not just "80% coverage"
|
|
17
|
+
- **Product managers** who want visibility into what's actually being tested
|
|
18
|
+
- **AI-first builders** who want clear requirements for faster, more accurate implementations
|
|
8
19
|
|
|
9
20
|
## Installation
|
|
10
21
|
|
|
@@ -32,10 +43,7 @@ Create `*.requirements.md` files in `.requirements/` or colocate them with your
|
|
|
32
43
|
|
|
33
44
|
```markdown
|
|
34
45
|
---
|
|
35
|
-
projectId: my-project
|
|
36
|
-
version: 1
|
|
37
46
|
document:
|
|
38
|
-
id: auth-requirements
|
|
39
47
|
title: "Authentication Requirements"
|
|
40
48
|
---
|
|
41
49
|
|
|
@@ -79,27 +87,6 @@ After running tests, you'll see a coverage report showing which requirements hav
|
|
|
79
87
|
|
|
80
88
|
---
|
|
81
89
|
|
|
82
|
-
## What Works Locally
|
|
83
|
-
|
|
84
|
-
The following features work fully offline—no account required:
|
|
85
|
-
|
|
86
|
-
- Write requirements (`.requirements.md` files)
|
|
87
|
-
- Validate requirements (`dotreq test`)
|
|
88
|
-
- Reference requirements in tests (`requirement()`)
|
|
89
|
-
- Coverage reporting (console output)
|
|
90
|
-
- MCP tools (search, validate, explore)
|
|
91
|
-
|
|
92
|
-
The following features require a dot•requirements cloud account:
|
|
93
|
-
|
|
94
|
-
- Sync requirements (`pull` / `push`)
|
|
95
|
-
- Historical coverage tracking
|
|
96
|
-
- AI-powered style checking
|
|
97
|
-
- Team collaboration
|
|
98
|
-
|
|
99
|
-
To enable cloud features, run `dotreq login`.
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
90
|
## CLI Commands
|
|
104
91
|
|
|
105
92
|
### `dotreq init`
|
|
@@ -148,15 +135,6 @@ dotreq test
|
|
|
148
135
|
dotreq test --file .requirements/auth.requirements.md
|
|
149
136
|
```
|
|
150
137
|
|
|
151
|
-
### `dotreq login` / `logout`
|
|
152
|
-
|
|
153
|
-
Authenticate with dot•requirements cloud.
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
dotreq login
|
|
157
|
-
dotreq logout
|
|
158
|
-
```
|
|
159
|
-
|
|
160
138
|
### `dotreq mcp-setup`
|
|
161
139
|
|
|
162
140
|
Configure the MCP server for AI assistants (Claude Code, Cursor, etc.).
|
|
@@ -175,9 +153,30 @@ dotreq mcp
|
|
|
175
153
|
|
|
176
154
|
---
|
|
177
155
|
|
|
156
|
+
## What Works Locally
|
|
157
|
+
|
|
158
|
+
The following features work fully offline—no account required:
|
|
159
|
+
|
|
160
|
+
- Write requirements (`.requirements.md` files)
|
|
161
|
+
- Validate requirements (`dotreq test`)
|
|
162
|
+
- Reference requirements in tests (`requirement()`)
|
|
163
|
+
- Coverage reporting (console output)
|
|
164
|
+
- MCP tools (search, validate, explore)
|
|
165
|
+
|
|
166
|
+
The following features require a dot•requirements cloud account:
|
|
167
|
+
|
|
168
|
+
- Sync requirements (`pull` / `push`)
|
|
169
|
+
- Historical coverage tracking
|
|
170
|
+
- AI-powered style checking
|
|
171
|
+
- Team collaboration
|
|
172
|
+
|
|
173
|
+
To enable cloud features, run `dotreq link` to connect your project to the cloud.
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
178
177
|
## Test Harness
|
|
179
178
|
|
|
180
|
-
The test harness tracks which requirements are exercised by your tests.
|
|
179
|
+
Stop wondering "did we test that?" The test harness tracks which requirements are exercised by your tests and shows gaps instantly.
|
|
181
180
|
|
|
182
181
|
### Setup with Vitest
|
|
183
182
|
|
|
@@ -210,6 +209,15 @@ export async function teardown() {
|
|
|
210
209
|
|
|
211
210
|
Alternatively, you can use the default export pattern that returns a teardown function—see the [Vitest globalSetup docs](https://vitest.dev/config/globalsetup).
|
|
212
211
|
|
|
212
|
+
**Customizing output:** `finalize()` accepts options to control verbosity:
|
|
213
|
+
|
|
214
|
+
```typescript
|
|
215
|
+
await finalize({ showTestedList: true }); // Include tested requirements
|
|
216
|
+
await finalize({ showSummary: false, showUntestedList: false }); // Quiet mode
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
By default, only untested requirements are shown. See the [test harness docs](https://dotrequirements.io/tools/test-harness) for all options.
|
|
220
|
+
|
|
213
221
|
### Setup with Jest
|
|
214
222
|
|
|
215
223
|
**jest.config.cjs:**
|
|
@@ -284,25 +292,29 @@ test(requirement('AUTH-LOGIN-1', 'AUTH-SECURITY-1'), () => {
|
|
|
284
292
|
|
|
285
293
|
### Coverage Reporting
|
|
286
294
|
|
|
295
|
+
Coverage isn't just a number—it's a map of which features have been tested and which haven't.
|
|
296
|
+
|
|
287
297
|
#### Local Report
|
|
288
298
|
|
|
289
299
|
After tests complete, a coverage summary prints to the console:
|
|
290
300
|
|
|
291
301
|
```
|
|
292
302
|
=== Requirements Coverage Report ===
|
|
303
|
+
|
|
293
304
|
Total Requirements: 12
|
|
294
305
|
Tested Requirements: 10
|
|
295
306
|
Untested Requirements: 2
|
|
296
307
|
Coverage: 83.3%
|
|
297
308
|
|
|
298
|
-
Tested:
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
309
|
+
✓ Tested Requirements:
|
|
310
|
+
- AUTH-LOGIN-1: A registered user, Jamie, can log in to their account
|
|
311
|
+
- AUTH-LOGIN-1.0: When Jamie provides a valid username and password...
|
|
312
|
+
|
|
313
|
+
✗ Untested Requirements:
|
|
314
|
+
- AUTH-LOGIN-2: A user with two-factor auth must provide an OTP
|
|
315
|
+
- AUTH-SECURITY-1: Session tokens expire after 8 hours
|
|
302
316
|
|
|
303
|
-
|
|
304
|
-
✗ AUTH-LOGIN-2
|
|
305
|
-
✗ AUTH-SECURITY-1
|
|
317
|
+
====================================
|
|
306
318
|
```
|
|
307
319
|
|
|
308
320
|
#### Cloud Reporting
|
|
@@ -313,12 +325,7 @@ With cloud credentials configured, coverage is automatically reported to dot•r
|
|
|
313
325
|
- Branch-based coverage (tracks `main`, feature branches, etc.)
|
|
314
326
|
- Query coverage via the MCP server
|
|
315
327
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
```bash
|
|
319
|
-
DOTREQUIREMENTS_PROJECT_ID=your-project-id
|
|
320
|
-
DOTREQUIREMENTS_PROJECT_SECRET=your-project-secret
|
|
321
|
-
```
|
|
328
|
+
Run `dotreq link` to connect your project to the cloud and enable coverage reporting.
|
|
322
329
|
|
|
323
330
|
Cloud reporting is fire-and-forget—it never blocks or fails your tests.
|
|
324
331
|
|
|
@@ -346,10 +353,7 @@ src/components/
|
|
|
346
353
|
|
|
347
354
|
```markdown
|
|
348
355
|
---
|
|
349
|
-
projectId: my-project
|
|
350
|
-
version: 1
|
|
351
356
|
document:
|
|
352
|
-
id: unique-doc-id
|
|
353
357
|
title: "Document Title"
|
|
354
358
|
---
|
|
355
359
|
|
|
@@ -380,7 +384,7 @@ AUTH-LOGIN-2: A user with two-factor auth must provide an OTP
|
|
|
380
384
|
|
|
381
385
|
### Format Details
|
|
382
386
|
|
|
383
|
-
- **Frontmatter**: YAML metadata (
|
|
387
|
+
- **Frontmatter**: YAML metadata (only `document.title` required for push)
|
|
384
388
|
- **Headings**: Optional documentation (not parsed as requirement data)
|
|
385
389
|
- **Fenced blocks**: `dotrequirements` blocks contain structured requirement data
|
|
386
390
|
- **First line**: `KEY: content` — the requirement identifier and summary
|
|
@@ -394,7 +398,7 @@ See [MARKDOWN_SCHEMA.md](https://github.com/PopoverAI/dotrequirements/blob/main/
|
|
|
394
398
|
|
|
395
399
|
## MCP Server
|
|
396
400
|
|
|
397
|
-
|
|
401
|
+
AI assistants can read your requirements in context, draft new ones, and verify tests actually validate what they claim to. The MCP server makes this possible through a standard protocol that works with Claude Code, Cursor, and other AI coding assistants.
|
|
398
402
|
|
|
399
403
|
### Setup
|
|
400
404
|
|
|
@@ -453,15 +457,16 @@ import '@popoverai/dotrequirements/mcp';
|
|
|
453
457
|
|
|
454
458
|
## Configuration
|
|
455
459
|
|
|
456
|
-
The CLI stores
|
|
460
|
+
The CLI stores project credentials in `.requirements/project-settings.json`:
|
|
457
461
|
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
+
```json
|
|
463
|
+
{
|
|
464
|
+
"projectId": "your-project-id",
|
|
465
|
+
"projectSecret": "your-project-secret"
|
|
466
|
+
}
|
|
462
467
|
```
|
|
463
468
|
|
|
464
|
-
|
|
469
|
+
This file is automatically added to `.gitignore` during initialization.
|
|
465
470
|
|
|
466
471
|
---
|
|
467
472
|
|
package/dist/cli.js
CHANGED
|
@@ -7,8 +7,6 @@ import { pushCommand } from './commands/push.js';
|
|
|
7
7
|
import { testCommand } from './commands/test.js';
|
|
8
8
|
import { mcpCommand } from './commands/mcp.js';
|
|
9
9
|
import { mcpSetupCommand } from './commands/mcp-setup.js';
|
|
10
|
-
import { loginCommand } from './commands/login.js';
|
|
11
|
-
import { logoutCommand } from './commands/logout.js';
|
|
12
10
|
import { loadEnvFile } from './utils/env.js';
|
|
13
11
|
import { readFileSync } from 'fs';
|
|
14
12
|
import { fileURLToPath } from 'url';
|
|
@@ -78,13 +76,5 @@ program
|
|
|
78
76
|
.command('mcp-setup')
|
|
79
77
|
.description('Configure MCP server for your AI assistant (Claude Code, Claude Desktop, etc.)')
|
|
80
78
|
.action(wrapCommand(mcpSetupCommand));
|
|
81
|
-
program
|
|
82
|
-
.command('login')
|
|
83
|
-
.description('Authenticate with dot•requirements and enable cloud features')
|
|
84
|
-
.action(wrapCommand(loginCommand));
|
|
85
|
-
program
|
|
86
|
-
.command('logout')
|
|
87
|
-
.description('Clear stored authentication tokens')
|
|
88
|
-
.action(wrapCommand(logoutCommand));
|
|
89
79
|
program.parse();
|
|
90
80
|
//# sourceMappingURL=cli.js.map
|