aios-core 2.1.3 → 2.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.
Files changed (24) hide show
  1. package/.aios-core/infrastructure/scripts/llm-routing/install-llm-routing.js +6 -6
  2. package/.claude/rules/mcp-usage.md +55 -9
  3. package/package.json +1 -1
  4. package/packages/installer/src/config/templates/env-template.js +2 -2
  5. package/packages/installer/src/wizard/wizard.js +34 -185
  6. package/src/wizard/index.js +2 -2
  7. package/.aios-core/development/tasks/analyze-brownfield.md +0 -456
  8. package/.aios-core/development/tasks/setup-project-docs.md +0 -444
  9. package/.aios-core/infrastructure/scripts/documentation-integrity/brownfield-analyzer.js +0 -501
  10. package/.aios-core/infrastructure/scripts/documentation-integrity/config-generator.js +0 -329
  11. package/.aios-core/infrastructure/scripts/documentation-integrity/deployment-config-loader.js +0 -282
  12. package/.aios-core/infrastructure/scripts/documentation-integrity/doc-generator.js +0 -331
  13. package/.aios-core/infrastructure/scripts/documentation-integrity/gitignore-generator.js +0 -312
  14. package/.aios-core/infrastructure/scripts/documentation-integrity/index.js +0 -74
  15. package/.aios-core/infrastructure/scripts/documentation-integrity/mode-detector.js +0 -358
  16. package/.aios-core/infrastructure/templates/core-config/core-config-brownfield.tmpl.yaml +0 -182
  17. package/.aios-core/infrastructure/templates/core-config/core-config-greenfield.tmpl.yaml +0 -127
  18. package/.aios-core/infrastructure/templates/gitignore/gitignore-aios-base.tmpl +0 -63
  19. package/.aios-core/infrastructure/templates/gitignore/gitignore-brownfield-merge.tmpl +0 -18
  20. package/.aios-core/infrastructure/templates/gitignore/gitignore-node.tmpl +0 -85
  21. package/.aios-core/infrastructure/templates/gitignore/gitignore-python.tmpl +0 -145
  22. package/.aios-core/infrastructure/templates/project-docs/coding-standards-tmpl.md +0 -346
  23. package/.aios-core/infrastructure/templates/project-docs/source-tree-tmpl.md +0 -177
  24. package/.aios-core/infrastructure/templates/project-docs/tech-stack-tmpl.md +0 -267
@@ -70,7 +70,7 @@ function installLLMRouting(options = {}) {
70
70
  projectRoot = process.cwd(),
71
71
  templatesDir = path.join(__dirname, 'templates'),
72
72
  onProgress = console.log,
73
- onError = console.error,
73
+ onError = console.error
74
74
  } = options;
75
75
 
