AI Prompt Context Files
Modern AI assistants like Claude, Gemini, Grok, or ChatGPT are remarkably capable at writing code. However, they can struggle with specialized libraries and APIs they weren't extensively trained on. That's where AI Prompt Contexts come in - specially crafted documentation files that give your AI assistant deep knowledge of the Bitbybit API.
Download Context Files
Choose the context file that matches your 3D rendering engine. Right-click and "Save As" to download, or open and copy the content.
- Monaco Editor
- BabylonJS
- ThreeJS
- PlayCanvas
Monaco Editor Context (Beginner-Friendly)
For users of our online TypeScript editor at bitbybit.dev/app
Markdown Context (Dictionary Translation)
TypeScript Declarations (No Translation)
BabylonJS Context Files
Full-featured 3D engine with powerful rendering capabilities
ThreeJS Context Files
Popular, lightweight 3D library for web applications
PlayCanvas Context Files
Game engine with visual editor and runtime
- Full Context - Best for beginners. Includes explanations, setup guides, and complete API reference with dictionary-compressed notation.
- Lite Context - Best for experienced developers. Minimal size, just API definitions with dictionary-compressed notation.
What Are AI Prompt Contexts?
An AI Prompt Context is a markdown file designed to be attached to conversations with AI coding assistants. When you provide this context file, the AI gains comprehensive knowledge about:
- Bitbybit's complete API with all available functions and their parameters
- Coding patterns and best practices for 3D/CAD development
- Integration approaches for different rendering engines
- Code examples demonstrating correct usage patterns
- Decision trees that help the AI recommend the right approach based on your experience level
Think of it as giving your AI assistant a complete reference manual it can consult while helping you write code.
How to Use Context Files
Step 1: Download or Copy
Click the download button above for your engine, then either:
- Right-click → Save As to download the file
- Or open the file and copy its entire content
Step 2: Attach to Your AI Conversation
Most modern AI interfaces support file attachments:
- Drag and drop the file into the chat
- Use the attachment button
- Or paste the content directly
Step 3: Start Coding with AI
Once attached, ask questions like:
- "Create a parametric table with adjustable legs"
- "Show me how to create a filleted box and export it as STEP"
- "Build a gear with 24 teeth and a 5mm module"
The AI will reference the context to generate accurate, working code that follows Bitbybit's recommended patterns.
Understanding the Dictionary Translation Format
Both Full and Lite context files use an important technique to reduce file size: a translation dictionary. This compression allows us to include the complete API reference while keeping token counts manageable.
At the beginning of the API section, you'll find a dictionary that maps abbreviated terms to their full names:
| Abbreviation | Full Name |
|---|---|
OC | OCCT |
sp | shape |
sd | solid |
cr | create |
Critical: AI Must Translate Abbreviations
The AI must translate these abbreviations back to full names when generating code. When the AI sees something like:
bitbybit.oc.sh.sd.crBox(op: BoxD)
It should generate:
bitbybit.occt.shapes.solid.createBox(boxOptions: BoxDto)
The abbreviated forms are only for documentation - they would not compile if used directly in code. The AI handles this translation transparently, so you receive clean, readable code.
If your AI agent cannot translate these abbreviated values, the code will not work. If that happens, consider using the TypeScript Declaration Files (.d.ts) instead, which use full, unabbreviated names and require no translation.
TypeScript Declaration Files (.d.ts)
For AI agents that have difficulty with dictionary translations, we provide TypeScript Declaration Files (.d.ts). These are standard TypeScript type definition files that describe the complete Bitbybit API schema.
Why Use .d.ts Files?
TypeScript declaration files are the native way TypeScript describes API shapes. They contain:
- Complete type definitions for all classes, interfaces, and functions
- JSDoc comments explaining each method and parameter (in the "with comments" version)
- Proper TypeScript syntax that any AI model can understand without translation
The key advantage is that no dictionary translation is required. While our markdown context files use abbreviated notation (like OC for OCCT) to save tokens, .d.ts files use full, unabbreviated names. This means even lower-end AI models can generate correct code without needing to apply translation rules.
Trade-offs
| Format | Tokens | Translation Required | Best For |
|---|---|---|---|
| Lite Context (.md) | ~87-128k | Yes | Capable AI models, token-conscious usage |
| Full Context (.md) | ~87-126k | Yes | Beginners, comprehensive guidance |
| .d.ts (no comments) | ~151-210k | No | Lower-end AI models, direct API reference |
| .d.ts (with comments) | ~460-612k | No | Maximum detail, documentation included |
Download Declaration Files
- BabylonJS
- ThreeJS
- PlayCanvas
BabylonJS Declaration Files
TypeScript definitions with full, unabbreviated names
ThreeJS Declaration Files
TypeScript definitions with full, unabbreviated names
PlayCanvas Declaration Files
TypeScript definitions with full, unabbreviated names
Use .d.ts files when:
- Your AI model produces incorrect code with abbreviated notation
- You're using a smaller or less capable AI model
- You want the AI to see the exact TypeScript types without any transformation
- You have a large context window available and token cost is not a concern
- Your AI agent supports lookahead and can selectively read only the relevant portions of the file
Combining with Context7 MCP
For the best experience, we recommend combining a Lite context with our Context7 MCP Server:
- Context7 MCP provides live access to full documentation and stays current with the latest changes
- Lite context ensures the AI knows precise API signatures
Together, they create a powerful coding assistant that understands both the big picture and the fine details.
Tips for Effective AI-Assisted Coding
Be Specific About Your Goals
Instead of asking for "a shape," describe what you actually need:
"Create a rounded rectangular table top with four cylindrical legs, where the leg height and table dimensions are parametric."
Mention Your Experience Level
The contexts include decision trees that help the AI adapt:
- Beginners: The AI can scaffold complete applications
- Experienced developers: The AI can focus on just the API calls you need
Iterate and Refine
AI assistants are collaborative tools. If the first attempt isn't quite right:
- Explain what you'd like changed
- Ask for specific modifications
- The AI can refine suggestions while staying consistent with the Bitbybit API
Staying Up to Date
The context files are updated with each Bitbybit release to match the latest API. When you see a new version available, download the updated context to ensure your AI has the most current information.
Check the version number in your context file and compare it with the latest version on bitbybit.dev GitHub to ensure you're using the most recent documentation.