@popoverai/dotrequirements 0.13.0 → 0.15.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.
Files changed (57) hide show
  1. package/README.md +92 -48
  2. package/dist/cli.js +1 -10
  3. package/dist/commands/init.js +166 -226
  4. package/dist/commands/link.d.ts +9 -10
  5. package/dist/commands/link.js +81 -106
  6. package/dist/commands/mcp-setup.js +77 -94
  7. package/dist/commands/pull.d.ts +1 -0
  8. package/dist/commands/pull.js +70 -53
  9. package/dist/commands/push.js +4 -13
  10. package/dist/config.js +0 -4
  11. package/dist/harness/cache.d.ts +0 -5
  12. package/dist/harness/cache.js +0 -48
  13. package/dist/harness/convexReporting.js +7 -14
  14. package/dist/harness/finalize.js +7 -12
  15. package/dist/harness/prepare.js +7 -9
  16. package/dist/mcp/convexClient.d.ts +9 -1
  17. package/dist/mcp/convexClient.js +15 -35
  18. package/dist/mcp/index.js +112 -152
  19. package/dist/mcp/requirements.d.ts +10 -0
  20. package/dist/mcp/requirements.js +15 -1
  21. package/dist/templates/context-file-section.md +59 -0
  22. package/dist/utils/context-file.d.ts +38 -0
  23. package/dist/utils/context-file.js +94 -0
  24. package/dist/utils/env.d.ts +0 -13
  25. package/dist/utils/env.js +0 -19
  26. package/dist/utils/gitignore.d.ts +2 -2
  27. package/dist/utils/gitignore.js +4 -4
  28. package/dist/utils/oauth-flow.d.ts +0 -1
  29. package/dist/utils/oauth-flow.js +0 -9
  30. package/dist/utils/project-discovery.d.ts +3 -5
  31. package/dist/utils/project-discovery.js +18 -42
  32. package/dist/utils/project-selector.d.ts +17 -3
  33. package/dist/utils/project-selector.js +35 -3
  34. package/dist/utils/project-settings.d.ts +56 -0
  35. package/dist/utils/project-settings.js +126 -0
  36. package/dist/utils/templates.d.ts +0 -24
  37. package/dist/utils/templates.js +0 -39
  38. package/package.json +1 -1
  39. package/dist/harness/localReporting.d.ts +0 -6
  40. package/dist/harness/localReporting.js +0 -49
  41. package/dist/templates/antigravity-gemini.md +0 -3
  42. package/dist/templates/antigravity-overview-rule.md +0 -3
  43. package/dist/templates/antigravity-test-rule.md +0 -3
  44. package/dist/templates/behavioral-core.md +0 -25
  45. package/dist/templates/claude-code-overview-skill.md +0 -6
  46. package/dist/templates/claude-code-skill.md +0 -6
  47. package/dist/templates/claude-code-test-skill.md +0 -6
  48. package/dist/templates/codex-agents.md +0 -3
  49. package/dist/templates/codex-overview-agents.md +0 -3
  50. package/dist/templates/codex-test-agents.md +0 -3
  51. package/dist/templates/cursor-overview-rule.mdc +0 -5
  52. package/dist/templates/cursor-rule.mdc +0 -5
  53. package/dist/templates/cursor-test-rule.mdc +0 -5
  54. package/dist/templates/overview-core.md +0 -27
  55. package/dist/templates/test-writing-core.md +0 -72
  56. package/dist/utils/detect-existing-project.d.ts +0 -5
  57. package/dist/utils/detect-existing-project.js +0 -34
package/README.md CHANGED
@@ -1,10 +1,21 @@
1
1
  # dot•requirements
2
2
 
3
- Requirements tracking CLI, test harness, and MCP server for AI-assisted development.
3
+ **One source of truth for what your software should do.**
4
+ Readable. Testable. AI-accessible.
4
5
 
5
- **dot•requirements** treats requirements as discrete, testable data that flows from discovery through implementation to testing. Write requirements as structured Markdown, reference them in tests, and track coverage over time.
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.
13
+
14
+ ## Who Is This For?
6
15
 
7
- > **Alpha Software** — This package is under active development and may be unstable or incomplete. We're working toward a stable release, but things may break. Please report issues to support@popover.ca.
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
 
@@ -76,27 +87,6 @@ After running tests, you'll see a coverage report showing which requirements hav
76
87
 
