mycontext-cli 4.1.4 → 4.1.5

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 CHANGED
@@ -2,34 +2,244 @@
2
2
 
3
3
  **The Command-Line Anchor for Zero-Drift Autonomous Development.**
4
4
 
5
- `mycontext-cli` is the primary interface for Spec-Driven Development. It allows you to initialize projects, generate code from specifications, and evolve your application autonomously through the **Living Brain**.
5
+ `mycontext-cli` is your AI-powered development companion that transforms screenshots into specs, generates production-ready code, and keeps your implementation perfectly aligned with design intent.
6
+
7
+ ## ✨ Key Features
8
+
9
+ 🎯 **Screenshot → Spec** - Reverse-engineer any UI into comprehensive specifications (Powered by Gemini 2.0 Flash)
10
+ 🤖 **Autonomous Code Generation** - AI agents that write code grounded in deterministic specs
11
+ 🔒 **Zero-Drift Development** - Maintain perfect alignment between design intent and implementation
12
+ 📊 **Living DB** - Deterministic manifest that evolves with your project
13
+ 🚀 **Instant Setup** - Initialize Next.js projects with shadcn/ui, InstantDB, and more
14
+
15
+ ---
6
16
 
7
17
  ## 🚀 Installation
8
18
 
9
19
  ```bash
20
+ # Install globally
10
21
  npm install -g mycontext-cli
11
- # or use without installation
22
+
23
+ # Or use without installation
12
24
  npx mycontext-cli init
13
25
  ```
14
26
 
15
- ## 🛠️ Main Commands
27
+ ---
28
+
29
+ ## 🛠️ Commands Reference
16
30
 
17
31
  ### `mycontext init`
18
- Initialize a new project with a **Hard Gravity** anchor. It sets up the `.mycontext` directory and creates your initial `design-manifest.json`.
32
+ Initialize a new project with the MyContext ecosystem.
33
+
34
+ ```bash
35
+ mycontext init
36
+
37
+ # Skip prompts (use defaults)
38
+ mycontext init --yes
39
+ ```
40
+
41
+ **What it does:**
42
+ - Creates `.mycontext/` directory structure
43
+ - Generates initial `design-manifest.json`
44
+ - Sets up shadcn/ui components
45
+ - Optional InstantDB initialization
46
+ - Installs required dependencies
47
+
48
+ ---
49
+
50
+ ### `mycontext analyze <screenshot>`
51
+ Analyze a screenshot and generate comprehensive specifications.
52
+
53
+ ```bash
54
+ mycontext analyze path/to/screenshot.png
55
+
56
+ # Output to specific file
57
+ mycontext analyze screenshot.png --output .mycontext/screen-spec.json
58
+ ```
59
+
60
+ **What it does:**
61
+ - Uses Gemini 2.0 Flash vision model
62
+ - Extracts UI components, layout, and design tokens
63
+ - Generates detailed specifications
64
+ - Updates design manifest
65
+
66
+ ---
67
+
68
+ ### `mycontext generate`
69
+ Generate context files, components, or code from your specifications.
70
+
71
+ ```bash
72
+ # Generate full context for AI coding assistants
73
+ mycontext generate context --full
74
+
75
+ # Generate specific components
76
+ mycontext generate components
77
+
78
+ # Generate Next.js routes from specs
79
+ mycontext generate screens
80
+
81
+ # Generate sample data
82
+ mycontext generate sample-data
83
+ ```
84
+
85
+ **Context files include:**
86
+ - Project overview and architecture
87
+ - Design tokens and component hierarchy
88
+ - Data models and API specifications
89
+ - Current implementation status
90
+
91
+ ---
19
92
 
20
93
  ### `mycontext status`
21
- Perform a "Narrative Compliance" check. It analyzes your project's current state against the Living DB manifest and reports on drift.
94
+ Check narrative compliance - analyze drift between spec and implementation.
95
+
96
+ ```bash
97
+ mycontext status
98
+
99
+ # Detailed report
100
+ mycontext status --verbose
101
+ ```
102
+
103
+ **What it checks:**
104
+ - Design manifest integrity
105
+ - Component implementation status
106
+ - Missing dependencies
107
+ - Configuration issues
108
+
109
+ ---
22
110
 
23
111
  ### `mycontext agent`
