Automates the generation of project documentation files from code state.

Install

mkdir -p .claude/skills/doc-socialgouv && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13183" && unzip -o skill.zip -d .claude/skills/doc-socialgouv && rm skill.zip

Installs to .claude/skills/doc-socialgouv

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Régénère la documentation utilisateur (`docs/*.md`) à partir de l'état courant du code. Usage : /doc (sur la branche courante) ou /doc <issue#> (sur la branche linkée à un epic / ticket).
187 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Regenerate user documentation (`docs/*.md`) from current code state
  • Delegate documentation tasks to the `doc-writer` agent
  • Operate on the current branch for local commits
  • Operate on a ticket/epic branch for automatic commit and push
  • Compare HEAD against `origin/alpha` for changes
  • Handle dirty working trees by refusing to proceed

How it works

The skill regenerates user documentation by delegating to a `doc-writer` agent, which calculates code diffs, rewrites affected documentation files, and then commits changes locally or pushes them automatically based on the invocation mode.

Inputs & outputs

You give it
Current code state on a feature branch, or an issue number for a ticket/epic branch
You get back
Updated user documentation files (`docs/features.md`, `docs/architecture.md`, `docs/parcours-utilisateurs.md`) with local commit or automatic push

When to use doc

  • Update docs from code
  • Generate architecture docs
  • Document feature updates

About this skill

/doc

Régénération de la documentation utilisateur du repo. Le skill délègue à l'agent doc-writer qui réécrit docs/features.md, docs/architecture.md, et docs/parcours-utilisateurs.md à partir de l'état courant du code.

Le skill est l'entrée humaine ; l'entrée orchestrée (en fin d'epic) passe par scripts/orchestration/run_doc_writer.sh invoqué directement depuis epic_loop.sh.

Mode d'invocationComportement
/doc sans argumentTourne sur la branche courante. Compare HEAD vs origin/alpha. Commit local seulement — l'humain pousse lui-même.
/doc <issue#>Tourne sur la branche d'un ticket / epic. Si <issue#> est un epic, opère sur origin/epic/<N>. Sinon opère sur la branche linkée à l'issue (sidebar Development). Commit + push automatique.

Step 0 — Pré-conditions

Refuser si :

  • Le working tree est dirty (git status --porcelain non-vide) → demander à l'humain de commit/stash d'abord
  • La branche courante est alpha ou master directement → la doc est régénérée sur les branches feature, pas sur la branche stable
if [ -n "$(git status --porcelain)" ]; then
    echo "Working tree dirty — commit ou stash d'abord."
    exit 1
fi

CURRENT=$(git branch --show-current)
if [ "$CURRENT" = "alpha" ] || [ "$CURRENT" = "master" ]; then
    echo "Refus : /doc ne tourne pas directement sur $CURRENT. Crée une branche dédiée."
    exit 1
fi

Step 1 — Résoudre la branche cible

Sans argument

Branche cible = branche courante. Base de comparaison = origin/alpha.

git fetch origin alpha --quiet
TARGET_BRANCH=$(git branch --show-current)
BASE_BRANCH=alpha
EPIC_N=null
PUSH_AUTO=false  # commit local, l'humain push lui-même

Avec un argument <issue#>

ISSUE_N="${ARGUMENTS%% *}"; ISSUE_N="${ISSUE_N#\#}"

ISSUE_TYPE=$(gh issue view "$ISSUE_N" --json issueType --jq '.issueType.name')

if [ "$ISSUE_TYPE" = "Feature" ]; then
    # Epic → tourne sur la branche d'intégration
    TARGET_BRANCH="epic/$ISSUE_N"
    BASE_BRANCH=alpha
    EPIC_N="$ISSUE_N"
else
    # Task / Bug → trouver la branche linkée à l'issue
    TARGET_BRANCH=$(gh api graphql -f query='
        query($owner:String!, $repo:String!, $n:Int!) {
          repository(owner:$owner, name:$repo) {
            issue(number:$n) {
              linkedBranches(first:5) { nodes { ref { name } } }
            }
          }
        }' -f owner=SocialGouv -f repo=egapro -F n=$ISSUE_N \
        --jq '.data.repository.issue.linkedBranches.nodes[0].ref.name // empty')

    if [ -z "$TARGET_BRANCH" ]; then
        echo "Aucune branche linkée à l'issue #$ISSUE_N."
        exit 1
    fi

    # Base = parent epic si l'issue est sub-issue d'un epic, sinon alpha
    PARENT=$(gh api graphql -f query='...parent...' --jq '.parent.number // empty')
    if [ -n "$PARENT" ]; then
        BASE_BRANCH="epic/$PARENT"
    else
        BASE_BRANCH=alpha
    fi
    EPIC_N="${PARENT:-null}"
fi

PUSH_AUTO=true
git fetch origin "$TARGET_BRANCH" "$BASE_BRANCH" --quiet
git checkout "$TARGET_BRANCH"
git pull --ff-only origin "$TARGET_BRANCH"

Step 2 — Invoquer l'agent doc-writer

Inputs à passer à l'agent (via le prompt de subagent) :

  • epic : $EPIC_N (ou null)
  • branch : $TARGET_BRANCH
  • base_branch : $BASE_BRANCH
  • mode : pipeline si PUSH_AUTO=true, skill sinon
  • worktree : . (skill = repo courant ; pas de worktree dédié)

L'agent suit .claude/agents/doc-writer/AGENT.md :

  1. Calcule le diff <base>...HEAD
  2. Heuristique no-op : si rien de fonctionnel n'a changé → retour no_changes
  3. Sinon : régénère from scratch les fichiers docs/*.md impactés
  4. Commit
  5. Push si mode=pipeline, sinon laisse le commit local

L'agent retourne un JSON strict (4 cas possibles, voir AGENT.md).


Step 3 — Parser le JSON retourné

.statusActionMarkdown affiché
updated(mode skill) signaler le commit local non poussé ; (mode pipeline) signaler le push## Doc: UPDATED + liste des fichiers + sha
no_changesaucune## Doc: NO_CHANGES + reason
rate_limitedproposer de retenter dans retry_in secondes## Doc: RATE_LIMITED
failedpropager l'erreur## Doc: FAILED + raison

Si notes est présent dans le JSON, l'afficher tel quel à l'humain (ex : "couverture insuffisante, envisager docs/api-publique.md").

En mode skill (commit local), terminer le message par :

Le commit a été créé localement. Relis le diff (`git show HEAD`) et push avec `git push` quand tu es prêt.

Quand utiliser /doc

  • Hotfix sur alpha direct : non, refusé par Step 0.
  • Branche feature standalone (sans epic) : /doc (sans arg) — utile après une grosse refacto.
  • Sub-task d'un epic : /doc <ticket#> ou laisse epic_loop.sh invoquer doc-writer automatiquement à la fin de l'epic. Cumul possible mais redondant.
  • Avant d'ouvrir une PR feature manuelle : /doc → relit le commit doc → push avec le reste.
  • Régénération forcée : invoquer /doc <epic#> après un merge important sur alpha pour resynchroniser le wiki dans la foulée.

Quand NE PAS utiliser /doc

  • Sur alpha ou master → refusé
  • Quand le diff vs base est uniquement du code de tests / CI / scripts d'orchestration → l'agent retournera no_changes de toutes façons, autant ne pas le lancer
  • Sur une branche en cours de travail (working tree dirty) → refusé

Référence

  • Agent : .claude/agents/doc-writer/AGENT.md
  • Script orchestration (mode pipeline) : scripts/orchestration/run_doc_writer.sh
  • Workflow GitHub Action de sync wiki : .github/workflows/sync-docs-to-wiki.yaml
  • Décision architecturale : voir mémoire project_doc_system

When not to use it

  • When operating directly on `alpha` or `master` branches
  • When the diff versus base only contains test code, CI, or orchestration scripts

Limitations

  • Refuses to run on `alpha` or `master` branches directly
  • Refuses to run with a dirty working tree
  • Does not regenerate documentation if only test code, CI, or orchestration scripts have changed

How it compares

This skill automates the regeneration of specific user documentation files based on the current code state, integrating with a `doc-writer` agent and handling different Git branch workflows, which is more structured than manual documentatio

Compared to similar skills

doc side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
doc (this skill)03moReviewIntermediate
ml-paper-writing486moReviewAdvanced
docs-review107moNo flagsBeginner
claude-md-improver216moReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

ml-paper-writing

davila7

Write publication-ready ML/AI papers for NeurIPS, ICML, ICLR, ACL, AAAI, COLM. Use when drafting papers from research repos, structuring arguments, verifying citations, or preparing camera-ready submissions. Includes LaTeX templates, reviewer guidelines, and citation verification workflows.

4897

docs-review

metabase

Review documentation changes for compliance with the Metabase writing style guide. Use when reviewing pull requests, files, or diffs containing documentation markdown files.

1085

claude-md-improver

anthropics

Audit and improve CLAUDE.md files in repositories. Use when user asks to check, audit, update, improve, or fix CLAUDE.md files. Scans for all CLAUDE.md files, evaluates quality against templates, outputs quality report, then makes targeted updates. Also use when the user mentions "CLAUDE.md maintenance" or "project memory optimization".

2167

write-docs

tldraw

Writing SDK documentation for tldraw. Use when creating new documentation articles, updating existing docs, or when documentation writing guidance is needed. Applies to docs in apps/docs/content/.

665

update-docs

vercel

This skill should be used when the user asks to "update documentation for my changes", "check docs for this PR", "what docs need updating", "sync docs with code", "scaffold docs for this feature", "document this feature", "review docs completeness", "add docs for this change", "what documentation is affected", "docs impact", or mentions "docs/", "docs/01-app", "docs/02-pages", "MDX", "documentation update", "API reference", ".mdx files". Provides guided workflow for updating Next.js documentation based on code changes.

2543

wiki-architect

microsoft

Analyzes code repositories and generates hierarchical documentation structures with onboarding guides. Use when the user wants to create a wiki, generate documentation, map a codebase structure, or understand a project's architecture at a high level.

1144

Search skills

Search the agent skills registry