Kailash Code Templates
Production-ready templates for common Kailash development tasks. All follow the canonical 4-parameter pattern from /01-core-sdk.
Sub-File Index
Workflow Templates
- template-workflow-basic - Standard workflow
- WorkflowBuilder setup, node addition, 4-param connections, runtime execution, result access, error handling
- template-cyclic-workflow - Iterative workflows
- CycleNode setup, convergence checking, state persistence, iteration limits
Custom Development
- template-custom-node - Custom node creation
- Extend BaseNode, parameter definition, execute method, input validation, output formatting, registration
- template-mcp-server - MCP server creation
- MCPServer init, tool/resource registration, transport config, auth, progress reporting
Test Templates
- template-test-unit - Tier 1: Unit tests
- Fixtures, mock setup (allowed in Tier 1), assertions, fast execution
- template-test-integration - Tier 2: Integration tests
- Real database setup, workflow execution, real infrastructure fixtures, resource cleanup
- template-test-e2e - Tier 3: End-to-end tests
- Full system setup, real HTTP requests, complete user flows
Template Selection
| Task | Template | Key Pattern |
|---|---|---|
| New workflow | template-workflow-basic |
WorkflowBuilder + .build() + runtime.execute() |
| Iterative logic | template-cyclic-workflow |
CycleNode + convergence check |
| New node type | template-custom-node |
Extend BaseNode, implement execute() |
| MCP integration | template-mcp-server |
MCPServer + tool registration |
| Fast tests | template-test-unit |
Mocking allowed, <1s |
| Real infra tests | template-test-integration |
Real DB/runtime, no mocks |
| Full system tests | template-test-e2e |
Real HTTP, complete flows |
Usage
- Select the template matching your task
- Read the sub-file for the complete, copy-ready template
- Customize to your specific needs
- Test with real data
Template Rules
- Keep core structure intact when customizing
- Never skip error handling or input validation
- Never remove resource cleanup
- Maintain type hints and docstrings
- Follow naming conventions from gold standards
Related Skills
- 01-core-sdk - Core patterns
- 06-cheatsheets - Pattern examples
- 07-development-guides - Development guides
- 12-testing-strategies - Testing strategies
- 17-gold-standards - Best practices
Support
pattern-expert- Pattern selectiontdd-implementer- Test-first development
Converted and distributed by TomeVault — claim your Tome and manage your conversions.