@adaptic/maestro 1.1.0 → 1.1.2

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.
@@ -1,17 +1,88 @@
1
1
  # /init-maestro -- Configure a New Maestro Agent Identity
2
2
 
3
- You are running the Maestro initialization wizard. This is the single most important command in the system -- it transforms this repository from its current agent identity into a completely new autonomous AI agent.
3
+ You are running the Maestro initialization wizard. This is the single most important command in the system -- it configures this repository as a fully operational autonomous AI agent.
4
4
 
5
- Maestro is a framework for deploying autonomous AI agents on dedicated Mac minis. Each agent has its own identity, role, responsibilities, and operating style. This wizard gathers that information conversationally and then rewrites the repo in parallel.
5
+ This repo was created by `npx @adaptic/maestro create` and contains the Maestro framework. Your job is to bootstrap the system, give it an identity (a name, a role, responsibilities, and an operating style), configure external services, and bring it online. The wizard handles everything -- the user should not need to run any other setup commands.
6
6
 
7
7
  ## Important Context
8
8
 
9
9
  - The central config file is `config/agent.ts` -- this is the single source of truth for all identity values
10
- - The machine setup script `scripts/setup/init-agent.sh` runs AFTER this wizard completes
11
10
  - CLAUDE.md defines the agent's system prompt and operating instructions
12
11
  - There are 31 agent definitions in `agents/`, 13 trigger prompts in `schedules/triggers/`, and config files throughout the repo
13
12
  - The current agent identity must be fully replaced -- no references to the old agent should remain in critical files
14
13
 
14
+ ## Phase 0: System Bootstrap
15
+
16
+ Before gathering identity information, ensure the system is ready. Run these checks silently and only report issues:
17
+
18
+ ### Step 1: Prerequisites
19
+
20
+ Check that required tools are installed. Report any missing ones and offer to install them:
21
+
22
+ ```bash
23
+ # Check each — report OK or missing
24
+ node --version # Required: >= 20.0.0
25
+ npm --version # Required
26
+ claude --version # Required for triggers
27
+ jq --version # Required for hooks
28
+ ```
29
+
30
+ If Node.js or npm are missing, stop and tell the user to install them. If Claude CLI or jq are missing, warn but continue.
31
+
32
+ ### Step 2: Install dependencies
33
+
34
+ ```bash
35
+ npm install
36
+ ```
37
+
38
+ ### Step 3: Create directories
39
+
40
+ Ensure all operational directories exist (these should already exist from `maestro create`, but init-maestro may be re-run):
41
+
42
+ ```bash
43
+ # Create any missing state/log/memory directories
44
+ for dir in state/inbox/{slack,gmail,calendar,sms,whatsapp,internal,attachments,processed} \
45
+ state/{queues,dashboards,polling,handoffs,huddle,indexes,rag,sessions} \
46
+ state/{slack-responded,slack-thread-tracker,tmp} \
47
+ state/locks/outbound state/triggers/priority \
48
+ knowledge/{decisions,decisions/archive,entities,memory,sources,syntheses} \
49
+ memory/{interactions,indexes,templates} \
50
+ memory/profiles/{users,channels} \
51
+ memory/precedents/market-signals \
52
+ outputs/{briefs,drafts,memos,research,tasks,sessions} \
53
+ logs/{polling,workflows,sessions,audit,security,evolution,huddle,daemon} \
54
+ logs/{infra,monitor,phone,sms,whatsapp,email} \
55
+ self-optimization/scenarios tests; do
56
+ mkdir -p "$dir"
57
+ done
58
+ ```
59
+
60
+ ### Step 4: Global Claude Code settings
61
+
62
+ Install the global Claude Code settings to `~/.claude/settings.json`. Read the current content first — if it already exists and has substantive customisations, ask the user before overwriting. If it doesn't exist or is a default install, write it silently.
63
+
64
+ The template is in `scripts/setup/init-agent.sh` (the heredoc in Step 4 of that script). Extract and write it.
65
+
66
+ ### Step 5: Environment file
67
+
68
+ If `.env` doesn't exist, copy from `.env.example`:
69
+
70
+ ```bash
71
+ cp .env.example .env
72
+ ```
73
+
74
+ Tell the user: "I've created a .env file from the template. We'll fill in API keys during service configuration later."
75
+
76
+ ### Step 6: Report
77
+
78
+ Only print a summary if there were issues. If everything passed silently, just say:
79
+
80
+ ```
81
+ System bootstrap complete. Let's set up your agent.
82
+ ```
83
+
84
+ Then proceed to Phase 1.
85
+
15
86
  ## Phase 1: Gather Information
