@dewtech/dare-cli 2.17.0 → 3.0.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 +98 -3
- package/dist/__tests__/confidence.test.d.ts +2 -0
- package/dist/__tests__/confidence.test.d.ts.map +1 -0
- package/dist/__tests__/confidence.test.js +73 -0
- package/dist/__tests__/confidence.test.js.map +1 -0
- package/dist/__tests__/datamodel.test.d.ts +2 -0
- package/dist/__tests__/datamodel.test.d.ts.map +1 -0
- package/dist/__tests__/datamodel.test.js +131 -0
- package/dist/__tests__/datamodel.test.js.map +1 -0
- package/dist/__tests__/dna-detector.test.d.ts +2 -0
- package/dist/__tests__/dna-detector.test.d.ts.map +1 -0
- package/dist/__tests__/dna-detector.test.js +97 -0
- package/dist/__tests__/dna-detector.test.js.map +1 -0
- package/dist/__tests__/dna-facts.test.d.ts +2 -0
- package/dist/__tests__/dna-facts.test.d.ts.map +1 -0
- package/dist/__tests__/dna-facts.test.js +44 -0
- package/dist/__tests__/dna-facts.test.js.map +1 -0
- package/dist/__tests__/graph-renderer.test.d.ts +2 -0
- package/dist/__tests__/graph-renderer.test.d.ts.map +1 -0
- package/dist/__tests__/graph-renderer.test.js +85 -0
- package/dist/__tests__/graph-renderer.test.js.map +1 -0
- package/dist/__tests__/migration.test.d.ts +2 -0
- package/dist/__tests__/migration.test.d.ts.map +1 -0
- package/dist/__tests__/migration.test.js +77 -0
- package/dist/__tests__/migration.test.js.map +1 -0
- package/dist/__tests__/module-detector.test.d.ts +2 -0
- package/dist/__tests__/module-detector.test.d.ts.map +1 -0
- package/dist/__tests__/module-detector.test.js +83 -0
- package/dist/__tests__/module-detector.test.js.map +1 -0
- package/dist/__tests__/refine.test.js +49 -49
- package/dist/__tests__/reverse-facts.test.d.ts +2 -0
- package/dist/__tests__/reverse-facts.test.d.ts.map +1 -0
- package/dist/__tests__/reverse-facts.test.js +78 -0
- package/dist/__tests__/reverse-facts.test.js.map +1 -0
- package/dist/__tests__/review.test.js +38 -38
- package/dist/__tests__/validate.test.js +65 -65
- package/dist/bin/dare.js +32 -3
- package/dist/bin/dare.js.map +1 -1
- package/dist/commands/blueprint.js +122 -122
- package/dist/commands/dag.d.ts.map +1 -1
- package/dist/commands/dag.js +43 -79
- package/dist/commands/dag.js.map +1 -1
- package/dist/commands/dna.d.ts +3 -0
- package/dist/commands/dna.d.ts.map +1 -0
- package/dist/commands/dna.js +69 -0
- package/dist/commands/dna.js.map +1 -0
- package/dist/commands/migrate.d.ts +3 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +101 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/new.d.ts +16 -0
- package/dist/commands/new.d.ts.map +1 -0
- package/dist/commands/new.js +103 -0
- package/dist/commands/new.js.map +1 -0
- package/dist/commands/reverse.d.ts +3 -0
- package/dist/commands/reverse.d.ts.map +1 -0
- package/dist/commands/reverse.js +201 -0
- package/dist/commands/reverse.js.map +1 -0
- package/dist/commands/welcome.d.ts +14 -0
- package/dist/commands/welcome.d.ts.map +1 -0
- package/dist/commands/welcome.js +29 -0
- package/dist/commands/welcome.js.map +1 -0
- package/dist/skills/commands/add.d.ts +23 -0
- package/dist/skills/commands/add.d.ts.map +1 -0
- package/dist/skills/commands/add.js +206 -0
- package/dist/skills/commands/add.js.map +1 -0
- package/dist/skills/commands/info.d.ts +14 -0
- package/dist/skills/commands/info.d.ts.map +1 -0
- package/dist/skills/commands/info.js +99 -0
- package/dist/skills/commands/info.js.map +1 -0
- package/dist/skills/commands/list.d.ts +19 -0
- package/dist/skills/commands/list.d.ts.map +1 -0
- package/dist/skills/commands/list.js +163 -0
- package/dist/skills/commands/list.js.map +1 -0
- package/dist/skills/commands/publish.d.ts +56 -0
- package/dist/skills/commands/publish.d.ts.map +1 -0
- package/dist/skills/commands/publish.js +272 -0
- package/dist/skills/commands/publish.js.map +1 -0
- package/dist/skills/commands/remove.d.ts +19 -0
- package/dist/skills/commands/remove.d.ts.map +1 -0
- package/dist/skills/commands/remove.js +96 -0
- package/dist/skills/commands/remove.js.map +1 -0
- package/dist/skills/commands/update.d.ts +31 -0
- package/dist/skills/commands/update.d.ts.map +1 -0
- package/dist/skills/commands/update.js +132 -0
- package/dist/skills/commands/update.js.map +1 -0
- package/dist/skills/index.d.ts +22 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +33 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/manifest.d.ts +54 -0
- package/dist/skills/manifest.d.ts.map +1 -0
- package/dist/skills/manifest.js +162 -0
- package/dist/skills/manifest.js.map +1 -0
- package/dist/skills/registry-local.d.ts +67 -0
- package/dist/skills/registry-local.d.ts.map +1 -0
- package/dist/skills/registry-local.js +130 -0
- package/dist/skills/registry-local.js.map +1 -0
- package/dist/skills/registry-mock.json +109 -0
- package/dist/skills/registry-remote.d.ts +110 -0
- package/dist/skills/registry-remote.d.ts.map +1 -0
- package/dist/skills/registry-remote.js +246 -0
- package/dist/skills/registry-remote.js.map +1 -0
- package/dist/skills/registry.d.ts +49 -0
- package/dist/skills/registry.d.ts.map +1 -0
- package/dist/skills/registry.js +94 -0
- package/dist/skills/registry.js.map +1 -0
- package/dist/skills/tests/manifest.spec.d.ts +8 -0
- package/dist/skills/tests/manifest.spec.d.ts.map +1 -0
- package/dist/skills/tests/manifest.spec.js +176 -0
- package/dist/skills/tests/manifest.spec.js.map +1 -0
- package/dist/skills/tests/publish.spec.d.ts +12 -0
- package/dist/skills/tests/publish.spec.d.ts.map +1 -0
- package/dist/skills/tests/publish.spec.js +276 -0
- package/dist/skills/tests/publish.spec.js.map +1 -0
- package/dist/skills/tests/registry-local.spec.d.ts +8 -0
- package/dist/skills/tests/registry-local.spec.d.ts.map +1 -0
- package/dist/skills/tests/registry-local.spec.js +231 -0
- package/dist/skills/tests/registry-local.spec.js.map +1 -0
- package/dist/skills/tests/registry.spec.d.ts +7 -0
- package/dist/skills/tests/registry.spec.d.ts.map +1 -0
- package/dist/skills/tests/registry.spec.js +58 -0
- package/dist/skills/tests/registry.spec.js.map +1 -0
- package/dist/skills/tests/remote-registry.spec.d.ts +9 -0
- package/dist/skills/tests/remote-registry.spec.d.ts.map +1 -0
- package/dist/skills/tests/remote-registry.spec.js +357 -0
- package/dist/skills/tests/remote-registry.spec.js.map +1 -0
- package/dist/skills/tests/update.spec.d.ts +9 -0
- package/dist/skills/tests/update.spec.d.ts.map +1 -0
- package/dist/skills/tests/update.spec.js +166 -0
- package/dist/skills/tests/update.spec.js.map +1 -0
- package/dist/utils/banner.d.ts +28 -0
- package/dist/utils/banner.d.ts.map +1 -0
- package/dist/utils/banner.js +77 -0
- package/dist/utils/banner.js.map +1 -0
- package/dist/utils/banner.spec.d.ts +5 -0
- package/dist/utils/banner.spec.d.ts.map +1 -0
- package/dist/utils/banner.spec.js +253 -0
- package/dist/utils/banner.spec.js.map +1 -0
- package/dist/utils/confidence.d.ts +41 -0
- package/dist/utils/confidence.d.ts.map +1 -0
- package/dist/utils/confidence.js +101 -0
- package/dist/utils/confidence.js.map +1 -0
- package/dist/utils/datamodel.d.ts +41 -0
- package/dist/utils/datamodel.d.ts.map +1 -0
- package/dist/utils/datamodel.js +535 -0
- package/dist/utils/datamodel.js.map +1 -0
- package/dist/utils/dna-detector.d.ts +61 -0
- package/dist/utils/dna-detector.d.ts.map +1 -0
- package/dist/utils/dna-detector.js +354 -0
- package/dist/utils/dna-detector.js.map +1 -0
- package/dist/utils/dna-facts.d.ts +13 -0
- package/dist/utils/dna-facts.d.ts.map +1 -0
- package/dist/utils/dna-facts.js +109 -0
- package/dist/utils/dna-facts.js.map +1 -0
- package/dist/utils/excalidraw-renderer.d.ts +11 -71
- package/dist/utils/excalidraw-renderer.d.ts.map +1 -1
- package/dist/utils/excalidraw-renderer.js +29 -162
- package/dist/utils/excalidraw-renderer.js.map +1 -1
- package/dist/utils/graph-renderer.d.ts +115 -0
- package/dist/utils/graph-renderer.d.ts.map +1 -0
- package/dist/utils/graph-renderer.js +216 -0
- package/dist/utils/graph-renderer.js.map +1 -0
- package/dist/utils/migration.d.ts +64 -0
- package/dist/utils/migration.d.ts.map +1 -0
- package/dist/utils/migration.js +183 -0
- package/dist/utils/migration.js.map +1 -0
- package/dist/utils/module-detector.d.ts +46 -0
- package/dist/utils/module-detector.d.ts.map +1 -0
- package/dist/utils/module-detector.js +348 -0
- package/dist/utils/module-detector.js.map +1 -0
- package/dist/utils/project-generator.js +252 -252
- package/dist/utils/reverse-facts.d.ts +50 -0
- package/dist/utils/reverse-facts.d.ts.map +1 -0
- package/dist/utils/reverse-facts.js +291 -0
- package/dist/utils/reverse-facts.js.map +1 -0
- package/dist/utils/stack-bootstrap.js +371 -371
- package/package.json +8 -3
- package/templates/DARE-dag-example.yaml +280 -280
- package/templates/UPDATE-MANIFEST.json +48 -48
- package/templates/backend/node-nestjs/.env.example +9 -9
- package/templates/backend/node-nestjs/nest-cli.json +8 -8
- package/templates/backend/node-nestjs/package.json +50 -50
- package/templates/backend/node-nestjs/src/app.controller.ts +12 -12
- package/templates/backend/node-nestjs/src/app.module.ts +15 -15
- package/templates/backend/node-nestjs/src/app.service.ts +8 -8
- package/templates/backend/node-nestjs/src/main.ts +24 -24
- package/templates/backend/node-nestjs/tsconfig.json +21 -21
- package/templates/backend/php-laravel/.env.example +22 -22
- package/templates/backend/php-laravel/app/Http/Controllers/HealthController.php +15 -15
- package/templates/backend/php-laravel/composer.json +40 -40
- package/templates/backend/python-fastapi/.env.example +4 -4
- package/templates/backend/python-fastapi/app/api/router.py +8 -8
- package/templates/backend/python-fastapi/app/core/config.py +20 -20
- package/templates/backend/python-fastapi/main.py +35 -35
- package/templates/backend/python-fastapi/requirements.txt +13 -13
- package/templates/backend/rust-axum/.env.example +3 -3
- package/templates/backend/rust-axum/Cargo.toml +23 -23
- package/templates/backend/rust-axum/src/errors.rs +30 -30
- package/templates/backend/rust-axum/src/main.rs +32 -32
- package/templates/backend/rust-axum/src/routes.rs +6 -6
- package/templates/frontend/leptos-csr/.cargo/config.toml +2 -2
- package/templates/frontend/leptos-csr/Cargo.toml +16 -16
- package/templates/frontend/leptos-csr/Trunk.toml +10 -10
- package/templates/frontend/leptos-csr/index.html +11 -11
- package/templates/frontend/leptos-csr/src/lib.rs +20 -20
- package/templates/frontend/leptos-csr/style/main.scss +19 -19
- package/templates/frontend/leptos-fullstack/.cargo/config.toml +4 -4
- package/templates/frontend/leptos-fullstack/Cargo.toml +56 -56
- package/templates/frontend/leptos-fullstack/src/app.rs +49 -49
- package/templates/frontend/leptos-fullstack/src/lib.rs +9 -9
- package/templates/frontend/leptos-fullstack/src/main.rs +29 -29
- package/templates/frontend/leptos-fullstack/style/main.scss +19 -19
- package/templates/frontend/react/index.html +12 -12
- package/templates/frontend/react/package.json +35 -35
- package/templates/frontend/react/src/App.tsx +25 -25
- package/templates/frontend/react/src/main.tsx +9 -9
- package/templates/frontend/vue/package.json +32 -32
- package/templates/frontend/vue/src/App.vue +7 -7
- package/templates/frontend/vue/src/main.ts +10 -10
- package/templates/frontend/vue/src/router/index.ts +14 -14
- package/templates/frontend/vue/src/views/HomeView.vue +6 -6
- package/templates/hooks/pre-commit-dare-validate +24 -24
- package/templates/ide/antigravity/.agents/skills/dare-ax/SKILL.md +152 -0
- package/templates/ide/antigravity/.agents/skills/dare-dag-build/SKILL.md +154 -0
- package/templates/ide/antigravity/.agents/skills/dare-dag-run/SKILL.md +130 -0
- package/templates/ide/antigravity/.agents/skills/dare-dag-runner/SKILL.md +203 -203
- package/templates/ide/antigravity/.agents/skills/dare-dna/SKILL.md +63 -0
- package/templates/ide/antigravity/.agents/skills/dare-docker/SKILL.md +315 -0
- package/templates/ide/antigravity/.agents/skills/dare-frontend-design/SKILL.md +192 -0
- package/templates/ide/antigravity/.agents/skills/dare-laravel-api/SKILL.md +337 -0
- package/templates/ide/antigravity/.agents/skills/dare-layered-design/SKILL.md +166 -0
- package/templates/ide/antigravity/.agents/skills/dare-llm-integration/SKILL.md +217 -0
- package/templates/ide/antigravity/.agents/skills/dare-migrate/SKILL.md +61 -0
- package/templates/ide/antigravity/.agents/skills/dare-quality-telemetry/SKILL.md +187 -0
- package/templates/ide/antigravity/.agents/skills/dare-realtime/SKILL.md +217 -0
- package/templates/ide/antigravity/.agents/skills/dare-refine/SKILL.md +114 -114
- package/templates/ide/antigravity/.agents/skills/dare-reverse/SKILL.md +108 -0
- package/templates/ide/antigravity/.agents/skills/dare-review/SKILL.md +111 -111
- package/templates/ide/antigravity/.agents/skills/dare-rust-leptos/SKILL.md +263 -0
- package/templates/ide/antigravity/.agents/skills/dare-rust-workspace/SKILL.md +275 -275
- package/templates/ide/antigravity/.agents/skills/dare-security/SKILL.md +274 -0
- package/templates/ide/antigravity/.agents/skills/dare-tasks/SKILL.md +265 -265
- package/templates/ide/antigravity/.agents/skills/dare-telemetry/SKILL.md +188 -0
- package/templates/ide/antigravity/.agents/skills/skill-fastapi-api/SKILL.md +343 -0
- package/templates/ide/antigravity/.agents/skills/skill-go-gin-api/SKILL.md +377 -0
- package/templates/ide/antigravity/.agents/skills/skill-mcp-server/SKILL.md +382 -0
- package/templates/ide/antigravity/.agents/skills/skill-nestjs-api/SKILL.md +326 -0
- package/templates/ide/antigravity/.agents/skills/skill-rails-api/SKILL.md +393 -0
- package/templates/ide/antigravity/templates/BLUEPRINT-template.md +193 -193
- package/templates/ide/antigravity/templates/DESIGN-template.md +129 -129
- package/templates/ide/antigravity/templates/TASK-SPEC-template.md +141 -141
- package/templates/ide/claude/.claude/commands/dare-ax.md +131 -0
- package/templates/ide/claude/.claude/commands/dare-blueprint.md +134 -134
- package/templates/ide/claude/.claude/commands/dare-bugfix-design.md +119 -0
- package/templates/ide/claude/.claude/commands/dare-dag-build.md +151 -151
- package/templates/ide/claude/.claude/commands/dare-dag-run.md +109 -109
- package/templates/ide/claude/.claude/commands/dare-dag-runner.md +117 -0
- package/templates/ide/claude/.claude/commands/dare-dag-viz.md +197 -197
- package/templates/ide/claude/.claude/commands/dare-design.md +69 -69
- package/templates/ide/claude/.claude/commands/dare-dna.md +75 -0
- package/templates/ide/claude/.claude/commands/dare-docker.md +207 -0
- package/templates/ide/claude/.claude/commands/dare-execute.md +152 -152
- package/templates/ide/claude/.claude/commands/dare-feature-design.md +147 -0
- package/templates/ide/claude/.claude/commands/dare-frontend-design.md +149 -0
- package/templates/ide/claude/.claude/commands/dare-laravel-api.md +211 -0
- package/templates/ide/claude/.claude/commands/dare-layered-design.md +124 -0
- package/templates/ide/claude/.claude/commands/dare-llm-integration.md +148 -0
- package/templates/ide/claude/.claude/commands/dare-migrate.md +72 -0
- package/templates/ide/claude/.claude/commands/dare-quality-telemetry.md +166 -0
- package/templates/ide/claude/.claude/commands/dare-realtime.md +159 -0
- package/templates/ide/claude/.claude/commands/dare-refine.md +145 -145
- package/templates/ide/claude/.claude/commands/dare-reverse.md +139 -0
- package/templates/ide/claude/.claude/commands/dare-review.md +113 -113
- package/templates/ide/claude/.claude/commands/dare-rust-leptos.md +269 -269
- package/templates/ide/claude/.claude/commands/dare-rust-workspace.md +209 -209
- package/templates/ide/claude/.claude/commands/dare-security.md +232 -232
- package/templates/ide/claude/.claude/commands/dare-tasks.md +70 -70
- package/templates/ide/claude/.claude/commands/dare-telemetry.md +132 -0
- package/templates/ide/claude/.claude/commands/skill-fastapi-api.md +205 -0
- package/templates/ide/claude/.claude/commands/skill-go-gin-api.md +232 -0
- package/templates/ide/claude/.claude/commands/skill-mcp-server.md +228 -0
- package/templates/ide/claude/.claude/commands/skill-nestjs-api.md +210 -0
- package/templates/ide/claude/.claude/commands/skill-rails-api.md +236 -0
- package/templates/ide/claude/.claude/settings.example.json +35 -35
- package/templates/ide/claude/CLAUDE.md +146 -146
- package/templates/ide/claude/templates/BLUEPRINT-template.md +193 -193
- package/templates/ide/claude/templates/DESIGN-template.md +129 -129
- package/templates/ide/claude/templates/TASK-SPEC-template.md +141 -141
- package/templates/ide/cursor/.cursor/commands/dag-viz.md +139 -0
- package/templates/ide/cursor/.cursor/commands/generate-blueprint.md +86 -86
- package/templates/ide/cursor/.cursor/commands/generate-design.md +35 -35
- package/templates/ide/cursor/.cursor/commands/generate-tasks.md +184 -184
- package/templates/ide/cursor/.cursor/commands/refine-task.md +107 -107
- package/templates/ide/cursor/.cursor/commands/review-task.md +91 -91
- package/templates/ide/cursor/.cursor/commands/run-dag.md +110 -110
- package/templates/ide/cursor/.cursor/rules/skill-ax.mdc +263 -0
- package/templates/ide/cursor/.cursor/rules/skill-dag-build.mdc +173 -0
- package/templates/ide/cursor/.cursor/rules/skill-dag-run.mdc +134 -0
- package/templates/ide/cursor/.cursor/rules/skill-dag-runner.mdc +221 -221
- package/templates/ide/cursor/.cursor/rules/skill-dna.mdc +63 -0
- package/templates/ide/cursor/.cursor/rules/skill-fastapi-api.mdc +352 -0
- package/templates/ide/cursor/.cursor/rules/skill-frontend-design.mdc +244 -0
- package/templates/ide/cursor/.cursor/rules/skill-go-gin-api.mdc +371 -0
- package/templates/ide/cursor/.cursor/rules/skill-layered-design.mdc +266 -0
- package/templates/ide/cursor/.cursor/rules/skill-llm-integration.mdc +295 -0
- package/templates/ide/cursor/.cursor/rules/skill-mcp-server.mdc +367 -0
- package/templates/ide/cursor/.cursor/rules/skill-migrate.mdc +58 -0
- package/templates/ide/cursor/.cursor/rules/skill-nestjs-api.mdc +346 -0
- package/templates/ide/cursor/.cursor/rules/skill-quality-telemetry.mdc +248 -0
- package/templates/ide/cursor/.cursor/rules/skill-rails-api.mdc +400 -0
- package/templates/ide/cursor/.cursor/rules/skill-realtime.mdc +262 -0
- package/templates/ide/cursor/.cursor/rules/skill-reverse.mdc +107 -0
- package/templates/ide/cursor/.cursor/rules/skill-rust-leptos.mdc +281 -0
- package/templates/ide/cursor/.cursor/rules/skill-rust-workspace.mdc +312 -312
- package/templates/ide/cursor/.cursor/rules/skill-security.mdc +245 -245
- package/templates/ide/cursor/templates/BLUEPRINT-template.md +193 -193
- package/templates/ide/cursor/templates/DESIGN-template.md +129 -129
- package/templates/ide/cursor/templates/TASK-SPEC-template.md +141 -141
- package/templates/shared/docker-compose.yml +41 -41
- package/dist/__tests__/dag-runner/adapters.test.d.ts +0 -2
- package/dist/__tests__/dag-runner/adapters.test.d.ts.map +0 -1
- package/dist/__tests__/dag-runner/adapters.test.js +0 -134
- package/dist/__tests__/dag-runner/adapters.test.js.map +0 -1
- package/dist/dag-runner/adapters/antigravity.d.ts +0 -6
- package/dist/dag-runner/adapters/antigravity.d.ts.map +0 -1
- package/dist/dag-runner/adapters/antigravity.js +0 -54
- package/dist/dag-runner/adapters/antigravity.js.map +0 -1
- package/dist/dag-runner/adapters/claude.d.ts +0 -6
- package/dist/dag-runner/adapters/claude.d.ts.map +0 -1
- package/dist/dag-runner/adapters/claude.js +0 -48
- package/dist/dag-runner/adapters/claude.js.map +0 -1
- package/dist/dag-runner/adapters/cursor.d.ts +0 -6
- package/dist/dag-runner/adapters/cursor.d.ts.map +0 -1
- package/dist/dag-runner/adapters/cursor.js +0 -58
- package/dist/dag-runner/adapters/cursor.js.map +0 -1
- package/dist/dag-runner/adapters/index.d.ts +0 -46
- package/dist/dag-runner/adapters/index.d.ts.map +0 -1
- package/dist/dag-runner/adapters/index.js +0 -55
- package/dist/dag-runner/adapters/index.js.map +0 -1
- package/dist/dag-runner/utils/timeout.d.ts +0 -27
- package/dist/dag-runner/utils/timeout.d.ts.map +0 -1
- package/dist/dag-runner/utils/timeout.js +0 -55
- package/dist/dag-runner/utils/timeout.js.map +0 -1
|
@@ -191,94 +191,94 @@ async function generateMcpTemplate(dir, config) {
|
|
|
191
191
|
const transportSetup = mcpTransport === 'stdio'
|
|
192
192
|
? `const transport = new StdioServerTransport();\nawait server.connect(transport);`
|
|
193
193
|
: `const app = express();\napp.get('/sse', async (req, res) => {\n const transport = new SSEServerTransport('/messages', res);\n await server.connect(transport);\n});\napp.post('/messages', express.json(), (req, res) => { /* message handler */ });\napp.listen(3000, () => console.error('MCP SSE server running on :3000'));`;
|
|
194
|
-
const resourceSection = hasResources ? `
|
|
195
|
-
import {
|
|
196
|
-
ListResourcesRequestSchema,
|
|
197
|
-
ReadResourceRequestSchema,
|
|
198
|
-
} from '@modelcontextprotocol/sdk/types.js';
|
|
199
|
-
|
|
200
|
-
server.setRequestHandler(ListResourcesRequestSchema, async () => ({
|
|
201
|
-
resources: [
|
|
202
|
-
{
|
|
203
|
-
uri: 'resource://example',
|
|
204
|
-
name: 'Example Resource',
|
|
205
|
-
description: 'An example resource',
|
|
206
|
-
mimeType: 'text/plain',
|
|
207
|
-
},
|
|
208
|
-
],
|
|
209
|
-
}));
|
|
210
|
-
|
|
211
|
-
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
212
|
-
if (request.params.uri === 'resource://example') {
|
|
213
|
-
return { contents: [{ uri: request.params.uri, mimeType: 'text/plain', text: 'Example content' }] };
|
|
214
|
-
}
|
|
215
|
-
throw new Error(\`Unknown resource: \${request.params.uri}\`);
|
|
216
|
-
});
|
|
194
|
+
const resourceSection = hasResources ? `
|
|
195
|
+
import {
|
|
196
|
+
ListResourcesRequestSchema,
|
|
197
|
+
ReadResourceRequestSchema,
|
|
198
|
+
} from '@modelcontextprotocol/sdk/types.js';
|
|
199
|
+
|
|
200
|
+
server.setRequestHandler(ListResourcesRequestSchema, async () => ({
|
|
201
|
+
resources: [
|
|
202
|
+
{
|
|
203
|
+
uri: 'resource://example',
|
|
204
|
+
name: 'Example Resource',
|
|
205
|
+
description: 'An example resource',
|
|
206
|
+
mimeType: 'text/plain',
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
}));
|
|
210
|
+
|
|
211
|
+
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
212
|
+
if (request.params.uri === 'resource://example') {
|
|
213
|
+
return { contents: [{ uri: request.params.uri, mimeType: 'text/plain', text: 'Example content' }] };
|
|
214
|
+
}
|
|
215
|
+
throw new Error(\`Unknown resource: \${request.params.uri}\`);
|
|
216
|
+
});
|
|
217
217
|
` : '';
|
|
218
|
-
const promptSection = hasPrompts ? `
|
|
219
|
-
import {
|
|
220
|
-
ListPromptsRequestSchema,
|
|
221
|
-
GetPromptRequestSchema,
|
|
222
|
-
} from '@modelcontextprotocol/sdk/types.js';
|
|
223
|
-
|
|
224
|
-
server.setRequestHandler(ListPromptsRequestSchema, async () => ({
|
|
225
|
-
prompts: [
|
|
226
|
-
{
|
|
227
|
-
name: 'example-prompt',
|
|
228
|
-
description: 'An example prompt template',
|
|
229
|
-
arguments: [{ name: 'topic', description: 'Topic to write about', required: true }],
|
|
230
|
-
},
|
|
231
|
-
],
|
|
232
|
-
}));
|
|
233
|
-
|
|
234
|
-
server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
235
|
-
if (request.params.name === 'example-prompt') {
|
|
236
|
-
const topic = request.params.arguments?.topic ?? 'general';
|
|
237
|
-
return {
|
|
238
|
-
description: 'Example prompt',
|
|
239
|
-
messages: [{ role: 'user', content: { type: 'text', text: \`Write about: \${topic}\` } }],
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
throw new Error(\`Unknown prompt: \${request.params.name}\`);
|
|
243
|
-
});
|
|
218
|
+
const promptSection = hasPrompts ? `
|
|
219
|
+
import {
|
|
220
|
+
ListPromptsRequestSchema,
|
|
221
|
+
GetPromptRequestSchema,
|
|
222
|
+
} from '@modelcontextprotocol/sdk/types.js';
|
|
223
|
+
|
|
224
|
+
server.setRequestHandler(ListPromptsRequestSchema, async () => ({
|
|
225
|
+
prompts: [
|
|
226
|
+
{
|
|
227
|
+
name: 'example-prompt',
|
|
228
|
+
description: 'An example prompt template',
|
|
229
|
+
arguments: [{ name: 'topic', description: 'Topic to write about', required: true }],
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
}));
|
|
233
|
+
|
|
234
|
+
server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
235
|
+
if (request.params.name === 'example-prompt') {
|
|
236
|
+
const topic = request.params.arguments?.topic ?? 'general';
|
|
237
|
+
return {
|
|
238
|
+
description: 'Example prompt',
|
|
239
|
+
messages: [{ role: 'user', content: { type: 'text', text: \`Write about: \${topic}\` } }],
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
throw new Error(\`Unknown prompt: \${request.params.name}\`);
|
|
243
|
+
});
|
|
244
244
|
` : '';
|
|
245
|
-
const indexContent = `import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
246
|
-
${transportImport}
|
|
247
|
-
import {
|
|
248
|
-
CallToolRequestSchema,
|
|
249
|
-
ListToolsRequestSchema,
|
|
250
|
-
} from '@modelcontextprotocol/sdk/types.js';
|
|
251
|
-
|
|
252
|
-
const server = new Server(
|
|
253
|
-
{ name: '${config.name}', version: '0.1.0' },
|
|
254
|
-
{ capabilities: { ${capabilities.join(', ')} } }
|
|
255
|
-
);
|
|
256
|
-
|
|
257
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
258
|
-
tools: [
|
|
259
|
-
{
|
|
260
|
-
name: 'hello',
|
|
261
|
-
description: 'Says hello to a given name',
|
|
262
|
-
inputSchema: {
|
|
263
|
-
type: 'object',
|
|
264
|
-
properties: {
|
|
265
|
-
name: { type: 'string', description: 'Name to greet' },
|
|
266
|
-
},
|
|
267
|
-
required: ['name'],
|
|
268
|
-
},
|
|
269
|
-
},
|
|
270
|
-
],
|
|
271
|
-
}));
|
|
272
|
-
|
|
273
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
274
|
-
if (request.params.name === 'hello') {
|
|
275
|
-
const { name } = request.params.arguments as { name: string };
|
|
276
|
-
return { content: [{ type: 'text', text: \`Hello, \${name}!\` }] };
|
|
277
|
-
}
|
|
278
|
-
throw new Error(\`Unknown tool: \${request.params.name}\`);
|
|
279
|
-
});
|
|
280
|
-
${resourceSection}${promptSection}
|
|
281
|
-
${transportSetup}
|
|
245
|
+
const indexContent = `import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
246
|
+
${transportImport}
|
|
247
|
+
import {
|
|
248
|
+
CallToolRequestSchema,
|
|
249
|
+
ListToolsRequestSchema,
|
|
250
|
+
} from '@modelcontextprotocol/sdk/types.js';
|
|
251
|
+
|
|
252
|
+
const server = new Server(
|
|
253
|
+
{ name: '${config.name}', version: '0.1.0' },
|
|
254
|
+
{ capabilities: { ${capabilities.join(', ')} } }
|
|
255
|
+
);
|
|
256
|
+
|
|
257
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
258
|
+
tools: [
|
|
259
|
+
{
|
|
260
|
+
name: 'hello',
|
|
261
|
+
description: 'Says hello to a given name',
|
|
262
|
+
inputSchema: {
|
|
263
|
+
type: 'object',
|
|
264
|
+
properties: {
|
|
265
|
+
name: { type: 'string', description: 'Name to greet' },
|
|
266
|
+
},
|
|
267
|
+
required: ['name'],
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
],
|
|
271
|
+
}));
|
|
272
|
+
|
|
273
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
274
|
+
if (request.params.name === 'hello') {
|
|
275
|
+
const { name } = request.params.arguments as { name: string };
|
|
276
|
+
return { content: [{ type: 'text', text: \`Hello, \${name}!\` }] };
|
|
277
|
+
}
|
|
278
|
+
throw new Error(\`Unknown tool: \${request.params.name}\`);
|
|
279
|
+
});
|
|
280
|
+
${resourceSection}${promptSection}
|
|
281
|
+
${transportSetup}
|
|
282
282
|
`;
|
|
283
283
|
await fs.writeFile(path.join(dir, 'src', 'index.ts'), indexContent);
|
|
284
284
|
const extraDeps = mcpTransport !== 'stdio' ? { express: '^4.18.0' } : {};
|
|
@@ -324,45 +324,45 @@ ${transportSetup}
|
|
|
324
324
|
// Python MCP
|
|
325
325
|
const hasResources = mcpFeatures.includes('resources');
|
|
326
326
|
const hasPrompts = mcpFeatures.includes('prompts');
|
|
327
|
-
const resourceSection = hasResources ? `
|
|
328
|
-
|
|
329
|
-
@mcp.resource("resource://example")
|
|
330
|
-
def example_resource() -> str:
|
|
331
|
-
"""An example resource."""
|
|
332
|
-
return "Example content"
|
|
327
|
+
const resourceSection = hasResources ? `
|
|
328
|
+
|
|
329
|
+
@mcp.resource("resource://example")
|
|
330
|
+
def example_resource() -> str:
|
|
331
|
+
"""An example resource."""
|
|
332
|
+
return "Example content"
|
|
333
333
|
` : '';
|
|
334
|
-
const promptSection = hasPrompts ? `
|
|
335
|
-
|
|
336
|
-
@mcp.prompt()
|
|
337
|
-
def example_prompt(topic: str) -> str:
|
|
338
|
-
"""An example prompt template."""
|
|
339
|
-
return f"Write about: {topic}"
|
|
334
|
+
const promptSection = hasPrompts ? `
|
|
335
|
+
|
|
336
|
+
@mcp.prompt()
|
|
337
|
+
def example_prompt(topic: str) -> str:
|
|
338
|
+
"""An example prompt template."""
|
|
339
|
+
return f"Write about: {topic}"
|
|
340
340
|
` : '';
|
|
341
341
|
const transportLine = mcpTransport === 'stdio' ? '' : '\n# For SSE transport:\n# mcp.run(transport="sse", host="0.0.0.0", port=8000)\n';
|
|
342
|
-
await fs.writeFile(path.join(dir, 'main.py'), `from mcp.server.fastmcp import FastMCP
|
|
343
|
-
|
|
344
|
-
mcp = FastMCP("${config.name}")
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
@mcp.tool()
|
|
348
|
-
def hello(name: str) -> str:
|
|
349
|
-
"""Says hello to a given name."""
|
|
350
|
-
return f"Hello, {name}!"
|
|
351
|
-
${resourceSection}${promptSection}
|
|
352
|
-
|
|
353
|
-
if __name__ == "__main__":
|
|
354
|
-
mcp.run()${transportLine}
|
|
342
|
+
await fs.writeFile(path.join(dir, 'main.py'), `from mcp.server.fastmcp import FastMCP
|
|
343
|
+
|
|
344
|
+
mcp = FastMCP("${config.name}")
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
@mcp.tool()
|
|
348
|
+
def hello(name: str) -> str:
|
|
349
|
+
"""Says hello to a given name."""
|
|
350
|
+
return f"Hello, {name}!"
|
|
351
|
+
${resourceSection}${promptSection}
|
|
352
|
+
|
|
353
|
+
if __name__ == "__main__":
|
|
354
|
+
mcp.run()${transportLine}
|
|
355
355
|
`);
|
|
356
356
|
await fs.writeFile(path.join(dir, 'requirements.txt'), `mcp>=1.0.0\n`);
|
|
357
|
-
await fs.writeFile(path.join(dir, 'pyproject.toml'), `[project]
|
|
358
|
-
name = "${config.name}"
|
|
359
|
-
version = "0.1.0"
|
|
360
|
-
requires-python = ">=3.11"
|
|
361
|
-
dependencies = ["mcp>=1.0.0"]
|
|
362
|
-
|
|
363
|
-
[build-system]
|
|
364
|
-
requires = ["hatchling"]
|
|
365
|
-
build-backend = "hatchling.build"
|
|
357
|
+
await fs.writeFile(path.join(dir, 'pyproject.toml'), `[project]
|
|
358
|
+
name = "${config.name}"
|
|
359
|
+
version = "0.1.0"
|
|
360
|
+
requires-python = ">=3.11"
|
|
361
|
+
dependencies = ["mcp>=1.0.0"]
|
|
362
|
+
|
|
363
|
+
[build-system]
|
|
364
|
+
requires = ["hatchling"]
|
|
365
|
+
build-backend = "hatchling.build"
|
|
366
366
|
`);
|
|
367
367
|
}
|
|
368
368
|
}
|
|
@@ -432,92 +432,92 @@ async function writeGraphragConfig(dir, config) {
|
|
|
432
432
|
const { graphrag } = config;
|
|
433
433
|
let content;
|
|
434
434
|
if (graphrag === 'sqlite') {
|
|
435
|
-
content = `# DARE Knowledge Graph — SQLite
|
|
436
|
-
backend: sqlite
|
|
437
|
-
|
|
438
|
-
sqlite:
|
|
439
|
-
path: .dare/graph.db
|
|
440
|
-
|
|
441
|
-
# Node types tracked in the graph
|
|
442
|
-
nodes:
|
|
443
|
-
- task
|
|
444
|
-
- file
|
|
445
|
-
- schema
|
|
446
|
-
- endpoint
|
|
447
|
-
- component
|
|
448
|
-
- entity
|
|
449
|
-
- concept
|
|
450
|
-
|
|
451
|
-
# Relationship types
|
|
452
|
-
edges:
|
|
453
|
-
- depends_on
|
|
454
|
-
- implements
|
|
455
|
-
- uses
|
|
456
|
-
- references
|
|
457
|
-
- related_to
|
|
458
|
-
- contains
|
|
459
|
-
- extends
|
|
435
|
+
content = `# DARE Knowledge Graph — SQLite
|
|
436
|
+
backend: sqlite
|
|
437
|
+
|
|
438
|
+
sqlite:
|
|
439
|
+
path: .dare/graph.db
|
|
440
|
+
|
|
441
|
+
# Node types tracked in the graph
|
|
442
|
+
nodes:
|
|
443
|
+
- task
|
|
444
|
+
- file
|
|
445
|
+
- schema
|
|
446
|
+
- endpoint
|
|
447
|
+
- component
|
|
448
|
+
- entity
|
|
449
|
+
- concept
|
|
450
|
+
|
|
451
|
+
# Relationship types
|
|
452
|
+
edges:
|
|
453
|
+
- depends_on
|
|
454
|
+
- implements
|
|
455
|
+
- uses
|
|
456
|
+
- references
|
|
457
|
+
- related_to
|
|
458
|
+
- contains
|
|
459
|
+
- extends
|
|
460
460
|
`;
|
|
461
461
|
}
|
|
462
462
|
else if (graphrag === 'neo4j') {
|
|
463
|
-
content = `# DARE Knowledge Graph — Neo4j
|
|
464
|
-
backend: neo4j
|
|
465
|
-
|
|
466
|
-
neo4j:
|
|
467
|
-
url: http://localhost:7474 # Neo4j HTTP API endpoint (not Bolt)
|
|
468
|
-
database: dare # database name
|
|
469
|
-
username: neo4j
|
|
470
|
-
password: password
|
|
471
|
-
# auth: "Bearer <token>" # alternative to username/password
|
|
472
|
-
|
|
473
|
-
# Node types tracked in the graph
|
|
474
|
-
nodes:
|
|
475
|
-
- task
|
|
476
|
-
- file
|
|
477
|
-
- schema
|
|
478
|
-
- endpoint
|
|
479
|
-
- component
|
|
480
|
-
- entity
|
|
481
|
-
- concept
|
|
482
|
-
|
|
483
|
-
# Relationship types
|
|
484
|
-
edges:
|
|
485
|
-
- depends_on
|
|
486
|
-
- implements
|
|
487
|
-
- uses
|
|
488
|
-
- references
|
|
489
|
-
- related_to
|
|
490
|
-
- contains
|
|
491
|
-
- extends
|
|
463
|
+
content = `# DARE Knowledge Graph — Neo4j
|
|
464
|
+
backend: neo4j
|
|
465
|
+
|
|
466
|
+
neo4j:
|
|
467
|
+
url: http://localhost:7474 # Neo4j HTTP API endpoint (not Bolt)
|
|
468
|
+
database: dare # database name
|
|
469
|
+
username: neo4j
|
|
470
|
+
password: password
|
|
471
|
+
# auth: "Bearer <token>" # alternative to username/password
|
|
472
|
+
|
|
473
|
+
# Node types tracked in the graph
|
|
474
|
+
nodes:
|
|
475
|
+
- task
|
|
476
|
+
- file
|
|
477
|
+
- schema
|
|
478
|
+
- endpoint
|
|
479
|
+
- component
|
|
480
|
+
- entity
|
|
481
|
+
- concept
|
|
482
|
+
|
|
483
|
+
# Relationship types
|
|
484
|
+
edges:
|
|
485
|
+
- depends_on
|
|
486
|
+
- implements
|
|
487
|
+
- uses
|
|
488
|
+
- references
|
|
489
|
+
- related_to
|
|
490
|
+
- contains
|
|
491
|
+
- extends
|
|
492
492
|
`;
|
|
493
493
|
}
|
|
494
494
|
else {
|
|
495
495
|
// json
|
|
496
|
-
content = `# DARE Knowledge Graph — JSON
|
|
497
|
-
backend: json
|
|
498
|
-
|
|
499
|
-
json:
|
|
500
|
-
path: .dare/graph.json
|
|
501
|
-
|
|
502
|
-
# Node types tracked in the graph
|
|
503
|
-
nodes:
|
|
504
|
-
- task
|
|
505
|
-
- file
|
|
506
|
-
- schema
|
|
507
|
-
- endpoint
|
|
508
|
-
- component
|
|
509
|
-
- entity
|
|
510
|
-
- concept
|
|
511
|
-
|
|
512
|
-
# Relationship types
|
|
513
|
-
edges:
|
|
514
|
-
- depends_on
|
|
515
|
-
- implements
|
|
516
|
-
- uses
|
|
517
|
-
- references
|
|
518
|
-
- related_to
|
|
519
|
-
- contains
|
|
520
|
-
- extends
|
|
496
|
+
content = `# DARE Knowledge Graph — JSON
|
|
497
|
+
backend: json
|
|
498
|
+
|
|
499
|
+
json:
|
|
500
|
+
path: .dare/graph.json
|
|
501
|
+
|
|
502
|
+
# Node types tracked in the graph
|
|
503
|
+
nodes:
|
|
504
|
+
- task
|
|
505
|
+
- file
|
|
506
|
+
- schema
|
|
507
|
+
- endpoint
|
|
508
|
+
- component
|
|
509
|
+
- entity
|
|
510
|
+
- concept
|
|
511
|
+
|
|
512
|
+
# Relationship types
|
|
513
|
+
edges:
|
|
514
|
+
- depends_on
|
|
515
|
+
- implements
|
|
516
|
+
- uses
|
|
517
|
+
- references
|
|
518
|
+
- related_to
|
|
519
|
+
- contains
|
|
520
|
+
- extends
|
|
521
521
|
`;
|
|
522
522
|
}
|
|
523
523
|
const destPath = path.join(dir, 'dare-graph.yml');
|
|
@@ -639,27 +639,27 @@ async function generateFrontendTemplate(dir, stack, projectName = 'frontend') {
|
|
|
639
639
|
}
|
|
640
640
|
function generateMcpStackSkill(language) {
|
|
641
641
|
if (language === 'python') {
|
|
642
|
-
return `---
|
|
643
|
-
description: Python MCP server development skill
|
|
644
|
-
---
|
|
645
|
-
# Python MCP Skill
|
|
646
|
-
- Use FastMCP for rapid server development
|
|
647
|
-
- Decorate tools with @mcp.tool(), resources with @mcp.resource(), prompts with @mcp.prompt()
|
|
648
|
-
- Use type hints — FastMCP derives the JSON schema automatically
|
|
649
|
-
- Test with: npx @modelcontextprotocol/inspector python main.py
|
|
650
|
-
- Use mcp.run() for stdio, mcp.run(transport="sse") for SSE
|
|
642
|
+
return `---
|
|
643
|
+
description: Python MCP server development skill
|
|
644
|
+
---
|
|
645
|
+
# Python MCP Skill
|
|
646
|
+
- Use FastMCP for rapid server development
|
|
647
|
+
- Decorate tools with @mcp.tool(), resources with @mcp.resource(), prompts with @mcp.prompt()
|
|
648
|
+
- Use type hints — FastMCP derives the JSON schema automatically
|
|
649
|
+
- Test with: npx @modelcontextprotocol/inspector python main.py
|
|
650
|
+
- Use mcp.run() for stdio, mcp.run(transport="sse") for SSE
|
|
651
651
|
`;
|
|
652
652
|
}
|
|
653
|
-
return `---
|
|
654
|
-
description: Node.js/TypeScript MCP server development skill
|
|
655
|
-
---
|
|
656
|
-
# TypeScript MCP Skill
|
|
657
|
-
- Import Server from @modelcontextprotocol/sdk/server/index.js
|
|
658
|
-
- Use StdioServerTransport for CLI tools, SSEServerTransport for web integrations
|
|
659
|
-
- Define tools with ListToolsRequestSchema + CallToolRequestSchema handlers
|
|
660
|
-
- Keep inputSchema strict — Claude uses it to call your tools correctly
|
|
661
|
-
- Test with: npm run inspect (uses @modelcontextprotocol/inspector)
|
|
662
|
-
- Build before shipping: npm run build
|
|
653
|
+
return `---
|
|
654
|
+
description: Node.js/TypeScript MCP server development skill
|
|
655
|
+
---
|
|
656
|
+
# TypeScript MCP Skill
|
|
657
|
+
- Import Server from @modelcontextprotocol/sdk/server/index.js
|
|
658
|
+
- Use StdioServerTransport for CLI tools, SSEServerTransport for web integrations
|
|
659
|
+
- Define tools with ListToolsRequestSchema + CallToolRequestSchema handlers
|
|
660
|
+
- Keep inputSchema strict — Claude uses it to call your tools correctly
|
|
661
|
+
- Test with: npm run inspect (uses @modelcontextprotocol/inspector)
|
|
662
|
+
- Build before shipping: npm run build
|
|
663
663
|
`;
|
|
664
664
|
}
|
|
665
665
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -838,9 +838,9 @@ async function createRustFullstackWorkspace(outputDir, projectName, layout, fron
|
|
|
838
838
|
].join('\n'));
|
|
839
839
|
// Root .cargo/config.toml guard
|
|
840
840
|
await fs.ensureDir(path.join(outputDir, '.cargo'));
|
|
841
|
-
await fs.writeFile(path.join(outputDir, '.cargo', 'config.toml'), `# DARE: Do NOT add a global [build] target here.
|
|
842
|
-
# This workspace mixes Leptos WASM crates with native Axum crates.
|
|
843
|
-
# A global target breaks one or the other — cargo-leptos manages wasm32 internally.
|
|
841
|
+
await fs.writeFile(path.join(outputDir, '.cargo', 'config.toml'), `# DARE: Do NOT add a global [build] target here.
|
|
842
|
+
# This workspace mixes Leptos WASM crates with native Axum crates.
|
|
843
|
+
# A global target breaks one or the other — cargo-leptos manages wasm32 internally.
|
|
844
844
|
`);
|
|
845
845
|
// Multi-crate: create core and cli scaffold crates
|
|
846
846
|
if (layout === 'multi') {
|
|
@@ -921,38 +921,38 @@ async function createCliCrate(outputDir, slug) {
|
|
|
921
921
|
}
|
|
922
922
|
function generateStackSkill(stack) {
|
|
923
923
|
const skills = {
|
|
924
|
-
'rust-leptos': `---
|
|
925
|
-
description: Leptos fullstack (SSR + WASM) development skill
|
|
926
|
-
---
|
|
927
|
-
# Leptos Fullstack Skill
|
|
928
|
-
- Use \`#[component]\` macro for all components — no class components
|
|
929
|
-
- State: \`signal()\` (RwSignal), \`ReadSignal\`/\`WriteSignal\` — fine-grained reactivity
|
|
930
|
-
- Async data: \`Resource\` for fetching, never \`Effect\` that calls fetch
|
|
931
|
-
- Mutations: \`Action\` for server calls (forms, submits)
|
|
932
|
-
- Loading states: \`Suspense\` and \`Transition\` — never block the render
|
|
933
|
-
- Conditionals: \`Show\`, \`For\` components — not if/for in view!
|
|
934
|
-
- Server functions: \`#[server]\` macro — only available with \`ssr\` feature
|
|
935
|
-
- Shared types (server + WASM): use \`#[cfg_attr(feature = "ssr", derive(sqlx::FromRow))]\`
|
|
936
|
-
- Avoid: \`tokio::spawn\` on client (no async runtime in WASM), \`panic!\` in components, \`wasm_bindgen\` direct
|
|
937
|
-
- Build: \`cargo leptos build\` (not \`cargo build\`)
|
|
938
|
-
- Test: \`cargo test --workspace\` (not \`cargo leptos test\` — that doesn't exist)
|
|
939
|
-
- Lint: \`cargo clippy --all-targets --all-features -- -D warnings && cargo fmt --check\`
|
|
940
|
-
- Dev server: \`cargo leptos watch\` (port 3000 + hot reload on port 3001)
|
|
924
|
+
'rust-leptos': `---
|
|
925
|
+
description: Leptos fullstack (SSR + WASM) development skill
|
|
926
|
+
---
|
|
927
|
+
# Leptos Fullstack Skill
|
|
928
|
+
- Use \`#[component]\` macro for all components — no class components
|
|
929
|
+
- State: \`signal()\` (RwSignal), \`ReadSignal\`/\`WriteSignal\` — fine-grained reactivity
|
|
930
|
+
- Async data: \`Resource\` for fetching, never \`Effect\` that calls fetch
|
|
931
|
+
- Mutations: \`Action\` for server calls (forms, submits)
|
|
932
|
+
- Loading states: \`Suspense\` and \`Transition\` — never block the render
|
|
933
|
+
- Conditionals: \`Show\`, \`For\` components — not if/for in view!
|
|
934
|
+
- Server functions: \`#[server]\` macro — only available with \`ssr\` feature
|
|
935
|
+
- Shared types (server + WASM): use \`#[cfg_attr(feature = "ssr", derive(sqlx::FromRow))]\`
|
|
936
|
+
- Avoid: \`tokio::spawn\` on client (no async runtime in WASM), \`panic!\` in components, \`wasm_bindgen\` direct
|
|
937
|
+
- Build: \`cargo leptos build\` (not \`cargo build\`)
|
|
938
|
+
- Test: \`cargo test --workspace\` (not \`cargo leptos test\` — that doesn't exist)
|
|
939
|
+
- Lint: \`cargo clippy --all-targets --all-features -- -D warnings && cargo fmt --check\`
|
|
940
|
+
- Dev server: \`cargo leptos watch\` (port 3000 + hot reload on port 3001)
|
|
941
941
|
`,
|
|
942
|
-
'rust-leptos-csr': `---
|
|
943
|
-
description: Leptos CSR (WASM + trunk) development skill
|
|
944
|
-
---
|
|
945
|
-
# Leptos CSR Skill
|
|
946
|
-
- Pure client-side WASM — no server rendering, no \`#[server]\` functions
|
|
947
|
-
- Use \`#[component]\` macro for all components
|
|
948
|
-
- State: \`signal()\`, \`create_memo()\` for derived state
|
|
949
|
-
- Async data: \`Resource\` — never \`Effect\` that calls fetch
|
|
950
|
-
- Entry point: \`leptos::mount::mount_to_body(App)\` called from \`main()\`
|
|
951
|
-
- Build tool: \`trunk build\` (NOT \`cargo leptos build\` — wrong tool for CSR)
|
|
952
|
-
- Dev server: \`trunk serve\` (port 3001 by default, configured in Trunk.toml)
|
|
953
|
-
- Test: \`cargo test --workspace\`
|
|
954
|
-
- Lint: \`cargo clippy --all-targets --all-features -- -D warnings && cargo fmt --check\`
|
|
955
|
-
- Deploy: \`trunk build --release\` produces \`dist/\` — static files, deployable to any CDN
|
|
942
|
+
'rust-leptos-csr': `---
|
|
943
|
+
description: Leptos CSR (WASM + trunk) development skill
|
|
944
|
+
---
|
|
945
|
+
# Leptos CSR Skill
|
|
946
|
+
- Pure client-side WASM — no server rendering, no \`#[server]\` functions
|
|
947
|
+
- Use \`#[component]\` macro for all components
|
|
948
|
+
- State: \`signal()\`, \`create_memo()\` for derived state
|
|
949
|
+
- Async data: \`Resource\` — never \`Effect\` that calls fetch
|
|
950
|
+
- Entry point: \`leptos::mount::mount_to_body(App)\` called from \`main()\`
|
|
951
|
+
- Build tool: \`trunk build\` (NOT \`cargo leptos build\` — wrong tool for CSR)
|
|
952
|
+
- Dev server: \`trunk serve\` (port 3001 by default, configured in Trunk.toml)
|
|
953
|
+
- Test: \`cargo test --workspace\`
|
|
954
|
+
- Lint: \`cargo clippy --all-targets --all-features -- -D warnings && cargo fmt --check\`
|
|
955
|
+
- Deploy: \`trunk build --release\` produces \`dist/\` — static files, deployable to any CDN
|
|
956
956
|
`,
|
|
957
957
|
'rust-axum': `---\ndescription: Rust/Axum API development skill\n---\n# Rust/Axum Skill\n- Use Axum for HTTP routing\n- Use Tokio for async runtime\n- Use SQLx for database\n- Run clippy and cargo test\n`,
|
|
958
958
|
'go-gin': `---\ndescription: Go/Gin API development skill\n---\n# Go + Gin Skill\n- Use Gin for HTTP routing (github.com/gin-gonic/gin)\n- Project layout: cmd/api/main.go (entrypoint), internal/handlers, internal/middleware, internal/services, internal/repository\n- Use context.Context propagation in every handler/service\n- Use struct tags for binding/validation (binding:"required" on DTOs)\n- For SQL: prefer database/sql + sqlx, parametrize ALL queries, no string concat\n- Errors: return wrapped errors (fmt.Errorf("...: %w", err)), not panics\n- Tests: use net/http/httptest + table-driven tests; place *_test.go alongside the package\n- Ralph Loop: \`go build ./...\`, \`go test ./...\`, \`go vet ./...\`\n`,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reverse-engineering fact assembly + artifact skeletons for `dare reverse`.
|
|
3
|
+
*
|
|
4
|
+
* The CLI half of `dare reverse`: it composes deterministic facts (stack +
|
|
5
|
+
* module graph) into `reverse-facts.json`, an `IDEIA.md` index (Phase 0
|
|
6
|
+
* pre-architecture) with an embedded Mermaid module map, one
|
|
7
|
+
* `REVERSE/module-*.md` per module, and an editable `architecture.excalidraw`.
|
|
8
|
+
*
|
|
9
|
+
* Everything semantic — inferred purpose, responsibilities, flow diagrams — is
|
|
10
|
+
* left as `<!-- AGENT: … -->` placeholders for the `/dare-reverse` skill to
|
|
11
|
+
* fill in the IDE. The CLI never calls an LLM.
|
|
12
|
+
*
|
|
13
|
+
* License: MIT (part of DARE CLI).
|
|
14
|
+
*/
|
|
15
|
+
import type { DetectedProject } from './project-detector.js';
|
|
16
|
+
import type { ModuleGraph, ModuleInfo } from './module-detector.js';
|
|
17
|
+
export interface ReverseFacts {
|
|
18
|
+
generatedAt: string;
|
|
19
|
+
project: {
|
|
20
|
+
name: string;
|
|
21
|
+
structure: string;
|
|
22
|
+
backend?: string;
|
|
23
|
+
frontend?: string;
|
|
24
|
+
confidence: string;
|
|
25
|
+
evidence: string[];
|
|
26
|
+
};
|
|
27
|
+
strategy: string;
|
|
28
|
+
summary: {
|
|
29
|
+
moduleCount: number;
|
|
30
|
+
totalFiles: number;
|
|
31
|
+
totalTestFiles: number;
|
|
32
|
+
totalLoc: number;
|
|
33
|
+
};
|
|
34
|
+
modules: ModuleInfo[];
|
|
35
|
+
}
|
|
36
|
+
export declare function buildFacts(detected: DetectedProject, graph: ModuleGraph, generatedAt: string): ReverseFacts;
|
|
37
|
+
export declare function renderModuleMapMermaid(facts: ReverseFacts): string;
|
|
38
|
+
export declare function renderArchitectureExcalidraw(facts: ReverseFacts): string;
|
|
39
|
+
/** Kebab id → numbered module spec filename, e.g. `module-01-auth.md`. */
|
|
40
|
+
export declare function moduleSpecFilename(index: number, mod: ModuleInfo): string;
|
|
41
|
+
export declare function renderIdeiaSkeleton(facts: ReverseFacts, withExcalidraw: boolean): string;
|
|
42
|
+
/** C4 component view — deterministic from the module map. */
|
|
43
|
+
export declare function renderC4Component(facts: ReverseFacts): string;
|
|
44
|
+
export declare function renderDomainRulesSkeleton(generatedAt: string): string;
|
|
45
|
+
export declare function renderStateMachinesSkeleton(generatedAt: string): string;
|
|
46
|
+
export declare function renderPermissionsSkeleton(generatedAt: string): string;
|
|
47
|
+
export declare function renderC4ContextSkeleton(generatedAt: string): string;
|
|
48
|
+
export declare function renderC4ContainerSkeleton(generatedAt: string): string;
|
|
49
|
+
export declare function renderModuleSpecSkeleton(mod: ModuleInfo, index: number, total: number, generatedAt: string): string;
|
|
50
|
+
//# sourceMappingURL=reverse-facts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reverse-facts.d.ts","sourceRoot":"","sources":["../../src/utils/reverse-facts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAc,MAAM,sBAAsB,CAAC;AAQhF,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AASD,wBAAgB,UAAU,CACxB,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,WAAW,EAClB,WAAW,EAAE,MAAM,GAClB,YAAY,CAuBd;AAeD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAOlE;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAKxE;AAID,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,MAAM,CAGzE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,OAAO,GAAG,MAAM,CAiFxF;AAID,6DAA6D;AAC7D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAqB7D;AAiBD,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAKrE;AAED,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAWvE;AAED,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAQrE;AAED,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CASnE;AAED,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CASrE;AAED,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GAClB,MAAM,CA+CR"}
|