Skip to content
gold-standards logo

Kailash Gold Standards - Mandatory Best Practices

gold-standards

Mandatory best practices and gold standards for Kailash SDK development including absolute imports, parameter passing, error handling, testing policies (NO MOCKING in Tiers 2-3), workflow design, custom node development, security, documentation, and test creation. Use when asking about 'best prac...

mattnigh/skills_collection0installs24stars

SKILL.md

Full skill instructions

Kailash Gold Standards - Mandatory Best Practices

Mandatory best practices and standards for all Kailash SDK development. These are required patterns that must be followed.

Overview

Gold standards are mandatory practices for:

  • Absolute imports (no relative imports)
  • Parameter passing patterns
  • Error handling strategies
  • Testing policies (NO MOCKING in Tiers 2-3)
  • Workflow design principles
  • Custom node development
  • Security requirements
  • Documentation standards
  • Test creation guidelines

IMPORTANT: These are not suggestions - they are required standards that prevent bugs, ensure consistency, and maintain code quality.

Reference Documentation

Code Organization

Absolute Imports (MANDATORY)
  • gold-absolute-imports - Absolute import requirement
    • Rule: ALWAYS use absolute imports, NEVER relative
    • Reason: Prevents import errors, enables refactoring
    • Pattern: from kailash.workflow.builder import WorkflowBuilder
    • Never: from ..workflow import builder
Parameter Passing (MANDATORY)
  • gold-parameter-passing - Parameter standards
    • Rule: Use 4-parameter connection format
    • Pattern: workflow.add_connection(source_id, source_param, target_id, target_param)
    • Rule: Access results with dict pattern
    • Pattern: results["node_id"]["result"]
    • Never: results["node_id"].result

Testing Standards

NO MOCKING Policy (MANDATORY)
  • gold-mocking-policy - NO MOCKING in Tiers 2-3
    • Rule: NO mocking in integration (Tier 2) or E2E (Tier 3) tests
    • Reason: Mocking hides real-world issues
    • Required: Use real databases, APIs, infrastructure
    • Allowed: Mocking ONLY in Tier 1 unit tests
Testing Standards (MANDATORY)
  • gold-testing - Testing requirements
    • Rule: Follow 3-tier strategy (Unit, Integration, E2E)
    • Rule: Tiers 2-3 use real infrastructure
    • Rule: All tests must clean up resources
    • Rule: Tests must be deterministic
Test Creation (MANDATORY)
  • gold-test-creation - Test creation standards
    • Rule: Write tests BEFORE implementation (TDD)
    • Rule: One assertion focus per test
    • Rule: Use AAA pattern (Arrange, Act, Assert)
    • Rule: Descriptive test names

Error Handling

Error Handling (MANDATORY)
  • gold-error-handling - Error handling requirements
    • Rule: Always handle errors explicitly
    • Rule: Never swallow exceptions silently
    • Rule: Provide actionable error messages
    • Rule: Clean up resources in finally blocks
    • Rule: Log errors with context

Workflow & Node Design

Workflow Design (MANDATORY)
  • gold-workflow-design - Workflow standards
    • Rule: Always call .build() before execution
    • Pattern: runtime.execute(workflow.build())
    • Rule: Use string-based node API
    • Rule: Validate inputs before processing
    • Rule: Single responsibility per workflow
Custom Node Development (MANDATORY)
  • gold-custom-nodes - Custom node standards
    • Rule: Extend BaseNode
    • Rule: Validate all inputs
    • Rule: Handle errors gracefully
    • Rule: Document parameters clearly
    • Rule: Return consistent output format

Security & Documentation

Security (MANDATORY)
  • gold-security - Security requirements
    • Rule: NEVER hardcode secrets
    • Rule: Use environment variables for credentials
    • Rule: Validate all user inputs
    • Rule: Prevent SQL injection
    • Rule: Prevent code injection
    • Rule: Use HTTPS for API calls
Documentation (MANDATORY)
  • gold-documentation - Documentation standards
    • Rule: Document all public APIs
    • Rule: Include code examples
    • Rule: Keep docs updated with code
    • Rule: Use docstrings for all functions/​classes
    • Rule: Explain WHY, not just WHAT

