| name | add-prompt |
| description | Add a prompt or skill to the dev.tools prompts collection (TypeScript catalog workflow) |
Add a Prompt (or Skill)
Prompt data lives in src/common/prompts/catalog/ as TypeScript modules. Adding a prompt means creating a .prompt.ts file and registering it in the category index.ts. Then run npm run build:prompts to validate and regenerate the manifest.
Directory layout
src/common/prompts/catalog/
a-software-engineering/
a01-code-generation/
sys.prompt.ts ← SYS-A01 system prompt
function.prompt.ts ← LP-A01-function logical prompt
from-spec.prompt.ts ← LP-A01-from-spec (dual variant)
index.ts ← barrel: exports prompts array
a02-code-refactoring/
...
index.ts ← domain barrel: re-exports all categories
b-writing-communication/
c-thinking-productivity/
d-ai-prompt-workflows/
index.ts ← top-level barrel: re-exports all domains
Domains
| Code | Title | Directory |
|---|
| A | Software Engineering | a-software-engineering/ |
| B | Writing & Communication | b-writing-communication/ |
| C | Thinking & Productivity | c-thinking-productivity/ |
| D | AI & Prompt Workflows | d-ai-prompt-workflows/ |
The LogicalPromptDef shape
Every .prompt.ts file exports a prompt constant of type LogicalPromptDef:
import type { LogicalPromptDef } from '../../../model/types';
export const prompt: LogicalPromptDef = {
id: 'LP-A01-function',
categoryCode: 'A01',
title: 'Generate a Function',
subtitle: 'Short subtitle shown in the UI',
description: 'One-line description',
variantAxes: [],
defaultVariantId: 'USR-A01-codegen-function',
modeClass: 'chat-only',
variants: [
{
id: 'USR-A01-codegen-function',
kind: 'user',
categoryCode: 'A01',
title: 'Generate a Function',
description: '...',
template: `Your template with {{param_name}} placeholders.`,
parameters: [
{
name: 'language',
label: 'Programming language',
description: 'Target language and version',
control: 'select',
optional: false,
valueSetId: 'programming-language',
},
{
name: 'requirements',
label: 'Requirement',
description: 'What the function must do',
control: 'textarea',
optional: false,
},
],
examples: { requirements: ['Example value 1', 'Example value 2'] },
keywords: ['keyword1', 'keyword2', 'A01'],
executionContext: 'chat',
model: null,
isMetaPrompt: false,
recommendedSystemPromptId: 'SYS-A01-code-generation',
relatedPromptIds: ['LP-A01-class'],
relatedSkillIds: [],
supports: { style: false, tone: false, context: false },
},
],
};
For a dual-mode prompt (chat + agent): set modeClass: 'dual', variantAxes: ['mode'], two variants — kind: 'user' + executionContext: 'chat' and kind: 'agent' + executionContext: 'agent'.
For a system prompt: set modeClass: 'chat-only-meta', kind: 'system', omit parameters / recommendedSystemPromptId.
Naming conventions
| Type | ID format | File name |
|---|
| Logical prompt | LP-<A01>-<slug> | <slug>.prompt.ts |
| System prompt | SYS-<A01>-<slug> | sys.prompt.ts |
<A01> = domain letter + two-digit category number.
<slug> = kebab-case, starts with a letter.
Steps: adding a prompt
Steps: adding a skill
Skills live in src/common/prompts/skills/<slug>/ as TypeScript modules with bundled file content.
Adding a model, style, tone, or context (data-only)
These additions require no runtime code changes — edit one registry file and run npm run build:prompts.
manifest.generated.ts and loaders.generated.ts are git-ignored — never commit them.
Validation errors
| Error message | Cause | Fix |
|---|
Duplicate ID: <id> | Another prompt already uses this ID | Change id to something globally unique |
Missing recommendedSystemPromptId target: <sys-id> | recommendedSystemPromptId references an ID that doesn't exist | Add the system prompt or fix the reference |
Invalid control type: <type> | control value is not one of the allowed set | Use select, textarea, text, or combobox |
Dual prompt missing agent/chat variant | modeClass: 'dual' but only one variant | Add the missing kind: 'agent' or kind: 'user' variant |
Parameter name contains abbreviation | Validator V13 rejects abbreviated param names | Use the full word (e.g. requirements not req) |