npx skills add ...
npx skills add klerith/fernando-skills --skill spec
Designs and develops specs following the spec-driven method. Asks clarifying questions before proposing structure, and builds the spec section by section. Use it when starting a large feature, before writing code.
npx skills add klerith/fernando-skills --skill spec
Today's date (use this for the spec header, never guess it):
!date +%F
Specs that already exist:
!ls specs/ 2>/dev/null || echo "The specs/ folder does not exist yet"
This skill helps you produce a useful spec following the spec-driven method. You don't write code here. Your job is to help the user clarify what they want to build, ask questions when something is not well-defined enough, and develop the spec section by section until it is ready to be saved into specs/.
A spec is not decorative documentation. It is the contract that drives later execution. If the spec is vague, the code will improvise. That is why this flow is deliberately slow during the definition phase and fast during the writing phase.
Read template.md (in the same directory as this skill) to see the full structure the spec will follow. Lean on it at every step.
Before asking questions about the feature, make sure you have project context:
CLAUDE.md, AGENTS.md, GEMINI.md, README.md. This adapts the skill to whichever agent is running it (Claude Code, Codex, Gemini CLI, etc.).specs/ listing in the session context above to see which specs already exist and how they are numbered.If the $ARGUMENTS argument comes in empty, ask the user for an initial single-sentence description of what they want to build. If the description does not fit in one sentence, that is the first signal that the feature is too big — suggest splitting it before continuing.
This is the most important phase of the command. Your job here is to detect ambiguities and ask, not to assume.
Ask questions in blocks of 3 to 5 at a time (not one single question followed by another single question — that is exhausting). After each block, wait for an answer before continuing.
Question categories you should always consider:
How to phrase the questions:
AskUserQuestion), use it for these blocks instead of writing the options as prose — the user picks instead of typing. Put your recommendation first and label it. Fall back to a numbered markdown list when no such tool exists.When to stop asking:
Stop when you can answer these three questions without assuming anything:
If you still cannot answer one of them, keep asking.
Once Phase 2 is closed, decide how to write it:
If you already have all the information you need — meaning you can answer the three Phase 2 questions (which files change, what the first and last executable steps are, how to verify it is finished) without assuming anything — then do not go section by section. Write the complete spec and jump straight to Phase 4 to save the file. Do not ask for section-by-section confirmation, and do not show a draft for approval first: the user already answered everything in Phase 2, and re-asking is friction. The user reviews the saved file and asks for changes if needed.
Only if information is still missing (the user cut Phase 2 short, an answer was vague, or some section cannot be written without inventing something), develop the sections one by one, showing each one and waiting for confirmation before moving to the next.
In both cases the content follows the same order:
After each section (only in the section-by-section mode):
Common mistakes to avoid:
When the content is ready (either because you had everything, or because all sections were confirmed):
Determine the next sequential number from the specs/ listing in the session context. Take the highest existing number and add one, zero-padded to two digits. If the last one is 02-powerups.md, this one will be 03-. If specs/ is empty or missing, start at 01-.
Generate a short kebab-case slug from the objective (e.g. levels-and-highscores). See Arguments below for when $ARGUMENTS is the slug instead.
Use the date from the session context above for the **Date:** field. Never write a date you did not read from there.
Write the file directly at specs/NN-slug.md with all the sections. Do not ask for permission to write it and do not ask whether the file name works — announce the path in the final confirmation. Only ask if the target file already exists.
Mark the state as Draft by default (or the equivalent word used by the existing specs in this repo). Do not mark it as Approved automatically — the user does that once they have re-read it.
If the header lists dependencies (**Depends on:** SPEC 01), check that each referenced spec actually exists in specs/. If one does not, say so instead of writing a dangling reference.
Seed the config file if it does not exist. Check for specs/.spec-config.yml. If it is missing, create it with the default content below. If it already exists, leave it untouched — never overwrite the user's settings.
Confirm to the user:
Draft state. Change it to Approved once you have re-read it.specs/.spec-config.yml, mention it exists and that AutoCreateBranch defaults to true (set it to false to control branch creation yourself)./spec-impl NN-slug to implement it..md file at the end./spec-impl when they are ready.Be direct and specific. Do not apologize for asking. Do not use phrases like "if you don't mind..." or "could you maybe...". The user invoked this skill precisely because they want you to ask questions. Use concrete questions, one per line when there are several, and number them so they are easy to answer.
Example of a well-formed block:
Before writing the data model I need to clarify three things:
- Persistence. localStorage, IndexedDB, or a JSON file on disk? Recommendation: localStorage if the data fits in <5MB and does not need queries.
- Schema versioning. What happens when the format changes? Options: (a) version prefix in the key, (b) ignore and rebuild, (c) migrate on load.
- Privacy. Is the data sensitive? If yes, is it encrypted? Is it deleted on logout?
$ARGUMENTS is the feature description, not the file name. Treat it as the starting point for Phase 1 and derive the slug from the objective in Phase 4.
The one exception: if $ARGUMENTS is already a single kebab-case token with no spaces (e.g. /spec levels-and-highscores), it is ambiguous between a description and a slug — use it as the slug and as the seed of the description, without asking for confirmation.
If they invoked /spec without arguments, start by asking for the one-sentence description.