Critical Gold Standards

1. Absolute Imports ALWAYS

# ✅ CORRECT (Gold Standard)
from kailash.workflow.builder import WorkflowBuilder
from kailash.runtime.local import LocalRuntime

# ❌ WRONG (Violates Gold Standard)
from ..workflow.builder import WorkflowBuilder
from .runtime import LocalRuntime

2. NO MOCKING in Tiers 2-3

# ✅ CORRECT (Gold Standard - Tier 2)
def test_dataflow_crud(db: DataFlow):  # Real database
    """Test with real PostgreSQL/​SQLite."""
    workflow = db.create_workflow(...)
    results = runtime.execute(workflow.build())
    # Verify in actual database

# ❌ WRONG (Violates Gold Standard)
def test_dataflow_crud():
    """Test with mocked database."""
    db = Mock(spec=DataFlow)  # NO MOCKING in Tier 2!
    db.create_workflow.return_value = mock_workflow

3. 4-Parameter Connections ALWAYS

# ✅ CORRECT (Gold Standard)
workflow.add_connection("node1", "result", "node2", "input_data")

# ❌ WRONG (Violates Gold Standard)
workflow.add_connection("node1", "node2")

4. Always Call .build()

# ✅ CORRECT (Gold Standard)
results = runtime.execute(workflow.build())

# ❌ WRONG (Violates Gold Standard)
results = runtime.execute(workflow)

5. Dict-Based Result Access

# ✅ CORRECT (Gold Standard)
value = results["node_id"]["result"]

# ❌ WRONG (Violates Gold Standard)
value = results["node_id"].result

6. Environment Variables for Secrets

# ✅ CORRECT (Gold Standard)
import os
api_key = os.environ["API_KEY"]

# ❌ WRONG (Violates Gold Standard)
api_key = "sk-1234567890abcdef"  # Hardcoded!

7. TDD (Test-First Development)

# ✅ CORRECT (Gold Standard)
# 1. Write test first
def test_user_creation():
    user = create_user("[email protected]")
    assert user.email == "[email protected]"

# 2. Then implement
def create_user(email):
    return User(email=email)

# ❌ WRONG (Violates Gold Standard)
# Write implementation first, then add tests

8. Explicit Error Handling

# ✅ CORRECT (Gold Standard)
try:
    results = runtime.execute(workflow.build())
except WorkflowExecutionError as e:
    logger.error(f"Workflow failed: {e}")
    raise
finally:
    cleanup_resources()

# ❌ WRONG (Violates Gold Standard)
try:
    results = runtime.execute(workflow.build())
except:  # Too broad, swallows errors
    pass  # Silent failure!

Compliance Checklist

Before Every Commit

  • All imports are absolute
  • All connections use 4 parameters
  • Called .build() before execute
  • No hardcoded secrets
  • Error handling present
  • Tests written (TDD)
  • No mocking in Tier 2-3 tests
  • Documentation updated

Before Every PR

  • Gold standards validator passed
  • All tests passing
  • Code reviewed for compliance
  • Security validation passed
  • Documentation complete

Before Every Release

  • Full gold standards audit
  • All patterns compliant
  • Security audit complete
  • Documentation verified

Enforcement

Automated Validation

# Run gold standards validator
python -m kailash.validation.gold_standards validate-all

# Check specific standards
python -m kailash.validation.gold_standards check-imports
python -m kailash.validation.gold_standards check-mocking
python -m kailash.validation.gold_standards check-security

Code Review Focus

  • Check absolute imports
  • Verify NO MOCKING policy
  • Validate connection format
  • Check error handling
  • Verify TDD approach
  • Review security patterns

Why Gold Standards Matter

Problems They Prevent

Absolute Imports: Prevent import errors during refactoring

NO MOCKING: Catch real database issues, API timeouts, race conditions

4-Parameter Connections: Prevent wrong data routing

.build() Requirement: Prevent TypeError at runtime

