Skip to content

Include generated docs in local circuit prompt - #88

Open
tracepatch-lab wants to merge 1 commit into
tscircuit:mainfrom
tracepatch-lab:generated-ai-docs-prompt
Open

Include generated docs in local circuit prompt#88
tracepatch-lab wants to merge 1 commit into
tscircuit:mainfrom
tracepatch-lab:generated-ai-docs-prompt

Conversation

@tracepatch-lab

@tracepatch-lab tracepatch-lab commented Jun 4, 2026

Copy link
Copy Markdown

Summary

  • load https://docs.tscircuit.com/ai.txt as optional generated-doc context for createLocalCircuitPrompt
  • fetch generated docs in parallel with the existing component props docs
  • cache generated docs during the process and keep prompt generation resilient if the endpoint fails
  • omit the generated-docs section when the optional endpoint is unavailable, instead of leaving an empty prompt section
  • add deterministic mocked-fetch tests for inclusion and fallback behavior

Fixes #45

Verification

bun test tests/create-local-circuit-prompt.test.ts
2 pass
0 fail
5 expect() calls

biome check lib/prompt-templates/create-local-circuit-prompt.ts tests/create-local-circuit-prompt.test.ts
Checked 2 files. No fixes applied.

node node_modules/typescript/bin/tsc --noEmit --pretty false

node node_modules/tsup/dist/cli-node.js lib/index.ts --format esm --dts
Build success

/claim #45

@tracepatch-lab
tracepatch-lab force-pushed the generated-ai-docs-prompt branch from 2544693 to 7417e96 Compare June 4, 2026 16:40
@tracepatch-lab

Copy link
Copy Markdown
Author

/claim #45

@tracepatch-lab

Copy link
Copy Markdown
Author

Ready for review. This PR links Fixes #45, includes /claim #45, and has local verification for the focused test, Biome, TypeScript, and build in the PR body.

Happy to adjust if you want the generated-docs section placed elsewhere in the prompt.

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.

use the new auto generated docs in the system prompt

1 participant