Tsp Model
Use when creating, modifying, or documenting TypeSpec domain models. Triggers include adding new entities, value objects, enums, extending base types, or when asked to create a "tsp model", "domain model", "entity", or work with files in the tsp/ directory. Part of the Shep autonomous SDLC platform — https://shep.bot
Get the complete skill folder, including its scripts and reference files.
When to use this skill
Use Tsp Model when an AI agent needs a reusable SKILL.md workflow for this job: Use when creating, modifying, or documenting TypeSpec domain models. Triggers include adding new entities, value objects, enums, extending base types, or when asked to create a "tsp model", "domain model", "entity", or work with files in the tsp/ directory. Part of the Shep autonomous SDLC platform — https://shep.bot
When not to use it
Skip Tsp Model when the task is outside the creativity category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.
How to install
Where will you use it?
mkdir -p ~/.claude/skills/tsp-model # Save SKILL.md to ~/.claude/skills/tsp-model/SKILL.md
- Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/tsp-model/SKILL.md. For a shared project, commit the folder at .claude/skills/tsp-model/ instead.
- Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
- For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.
Full install guide for Claude, Cursor, and Codex →
Try a starter prompt
After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.
Use the Tsp Model skill for this task: Use Tsp Model when this documented workflow matches the task. Confirm any required inputs or files before making changes.
What supports this recommendation?
70/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.
- Documentation
- 77/100
- Practical detail
- 68/100
- Source evidence
- 62/100
- Source signals
- 70/100
Model compatibility evidence
- claudeinferred
The skill text mentions Claude or a closely associated term. This is keyword-derived compatibility; no hands-on model test is recorded.
- chatgptuntested
No model-specific signal or recorded compatibility test was found.
- geminiuntested
No model-specific signal or recorded compatibility test was found.
- copilotuntested
No model-specific signal or recorded compatibility test was found.
- llamauntested
No model-specific signal or recorded compatibility test was found.
- perplexityuntested
No model-specific signal or recorded compatibility test was found.
- mistraluntested
No model-specific signal or recorded compatibility test was found.
- grokuntested
No model-specific signal or recorded compatibility test was found.
Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.
What this skill does
# TypeSpec Domain Model Generation
Generate TypeSpec domain models following this project's conventions for Clean Architecture entities.
## Directory Structure
``` tsp/ ├── common/ # Base types, scalars, enums │ ├── base.tsp # BaseEntity, SoftDeletableEntity, AuditableEntity │ ├── scalars.tsp # UUID scalar type │ ├── ask.tsp # Askable interface pattern │ └── enums/ # One file per enum ├── domain/ # Domain entities │ ├── entities/ # One file per entity │ └── value-objects/# Embedded value objects ├── agents/ # Agent system models └── deployment/ # Deployment configuration models ```
## File Conventions
**One model per file** - Each entity/enum/value-object gets its own file.
**Naming:**
- Files: `kebab-case.tsp` (e.g., `action-item.tsp`) - Models: `PascalCase` (e.g., `ActionItem`) - Enums: `PascalCase` with values in `PascalCase` (e.g., `TaskStatus.InProgress`)
## Required Template
Every `.tsp` file MUST follow this structure:
````typespec /** * @module Shep.Domain.Entities.<EntityName> * * Brief description of the entity's purpose. * * ## Entity Relationships (if applicable) * ASCII diagram showing relationships * * @see docs/concepts/<relevant-doc>.md * @see <related-entity>.tsp */ import "../../common/base.tsp"; import "../../common/scalars.tsp"; // other imports...
/** * Entity Name * * Detailed description. * * ## Properties * * | Property | Type | Required | Description | * |----------|------|----------|-------------| * | ... | ... | ... | ... | * * @example * ```json * { ... } * ``` */ @doc("One-line description for OpenAPI") model EntityName extends BaseEntity { /** * Property description. * @example "example value" */ @doc("One-line property description") propertyName: PropertyType; } ````
## Base Types
**Choose the right base:**
| Base Type | Use When | | --------------------- | ------------------------------------------------------ | | `BaseEntity` | Standard entity with id, createdAt, updatedAt | | `SoftDeletableEntity` | Entity that can be soft-deleted (adds deletedAt) | | `AuditableEntity` | Entity needing audit trail (adds createdBy, updatedBy) |
## Enum Definition Pattern
```typespec /** * @module Shep.Common.Enums.<EnumName> */ /** * Enum description */ @doc("One-line enum description") enum EnumName { @doc("Description of this value") ValueOne,
@doc("Description of this value") ValueTwo, } ```
## Documentation Requirements
1. **Module JSDoc** at file top with `@module`, relationships, `@see` links 2. **Model JSDoc** with property table and JSON examples 3. **Property JSDoc** with `@example` tags 4. **`@doc()` decorator** on every model and property (for OpenAPI)
## Validation Commands
After creating/modifying TypeSpec:
```bash pnpm tsp:compile # Verify compilation pnpm tsp:format # Format TypeSpec files ```
## Quick Reference
| Task | Location | Example | | ---------------- | ------------------------------------- | ----------------- | | New entity | `tsp/domain/entities/<name>.tsp` | feature.tsp | | New enum | `tsp/common/enums/<name>.tsp` | lifecycle.tsp | | New value object | `tsp/domain/value-objects/<name>.tsp` | gantt.tsp | | Agent model | `tsp/agents/<name>.tsp` | feature-agent.tsp |
## Common Mistakes
- **Missing `@doc()` decorators** - Required for OpenAPI generation - **Forgetting index.tsp exports** - Add to directory's index.tsp - **Wrong import paths** - Use relative paths from current file - **Missing examples** - Always include `@example` with realistic JSON
Intended uses
- Use Tsp Model when this documented workflow matches the task.
Implementation notes
- Review the source instructions and adapt inputs before running the workflow.
Try it, then tell us how it went
A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.