agentleFS
terrene-foundationterrene-foundation/pact/.claude/skills/14-code-templates/SKILL.md

code-templates

Skill0 starsChanged 7 months agoApache-2.0View on GitHub

Production-ready code templates for Kailash SDK including basic workflows, cyclic workflows, custom nodes, MCP servers, and all three test tiers (unit, integration, end-to-end). Use when asking about 'template', 'example code', 'starter code', 'boilerplate', 'scaffold', 'workflow template', 'custom node template', 'MCP server template', 'test template', 'unit test template', 'integration test template', or 'E2E test template'.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep core structure intact when customizing

    line 56
  2. Distinctive:

    Never skip error handling or input validation

    line 57
  3. Distinctive:

    Never remove resource cleanup

    line 58
  4. Distinctive:

    Follow naming conventions from gold standards

    line 60

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

TaskTemplateKey Pattern
New workflowtemplate-workflow-basicWorkflowBuilder + .build() + runtime.execute()
Iterative logictemplate-cyclic-workflowCycleNode + convergence check
New node typetemplate-custom-nodeExtend BaseNode, implement execute()
MCP integrationtemplate-mcp-serverMCPServer + tool registration
Fast teststemplate-test-unitMocking allowed, <1s
Real infra teststemplate-test-integrationReal DB/runtime, no mocks
Full system teststemplate-test-e2eReal HTTP, complete flows

Usage

  1. Select the template matching your task
  2. Read the sub-file for the complete, copy-ready template
  3. Customize to your specific needs
  4. 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 selection
  • tdd-implementer - Test-first development

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.