feat(new-setup-2): phase-2 setup skill + --no-cli-bonus flag

New /new-setup-2 skill, invoked when the user picks "continue setup"
at the end of /new-setup. Linear rollthrough; every step skippable:

  1. What should the agent call you?
  2. What's your agent's name?
  3. Messaging channel (plain list, no AskUserQuestion) — invokes the
     matching /add-<channel> skill, captures platform IDs from its
     output, then wires via init-first-agent.ts with --no-cli-bonus.
     On success, emits the encouragement line verbatim.
  4. Quality-of-life picks (dashboard, compact, karpathy-wiki, plus
     macos-statusbar only when the probe reports PLATFORM=darwin).
  5. Wrap-up.

scripts/init-first-agent.ts gains a --no-cli-bonus flag. In DM mode,
the bonus "wire new agent to CLI" call is skipped when set. Used by
/new-setup-2 so the throwaway CLI-only agent from /new-setup retains
clean single-agent ownership of CLI routing instead of being duelled
by the real agent on the same channel.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Koshkoshinski
2026-04-20 10:43:14 +00:00
parent 2eb6907f09
commit 4e1cee0e5b
2 changed files with 125 additions and 3 deletions
+13 -3
View File
@@ -59,6 +59,7 @@ import type { AgentGroup, MessagingGroup } from '../src/types.js';
interface Args {
cliOnly: boolean;
noCliBonus: boolean;
channel: string;
userId: string;
platformId: string;
@@ -75,7 +76,7 @@ const CLI_PLATFORM_ID = 'local';
const CLI_SYNTHETIC_USER_ID = `${CLI_CHANNEL}:${CLI_PLATFORM_ID}`;
function parseArgs(argv: string[]): Args {
const out: Partial<Args> = { cliOnly: false };
const out: Partial<Args> = { cliOnly: false, noCliBonus: false };
for (let i = 0; i < argv.length; i++) {
const key = argv[i];
const val = argv[i + 1];
@@ -83,6 +84,9 @@ function parseArgs(argv: string[]): Args {
case '--cli-only':
out.cliOnly = true;
break;
case '--no-cli-bonus':
out.noCliBonus = true;
break;
case '--channel':
out.channel = (val ?? '').toLowerCase();
i++;
@@ -120,6 +124,7 @@ function parseArgs(argv: string[]): Args {
// CLI-only: channel/user/platform default to the synthetic local CLI identity.
return {
cliOnly: true,
noCliBonus: out.noCliBonus ?? false,
channel: CLI_CHANNEL,
userId: CLI_SYNTHETIC_USER_ID,
platformId: CLI_PLATFORM_ID,
@@ -139,6 +144,7 @@ function parseArgs(argv: string[]): Args {
return {
cliOnly: false,
noCliBonus: out.noCliBonus ?? false,
channel: out.channel!,
userId: out.userId!,
platformId: out.platformId!,
@@ -292,7 +298,9 @@ async function main(): Promise<void> {
wireIfMissing(primaryMg, ag, now, args.cliOnly ? 'cli' : 'dm');
// In DM mode also wire CLI so `pnpm run chat` works immediately.
if (!args.cliOnly) {
// Skip the bonus when --no-cli-bonus is set — used by /new-setup-2 so the
// throwaway CLI-only agent from /new-setup still owns CLI routing cleanly.
if (!args.cliOnly && !args.noCliBonus) {
wireIfMissing(cliMg, ag, now, 'cli-bonus');
}
@@ -322,7 +330,9 @@ async function main(): Promise<void> {
console.log(` channel: cli/${CLI_PLATFORM_ID}`);
} else {
console.log(` channel: ${args.channel} ${primaryMg.platform_id}`);
console.log(` cli: cli/${CLI_PLATFORM_ID} wired — try \`pnpm run chat hi\``);
if (!args.noCliBonus) {
console.log(` cli: cli/${CLI_PLATFORM_ID} wired — try \`pnpm run chat hi\``);
}
}
console.log(` session: ${session.id}`);
console.log('');