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/Hamza-Haadi/disease-risk-classifier-hamza --skill code-templates-hamza-haadi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: code-templates
Source: https://github.com/Hamza-Haadi/disease-risk-classifier-hamza/tree/main/.claude/skills/14-code-templates
Command: npx skills add https://github.com/Hamza-Haadi/disease-risk-classifier-hamza --skill code-templates-hamza-haadi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Starting a new Kailash SDK project from scratch requires remembering the canonical 4-parameter pattern, correct cycle setup order, MCP server configuration, and the strict 3-tier testing policy. This Skill provides ready-to-customize templates so developers avoid structural mistakes and boilerplate rewriting. ## Core Features & Use Cases - Workflow Templates: Basic and cyclic workflow scaffolds using WorkflowBuilder, including the critical build-before-cycle pattern and convergence criteria. - Custom Node & MCP Server Templates: Node class structure with get_parameters() declaration, Pydantic validation, and production MCP servers with authentication, caching, and permissions. - 3-Tier Test Templates: Unit (Tier 1, mocks allowed), integration (Tier 2, real Docker services, no mocking), and end-to-end (Tier 3, full business scenarios) test scaffolds. - Use Case: When asked to scaffold a new integration test, the Skill produces a pytest class wired to a real PostgreSQL Docker container with cleanup fixtures, following the no-mocking policy. ## Quick Start Ask the AI to generate a starter template for the component you need, such as a basic workflow, custom node, MCP server, or a specific test tier.

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 the basic workflow template: instantiate WorkflowBuilder, add nodes with the 4-parameter pattern, connect them with add_connection, call build(), then execute with LocalRuntime. The template includes sync CLI, async FastAPI, and ETL variations.

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

Build the workflow first with workflow.build(), then call create_cycle() on the built workflow. Use mapping with the 'result.' prefix for PythonCodeNode outputs, set max_iterations, and define convergence with flattened fields like 'done == True'.

Can I use mocks in Kailash integration tests?▼

No. Tier 2 integration tests forbid mocking and must use real Docker services like PostgreSQL and Redis. Mocking external services is only allowed in Tier 1 unit tests, which must run in under one second.

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() for execution logic. The template also shows optional Pydantic-based validation for complex parameter contracts.

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

Tier 1 unit tests run under 1 second with mocks allowed. Tier 2 integration tests run under 5 seconds against real Docker services with no mocking. Tier 3 end-to-end tests run under 10 seconds covering complete business scenarios on full infrastructure.

How do I add authentication to a Kailash MCP server?▼

Use the production MCP server template with APIKeyAuth, defining keys with permissions and rate limits. Pass the auth provider to MCPServer along with enable_metrics and caching options, then set required_permission on individual tools.