claude-code-templates 1.24.12 → 1.24.14

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.
@@ -232,7 +232,17 @@ Requirements:
232
232
  - Do NOT include any explanations, ONLY code blocks with filenames`
233
233
  : config.prompt;
234
234
 
235
- // Load agent content if agents were installed
235
+ // TEMPORARY SOLUTION: Load agent content manually and pass as systemPrompt
236
+ //
237
+ // NOTE: This is a workaround because the current version of @anthropic-ai/claude-agent-sdk
238
+ // does not properly support `settingSources: ['project']` for loading agents from .claude/
239
+ //
240
+ // FUTURE: Once the SDK properly supports settingSources, we should use:
241
+ // settingSources: ['project']
242
+ // instead of manually loading and passing the agent content.
243
+ //
244
+ // The SDK version ^0.1.0 is the latest available but seems to have issues with
245
+ // automatic agent loading. We need to revisit this in future SDK updates.
236
246
  let agentSystemPrompt = '';
237
247
  if (agents.length > 0) {
238
248
  const agentPath = path.join(process.cwd(), '.claude', 'agents', `${agents[0].replace(/\//g, '-')}.md`);
@@ -249,6 +259,7 @@ Requirements:
249
259
  model: 'claude-sonnet-4-5',
250
260
  apiKey: config.anthropicApiKey,
251
261
  // Use custom system prompt with agent content if available
262
+ // TODO: Replace with settingSources once SDK properly supports it
252
263
  systemPrompt: agentSystemPrompt
253
264
  ? { type: 'text', text: agentSystemPrompt }
254
265
  : { type: 'preset', preset: 'claude_code' },
@@ -259,7 +270,15 @@ Requirements:
259
270
 
260
271
  try {
261
272
  for await (const message of query({ prompt: promptContent, options })) {
262
- if (message.type === 'text') {
273
+ // The Agent SDK returns different message types:
274
+ // - 'system': Initialization info
275
+ // - 'assistant': Individual API responses
276
+ // - 'result': Final aggregated result (THIS is what we need!)
277
+ if (message.type === 'result' && message.result) {
278
+ generatedCode = message.result;
279
+ log(`Received result (${message.result.length} chars)`, 'success');
280
+ } else if (message.type === 'text' && message.text) {
281
+ // Fallback for older SDK versions
263
282
  generatedCode += message.text;
264
283
  }
265
284
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-templates",
3
- "version": "1.24.12",
3
+ "version": "1.24.14",
4
4
  "description": "CLI tool to setup Claude Code configurations with framework-specific commands, automation hooks and MCP Servers for your projects",
5
5
  "main": "src/index.js",
6
6
  "bin": {