agents-united 0.6.0 → 0.7.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 CHANGED
@@ -119,7 +119,7 @@ Agents United provides **24 curated bundles**, **46 specialized agents** (8 Orch
119
119
  | **🔒 Security Operations** | `security-operations` | — | `orchestrator-security` |
120
120
  | **🔬 Deep Technical Research** | `deep-research` | — | `orchestrator-research` |
121
121
  | **💼 Business Strategy & Economics** | `business-strategy` | — | `orchestrator-business` |
122
- | **🏢 Organization Bundles (Experimental)** | `digital-agency` 🚧 | *(Currently under development)* | `orchestrator-digital-agency-director` |
122
+ | **🏢 Organization Bundles (Experimental)** | `digital-agency` | *(Cross-functional composite)* | `orchestrator-marketing` (Campaign Director / Chris) |
123
123
 
124
124
  <details>
125
125
  <summary><strong>🔍 Click to expand full Department & Agent Roster Breakdown</strong></summary>
@@ -173,7 +173,7 @@ Agents United provides **24 curated bundles**, **46 specialized agents** (8 Orch
173
173
  - **Essentials Base (`business-strategy`)**: `subagent-business-panel-experts`
174
174
 
175
175
  #### 🏢 Organization Bundles (Tier 2 / Experimental)
176
- - **Digital Product Agency (`digital-agency` 🚧)**: *(Currently under development)*
176
+ - **Digital Product Agency (`digital-agency` )**: 10-agent cross-functional AstrolabsAI team (Chris / Ava / Kaan / Jamileh / Yavuz / Jale + engineering, QA & compliance) with Tri-Tier MCP execution modes and the Subagent-First Planning Dialogue Loop (ADR 0014).
177
177
 
178
178
  </details>
179
179
 
@@ -415,6 +415,19 @@ Organization bundles operate across three dynamic execution envelopes:
415
415
  > [!TIP]
416
416
  > **Zero Friction Onboarding**: You can start working with your Lead Orchestrator immediately using native tools. If your task needs live integrations (e.g. *"Set up Playwright browser testing"*), your Orchestrator will inspect your OS, configure the exact MCP server, test the connection, and activate it interactively!
417
417
 
418
+ ### Subagent-First Planning Dialogue Loop (ADR 0014)
419
+
420
+ Organization bundles can opt into a **delegation-first planning protocol**: the Lead Orchestrator plans *with the user* (Socratic grilling via `/grill-me` / `/grill-with-docs`) and *with the team* — spawning up to 2 **Planning Sidekicks** into the planning conversation, running a bounded **Specialist Council** (every relevant specialist returns a ≤150-word Scope-of-Work Statement), and presenting a **Delegation Map** before any execution starts. Inter-specialist discussion is bounded by a declarative **Consultation Budget**, and each specialist's per-invocation run is hard-capped via Cline `maxIterations`:
421
+
422
+ | Budget cap | Default | Meaning |
423
+ | :--- | :--- | :--- |
424
+ | `maxPlanningRounds` | 2 | Orchestrator ↔ council cycles per task |
425
+ | `maxPeerExchangesPerPair` | 2 | Directed questions per specialist pair |
426
+ | `summaryWordCap` | 150 | Words per Scope-of-Work Statement |
427
+ | `maxIterations` | 8 | Per-invocation iteration cap (`.cline/agents/*.yml`) |
428
+
429
+ Currently enabled for `digital-agency` (`planningLoop.enabled` in `registry/bundles.json`); rollout to the remaining bundles is tracked in [`ROADMAP.md`](ROADMAP.md). See [ADR 0014](./docs/adr/0014-subagent-first-planning-loop.md) and [Plan 012](./plans/012-subagent-first-planning-loop.md).
430
+
418
431
  ---
419
432
  ## 🌐 One Library, Every Assistant
420
433
 
@@ -541,20 +554,25 @@ When contributing new skills or adapting external skills:
541
554
  3. **Deterministic Verifications**: Include clear validation commands, error recovery procedures, and code exemplars.
542
555
 
543
556
  ### 6. Pull Request (PR) Workflow
544
- 1. **Create a Feature Branch**: Always branch from `dev`:
557
+
558
+ We use a two-line branch model — `main` is the release line, `dev` is the **protected** integration line. Full walkthrough: [`docs/workflow-guide.md`](docs/workflow-guide.md).
559
+
560
+ 1. **Branch from a fresh `dev`** (direct pushes to `dev` are rejected — changes arrive via PR only):
545
561
  ```bash
546
- git checkout dev
547
- git pull origin dev
548
- git checkout -b feat/your-feature-name
562
+ git switch dev && git pull origin dev
563
+ git switch -c feat/your-feature-name # or fix/, docs/, ci/
549
564
  ```
550
565
  2. **Follow TDD (Red-Green-Refactor)**: Author failing unit/E2E tests in `tests/` before implementing code.
551
566
  3. **Run Pre-PR Verification**:
552
567
  ```bash
568
+ npm run typecheck && npm test
553
569
  npm run build
554
- npm test
555
570
  git diff --cached # Audit staged files for accidental secrets or temp files
556
571
  ```
557
- 4. **Submit Pull Request**: Open a PR targeting the `dev` branch with a concise description of changes and test results.
572
+ 4. **Push early & open PR #1 base `dev`**: CI runs automatically (typecheck, build, full Vitest suite on `ubuntu-latest`). The PR can only merge once the required **`test`** status check passes.
573
+ 5. **Release via PR #2 → base `main`** (compare `dev`): merging triggers **semantic-release** — `feat:` bumps the minor version, `fix:` the patch — then the sync workflow auto-merges `main` back into `dev`.
574
+
575
+ > Commit messages follow **Conventional Commits**: `feat:` / `fix:` drive releases; `docs:`, `ci:`, `chore:`, `refactor:`, `test:`, `perf:` accumulate without releasing. Emergency production hotfixes branch from `main` and PR directly into it.
558
576
 
559
577
  ---
560
578
 
package/dist/cli.js CHANGED
@@ -374,7 +374,7 @@ complete the role in the main session.`;
374
374
  * canonical agent markdown content. Cline 3.x consumes YAML files with
375
375
  * frontmatter (name, description) and treats the body as the agent system prompt.
376
376
  */
377
- static renderConfiguredAgent(canonicalContent, canonicalRelPath) {
377
+ static renderConfiguredAgent(canonicalContent, canonicalRelPath, defaultMaxIterations) {
378
378
  const match = canonicalContent.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/);
379
379
  if (!match) {
380
380
  throw new Error(`Canonical agent ${canonicalRelPath} is missing YAML frontmatter.`);
@@ -393,6 +393,11 @@ complete the role in the main session.`;
393
393
  if (typeof parsed.description === "string" && parsed.description.trim().length > 0) {
394
394
  cleanFrontmatter.description = parsed.description.trim();
395
395
  }
396
+ if (typeof parsed.maxIterations === "number") {
397
+ cleanFrontmatter.maxIterations = parsed.maxIterations;
398
+ } else if (typeof defaultMaxIterations === "number") {
399
+ cleanFrontmatter.maxIterations = defaultMaxIterations;
400
+ }
396
401
  const frontmatterStr = yaml.stringify(cleanFrontmatter).trim();
397
402
  const bodyStr = match[2].trim();
398
403
  return `---
@@ -518,6 +523,12 @@ ${bodyStr}
518
523
  fallbacks: ["adaptive-session", "single-orchestrator"]
519
524
  }
520
525
  };
526
+ if (bundle.planningLoop?.enabled) {
527
+ manifest.planningLoop = bundle.planningLoop;
528
+ if (bundle.personaAliases && Object.keys(bundle.personaAliases).length > 0) {
529
+ manifest.personas = Object.entries(bundle.personaAliases).map(([persona, role]) => ({ persona, role }));
530
+ }
531
+ }
521
532
  return yaml.stringify(manifest);
522
533
  }
523
534
  /**
@@ -539,6 +550,40 @@ ${bodyStr}
539
550
  const addonSection = addons.length > 0 ? `
540
551
  ### Recommended Addon Policy
541
552
  When user tasks require capabilities from: ${addons.join(", ")}, explain the capability and request user confirmation to install via \`agents add <addon> -t cline -y\` before running the installation.` : "";
553
+ const planning = bundle.planningLoop?.enabled === true ? bundle.planningLoop : void 0;
554
+ const budget = planning?.budget;
555
+ const delegationStep = planning ? "2. **Subagent-First Delegation Policy (ADR 0014)**: execute specialist work through the configured `subagent_*` agent tools (projected under `.cline/agents/`), assigning non-overlapping scopes. Complete specialist work in the main session ONLY if the subagent tools are genuinely absent from this runtime or the task is trivial (single-file read, one-line answer, formatting) \u2014 never as a convenience or speed choice." : "2. Delegate specialist tasks using the configured `subagent_*` agent tools (projected under `.cline/agents/`) when available, assigning non-overlapping scopes; fall back to Agent Teams (`team_spawn_teammate`) or session subagents as needed.";
556
+ const planningSection = planning ? `
557
+
558
+ ## Subagent-First Planning Dialogue Loop (ADR 0014)
559
+ Run this loop BEFORE any substantive execution on a non-trivial task. Delegation-first is mandatory, not advisory.
560
+
561
+ ### Phase 0 \u2014 User Alignment
562
+ If the user's brief is ambiguous, grill it Socratically with the user first: \`/grill-me\` (strategy / non-code) or \`/grill-with-docs\` (code & docs; writes ADRs and updates CONTEXT.md).
563
+
564
+ ### Phase 0.5 \u2014 Sidekick Clarification
565
+ Spawn at most ${planning.sidekicks?.max ?? 2} relevant specialists (spawnable \`subagent_*\` tools) INTO this planning conversation to resolve remaining ambiguity. Sidekicks advise you; you relay their questions to the user.
566
+
567
+ ### Phase 1 \u2014 Specialist Council
568
+ Have every relevant specialist return a Scope-of-Work Statement (max ${budget?.summaryWordCap ?? 150} words): (1) my scope, (2) inputs I need from peers, (3) my deliverable per my own workflows, (4) at most 2 open questions.
569
+
570
+ ### Phase 2 \u2014 Delegation Map
571
+ Synthesize the council output into a task \u2192 specialist map and present it to the user BEFORE execution. Then delegate per the map.
572
+
573
+ ### Consultation Budget (hard caps)
574
+ - Planning rounds (orchestrator \u2194 council): max ${budget?.maxPlanningRounds ?? 2}
575
+ - Peer exchanges per specialist pair: max ${budget?.maxPeerExchangesPerPair ?? 2} directed questions
576
+ - Scope-of-Work statement length: max ${budget?.summaryWordCap ?? 150} words
577
+ - Specialist per-invocation iteration cap: maxIterations: ${budget?.maxIterations ?? 8} (rendered into .cline/agents/*.yml)` : "";
578
+ const personaSection = planning && bundle.personaAliases && Object.keys(bundle.personaAliases).length > 0 ? `
579
+
580
+ ### Persona \u2192 Spawnable Tool Map
581
+ | Persona | Role / Spawnable tool |
582
+ |---|---|
583
+ ${Object.entries(bundle.personaAliases).map(([persona, role]) => {
584
+ const target = role.startsWith("subagent-") ? `${role} \u2192 \`subagent_${this.stripSubagentPrefix(role).replace(/-/g, "_")}\`` : `${role} (you, the coordinator)`;
585
+ return `| ${persona} | ${target} |`;
586
+ }).join("\n")}` : "";
542
587
  return `# Agents United \u2014 ${bundle.name} Coordinator Rule
