From e4a9df0c91f734a51ae96cdbe916d2c9983ce0a8 Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Tue, 3 Mar 2026 09:57:48 -0700 Subject: [PATCH] fix: simplify intent-library install to print directly to stdout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The install command is run by coding agents, not humans — the output goes straight into the agent's context. Remove clipboard copy logic and status messages so the prompt is the only output. Update help text to clarify the command's purpose. Co-Authored-By: Claude Opus 4.6 --- packages/intent/src/intent-library.ts | 38 ++------------------------- 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/packages/intent/src/intent-library.ts b/packages/intent/src/intent-library.ts index f0e2984d..4fd48292 100644 --- a/packages/intent/src/intent-library.ts +++ b/packages/intent/src/intent-library.ts @@ -1,7 +1,5 @@ #!/usr/bin/env node -import { spawnSync } from 'node:child_process' -import { release } from 'node:os' import type { LibraryScanResult } from './library-scanner.js' import { scanLibrary } from './library-scanner.js' @@ -49,30 +47,6 @@ async function cmdList(): Promise { } function cmdInstall(): void { - function tryCopyToClipboard(text: string): boolean { - const platform = process.platform - const isWsl = - platform === 'linux' && - (Boolean(process.env.WSL_DISTRO_NAME) || - Boolean(process.env.WSL_INTEROP) || - release().toLowerCase().includes('microsoft')) - - const tryCommand = (command: string, args: string[] = []) => { - const result = spawnSync(command, args, { input: text }) - return result.status === 0 - } - - if (platform === 'darwin') return tryCommand('pbcopy') - if (platform === 'win32') return tryCommand('clip') - if (isWsl) return tryCommand('clip.exe') - - return ( - tryCommand('wl-copy') || - tryCommand('xclip', ['-selection', 'clipboard']) || - tryCommand('xsel', ['--clipboard', '--input']) - ) - } - const prompt = `You are an AI assistant helping a developer set up skill-to-task mappings for their project. Follow these steps in order: @@ -120,16 +94,7 @@ skills: - Keep entries concise — this block is read on every agent task - Preserve all content outside the block tags unchanged` - console.log('šŸš€ Intent Install') - console.log('✨ Copy the prompt below into your AI agent:\n') console.log(prompt) - - const copied = tryCopyToClipboard(prompt) - if (copied) { - console.log('\nāœ… Copied prompt to clipboard') - } else { - console.log('\n⚠ Tip: Manually copy the prompt above into your agent') - } } // --------------------------------------------------------------------------- @@ -140,7 +105,8 @@ const USAGE = `TanStack Intent Usage: intent list List all available skills from this library and its dependencies - intent install Set up skill-to-task mappings in your agent config` + intent install Print a skill that guides your coding agent to scan the project + and set up skill-to-task mappings in your agent config` const command = process.argv[2]