@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
@@ -1,3 +0,0 @@
1
- <!-- BEGIN dotreq-overview -->
2
- {{OVERVIEW_CORE}}
3
- <!-- END dotreq-overview -->
@@ -1,3 +0,0 @@
1
- <!-- BEGIN dotreq-tests -->
2
- {{TEST_WRITING_CORE}}
3
- <!-- END dotreq-tests -->
@@ -1,25 +0,0 @@
1
- # Requirements Capture
2
-
3
- ALWAYS ask about capturing requirements when the user requests new functionality (not bug fixes or refactoring).
4
-
5
- Ask: "Should we capture what this should do before we build it?"
6
-
7
- If yes, use the MCP tools for requirements writing.
8
-
9
- ## Workflow
10
-
11
- 1. **Ask questions** only if there are major gaps in expected behavior
12
- 2. **Use requirements as alignment** - Get assumptions on paper quickly instead of playing twenty questions
13
- 3. **Think MVP** - Don't expand scope without consulting the user
14
- 4. **After building** - Suggest testing against the requirements using the project's standard testing tools
15
-
16
- Be helpful, consultative, and encouraging; not obstructive.
17
-
18
- ## MCP Tools for Requirements
19
-
20
- - `create_requirement_document` - Get template with codebase-aware format guidance and style principles
21
- - `validate_requirements` - Check syntax before pushing (works offline)
22
- - `style_check` - Get AI feedback on writing quality and clarity
23
- - `push_requirements` - Sync to cloud (shows diff preview, then confirms)
24
-
25
- Note: Users can also explicitly trigger this workflow with `/capture-requirements`.
@@ -1,6 +0,0 @@
1
- ---
2
- name: dotreq-overview
3
- description: Use this to understand what the system is supposed to do. ALWAYS use it when exploring expected behavior.
4
- ---
5
-
6
- {{OVERVIEW_CORE}}
@@ -1,6 +0,0 @@
1
- ---
2
- name: dotreq-requirements
3
- description: Use this when adding new expected behavior to the system. ALWAYS use it when implementing new functionality.
4
- ---
5
-
6
- {{BEHAVIORAL_CORE}}
@@ -1,6 +0,0 @@
1
- ---
2
- name: dotreq-tests
3
- description: Use this when validating expected behavior. ALWAYS use it when writing tests.
4
- ---
5
-
6
- {{TEST_WRITING_CORE}}
@@ -1,3 +0,0 @@
1
- <!-- BEGIN dotreq-requirements -->
2
- {{BEHAVIORAL_CORE}}
3
- <!-- END dotreq-requirements -->
@@ -1,3 +0,0 @@
1
- <!-- BEGIN dotreq-overview -->
2
- {{OVERVIEW_CORE}}
3
- <!-- END dotreq-overview -->
@@ -1,3 +0,0 @@
1
- <!-- BEGIN dotreq-tests -->
2
- {{TEST_WRITING_CORE}}
3
- <!-- END dotreq-tests -->
@@ -1,5 +0,0 @@
1
- ---
2
- description: Use this to understand what the system is supposed to do. ALWAYS use it when exploring expected behavior.
3
- ---
4
-
5
- {{OVERVIEW_CORE}}
@@ -1,5 +0,0 @@
1
- ---
2
- description: Use this when adding new expected behavior to the system. ALWAYS use it when implementing new functionality.
3
- ---
4
-
5
- {{BEHAVIORAL_CORE}}
@@ -1,5 +0,0 @@
1
- ---
2
- description: Use this when validating expected behavior. ALWAYS use it when writing tests.
3
- ---
4
-
5
- {{TEST_WRITING_CORE}}
@@ -1,27 +0,0 @@
1
- # Understanding Expected Behavior
2
-
3
- ALWAYS use this when you want to understand what the system is supposed to do.
4
-
5
- ## Where to Find Expected Behavior
6
-
7
- This project uses **requirements as the source of truth** for expected behavior.
8
-
9
- **Location:** `.requirements/` directory contains `*.requirements.md` files
10
-
11
- **Format:** Requirements are structured as:
12
- - Requirement IDs (e.g., `AUTH-1`, `LOGIN-2`)
13
- - Descriptions of expected behavior
14
- - Hierarchical structure (parent requirements with child criteria)
15
-
16
- ## MCP Tools for Exploration
17
-
18
- - `list_all_requirements` - Get overview of all requirements in the project
19
- - `get_requirement` - Get detailed requirement tree with test coverage
20
- - `search_requirements` - Search by text/regex across all requirements
21
- - `get_requirements_by_test` - See what a test file validates
22
-
23
- ## Next Steps
24
-
25
- Once you understand the expected behavior:
26
- - **Adding new behavior?** Use the `dotreq-requirements` skill
27
- - **Writing tests?** Use the `dotreq-tests` skill
@@ -1,72 +0,0 @@
1
- # Test Writing with Requirements
2
-
3
- ALWAYS use this guidance when writing tests based on requirements.
4
-
5
- ## Core Principle
6
-
7
- Use `requirement()` AS the test description, not in the body or comments.
8
-
9
- ```typescript
10
- // ✅ Good
11
- test(requirement('AUTH-1'), () => { /* test */ });
12
-
13
- // ❌ Bad
14
- test("user can log in", () => { requirement('AUTH-1'); });
15
- ```
16
-
17
- ## Test Structure
18
-
19
- **Match the requirement hierarchy:**
20
-
21
- For structured requirements, nest describe/it blocks:
22
-
23
- ```typescript
24
- describe(requirement('LOGIN-1'), () => {
25
- describe(requirement('LOGIN-1.given'), () => {
26
- // Arrange
27
- });
28
- describe(requirement('LOGIN-1.when'), () => {
29
- // Act
30
- it(requirement('LOGIN-1.then'), () => {
31
- // Assert
32
- });
33
- });
34
- });
35
- ```
36
-
37
- For simple requirements, use a single test block.
38
-
39
- ## Comments
40
-
41
- Comments should describe the TEST implementation, not copy the requirement text verbatim.
42
-
43
- **NEVER document coverage in comments.** Our MCP tools track coverage automatically.
44
-
45
- ```typescript
46
- // ❌ Bad - creates second source of truth
47
- /**
48
- * Requirements coverage:
49
- * - AUTH-9.0: Backend creates project ✓
50
- * - AUTH-9.1: CLI writes to .env.local ✓
51
- */
52
-
53
- // ✅ Good - use MCP tools instead
54
- // Use get_requirement, get_requirements_by_test to see coverage
55
- ```
56
-
57
- ## Workflow
58
-
59
- After writing tests:
60
-
61
- 1. Run tests to ensure they don't throw errors
62
- 2. **ALWAYS run `review_test`** on the test file to validate tests actually check what requirements specify
63
- 3. Fix any issues identified by the review
64
-
65
- ## MCP Tools for Test Writing
66
-
67
- - `get_requirement` - Get requirement tree with existing coverage
68
- - `get_requirements_by_test` - See requirements referenced in a test file
69
- - `list_untested_requirements` - Find requirements without tests
70
- - `review_test` - Validate test actually checks what requirement specifies (run after writing tests)
71
-
72
- Note: Users can also explicitly trigger this workflow with `/write-tests`.
@@ -1,5 +0,0 @@
1
- /**
2
- * Detect if .requirements/ directory exists and extract projectId from files
3
- */
4
- export declare function detectExistingProject(cwd: string): string | null;
5
- //# sourceMappingURL=detect-existing-project.d.ts.map
@@ -1,34 +0,0 @@
1
- import * as fs from 'fs';
2
- import * as path from 'path';
3
- import { parseRequirementsFromFile } from '../schema/index.js';
4
- /**
5
- * Detect if .requirements/ directory exists and extract projectId from files
6
- */
7
- export function detectExistingProject(cwd) {
8
- const requirementsDir = path.join(cwd, '.requirements');
9
- if (!fs.existsSync(requirementsDir)) {
10
- return null;
11
- }
12
- // Look for .requirements.md files
13
- const files = fs.readdirSync(requirementsDir)
14
- .filter(f => f.endsWith('.requirements.md'));
15
- if (files.length === 0) {
16
- return null;
17
- }
18
- // Try to parse first file to get projectId
19
- for (const file of files) {
20
- try {
21
- const filePath = path.join(requirementsDir, file);
22
- const parsed = parseRequirementsFromFile(filePath);
23
- if (parsed.metadata.projectId) {
24
- return parsed.metadata.projectId;
25
- }
26
- }
27
- catch (error) {
28
- // Skip files that can't be parsed
29
- continue;
30
- }
31
- }
32
- return null;
33
- }
34
- //# sourceMappingURL=detect-existing-project.js.map