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.
- package/README.md +423 -60
- package/dist/agents/implementations/SolverAgent.d.ts +42 -0
- package/dist/agents/implementations/SolverAgent.d.ts.map +1 -0
- package/dist/agents/implementations/SolverAgent.js +543 -0
- package/dist/agents/implementations/SolverAgent.js.map +1 -0
- package/dist/cli.js +129 -0
- package/dist/cli.js.map +1 -1
- package/dist/clients/ClaudeSDKClient.d.ts +1 -0
- package/dist/clients/ClaudeSDKClient.d.ts.map +1 -1
- package/dist/clients/ClaudeSDKClient.js +3 -0
- package/dist/clients/ClaudeSDKClient.js.map +1 -1
- package/dist/clients/MyContextAIClient.d.ts +4 -0
- package/dist/clients/MyContextAIClient.d.ts.map +1 -1
- package/dist/clients/MyContextAIClient.js +6 -0
- package/dist/clients/MyContextAIClient.js.map +1 -1
- package/dist/clients/ProviderChain.d.ts +1 -0
- package/dist/clients/ProviderChain.d.ts.map +1 -1
- package/dist/clients/ProviderChain.js +3 -0
- package/dist/clients/ProviderChain.js.map +1 -1
- package/dist/clients/XAIClient.d.ts +4 -0
- package/dist/clients/XAIClient.d.ts.map +1 -1
- package/dist/clients/XAIClient.js +6 -0
- package/dist/clients/XAIClient.js.map +1 -1
- package/dist/commands/add.d.ts +17 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +164 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/build.d.ts +10 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +37 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/generate-assets.d.ts +11 -0
- package/dist/commands/generate-assets.d.ts.map +1 -0
- package/dist/commands/generate-assets.js +131 -0
- package/dist/commands/generate-assets.js.map +1 -0
- package/dist/commands/generate-screens.d.ts +5 -0
- package/dist/commands/generate-screens.d.ts.map +1 -1
- package/dist/commands/generate-screens.js +160 -12
- package/dist/commands/generate-screens.js.map +1 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +43 -9
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/ideate.d.ts +14 -0
- package/dist/commands/ideate.d.ts.map +1 -0
- package/dist/commands/ideate.js +153 -0
- package/dist/commands/ideate.js.map +1 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +27 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/migrate-transform.d.ts +16 -0
- package/dist/commands/migrate-transform.d.ts.map +1 -0
- package/dist/commands/migrate-transform.js +135 -0
- package/dist/commands/migrate-transform.js.map +1 -0
- package/dist/commands/sync-readme.d.ts +3 -1
- package/dist/commands/sync-readme.d.ts.map +1 -1
- package/dist/commands/sync-readme.js +57 -59
- package/dist/commands/sync-readme.js.map +1 -1
- package/dist/commands/vision-test.d.ts.map +1 -1
- package/dist/commands/vision-test.js +8 -0
- package/dist/commands/vision-test.js.map +1 -1
- package/dist/constants/subAgentPersonalities.d.ts.map +1 -1
- package/dist/constants/subAgentPersonalities.js +29 -0
- package/dist/constants/subAgentPersonalities.js.map +1 -1
- package/dist/core/ai/AICore.d.ts +8 -0
- package/dist/core/ai/AICore.d.ts.map +1 -1
- package/dist/core/ai/AICore.js +50 -1
- package/dist/core/ai/AICore.js.map +1 -1
- package/dist/core/ai/TokenCostModel.d.ts +37 -0
- package/dist/core/ai/TokenCostModel.d.ts.map +1 -0
- package/dist/core/ai/TokenCostModel.js +132 -0
- package/dist/core/ai/TokenCostModel.js.map +1 -0
- package/dist/core/brain/BrainClient.d.ts +13 -1
- package/dist/core/brain/BrainClient.d.ts.map +1 -1
- package/dist/core/brain/BrainClient.js +49 -0
- package/dist/core/brain/BrainClient.js.map +1 -1
- package/dist/interfaces/AIClient.d.ts +4 -0
- package/dist/interfaces/AIClient.d.ts.map +1 -1
- package/dist/interfaces/AIClient.js.map +1 -1
- package/dist/services/MonorepoScanner.d.ts +18 -0
- package/dist/services/MonorepoScanner.d.ts.map +1 -0
- package/dist/services/MonorepoScanner.js +101 -0
- package/dist/services/MonorepoScanner.js.map +1 -0
- package/dist/services/ProjectScanner.d.ts.map +1 -1
- package/dist/services/ProjectScanner.js +7 -0
- package/dist/services/ProjectScanner.js.map +1 -1
- package/dist/services/ReadmeDeducer.d.ts +14 -0
- package/dist/services/ReadmeDeducer.d.ts.map +1 -0
- package/dist/services/ReadmeDeducer.js +109 -0
- package/dist/services/ReadmeDeducer.js.map +1 -0
- package/dist/tui/DashboardMode.d.ts +2 -0
- package/dist/tui/DashboardMode.d.ts.map +1 -1
- package/dist/tui/DashboardMode.js +116 -1
- package/dist/tui/DashboardMode.js.map +1 -1
- package/dist/types/constraint.d.ts +123 -0
- package/dist/types/constraint.d.ts.map +1 -0
- package/dist/types/constraint.js +13 -0
- package/dist/types/constraint.js.map +1 -0
- package/dist/types/living-context.d.ts +6 -0
- package/dist/types/living-context.d.ts.map +1 -1
- package/dist/utils/claudeAgentClient.d.ts +4 -0
- package/dist/utils/claudeAgentClient.d.ts.map +1 -1
- package/dist/utils/claudeAgentClient.js +6 -0
- package/dist/utils/claudeAgentClient.js.map +1 -1
- package/dist/utils/contextRenderer.d.ts.map +1 -1
- package/dist/utils/contextRenderer.js +40 -30
- package/dist/utils/contextRenderer.js.map +1 -1
- package/dist/utils/geminiClient.d.ts +11 -1
- package/dist/utils/geminiClient.d.ts.map +1 -1
- package/dist/utils/geminiClient.js +106 -58
- package/dist/utils/geminiClient.js.map +1 -1
- package/dist/utils/githubModelsClient.d.ts +4 -0
- package/dist/utils/githubModelsClient.d.ts.map +1 -1
- package/dist/utils/githubModelsClient.js +6 -0
- package/dist/utils/githubModelsClient.js.map +1 -1
- package/dist/utils/openRouterClient.d.ts +1 -0
- package/dist/utils/openRouterClient.d.ts.map +1 -1
- package/dist/utils/openRouterClient.js +3 -0
- package/dist/utils/openRouterClient.js.map +1 -1
- package/package.json +4 -2
- package/dist/templates/playbooks/instantdb-integration.md +0 -851
- package/dist/templates/playbooks/mpesa-integration.md +0 -652
- package/dist/templates/ui-spec-examples.md +0 -318
package/README.md
CHANGED
|
@@ -1,106 +1,469 @@
|
|
|
1
|
-
#
|
|
1
|
+
# mycontext-cli
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
6
|
+
[](https://www.npmjs.com/package/mycontext-cli)
|
|
7
|
+
[](LICENSE)
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
224
|
+
mycontext plan
|
|
47
225
|
```
|
|
48
|
-
*AI auto-infers project framework, core entities, and foundational requirements.*
|
|
49
226
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
|
236
|
+
mycontext ideate --industry fintech --count 5
|
|
60
237
|
```
|
|
61
238
|
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
69
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
367
|
+
### Maintenance
|
|
368
|
+
|
|
369
|
+
#### `mycontext update`
|
|
370
|
+
|
|
371
|
+
Update the CLI to the latest published version.
|
|
372
|
+
|
|
89
373
|
```bash
|
|
90
|
-
|
|
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
|
-
##
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
-
|
|
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"}
|