teamcast 1.2.0 → 1.2.1

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.
@@ -52,6 +52,7 @@ const INSTRUCTION_FRAGMENTS = {
52
52
  '- SMALL (bug fix, isolated change, single module, <50 lines) -> delegate to developer only',
53
53
  '- MEDIUM (new feature, refactor touching multiple files) -> planner -> developer -> reviewer',
54
54
  '- LARGE (complex feature, cross-cutting concern, new subsystem) -> planner -> developer -> reviewer with detailed handoff context',
55
+ '- CRITICAL (security-sensitive change, breaking API, data migration, auth/permissions) -> Do NOT handle autonomously. Summarize scope and risks, then return control to the user for supervised coordination.',
55
56
  ].join('\n')),
56
57
  'feature-orchestrator-output': block('delegation', [
57
58
  'When handling directly: be concise, do not explain your triage decision.',
@@ -1,4 +1,52 @@
1
1
  import { mapPoliciesToClaudePermissions } from './policy-mapper.js';
2
+ function findDirectSpecialist(handoffs, agents) {
3
+ const writer = handoffs.find((id) => {
4
+ const agent = agents[id];
5
+ return agent?.runtime.tools?.some((t) => ['Write', 'Edit', 'MultiEdit'].includes(t));
6
+ });
7
+ return writer ?? handoffs[handoffs.length - 1];
8
+ }
9
+ function renderWorkflowSection(team, entryPoints) {
10
+ const lines = [];
11
+ // Use first entry point (typically the only orchestrator)
12
+ const [orchestratorId, orchestrator] = entryPoints[0];
13
+ const handoffs = orchestrator.metadata?.handoffs ?? [];
14
+ const specialist = findDirectSpecialist(handoffs, team.agents);
15
+ lines.push('## Workflow');
16
+ lines.push('');
17
+ lines.push('Classify every task by complexity before choosing a mode:');
18
+ lines.push('');
19
+ lines.push('| Level | Examples | Mode |');
20
+ lines.push('|-------|----------|------|');
21
+ lines.push('| META | explain code, git operations, answer question | Handle directly |');
22
+ lines.push('| MICRO | typo, rename, 1-2 line fix | Handle directly |');
23
+ lines.push(`| SMALL | bug fix, single module, <50 lines | Delegate to **${specialist}** |`);
24
+ lines.push(`| MEDIUM | new feature, refactor, 2-5 files | Delegate to **${orchestratorId}** |`);
25
+ lines.push('| LARGE | new subsystem, cross-cutting concern, 5+ files | Supervised coordination |');
26
+ lines.push('| CRITICAL | security change, breaking API, data migration | Supervised + user confirmation at each step |');
27
+ lines.push('');
28
+ // If there are additional entry points, show their chains too
29
+ if (entryPoints.length > 1) {
30
+ for (const [agentId, agent] of entryPoints) {
31
+ const agentChain = agent.metadata?.handoffs ? [agentId, ...agent.metadata.handoffs].join(' -> ') : agentId;
32
+ lines.push(`Pipeline **${agentId}**: \`${agentChain}\``);
33
+ }
34
+ lines.push('');
35
+ }
36
+ lines.push('### Supervised mode (LARGE / CRITICAL)');
37
+ lines.push('');
38
+ lines.push(`Do NOT delegate to **${orchestratorId}**. Personally coordinate the chain:`);
39
+ handoffs.forEach((agentId, index) => {
40
+ if (index < handoffs.length - 1) {
41
+ lines.push(`${index + 1}. Delegate to **${agentId}** — present result to user`);
42
+ }
43
+ else {
44
+ lines.push(`${index + 1}. Delegate to **${agentId}** — present result, decide next step`);
45
+ }
46
+ });
47
+ lines.push('');
48
+ return lines;
49
+ }
2
50
  export function renderClaudeMd(team) {
3
51
  const lines = [];
4
52
  lines.push(`# ${team.project.name}`);
@@ -21,15 +69,7 @@ export function renderClaudeMd(team) {
21
69
  return agent.runtime.tools?.includes('Agent') && (agent.metadata?.handoffs?.length ?? 0) > 0;
22
70
  });
23
71
  if (entryPoints.length > 0) {
24
- lines.push('### Preferred workflow');
25
- lines.push('');
26
- for (const [agentId, agent] of entryPoints) {
27
- const chain = agent.metadata?.handoffs ? [agentId, ...agent.metadata.handoffs].join(' -> ') : agentId;
28
- lines.push(`For complex tasks, start with **${agentId}**: \`${chain}\``);
29
- }
30
- lines.push('');
31
- lines.push('For simple single-file changes, work directly without delegation.');
32
- lines.push('');
72
+ lines.push(...renderWorkflowSection(team, entryPoints));
33
73
  }
34
74
  if (team.policies) {
35
75
  lines.push('## Security Boundaries');
@@ -25,7 +25,7 @@ export async function promptConfirm(options) {
25
25
  export async function promptList(options) {
26
26
  const answers = await inquirer.prompt([
27
27
  {
28
- type: 'list',
28
+ type: 'select',
29
29
  name: 'value',
30
30
  message: options.message,
31
31
  choices: options.choices,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teamcast",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "YAML-driven CLI to design, validate, and generate multi-target agent teams for Claude Code and Codex",
5
5
  "type": "module",
6
6
  "bin": {