24
- The core of the autonomous engine.
25
- - `--plan`: Generate an implementation plan for a new feature.
26
- - `--execute`: Trigger agentic code generation.
112
+ Autonomous development agent for feature implementation.
27
113
 
28
- ### `mycontext generate`
29
- Scaffold specific components, context files, or PRDs based on your design tokens.
114
+ ```bash
115
+ # Generate implementation plan
116
+ mycontext agent --plan "Add user authentication"
117
+
118
+ # Execute autonomous code generation
119
+ mycontext agent --execute "Implement shopping cart"
120
+ ```
121
+
122
+ **Features:**
123
+ - Multi-agent orchestration (Architect, CodeGen, QA, Security)
124
+ - Deterministic prompt construction
125
+ - Context-aware code generation
126
+ - Built-in testing and validation
127
+
128
+ ---
129
+
130
+ ## 🎯 Quick Start Example
131
+
132
+ ```bash
133
+ # 1. Create a new Next.js project
134
+ npx create-next-app my-app
135
+ cd my-app
136
+
137
+ # 2. Initialize MyContext
138
+ npx mycontext-cli init
139
+
140
+ # 3. Configure AI provider (choose one)
141
+ # GitHub Models (Free, High Quality)
142
+ echo 'GITHUB_TOKEN=your-token' >> .mycontext/.env
143
+
144
+ # Or Gemini (Free tier + Vision)
145
+ echo 'GEMINI_API_KEY=your-key' >> .mycontext/.env
146
+
147
+ # 4. Analyze a design screenshot
148
+ mycontext analyze designs/homepage.png
149
+
150
+ # 5. Generate full context for AI assistants
151
+ mycontext generate context --full
152
+
153
+ # 6. Use autonomous agent for feature development
154
+ mycontext agent --plan "Add dark mode toggle"
155
+ ```
156
+
157
+ ---
158
+
159
+ ## 🔧 Configuration
160
+
161
+ ### AI Provider Setup
162
+
163
+ MyContext supports multiple AI providers. Configure in `.mycontext/.env`:
164
+
165
+ **GitHub Models** (Recommended - Free & High Quality)
166
+ ```bash
167
+ GITHUB_TOKEN=ghp_your_token_here
168
+ # Get token: https://github.com/settings/tokens
169
+ ```
170
+
171
+ **Gemini** (Free Tier + Vision for screenshots)
172
+ ```bash
173
+ GEMINI_API_KEY=your_gemini_key
174
+ # Get key: https://aistudio.google.com/apikey
175
+ ```
176
+
177
+ **Claude** (Best for advanced reasoning)
178
+ ```bash
179
+ ANTHROPIC_API_KEY=your_claude_key
180
+ # Get key: https://console.anthropic.com/
181
+ ```
182
+
183
+ **OpenAI**
184
+ ```bash
185
+ OPENAI_API_KEY=your_openai_key
186
+ ```
187
+
188
+ ---
189
+
190
+ ## 📁 Project Structure
191
+
192
+ After running `mycontext init`, your project will have:
193
+
194
+ ```
195
+ .mycontext/
196
+ ├── .env # AI provider configuration
197
+ ├── design-manifest.json # Living DB - source of truth
198
+ ├── context/ # Generated context files
199
+ │ ├── PROJECT_OVERVIEW.md
200
+ │ ├── ARCHITECTURE.md
201
+ │ └── ...
202
+ └── logs/ # Operation logs
203
+ ```
204
+
205
+ ---
30
206
 
31
207
  ## 🎯 The Philosophy: Hard Gravity
