Skip to content

feat: include auto-generated docs from docs.tscircuit.com/ai.txt in system prompt#69

Open
colorbank wants to merge 5 commits into
tscircuit:mainfrom
colorbank:feat/auto-generated-docs-system-prompt
Open

feat: include auto-generated docs from docs.tscircuit.com/ai.txt in system prompt#69
colorbank wants to merge 5 commits into
tscircuit:mainfrom
colorbank:feat/auto-generated-docs-system-prompt

Conversation

@colorbank
Copy link
Copy Markdown

/claim #45

Summary

Fetches auto-generated documentation from https://docs.tscircuit.com/ai.txt and prepends it to the system prompt, giving the AI model up-to-date tscircuit API context.

Changes

  • Added fetchOptionalFileContent helper that gracefully returns "" on any error (404 or network failure)
  • Modified createLocalCircuitPrompt to fetch ai.txt in parallel with the existing COMPONENT_TYPES.md fetch using Promise.all
  • Prepends the generated docs section before ## tscircuit API overview when available; falls back gracefully when unavailable

Tests

Added tests/prompt-templates/create-local-circuit-prompt.test.ts covering:

  1. ✅ Generated docs are included when ai.txt is available
  2. ✅ Prompt works normally when ai.txt returns 404
  3. ✅ Prompt works normally when ai.txt fetch throws
  4. ✅ Generated docs appear before the ## tscircuit API overview section

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant