mycontext-cli 4.2.17 → 4.2.19

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 (123) hide show
  1. package/README.md +423 -60
  2. package/dist/agents/implementations/SolverAgent.d.ts +42 -0
  3. package/dist/agents/implementations/SolverAgent.d.ts.map +1 -0
  4. package/dist/agents/implementations/SolverAgent.js +543 -0
  5. package/dist/agents/implementations/SolverAgent.js.map +1 -0
  6. package/dist/cli.js +129 -0
  7. package/dist/cli.js.map +1 -1
  8. package/dist/clients/ClaudeSDKClient.d.ts +1 -0
  9. package/dist/clients/ClaudeSDKClient.d.ts.map +1 -1
  10. package/dist/clients/ClaudeSDKClient.js +3 -0
  11. package/dist/clients/ClaudeSDKClient.js.map +1 -1
  12. package/dist/clients/MyContextAIClient.d.ts +4 -0
  13. package/dist/clients/MyContextAIClient.d.ts.map +1 -1
  14. package/dist/clients/MyContextAIClient.js +6 -0
  15. package/dist/clients/MyContextAIClient.js.map +1 -1
  16. package/dist/clients/ProviderChain.d.ts +1 -0
  17. package/dist/clients/ProviderChain.d.ts.map +1 -1
  18. package/dist/clients/ProviderChain.js +3 -0
  19. package/dist/clients/ProviderChain.js.map +1 -1
  20. package/dist/clients/XAIClient.d.ts +4 -0
  21. package/dist/clients/XAIClient.d.ts.map +1 -1
  22. package/dist/clients/XAIClient.js +6 -0
  23. package/dist/clients/XAIClient.js.map +1 -1
  24. package/dist/commands/add.d.ts +17 -0
  25. package/dist/commands/add.d.ts.map +1 -0
  26. package/dist/commands/add.js +164 -0
  27. package/dist/commands/add.js.map +1 -0
  28. package/dist/commands/build.d.ts +10 -0
  29. package/dist/commands/build.d.ts.map +1 -0
  30. package/dist/commands/build.js +37 -0
  31. package/dist/commands/build.js.map +1 -0
  32. package/dist/commands/generate-assets.d.ts +11 -0
  33. package/dist/commands/generate-assets.d.ts.map +1 -0
  34. package/dist/commands/generate-assets.js +131 -0
  35. package/dist/commands/generate-assets.js.map +1 -0
  36. package/dist/commands/generate-screens.d.ts +5 -0
  37. package/dist/commands/generate-screens.d.ts.map +1 -1
  38. package/dist/commands/generate-screens.js +160 -12
  39. package/dist/commands/generate-screens.js.map +1 -1
  40. package/dist/commands/generate.d.ts.map +1 -1
  41. package/dist/commands/generate.js +43 -9
  42. package/dist/commands/generate.js.map +1 -1
  43. package/dist/commands/ideate.d.ts +14 -0
  44. package/dist/commands/ideate.d.ts.map +1 -0
  45. package/dist/commands/ideate.js +153 -0
  46. package/dist/commands/ideate.js.map +1 -0
  47. package/dist/commands/init.d.ts +1 -0
  48. package/dist/commands/init.d.ts.map +1 -1
  49. package/dist/commands/init.js +27 -2
  50. package/dist/commands/init.js.map +1 -1
  51. package/dist/commands/migrate-transform.d.ts +16 -0
  52. package/dist/commands/migrate-transform.d.ts.map +1 -0
  53. package/dist/commands/migrate-transform.js +135 -0
  54. package/dist/commands/migrate-transform.js.map +1 -0
  55. package/dist/commands/sync-readme.d.ts +3 -1
  56. package/dist/commands/sync-readme.d.ts.map +1 -1
  57. package/dist/commands/sync-readme.js +57 -59
  58. package/dist/commands/sync-readme.js.map +1 -1
  59. package/dist/commands/vision-test.d.ts.map +1 -1
  60. package/dist/commands/vision-test.js +8 -0
  61. package/dist/commands/vision-test.js.map +1 -1
  62. package/dist/constants/subAgentPersonalities.d.ts.map +1 -1
  63. package/dist/constants/subAgentPersonalities.js +29 -0
  64. package/dist/constants/subAgentPersonalities.js.map +1 -1
  65. package/dist/core/ai/AICore.d.ts +8 -0
  66. package/dist/core/ai/AICore.d.ts.map +1 -1
  67. package/dist/core/ai/AICore.js +50 -1
  68. package/dist/core/ai/AICore.js.map +1 -1
  69. package/dist/core/ai/TokenCostModel.d.ts +37 -0
  70. package/dist/core/ai/TokenCostModel.d.ts.map +1 -0
  71. package/dist/core/ai/TokenCostModel.js +132 -0
  72. package/dist/core/ai/TokenCostModel.js.map +1 -0
  73. package/dist/core/brain/BrainClient.d.ts +13 -1
  74. package/dist/core/brain/BrainClient.d.ts.map +1 -1
  75. package/dist/core/brain/BrainClient.js +49 -0
  76. package/dist/core/brain/BrainClient.js.map +1 -1
  77. package/dist/interfaces/AIClient.d.ts +4 -0
  78. package/dist/interfaces/AIClient.d.ts.map +1 -1
  79. package/dist/interfaces/AIClient.js.map +1 -1
  80. package/dist/services/MonorepoScanner.d.ts +18 -0
  81. package/dist/services/MonorepoScanner.d.ts.map +1 -0
  82. package/dist/services/MonorepoScanner.js +101 -0
  83. package/dist/services/MonorepoScanner.js.map +1 -0
  84. package/dist/services/ProjectScanner.d.ts.map +1 -1
  85. package/dist/services/ProjectScanner.js +7 -0
  86. package/dist/services/ProjectScanner.js.map +1 -1
  87. package/dist/services/ReadmeDeducer.d.ts +14 -0
  88. package/dist/services/ReadmeDeducer.d.ts.map +1 -0
  89. package/dist/services/ReadmeDeducer.js +109 -0
  90. package/dist/services/ReadmeDeducer.js.map +1 -0
  91. package/dist/tui/DashboardMode.d.ts +2 -0
  92. package/dist/tui/DashboardMode.d.ts.map +1 -1
  93. package/dist/tui/DashboardMode.js +116 -1
  94. package/dist/tui/DashboardMode.js.map +1 -1
  95. package/dist/types/constraint.d.ts +123 -0
  96. package/dist/types/constraint.d.ts.map +1 -0
  97. package/dist/types/constraint.js +13 -0
  98. package/dist/types/constraint.js.map +1 -0
  99. package/dist/types/living-context.d.ts +6 -0
  100. package/dist/types/living-context.d.ts.map +1 -1
  101. package/dist/utils/claudeAgentClient.d.ts +4 -0
  102. package/dist/utils/claudeAgentClient.d.ts.map +1 -1
  103. package/dist/utils/claudeAgentClient.js +6 -0
  104. package/dist/utils/claudeAgentClient.js.map +1 -1
  105. package/dist/utils/contextRenderer.d.ts.map +1 -1
  106. package/dist/utils/contextRenderer.js +40 -30
  107. package/dist/utils/contextRenderer.js.map +1 -1
  108. package/dist/utils/geminiClient.d.ts +11 -1
  109. package/dist/utils/geminiClient.d.ts.map +1 -1
  110. package/dist/utils/geminiClient.js +106 -58
  111. package/dist/utils/geminiClient.js.map +1 -1
  112. package/dist/utils/githubModelsClient.d.ts +4 -0
  113. package/dist/utils/githubModelsClient.d.ts.map +1 -1
  114. package/dist/utils/githubModelsClient.js +6 -0
  115. package/dist/utils/githubModelsClient.js.map +1 -1
  116. package/dist/utils/openRouterClient.d.ts +1 -0
  117. package/dist/utils/openRouterClient.d.ts.map +1 -1
  118. package/dist/utils/openRouterClient.js +3 -0
  119. package/dist/utils/openRouterClient.js.map +1 -1
  120. package/package.json +4 -2
  121. package/dist/templates/playbooks/instantdb-integration.md +0 -851
  122. package/dist/templates/playbooks/mpesa-integration.md +0 -652
  123. package/dist/templates/ui-spec-examples.md +0 -318
