code-templates

Generates boilerplate code for Kailash SDK workflows, custom nodes, MCP servers, and three-tier tests.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/Dchuuuuuu/disease-risk-classifier --skill code-templates-dchuuuuuu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: code-templates
Source: https://github.com/Dchuuuuuu/disease-risk-classifier/tree/main/.claude/skills/14-code-templates
Command: npx skills add https://github.com/Dchuuuuuu/disease-risk-classifier --skill code-templates-dchuuuuuu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Starting a new Kailash SDK workflow, custom node, MCP server, or test suite from scratch requires remembering the canonical 4-parameter pattern, cycle setup rules, and tier-specific testing policies, which slows development and introduces structural errors. ## Core Features & Use Cases - Workflow Templates: Provides basic, cyclic, CLI, FastAPI async, and ETL workflow scaffolds using WorkflowBuilder and LocalRuntime. - Custom Node & MCP Server Templates: Supplies node class structures with parameter declaration and Pydantic validation, plus MCP server setups with authentication, caching, and permissions. - Three-Tier Test Templates: Includes unit (Tier 1, mocks allowed), integration (Tier 2, real Docker services), and end-to-end (Tier 3, full scenarios) pytest templates. - Use Case: When asked to scaffold a new iterative workflow, the Skill provides the cyclic template showing the critical build-before-cycle pattern with convergence criteria and max iteration limits. ## Quick Start Ask the AI to generate a basic Kailash workflow template with two connected PythonCodeNode steps and runtime execution.

Frequently Asked Questions about code-templates

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a basic Kailash workflow from scratch?▼

Use WorkflowBuilder to add nodes with the 4-parameter pattern, connect them with add_connection, then call build() before executing with LocalRuntime. The basic template includes imports, a main function, error handling, and result access via the 'result' key.

How do I write a cyclic workflow template in Kailash SDK?▼

Build the workflow first with workflow.build(), then call create_cycle on the built workflow with mapping, max_iterations, and converge_when criteria. Use try/except in node code to handle the first iteration, and use the 'result.' prefix in mappings for PythonCodeNode outputs.

What is the difference between Tier 1, Tier 2, and Tier 3 tests?▼

Tier 1 unit tests run under 1 second and allow mocking external services. Tier 2 integration tests run under 5 seconds against real Docker services like PostgreSQL with mocking forbidden. Tier 3 end-to-end tests validate complete business scenarios on full infrastructure.

Can I use mocks in Kailash integration tests?▼

No, mocking is forbidden in Tier 2 integration tests. You must use real Docker services such as PostgreSQL and Redis, with fixtures providing connection URLs and cleanup logic that truncates test tables before and after each test.

How do I create a custom node in Kailash SDK?▼

Subclass Node, implement get_parameters() to declare NodeParameter entries with types and defaults, and implement run() to execute logic. Optionally add Pydantic models for validation, then register the node with NodeRegistry for use in workflows.

How do I build an MCP server with authentication using Kailash?▼

Instantiate MCPServer with an APIKeyAuth provider defining keys, permissions, and rate limits. Register tools with the @server.tool() decorator specifying required_permission and cache settings, then run the server with asyncio.