@popoverai/dotrequirements 0.17.1 → 0.18.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 CHANGED
@@ -227,7 +227,7 @@ await finalize({ showTestedList: true }); // Include tested requirements
227
227
  await finalize({ showSummary: false, showUntestedList: false }); // Quiet mode
228
228
  ```
229
229
 
230
- By default, only untested requirements are shown. See the [test harness docs](https://dotrequirements.io/tools/test-harness) for all options.
230
+ By default, only untested requirements are shown. See the [test harness docs](https://docs.dotrequirements.io/tools/test-harness) for all options.
231
231
 
232
232
  ### Setup with Jest
233
233
 
@@ -474,7 +474,7 @@ Example MCP config for GitHub Actions:
474
474
  }
475
475
  ```
476
476
 
477
- See the [CI/CD Integration docs](https://dotrequirements.io/tools/ai/ci-cd) for complete examples.
477
+ See the [CI/CD Integration docs](https://docs.dotrequirements.io/tools/ai/ci-cd) for complete examples.
478
478
 
479
479
  ---
480
480
 
@@ -5,6 +5,7 @@ import { ensureGitignore } from '../utils/gitignore.js';
5
5
  import { generateRequirementsReadme } from '../templates/requirements-readme.js';
6
6
  import { generateExampleRequirements } from '../templates/example-requirements.js';
7
7
  import { promptChoice, promptConfirm } from '../utils/prompts.js';
8
+ import { mcpSetupCommand } from './mcp-setup.js';
8
9
  import { pullCommand } from './pull.js';
9
10
  import { executeOAuthFlow } from '../utils/oauth-flow.js';
10
11
  import { ConvexHttpClient } from 'convex/browser';
@@ -34,16 +35,24 @@ export async function initCommand(options = {}) {
34
35
  console.log('Initialization cancelled.');
35
36
  return;
36
37
  }
38
+ let initSucceeded;
37
39
  if (authChoice === 'no') {
38
40
  // INIT-3: Local-only workflow
39
- await localOnlyFlow(cwd);
41
+ initSucceeded = await localOnlyFlow(cwd);
40
42
  }
41
43
  else {
42
44
  // INIT-17+: Authenticated workflow
43
- await authenticatedFlow(cwd, options);
45
+ initSucceeded = await authenticatedFlow(cwd, options);
44
46
  }
45
47
  console.log('\nDocumentation: https://docs.dotrequirements.io/getting-started');
46
48
  console.log('By using this service, you agree to our Terms: https://app.dotrequirements.io/terms');
49
+ // Offer to configure AI assistant integration after successful init
50
+ if (initSucceeded) {
51
+ const setupMcp = await promptConfirm('\nConfigure AI assistant integration?', true);
52
+ if (setupMcp) {
53
+ await mcpSetupCommand();
54
+ }
55
+ }
47
56
  }
48
57
  catch (error) {
49
58
  console.error(`\n✗ Error: ${error instanceof Error ? error.message : String(error)}`);
@@ -57,6 +66,7 @@ export async function initCommand(options = {}) {
57
66
  }
58
67
  /**
59
68
  * INIT-3: Local-only workflow - creates folder structure without credentials
69
+ * Returns true if project was created successfully
60
70
  */
61
71
  async function localOnlyFlow(cwd) {
62
72
  console.log('\nInitializing local project...');
@@ -84,9 +94,11 @@ async function localOnlyFlow(cwd) {
84
94
  console.log(' 1. Create requirements in .requirements/ directory');
85
95
  console.log(' 2. Add the test harness to your test setup (see README)');
86
96
  console.log(' 3. Run "dotrequirements link" to connect to cloud features');
97
+ return true;
87
98
  }
88
99
  /**
89
100
  * INIT-17, INIT-18, INIT-7, INIT-4, INIT-6: Authenticated workflow
101
+ * Returns true if project was created/connected successfully
90
102
  */
91
103
  async function authenticatedFlow(cwd, options) {
92
104
  // INIT-17: Inline OAuth (no persistent tokens)
@@ -100,7 +112,7 @@ async function authenticatedFlow(cwd, options) {
100
112
  // INIT-17.3: OAuth failed
101
113
  console.error('\nAuthentication failed:', error instanceof Error ? error.message : String(error));
102
114
  console.log('Please try again later.\n');
103
- return;
115
+ return false;
104
116
  }
105
117
  // Set up authenticated client using the session token
106
118
  const client = new ConvexHttpClient(getConvexUrl());
@@ -110,13 +122,13 @@ async function authenticatedFlow(cwd, options) {
110
122
  if (selectedTeam === undefined) {
111
123
  // User cancelled
112
124
  console.log('Initialization cancelled.');
113
- return;
125
+ return false;
114
126
  }
115
127
  // INIT-7: Choose between create and connect
116
128
  const projectChoice = await chooseProjectAction(client, selectedTeam.teamId);
117
129
  if (!projectChoice) {
118
130
  console.log('Initialization cancelled.');
119
- return;
131
+ return false;
120
132
  }
121
133
  if (projectChoice === 'create') {
122
134
  await createNewProjectFlow(cwd, client, selectedTeam, options);
@@ -124,6 +136,7 @@ async function authenticatedFlow(cwd, options) {
124
136
  else {
125
137
  await connectExistingProjectFlow(cwd, client, selectedTeam);
126
138
  }
139
+ return true;
127
140
  }
128
141
  /**
129
142
  * INIT-18: Prompt user to select a team after OAuth
@@ -3,8 +3,9 @@
3
3
  * This allows AI assistants to query requirements data
4
4
  */
5
5
  export async function mcpCommand() {
6
- // Import the MCP server - this starts it automatically
6
+ // Import and start the MCP server
7
7
  // The server handles stdio transport and runs until process termination
8
- await import('../mcp/index.js');
8
+ const { main } = await import('../mcp/index.js');
9
+ await main();
9
10
  }
10
11
  //# sourceMappingURL=mcp.js.map
@@ -41,4 +41,5 @@ export declare const server: Server<{
41
41
  } | undefined;
42
42
  } | undefined;
43
43
  }>;
44
+ export declare function main(): Promise<void>;
44
45
  //# sourceMappingURL=index.d.ts.map
package/dist/mcp/index.js CHANGED
@@ -611,8 +611,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
611
611
  };
612
612
  }
613
613
  });