543
588
  ${marker}
544
589
 
@@ -548,9 +593,10 @@ ${marker}
548
593
 
549
594
  ## Activation Protocol
550
595
  1. At session start, read the Team Manifest (\`${manifestRelPath}\`) and coordinator role prompt (\`.agents/${coordinatorCanonical}\`).
551
- 2. Delegate specialist tasks using the configured \`subagent_*\` agent tools (projected under \`.cline/agents/\`) when available, assigning non-overlapping scopes; fall back to Agent Teams (\`team_spawn_teammate\`) or session subagents as needed.
596
+ ${delegationStep}
552
597
  3. For lightweight read-only research, use session subagents.
553
598
  4. Only specialist roles declared in the Team Manifest are active in this workspace.
599
+ ${planningSection}${personaSection}
554
600
  ${specialistLines.length > 0 ? `
555
601
  ### Installed Specialist Roles
556
602
  ${specialistLines.join("\n")}` : ""}
@@ -582,7 +628,11 @@ ${addonSection}
582
628
  const srcPath = path4.join(registryDir, "agents", agentFile);
583
629
  if (await fs2.pathExists(srcPath)) {
584
630
  const content = await fs2.readFile(srcPath, "utf8");
585
- const rendered = this.renderConfiguredAgent(content, canonicalRel);
631
+ const rendered = this.renderConfiguredAgent(
632
+ content,
633
+ canonicalRel,
634
+ bundle.planningLoop?.enabled === true ? bundle.planningLoop.budget?.maxIterations : void 0
635
+ );
586
636
  const roleName = this.stripSubagentPrefix(agentFile.replace(/\.md$/i, ""));
587
637
  artifacts.push({
588
638
  kind: "role",