76
76
  const result = {
@@ -78,7 +78,7 @@ function installLLMRouting(options = {}) {
78
78
  installDir: null,
79
79
  filesInstalled: [],
80
80
  envCreated: false,
81
- errors: [],
81
+ errors: []
82
82
  };
83
83
 
84
84
  // Check templates exist
@@ -143,7 +143,7 @@ function installLLMRouting(options = {}) {
143
143
  try {
144
144
  fs.copyFileSync(envExample, envFile);
145
145
  result.envCreated = true;
146
- onProgress('✅ Created .env from .env.example');
146
+ onProgress(`✅ Created .env from .env.example`);
147
147
  } catch (error) {
148
148
  result.success = false;
149
149
  result.errors.push(`Failed to create .env: ${error.message}`);
@@ -180,7 +180,7 @@ function updateClaudeConfig() {
180
180
  config.aiosLLMRouting = {
181
181
  version: LLM_ROUTING_VERSION,
182
182
  installedAt: new Date().toISOString(),
183
- commands: ['claude-max', 'claude-free'],
183
+ commands: ['claude-max', 'claude-free']
184
184
  };
185
185
 
186
186
  fs.writeFileSync(claudeConfigPath, JSON.stringify(config, null, 2));
@@ -250,7 +250,7 @@ module.exports = {
250
250
  isLLMRoutingInstalled,
251
251
  getInstallDir,
252
252
  getInstallationSummary,
253
- LLM_ROUTING_VERSION,
253
+ LLM_ROUTING_VERSION
254
254
  };
255
255
 
256
256
  // Run if executed directly
@@ -259,7 +259,7 @@ if (require.main === module) {
259
259
 
260
260
  const result = installLLMRouting({
261
261
  projectRoot: process.cwd(),
262
- templatesDir: path.join(__dirname, 'templates'),
262
+ templatesDir: path.join(__dirname, 'templates')
263
263
  });
264
264
 
265
265
  const summary = getInstallationSummary(result);
@@ -2,7 +2,23 @@
2
2
  paths: **/*
3
3
  ---
4
4
 
5
- # MCP Server Usage Rules
5
+ # MCP Server Usage Rules - AIOS Architecture
6
+
7
+ ## MCP Configuration Architecture
8
+
9
+ AIOS uses a hybrid MCP architecture for optimal performance and security:
10
+
11
+ ### Direct in Claude Code (global ~/.claude.json)
12
+ | MCP | Purpose |
13
+ |-----|---------|
14
+ | **playwright** | Browser automation, screenshots, web testing |
15
+ | **desktop-commander** | Docker container operations via docker-gateway |
16
+
17
+ ### Inside Docker Desktop (via desktop-commander)
18
+ | MCP | Purpose |
19
+ |-----|---------|
20
+ | **EXA** | Web search, research, company/competitor analysis |
21
+ | **Context7** | Library documentation lookup |
6
22
 
7
23
  ## CRITICAL: Tool Selection Priority
8
24
 
@@ -17,38 +33,68 @@ ALWAYS prefer native Claude Code tools over MCP servers:
17
33
  | Search content | `Grep` tool | docker-gateway |
18
34
  | List directories | `Bash(ls)` or `Glob` | docker-gateway |
19
35
 
20
- ## docker-gateway (Desktop Commander) Restrictions
36
+ ## desktop-commander (docker-gateway) Usage
21
37
 
22
38
  ### ONLY use docker-gateway when:
23
39
  1. User explicitly says "use docker" or "use container"
24
40
  2. User explicitly mentions "Desktop Commander"
25
41
  3. Task specifically requires Docker container operations
26
- 4. User asks to run something inside a Docker container
42
+ 4. Accessing MCPs running inside Docker (EXA, Context7)
43
+ 5. User asks to run something inside a Docker container
27
44
 
28
45
  ### NEVER use docker-gateway for:
29
46
  - Reading local files (use `Read` tool)
30
47
  - Writing local files (use `Write` or `Edit` tools)
31
- - Running shell commands (use `Bash` tool)
48
+ - Running shell commands on host (use `Bash` tool)
32
49
  - Searching files (use `Glob` or `Grep` tools)
33
50
  - Listing directories (use `Bash(ls)` or `Glob`)
34
- - Running Node.js or Python scripts (use `Bash` tool)
51
+ - Running Node.js or Python scripts on host (use `Bash` tool)
35
52
 
36
- ## playwright MCP Restrictions
53
+ ## playwright MCP Usage
37
54
 
38
55
  ### ONLY use playwright when:
39
56
  1. User explicitly asks for browser automation
40
57
  2. User wants to take screenshots of web pages
41
58
  3. User needs to interact with a website
42
59
  4. Task requires web scraping or testing
60
+ 5. Filling forms or clicking elements on web pages
43
61
 
44
62
  ### NEVER use playwright for:
45
63
  - General file operations
46
64
  - Running commands
47
65
  - Anything not related to web browsers
48
66
 
67
+ ## EXA MCP Usage (via Docker)
68
+
69
+ ### Use EXA (mcp__docker-gateway__web_search_exa) for:
70
+ 1. Web searches for current information
71
+ 2. Research and documentation lookup
72
+ 3. Company and competitor research
73
+ 4. Finding code examples online
74
+
75
+ ### Access pattern:
76
+ ```
77
+ mcp__docker-gateway__web_search_exa
78
+ ```
79
+
80
+ ## Context7 MCP Usage (via Docker)
81
+
82
+ ### Use Context7 for:
83
+ 1. Library documentation lookup
84
+ 2. API reference for packages/frameworks
85
+ 3. Getting up-to-date docs for dependencies
86
+
87
+ ### Access pattern:
88
+ ```
89
+ mcp__docker-gateway__resolve-library-id
90
+ mcp__docker-gateway__get-library-docs
91
+ ```
92
+
49
93
  ## Rationale
50
94
 
51
- - Native tools execute on the LOCAL system (Windows)
52
- - docker-gateway executes inside Docker containers (Linux)
95
+ - **Native tools** execute on the LOCAL system (Windows/Mac/Linux)
96
+ - **docker-gateway** executes inside Docker containers (Linux)
53
97
  - Using docker-gateway for local operations causes path mismatches and failures
54
- - Native tools are faster and more reliable for local operations
98
+ - Native tools are faster and more reliable for local file operations
99
+ - EXA and Context7 run inside Docker for isolation and consistent environment
100
+ - playwright runs directly for better browser integration with host system
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aios-core",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "description": "AIOS: AI-Orchestrated System for Full Stack Development - Core Framework",
5
5
  "main": "index.js",
6
6
  "module": "index.esm.js",
@@ -118,7 +118,7 @@ VERCEL_TOKEN=
118
118
  # AIOS Core Configuration
119
119
  # --------------------------------------------
120
120
  NODE_ENV=development
121
- AIOS_VERSION=2.1.3
121
+ AIOS_VERSION=2.1.5
122
122
 
123
123
  # --------------------------------------------
124
124
  # Custom Configuration
@@ -230,7 +230,7 @@ VERCEL_TOKEN=
230
230
  # AIOS Core Configuration
231
231
  # --------------------------------------------
232
232
  NODE_ENV=development
233
- AIOS_VERSION=2.1.3
233
+ AIOS_VERSION=2.1.5
234
234
 
235
235
  # --------------------------------------------
236
236
  # Custom Configuration
@@ -1,70 +1,46 @@
1
1
  const { detectProjectType } = require('../detection/detect-project-type');
2
- const {
3
- detectInstallationMode,
4
- getModeOptions,
5
- validateModeSelection,
6
- InstallationMode,
7
- } = require('../../../../.aios-core/infrastructure/scripts/documentation-integrity/mode-detector');
8
2
 
9
3
  /**
10
4
  * Interactive Wizard for AIOS Installation
11
- *
12
- * Supports three installation modes:
13
- * - GREENFIELD: New project - generates all docs and config
14
- * - BROWNFIELD: Existing project - analyzes and adapts
15
- * - FRAMEWORK_DEV: Contributing to aios-core itself
16
- *
5
+ *
6
+ * This is a stub implementation that demonstrates the integration
7
+ * with the project type detection module (Story 1.3).
8
+ * Full wizard implementation is part of Story 1.2.
9
+ *
17
10
  * @module wizard
18
- * @version 2.0.0
19
- * @story 6.9
20
11
  */
21
12
 
22
13
  /**
23
14
  * Run the interactive installer wizard
24
- *
15
+ *
25
16
  * @param {Object} options - Wizard options
26
17
  * @param {string} options.targetDir - Target directory for installation
27
- * @param {string} options.mode - Pre-selected mode (skip detection)
28
18
  * @returns {Promise<Object>} Installation configuration
29
19
  */
30
20
  async function runWizard(options = {}) {
31
21
  const targetDir = options.targetDir || process.cwd();
32
-
22
+
33
23
  try {
34
- // Step 1: Welcome screen
24
+ // Step 1: Welcome screen (Story 1.2)
35
25
  console.log('🚀 Welcome to AIOS Installer\n');
36
-
37
- // Step 2: Detect installation mode (Story 6.9)
38
- console.log('📊 Analyzing project directory...');
39
- const detected = detectInstallationMode(targetDir);
40
- console.log(`✅ Detected: ${detected.mode} (${detected.reason})\n`);
41
-
42
- // Step 3: Select installation mode (with user override)
43
- const selectedMode = options.mode || (await selectInstallationMode(detected));
44
-
45
- // Step 4: Validate selection
46
- const validation = validateModeSelection(selectedMode, detected);
47
- if (validation.warnings.length > 0) {
48
- console.log('\n⚠️ Warnings:');
49
- validation.warnings.forEach((w) => console.log(` - ${w}`));
50
- console.log('');
51
- }
52
-
53
- // Step 5: Mode-specific configuration
54
- const modeConfig = await configureModeSpecific(selectedMode, targetDir, detected);
55
-
56
- // Step 6: Continue with installation (Stories 1.4-1.8)
26
+
27
+ // Step 2: Detect project type (THIS STORY - Story 1.3)
28
+ console.log('📊 Detecting project type...');
29
+ const detectedType = detectProjectType(targetDir);
30
+ console.log(`✅ Detected: ${detectedType}\n`);
31
+
32
+ // Step 3: Confirm with user (Story 1.2)
33
+ const confirmedType = await confirmProjectType(detectedType);
34
+
35
+ // Step 4: Continue with installation (Stories 1.4-1.8)
57
36
  // - IDE Selection (Story 1.4)
58
37
  // - MCP Installation (Story 1.5)
59
38
  // - Environment Config (Story 1.6)
60
39
  // - Validation (Story 1.8)
61
-
40
+
62
41
  return {
63
- projectType: detected.legacyType, // Backward compatibility
64
- installationMode: selectedMode,
42
+ projectType: confirmedType,
65
43
  targetDir,
66
- detected,
67
- modeConfig,
68
44
  // Other configuration will be added by downstream stories
69
45
  };
70
46
  } catch (error) {
@@ -73,152 +49,29 @@ async function runWizard(options = {}) {
73
49
  }
74
50
  }
75
51
 
76
- /**
77
- * Select installation mode with user input
78
- *
79
- * @param {Object} detected - Detection result from mode detector
80
- * @returns {Promise<string>} Selected installation mode
81
- */
82
- async function selectInstallationMode(detected) {
83
- const options = getModeOptions(detected);
84
-
85
- console.log('Select installation type:\n');
86
- options.forEach((opt, index) => {
87
- const marker = opt.value === detected.mode ? '→' : ' ';
88
- console.log(`${marker} ${index + 1}. ${opt.label}`);
89
- console.log(` ${opt.hint}\n`);
90
- });
91
-
92
- // Stub: In real implementation, use @clack/prompts select()
93
- // For now, return detected mode or first option
94
- console.log(`(Using detected mode: ${detected.mode})`);
95
- console.log('(Interactive selection via @clack/prompts in Story 1.2)\n');
96
-
97
- return detected.mode !== InstallationMode.UNKNOWN ? detected.mode : InstallationMode.GREENFIELD;
98
- }
99
-
100
- /**
101
- * Configure mode-specific settings
102
- *
103
- * @param {string} mode - Selected installation mode
104
- * @param {string} targetDir - Target directory
105
- * @param {Object} detected - Detection result
106
- * @returns {Promise<Object>} Mode-specific configuration
107
- */
108
- async function configureModeSpecific(mode, targetDir, detected) {
109
- const config = {
110
- mode,
111
- generateDocs: true,
112
- generateConfig: true,
113
- generateGitignore: true,
114
- runSetupGithub: false,
115
- deployment: null,
116
- };
117
-
118
- switch (mode) {
119
- case InstallationMode.FRAMEWORK_DEV:
120
- // Framework development - skip project setup
121
- console.log('🔧 Framework Development Mode');
122
- console.log(' → Using existing framework standards');
123
- console.log(' → Skipping project documentation generation');
124
- console.log(' → Skipping infrastructure setup\n');
125
- config.generateDocs = false;
126
- config.generateConfig = false;
127
- config.generateGitignore = false;
128
- break;
129
-
130
- case InstallationMode.GREENFIELD:
131
- // New project - full scaffolding
132
- console.log('🆕 Greenfield Mode');
133
- console.log(' → Will generate project documentation');
134
- console.log(' → Will create project-specific core-config');
135
- console.log(' → Will generate .gitignore based on tech stack');
136
- console.log(' → Will offer *setup-github for infrastructure\n');
137
- config.runSetupGithub = true;
138
- // Deployment config will be elicited in Phase 3
139
- config.deployment = await elicitDeploymentConfig();
140
- break;
141
-
142
- case InstallationMode.BROWNFIELD:
143
- // Existing project - analyze and adapt
144
- console.log('📂 Brownfield Mode');
145
- console.log(' → Will analyze existing source tree');
146
- console.log(' → Will detect existing coding standards');
147
- console.log(' → Will merge with existing .gitignore');
148
- console.log(' → Will analyze existing GitHub workflows\n');
149
- // Deployment config will be elicited based on analysis in Phase 3
150
- config.deployment = await elicitDeploymentConfig();
151
- break;
152
-
153
- default:
154
- console.log('❓ Unknown mode - using greenfield defaults\n');
155
- }
156
-
157
- return config;
158
- }
159
-
160
- /**
161
- * Elicit deployment configuration from user
162
- * Implements Task 3.3 from Story 6.9
163
- *
164
- * @returns {Promise<Object>} Deployment configuration
165
- */
166
- async function elicitDeploymentConfig() {
167
- // Stub implementation - will be fully implemented in Phase 3
168
- console.log('📦 Deployment Configuration');
169
- console.log(' (Full elicitation will be implemented in Phase 3)\n');
170
-
171
- // Return default staging-first workflow
172
- return {
173
- workflow: 'staging-first',
174
- branches: {
175
- staging_targets: ['feature/*', 'fix/*', 'docs/*', 'chore/*', 'refactor/*', 'test/*'],
176
- production_targets: ['hotfix/*'],
177
- staging_branch: 'staging',
178
- production_branch: 'main',
179
- default_target: 'staging',
180
- },
181
- environments: {
182
- staging: {
183
- name: 'Staging',
184
- auto_deploy: true,
185
- platform: null, // To be detected/elicited
186
- },
187
- production: {
188
- name: 'Production',
189
- auto_deploy: true,
190
- platform: null,
191
- },
192
- },
193
- quality_gates: {
194
- lint: true,
195
- typecheck: true,
196
- tests: true,
197
- security_scan: false,
198
- },
199
- };
200
- }
201
-
202
52
  /**
203
53
  * Confirm project type with user or allow override
204
- * @deprecated Use selectInstallationMode instead
205
- *
54
+ *
206
55
  * @param {string} detectedType - Detected project type
207
56
  * @returns {Promise<string>} Confirmed project type
208
57
  */
209
58
  async function confirmProjectType(detectedType) {
210
- // Kept for backward compatibility
59
+ // Stub implementation - full implementation in Story 1.2
60
+ // In real implementation, this would use @clack/prompts to ask user
61
+
211
62
  const typeDescriptions = {
212
- GREENFIELD: 'New project - AIOS will create complete structure',
213
- BROWNFIELD: 'Existing project - AIOS will integrate with current setup',
214
- EXISTING_AIOS: 'AIOS already installed - Would you like to update or reinstall?',
215
- UNKNOWN: 'Unknown project type - Manual selection required',
63
+ 'GREENFIELD': 'New project - AIOS will create complete structure',
64
+ 'BROWNFIELD': 'Existing project - AIOS will integrate with current setup',
65
+ 'EXISTING_AIOS': 'AIOS already installed - Would you like to update or reinstall?',
66
+ 'UNKNOWN': 'Unknown project type - Manual selection required',
216
67
  };
217
-
68
+
218
69
  console.log(`Project Type: ${detectedType}`);
219
70
  console.log(`Description: ${typeDescriptions[detectedType]}`);
220
- console.log('(Use selectInstallationMode for new three-mode selection)\n');
221
-
71
+ console.log('(Interactive confirmation will be added in Story 1.2)\n');
72
+
73
+ // For now, return the detected type
74
+ // Real implementation would prompt user to confirm or override
222
75
  return detectedType;
223
76
  }
224
77
 
@@ -234,11 +87,7 @@ function getProjectType(targetDir) {
234
87
 
235
88
  module.exports = {
236
89
  runWizard,
237
- selectInstallationMode,
238
- configureModeSpecific,
239
- elicitDeploymentConfig,
240
- confirmProjectType, // Deprecated - kept for backward compatibility
90
+ confirmProjectType,
241
91
  getProjectType,
242
- InstallationMode,
243
92
  };
244
93
 
@@ -30,7 +30,7 @@ const {
30
30
  const {
31
31
  installLLMRouting,
32
32
  isLLMRoutingInstalled,
33
- getInstallationSummary,
33
+ getInstallationSummary
34
34
  } = require('../../.aios-core/infrastructure/scripts/llm-routing/install-llm-routing');
35
35
 
36
36
  /**
@@ -484,7 +484,7 @@ async function runWizard() {
484
484
  const llmResult = installLLMRouting({
485
485
  projectRoot: process.cwd(),
486
486
  onProgress: (msg) => console.log(` ${msg}`),
487
- onError: (msg) => console.error(` ${msg}`),
487
+ onError: (msg) => console.error(` ${msg}`)
488
488
  });
489
489
 
490
490
  if (llmResult.success) {