package/README.md CHANGED
@@ -1,106 +1,469 @@
1
- # MyContext CLI - Deterministic Full-Stack App Compiler
1
+ # mycontext-cli
2
2
 
3
- Transform natural language into production-ready Next.js applications through deterministic compilation.
3
+ > The Context Engine for AI-Native Development.
4
+ > Generate high-fidelity scaffolds, maintain a **Living Brain**, and drive your entire codebase with a single source of truth.
4
5
 
5
- MyContext is not an AI code generator—it's a natural-language-to-project compiler that uses LLMs only for intent parsing, while all code generation is performed by deterministic script templates. No hallucinations. No guessing. Just facts → manifest → complete application.
6
+ [![npm version](https://img.shields.io/npm/v/mycontext-cli)](https://www.npmjs.com/package/mycontext-cli)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
8
 
7
- [![npm version](https://img.shields.io/npm/v/mycontext-cli.svg)](https://www.npmjs.com/package/mycontext-cli)
8
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+ ---
10
+
11
+ ## Table of Contents
12
+
13
+ - [What is MyContext?](#what-is-mycontext)
14
+ - [Installation](#installation)
15
+ - [Quick Start](#quick-start)
16
+ - [Core Concepts](#core-concepts)
17
+ - [Command Reference](#command-reference)
18
+ - [Project Setup](#project-setup)
19
+ - [Living Brain](#living-brain)
20
+ - [AI Agent & Planning](#ai-agent--planning)
21
+ - [Code Generation](#code-generation)
22
+ - [Analysis & Diagnostics](#analysis--diagnostics)
23
+ - [Maintenance](#maintenance)
24
+ - [Typical Workflow](#typical-workflow)
25
+ - [Environment Variables](#environment-variables)
26
+ - [Configuration](#configuration)
27
+
28
+ ---
29
+
30
+ ## What is MyContext?
31
+
32
+ MyContext treats your project spec as a **Living Brain** — a structured JSON document (`.mycontext/context.json`) that describes your app's goals, architecture, components, and design system. Every CLI command reads from and writes back to this Brain, keeping your code and your spec permanently in sync.
33
+
34
+ ---
35
+
36
+ ## Installation
37
+
38
+ ```bash
39
+ npm install -g mycontext-cli
40
+ # or
41
+ pnpm add -g mycontext-cli
42
+ ```
43
+
44
+ Verify:
45
+
46
+ ```bash
47
+ mycontext --version
48
+ ```
9
49
 
10
50
  ---
11
51
 
12
- ## 🧠 Core Philosophy
52
+ ## Quick Start
53
+
54
+ ```bash
55
+ # 1. Go to your project folder (or an empty directory)
56
+ cd my-app
57
+
58
+ # 2. Initialise the Living Brain
59
+ mycontext init
60
+
61
+ # 3. Configure your AI provider
62
+ mycontext setup
63
+
64
+ # 4. Generate the full context from your PRD
65
+ mycontext generate context --full
66
+
67
+ # 5. Scaffold the entire application
68
+ mycontext build
69
+ ```
70
+
71
+ ---
13
72
 
14
- ### Zero-Hallucination Compilation
15
- Most AI tools act as "chat-driven coders" that guess your requirements. MyContext acts as a **Natural Language Compiler**:
16
- 1. **Analyze**: LLM parses your intent into a strict JSON manifest (FSR).
17
- 2. **Clarify**: The CLI identifies gaps and prompts you *before* any code is written.
18
- 3. **Generate**: Deterministic script templates render valid, typed Next.js code.
73
+ ## Core Concepts
19
74
 
20
- ### The Living Brain (`.mycontext/`)
21
- Every project is governed by a local "brain" folder that ensures your code, types, and design tokens never drift:
22
- - `context.json`: The master source of truth for your project features.
23
- - `design_manifest.json`: Your premium design tokens and layout rules.
24
- - `registry/`: Automated tracking of all generated components and actions.
75
+ | Concept | What it is |
76
+ |---|---|
77
+ | **Living Brain** | `.mycontext/context.json` single source of truth for your project |
78
+ | **PRD** | `.mycontext/01-prd.md` your product requirements document |
79
+ | **Design Manifest** | AI-derived design system snapshot |
80
+ | **Sub-agents** | Specialised AI workers (CodeGen, QA, Architect, Security, …) |
81
+ | **FSR** | Feature Spec Record — structured description of a single feature |
25
82
 
26
83
  ---
27
84
 
28
- ## 🚀 NEW: Phase 0.7 Premium Features (VERIFIED ✓)
85
+ ## Command Reference
86
+
87
+ ### Project Setup
88
+
89
+ #### `mycontext init [project-name]`
90
+
91
+ Initialise a new MyContext project. Creates `.mycontext/` with your PRD template, context skeleton, and (optionally) a framework scaffold.
92
+
93
+ ```bash
94
+ mycontext init my-saas-app
95
+ mycontext init --framework nextjs # Next.js + shadcn/ui
96
+ mycontext init --framework instantdb # Next.js + InstantDB + shadcn (default)
97
+ mycontext init --framework other # MyContext files only
98
+ mycontext init --interactive # Guided 100%-complete spec wizard
99
+ mycontext init --spec-only # Context files only, no framework setup
100
+ ```
101
+
102
+ #### `mycontext setup`
103
+
104
+ Configure AI providers (Anthropic, OpenAI, xAI) and your development stack.
105
+
106
+ ```bash
107
+ mycontext setup
108
+ mycontext setup --stack nextjs-tailwind-shadcn
109
+ ```
110
+
111
+ #### `mycontext auth`
112
+
113
+ Authenticate with the MyContext AI cloud service.
114
+
115
+ ```bash
116
+ mycontext auth --login
117
+ mycontext auth --status
118
+ mycontext auth --logout
119
+ ```
120
+
121
+ #### `mycontext setup-shadcn`
122
+
123
+ Add shadcn/ui to an existing project and wire it to the Living Brain.
124
+
125
+ #### `mycontext setup-database`
126
+
127
+ Set up a database provider (InstantDB, Supabase, Firebase) with schema and auth components.
128
+
129
+ ```bash
130
+ mycontext setup-database --provider instantdb
131
+ ```
132
+
133
+ #### `mycontext setup-instantdb`
134
+
135
+ Full InstantDB + MCP integration wizard.
136
+
137
+ ```bash
138
+ mycontext setup-instantdb --app-id <id> --token <token>
139
+ ```
140
+
141
+ #### `mycontext setup-mcp`
142
+
143
+ Configure a Model Context Protocol (MCP) server for AI-powered tooling.
29
144
 
30
- - **Smart Layout Engine**: Autonomic 8/12 grid placement based on component `weight`.
31
- - **Test-Mode Fast-Forward**: Detects `__MYCONTEXT_TEST_MODE__` to speed up animations 60x.
32
- - **Auto-Test Generation**: `mycontext test:generate` creates Playwright specs from your FSR.
33
- - **Density Guardrails**: Visual checks to prevent "rammed UI" and visual clutter.
145
+ ```bash
146
+ mycontext setup-mcp --provider instantdb
147
+ mycontext setup-mcp --provider github
148
+ mycontext setup-mcp --provider custom --server <url>
149
+ ```
34
150
 
35
151
  ---
36
152
 
153
+ ### Living Brain
154
+
155
+ #### `mycontext generate [type]`
156
+
157
+ Orchestrate the Living Brain — generate context files, types, brand tokens, and more.
158
+
159
+ ```bash
160
+ mycontext generate context --full # Full PRD + A/B/C/D context files
161
+ mycontext generate context # Incremental update
162
+ mycontext generate --from-schema # Types from InstantDB schema
163
+ mycontext generate design-prompt # AI design brief
164
+ mycontext generate screens # Screen list from user flows
165
+ mycontext generate components-manifest # Component props + sample data
166
+ mycontext generate actions # UI→backend action hooks
167
+ mycontext generate assets # Planned asset list
168
+ mycontext generate sample-data # Seed data for development
169
+ ```
170
+
171
+ #### `mycontext sync`
172
+
173
+ Auto-update `context.json` and `README.md` by scanning the live codebase.
174
+
175
+ ```bash
176
+ mycontext sync # Sync both
177
+ mycontext sync --context # context.json only
178
+ mycontext sync --readme # README.md only
179
+ mycontext sync --dry-run # Preview changes without writing
180
+ ```
181
+
182
+ #### `mycontext sync-readme`
183
+
184
+ Synchronise the root `README.md` with your design manifest.
185
+
186
+ #### `mycontext validate <target>`
187
+
188
+ Validate your PRD or context files for completeness.
189
+
190
+ ```bash
191
+ mycontext validate prd
192
+ mycontext validate context
193
+ mycontext validate --interactive
194
+ ```
195
+
196
+ #### `mycontext status`
197
+
198
+ Show current project status and progress against the Living Brain.
199
+
200
+ ```bash
201
+ mycontext status
202
+ mycontext status --detailed
203
+ ```
204
+
37
205
  ---
38
206
 
39
- ## 🚀 The Brain-First Workflow
207
+ ### AI Agent & Planning
208
+
209
+ #### `mycontext agent [prompt]`
210
+
211
+ Assess a natural-language prompt against the Living Brain and propose (or apply) changes.
40
212
 
41
- Transforming natural language into project intent involves three core stages, all mediated by the **Living Brain (`.mycontext/context.json`)**.
213
+ ```bash
214
+ mycontext agent "Add a dark mode toggle to the nav"
215
+ mycontext agent "Add a dark mode toggle" --execute # Apply changes
216
+ mycontext agent "..." --execute --yes # Skip confirmation
217
+ ```
218
+
219
+ #### `mycontext plan`
220
+
221
+ Interactive feature planning session — produces an FSR (Feature Spec Record).
42
222
 
43
- ### 1. Initialization (`mycontext init`)
44
- Establish the `.mycontext` directory and establish the source of truth.
45
223
  ```bash
46
- mycontext init --interactive
224
+ mycontext plan
47
225
  ```
48
- *AI auto-infers project framework, core entities, and foundational requirements.*
49
226
 
50
- ### 2. High-Fidelity Sync (`mycontext generate context --full`)
51
- The most critical step. This command performs a unified AI pass to synchronize:
52
- - **Requirements**: Functional and non-functional specs (PRD).
53
- - **Features**: Atomic feature breakdown with technical specifications.
54
- - **Types**: Shared TypeScript entity definitions and database schemas.
55
- - **Brand**: Visual design tokens (colors, typography).
56
- - **Registry**: Auto-discovery of existing code to prevent drift.
227
+ #### `mycontext build-strategy`
228
+
229
+ Generate an AI-powered build strategy and execution plan from the current Brain state.
230
+
231
+ #### `mycontext ideate`
232
+
233
+ Generate creative UI/UX concepts based on project context.
57
234
 
58
235
  ```bash
59
- mycontext generate context --full --description "A removal tool for image backgrounds"
236
+ mycontext ideate --industry fintech --count 5
60
237
  ```
61
238
 
62
- ### 3. Component Orchestration (`mycontext generate-components`)
63
- Render the specifications in the brain into production-ready React code.
239
+ ---
240
+
241
+ ### Code Generation
242
+
243
+ #### `mycontext build`
244
+
245
+ Scaffold the **entire** application from the Living Brain in one shot.
246
+
247
+ ```bash
248
+ mycontext build
249
+ mycontext build --force # Regenerate all components
250
+ ```
251
+
252
+ #### `mycontext build-feature`
253
+
254
+ Build a single feature end-to-end from an FSR.
255
+
256
+ #### `mycontext generate-components [target]`
257
+
258
+ Generate React components from the component manifest.
259
+
64
260
  ```bash
65
- # Generate everything in the brain
66
261
  mycontext generate-components all
262
+ mycontext generate-components --core-only # First 10 components only
263
+ mycontext generate-components --group forms
264
+ mycontext generate-components all --with-tests
265
+ ```
266
+
267
+ #### `mycontext add <component>`
268
+
269
+ Add a context-aware component (shadcn primitive or custom).
270
+
271
+ ```bash
272
+ mycontext add button
273
+ mycontext add UserCard --group cards
274
+ mycontext add dialog --shadcn
275
+ ```
276
+
277
+ #### `mycontext enhance`
278
+
279
+ Enhance the project or specific components with AI suggestions.
280
+
281
+ #### `mycontext refine`
282
+
283
+ Refine context or components.
284
+
285
+ #### `mycontext refine:component <componentName>`
67
286
 
68
- # Or target a specific group
69
- mycontext generate-components gallery
287
+ Refine a single component with targeted AI feedback.
288
+
289
+ ```bash
290
+ mycontext refine:component HeroSection --variant mobile
291
+ mycontext refine:component NavBar --in-place
70
292
  ```
71
293
 
72
- ### 4. Project Cockpit (The Dashboard)
73
- Run `mycontext` without arguments to launch the interactive dashboard.
74
- - **Project Health**: View feature completeness and type coverage.
75
- - **Registry Manager**: Browse generated components and schemas.
76
- - **Sync Trigger**: Instantly refresh the brain from the dashboard.
294
+ #### `mycontext migrate [target]`
295
+
296
+ Migrate components to new standards.
297
+
298
+ ```bash
299
+ mycontext migrate rtl # RTL-friendly logical CSS properties
300
+ mycontext migrate rtl --path src/components/Nav.tsx
301
+ mycontext migrate radix --all # Refactor to Radix/shadcn primitives
302
+ ```
77
303
 
78
304
  ---
79
305
 
80
- ## 🛠️ Diagnostics & Maintenance
306
+ ### Analysis & Diagnostics
307
+
308
+ #### `mycontext analyze`
309
+
310
+ Analyse an **existing** project and generate context files from the live codebase.
311
+
312
+ ```bash
313
+ mycontext analyze
314
+ mycontext analyze --image ./screenshot.png # Analyse a mockup instead
315
+ mycontext analyze --verbose
316
+ ```
317
+
318
+ #### `mycontext design`
319
+
320
+ Design system analysis and manifest generation.
321
+
322
+ ```bash
323
+ mycontext design --analyze
324
+ mycontext design --validate
325
+ mycontext design --summary
326
+ mycontext design --regenerate
327
+ ```
328
+
329
+ #### `mycontext scan`
330
+
331
+ Scan the project tree and assess progress against the Living Brain.
332
+
333
+ ```bash
334
+ mycontext scan
335
+ mycontext scan --assess # AI progress assessment
336
+ mycontext scan --assess --json # Machine-readable output
337
+ ```
338
+
339
+ #### `mycontext health-check`
340
+
341
+ Run health checks across the project.
342
+
343
+ #### `mycontext doctor`
344
+
345
+ Full diagnostic check with auto-fix suggestions.
346
+
347
+ #### `mycontext sanitize`
348
+
349
+ Find and optionally remove redundant, duplicate, or unreachable code.
350
+
351
+ ```bash
352
+ mycontext sanitize
353
+ mycontext sanitize --fix
354
+ mycontext sanitize --verbose
355
+ ```
81
356
 
82
- - **`mycontext doctor`**: Verify project health, type safety, and schema alignment.
83
- - **`mycontext sync --readme`**: Synchronize the root README with the brain's latest design manifest.
84
- - **`mycontext status`**: Quick check of the current project state.
357
+ #### `mycontext generate-todos`
358
+
359
+ Generate a contextual todo list from the project's current state.
360
+
361
+ ```bash
362
+ mycontext generate-todos --count 10 --energy high --complexity moderate
363
+ ```
85
364
 
86
365
  ---
87
366
 
88
- ## 📦 Installation
367
+ ### Maintenance
368
+
369
+ #### `mycontext update`
370
+
371
+ Update the CLI to the latest published version.
372
+
89
373
  ```bash
90
- npm install -g mycontext-cli
374
+ mycontext update
375
+ ```
376
+
377
+ #### `mycontext clean`
378
+
379
+ Clean and repair malformed context files.
380
+
381
+ ```bash
382
+ mycontext clean
383
+ mycontext clean --project ./path/to/project
384
+ ```
385
+
386
+ #### `mycontext help [topic]`
387
+
388
+ Context-aware help for any topic or command.
389
+
390
+ ```bash
391
+ mycontext help
392
+ mycontext help agent
393
+ mycontext help generate --verbose
91
394
  ```
92
395
 
93
396
  ---
94
397
 
95
- ## 🛣️ Roadmap
96
- - [x] **Phase 0.7**: Brain-First Architecture & TUI Dashboard
97
- - [x] **Phase 0.8**: Smart Layout Engine & Deterministic Scaffolding
98
- - [ ] **Phase 1**: Multi-Agent Orchestration (Backend/Security/QA)
99
- - [ ] **Phase 2**: Granular component-level targeted LLM refactors
398
+ ## Typical Workflow
399
+
400
+ ### Starting a new project
401
+
402
+ ```bash
403
+ mkdir my-app && cd my-app
404
+ mycontext init --interactive # Guided spec wizard
405
+ mycontext setup # Configure AI keys
406
+ mycontext generate context --full # Build the Living Brain
407
+ mycontext generate components-manifest
408
+ mycontext build # Scaffold the whole app
409
+ ```
410
+
411
+ ### Adding a feature to an existing project
412
+
413
+ ```bash
414
+ mycontext plan # Describe the feature interactively
415
+ mycontext build-feature # Generate code from the FSR
416
+ mycontext sync # Keep context.json in sync
417
+ ```
418
+
419
+ ### Adopting MyContext on an existing codebase
420
+
421
+ ```bash
422
+ cd existing-project
423
+ mycontext analyze # Reverse-engineer context from code
424
+ mycontext generate context # Fill gaps with AI
425
+ mycontext status # See what's covered
426
+ ```
427
+
428
+ ---
429
+
430
+ ## Environment Variables
431
+
432
+ MyContext loads `.env` files from your project automatically. You can also set these directly:
433
+
434
+ | Variable | Description |
435
+ |---|---|
436
+ | `ANTHROPIC_API_KEY` | Anthropic Claude API key |
437
+ | `OPENAI_API_KEY` | OpenAI API key |
438
+ | `XAI_API_KEY` | xAI (Grok) API key |
439
+ | `MYCONTEXT_API_KEY` | MyContext cloud service key |
440
+ | `INSTANTDB_APP_ID` | InstantDB application ID |
441
+
442
+ Loaded in order (first match wins):
443
+ `.mycontext/.env.local` → `.mycontext/.env` → `.env.local` → `.env`
444
+
445
+ ---
446
+
447
+ ## Configuration
448
+
449
+ All project configuration lives in `.mycontext/`:
450
+
451
+ ```
452
+ .mycontext/
453
+ ├── context.json ← Living Brain (source of truth)
454
+ ├── 01-prd.md ← Product Requirements Document
455
+ ├── .env.local ← Local secrets (git-ignored)
456
+ └── ... ← Generated context files
457
+ ```
458
+
459
+ ---
460
+
461
+ ## Links
462
+
463
+ - [GitHub](https://github.com/farajabien/mycontext-cli)
464
+ - [Issues](https://github.com/farajabien/mycontext-cli/issues)
465
+ - [npm](https://www.npmjs.com/package/mycontext-cli)
100
466
 
101
467
  ---
102
468
 
103
- ## 📄 License & Links
104
- MIT © [MyContext Team](https://github.com/farajabien/mycontext-cli)
105
- - [Documentation](https://mycontext.framer.website)
106
- - [NPM: mycontext-cli](https://www.npmjs.com/package/mycontext-cli)
469
+ *Built with MyContext spec-driven development for the AI era.*
@@ -0,0 +1,42 @@
1
+ /**
2
+ * SolverAgent
3
+ *
4
+ * Research sub-agent that implements Phase 2–4 of the "Structured Reasoning
5
+ * Systems" research plan:
6
+ *
7
+ * NL → LLM → ConstraintSpec (JSON Brain) → Solver → SolveResult + metrics
8
+ *
9
+ * The solver operates in pure TypeScript with no external dependencies so the
10
+ * pipeline can run immediately. Swap the `_nativeSolve` call for a Z3 /
11
+ * OR-Tools binding once you want to scale to harder instances.
12
+ *
13
+ * Key design choices:
14
+ * - Expression evaluation uses a recursive-descent parser (NO eval()).
15
+ * - Three interchangeable strategies: brute-force, constraint-propagation,
16
+ * llm-guided (LLM trims the domain before search).
17
+ * - Every run produces a SolveTrace with operations count, search-space size,
18
+ * pruning ratio — the numbers for Phase 4 / 5 measurement tables.
19
+ */
20
+ import { SubAgent } from "../interfaces/SubAgent";
21
+ import { SolverInput, SolverOutput, ConstraintSpec } from "../../types/constraint";
22
+ export declare class SolverAgent implements SubAgent<SolverInput, SolverOutput> {
23
+ name: string;
24
+ description: string;
25
+ personality: string;
26
+ llmProvider: string;
27
+ expertise: string[];
28
+ private ai;
29
+ constructor();
30
+ validate(input: SolverInput): Promise<boolean>;
31
+ run(input: SolverInput): Promise<SolverOutput>;
32
+ private _translateNL;
33
+ private _llmNarrowDomains;
34
+ getStatus(): Promise<{
35
+ name: string;
36
+ status: "idle";
37
+ errorCount: number;
38
+ successCount: number;
39
+ }>;
40
+ }
41
+ export declare function createFactorizationSpec(N: number): ConstraintSpec;
42
+ //# sourceMappingURL=SolverAgent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SolverAgent.d.ts","sourceRoot":"","sources":["../../../src/agents/implementations/SolverAgent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,cAAc,EAQf,MAAM,wBAAwB,CAAC;AAwbhC,qBAAa,WAAY,YAAW,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;IACrE,IAAI,SAAiB;IACrB,WAAW,SACsJ;IACjK,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB,OAAO,CAAC,EAAE,CAAiB;;IAWrB,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAI9C,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;YAuCtC,YAAY;YAqCZ,iBAAiB;IA8BzB,SAAS;;;;;;CAQhB;AAMD,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,MAAM,GAAG,cAAc,CAqBjE"}