77
88
  ---
78
89
 
79
- ## What Works Locally
80
-
81
- The following features work fully offline—no account required:
82
-
83
- - Write requirements (`.requirements.md` files)
84
- - Validate requirements (`dotreq test`)
85
- - Reference requirements in tests (`requirement()`)
86
- - Coverage reporting (console output)
87
- - MCP tools (search, validate, explore)
88
-
89
- The following features require a dot•requirements cloud account:
90
-
91
- - Sync requirements (`pull` / `push`)
92
- - Historical coverage tracking
93
- - AI-powered style checking
94
- - Team collaboration
95
-
96
- To enable cloud features, run `dotreq login`.
97
-
98
- ---
99
-
100
90
  ## CLI Commands
101
91
 
102
92
  ### `dotreq init`
@@ -124,8 +114,19 @@ Sync requirements from dot•requirements cloud to local `.requirements/` files.
124
114
  dotreq pull
125
115
  dotreq pull --project <project-id>
126
116
  dotreq pull --document <document-id>
117
+ dotreq pull --share <token>
118
+ ```
119
+
120
+ **First-time setup with a share token:**
121
+
122
+ If a team member shares a pull command with you, you can pull requirements without creating an account:
123
+
124
+ ```bash
125
+ npx @popoverai/dotrequirements pull --share drt_abc123...
127
126
  ```
128
127
 
128
+ This gives you read-only access to view requirements. To push changes or report coverage, run `dotreq link` afterward.
129
+
129
130
  ### `dotreq push`
130
131
 
131
132
  Push local requirements to dot•requirements cloud.
@@ -145,15 +146,6 @@ dotreq test
145
146
  dotreq test --file .requirements/auth.requirements.md
146
147
  ```
147
148
 
148
- ### `dotreq login` / `logout`
149
-
150
- Authenticate with dot•requirements cloud.
151
-
152
- ```bash
153
- dotreq login
154
- dotreq logout
155
- ```
156
-
157
149
  ### `dotreq mcp-setup`
158
150
 
159
151
  Configure the MCP server for AI assistants (Claude Code, Cursor, etc.).
@@ -172,9 +164,30 @@ dotreq mcp
172
164
 
173
165
  ---
174
166
 
167
+ ## What Works Locally
168
+
169
+ The following features work fully offline—no account required:
170
+
171
+ - Write requirements (`.requirements.md` files)
172
+ - Validate requirements (`dotreq test`)
173
+ - Reference requirements in tests (`requirement()`)
174
+ - Coverage reporting (console output)
175
+ - MCP tools (search, validate, explore)
176
+
177
+ The following features require a dot•requirements cloud account:
178
+
179
+ - Sync requirements (`pull` / `push`)
180
+ - Historical coverage tracking
181
+ - AI-powered style checking
182
+ - Team collaboration
183
+
184
+ To enable cloud features, run `dotreq link` to connect your project to the cloud.
185
+
186
+ ---
187
+
175
188
  ## Test Harness
176
189
 
177
- The test harness tracks which requirements are exercised by your tests.
190
+ Stop wondering "did we test that?" The test harness tracks which requirements are exercised by your tests and shows gaps instantly.
178
191
 
179
192
  ### Setup with Vitest
180
193
 
@@ -290,6 +303,8 @@ test(requirement('AUTH-LOGIN-1', 'AUTH-SECURITY-1'), () => {
290
303
 
291
304
  ### Coverage Reporting
292
305
 
306
+ Coverage isn't just a number—it's a map of which features have been tested and which haven't.
307
+
293
308
  #### Local Report
294
309
 
295
310
  After tests complete, a coverage summary prints to the console:
@@ -321,12 +336,7 @@ With cloud credentials configured, coverage is automatically reported to dot•r
321
336
  - Branch-based coverage (tracks `main`, feature branches, etc.)
322
337
  - Query coverage via the MCP server
323
338
 
324
- Configure by adding to `.env.local`:
325
-
326
- ```bash
327
- DOTREQUIREMENTS_PROJECT_ID=your-project-id
328
- DOTREQUIREMENTS_PROJECT_SECRET=your-project-secret
329
- ```
339
+ Run `dotreq link` to connect your project to the cloud and enable coverage reporting.
330
340
 
331
341
  Cloud reporting is fire-and-forget—it never blocks or fails your tests.
332
342
 
@@ -399,7 +409,7 @@ See [MARKDOWN_SCHEMA.md](https://github.com/PopoverAI/dotrequirements/blob/main/
399
409
 
400
410
  ## MCP Server
401
411
 
402
- The package includes an MCP (Model Context Protocol) server for AI assistant integration. This enables AI coding assistants to search, validate, and work with your requirements.
412
+ 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.
403
413
 
404
414
  ### Setup
405
415
 
@@ -422,7 +432,7 @@ Follow the prompts to configure for your AI assistant (Claude Code, Cursor, etc.
422
432
  **Authoring:**
423
433
  - `create_requirement_document` — Get a Markdown template with format examples
424
434
  - `validate_requirements` — Validate file schema (works offline)
425
- - `style_check` — AI-powered style feedback on requirements
435
+ - `style_check` — AI-powered style feedback on requirements (supports optional `requirementKeys` filter)
426
436
  - `review_test` — Comprehensive test review (style + semantic correctness)
427
437
 
428
438
  **Cloud:**
@@ -433,6 +443,39 @@ Follow the prompts to configure for your AI assistant (Claude Code, Cursor, etc.
433
443
  **Diagnostic:**
434
444
  - `debug_mcp_environment` — Debug MCP server configuration
435
445
 
446
+ ### CI/CD Mode
447
+
448
+ For CI/CD environments (GitHub Actions, etc.), use the `--auth-from-env` flag to read credentials from environment variables instead of `project-settings.json`:
449
+
450
+ ```bash
451
+ node packages/cli/dist/mcp/index.js --auth-from-env
452
+ ```
453
+
454
+ Required environment variables:
455
+ - `DOTREQ_PROJECT_ID` — Your project slug
456
+ - `DOTREQ_PROJECT_SECRET` — Your project secret
457
+
458
+ **Important:** Without `--auth-from-env`, these environment variables are ignored. This explicit opt-in prevents credential conflicts between local and CI environments.
459
+
460
+ Example MCP config for GitHub Actions:
461
+
462
+ ```json
463
+ {
464
+ "mcpServers": {
465
+ "dotrequirements": {
466
+ "command": "node",
467
+ "args": ["packages/cli/dist/mcp/index.js", "--auth-from-env"],
468
+ "env": {
469
+ "DOTREQ_PROJECT_ID": "${DOTREQ_PROJECT_ID}",
470
+ "DOTREQ_PROJECT_SECRET": "${DOTREQ_PROJECT_SECRET}"
471
+ }
472
+ }
473
+ }
474
+ }
475
+ ```
476
+
477
+ See the [CI/CD Integration docs](https://dotrequirements.io/tools/ai/ci-cd) for complete examples.
478
+
436
479
  ---
437
480
 
438
481
  ## Package Exports
@@ -458,15 +501,16 @@ import '@popoverai/dotrequirements/mcp';
458
501
 
459
502
  ## Configuration
460
503
 
461
- The CLI stores configuration in `.env.local`:
504
+ The CLI stores project credentials in `.requirements/project-settings.json`:
462
505
 
463
- ```bash
464
- # Project credentials (from dotreq init or login)
465
- DOTREQUIREMENTS_PROJECT_ID=your-project-id
466
- DOTREQUIREMENTS_PROJECT_SECRET=your-project-secret
506
+ ```json
507
+ {
508
+ "projectId": "your-project-id",
509
+ "projectSecret": "your-project-secret"
510
+ }
467
511
  ```
468
512
 
469
- The `.env.local` file is automatically added to `.gitignore` during initialization.
513
+ This file is automatically added to `.gitignore` during initialization.
470
514
 
471
515
  ---
472
516
 
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';
@@ -59,6 +57,7 @@ program
59
57
  .description('Sync requirements from cloud to local .requirements/ files')
60
58
  .option('-p, --project <id>', 'Project ID to sync')
61
59
  .option('-d, --document <id>', 'Specific document ID to sync')
60
+ .option('-s, --share <token>', 'Read-only share token for quick onboarding (no setup required)')
62
61
  .action(wrapCommand(pullCommand));
63
62
  program
64
63
  .command('push [file]')
@@ -78,13 +77,5 @@ program
78
77
  .command('mcp-setup')
79
78
  .description('Configure MCP server for your AI assistant (Claude Code, Claude Desktop, etc.)')
80
79
  .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
80
  program.parse();
90
81
  //# sourceMappingURL=cli.js.map