ai-devx 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +325 -0
  3. package/bin/cli.js +65 -0
  4. package/package.json +63 -0
  5. package/src/commands/init.js +86 -0
  6. package/src/commands/status.js +60 -0
  7. package/src/commands/update.js +77 -0
  8. package/src/config.js +72 -0
  9. package/src/utils/fileSystem.js +64 -0
  10. package/src/utils/logger.js +18 -0
  11. package/templates/.agent/.gitignore +6 -0
  12. package/templates/.agent/agents/backend-specialist.md +147 -0
  13. package/templates/.agent/agents/database-architect.md +164 -0
  14. package/templates/.agent/agents/debugger.md +128 -0
  15. package/templates/.agent/agents/devops-engineer.md +185 -0
  16. package/templates/.agent/agents/frontend-specialist.md +122 -0
  17. package/templates/.agent/agents/orchestrator.md +137 -0
  18. package/templates/.agent/agents/project-planner.md +127 -0
  19. package/templates/.agent/agents/security-auditor.md +122 -0
  20. package/templates/.agent/agents/test-engineer.md +176 -0
  21. package/templates/.agent/scripts/checklist.js +260 -0
  22. package/templates/.agent/scripts/security_scan.js +251 -0
  23. package/templates/.agent/skills/api-patterns/SKILL.md +236 -0
  24. package/templates/.agent/skills/database-design/SKILL.md +303 -0
  25. package/templates/.agent/skills/docker-expert/SKILL.md +286 -0
  26. package/templates/.agent/skills/react-best-practices/SKILL.md +246 -0
  27. package/templates/.agent/skills/testing-patterns/SKILL.md +262 -0
  28. package/templates/.agent/workflows/create.md +131 -0
  29. package/templates/.agent/workflows/debug.md +138 -0
  30. package/templates/.agent/workflows/deploy.md +163 -0
  31. package/templates/.agent/workflows/plan.md +153 -0
  32. package/templates/.agent/workflows/security.md +181 -0
  33. package/templates/.agent/workflows/test.md +165 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 kmamtora
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,325 @@
1
+ # 🤖 AI-DEVX
2
+
3
+ > AI Agent templates with Skills, Agents, and Workflows for enhanced coding assistance
4
+
5
+ [![npm version](https://badge.fury.io/js/ai-devx.svg)](https://www.npmjs.com/package/ai-devx)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ AI-DEVX is a powerful CLI tool that installs AI agent templates into your projects, enabling AI-powered editors like Cursor and Windsurf to provide specialized assistance through agents, skills, and workflows.
9
+
10
+ ## ✨ Features
11
+
12
+ - **9 Specialist Agents**: Frontend, Backend, Security, Database, DevOps, Testing, Debugging, Planning, and Orchestration
13
+ - **5+ Domain Skills**: React, API Patterns, Testing, Database Design, Docker, and more
14
+ - **9 Workflow Commands**: `/plan`, `/create`, `/debug`, `/test`, `/deploy`, `/security`, and more
15
+ - **Validation Scripts**: Automated code quality, security, and testing checks
16
+ - **Multi-Agent Coordination**: Complex tasks handled by multiple specialists
17
+ - **Zero Learning Curve**: Just describe what you need
18
+
19
+ ## 🚀 Quick Start
20
+
21
+ ### Installation
22
+
23
+ ```bash
24
+ # Using npx (recommended)
25
+ npx ai-devx init
26
+
27
+ # Or install globally
28
+ npm install -g ai-devx
29
+ ai-devx init
30
+ ```
31
+
32
+ This installs the `.agent` folder containing all templates into your project.
33
+
34
+ ### Important: Git Configuration
35
+
36
+ If you are using AI-powered editors like **Cursor** or **Windsurf**, adding the `.agent/` folder to your `.gitignore` may prevent the IDE from indexing the workflows. This results in slash commands (like `/plan`, `/debug`) not appearing in the chat suggestion dropdown.
37
+
38
+ **Recommended Solution:** To keep the `.agent/` folder local (not tracked by Git) while maintaining AI functionality:
39
+
40
+ 1. Ensure `.agent/` is **NOT** in your project's `.gitignore`
41
+ 2. Instead, add it to your local exclude file: `.git/info/exclude`
42
+
43
+ ```bash
44
+ echo ".agent/" >> .git/info/exclude
45
+ ```
46
+
47
+ ## 📦 What's Included
48
+
49
+ | Component | Count | Description |
50
+ |-----------|-------|-------------|
51
+ | **Agents** | 9 | Specialist AI personas |
52
+ | **Skills** | 5+ | Domain-specific knowledge modules |
53
+ | **Workflows** | 9 | Slash command procedures |
54
+ | **Scripts** | 2 | Validation and automation tools |
55
+
56
+ ### Agents
57
+
58
+ - **@frontend-specialist** - React, Vue, Angular, TypeScript, UI/UX
59
+ - **@backend-specialist** - Node.js, Python, Go, API Design
60
+ - **@security-auditor** - Vulnerability scanning, OWASP, Security best practices
61
+ - **@database-architect** - Schema design, SQL optimization, migrations
62
+ - **@devops-engineer** - Docker, CI/CD, Cloud deployment
63
+ - **@test-engineer** - Unit, integration, E2E testing
64
+ - **@debugger** - Systematic debugging and root cause analysis
65
+ - **@project-planner** - Task breakdown, estimation, architecture
66
+ - **@orchestrator** - Multi-agent coordination for complex tasks
67
+
68
+ ## 🎯 Usage
69
+
70
+ ### Using Agents
71
+
72
+ **No need to mention agents explicitly!** The system automatically detects and applies the right specialist(s):
73
+
74
+ ```
75
+ You: "Add JWT authentication"
76
+ AI: 🤖 Applying @security-auditor + @backend-specialist...
77
+
78
+ You: "Fix the dark mode button"
79
+ AI: 🤖 Using @frontend-specialist...
80
+
81
+ You: "Login returns 500 error"
82
+ AI: 🤖 Using @debugger for systematic analysis...
83
+ ```
84
+
85
+ **How it works:**
86
+ - Analyzes your request silently
87
+ - Detects domain(s) automatically (frontend, backend, security, etc.)
88
+ - Selects the best specialist(s)
89
+ - Informs you which expertise is being applied
90
+ - You get specialist-level responses without needing to know the system architecture
91
+
92
+ **Benefits:**
93
+ - ✅ Zero learning curve - just describe what you need
94
+ - ✅ Always get expert responses
95
+ - ✅ Transparent - shows which agent is being used
96
+ - ✅ Can still override by mentioning agent explicitly
97
+
98
+ ### Using Workflows
99
+
100
+ Invoke workflows with slash commands:
101
+
102
+ | Command | Description |
103
+ |---------|-------------|
104
+ | `/plan` | Create task breakdown and implementation plan |
105
+ | `/create` | Create new features or apps |
106
+ | `/debug` | Systematic debugging |
107
+ | `/test` | Generate and run tests |
108
+ | `/deploy` | Deploy application |
109
+ | `/security` | Security audit and fixes |
110
+
111
+ Example:
112
+ ```
113
+ /plan user authentication system
114
+ /create login form component
115
+ /debug why API returns 500 error
116
+ /test UserService
117
+ /deploy production
118
+ ```
119
+
120
+ ### Using Skills
121
+
122
+ Skills are loaded automatically based on task context. The AI reads skill descriptions and applies relevant knowledge.
123
+
124
+ **Available Skills:**
125
+ - **react-best-practices** - React hooks, patterns, performance
126
+ - **api-patterns** - REST API design, authentication, best practices
127
+ - **testing-patterns** - Unit, integration, E2E testing strategies
128
+ - **database-design** - Schema design, normalization, optimization
129
+ - **docker-expert** - Containerization, multi-stage builds, deployment
130
+
131
+ ## 🛠️ CLI Tool
132
+
133
+ ### Commands
134
+
135
+ | Command | Description |
136
+ |---------|-------------|
137
+ | `ai-devx init` | Install `.agent` folder into your project |
138
+ | `ai-devx update` | Update to the latest version |
139
+ | `ai-devx status` | Check installation status |
140
+
141
+ ### Options
142
+
143
+ ```bash
144
+ ai-devx init --force # Overwrite existing .agent folder
145
+ ai-devx init --path ./myapp # Install in specific directory
146
+ ai-devx init --branch dev # Use specific branch
147
+ ai-devx init --quiet # Suppress output (for CI/CD)
148
+ ai-devx init --dry-run # Preview actions without executing
149
+ ai-devx update --backup # Create backup before updating
150
+ ```
151
+
152
+ ### Validation Scripts
153
+
154
+ After installation, use the validation scripts:
155
+
156
+ ```bash
157
+ # Quick check (security, lint, types, tests)
158
+ node .agent/scripts/checklist.js
159
+
160
+ # Security scan
161
+ node .agent/scripts/security_scan.js
162
+ ```
163
+
164
+ ## 📁 Project Structure
165
+
166
+ ```
167
+ .agent/
168
+ ├── agents/ # Agent definitions
169
+ │ ├── frontend-specialist.md
170
+ │ ├── backend-specialist.md
171
+ │ ├── security-auditor.md
172
+ │ └── ...
173
+ ├── skills/ # Skill modules
174
+ │ ├── react-best-practices/
175
+ │ ├── api-patterns/
176
+ │ ├── testing-patterns/
177
+ │ └── ...
178
+ ├── workflows/ # Workflow definitions
179
+ │ ├── plan.md
180
+ │ ├── create.md
181
+ │ ├── debug.md
182
+ │ └── ...
183
+ ├── scripts/ # Validation scripts
184
+ │ ├── checklist.js
185
+ │ └── security_scan.js
186
+ ├── VERSION # Current version
187
+ └── config.json # Installation config
188
+ ```
189
+
190
+ ## 🔄 How It Works
191
+
192
+ ```
193
+ User Request
194
+
195
+ Request Classification
196
+
197
+ ┌──────────────────┬──────────────────┐
198
+ │ Workflow Command │ Direct Agent │
199
+ │ (Slash Command) │ Assignment │
200
+ └────────┬─────────┴────────┬─────────┘
201
+ │ │
202
+ ↓ ↓
203
+ Agent Selection
204
+ Skills Loading
205
+
206
+ Task Execution
207
+
208
+ Validation Layer
209
+
210
+ Result Delivery
211
+ ```
212
+
213
+ ## 🎨 Example Usage
214
+
215
+ ### Building a Feature
216
+
217
+ ```
218
+ User: /plan Build a user dashboard
219
+
220
+ AI: 🤖 Applying @project-planner...
221
+
222
+ ## Plan: User Dashboard
223
+
224
+ ### Tasks
225
+ | ID | Task | Estimate |
226
+ |----|------|----------|
227
+ | T1 | Design user schema | 2h |
228
+ | T2 | Create user API | 4h |
229
+ | T3 | Build dashboard UI | 8h |
230
+
231
+ Total: 14 hours
232
+
233
+ Next steps:
234
+ 1. Create database schema
235
+ 2. Implement API endpoints
236
+ 3. Build React components
237
+ ```
238
+
239
+ ### Debugging
240
+
241
+ ```
242
+ User: /debug Login button not working
243
+
244
+ AI: 🤖 Applying @debugger...
245
+
246
+ ## Issue Analysis
247
+
248
+ ### Root Cause
249
+ Event handler not bound correctly in React component.
250
+
251
+ ### Solution
252
+ ```tsx
253
+ // Before
254
+ <button onClick={handleLogin}>Login</button>
255
+
256
+ // After
257
+ <button onClick={() => handleLogin()}>Login</button>
258
+ ```
259
+
260
+ ### Verification
261
+ ✅ Button now triggers login function
262
+ ```
263
+
264
+ ### Security Audit
265
+
266
+ ```
267
+ User: /security
268
+
269
+ AI: 🤖 Applying @security-auditor...
270
+
271
+ ## Security Scan Results
272
+
273
+ 🔴 Critical: 1
274
+ 🟠 High: 0
275
+ 🟡 Medium: 2
276
+
277
+ ### Critical Issue
278
+ Hardcoded API key in src/config.ts:15
279
+
280
+ Fix: Move to environment variables
281
+ ```
282
+
283
+ ## 🛡️ Security
284
+
285
+ AI-DEVX follows security best practices:
286
+
287
+ - No sensitive data in templates
288
+ - Environment variable usage patterns
289
+ - Security scanning built-in
290
+ - OWASP compliance guidelines
291
+
292
+ ## 🤝 Contributing
293
+
294
+ Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details.
295
+
296
+ ### Adding New Agents
297
+
298
+ 1. Create `.agent/agents/my-agent.md`
299
+ 2. Follow the frontmatter format
300
+ 3. Include role, capabilities, and guidelines
301
+ 4. Submit a PR
302
+
303
+ ### Adding New Skills
304
+
305
+ 1. Create `.agent/skills/my-skill/SKILL.md`
306
+ 2. Define the skill metadata
307
+ 3. Add examples and best practices
308
+ 4. Submit a PR
309
+
310
+ ## 📄 License
311
+
312
+ MIT © [kmamtora](https://github.com/kmamtora)
313
+
314
+ ## 🙏 Acknowledgments
315
+
316
+ Inspired by [antigravity-kit](https://github.com/vudovn/antigravity-kit) - An amazing AI agent toolkit.
317
+
318
+ ## 📞 Support
319
+
320
+ - GitHub Issues: [Report a bug](https://github.com/kmamtora/ai-devx/issues)
321
+ - Discussions: [Ask a question](https://github.com/kmamtora/ai-devx/discussions)
322
+
323
+ ---
324
+
325
+ **Happy Coding!** 🤖✨
package/bin/cli.js ADDED
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { program } = require('commander');
4
+ const chalk = require('chalk');
5
+ const pkg = require('../package.json');
6
+ const initCommand = require('../src/commands/init');
7
+ const updateCommand = require('../src/commands/update');
8
+ const statusCommand = require('../src/commands/status');
9
+
10
+ console.log(chalk.cyan.bold(`
11
+ ╔════════════════════════════════════╗
12
+ ║ 🤖 AI-DEVX ${pkg.version.padEnd(8)} ║
13
+ ║ AI Agent Templates & Workflows ║
14
+ ╚════════════════════════════════════╝
15
+ `));
16
+
17
+ program
18
+ .name('ai-devx')
19
+ .description('AI Agent templates with Skills, Agents, and Workflows')
20
+ .version(pkg.version, '-v, --version', 'Display version number');
21
+
22
+ program
23
+ .command('init')
24
+ .description('Install .agent folder into your project')
25
+ .option('-f, --force', 'Overwrite existing .agent folder')
26
+ .option('-p, --path <path>', 'Install in specific directory', process.cwd())
27
+ .option('-b, --branch <branch>', 'Use specific branch from repository', 'main')
28
+ .option('-q, --quiet', 'Suppress output (for CI/CD)')
29
+ .option('--dry-run', 'Preview actions without executing')
30
+ .option('-s, --source <url>', 'Custom template source (GitHub repo)', 'kmamtora/ai-devx')
31
+ .action(initCommand);
32
+
33
+ program
34
+ .command('update')
35
+ .description('Update to the latest version of templates')
36
+ .option('-f, --force', 'Force update even if up-to-date')
37
+ .option('--backup', 'Create backup before updating')
38
+ .option('-q, --quiet', 'Suppress output')
39
+ .action(updateCommand);
40
+
41
+ program
42
+ .command('status')
43
+ .description('Check installation status and version info')
44
+ .option('-p, --path <path>', 'Check specific directory', process.cwd())
45
+ .action(statusCommand);
46
+
47
+ program.on('--help', () => {
48
+ console.log('');
49
+ console.log(chalk.bold('Examples:'));
50
+ console.log(' $ ai-devx init # Install in current directory');
51
+ console.log(' $ ai-devx init --path ./my-project # Install in specific directory');
52
+ console.log(' $ ai-devx init --force # Overwrite existing installation');
53
+ console.log(' $ ai-devx update # Update templates');
54
+ console.log(' $ ai-devx status # Check installation status');
55
+ console.log('');
56
+ console.log(chalk.bold('Quick Start:'));
57
+ console.log(' $ npx ai-devx init');
58
+ console.log('');
59
+ });
60
+
61
+ program.parse();
62
+
63
+ if (!process.argv.slice(2).length) {
64
+ program.outputHelp();
65
+ }
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "ai-devx",
3
+ "version": "1.0.0",
4
+ "description": "AI Agent templates with Skills, Agents, and Workflows for enhanced coding assistance",
5
+ "main": "src/index.js",
6
+ "bin": {
7
+ "ai-devx": "./bin/cli.js",
8
+ "aex": "./bin/cli.js"
9
+ },
10
+ "scripts": {
11
+ "test": "node --test test/*.test.js",
12
+ "test:cli": "node bin/cli.js --version",
13
+ "lint": "eslint src/ bin/",
14
+ "format": "prettier --write .",
15
+ "prepublishOnly": "npm test",
16
+ "local-link": "npm link",
17
+ "local-unlink": "npm unlink -g ai-devx"
18
+ },
19
+ "keywords": [
20
+ "ai",
21
+ "agent",
22
+ "cli",
23
+ "templates",
24
+ "cursor",
25
+ "windsurf",
26
+ "coding-assistant",
27
+ "development-tools",
28
+ "productivity"
29
+ ],
30
+ "author": "kmamtora",
31
+ "license": "MIT",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/kmamtora/ai-devx.git"
35
+ },
36
+ "bugs": {
37
+ "url": "https://github.com/kmamtora/ai-devx/issues"
38
+ },
39
+ "homepage": "https://github.com/kmamtora/ai-devx#readme",
40
+ "engines": {
41
+ "node": ">=16.0.0"
42
+ },
43
+ "files": [
44
+ "bin/",
45
+ "src/",
46
+ "templates/",
47
+ "README.md",
48
+ "LICENSE"
49
+ ],
50
+ "dependencies": {
51
+ "commander": "^11.1.0",
52
+ "chalk": "^4.1.2",
53
+ "fs-extra": "^11.2.0",
54
+ "ora": "^5.4.1",
55
+ "inquirer": "^8.2.6",
56
+ "axios": "^1.6.2",
57
+ "adm-zip": "^0.5.10"
58
+ },
59
+ "devDependencies": {
60
+ "eslint": "^8.56.0",
61
+ "prettier": "^3.1.1"
62
+ }
63
+ }
@@ -0,0 +1,86 @@
1
+ const path = require('path');
2
+ const fs = require('fs-extra');
3
+ const ora = require('ora');
4
+ const logger = require('../utils/logger');
5
+ const fileUtils = require('../utils/fileSystem');
6
+ const config = require('../config');
7
+
8
+ async function initCommand(options) {
9
+ const { force, path: targetPath, branch, quiet, dryRun, source } = options;
10
+
11
+ const spinner = quiet ? null : ora('Installing AI-DEVX templates...').start();
12
+
13
+ try {
14
+ const absolutePath = path.resolve(targetPath);
15
+ const agentPath = path.join(absolutePath, config.AGENT_FOLDER);
16
+
17
+ // Check if already installed
18
+ const isInstalled = await fileUtils.isInstalled(absolutePath);
19
+
20
+ if (isInstalled && !force && !dryRun) {
21
+ if (spinner) spinner.stop();
22
+ logger.warning('AI-DEVX is already installed in this directory.');
23
+ logger.info('Use --force to overwrite or run "ai-devx update" to update.');
24
+ logger.blank();
25
+ logger.info('To keep .agent/ local without git tracking:');
26
+ logger.step('Add ".agent/" to .git/info/exclude (not .gitignore)');
27
+ return;
28
+ }
29
+
30
+ if (dryRun) {
31
+ if (spinner) spinner.stop();
32
+ logger.info('DRY RUN - Actions that would be taken:');
33
+ logger.step(`Install templates to: ${agentPath}`);
34
+ if (isInstalled) logger.step('Overwrite existing installation');
35
+ return;
36
+ }
37
+
38
+ // Determine source path
39
+ const sourcePath = path.join(__dirname, '../../templates/.agent');
40
+
41
+ // Copy templates
42
+ if (spinner) spinner.text = 'Copying template files...';
43
+ await fileUtils.copyDir(sourcePath, agentPath, { force });
44
+
45
+ // Write version file
46
+ const versionFile = path.join(agentPath, 'VERSION');
47
+ await fs.writeFile(versionFile, config.version || '1.0.0');
48
+
49
+ // Write config file
50
+ const configFile = path.join(agentPath, 'config.json');
51
+ await fileUtils.writeJson(configFile, {
52
+ version: '1.0.0',
53
+ installedAt: new Date().toISOString(),
54
+ source: source
55
+ });
56
+
57
+ if (spinner) spinner.succeed('AI-DEVX templates installed successfully!');
58
+
59
+ if (!quiet) {
60
+ logger.blank();
61
+ logger.success(`Installed in: ${agentPath}`);
62
+ logger.blank();
63
+ logger.info('What\'s included:');
64
+ logger.step(`Agents: 9 specialist personas`);
65
+ logger.step(`Skills: Domain-specific knowledge modules`);
66
+ logger.step(`Workflows: Slash commands (/plan, /create, /debug, etc.)`);
67
+ logger.step(`Scripts: Validation and automation tools`);
68
+ logger.blank();
69
+ logger.info('Quick Start:');
70
+ logger.step('Type /plan to create a task breakdown');
71
+ logger.step('Type /create to build new features');
72
+ logger.step('Type /debug for systematic debugging');
73
+ logger.blank();
74
+ logger.warning('Important: For Cursor/Windsurf compatibility');
75
+ logger.step('Add ".agent/" to .git/info/exclude (NOT .gitignore)');
76
+ logger.step('This keeps templates local while allowing AI indexing');
77
+ }
78
+
79
+ } catch (error) {
80
+ if (spinner) spinner.fail('Installation failed');
81
+ logger.error(error.message);
82
+ process.exit(1);
83
+ }
84
+ }
85
+
86
+ module.exports = initCommand;
@@ -0,0 +1,60 @@
1
+ const path = require('path');
2
+ const chalk = require('chalk');
3
+ const logger = require('../utils/logger');
4
+ const fileUtils = require('../utils/fileSystem');
5
+ const config = require('../config');
6
+
7
+ async function statusCommand(options) {
8
+ const { path: targetPath } = options;
9
+ const absolutePath = path.resolve(targetPath);
10
+ const agentPath = path.join(absolutePath, config.AGENT_FOLDER);
11
+
12
+ logger.blank();
13
+ logger.info('AI-DEVX Status');
14
+ logger.blank();
15
+
16
+ const isInstalled = await fileUtils.isInstalled(absolutePath);
17
+
18
+ if (!isInstalled) {
19
+ logger.error('Not installed');
20
+ logger.info(`Directory: ${absolutePath}`);
21
+ logger.blank();
22
+ logger.info('Run "ai-devx init" to install');
23
+ return;
24
+ }
25
+
26
+ // Get version
27
+ const version = await fileUtils.getVersion(agentPath);
28
+ const configData = await fileUtils.readJson(path.join(agentPath, 'config.json'));
29
+
30
+ logger.success('Installed');
31
+ logger.blank();
32
+ logger.info(`Directory: ${agentPath}`);
33
+ logger.info(`Version: ${chalk.green(version || 'unknown')}`);
34
+
35
+ if (configData) {
36
+ if (configData.installedAt) {
37
+ logger.info(`Installed: ${new Date(configData.installedAt).toLocaleDateString()}`);
38
+ }
39
+ if (configData.updatedAt) {
40
+ logger.info(`Last updated: ${new Date(configData.updatedAt).toLocaleDateString()}`);
41
+ }
42
+ }
43
+
44
+ logger.blank();
45
+ logger.info('Available Components:');
46
+ logger.step(`Agents: 9 specialist personas`);
47
+ logger.step(`Skills: Multiple domain knowledge modules`);
48
+ logger.step(`Workflows: 9 slash commands`);
49
+ logger.step(`Scripts: Validation and automation tools`);
50
+
51
+ logger.blank();
52
+ logger.info('Quick Commands:');
53
+ config.WORKFLOWS.slice(0, 5).forEach(wf => {
54
+ logger.step(`${chalk.cyan(wf.command)} - ${wf.description}`);
55
+ });
56
+
57
+ logger.blank();
58
+ }
59
+
60
+ module.exports = statusCommand;
@@ -0,0 +1,77 @@
1
+ const path = require('path');
2
+ const fs = require('fs-extra');
3
+ const ora = require('ora');
4
+ const logger = require('../utils/logger');
5
+ const fileUtils = require('../utils/fileSystem');
6
+ const config = require('../config');
7
+
8
+ async function updateCommand(options) {
9
+ const { force, backup, quiet } = options;
10
+
11
+ const spinner = quiet ? null : ora('Checking for updates...').start();
12
+
13
+ try {
14
+ const cwd = process.cwd();
15
+ const isInstalled = await fileUtils.isInstalled(cwd);
16
+
17
+ if (!isInstalled) {
18
+ if (spinner) spinner.stop();
19
+ logger.error('AI-DEVX is not installed in this directory.');
20
+ logger.info('Run "ai-devx init" first.');
21
+ return;
22
+ }
23
+
24
+ const agentPath = path.join(cwd, config.AGENT_FOLDER);
25
+ const currentVersion = await fileUtils.getVersion(agentPath);
26
+ const latestVersion = '1.0.0'; // In real implementation, fetch from GitHub
27
+
28
+ if (currentVersion === latestVersion && !force) {
29
+ if (spinner) spinner.stop();
30
+ logger.success('AI-DEVX is already up to date!');
31
+ logger.info(`Version: ${currentVersion}`);
32
+ return;
33
+ }
34
+
35
+ if (spinner) spinner.text = 'Updating templates...';
36
+
37
+ // Create backup if requested
38
+ if (backup) {
39
+ const backupPath = await fileUtils.backup(cwd);
40
+ if (backupPath && !quiet) {
41
+ logger.info(`Backup created: ${backupPath}`);
42
+ }
43
+ }
44
+
45
+ // Copy updated templates
46
+ const sourcePath = path.join(__dirname, '../../templates/.agent');
47
+ await fileUtils.copyDir(sourcePath, agentPath, { force: true });
48
+
49
+ // Update version file
50
+ const versionFile = path.join(agentPath, 'VERSION');
51
+ await fs.writeFile(versionFile, latestVersion);
52
+
53
+ // Update config
54
+ const configFile = path.join(agentPath, 'config.json');
55
+ const existingConfig = await fileUtils.readJson(configFile) || {};
56
+ existingConfig.version = latestVersion;
57
+ existingConfig.updatedAt = new Date().toISOString();
58
+ await fileUtils.writeJson(configFile, existingConfig);
59
+
60
+ if (spinner) spinner.succeed('AI-DEVX updated successfully!');
61
+
62
+ if (!quiet) {
63
+ logger.blank();
64
+ logger.success(`Updated to version: ${latestVersion}`);
65
+ if (currentVersion) {
66
+ logger.info(`Previous version: ${currentVersion}`);
67
+ }
68
+ }
69
+
70
+ } catch (error) {
71
+ if (spinner) spinner.fail('Update failed');
72
+ logger.error(error.message);
73
+ process.exit(1);
74
+ }
75
+ }
76
+
77
+ module.exports = updateCommand;