32
- Every project starts with a deterministic spec. The CLI ensures that code never drifts from its design intent, providing a "Hard Gravity" anchor that keeps the project cohesive even as it scales beyond human capacity to track every detail.
208
+
209
+ Every project starts with a **deterministic spec**. The CLI ensures that code never drifts from its design intent, providing a "Hard Gravity" anchor that keeps the project cohesive even as it scales beyond human capacity to track every detail.
210
+
211
+ **Zero-Drift Development:**
212
+ 1. **Screenshot → Spec** - AI vision extracts design intent
213
+ 2. **Spec → Code** - Agents generate implementation
214
+ 3. **Code → Validation** - Continuous narrative compliance checks
215
+ 4. **Never Drift** - Living DB maintains alignment
216
+
217
+ ---
218
+
219
+ ## 🤝 Contributing
220
+
221
+ This package is part of the [MyContext Monorepo](https://github.com/farajabien/mycontext-cli).
222
+
223
+ For local development:
224
+ ```bash
225
+ git clone https://github.com/farajabien/mycontext-cli.git
226
+ cd mycontext-cli
227
+ pnpm install
228
+ pnpm run build
229
+ cd apps/cli && pnpm link --global
230
+ ```
231
+
232
+ ---
33
233
 
34
234
  ## 📄 License
35
- MIT © MyContext - See [LICENSE](../../LICENSE) for details.
235
+
236
+ MIT © MyContext - See [LICENSE](https://github.com/farajabien/mycontext-cli/blob/main/LICENSE) for details.
237
+
238
+ ---
239
+
240
+ ## 🔗 Links
241
+
242
+ - [Documentation](https://github.com/farajabien/mycontext-cli#readme)
243
+ - [Report Issues](https://github.com/farajabien/mycontext-cli/issues)
244
+ - [npm Package](https://www.npmjs.com/package/mycontext-cli)
245
+ - [Core Package (@myycontext/core)](https://www.npmjs.com/package/@myycontext/core)
package/dist/README.md CHANGED
@@ -2,34 +2,244 @@
2
2
 
3
3
  **The Command-Line Anchor for Zero-Drift Autonomous Development.**
4
4
 
5
- `mycontext-cli` is the primary interface for Spec-Driven Development. It allows you to initialize projects, generate code from specifications, and evolve your application autonomously through the **Living Brain**.
5
+ `mycontext-cli` is your AI-powered development companion that transforms screenshots into specs, generates production-ready code, and keeps your implementation perfectly aligned with design intent.
6
+
7
+ ## ✨ Key Features
8
+
9
+ 🎯 **Screenshot → Spec** - Reverse-engineer any UI into comprehensive specifications (Powered by Gemini 2.0 Flash)
10
+ 🤖 **Autonomous Code Generation** - AI agents that write code grounded in deterministic specs
11
+ 🔒 **Zero-Drift Development** - Maintain perfect alignment between design intent and implementation
12
+ 📊 **Living DB** - Deterministic manifest that evolves with your project
13
+ 🚀 **Instant Setup** - Initialize Next.js projects with shadcn/ui, InstantDB, and more
14
+
15
+ ---
6
16
 
7
17
  ## 🚀 Installation
8
18
 
9
19
  ```bash
20
+ # Install globally
10
21
  npm install -g mycontext-cli
11
- # or use without installation
22
+
23
+ # Or use without installation
12
24
  npx mycontext-cli init
13
25
  ```
14
26
 
15
- ## 🛠️ Main Commands
27
+ ---
28
+
29
+ ## 🛠️ Commands Reference
16
30
 
17
31
  ### `mycontext init`
18
- Initialize a new project with a **Hard Gravity** anchor. It sets up the `.mycontext` directory and creates your initial `design-manifest.json`.
32
+ Initialize a new project with the MyContext ecosystem.
33
+
34
+ ```bash
35
+ mycontext init
36
+
37
+ # Skip prompts (use defaults)
38
+ mycontext init --yes
39
+ ```
40
+
41
+ **What it does:**
42
+ - Creates `.mycontext/` directory structure
43
+ - Generates initial `design-manifest.json`
44
+ - Sets up shadcn/ui components
45
+ - Optional InstantDB initialization
46
+ - Installs required dependencies
47
+
48
+ ---
49
+
50
+ ### `mycontext analyze <screenshot>`
51
+ Analyze a screenshot and generate comprehensive specifications.
52
+
53
+ ```bash
54
+ mycontext analyze path/to/screenshot.png
55
+
56
+ # Output to specific file
57
+ mycontext analyze screenshot.png --output .mycontext/screen-spec.json
58
+ ```
59
+
60
+ **What it does:**
61
+ - Uses Gemini 2.0 Flash vision model
62
+ - Extracts UI components, layout, and design tokens
63
+ - Generates detailed specifications
64
+ - Updates design manifest
65
+
66
+ ---
67
+
68
+ ### `mycontext generate`
69
+ Generate context files, components, or code from your specifications.
70
+
71
+ ```bash
72
+ # Generate full context for AI coding assistants
73
+ mycontext generate context --full
74
+
75
+ # Generate specific components
76
+ mycontext generate components
77
+
78
+ # Generate Next.js routes from specs
79
+ mycontext generate screens
80
+
81
+ # Generate sample data
82
+ mycontext generate sample-data
83
+ ```
84
+
85
+ **Context files include:**
86
+ - Project overview and architecture
87
+ - Design tokens and component hierarchy
88
+ - Data models and API specifications
89
+ - Current implementation status
90
+
91
+ ---
19
92
 
20
93
  ### `mycontext status`
21
- Perform a "Narrative Compliance" check. It analyzes your project's current state against the Living DB manifest and reports on drift.
94
+ Check narrative compliance - analyze drift between spec and implementation.
95
+
96
+ ```bash
97
+ mycontext status
98
+
99
+ # Detailed report
100
+ mycontext status --verbose
101
+ ```
102
+
103
+ **What it checks:**
104
+ - Design manifest integrity
105
+ - Component implementation status
106
+ - Missing dependencies
107
+ - Configuration issues
108
+
109
+ ---
22
110
 
23
111
  ### `mycontext agent`
24
- The core of the autonomous engine.
25
- - `--plan`: Generate an implementation plan for a new feature.
26
- - `--execute`: Trigger agentic code generation.
112
+ Autonomous development agent for feature implementation.
27
113
 
28
- ### `mycontext generate`
29
- Scaffold specific components, context files, or PRDs based on your design tokens.
114
+ ```bash
115
+ # Generate implementation plan
116
+ mycontext agent --plan "Add user authentication"
117
+
118
+ # Execute autonomous code generation
119
+ mycontext agent --execute "Implement shopping cart"
120
+ ```
121
+
122
+ **Features:**
123
+ - Multi-agent orchestration (Architect, CodeGen, QA, Security)
124
+ - Deterministic prompt construction
125
+ - Context-aware code generation
126
+ - Built-in testing and validation
127
+
128
+ ---
129
+
130
+ ## 🎯 Quick Start Example
131
+
132
+ ```bash
133
+ # 1. Create a new Next.js project
134
+ npx create-next-app my-app
135
+ cd my-app
136
+
137
+ # 2. Initialize MyContext
138
+ npx mycontext-cli init
139
+
140
+ # 3. Configure AI provider (choose one)
141
+ # GitHub Models (Free, High Quality)
142
+ echo 'GITHUB_TOKEN=your-token' >> .mycontext/.env
143
+
144
+ # Or Gemini (Free tier + Vision)
145
+ echo 'GEMINI_API_KEY=your-key' >> .mycontext/.env
146
+
147
+ # 4. Analyze a design screenshot
148
+ mycontext analyze designs/homepage.png
149
+
150
+ # 5. Generate full context for AI assistants
151
+ mycontext generate context --full
152
+
153
+ # 6. Use autonomous agent for feature development
154
+ mycontext agent --plan "Add dark mode toggle"
155
+ ```
156
+
157
+ ---
158
+
159
+ ## 🔧 Configuration
160
+
161
+ ### AI Provider Setup
162
+
163
+ MyContext supports multiple AI providers. Configure in `.mycontext/.env`:
164
+
165
+ **GitHub Models** (Recommended - Free & High Quality)
166
+ ```bash
167
+ GITHUB_TOKEN=ghp_your_token_here
168
+ # Get token: https://github.com/settings/tokens
169
+ ```
170
+
171
+ **Gemini** (Free Tier + Vision for screenshots)
172
+ ```bash
173
+ GEMINI_API_KEY=your_gemini_key
174
+ # Get key: https://aistudio.google.com/apikey
175
+ ```
176
+
177
+ **Claude** (Best for advanced reasoning)
178
+ ```bash
179
+ ANTHROPIC_API_KEY=your_claude_key
180
+ # Get key: https://console.anthropic.com/
181
+ ```
182
+
183
+ **OpenAI**
184
+ ```bash
185
+ OPENAI_API_KEY=your_openai_key
186
+ ```
187
+
188
+ ---
189
+
190
+ ## 📁 Project Structure
191
+
192
+ After running `mycontext init`, your project will have:
193
+
194
+ ```
195
+ .mycontext/
196
+ ├── .env # AI provider configuration
197
+ ├── design-manifest.json # Living DB - source of truth
198
+ ├── context/ # Generated context files
199
+ │ ├── PROJECT_OVERVIEW.md
200
+ │ ├── ARCHITECTURE.md
201
+ │ └── ...
202
+ └── logs/ # Operation logs
203
+ ```
204
+
205
+ ---
30
206
 
31
207
  ## 🎯 The Philosophy: Hard Gravity
32
- Every project starts with a deterministic spec. The CLI ensures that code never drifts from its design intent, providing a "Hard Gravity" anchor that keeps the project cohesive even as it scales beyond human capacity to track every detail.
208
+
209
+ Every project starts with a **deterministic spec**. The CLI ensures that code never drifts from its design intent, providing a "Hard Gravity" anchor that keeps the project cohesive even as it scales beyond human capacity to track every detail.
210
+
211
+ **Zero-Drift Development:**
212
+ 1. **Screenshot → Spec** - AI vision extracts design intent
213
+ 2. **Spec → Code** - Agents generate implementation
214
+ 3. **Code → Validation** - Continuous narrative compliance checks
215
+ 4. **Never Drift** - Living DB maintains alignment
216
+
217
+ ---
218
+
219
+ ## 🤝 Contributing
220
+
221
+ This package is part of the [MyContext Monorepo](https://github.com/farajabien/mycontext-cli).
222
+
223
+ For local development:
224
+ ```bash
225
+ git clone https://github.com/farajabien/mycontext-cli.git
226
+ cd mycontext-cli
227
+ pnpm install
228
+ pnpm run build
229
+ cd apps/cli && pnpm link --global
230
+ ```
231
+
232
+ ---
33
233
 
34
234
  ## 📄 License
35
- MIT © MyContext - See [LICENSE](../../LICENSE) for details.
235
+
236
+ MIT © MyContext - See [LICENSE](https://github.com/farajabien/mycontext-cli/blob/main/LICENSE) for details.
237
+
238
+ ---
239
+
240
+ ## 🔗 Links
241
+
242
+ - [Documentation](https://github.com/farajabien/mycontext-cli#readme)
243
+ - [Report Issues](https://github.com/farajabien/mycontext-cli/issues)
244
+ - [npm Package](https://www.npmjs.com/package/mycontext-cli)
245
+ - [Core Package (@myycontext/core)](https://www.npmjs.com/package/@myycontext/core)
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mycontext-cli",
3
- "version": "4.1.4",
3
+ "version": "4.1.5",
4
4
  "description": "CLI tool for spec-driven development - Generate comprehensive context, visual screens, and scaffolding for AI-powered coding",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {
@@ -41,7 +41,8 @@
41
41
  "license": "MIT",
42
42
  "repository": {
43
43
  "type": "git",
44
- "url": "git+https://github.com/farajabien/mycontext-cli.git"
44
+ "url": "git+https://github.com/farajabien/mycontext-cli.git",
45
+ "directory": "apps/cli"
45
46
  },
46
47
  "homepage": "https://github.com/farajabien/mycontext-cli#readme",
47
48
  "bugs": {
@@ -105,4 +106,4 @@
105
106
  "package.json"
106
107
  ],
107
108
  "packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977"
108
- }
109
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mycontext-cli",
3
- "version": "4.1.4",
3
+ "version": "4.1.5",
4
4
  "description": "CLI tool for spec-driven development - Generate comprehensive context, visual screens, and scaffolding for AI-powered coding",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {
@@ -23,7 +23,8 @@
23
23
  "license": "MIT",
24
24
  "repository": {
25
25
  "type": "git",
26
- "url": "git+https://github.com/farajabien/mycontext-cli.git"
26
+ "url": "git+https://github.com/farajabien/mycontext-cli.git",
27
+ "directory": "apps/cli"
27
28
  },
28
29
  "homepage": "https://github.com/farajabien/mycontext-cli#readme",
29
30
  "bugs": {
@@ -60,7 +61,7 @@
60
61
  "unified": "^11.0.5",
61
62
  "uuid": "^9.0.1",
62
63
  "zod": "^3.25.76",
63
- "@myycontext/core": "1.0.3"
64
+ "@myycontext/core": "1.0.4"
64
65
  },
65
66
  "devDependencies": {
66
67
  "@types/fs-extra": "^11.0.4",