spec

A command that creates a written specification for an AI-assisted coding task. The specification records the problem, expected result, relevant files, constraints, tasks, and checks.

In plain words
What is it for?
Use it before asking an AI agent to build a feature. It creates a structured file under .ai/specs with implementation tasks and verification steps.
Why use it?
It turns a feature request into a shared plan before implementation, making the work and its completion criteria clearer.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/owainlewis/youtube-tutorials/spec
Clone the repo
git clone --depth 1 https://github.com/owainlewis/youtube-tutorials
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 672 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00672
Opus 5 $0.00000 $0.00336
Sonnet 5 $0.00000 $0.00134
Haiku 4.5 $0.00000 $0.00067

Measured 2d ago against content hash 9b2aa8eb869c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

spec 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 2d 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.

tutorials/spec-driven-development/resources/commands/spec.md · 113 lines

How it starts

The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Spec

Generate a specification for AI-assisted implementation.

Feature

$ARGUMENTS

Instructions

Read CLAUDE.md first. Ask only if blocked.

Create .ai/specs/<feature-slug>.md:

# Feature Name

## Why

[1-2 sentences: Problem solved. Why now.]

## What

[Concrete deliverable. How you'll know it's done.]

## Context

**Relevant files:**
- `path/to/file.ts` — [what it does]
- `path/to/other.ts` — [why it matters]

**Patterns to follow:**
- [Existing convention to match, with example file]

**Key decisions already made:**
- [Tech choices, libraries, approaches locked in]

## Constraints

**Must:**
- [Required patterns/conventions]

**Must not:**
- [No new dependencies unless specified]
- [Don't modify unrelated code]
- [Don't refactor existing code]

**Out of scope:**
- [Adjacent features explicitly not included]

## Tasks

Break into tasks that:
- Can each be completed in one session
- Have a clear verify step
- Are safe to commit independently

### T1: [Noun phrase — what gets built]

**Do:** [Specific changes]

**Files:** `path/to/file`, `path/to/test`

**Verify:** `command` or "Manual: [check]"

### T2: [Title]
...

## Done

[End-to-end verification after all tasks]

- [ ] `build/test command passes`
- [ ] Manual: [what to verify in UI/API]
- [ ] No regressions in [related area]

Guidelines

Sizing tasks:

  • Group changes that must ship together (schema + types + migration = 1 task)
  • Split at natural commit boundaries
  • If a task might hit context limits, it's too big

Writing good verify steps:

  • Prefer commands over manual checks
  • Manual checks should be specific: "Click X, see Y" not "verify it works"
  • Include the unhappy path when relevant

Context section tips:

  • List only files the agent will actually touch or need to reference
  • "Patterns to follow" with a concrete example file beats abstract description
  • Capture decisions so the agent doesn't re-litigate them

When to skip sections:

  • Trivial features (< 3 files): inline everything, skip Context
  • Bug fixes: Why + What + single Task may suffice
  • Spikes/exploration: just Why + What + time box

Read the full file on GitHub · 113 lines

Changes

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.

  1. 2d ago First seen · 113 lines · 0 tokens per session scan A 9b2aa8eb869c

Subscribe to this mod's changes

spec is a command published in the GitHub repository owainlewis/youtube-tutorials (375 stars, last pushed 10d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 672 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.