614
- // Start server
615
- async function main() {
614
+ // Start server (exported for CLI command to call directly)
615
+ export async function main() {
616
616
  const transport = new StdioServerTransport();
617
617
  await server.connect(transport);
618
618
  console.error('dot•requirements MCP server running');
@@ -1,12 +1,12 @@
1
- ## Requirements-First Development
1
+ ## Requirements-Driven Development
2
2
 
3
3
  This project uses dotrequirements for requirements tracking. Requirements live in `.requirements/*.requirements.md`.
4
4
 
5
5
  ### Workflow
6
6
 
7
- When adding new functionality (not bug fixes or refactoring):
7
+ **ALWAYS follow this workflow when changing system behavior** (new features, bug fixes, any behavioral change). Only pure refactoring (same behavior, different code) may skip requirements.
8
8
 
9
- 1. **Draft requirements** - Write in `.requirements/*.requirements.md`
9
+ 1. **Find or write requirements** - Check `.requirements/` for existing specs; write new ones if needed
10
10
  2. **Style-check** - Run `mcp__dotrequirements__style_check` on the file
11
11
  3. **Get approval** - Present requirements, wait for go-ahead
12
12
  4. **Implement** - Build the feature
@@ -18,16 +18,15 @@ When adding new functionality (not bug fixes or refactoring):
18
18
 
19
19
  ```dotrequirements
20
20
  REQ-ID: Short description of expected behavior
21
- 0. Given -> Precondition that must be true
22
- 1. When -> Action or trigger
23
- 2. Then -> Expected outcome
24
- 2.0. And -> Additional outcome detail
21
+ 0. -> First criterion or condition
22
+ 1. -> Second criterion
23
+ 1.0. -> Nested detail under second criterion
25
24
  ```
26
25
 
27
26
  - First line: `KEY: description`
28
- - Criteria: `position. Label -> content` (Given/When/Then structure)
27
+ - Criteria: `position. -> content` (optional label before the arrow)
29
28
  - Nesting: Indent with 2 spaces, use `x.y` position paths
30
- - Delimiter: `->` or the arrow character
29
+ - Delimiter: `->` or `→`
31
30
 
32
31
  ### Test Usage
33
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popoverai/dotrequirements",
3
- "version": "0.17.1",
3
+ "version": "0.18.0",
4
4
  "description": "Requirements tracking CLI, test harness, and MCP server",
5
5
  "type": "module",
6
6
  "bin": {