Error Handling: Prevent silent failures

TDD: Prevent bugs before they exist

Security Standards: Prevent credential leaks, injection attacks

When to Use This Skill

Use this skill:

  • Before writing code - Know the standards
  • During code review - Validate compliance
  • When in doubt - Check gold standards
  • Before deployment - Ensure compliance
  • When onboarding - Learn required patterns

Related Skills

Support

For gold standards compliance, invoke:

  • gold-standards-validator - Automated compliance checking
  • pattern-expert - Pattern validation
  • testing-specialist - Testing compliance
  • requirements-analyst - Standards documentation

More skills from mattnigh

spring-framework-patterns logo
mattnigh/skills_collection

spring-framework-patterns

Comprehensive Spring Framework and Spring Boot best practices including dependency injection patterns, bean lifecycle and scopes, REST API development, Spring Data JPA, service layer design, Spring Security, testing strategies, caching, AOP, async processing, error handling, and common anti-patte...

24 0
View

TypeScript厳格モードによる型安全性設計を専門とするスキル。 📖 参照書籍: - 『Effective TypeScript』(Dan Vanderkam): 型設計 📚 リソース参照: - `resources/Level1_basics.md`: レベル1の基礎ガイド - `resources/Level2_intermediate.md`: レベル2の実務ガイド - `resources/Level3_advanced.md`: レベル3の応用ガイド - `resources/Level4_expert.md`: レベル4の専門ガイド - `resources/di...

24 0
View
deploying-cloud-k8s logo
mattnigh/skills_collection

deploying-cloud-k8s

Deploys applications to cloud Kubernetes (AKS/GKE/DOKS) with CI/CD pipelines. Use when deploying to production, setting up GitHub Actions, troubleshooting deployments. Covers build-time vs runtime vars, architecture matching, and battle-tested debugging.

24 0
View
moai-alfred-agent-guide logo
mattnigh/skills_collection

moai-alfred-agent-guide

19-agent team structure, decision trees for agent selection, Haiku vs Sonnet model selection, and agent collaboration principles. Use when deciding which sub-agent to invoke, understanding team responsibilities, or learning multi-agent orchestration.

24 0
View
mermaid-diagram-generator logo
mattnigh/skills_collection

mermaid-diagram-generator

Converts architecture descriptions, module specs, or workflow docs into Mermaid diagrams. Use when visualizing brick module relationships, workflows (DDD, investigation), or system architecture. Supports: flowcharts, sequence diagrams, class diagrams, state machines, entity relationship diagrams,...

24 0
View
pre-flight-check logo
mattnigh/skills_collection

pre-flight-check

INVOKE FIRST before any code work. Validates git workflow (branch, issue, worklog) and checks approach. Use at START of every task and END before completing. Prevents skipped steps.

24 0
View
browser-dev-tools logo
mattnigh/skills_collection

browser-dev-tools

This skill should be used when working with browser-rendered artifacts (i.e. Bun, React/React Native) to proactively validate that development work on localhost is being built appropriately and to support debugging browser-rendered content. Use this skill after making frontend changes to verify t...

24 0
View
lead-dev logo
mattnigh/skills_collection

lead-dev

Lead Développeur - Coordination technique opérationnelle, code review, mentoring et livraison. Pair de web-dev-process au niveau OPÉRATIONS.

24 0
View
worker-monitor logo
mattnigh/skills_collection

worker-monitor

Monitor Docker workers, RQ queue health, and auto-scale workers (max 4). Use when: checking job progress, monitoring queue depth, scaling workers up/down, diagnosing slow processing, or waiting for jobs to complete. Referenced by data-quality skill during reprocessing.

24 0
View
quality-advisor logo
mattnigh/skills_collection

quality-advisor

Proactive quality guidance system that monitors artifact creation and provides real-time feedback on documentation quality

24 0
View
bump-version logo
mattnigh/skills_collection

bump-version

This skill should be used when the user wants to bump the version number in the workspace. It updates versions across all pyproject.toml files (root, tde, and tda packages) and the CHANGELOG.md to keep them synchronized.

24 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View