Créer spécification et branche de fonctionnalité

VérifiéPrudence

Générer une spécification et une branche pour une nouvelle fonctionnalité Spendly, avec un workflow structuré : opérations git, analyse des arguments, recherche dans le code.

Spar Skills Guide Bot
DeveloppementIntermédiaire
22/07/2026
Claude Code
#git-workflow#spec-writing#feature-branch#project-scaffolding#slash-command

Recommandé pour

Synthèse automatique

Commande Claude Code qui prépare le prochain incrément du projet Spendly : vérification de l'arbre Git, création d'une branche feature et rédaction d'un fichier de spec structuré dans `.claude/specs/`.

Points forts

  • Enchaîne un workflow Git rigoureux : refus de démarrer si le répertoire n'est pas propre, mise à jour de main, nommage de branche avec suffixe anti-collision
  • Normalise les arguments (numéro d'étape zéro-paddé, slug kebab-case limité à 40 caractères) et demande une clarification plutôt que de deviner
  • Explore le code existant (CLAUDE.md, modèles FastAPI, specs précédentes, pages React, tokens CSS) avant d'écrire, et alerte si l'étape est déjà réalisée
  • Impose un gabarit de spec strict avec une section Design exigeante qui réutilise les variables CSS existantes au lieu d'inventer de nouvelles couleurs

Limites

  • Fortement couplé à l'arborescence de Spendly (`backend/app/`, `frontend/src/`, `CLAUDE.md`) : inutilisable tel quel sur un autre dépôt
  • Ne produit que la branche et le document de spec, aucun code d'implémentation
  • La qualité de la section Design dépend entièrement de l'invocation de la skill `frontend-design`, non fournie ici
Quand l'utiliser

À utiliser au démarrage de chaque nouvelle étape planifiée du roadmap Spendly, quand l'arbre de travail est propre et que l'on veut cadrer le travail avant de coder.

Quand l'éviter

À éviter sur un projet dont la structure de fichiers ou le roadmap diffère de Spendly, ou lorsque l'on veut directement écrire du code sans passer par une spec.

Analyse de sécurité

Prudence
Score qualité85/100

The skill is a routine git-workflow + spec-writing helper. Its only execution surface is `Bash(git:*)` used for status, branch listing, checkout, pull and branch creation, plus Write for a new spec file. There is no exfiltration, no destructive deletion, no obfuscation and no safety-disabling instruction. It earns 'caution' rather than 'safe' only because it performs repository-mutating git operations (checkout main, pull from origin) where a fast-forward pull or branch checkout could surprise a user; the clean-tree gate mitigates the worst case but the skill does not confirm the remote or show a diff before pulling.

Points d'attention
  • •Runs `git checkout main` and `git pull origin main`, which mutate local repository state and can overwrite/fast-forward branches; only protection is a clean-worktree check (untracked/unstaged guard), no confirmation of the pull remote.
  • •Runs `git checkout -b` and an existence check via `git branch` — creates branches, benign but state-changing.
  • •Writes a new spec file into `.claude/specs/` via Write tool — scoped, not destructive.
  • •No curl|sh, no `rm -rf`, no base64 payloads, no credential/token handling or outbound data transfer; reads only local project files (backend/frontend sources, CLAUDE.md).
Comment cette analyse est faite

Exemples

Start step 2
2 registration
Feature with multiple flows
4 login and logout
Later roadmap step
11 budgets and categories

description: Create a spec file and feature branch for the next Spendly step argument-hint: "Step number and feature name e.g. 2 registration" allowed-tools: Read, Write, Glob, Bash(git:*)

You are a senior developer spinning up a new feature for the Spendly expense tracker. Always follow the rules in CLAUDE.md.

User input: $ARGUMENTS

Step 1 — Check working directory is clean

Run git status and check for uncommitted, unstaged, or untracked files.

If any exist, stop immediately and tell the user to commit or stash changes before proceeding.

DO NOT CONTINUE until the working directory is clean.


Step 2 — Parse the arguments

From $ARGUMENTS extract:

  1. step_number

    • Zero-pad to 2 digits.

    • Example:

      • 2 → 02
      • 11 → 11
  2. feature_title

    • Human-readable title in Title Case.

    • Examples:

      • Registration
      • Login and Logout
  3. feature_slug

    • Git and filename safe.

    • Lowercase kebab-case.

    • Only:

      • a-z
      • 0-9
      • -
    • Maximum 40 characters.

    • Examples:

      • registration
      • login-logout
  4. branch_name Format:

    feature/<feature_slug>
    

    Example:

    feature/registration
    

If these cannot be inferred from $ARGUMENTS, ask the user for clarification before proceeding.


Step 3 — Check branch name

Run:

git branch

If the desired branch already exists, append a number:

feature/registration-01
feature/registration-02
...

Step 4 — Update main

Run:

git checkout main
git pull origin main

Step 5 — Create feature branch

Run:

git checkout -b <branch_name>

Step 6 — Research the codebase

Read these files before writing the spec:

  • CLAUDE.md
  • backend/app/main.py, backend/app/models.py, backend/app/schemas.py
  • Every file inside .claude/specs/
  • The frontend/src/pages/ and frontend/src/components/ files most relevant to this feature, plus frontend/src/index.css for existing design tokens

Use them to:

  • Understand the roadmap.
  • Follow existing conventions (FastAPI + SQLAlchemy + Pydantic backend, React + TypeScript frontend — see CLAUDE.md for the full architecture; this is not a Flask/Jinja app).
  • Avoid duplicate specs.
  • Verify the current database schema.

Check CLAUDE.md and .claude/specs/ to confirm the requested step is not already completed.

If it is already marked complete:

  • Warn the user.
  • Stop immediately.

Step 7 — Write the spec

Generate a spec document with this exact structure.


Spec: <feature_title>

Overview

One paragraph describing what this feature does and why it exists at this stage of the Spendly roadmap.

Design

Required whenever this feature adds or changes any UI (skip only if the feature is purely backend/data with no frontend changes — write No UI changes. instead).

The bar is: would a real user notice and like this, unprompted? A good product is one that attracts and holds people — not one that merely works. Never write a Design section that a bored engineer would produce by default (a generic card grid, a plain progress bar, an unstyled table dump). Always invoke the frontend-design skill's own planning process to produce this section — do not freehand it — and hold its output to its own anti-genericness bar: no cookie-cutter SaaS-dashboard filler, no numbered 01/02/03 markers unless the content is genuinely sequential, no decoration that doesn't serve this specific feature's content.

Format as:

  • Palette — named colors mapped to existing CSS variables (e.g. Primary accent → var(--accent)). Do not introduce new hex values; reuse tokens already defined in frontend/src/index.css.
  • Typography — role → font mapping, reusing var(--font-display) / var(--font-body) per role (display heading, body text, captions/data).
  • Layout — a one-sentence layout concept plus a small ASCII wireframe of the new/changed UI.
  • Signature — the one deliberate, memorable detail this feature's UI should be remembered by, consistent with Spendly's existing ledger/passbook aesthetic (serif display headings, hairline borders, green/terracotta accents). This must be specific to what this feature actually does, not a generic flourish — if you can picture the same "signature" applying unchanged to a different feature, it isn't specific enough yet.

Before finalizing this section, self-check it against the anti-defaults in the frontend-design skill (warm-cream-serif, near-black-neon-accent, broadsheet-hairline are defaults, not choices, when applied regardless of subject) and revise anything that reads as the generic answer rather than a decision made for this feature.

Depends on

Which previous steps this feature requires.

Routes

List every new route.

Format:

  • METHOD /path — description — access level

Access level:

  • Public
  • Logged-in

If none:

No new routes.

Database changes

Verify against backend/app/models.py (SQLAlchemy models) — this app uses SQLAlchemy, not raw SQL.

Describe:

  • New tables
  • New columns
  • Constraints
  • Indexes

If none:

No database changes.

Frontend components

Create

List every new React component/page file (frontend/src/pages/ or frontend/src/components/).

Modify

List every existing component/page that needs changes and explain what changes.

Files to change

Every existing file that must be modified (backend and frontend).

Files to create

Every new file required (backend and frontend).

New dependencies

List any required backend (backend/requirements.txt) or frontend (frontend/package.json) packages.

If none:

No new dependencies.

Rules for implementation

Claude must always follow these rules:

Backend

  • SQLAlchemy ORM + Pydantic schemas — never raw SQL string-formatting (parameterised queries are handled by the ORM already).
  • Passwords must always be hashed using Werkzeug's generate_password_hash/check_password_hash (see backend/app/security.py).
  • Every route declares a Pydantic response_model — never return a raw dict.
  • DB access belongs in backend/app/crud.py, never inline in routers.
  • Reuse existing helper functions whenever possible.
  • Keep code modular and maintainable.

Frontend

  • Never settle for the first, most obvious layout. Boring is a failure mode here, not a safe default — a spec that ships a plain form/table/card grid with no point of view is the thing to avoid, not the thing to fall back on when unsure. If the Design section above wouldn't make someone stop and look twice, redo it before moving on to markup.
  • Whenever implementation of this spec is requested and it touches any component or UI, always invoke the built-in frontend-design skill before writing component/CSS code. This applies every time — not just once per spec, and not only when the user asks for it. Use it to fill in and refine the Design section above and to guide the actual markup/CSS.
  • Build React function components under frontend/src/pages/ (routes) or frontend/src/components/ (reusable pieces) — this is a React + TypeScript app, not server-rendered templates. New pages get wired into App.tsx's <Routes>.
  • Use CSS variables only (from frontend/src/index.css). Never hardcode hex color values.
  • Build every page as production-ready, not as a prototype.
  • Every page must have a clean, distinctive, responsive, professional UI that a real user would find inviting to use — attractiveness is a requirement, not a nice-to-have.
  • Maintain consistent spacing, typography, colors, border radius, shadows, and component styling throughout the application, matching Spendly's existing ledger/passbook aesthetic rather than introducing a new unrelated look.
  • Use reusable UI components whenever possible.

Layout & Responsiveness

  • Every page must remain visually appealing regardless of how much content is displayed.
  • Design layouts to scale for future growth.
  • Assume pages may eventually contain hundreds or thousands of records.
  • Never place large amounts of content directly onto the page without proper structure.
  • Use responsive containers, cards, grids, sections, and spacing.
  • Tables must be responsive and support scrolling or pagination where appropriate.
  • Long lists should remain readable and well-organized.
  • Forms should have proper spacing and alignment.
  • Ensure all pages work well on desktop, tablet, and mobile devices.

User Experience

  • Use modern UI patterns where appropriate:

    • Cards
    • Dashboards
    • Search bars
    • Filters
    • Pagination
    • Empty states
    • Loading states
    • Confirmation dialogs
    • Success/error notifications
    • Responsive tables
    • Well-designed forms
  • Forms should include clear validation messages.

  • Avoid cluttered interfaces.

  • Prioritize readability, accessibility, and usability.

  • If a page displays data, design it so future additions do not require redesigning the layout.

  • Every new page should feel polished and production-ready.

Definition of done

Provide a checklist where every item can be verified by running the application.


Step 8 — Save the spec

Save the generated spec to:

.claude/specs/<step_number>-<feature_slug>.md

Step 9 — Report

Print only this summary:

Branch:    <branch_name>
Spec file: .claude/specs/<step_number>-<feature_slug>.md
Title:     <feature_title>

Then print:

Review the spec at .claude/specs/<step_number>-<feature_slug>.md then enter Plan Mode with Shift+Tab twice to begin implementation. Note: when implementation touches any UI, the frontend-design skill will be invoked automatically before component/CSS code is written.

Do not print the full spec in chat unless explicitly asked.

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/create-feature-spec-and-branch-mrwakev2/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/create-feature-spec-and-branch-mrwakev2' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/create-feature-spec-and-branch-mrwakev2/download' --output '.skill-downloads/create-feature-spec-and-branch-mrwakev2/SKILL.md.part' && mv '.skill-downloads/create-feature-spec-and-branch-mrwakev2/SKILL.md.part' '.skill-downloads/create-feature-spec-and-branch-mrwakev2/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Outils déclarés par l’auteur (à vérifier dans votre agent) : Read, Write, Glob, Bash(git:*)

Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Le fichier ne fournit pas un en-tête name/description exploitable pour cette procédure native. Le téléchargement reste disponible pour lecture ; utilisez le mode manuel ci-dessous.

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/create-feature-spec-and-branch-mrwakev2/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires