Skip to content

AI Integration (Cursor, Cline, ChatGPT & Claude)

We use AI daily to write code, and we know many of you do too. However, because Large Language Models are heavily trained on traditional Python concurrency patterns (like asyncio, await, and time.sleep()), they need a little context to understand TaskTonic's unique "Sparkling" event-driven model.

To make this as seamless as possible, we provide a live, pre-compiled AI SDK. Feeding this context to your AI ensures it writes perfect, non-blocking TaskTonic code right out of the gate.


1. Using AI IDEs (Cursor, Roo-Code, Continue)

To ensure your AI assistant follows TaskTonic's strict formatting and architectural rules automatically within your editor, create a .clinerules (for Cline/Roo-Code) or .cursorrules (for Cursor) file in the root of your new project. If you use Continue.dev, add this to your config.json system prompt.

Copy and paste the following snippet:

# Project Rules
You are building an application using the TaskTonic concurrency framework.

## Framework Knowledge Base
Whenever you need to understand TaskTonic routing, Sparkles, or need implementation examples, 
you MUST fetch and read the raw markdown context from the official TaskTonic AI SDK:
* Core Rules: [https://tasktonic.dev/ai_sdk/rules.md](https://tasktonic.dev/ai_sdk/rules.md)
* API & Architecture: [https://tasktonic.dev/ai_sdk/api.md](https://tasktonic.dev/ai_sdk/api.md)
* Code Examples: [https://tasktonic.dev/ai_sdk/examples.md](https://tasktonic.dev/ai_sdk/examples.md)
* Practical Tests: [https://tasktonic.dev/ai_sdk/tests.md](https://tasktonic.dev/ai_sdk/tests.md)

## Core Directives
* All generated code, variables, and comments MUST be in English.
* Never place execution statements on the same line after an 'if' colon.
* Maximum line length is strictly 120 characters.

2. Using Web-Based AI (ChatGPT, Claude, Gemini)

If you use a web-based AI, you must explicitly provide the framework rules to prevent it from reverting to standard Python concurrency patterns.

Claude (Anthropic)

Claude excels at coding when using the Projects feature. 1. Create a new Project in Claude. 2. In the "Custom Instructions" for the project, paste the text snippet from the IDE section above. 3. Download the four .md files from https://tasktonic.dev/ai_sdk/ and upload them to the Project Knowledge base. Claude will now natively understand TaskTonic.

ChatGPT (OpenAI)

ChatGPT can browse the web to fetch documentation dynamically. 1. Create a Custom GPT or use the Custom Instructions setting. 2. Paste the text snippet from the IDE section above. 3. When asking complex questions, explicitly tell ChatGPT: "Please read the TaskTonic examples from the URLs in my instructions before generating the code."

Gemini (Google)

  1. Create a Gem (if you have Advanced) or start a new chat.
  2. Provide the URLs to the SDK and ask Gemini to analyze them first, or copy-paste the contents of rules.md and api.md as your first prompt to establish the base knowledge.

What is in the AI SDK?

The https://tasktonic.dev/ai_sdk/ directory contains raw, unstyled Markdown files. They are not meant for human reading, but are highly optimized (low token count) for Large Language Models.

  • rules.md: The absolute "Constitution" of TaskTonic. It explicitly forbids the AI from using time.sleep(), asyncio, or thread locks, and forces it to use the FIFO Catalyst queue and ttTimer components.
  • api.md: A bundled version of the core component documentation (ttTonic, ttStore, ttCatalyst).
  • examples.md: Real-world examples (like HTTP servers, PySide UIs, and UDP connections) so the AI can mimic the exact syntax.
  • tests.md: The framework's test suite, which provides the AI with flawless, working edge-cases and Distiller contract configurations.