Skip to content
cccskills
FreePublished on GitHub

doc

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

The English summary is being prepared. Showing the original description.

Works withGitHub
See how to install

Files included (1)

  • SKILL.md6.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

/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

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Conception pipeline. Détecte le mode (epic/task/bug) selon le type d'issue ou le prompt et invoque les agents appropriés. Usage: /analyse [<issue#>] [<description>]

The English summary is being prepared. Showing the original description.

SocialGouv/egapro12Updated Oct 19, 2026

Conception pipeline for Codex. Equivalent to the repository's Claude skill: detect epic/task/bug mode, then delegate to the existing repo agents and workflows. Usage: /analyse [<issue#>] [<description>]

The English summary is being prepared. Showing the original description.

SocialGouv/egapro12Updated Oct 19, 2026

doc

Free

Documentation regeneration for Codex. Equivalent to the repository's Claude skill: regenerate user-facing docs from current code state. Usage: /doc or /doc <issue#>

The English summary is being prepared. Showing the original description.

SocialGouv/egapro12Updated Oct 19, 2026

Phase exécution. Détecte le mode (epic/task/bug) selon le type d'issue et lance le bon mécanisme : loop driver background pour epic, code-dev synchrone pour task/bug. Usage: /implement <issue#>

The English summary is being prepared. Showing the original description.

SocialGouv/egapro12Updated Oct 19, 2026

Execution pipeline for Codex. Detect epic/task/bug mode and implement with Codex models only. Usage: /implement <issue#>

The English summary is being prepared. Showing the original description.

SocialGouv/egapro12Updated Oct 19, 2026

open

Free

Worktree recreation for Codex. Equivalent to the repository's Claude skill: recreate a local worktree for a PR so it can be tested locally. Usage: /open <PR>

The English summary is being prepared. Showing the original description.

SocialGouv/egapro12Updated Oct 19, 2026

See all skills by SocialGouv

Report a problem with this skill