@popoverai/dotrequirements 0.13.0 → 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 +47 -47
- package/dist/cli.js +0 -10
- package/dist/commands/init.js +166 -226
- 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 +7 -29
- package/dist/commands/push.js +4 -13
- 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.js +7 -12
- 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 +12 -73
- 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 +35 -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
|
@@ -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,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
|