working-with-runtime-system

Explains kdn runtime system architecture and registration workflow for engineers.

10|14|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/openkaiden/kdn --skill working-with-runtime-system
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: working-with-runtime-system
Source: https://github.com/openkaiden/kdn/tree/main/.agents/skills/working-with-runtime-system
Command: npx skills add https://github.com/openkaiden/kdn --skill working-with-runtime-system

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Clarifies how to understand the kdn runtime system architecture and the runtime registration workflow, guiding developers through the core components and interactions.

Core Features & Use Cases

  • Runtime Interface: The contract all runtimes must implement (pkg/runtime/runtime.go).
  • Registry: Manages runtime registration and discovery.
  • Runtime Implementations: Platform-specific packages (e.g., fake, podman, openshell).
  • Centralized Registration: Automatic registration setup via pkg/runtimesetup.
  • Optional Interfaces & Extensions: StorageAware, AgentLister, FlagProvider, Terminal, HostResolver, ConfigTransformer, Experimental.
  • State Validation & Safety: Manager enforces valid WorkspaceState across runtimes and maps platform states, ensuring safe operation.

Quick Start

Run the provided example to register all runtimes and inspect how the registry exposes available backends.

Frequently Asked Questions about working-with-runtime-system

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

FAQPage Schema
How does runtime registration and automatic discovery work in the kdn architecture?

Runtime registration in the kdn architecture works through a centralized Registry that manages discovery, with automatic registration setup handled via pkg/runtimesetup to expose available backends. The Registry manages the registration workflow and allows engineers to inspect available platform-specific packages.

What is the Runtime interface contract that all platform backends must implement?

The Runtime interface contract is defined in pkg/runtime/runtime.go and specifies the mandatory methods all runtimes must implement. It serves as the foundation that platform-specific implementations like podman and openshell build upon to integrate with the system.

How do I integrate a new runtime like podman or openshell into the system?

To integrate a new runtime, you implement the Runtime interface contract and utilize centralized registration via pkg/runtimesetup for automatic discovery. The system supports platform-specific packages, allowing new backends to be registered and exposed through the Registry.

What safety constraints and state validation rules does the runtime manager enforce?

The runtime manager enforces safety constraints through state validation, ensuring valid WorkspaceState across all runtimes and mapping platform states. It enforces path containment rules to guarantee safe operation during runtime registration and execution workflows.

Can I extend runtime behavior beyond the core interface?

Yes, you can extend runtime behavior using optional interfaces and extensions such as StorageAware, AgentLister, FlagProvider, Terminal, HostResolver, ConfigTransformer, and Experimental. These optional interfaces allow runtimes to declare additional capabilities beyond the core Runtime contract.

Why is my runtime not being discovered by the registry during automatic registration?

If your runtime is not discovered during automatic registration, verify that centralized registration setup via pkg/runtimesetup is correctly configured. The Registry manages runtime discovery, so failures typically indicate the runtime implementation was not properly registered or the automatic registration setup was bypassed.