@dewtech/dare-cli 0.1.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 (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +104 -0
  3. package/dist/__tests__/dag-converter.test.d.ts +2 -0
  4. package/dist/__tests__/dag-converter.test.d.ts.map +1 -0
  5. package/dist/__tests__/dag-converter.test.js +134 -0
  6. package/dist/__tests__/dag-converter.test.js.map +1 -0
  7. package/dist/__tests__/validators.test.d.ts +2 -0
  8. package/dist/__tests__/validators.test.d.ts.map +1 -0
  9. package/dist/__tests__/validators.test.js +62 -0
  10. package/dist/__tests__/validators.test.js.map +1 -0
  11. package/dist/bin/dare.d.ts +3 -0
  12. package/dist/bin/dare.d.ts.map +1 -0
  13. package/dist/bin/dare.js +20 -0
  14. package/dist/bin/dare.js.map +1 -0
  15. package/dist/commands/blueprint.d.ts +3 -0
  16. package/dist/commands/blueprint.d.ts.map +1 -0
  17. package/dist/commands/blueprint.js +134 -0
  18. package/dist/commands/blueprint.js.map +1 -0
  19. package/dist/commands/design.d.ts +3 -0
  20. package/dist/commands/design.d.ts.map +1 -0
  21. package/dist/commands/design.js +38 -0
  22. package/dist/commands/design.js.map +1 -0
  23. package/dist/commands/execute.d.ts +3 -0
  24. package/dist/commands/execute.d.ts.map +1 -0
  25. package/dist/commands/execute.js +60 -0
  26. package/dist/commands/execute.js.map +1 -0
  27. package/dist/commands/init.d.ts +3 -0
  28. package/dist/commands/init.d.ts.map +1 -0
  29. package/dist/commands/init.js +112 -0
  30. package/dist/commands/init.js.map +1 -0
  31. package/dist/dag-runner/run_dag.d.ts +32 -0
  32. package/dist/dag-runner/run_dag.d.ts.map +1 -0
  33. package/dist/dag-runner/run_dag.js +160 -0
  34. package/dist/dag-runner/run_dag.js.map +1 -0
  35. package/dist/index.d.ts +10 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +8 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/utils/dag-converter.d.ts +10 -0
  40. package/dist/utils/dag-converter.d.ts.map +1 -0
  41. package/dist/utils/dag-converter.js +46 -0
  42. package/dist/utils/dag-converter.js.map +1 -0
  43. package/dist/utils/project-generator.d.ts +12 -0
  44. package/dist/utils/project-generator.d.ts.map +1 -0
  45. package/dist/utils/project-generator.js +103 -0
  46. package/dist/utils/project-generator.js.map +1 -0
  47. package/dist/utils/templates.d.ts +11 -0
  48. package/dist/utils/templates.d.ts.map +1 -0
  49. package/dist/utils/templates.js +137 -0
  50. package/dist/utils/templates.js.map +1 -0
  51. package/package.json +63 -0
@@ -0,0 +1,137 @@
1
+ export function generateCursorRules(config) {
2
+ const { backend, frontend, graphrag, mcp } = config;
3
+ const backendRules = {
4
+ 'rust-axum': `## Backend: Rust/Axum
5
+ - Use Rust idioms and patterns (no unwrap in production)
6
+ - Prefer async/await with Tokio runtime
7
+ - Use Axum extractors for request handling
8
+ - Handle all errors with thiserror/anyhow
9
+ - Run \`cargo clippy\` and \`cargo test\` before completing any task (Ralph Loop)
10
+ - Use SQLx for database queries with compile-time verification`,
11
+ 'node-nestjs': `## Backend: Node.js/NestJS
12
+ - Use NestJS decorators and dependency injection
13
+ - Define DTOs with class-validator for all inputs
14
+ - Use TypeORM or Prisma for database access
15
+ - Write Jest unit and e2e tests for all services
16
+ - Follow NestJS module structure`,
17
+ 'python-fastapi': `## Backend: Python/FastAPI
18
+ - Use Pydantic v2 for all data validation
19
+ - Type all functions with PEP 484 type hints
20
+ - Use async/await for all IO operations
21
+ - Follow PEP 8 and use ruff for linting
22
+ - Write pytest tests with coverage`,
23
+ 'php-laravel': `## Backend: PHP/Laravel
24
+ - Follow PSR-12 coding standards
25
+ - Use FormRequests for all input validation
26
+ - Use API Resources for all responses
27
+ - Write PHPUnit feature and unit tests
28
+ - Use Eloquent ORM with proper relationships`,
29
+ };
30
+ const frontendRules = {
31
+ react: `## Frontend: React 18+
32
+ - Use functional components with hooks only
33
+ - TypeScript for all components and hooks
34
+ - Prefer React Query for server state management
35
+ - Use Zustand or Context API for client state
36
+ - Write Vitest + Testing Library tests`,
37
+ vue: `## Frontend: Vue 3+
38
+ - Use Composition API with <script setup> syntax
39
+ - TypeScript for all components
40
+ - Use Pinia for state management
41
+ - Use Vue Router for navigation
42
+ - Write Vitest + Vue Test Utils tests`,
43
+ };
44
+ return `# DARE Framework - Cursor Rules
45
+
46
+ ## DARE Methodology
47
+ You are an AI assistant following the DARE methodology:
48
+ - **D**esign: Define requirements and architecture
49
+ - **A**rchitect: Create technical blueprint and task graph
50
+ - **R**eview: Validate implementation against blueprint
51
+ - **E**xecute: Implement tasks following the DAG
52
+
53
+ ## Core Rules
54
+ - Always read DARE/BLUEPRINT.md before implementing any feature
55
+ - Update DARE/TASKS.md status after completing each task
56
+ - Never skip the Ralph Loop (build → test → lint) before marking a task as DONE
57
+ - Human approval is required before merging to main branch
58
+ - Context is king: use MCP Server queries instead of re-reading large files
59
+
60
+ ## Project Structure
61
+ - DARE/ - Methodology files (DESIGN.md, BLUEPRINT.md, TASKS.md, dare-dag.yaml)
62
+ - DARE/EXECUTION/ - Task execution logs
63
+
64
+ ${backend && backendRules[backend] ? backendRules[backend] : ''}
65
+
66
+ ${frontend && frontendRules[frontend] ? frontendRules[frontend] : ''}
67
+
68
+ ## GraphRAG Context (${graphrag})
69
+ ${mcp ? `- Query MCP Server at http://localhost:3000 for context instead of reading full files
70
+ - Use POST /context/query with {"type": "file"|"task"|"dependency", "query": "..."}` : '- Use DARE/BLUEPRINT.md as the single source of truth for context'}
71
+
72
+ ## Ralph Loop (Mandatory before DONE)
73
+ 1. Build the project (cargo build / npm run build / etc)
74
+ 2. Run tests (cargo test / npm test / pytest / etc)
75
+ 3. Run linter (cargo clippy / eslint / ruff / phpstan)
76
+ 4. Only mark task as DONE if all 3 steps pass
77
+ `;
78
+ }
79
+ export function generateAntigravityRules(config) {
80
+ const { backend, frontend, graphrag, mcp } = config;
81
+ return `# DARE Framework - Antigravity Rules
82
+
83
+ ## Agent Configuration
84
+ You are an autonomous AI agent following the DARE methodology.
85
+ Execute tasks from DARE/dare-dag.yaml in parallel when dependencies allow.
86
+
87
+ ## DARE Phases
88
+ - **Design**: Read DARE/DESIGN.md for requirements
89
+ - **Architect**: Read DARE/BLUEPRINT.md for technical spec
90
+ - **Review**: Validate against blueprint before marking DONE
91
+ - **Execute**: Implement tasks, update DARE/TASKS.md
92
+
93
+ ## Stack
94
+ ${backend ? `- Backend: ${backend}` : ''}
95
+ ${frontend ? `- Frontend: ${frontend}` : ''}
96
+
97
+ ## Context Strategy (${graphrag})
98
+ ${mcp ? `- Query MCP Server at http://localhost:3000 for context
99
+ - Avoid reading full files; use targeted queries` : '- Read DARE/BLUEPRINT.md for context'}
100
+
101
+ ## Execution Rules
102
+ - Always check task dependencies before starting
103
+ - Update task status in DARE/TASKS.md in real-time
104
+ - Run Ralph Loop before marking any task as DONE
105
+ - Request human review for architectural decisions
106
+ `;
107
+ }
108
+ export function generateSharedConfig(projectName) {
109
+ return `# DARE - ${projectName}
110
+
111
+ ## Methodology Files
112
+ - **DESIGN.md** - Requirements and goals (Phase D)
113
+ - **BLUEPRINT.md** - Technical architecture (Phase A)
114
+ - **TASKS.md** - Task tracking (Phase E)
115
+ - **dare-dag.yaml** - Task dependency graph (Phase E)
116
+ - **EXECUTION/** - Task execution logs
117
+
118
+ ## Quick Start
119
+ \`\`\`bash
120
+ # 1. Define requirements
121
+ dare design "Describe your feature"
122
+
123
+ # 2. Generate blueprint and task graph
124
+ dare blueprint
125
+
126
+ # 3. Execute tasks in parallel
127
+ dare execute --parallel --runner cursor
128
+ \`\`\`
129
+
130
+ ## Ralph Loop
131
+ Before marking any task as DONE:
132
+ 1. Build ✅
133
+ 2. Test ✅
134
+ 3. Lint ✅
135
+ `;
136
+ }
137
+ //# sourceMappingURL=templates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/utils/templates.ts"],"names":[],"mappings":"AAOA,MAAM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WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B/B,CAAC;AACF,CAAC"}
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@dewtech/dare-cli",
3
+ "version": "0.1.0",
4
+ "description": "DARE Framework CLI - Interactive project setup and task execution",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "bin": {
9
+ "dare": "./dist/bin/dare.js"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "types": "./dist/index.d.ts"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "dependencies": {
21
+ "chalk": "^5.3.0",
22
+ "inquirer": "^9.2.0",
23
+ "fs-extra": "^11.1.1",
24
+ "yaml": "^2.3.1",
25
+ "commander": "^11.0.0",
26
+ "ora": "^7.0.1"
27
+ },
28
+ "devDependencies": {
29
+ "@types/node": "^20.0.0",
30
+ "@types/fs-extra": "^11.0.1",
31
+ "@types/inquirer": "^9.0.3",
32
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
33
+ "@typescript-eslint/parser": "^6.0.0",
34
+ "eslint": "^8.0.0",
35
+ "prettier": "^3.0.0",
36
+ "tsx": "^4.0.0",
37
+ "typescript": "^5.0.0",
38
+ "vitest": "^1.0.0"
39
+ },
40
+ "keywords": [
41
+ "dare",
42
+ "cli",
43
+ "ai-assisted",
44
+ "development"
45
+ ],
46
+ "author": "Dewtech Technologies",
47
+ "license": "MIT",
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "https://github.com/dewtech-technologies/dare-method.git",
51
+ "directory": "packages/cli"
52
+ },
53
+ "engines": {
54
+ "node": ">=18.0.0"
55
+ },
56
+ "scripts": {
57
+ "build": "tsc",
58
+ "dev": "tsx watch src/bin/dare.ts",
59
+ "test": "vitest",
60
+ "lint": "eslint src --ext .ts",
61
+ "format": "prettier --write src"
62
+ }
63
+ }