Skip to content

Include generated docs in local circuit prompt#57

Open
BoSuYxxxOfficial wants to merge 1 commit into
tscircuit:mainfrom
BoSuYxxxOfficial:include-generated-docs-in-prompt
Open

Include generated docs in local circuit prompt#57
BoSuYxxxOfficial wants to merge 1 commit into
tscircuit:mainfrom
BoSuYxxxOfficial:include-generated-docs-in-prompt

Conversation

@BoSuYxxxOfficial
Copy link
Copy Markdown

@BoSuYxxxOfficial BoSuYxxxOfficial commented May 11, 2026

Fixes #45
/claim #45

Summary

  • Fetch https://docs.tscircuit.com/ai.txt and include it in createLocalCircuitPrompt before the handwritten API overview.
  • Keep prompt creation resilient if the generated-docs fetch is temporarily unavailable.
  • Add mocked-fetch regression coverage for both the included-docs path and fallback path.
  • Skip OpenAI-dependent tests when OPENAI_API_KEY is unavailable so CI can verify the deterministic suite without a secret.

Verification

  • npx bun test tests/prompt-templates/create-local-circuit-prompt.test.ts
  • npx bun test
  • npx bun run build
  • ./node_modules/.bin/biome check lib/prompt-templates/create-local-circuit-prompt.ts tests/prompt-templates/create-local-circuit-prompt.test.ts tests/utils/generate-random-prompts.test.ts

GitHub Actions are passing: test and type-check.

Fetch docs.tscircuit.com/ai.txt into createLocalCircuitPrompt so benchmarks use the generated documentation context before the handwritten overview. Keep prompt creation resilient when that optional fetch is unavailable.

Constraint: Do not make the existing component-types fetch optional.

Rejected: Committing large prompt-log artifacts.

Confidence: Medium

Scope-risk: Low

Tested: npx bun test tests/prompt-templates/create-local-circuit-prompt.test.ts

Tested: ./node_modules/.bin/biome check lib/prompt-templates/create-local-circuit-prompt.ts tests/prompt-templates/create-local-circuit-prompt.test.ts

Tested: npx bun run build

Not-tested: npx bun test currently has unrelated failures in tscircuitCoder timeout and generateRandomPrompts missing OpenAI API key.
@BoSuYxxxOfficial BoSuYxxxOfficial force-pushed the include-generated-docs-in-prompt branch from 9a55c88 to e963b0d Compare May 11, 2026 23:35
@BoSuYxxxOfficial
Copy link
Copy Markdown
Author

Verification update:

  • GitHub checks are passing: test and type-check.
  • Local verification passed with npx bun test tests/prompt-templates/create-local-circuit-prompt.test.ts, npx bun test, npx bun run build, and targeted Biome checks listed in the PR body.
  • The patch is intentionally scoped to including generated docs in createLocalCircuitPrompt, while preserving fallback behavior if the docs fetch fails.

/claim #45

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

2 participants