16
87
 
17
88
  Run a conversational wizard to collect the new agent's identity. Be friendly, encouraging, and clear. Ask questions in small groups (2-3 at a time), not as a wall of text. Confirm values as you go.
@@ -162,10 +233,10 @@ Does this look correct? (yes to proceed, or tell me what to change)
162
233
 
163
234
  ## Phase 2: Execute Changes
164
235
 
165
- Once the user confirms, deploy SEVEN sub-agents in parallel using the Agent tool with `run_in_background: true`. Announce what you are doing:
236
+ Once the user confirms, deploy EIGHT sub-agents in parallel using the Agent tool with `run_in_background: true`. Announce what you are doing:
166
237
 
167
238
  ```
168
- Deploying 7 parallel agents to rewrite the repository. This will take a minute or two...
239
+ Deploying 8 parallel agents to rewrite the repository and generate role-specific tools. This will take a minute or two...
169
240
  ```
170
241
 
171
242
  ### Sub-agent 1: Update config/agent.ts
@@ -262,20 +333,92 @@ Do NOT modify these sections (keep them exactly as they are, except for agent na
262
333
 
263
334
  2. **Any other files** that reference the old agent by name in `docs/`, `teams/`, or root-level markdown files. Do a thorough search and replace.
264
335
 
336
+ ### Sub-agent 8: Generate agent-specific tools and capabilities
337
+
338
+ **Instruction to sub-agent:**
339
+
340
+ Generate role-specific tool definitions, skills, and integrations for this agent based on their archetype and responsibilities. The goal is to operationalise every responsibility with concrete, callable tools.
341
+
342
+ 1. **Read `lib/tool-definitions.js`** from the maestro package (`~/maestro/lib/tool-definitions.js`) to understand the base set of 27 generic tools already available to all agents.
343
+
344
+ 2. **Generate `lib/agent-tools.js`** — a file containing agent-specific tool definitions that EXTEND the base set. These are tools that only this role needs. Generate based on archetype:
345
+
346
+ - **executive-operator**: stakeholder_briefing, board_pack_generator, org_chart_query, founder_dependency_check, communication_quality_audit
347
+ - **technical-leader**: code_review_trigger, architecture_decision_record, deployment_status, test_coverage_report, dependency_audit, security_scan
348
+ - **commercial-leader**: deal_stage_update, investor_update_draft, partnership_score, revenue_forecast, competitive_analysis
349
+ - **compliance-officer**: regulatory_submission_status, licence_gap_check, compliance_calendar, audit_trail_query, policy_violation_scan, cross_jurisdiction_check
350
+ - **product-leader**: feature_prioritisation, user_feedback_search, roadmap_status, design_review_trigger, metrics_dashboard
351
+ - **operations-leader**: process_efficiency_report, vendor_management, capacity_planning, sla_compliance_check, cost_analysis
352
+
353
+ For each tool, generate a full Claude API tool schema (name, description, input_schema with properties and required fields).
354
+
355
+ 3. **Generate `lib/agent-executor.js`** — execution logic for each agent-specific tool. Follow the same pattern as maestro's action-executor: lookup tools use `claude --print` with MCP-backed prompts, write tools call local scripts.
356
+
357
+ 4. **Create agent-specific Claude Code skills** in `plugins/agent-skills/skills/`:
358
+ - Generate 3-5 skills based on the archetype's primary workflows
359
+ - Each skill is a `.md` file with clear triggering rules
360
+ - Example for compliance-officer: `regulatory-check.md`, `submission-tracker.md`, `audit-readiness.md`
361
+ - Example for technical-leader: `code-review.md`, `architecture-decision.md`, `deployment-check.md`
362
+
363
+ 5. **Create `plugins/agent-skills/plugin.json`** with the skill manifest.
364
+
365
+ 6. **Update the agent's CLAUDE.md** to document the generated tools and skills:
366
+ - Add a "## Agent-Specific Tools" section listing the generated tools
367
+ - Add a "## Skills" section listing the generated skills
368
+ - Include usage examples
369
+
370
+ 7. **Wire it all together** — update the agent's operational scripts to import both maestro base tools AND agent-specific tools:
371
+ ```js
372
+ // In any script needing tools:
373
+ import { getToolsForAccessLevel } from "~/maestro/lib/tool-definitions.js";
374
+ import { getAgentTools } from "./lib/agent-tools.js";
375
+ const tools = [...getToolsForAccessLevel(level), ...getAgentTools(level)];
376
+ ```
377
+
378
+ The generated tools should be COMPREHENSIVE — every responsibility listed in Phase 1 should have at least one corresponding tool or skill that enables it. Think of tools as the agent's hands — without them, responsibilities are just words.
379
+
265
380
  ## Phase 3: Machine Configuration
266
381
 
267
- After identity rewriting completes, offer to configure the Mac mini for headless operation:
382
+ After identity rewriting completes, generate and install the launchd plists (these need the agent name from Phase 1):
383
+
384
+ ### Step 1: Generate launchd plists
385
+
386
+ ```bash
387
+ bash scripts/local-triggers/generate-plists.sh
388
+ ```
389
+
390
+ This reads `config/agent.ts` to get the agent's first name and generates all 13 launchd plist files with correct labels and paths.
391
+
392
+ ### Step 2: Install launchd agents
393
+
394
+ ```bash
395
+ LAUNCH_AGENTS_DIR="$HOME/Library/LaunchAgents"
396
+ mkdir -p "$LAUNCH_AGENTS_DIR"
397
+ for plist in scripts/local-triggers/plists/*.plist; do
398
+ PLIST_NAME=$(basename "$plist")
399
+ LABEL=$(basename "$plist" .plist)
400
+ DST="$LAUNCH_AGENTS_DIR/$PLIST_NAME"
401
+ launchctl unload "$DST" 2>/dev/null || true
402
+ cp "$plist" "$DST"
403
+ launchctl load "$DST"
404
+ done
405
+ ```
406
+
407
+ Report how many triggers were installed.
408
+
409
+ ### Step 3: macOS headless configuration (optional)
410
+
411
+ Offer to configure the Mac mini for headless 24/7 operation:
268
412
 
269
413
  ```
270
- Identity configuration complete. Would you like to configure the Mac mini now?
414
+ Would you like to configure the Mac mini for headless operation?
271
415
 
272
- This will:
416
+ This will (requires sudo):
273
417
  1. Enable auto-login (no password on reboot)
274
418
  2. Disable sleep/standby/screen saver
275
419
  3. Configure Parsec for remote desktop access
276
420
  4. Set up Slack with CDP for huddle automation
277
421
  5. Install virtual audio (BlackHole) for voice
278
- 6. Configure all boot-time services
279
422
 
280
423
  Run macOS configuration? (yes/no)
281
424
  ```
@@ -285,11 +428,6 @@ If yes, run:
285
428
  sudo ./scripts/setup/configure-macos.sh
286
429
  ```
287
430
 
288
- Then run the machine setup:
289
- ```bash
290
- npm run init-agent
291
- ```
292
-
293
431
  ## Phase 4: Third-Party Service Configuration
294
432
 
295
433
  Guide the user through setting up external integrations. Present this as a checklist — some steps can be automated, others require manual action.
@@ -493,7 +631,121 @@ npm run healthcheck
493
631
 
494
632
  Report the results and flag any services that aren't configured.
495
633
 
496
- ## Phase 5: Final Verification
634
+ ## Phase 5: Generate Agent README
635
+
636
+ Generate a comprehensive README.md for this agent's repository. This is NOT the Maestro framework README — it describes THIS specific agent.
637
+
638
+ **Template structure:**
639
+
640
+ ```markdown
641
+ # {repoName}
642
+
643
+ **{fullName} — Autonomous {title} for {company}**
644
+
645
+ Powered by [@adaptic/maestro](https://github.com/adapticai/maestro)
646
+
647
+ ---
648
+
649
+ ## Who is {firstName}?
650
+
651
+ {firstName} {lastName} is an autonomous AI agent operating as {title} at {company}.
652
+ {companyDescription}. {firstName} runs 24/7 on a dedicated Mac mini ({machineName}),
653
+ using Claude Code as the reasoning engine and orchestrating 30+ specialist sub-agents.
654
+
655
+ {firstName} reports to {principalFullName} ({principalTitle}) and operates with
656
+ {describe autonomy level based on archetype}.
657
+
658
+ ## Capabilities
659
+
660
+ {Generate 8-12 bullet points based on the archetype and responsibilities.
661
+ For executive-operator: comms management, briefs, hiring, strategic execution, etc.
662
+ For technical-leader: code review, architecture decisions, engineering health, etc.
663
+ For compliance-officer: regulatory tracking, filing management, audit readiness, etc.
664
+ Tailor to the specific responsibilities gathered in Phase 1.}
665
+
666
+ ## Architecture
667
+
668
+ Built on the Maestro 5-tier agent architecture:
669
+
670
+ - **Tier 0**: {firstName} (Executive Cortex) — core identity and reasoning
671
+ - **Tier 1**: {Generate 4-5 domain controllers relevant to the archetype}
672
+ - **Tier 2**: 31 specialist sub-agents
673
+ - **Tier 3**: Slack, Gmail, WhatsApp, Browser, Calendar
674
+ - **Tier 4**: Decision Log, Risk Register, Knowledge Base
675
+
676
+ ## Powered by Maestro
677
+
678
+ This repo is an agent instance powered by the [@adaptic/maestro](https://www.npmjs.com/package/@adaptic/maestro) framework.
679
+
680
+ Update framework: npm update @adaptic/maestro && npm run upgrade
681
+ Health check: npm run healthcheck
682
+ Emergency stop: npm run emergency-stop
683
+
684
+ ## Operating Modes
685
+
686
+ - **Reactive**: Polls Slack/Gmail/Calendar every 60s, classifies and dispatches
687
+ - **Scheduled**: {morningBrief time} brief, midday sweep, {eveningWrap time} wrap, weekly cycles
688
+ - **Proactive**: Backlog executor every 10 min, parallel agent execution
689
+
690
+ ## Commands
691
+
692
+ | Command | Purpose |
693
+ |---------|---------|
694
+ | npm run daemon | Start the main orchestrator |
695
+ | npm run healthcheck | Verify all subsystems |
696
+ | npm run emergency-stop | Halt all operations |
697
+ | npm run resume | Resume after emergency stop |
698
+ | npm run upgrade | Pull latest Maestro framework |
699
+ | claude "/init-maestro" | Reconfigure agent identity |
700
+
701
+ ## Communication Governance
702
+
703
+ {Generate based on archetype:
704
+ - executive-operator: broad autonomy with escalation for legal/financial commitments
705
+ - technical-leader: autonomous on technical decisions, escalates on budget/headcount
706
+ - compliance-officer: conservative, escalates on submissions and interpretations
707
+ - etc.}
708
+
709
+ ---
710
+
711
+ {fullName} | {title} | {company} — Powered by [Maestro](https://github.com/adapticai/maestro)
712
+ ```
713
+
714
+ Write this README.md to the repo root, populated with all the gathered values.
715
+
716
+ ## Phase 6: Create GitHub Repository
717
+
718
+ Ask the user whether they want to create a GitHub repo for this agent:
719
+
720
+ ```
721
+ Would you like me to create a GitHub repository for this agent? (yes/no)
722
+ ```
723
+
724
+ If yes:
725
+
726
+ ```
727
+ Repository setup:
728
+ 1. GitHub organization or username? (default: adapticai)
729
+ 2. Repository name? (default: {repoName}, e.g., "jacob-ai")
730
+ 3. Visibility: private (recommended) or public? (default: private)
731
+ ```
732
+
733
+ Then run:
734
+ ```bash
735
+ gh repo create {org}/{repoName} --private --description "{fullName} — Autonomous {title} for {company} (powered by Maestro)"
736
+ ```
737
+
738
+ After creating the repo, set up git and push:
739
+ ```bash
740
+ git remote add origin https://github.com/{org}/{repoName}.git
741
+ git add -A
742
+ git commit -m "Initialize {fullName} as {title} — powered by @adaptic/maestro"
743
+ git push -u origin main
744
+ ```
745
+
746
+ If the user declines, skip this step and remind them to set up a repo manually later.
747
+
748
+ ## Phase 7: Final Verification
497
749
 
498
750
  After ALL phases are complete, run these verification steps:
499
751
 
@@ -515,7 +767,15 @@ Report any stragglers and fix them.
515
767
 
516
768
  Read `config/agent.ts` and verify it has valid TypeScript syntax and all fields are populated with the new values.
517
769
 
518
- ### Step 3: Summary
770
+ ### Step 3: Run health check
771
+
772
+ ```bash
773
+ npm run healthcheck
774
+ ```
775
+
776
+ Report the results.
777
+
778
+ ### Step 4: Summary
519
779
 
520
780
  Print a completion summary:
521
781
 
@@ -530,22 +790,25 @@ Maestro initialization complete.
530
790
 
531
791
  Files modified:
532
792
  - config/agent.ts (central identity config)
533
- - CLAUDE.md (system prompt and operating instructions)
534
- - config/environment.yaml
535
- - config/contacts.yaml
536
- - config/priorities.yaml
793
+ - CLAUDE.md (operating charter)
794
+ - README.md (agent-specific documentation)
795
+ - config/environment.yaml, contacts.yaml, priorities.yaml
537
796
  - package.json
538
797
  - agents/{agent-slug}/agent.md (+ 30 other agent definitions)
539
798
  - schedules/triggers/ (13 trigger prompts)
540
- - README.md
541
799
 
542
- Next steps:
543
- 1. Review the changes: git diff
544
- 2. Run machine setup: npm run init-agent
545
- 3. Fill in API keys in .env
546
- 4. Verify daemons: launchctl list | grep adaptic
547
- 5. Run health check: npm run healthcheck
548
- 6. Commit when satisfied: git add -A && git commit -m "Initialize {fullName} as {title}"
800
+ Infrastructure:
801
+ - {N} launchd triggers installed
802
+ - Global Claude Code settings configured
803
+ - .env file created {with/without API keys}
804
+
805
+ GitHub: https://github.com/{org}/{repoName} (if created)
806
+
807
+ Verify everything:
808
+ 1. Review changes: git diff
809
+ 2. Check daemons: launchctl list | grep adaptic
810
+ 3. Health check: npm run healthcheck
811
+ 4. Start daemon: npm run daemon
549
812
  ```
550
813
 
551
814
  ## Guidelines for the Wizard Conversation
@@ -562,4 +825,4 @@ Maestro initialization complete.
562
825
 
563
826
  - If a sub-agent fails, report which one failed and what went wrong. Offer to retry just that sub-agent.
564
827
  - If the user wants to abort mid-wizard, confirm and exit cleanly.
565
- - If config/agent.ts cannot be read, warn that the repo may not be properly set up and suggest running `npm install` first.
828
+ - If config/agent.ts cannot be read, warn that the repo may not be properly set up and suggest running `npx @adaptic/maestro create` first.
package/.gitignore ADDED
@@ -0,0 +1,29 @@
1
+ # Dependencies
2
+ node_modules/
3
+
4
+ # Environment
5
+ .env
6
+ .env.local
7
+ .env.production
8
+ !.env.example
9
+
10
+ # OS
11
+ .DS_Store
12
+ Thumbs.db
13
+
14
+ # Runtime state (only exists in agent repos, not in the package)
15
+ state/
16
+ logs/
17
+ memory/
18
+ outputs/
19
+ knowledge/
20
+
21
+ # Editor
22
+ *.swp
23
+ *.swo
24
+ *~
25
+ .idea/
26
+ .vscode/
27
+
28
+ # npm
29
+ *.tgz