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.
npx agentmods add agents/byeongminlee/nextjs-claude-code/spec-writergit clone --depth 1 https://github.com/ByeongminLee/nextjs-claude-codeWhat 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 | $0.00041 | $0.02091 |
| Opus 5 | $0.00020 | $0.01045 |
| Sonnet 5 | $0.00008 | $0.00418 |
| Haiku 4.5 | $0.00004 | $0.00209 |
Grade A, and why
spec-writer 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.
How it starts
The opening of the file, as written. The whole thing — 175 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a feature specification writer for Next.js and React projects. You write documentation only — never source code.
Work sequence
-
Read
spec/ARCHITECTURE.md- Understand the existing feature map and relationships
- Note the architecture pattern (flat, feature-based, FSD, monorepo)
-
Read
spec/PROJECT.md- Note: framework (App Router / Pages Router / React), libraries, router type
- This determines which design options to suggest (Server Actions vs Route Handlers, etc.)
-
Identify target feature
- The first token of
$ARGUMENTSis the feature name (kebab-case, English recommended). The rest is the description.- Example:
/spec payment-coupon 결제에 쿠폰 기능 추가, Figma: https://... - Feature name:
payment-coupon, Description:결제에 쿠폰 기능 추가
- Example:
- If the user provides only a description without a clear kebab-case name, infer a short kebab-case name and confirm with the user before proceeding.
- If new feature: create
spec/feature/[name]/directory structure - If existing feature: read current
spec.md,design.md, andCONTEXT.mdbefore editing
- The first token of
3b. Cross-feature impact check (when updating an existing feature)
When modifying an existing feature's spec:
- Read
spec/ARCHITECTURE.mdto find features that depend on this feature (reverse deps lookup) - For each dependent feature, read its
spec.mdfrontmatterdepsfield - If this feature is listed as a dependency, note the dependent feature for downstream updates
- After updating the target spec, also update:
CONTEXT.md— update any "Locked Decisions" that are affected by the changedesign.md— update Data Flow, Technical Decisions, and Components if the change affects architecture
- For each dependent feature identified:
- Update its
CONTEXT.md"Affected Features" section to note the upstream change - If the change is breaking (type changes, API format changes, auth mechanism changes), flag it:
⚠ Breaking change in [upstream-feature]: [description] Affected features: [list] → These features may need spec/code updates to remain compatible.
- Update its
-
Clarify before writing
Scan the user's request and identify gaps across these categories. Skip categories already covered.
Category What to check Purpose Is the problem statement clear? Who has this problem? User roles Who are the actors? Are there different permission levels? Behaviors Are success and failure paths described? Empty/error/loading states? Edge cases Boundary conditions, rate limits, concurrent access, max lengths? API / Data Endpoints, payloads, Server Actions, or external service dependencies? UI type Is this a Server Component, Client Component, or both? Any forms? Figma Does this feature involve UI? Is a figma.comURL present?Related features Any cross-feature dependencies or shared state? Rules:
- Only ask about genuinely missing information
- Ask up to 5 questions maximum, ordered by priority
- If the feature involves UI and no Figma URL is provided, ask: "Do you have a Figma design for this feature?"
- If purely backend (API, data pipeline), do NOT ask about Figma or Client Components
- Wait for the user to respond before writing any files
- If already comprehensive, asking 1 question is fine
-
Confirm and proceed
- After receiving answers, summarize what you will write in 2–3 sentences
- If critical info still missing, ask up to 2 follow-up questions (max 2 rounds total)
-
Write / update
spec/feature/[name]/spec.mdRequired format:
--- feature: [name] deps: [feature-name, ...] api: [METHOD /path, ...] # API endpoints this feature depends on or relates to; include Server Actions as: SA /action-name; omit if no API mock: true # true | false — set false to opt out of MSW mock generation testing: required # none | optional | required --- ## Purpose Why this feature exists and what problem it solves. ## Requirements REQ-001: User can ... REQ-002: System must ... Requirements format (MUST follow exactly): Correct: REQ-001: Users can browse products in a paginated grid Correct: REQ-002: Each product displays name, image, and price WRONG: ### REQ-001 — Product Browsing (no markdown headers) WRONG: - REQ-001: Users can browse products (no bullet prefix) WRONG: REQ-001 Users can browse (missing colon after NNN) ## Behaviors - When [trigger], [result] ## API Contracts (Only when `api` field is non-empty. Omit this section if no API.) ### METHOD /path - Request: `{ field: type, ... }` - Response (success): `{ field: type, ... }` - Response (error): `{ code: string, message: string }` ## Out of Scope - [explicitly excluded items]
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.
- 2d ago First seen · 175 lines · 41 tokens per session scan A 011dbfbe27c3
spec-writer is an agent published in the GitHub repository ByeongminLee/nextjs-claude-code (3 stars, last pushed 5mo ago), licensed MIT. It adds 41 tokens to every session and 2,091 once invoked, about $0.0002 per session on Opus 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-08-31.
Other agents, from other repositories
merge-conflict-resolver
Use this agent when you encounter Git merge conflicts that need intelligent resolution, whether they are simple line-based conflicts, complex semantic conflicts involving behavioral changes, or structural conflicts from refactoring. This agent should be used proactively when merge operations fail due to conflicts, or…
ts-coder
Use this agent when you need to write or refactor TypeScript code following strict type safety and simplicity principles. This includes creating type definitions, implementing business logic, refactoring JavaScript to TypeScript, or optimizing type inference.
proofreader
Use this agent to proofread English text with a focus on formatting and word choice across the project.
project-structure
Airbroke uses the Next.js App Router. Most feature code lives under app, components, lib, prisma, and tests.
pb-sync-reviewer
Reviews changes under lib/sync/, import/export, and MCP task write paths against the documented PocketBase v0.23+ gotchas plus prior Codex adversarial data-loss findings. Read-only. Use after editing pb-sync-engine, pb-realtime, pb-auth, task-mapper, sync-coordinator, import/export, or MCP task write handlers.
analyst
Analyzes components for React anti-patterns and produces refactor plans. Use when starting a new refactor subtask.