@zweer/dev 1.2.0 ā 1.3.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.
- package/README.md +362 -34
- package/cli/commands/cao/agent/create.d.ts +10 -2
- package/cli/commands/cao/agent/create.js +155 -23
- package/cli/commands/cao/index.js +5 -3
- package/cli/commands/cao/list.d.ts +3 -1
- package/cli/commands/cao/list.js +13 -5
- package/cli/commands/cao/status.d.ts +2 -0
- package/cli/commands/cao/status.js +25 -0
- package/cli/commands/cao/uninstall.d.ts +2 -0
- package/cli/commands/cao/uninstall.js +16 -0
- package/cli/utils/cao.d.ts +2 -0
- package/cli/utils/cao.js +16 -0
- package/package.json +1 -1
- package/templates/orchestrator_lambda.md +263 -0
- package/templates/orchestrator_microservices.md +345 -0
- package/templates/orchestrator_mobile.md +199 -0
- package/templates/orchestrator_writing.md +306 -0
- package/cli/commands/cao/init.d.ts +0 -15
- package/cli/commands/cao/init.js +0 -87
- /package/templates/{orchestrator.md ā orchestrator_webapp.md} +0 -0
package/README.md
CHANGED
|
@@ -19,6 +19,7 @@ Central repository of reusable configurations and specialized AI agents for soft
|
|
|
19
19
|
- [Benefits of This Approach](#benefits-of-this-approach)
|
|
20
20
|
- [Contributing](#contributing)
|
|
21
21
|
- [Roadmap](#roadmap)
|
|
22
|
+
- [CI/CD](#cicd)
|
|
22
23
|
- [License](#license)
|
|
23
24
|
|
|
24
25
|
## Project Purpose
|
|
@@ -278,29 +279,9 @@ Adds configurations to existing project:
|
|
|
278
279
|
|
|
279
280
|
All CAO-related commands are under the `cao` subcommand:
|
|
280
281
|
|
|
281
|
-
##### `dev cao init [name]`
|
|
282
|
-
|
|
283
|
-
Create an orchestrator in your current project.
|
|
284
|
-
|
|
285
|
-
```bash
|
|
286
|
-
# Interactive mode
|
|
287
|
-
dev cao init
|
|
288
|
-
|
|
289
|
-
# With custom name
|
|
290
|
-
dev cao init my_orchestrator
|
|
291
|
-
|
|
292
|
-
# Skip prompts (use defaults)
|
|
293
|
-
dev cao init --yes
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
Creates `.cao/agents/<name>.md` with a template orchestrator configured for your project.
|
|
297
|
-
|
|
298
|
-
**Options:**
|
|
299
|
-
- `-y, --yes` - Skip prompts and use defaults
|
|
300
|
-
|
|
301
282
|
##### `dev cao install`
|
|
302
283
|
|
|
303
|
-
Install CAO (CLI Agent Orchestrator) and all
|
|
284
|
+
Install CAO (CLI Agent Orchestrator) and all global agents.
|
|
304
285
|
|
|
305
286
|
```bash
|
|
306
287
|
# Install everything
|
|
@@ -317,12 +298,88 @@ This command:
|
|
|
317
298
|
1. Installs tmux configuration
|
|
318
299
|
2. Installs `uv` package manager
|
|
319
300
|
3. Installs CAO via `uv tool install`
|
|
320
|
-
4. Installs all 30+
|
|
301
|
+
4. Installs all 30+ global agents (zweer_*) from this repository
|
|
321
302
|
|
|
322
303
|
**Options:**
|
|
323
304
|
- `--cao-only` - Install only CAO prerequisites
|
|
324
305
|
- `--agents-only` - Install only agents (skip CAO)
|
|
325
306
|
|
|
307
|
+
##### `dev cao agent create [name]`
|
|
308
|
+
|
|
309
|
+
Create a new local agent in your project.
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
# Interactive mode
|
|
313
|
+
dev cao agent create
|
|
314
|
+
|
|
315
|
+
# With custom name
|
|
316
|
+
dev cao agent create my_orchestrator
|
|
317
|
+
|
|
318
|
+
# Web app orchestrator (default)
|
|
319
|
+
dev cao agent create --template orchestrator_webapp
|
|
320
|
+
|
|
321
|
+
# Mobile app orchestrator
|
|
322
|
+
dev cao agent create --template orchestrator_mobile
|
|
323
|
+
|
|
324
|
+
# Serverless Lambda orchestrator
|
|
325
|
+
dev cao agent create --template orchestrator_lambda
|
|
326
|
+
|
|
327
|
+
# Microservices orchestrator
|
|
328
|
+
dev cao agent create --template orchestrator_microservices
|
|
329
|
+
|
|
330
|
+
# Writing project orchestrator
|
|
331
|
+
dev cao agent create --template orchestrator_writing
|
|
332
|
+
|
|
333
|
+
# Skip prompts (use defaults)
|
|
334
|
+
dev cao agent create my_agent --yes
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Creates `.cao/agents/<name>.md` with a template agent configured for your project.
|
|
338
|
+
|
|
339
|
+
**Available Templates:**
|
|
340
|
+
- `orchestrator_webapp` - Web application (Next.js, React, etc.) - **default**
|
|
341
|
+
- `orchestrator_mobile` - Mobile app (React Native, Flutter, iOS, Android)
|
|
342
|
+
- `orchestrator_lambda` - Serverless with AWS Lambda
|
|
343
|
+
- `orchestrator_microservices` - Microservices architecture
|
|
344
|
+
- `orchestrator_writing` - Content creation and writing projects
|
|
345
|
+
|
|
346
|
+
**Options:**
|
|
347
|
+
- `-t, --template <template>` - Template to use
|
|
348
|
+
- `-y, --yes` - Skip prompts and use defaults
|
|
349
|
+
|
|
350
|
+
##### `dev cao agent list`
|
|
351
|
+
|
|
352
|
+
List all local agents in `.cao/agents/`.
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
dev cao agent list
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
##### `dev cao agent remove <name>`
|
|
359
|
+
|
|
360
|
+
Remove a local agent.
|
|
361
|
+
|
|
362
|
+
```bash
|
|
363
|
+
# With confirmation prompt
|
|
364
|
+
dev cao agent remove my_agent
|
|
365
|
+
|
|
366
|
+
# Skip confirmation
|
|
367
|
+
dev cao agent remove my_agent --yes
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
**Options:**
|
|
371
|
+
- `-y, --yes` - Skip confirmation
|
|
372
|
+
|
|
373
|
+
##### `dev cao sync`
|
|
374
|
+
|
|
375
|
+
Sync (install/update) all local agents from `.cao/agents/`.
|
|
376
|
+
|
|
377
|
+
```bash
|
|
378
|
+
dev cao sync
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
Run this after creating or modifying local agents to install/update them in CAO.
|
|
382
|
+
|
|
326
383
|
##### `dev cao server`
|
|
327
384
|
|
|
328
385
|
Launch the CAO server.
|
|
@@ -350,10 +407,42 @@ dev cao launch zweer_web_frontend
|
|
|
350
407
|
List all available agents with descriptions.
|
|
351
408
|
|
|
352
409
|
```bash
|
|
410
|
+
# List all agents with installation status
|
|
353
411
|
dev cao list
|
|
412
|
+
|
|
413
|
+
# List only installed agents
|
|
414
|
+
dev cao list --installed
|
|
354
415
|
```
|
|
355
416
|
|
|
356
|
-
Shows all 30+ agents organized by category
|
|
417
|
+
Shows all 30+ agents organized by category with installation status indicators:
|
|
418
|
+
- ā = Installed
|
|
419
|
+
- ā = Not installed
|
|
420
|
+
|
|
421
|
+
**Options:**
|
|
422
|
+
- `--installed` - Show only installed agents
|
|
423
|
+
|
|
424
|
+
##### `dev cao status`
|
|
425
|
+
|
|
426
|
+
Show installation status summary.
|
|
427
|
+
|
|
428
|
+
```bash
|
|
429
|
+
dev cao status
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
Displays:
|
|
433
|
+
- Number of installed agents
|
|
434
|
+
- Number of not installed agents
|
|
435
|
+
- List of agents that are not installed
|
|
436
|
+
|
|
437
|
+
##### `dev cao uninstall <agent>`
|
|
438
|
+
|
|
439
|
+
Uninstall a specific agent.
|
|
440
|
+
|
|
441
|
+
```bash
|
|
442
|
+
dev cao uninstall zweer_web_frontend
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
Removes the agent from CAO's agent directory (`~/.aws/cli-agent-orchestrator/agent-context/`).
|
|
357
446
|
|
|
358
447
|
## How to Use Agents
|
|
359
448
|
|
|
@@ -363,20 +452,39 @@ Shows all 30+ agents organized by category.
|
|
|
363
452
|
# In your project directory
|
|
364
453
|
cd my-project
|
|
365
454
|
|
|
366
|
-
#
|
|
367
|
-
dev cao init
|
|
368
|
-
|
|
369
|
-
# Install CAO and agents
|
|
455
|
+
# Install CAO and global agents (zweer_*)
|
|
370
456
|
dev cao install
|
|
457
|
+
|
|
458
|
+
# Create orchestrator based on your project type
|
|
459
|
+
|
|
460
|
+
# For web app (default)
|
|
461
|
+
dev cao agent create
|
|
462
|
+
|
|
463
|
+
# For mobile app
|
|
464
|
+
dev cao agent create --template orchestrator_mobile
|
|
465
|
+
|
|
466
|
+
# For serverless Lambda
|
|
467
|
+
dev cao agent create --template orchestrator_lambda
|
|
468
|
+
|
|
469
|
+
# For microservices
|
|
470
|
+
dev cao agent create --template orchestrator_microservices
|
|
471
|
+
|
|
472
|
+
# For writing project
|
|
473
|
+
dev cao agent create --template orchestrator_writing
|
|
474
|
+
|
|
475
|
+
# Sync all local agents
|
|
476
|
+
dev cao sync
|
|
371
477
|
```
|
|
372
478
|
|
|
373
|
-
### Customize
|
|
479
|
+
### Customize Agents
|
|
374
480
|
|
|
375
|
-
Edit `.cao/agents
|
|
481
|
+
Edit agents in `.cao/agents/` to add:
|
|
376
482
|
- Project-specific context
|
|
377
483
|
- Tech stack details
|
|
378
484
|
- Architecture notes
|
|
379
|
-
- Custom
|
|
485
|
+
- Custom logic and tools
|
|
486
|
+
|
|
487
|
+
After editing, run `dev cao sync` to update them in CAO.
|
|
380
488
|
|
|
381
489
|
### Launch and Work
|
|
382
490
|
|
|
@@ -385,7 +493,23 @@ Edit `.cao/agents/my-project_orchestrator.md` to add:
|
|
|
385
493
|
dev cao server
|
|
386
494
|
|
|
387
495
|
# Launch your orchestrator (in another terminal)
|
|
388
|
-
dev cao launch
|
|
496
|
+
dev cao launch my_orchestrator
|
|
497
|
+
|
|
498
|
+
# Or launch a specialized agent
|
|
499
|
+
dev cao launch db_specialist
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
### Managing Local Agents
|
|
503
|
+
|
|
504
|
+
```bash
|
|
505
|
+
# List all local agents
|
|
506
|
+
dev cao agent list
|
|
507
|
+
|
|
508
|
+
# Remove an agent
|
|
509
|
+
dev cao agent remove old_agent
|
|
510
|
+
|
|
511
|
+
# Sync after modifications
|
|
512
|
+
dev cao sync
|
|
389
513
|
```
|
|
390
514
|
|
|
391
515
|
### Use Agent Handoff
|
|
@@ -499,9 +623,213 @@ To add new agents:
|
|
|
499
623
|
- [x] Android native
|
|
500
624
|
- [x] Data engineering agents (`agents/data/`)
|
|
501
625
|
- [x] Writing agents (`agents/writing/`)
|
|
502
|
-
- [
|
|
503
|
-
- [
|
|
504
|
-
- [
|
|
626
|
+
- [x] Common configurations
|
|
627
|
+
- [x] TypeScript, Biome, Vitest configs
|
|
628
|
+
- [x] `dev bootstrap` command
|
|
629
|
+
- [x] `dev setup` command
|
|
630
|
+
- [x] Project templates (`templates/`)
|
|
631
|
+
- [x] Web app orchestrator
|
|
632
|
+
- [x] Mobile app orchestrator
|
|
633
|
+
- [x] Serverless Lambda orchestrator
|
|
634
|
+
- [x] Microservices orchestrator
|
|
635
|
+
- [x] Writing project orchestrator
|
|
636
|
+
- [x] CLI tool for agent management
|
|
637
|
+
- [x] Install/uninstall agents
|
|
638
|
+
- [x] List agents with status
|
|
639
|
+
- [x] Create orchestrators from templates
|
|
640
|
+
- [x] Sync local agents
|
|
641
|
+
|
|
642
|
+
## CI/CD
|
|
643
|
+
|
|
644
|
+
This project uses GitHub Actions for continuous integration and deployment. All workflows are **reusable** and can be used in other projects.
|
|
645
|
+
|
|
646
|
+
### Available Workflows
|
|
647
|
+
|
|
648
|
+
- `ci.yml` - Test, build, and lint (reusable base workflow)
|
|
649
|
+
- `pr.yml` - Pull request checks (includes CI + validation)
|
|
650
|
+
- `npm.yml` - Release and publish to npm
|
|
651
|
+
- `security.yml` - Security audit
|
|
652
|
+
- `dependabot-auto-merge.yml` - Auto-merge Dependabot PRs
|
|
653
|
+
|
|
654
|
+
### How to Use in Other Projects
|
|
655
|
+
|
|
656
|
+
#### Option 1: Call Workflows from This Repository
|
|
657
|
+
|
|
658
|
+
Create workflows in your project that call these reusable workflows:
|
|
659
|
+
|
|
660
|
+
**`.github/workflows/pr.yml`** in your project:
|
|
661
|
+
```yaml
|
|
662
|
+
name: PR
|
|
663
|
+
|
|
664
|
+
on:
|
|
665
|
+
pull_request:
|
|
666
|
+
|
|
667
|
+
permissions:
|
|
668
|
+
contents: read
|
|
669
|
+
pull-requests: write
|
|
670
|
+
|
|
671
|
+
jobs:
|
|
672
|
+
pr:
|
|
673
|
+
uses: zweer/dev/.github/workflows/pr.yml@main
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
**`.github/workflows/release.yml`** in your project:
|
|
677
|
+
```yaml
|
|
678
|
+
name: Release
|
|
679
|
+
|
|
680
|
+
on:
|
|
681
|
+
push:
|
|
682
|
+
branches:
|
|
683
|
+
- main
|
|
684
|
+
|
|
685
|
+
permissions:
|
|
686
|
+
contents: write
|
|
687
|
+
issues: write
|
|
688
|
+
pull-requests: write
|
|
689
|
+
id-token: write
|
|
690
|
+
|
|
691
|
+
jobs:
|
|
692
|
+
release:
|
|
693
|
+
uses: zweer/dev/.github/workflows/npm.yml@main
|
|
694
|
+
secrets:
|
|
695
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
696
|
+
```
|
|
697
|
+
|
|
698
|
+
**`.github/workflows/security.yml`** in your project:
|
|
699
|
+
```yaml
|
|
700
|
+
name: Security
|
|
701
|
+
|
|
702
|
+
on:
|
|
703
|
+
schedule:
|
|
704
|
+
- cron: '0 9 * * 1'
|
|
705
|
+
workflow_dispatch:
|
|
706
|
+
|
|
707
|
+
permissions:
|
|
708
|
+
contents: read
|
|
709
|
+
|
|
710
|
+
jobs:
|
|
711
|
+
audit:
|
|
712
|
+
uses: zweer/dev/.github/workflows/security.yml@main
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
#### Option 2: Copy Workflows to Your Project
|
|
716
|
+
|
|
717
|
+
If you prefer to have full control, copy the workflow files to your project's `.github/workflows/` directory.
|
|
718
|
+
|
|
719
|
+
**Note**: If you copy `pr.yml` or `npm.yml`, you'll also need to copy `ci.yml` since they depend on it.
|
|
720
|
+
|
|
721
|
+
### Workflow Dependencies
|
|
722
|
+
|
|
723
|
+
```
|
|
724
|
+
pr.yml
|
|
725
|
+
āāā ci.yml (required)
|
|
726
|
+
|
|
727
|
+
npm.yml
|
|
728
|
+
āāā ci.yml (required)
|
|
729
|
+
|
|
730
|
+
security.yml (standalone)
|
|
731
|
+
|
|
732
|
+
dependabot-auto-merge.yml (standalone)
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
### Customization
|
|
736
|
+
|
|
737
|
+
**Using a Specific Version**
|
|
738
|
+
|
|
739
|
+
Instead of `@main`, you can pin to a specific version:
|
|
740
|
+
|
|
741
|
+
```yaml
|
|
742
|
+
uses: zweer/dev/.github/workflows/pr.yml@v1.2.0
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
**Overriding CI Workflow**
|
|
746
|
+
|
|
747
|
+
If you need custom CI steps:
|
|
748
|
+
|
|
749
|
+
1. Copy `ci.yml` to your project
|
|
750
|
+
2. Modify it as needed
|
|
751
|
+
3. Update `pr.yml` and `npm.yml` to use your local `ci.yml`:
|
|
752
|
+
|
|
753
|
+
```yaml
|
|
754
|
+
jobs:
|
|
755
|
+
ci:
|
|
756
|
+
uses: ./.github/workflows/ci.yml # Use local version
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
### Complete Setup Example
|
|
760
|
+
|
|
761
|
+
For a typical npm package, create these files in your project:
|
|
762
|
+
|
|
763
|
+
**`.github/workflows/pr.yml`**:
|
|
764
|
+
```yaml
|
|
765
|
+
name: PR
|
|
766
|
+
on:
|
|
767
|
+
pull_request:
|
|
768
|
+
permissions:
|
|
769
|
+
contents: read
|
|
770
|
+
pull-requests: write
|
|
771
|
+
jobs:
|
|
772
|
+
pr:
|
|
773
|
+
uses: zweer/dev/.github/workflows/pr.yml@main
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
**`.github/workflows/release.yml`**:
|
|
777
|
+
```yaml
|
|
778
|
+
name: Release
|
|
779
|
+
on:
|
|
780
|
+
push:
|
|
781
|
+
branches: [main]
|
|
782
|
+
permissions:
|
|
783
|
+
contents: write
|
|
784
|
+
issues: write
|
|
785
|
+
pull-requests: write
|
|
786
|
+
id-token: write
|
|
787
|
+
jobs:
|
|
788
|
+
release:
|
|
789
|
+
uses: zweer/dev/.github/workflows/npm.yml@main
|
|
790
|
+
secrets:
|
|
791
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
792
|
+
```
|
|
793
|
+
|
|
794
|
+
**`.github/dependabot.yml`**:
|
|
795
|
+
```yaml
|
|
796
|
+
version: 2
|
|
797
|
+
updates:
|
|
798
|
+
- package-ecosystem: npm
|
|
799
|
+
directory: /
|
|
800
|
+
schedule:
|
|
801
|
+
interval: weekly
|
|
802
|
+
```
|
|
803
|
+
|
|
804
|
+
That's it! Your project now has:
|
|
805
|
+
- ā
Automated testing on PRs
|
|
806
|
+
- ā
Automated releases with semantic-release
|
|
807
|
+
- ā
Automated dependency updates
|
|
808
|
+
- ā
PR title validation
|
|
809
|
+
|
|
810
|
+
### Dependabot
|
|
811
|
+
|
|
812
|
+
Automated dependency updates configured in `.github/dependabot.yml`:
|
|
813
|
+
- **npm dependencies**: Weekly updates on Mondays
|
|
814
|
+
- **GitHub Actions**: Weekly updates on Mondays
|
|
815
|
+
- Groups patch/minor updates together
|
|
816
|
+
- Separate groups for dev and production dependencies
|
|
817
|
+
|
|
818
|
+
### Required Secrets
|
|
819
|
+
|
|
820
|
+
For the workflows to function properly, configure these secrets in your GitHub repository:
|
|
821
|
+
|
|
822
|
+
- `NPM_TOKEN` - npm authentication token for publishing packages
|
|
823
|
+
|
|
824
|
+
### Branch Protection
|
|
825
|
+
|
|
826
|
+
Recommended branch protection rules for `main`:
|
|
827
|
+
|
|
828
|
+
- Require pull request reviews before merging
|
|
829
|
+
- Require status checks to pass (Test & Lint from CI workflow)
|
|
830
|
+
- Require branches to be up to date before merging
|
|
831
|
+
- Require conversation resolution before merging
|
|
832
|
+
- Do not allow bypassing the above settings
|
|
505
833
|
|
|
506
834
|
## License
|
|
507
835
|
|
|
@@ -3,8 +3,16 @@ export interface AgentConfig {
|
|
|
3
3
|
name: string;
|
|
4
4
|
projectName: string;
|
|
5
5
|
projectPath: string;
|
|
6
|
-
techStack
|
|
7
|
-
projectStructure
|
|
6
|
+
techStack?: string;
|
|
7
|
+
projectStructure?: string;
|
|
8
|
+
platform?: string;
|
|
9
|
+
targetPlatforms?: string;
|
|
10
|
+
iacTool?: string;
|
|
11
|
+
runtime?: string;
|
|
12
|
+
serviceMesh?: string;
|
|
13
|
+
contentType?: string;
|
|
14
|
+
audience?: string;
|
|
15
|
+
tone?: string;
|
|
8
16
|
template: string;
|
|
9
17
|
}
|
|
10
18
|
export declare function createAgent(config: AgentConfig): Promise<{
|
|
@@ -8,12 +8,33 @@ export async function createAgent(config) {
|
|
|
8
8
|
// Read template
|
|
9
9
|
const templatePath = join(paths.templates, `${config.template}.md`);
|
|
10
10
|
let template = await readFile(templatePath, 'utf-8');
|
|
11
|
-
// Replace placeholders
|
|
11
|
+
// Replace common placeholders
|
|
12
12
|
template = template
|
|
13
13
|
.replace(/\{\{PROJECT_NAME\}\}/g, config.projectName)
|
|
14
|
-
.replace(/\{\{PROJECT_PATH\}\}/g, config.projectPath)
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
.replace(/\{\{PROJECT_PATH\}\}/g, config.projectPath);
|
|
15
|
+
// Replace template-specific placeholders
|
|
16
|
+
if (config.techStack)
|
|
17
|
+
template = template.replace(/\{\{TECH_STACK\}\}/g, config.techStack);
|
|
18
|
+
if (config.projectStructure)
|
|
19
|
+
template = template.replace(/\{\{PROJECT_STRUCTURE\}\}/g, config.projectStructure);
|
|
20
|
+
if (config.platform)
|
|
21
|
+
template = template.replace(/\{\{PLATFORM\}\}/g, config.platform);
|
|
22
|
+
if (config.targetPlatforms)
|
|
23
|
+
template = template.replace(/\{\{TARGET_PLATFORMS\}\}/g, config.targetPlatforms);
|
|
24
|
+
if (config.iacTool)
|
|
25
|
+
template = template.replace(/\{\{IAC_TOOL\}\}/g, config.iacTool);
|
|
26
|
+
if (config.runtime)
|
|
27
|
+
template = template.replace(/\{\{RUNTIME\}\}/g, config.runtime);
|
|
28
|
+
if (config.serviceMesh)
|
|
29
|
+
template = template.replace(/\{\{SERVICE_MESH\}\}/g, config.serviceMesh);
|
|
30
|
+
if (config.contentType)
|
|
31
|
+
template = template.replace(/\{\{CONTENT_TYPE\}\}/g, config.contentType);
|
|
32
|
+
if (config.audience)
|
|
33
|
+
template = template.replace(/\{\{AUDIENCE\}\}/g, config.audience);
|
|
34
|
+
if (config.tone)
|
|
35
|
+
template = template.replace(/\{\{TONE\}\}/g, config.tone);
|
|
36
|
+
// Replace any remaining placeholders with empty string
|
|
37
|
+
template = template.replace(/\{\{[A-Z_]+\}\}/g, '');
|
|
17
38
|
// Create .cao/agents directory
|
|
18
39
|
const caoDir = join(config.projectPath, '.cao', 'agents');
|
|
19
40
|
await mkdir(caoDir, { recursive: true });
|
|
@@ -24,26 +45,59 @@ export async function createAgent(config) {
|
|
|
24
45
|
}
|
|
25
46
|
export function getDefaultConfig(cwd, name, template) {
|
|
26
47
|
const projectName = basename(cwd);
|
|
27
|
-
|
|
48
|
+
const baseConfig = {
|
|
28
49
|
name: name || `${projectName}_orchestrator`,
|
|
29
50
|
projectName,
|
|
30
51
|
projectPath: cwd,
|
|
31
|
-
|
|
32
|
-
projectStructure: 'app/, components/, lib/',
|
|
33
|
-
template: template || 'orchestrator',
|
|
52
|
+
template: template || 'orchestrator_webapp',
|
|
34
53
|
};
|
|
54
|
+
// Template-specific defaults
|
|
55
|
+
switch (template) {
|
|
56
|
+
case 'orchestrator_mobile':
|
|
57
|
+
return {
|
|
58
|
+
...baseConfig,
|
|
59
|
+
platform: 'React Native',
|
|
60
|
+
targetPlatforms: 'iOS, Android',
|
|
61
|
+
};
|
|
62
|
+
case 'orchestrator_lambda':
|
|
63
|
+
return {
|
|
64
|
+
...baseConfig,
|
|
65
|
+
iacTool: 'AWS CDK',
|
|
66
|
+
runtime: 'Node.js 20',
|
|
67
|
+
};
|
|
68
|
+
case 'orchestrator_microservices':
|
|
69
|
+
return {
|
|
70
|
+
...baseConfig,
|
|
71
|
+
platform: 'EKS',
|
|
72
|
+
serviceMesh: 'None',
|
|
73
|
+
};
|
|
74
|
+
case 'orchestrator_writing':
|
|
75
|
+
return {
|
|
76
|
+
...baseConfig,
|
|
77
|
+
contentType: 'Blog',
|
|
78
|
+
audience: 'Developers',
|
|
79
|
+
tone: 'Professional',
|
|
80
|
+
};
|
|
81
|
+
default:
|
|
82
|
+
return {
|
|
83
|
+
...baseConfig,
|
|
84
|
+
techStack: 'Next.js, TypeScript, PostgreSQL',
|
|
85
|
+
projectStructure: 'app/, components/, lib/',
|
|
86
|
+
};
|
|
87
|
+
}
|
|
35
88
|
}
|
|
36
89
|
export const createCommand = new Command()
|
|
37
90
|
.name('create')
|
|
38
91
|
.description('Create a new agent in current project')
|
|
39
92
|
.argument('[name]', 'Agent name')
|
|
40
|
-
.option('-t, --template <template>', 'Template to use (
|
|
93
|
+
.option('-t, --template <template>', 'Template to use (orchestrator_webapp, orchestrator_mobile, orchestrator_lambda, orchestrator_microservices, orchestrator_writing)', 'orchestrator_webapp')
|
|
41
94
|
.option('-y, --yes', 'Skip prompts and use defaults')
|
|
42
95
|
.action(async (name, options) => {
|
|
43
96
|
const cwd = process.cwd();
|
|
44
97
|
let config = getDefaultConfig(cwd, name, options.template);
|
|
45
98
|
if (!options.yes) {
|
|
46
|
-
|
|
99
|
+
// Common prompts
|
|
100
|
+
const commonAnswers = await inquirer.prompt([
|
|
47
101
|
{
|
|
48
102
|
type: 'input',
|
|
49
103
|
name: 'name',
|
|
@@ -56,20 +110,98 @@ export const createCommand = new Command()
|
|
|
56
110
|
message: 'Project name:',
|
|
57
111
|
default: config.projectName,
|
|
58
112
|
},
|
|
59
|
-
{
|
|
60
|
-
type: 'input',
|
|
61
|
-
name: 'techStack',
|
|
62
|
-
message: 'Tech stack:',
|
|
63
|
-
default: config.techStack,
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
type: 'input',
|
|
67
|
-
name: 'projectStructure',
|
|
68
|
-
message: 'Main folders:',
|
|
69
|
-
default: config.projectStructure,
|
|
70
|
-
},
|
|
71
113
|
]);
|
|
72
|
-
config = { ...config, ...
|
|
114
|
+
config = { ...config, ...commonAnswers };
|
|
115
|
+
// Template-specific prompts
|
|
116
|
+
let specificAnswers = {};
|
|
117
|
+
switch (options.template) {
|
|
118
|
+
case 'orchestrator_mobile':
|
|
119
|
+
specificAnswers = await inquirer.prompt([
|
|
120
|
+
{
|
|
121
|
+
type: 'input',
|
|
122
|
+
name: 'platform',
|
|
123
|
+
message: 'Mobile platform:',
|
|
124
|
+
default: config.platform,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
type: 'input',
|
|
128
|
+
name: 'targetPlatforms',
|
|
129
|
+
message: 'Target platforms:',
|
|
130
|
+
default: config.targetPlatforms,
|
|
131
|
+
},
|
|
132
|
+
]);
|
|
133
|
+
break;
|
|
134
|
+
case 'orchestrator_lambda':
|
|
135
|
+
specificAnswers = await inquirer.prompt([
|
|
136
|
+
{
|
|
137
|
+
type: 'input',
|
|
138
|
+
name: 'iacTool',
|
|
139
|
+
message: 'IaC tool:',
|
|
140
|
+
default: config.iacTool,
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
type: 'input',
|
|
144
|
+
name: 'runtime',
|
|
145
|
+
message: 'Lambda runtime:',
|
|
146
|
+
default: config.runtime,
|
|
147
|
+
},
|
|
148
|
+
]);
|
|
149
|
+
break;
|
|
150
|
+
case 'orchestrator_microservices':
|
|
151
|
+
specificAnswers = await inquirer.prompt([
|
|
152
|
+
{
|
|
153
|
+
type: 'input',
|
|
154
|
+
name: 'platform',
|
|
155
|
+
message: 'Container platform:',
|
|
156
|
+
default: config.platform,
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
type: 'input',
|
|
160
|
+
name: 'serviceMesh',
|
|
161
|
+
message: 'Service mesh:',
|
|
162
|
+
default: config.serviceMesh,
|
|
163
|
+
},
|
|
164
|
+
]);
|
|
165
|
+
break;
|
|
166
|
+
case 'orchestrator_writing':
|
|
167
|
+
specificAnswers = await inquirer.prompt([
|
|
168
|
+
{
|
|
169
|
+
type: 'input',
|
|
170
|
+
name: 'contentType',
|
|
171
|
+
message: 'Content type:',
|
|
172
|
+
default: config.contentType,
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
type: 'input',
|
|
176
|
+
name: 'audience',
|
|
177
|
+
message: 'Target audience:',
|
|
178
|
+
default: config.audience,
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
type: 'input',
|
|
182
|
+
name: 'tone',
|
|
183
|
+
message: 'Tone:',
|
|
184
|
+
default: config.tone,
|
|
185
|
+
},
|
|
186
|
+
]);
|
|
187
|
+
break;
|
|
188
|
+
default:
|
|
189
|
+
specificAnswers = await inquirer.prompt([
|
|
190
|
+
{
|
|
191
|
+
type: 'input',
|
|
192
|
+
name: 'techStack',
|
|
193
|
+
message: 'Tech stack:',
|
|
194
|
+
default: config.techStack,
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
type: 'input',
|
|
198
|
+
name: 'projectStructure',
|
|
199
|
+
message: 'Main folders:',
|
|
200
|
+
default: config.projectStructure,
|
|
201
|
+
},
|
|
202
|
+
]);
|
|
203
|
+
}
|
|
204
|
+
config = { ...config, ...specificAnswers };
|
|
73
205
|
}
|
|
74
206
|
console.log(chalk.cyan(`\nšÆ Creating agent: ${config.name}\n`));
|
|
75
207
|
try {
|