Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/Matt-Dionis/claude-code-configsnpx agentmods add commands/matt-dionis/claude-code-configs/add-promptWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/matt-dionis/claude-code-configs/add-prompt)<a href="https://agentmods.dev/commands/matt-dionis/claude-code-configs/add-prompt"><img src="https://agentmods.dev/badge/commands/matt-dionis/claude-code-configs/add-prompt.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01631 |
| Opus 5 | $0.00000 | $0.00816 |
| Sonnet 5 | $0.00000 | $0.00326 |
| Haiku 4.5 | $0.00000 | $0.00163 |
Grade A, and why
add-prompt scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 242 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Add Prompt Template to MCP Server
Adds a new prompt template to your MCP server for reusable conversation patterns.
Usage
/add-prompt <name> <description> [arguments]
Examples
/add-prompt code_review "Review code for improvements" language:string file:string?
/add-prompt analyze_data "Analyze data patterns" dataset:string metrics:array
/add-prompt generate_docs "Generate documentation" codebase:string style:enum[minimal,detailed]
Implementation
import * as fs from 'fs/promises';
import * as path from 'path';
async function addPrompt(
name: string,
description: string,
argumentDefs?: string[]
) {
// Parse arguments
const args = parsePromptArguments(argumentDefs || []);
// Generate prompt file
const promptContent = generatePromptFile(name, description, args);
// Write prompt file
const promptPath = path.join('src/prompts', `${name}.ts`);
await fs.writeFile(promptPath, promptContent);
// Update prompt index
await updatePromptIndex(name);
// Generate test file
const testContent = generatePromptTest(name);
const testPath = path.join('tests/unit/prompts', `${name}.test.ts`);
await fs.writeFile(testPath, testContent);
console.log(`✅ Prompt "${name}" added successfully!`);
console.log(` - Implementation: ${promptPath}`);
console.log(` - Test file: ${testPath}`);
console.log(`\nNext steps:`);
console.log(` 1. Define the prompt template in ${promptPath}`);
console.log(` 2. Test with MCP Inspector`);
}
interface PromptArgument {
name: string;
description: string;
required: boolean;
type: string;
}
function parsePromptArguments(argumentDefs: string[]): PromptArgument[] {
return argumentDefs.map(def => {
const [nameWithType, description] = def.split('=');
const [nameType] = nameWithType.split(':');
const isOptional = nameType.endsWith('?');
const name = isOptional ? nameType.slice(0, -1) : nameType;
const type = nameWithType.split(':')[1] || 'string';
return {
name,
description: description || `${name} parameter`,
required: !isOptional,
type: type.replace('?', ''),
};
});
}
function generatePromptFile(
name: string,
description: string,
args: PromptArgument[]
): string {
return `
import type { Prompt, PromptMessage } from '../types/prompts.js';
export const ${name}Prompt: Prompt = {
name: '${name}',
description: '${description}',
arguments: [
${args.map(arg => ` {
name: '${arg.name}',
description: '${arg.description}',
required: ${arg.required},
},`).join('\n')}
],
};
export function get${capitalize(name)}Prompt(
args: Record<string, unknown>
): PromptMessage[] {
// Validate required arguments
${args.filter(a => a.required).map(arg => ` if (!args.${arg.name}) {
throw new Error('Missing required argument: ${arg.name}');
}`).join('\n')}
// Build prompt messages
const messages: PromptMessage[] = [];
// System message (optional)
messages.push({
role: 'system',
content: {
type: 'text',
text: buildSystemPrompt(args),
},
});
// User message
messages.push({
role: 'user',
content: {
type: 'text',
text: buildUserPrompt(args),
},
});
return messages;
}
function buildSystemPrompt(args: Record<string, unknown>): string {
// TODO: Define the system prompt template
return \`You are an expert assistant helping with ${description.toLowerCase()}.\`;
}
function buildUserPrompt(args: Record<string, unknown>): string {
// TODO: Define the user prompt template
let prompt = '${description}\\n\\n';
${args.map(arg => ` if (args.${arg.name}) {
prompt += \`${capitalize(arg.name)}: \${args.${arg.name}}\\n\`;
}`).join('\n')}
return prompt;
}
function capitalize(str: string): string {
return str.charAt(0).toUpperCase() + str.slice(1);
}
`;
}
function generatePromptTest(name: string): string {
return `
import { describe, it, expect } from 'vitest';
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 242 lines · 0 tokens per session scan A d446d1d16d4d
add-prompt is a command published in the GitHub repository Matt-Dionis/claude-code-configs (624 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,631 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.
implement
Execute the implementation plan by processing and executing all tasks defined in tasks.md.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.