@hatchway/cli 0.50.60 → 0.50.62

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/dist/index.js CHANGED
@@ -174,10 +174,14 @@ function getPlatformPluginDir() {
174
174
  _pluginDir = findPluginDir();
175
175
  if (_pluginDir) {
176
176
  const names = listBundledSkills();
177
- process.stderr.write(`[skills] Platform plugin: ${_pluginDir} (${names.length} skills: [${names.join(', ')}])\n`);
177
+ if (process.env.SILENT_MODE !== '1') {
178
+ process.stderr.write(`[skills] Platform plugin: ${_pluginDir} (${names.length} skills: [${names.join(', ')}])\n`);
179
+ }
178
180
  }
179
181
  else {
180
- process.stderr.write('[skills] Platform plugin directory not found\n');
182
+ if (process.env.SILENT_MODE !== '1') {
183
+ process.stderr.write('[skills] Platform plugin directory not found\n');
184
+ }
181
185
  Sentry.logger.error('Platform plugin directory not found — agent will run without core skills', {
182
186
  candidatePaths: [
183
187
  join(__dirname$3, 'skills', 'platform-plugin'),
@@ -1457,6 +1461,24 @@ var init_droid_strategy$1 = __esm$1({
1457
1461
  // src/lib/prompts.ts
1458
1462
  var CLAUDE_SYSTEM_PROMPT = `You are an elite coding assistant specialized in building visually stunning, production-ready JavaScript applications.
1459
1463
 
1464
+ ## Platform Skills
1465
+
1466
+ You have access to platform skills that provide critical procedural knowledge. Load and follow these skills for EVERY task:
1467
+
1468
+ **Always load (required for every build):**
1469
+ - \`todo-workflow\` \u2014 You MUST use TodoWrite to track progress. Without it, users see no progress in the UI.
1470
+ - \`communication-style\` \u2014 Follow the Hatchway output formatting conventions.
1471
+ - \`build-verification\` \u2014 Use the fix-verify loop for all dependency and build errors.
1472
+ - \`context-awareness\` \u2014 Read existing code before modifying. Never write blind.
1473
+ - \`dependency-management\` \u2014 Install all dependencies upfront in a single operation.
1474
+
1475
+ **Load when relevant:**
1476
+ - \`architectural-thinking\` \u2014 Load when starting a new feature or multi-file change.
1477
+ - \`design-excellence\` \u2014 Load when building or styling user-facing UI.
1478
+ - \`template-originality\` \u2014 Load only when building a new project from a template scaffold.
1479
+
1480
+ Load each skill by reading its SKILL.md file, then follow its instructions throughout the task.
1481
+
1460
1482
  ## Plan Mode
1461
1483
 
1462
1484
  If you use ExitPlanMode to submit a plan, the system will automatically approve it.
@@ -4384,16 +4406,19 @@ function createNativeClaudeQuery(modelId = DEFAULT_CLAUDE_MODEL_ID, abortControl
4384
4406
  // See: https://github.com/anthropics/claude-code/issues/2970
4385
4407
  // See: https://github.com/anthropics/claude-agent-sdk-typescript/issues/46
4386
4408
  abortController,
4387
- // Capture SDK internal stderr to debug skill discovery
4409
+ // Capture SDK internal stderr to debug skill discovery (suppressed in TUI mode)
4388
4410
  stderr: (data) => {
4389
- // Log all skill-related and add-dir related output
4390
- if (data.toLowerCase().includes('skill') || data.includes('add-dir') || data.includes('additional')) {
4391
- process.stderr.write(`[native-sdk:stderr] ${data}\n`);
4411
+ if (process.env.SILENT_MODE !== '1') {
4412
+ if (data.toLowerCase().includes('skill') || data.includes('add-dir') || data.includes('additional')) {
4413
+ process.stderr.write(`[native-sdk:stderr] ${data}\n`);
4414
+ }
4392
4415
  }
4393
4416
  },
4394
4417
  };
4395
4418
  debugLog$4();
4396
- process.stderr.write(`[native-sdk] plugins: ${JSON.stringify(platformPlugins.map(p => p.path))}\n`);
4419
+ if (process.env.SILENT_MODE !== '1') {
4420
+ process.stderr.write(`[native-sdk] plugins: ${JSON.stringify(platformPlugins.map(p => p.path))}\n`);
4421
+ }
4397
4422
  let messageCount = 0;
4398
4423
  let toolCallCount = 0;
4399
4424
  let textBlockCount = 0;
@@ -4425,9 +4450,11 @@ function createNativeClaudeQuery(modelId = DEFAULT_CLAUDE_MODEL_ID, abortControl
4425
4450
  const discoveredSkills = initMsg.skills ?? [];
4426
4451
  const loadedPlugins = initMsg.plugins ?? [];
4427
4452
  const toolCount = (initMsg.tools ?? []).length;
4428
- process.stderr.write(`[native-sdk] SDK init — skills: [${discoveredSkills.join(', ')}] (${discoveredSkills.length})\n`);
4429
- process.stderr.write(`[native-sdk] SDK init — plugins: ${JSON.stringify(loadedPlugins)}\n`);
4430
- process.stderr.write(`[native-sdk] SDK init — tools: ${toolCount} loaded\n`);
4453
+ if (process.env.SILENT_MODE !== '1') {
4454
+ process.stderr.write(`[native-sdk] SDK init — skills: [${discoveredSkills.join(', ')}] (${discoveredSkills.length})\n`);
4455
+ process.stderr.write(`[native-sdk] SDK init — plugins: ${JSON.stringify(loadedPlugins)}\n`);
4456
+ process.stderr.write(`[native-sdk] SDK init — tools: ${toolCount} loaded\n`);
4457
+ }
4431
4458
  if (discoveredSkills.length > 0) {
4432
4459
  Sentry.logger.info('SDK initialized with skills', {
4433
4460
  skillCount: String(discoveredSkills.length),
@@ -4453,7 +4480,9 @@ function createNativeClaudeQuery(modelId = DEFAULT_CLAUDE_MODEL_ID, abortControl
4453
4480
  // Capture tool_use_summary messages — these indicate skill content loading
4454
4481
  if (sdkMessage.type === 'tool_use_summary') {
4455
4482
  const summaryMsg = sdkMessage;
4456
- process.stderr.write(`[native-sdk] Tool use summary: ${summaryMsg.summary}\n`);
4483
+ if (process.env.SILENT_MODE !== '1') {
4484
+ process.stderr.write(`[native-sdk] Tool use summary: ${summaryMsg.summary}\n`);
4485
+ }
4457
4486
  }
4458
4487
  // Log result messages
4459
4488
  if (sdkMessage.type === 'result') {
@@ -9330,7 +9359,9 @@ function loadSkill(name) {
9330
9359
  // Try next candidate
9331
9360
  }
9332
9361
  }
9333
- process.stderr.write(`[skills] Could not load skill "${name}" from any path. Searched: ${candidates.join(', ')}\n`);
9362
+ if (process.env.SILENT_MODE !== '1') {
9363
+ process.stderr.write(`[skills] Could not load skill "${name}" from any path. Searched: ${candidates.join(', ')}\n`);
9364
+ }
9334
9365
  return `[Skill "${name}" not found]`;
9335
9366
  }
9336
9367
  function composeSkills(context) {
@@ -9363,7 +9394,9 @@ function composeSkills(context) {
9363
9394
  // Always: build verification
9364
9395
  add('build-verification');
9365
9396
  const totalChars = sections.reduce((sum, s) => sum + s.length, 0);
9366
- process.stderr.write(`[skills] Composed ${loaded.length} skills (${totalChars} chars) for agent=${context.agentId} isNew=${context.isNewProject} hasDesign=${context.hasDesignTags}: [${loaded.join(', ')}]\n`);
9397
+ if (process.env.SILENT_MODE !== '1') {
9398
+ process.stderr.write(`[skills] Composed ${loaded.length} skills (${totalChars} chars) for agent=${context.agentId} isNew=${context.isNewProject} hasDesign=${context.hasDesignTags}: [${loaded.join(', ')}]\n`);
9399
+ }
9367
9400
  return sections;
9368
9401
  }
9369
9402