directory-to-spec

directory-to-spec is a skill for Claude Code, Codex from tomzx/agents. It costs 25 tokens per session (417 once invoked), scanned A, original, MIT.

A codebase analysis tool that creates a `spec/` folder with one plain-language requirements file for each major feature. The requirements use MUST, SHOULD, and MAY to describe expected behavior without tying it to a specific technology.

In plain words
What is it for?
Use it to document the main features of a project and create technology-independent requirements for future development or review.
Why use it?
It turns an existing codebase into organized specifications, making its features and expected behavior easier to understand and maintain.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to document the main features of a project and create technology-independent requirements for future development or review.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tomzx/agents/directory-to-spec
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.

Any agent
npx skills add tomzx/agents --skill directory-to-spec
Clone the repo
git clone --depth 1 https://github.com/tomzx/agents

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for directory-to-spec

README.md
[![agentmods](https://agentmods.dev/badge/skills/tomzx/agents/directory-to-spec/github.svg)](https://agentmods.dev/skills/tomzx/agents/directory-to-spec)
Your own site
<a href="https://agentmods.dev/skills/tomzx/agents/directory-to-spec"><img src="https://agentmods.dev/badge/skills/tomzx/agents/directory-to-spec/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for directory-to-spec

Your own site · 80×15
<a href="https://agentmods.dev/skills/tomzx/agents/directory-to-spec"><img src="https://agentmods.dev/badge/skills/tomzx/agents/directory-to-spec.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 417 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00025 $0.00417
Opus 5.5 $0.00010 $0.00167
Sonnet 5.5 $0.00005 $0.00083
Haiku 4.5 $0.00003 $0.00042

Measured 22d ago against content hash ec08441422c5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

directory-to-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 22d 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.

skills/directory-to-spec/SKILL.md · 47 lines

What it actually says

Convert Directory to Spec

Analyzes code in the current directory and generates a spec/ directory containing one specification file per major feature, each with MUST/SHOULD/MAY requirements.

Prerequisites

  • Read access to the current directory and its subdirectories
  • A codebase with identifiable features or modules

Steps

  1. Read and analyze the code in the current directory and subdirectories to identify major features.
  2. Create the spec/ directory.
  3. For each major feature, create a descriptively named specification file (e.g., authentication.md).
  4. Each file must include a requirements section using RFC 2119 language (MUST, SHOULD, MAY).
  5. Specifications must remain technology-agnostic: no specific library, framework, or technology choices should appear in the requirements, unless used as illustrative examples (e.g., "the system MUST provide a key-value cache, such as Redis").

Naming rules:

  • Use descriptive, lowercase names: authentication.md
  • Do NOT number files: 01-authentication.md
  • Do NOT suffix with -spec: authentication-spec.md

Example Usage

Scenario 1: REST API project Working directory contains auth/, orders/, payments/. Produces:

  • spec/authentication.md
  • spec/order-management.md
  • spec/payment-processing.md

Scenario 2: Single-module library Working directory contains a single Python library with multiple classes. Produces one spec file per major class or responsibility area.

Scenario 3: Frontend application Working directory contains React components. Produces spec files organized around user-facing features rather than individual component names.

Useful Commands Reference

Command Description
mkdir spec Create the spec output directory
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. 22d ago Changed ec08441422c5
  2. 1mo ago First seen · 47 lines · 25 tokens per session scan A f3b2a85bf10b

Subscribe to this mod's changes

directory-to-spec is a skill published in the GitHub repository tomzx/agents (13 stars, last pushed yesterday), licensed MIT. It adds 25 tokens to every session and 417 once invoked, about $0.0001 per session on Opus 5.5. 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-09-03.

Related

Other skills, from other repositories

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens