domain-model

Define typed Tool, Task, and AppState models for TypeScript agents.

5|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/TechyMT/claude-code-superpowers --skill domain-model-techymt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: domain-model
Source: https://github.com/TechyMT/claude-code-superpowers/tree/main/skills/domain-model
Command: npx skills add https://github.com/TechyMT/claude-code-superpowers --skill domain-model-techymt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a single, consistent architecture for connecting an LLM-driven capability surface to a local runtime by defining the six core concepts (Tool, Message, Task, ToolUseContext, AppState, Command) so capabilities are typed, permissioned, and testable without global singletons.

Core Features & Use Cases

  • Typed Capability Contracts: Define Tools with Zod-driven input schemas that produce structured tool calls and results for the LLM.
  • Contextual Dependency Injection: Use ToolUseContext to pass state, abort signals, callbacks, and permissions into every tool call so tools remain independently testable.
  • Immutable, Reducer-Based State: Manage UI and background work via an AppState store updated atomically through reducer functions and tracked Tasks.
  • Use Cases: Implement new file, git, or network Tools with per-call permission checks; create PromptCommand or LocalCommand integrations; spawn and monitor long-running Tasks safely.

Quick Start

Use the domain-model skill to explain how to implement a new Tool with a Zod input schema, a checkPermissions function, and a context-aware call that returns a structured tool result.

Frequently Asked Questions about domain-model

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

FAQPage Schema
How do I structure an AI agent's domain model for TypeScript tool calls?

To structure an AI agent's domain model, define Tools, ToolUseContext, AppState, Message, Task, and Command to bridge LLM tool calls with the local runtime using typed Zod schemas and immutable state transitions.

What is the best way to implement permission checks for LLM tool calls?

The best way to implement permission checks is by using a ToolUseContext to inject per-call permission callbacks into every tool execution, ensuring capabilities are validated independently without relying on global singletons.

How do I manage concurrency and state transitions in an AI agent runtime?

Manage concurrency and state transitions by implementing a reducer-based AppState store that updates atomically and tracks background Tasks, ensuring safe execution of concurrent operations and immutable state changes.

Can I use Zod schemas to define typed input contracts for agent tools?

Yes, you can use Zod schemas to define typed input contracts for agent tools, producing structured tool calls and results for the LLM while ensuring capabilities remain typed and testable.

How do I pass dependencies into an LLM tool call without global singletons?

Pass dependencies into an LLM tool call by utilizing contextual dependency injection through a ToolUseContext, which carries state, abort signals, and permissions directly into each function execution.

Does this domain model approach work for spawning long-running background tasks?

Yes, this domain model approach works for spawning long-running background tasks by tracking them within the AppState store and utilizing abort signals passed through the ToolUseContext for safe monitoring.