cvg-spawn : envelopper les travailleurs générés

VérifiéPrudence

Ajoute un wrapper de cycle de vie (enregistrement, battement de cœur, retrait) aux briefs des travailleurs générés pour qu'ils restent visibles dans le démon Convergio.

Spar Skills Guide Bot
DevOpsIntermédiaire
24/07/2026
Claude Code
#subagent-orchestration#agent-registry#heartbeat#observability#claude-code

Recommandé pour

Synthèse automatique

Génère un bloc bash de cycle de vie (enregistrement, heartbeat, retrait) à insérer en tête du brief d'un worker lancé via l'outil Task, afin qu'il reste visible dans le registre d'agents du daemon Convergio.

Points forts

  • Produit un identifiant unique de sous-agent dérivé du slug de la tâche et de 8 caractères hexadécimaux
  • Inclut les contrôles de budget de contexte avant et pendant le travail (scripts/check-context-budget.sh)
  • Gère les modes subagent et background avec des cadences de heartbeat distinctes (5 min vs 60 s)
  • Idempotent : l'enregistrement est un upsert, le skill peut être relancé sans risque

Limites

  • Ne réalise lui-même aucune requête : il ne fait que restituer le boilerplate que l'agent parent doit coller dans le brief
  • Dépend du daemon Convergio et des scripts du dépôt (check-context-budget.sh, endpoints /v1/agent-registry)
  • Inutile pour les helpers en lecture seule (recherche, question ponctuelle)
Quand l'utiliser

À invoquer juste avant un appel à l'outil Task lorsqu'un sous-agent ou agent d'arrière-plan va modifier des fichiers, lancer des tests, pousser des branches ou ouvrir des PR.

Quand l'éviter

Ne pas l'utiliser pour des helpers en lecture seule ou en dehors d'un dépôt instrumenté par le daemon Convergio.

Analyse de sécurité

Prudence
Score qualité80/100

No destructive, exfiltration, or obfuscated payloads are present; the skill mainly renders text and runs a local helper script. It does rely on Bash and causes spawned workers to make registry/audit HTTP calls, which is a powerful but clearly intentional and non-abusive pattern. Rated caution rather than safe because it shells out to an unshown script and triggers network/registry writes via a downstream agent.

Points d'attention
  • •Declares and uses Bash to execute a sibling script (cvg-spawn.sh) whose contents are not shown in SKILL.md; auditability depends on that script.
  • •The rendered block instructs spawned workers to POST to /v1/agent-registry/... endpoints and to run ./scripts/check-context-budget.sh, delegating network/registry side effects to another agent without specifying host/base URL.
  • •Provides a deterministic seam via CONVERGIO_SPAWN_HEX (legitimate for tests, but an environment-controlled input to id generation).
Comment cette analyse est faite

Exemples

Wrap a refactor subagent
Spawn a subagent to refactor the auth module and run the test suite — wrap it with /cvg-spawn first so it registers in the daemon
Background migration worker
/cvg-spawn --mode background database migration cleanup, then launch it as a background Task
Pre-flight check before Task
Before calling Task to open a PR for the logging fix, run /cvg-spawn with the description 'logging fix PR' and paste the rendered block into the brief

name: cvg-spawn version: 1.0.0 description: | Wrap spawned-worker briefs (subagent or background agent) with auto-register + heartbeat boilerplate so they stay visible in the Convergio daemon. Use this when invoking the Task tool for code-mutating work in this repo. allowed-tools:

  • Bash triggers:
  • cvg-spawn
  • spawn subagent preamble-tier: 4

/cvg-spawn — wrap a spawned worker brief with Convergio auto-register

Why this skill exists

Claude Code spawned helpers (subagents and background agents launched via the parent's Task tool) run in a different harness from the top-level session. The SessionStart hook in .claude/settings.json therefore does not fire for them — they would silently disappear from the daemon's agent registry, which means:

  • cvg agent list cannot see them.
  • The TUI dashboard cannot colour-code them.
  • cvg coherence agents cannot detect zombies.
  • Audit cannot prove who did what.

/cvg-spawn solves this by emitting the canonical 3-step lifecycle wrapper (register → work → retire) plus a heartbeat reminder. The parent agent prepends the rendered block to every spawned-worker brief that contains code-mutating work in this repository.

When to invoke

The parent (top-level) agent should invoke /cvg-spawn immediately before calling the Task tool, then paste the rendered block into the head of the spawned worker's brief.

You do not need to invoke /cvg-spawn for read-only helpers (pure search, single-shot question answering). Invoke it whenever the spawned worker will edit files, run tests, push branches, or open PRs.

What this skill renders

The skill produces three deterministic outputs (and is safe to re-run: agent registration is an upsert):

  1. A unique subagent_id of the form subagent-${TASK_DESC_SLUG}-${HEX8} where:
    • TASK_DESC_SLUG = first 24 chars of the task description, lower-cased, spaces replaced with -, non-alnum stripped.
    • HEX8 = 8 random hex chars (openssl rand -hex 4).
  2. A bash block to prepend to the spawned-worker brief:
    • line 1: SUBAGENT_ID="subagent-<slug>-<hex8>" (or subagent-bg-... in background mode)
    • line 2: CVG_SPAWN_MODE="subagent"|"background"
    • line 3: budget pre-check — ./scripts/check-context-budget.sh refuses only on hard caps (exit 1). Soft warnings (exit 2) are advisory.
    • line 4: register POST to /v1/agent-registry/agents with kind=subagent and metadata.spawn_mode.
    • line 5: heartbeat POST to /v1/agent-registry/agents/${SUBAGENT_ID}/heartbeat.
    • line 6: # heartbeat every 5 min (subagent) or # heartbeat every 60 s (background)
    • line 7: budget mid-flight reminder — re-run check-context-budget.sh every ~200 LOC so the worker does not push past cap on push.
    • line 8: # ... do work ...
    • line 9: retire POST to /v1/agent-registry/agents/${SUBAGENT_ID}/retire.
  3. A one-line confirmation summary the parent prints back to the user before launching the helper: Subagent <id> will be registered as kind=subagent (mode=...).

Execution

# default (subagent)
bash "$(dirname "$0")/cvg-spawn.sh" <task-description>

# background helper spawned via Task tool background mode
bash "$(dirname "$0")/cvg-spawn.sh" --mode background <task-description>

<task-description> is the short human-readable label the parent will pass into the Task tool's description field. The skill slug-ifies it to seed the subagent id.

If CONVERGIO_SPAWN_HEX is set (used by the integration smoke test), the skill uses it verbatim instead of generating fresh random bytes — that is the only deterministic seam.

Output contract

| Stream | Content | |---|---| | stdout | The wrapper bash block (no leading blank line) followed by the one-line summary on its own line | | stderr | Empty on success; one-line error on bad usage | | exit | 0 on success, 2 on missing argument or invalid --mode |

The skill performs no network I/O. It only renders text. The register / heartbeat / retire calls fire when the spawned worker actually runs the rendered block.

Why kind=subagent

The agent registry kind field is a permissive lower-case string (see convergio-durability::store::agent_validation). Existing top-level sessions register as kind=claude or kind=copilot. Subagents register as kind=subagent so:

  • The TUI dashboard can render them with reduced visual weight (smaller indent, gray accent).
  • cvg coherence agents can decide whether to count them as PR-author candidates (a subagent normally is not the PR author — its parent is).
  • Audit rows distinguish "I, the human-driven session, did this" from "I, a tool-spawned helper, did this".

The list of recognised kinds lives in docs/multi-agent-operating-model.md under "Subagent lifecycle".

Relation to /cvg-attach

/cvg-attach registers the top-level Claude Code session at session start (the SessionStart hook calls it). /cvg-spawn generates a wrapper for spawned helpers (subagents and background agents) launched mid-session via the Task tool. The two skills do not overlap — they cover the distinct harnesses in which Claude Code can run.

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/cvg-spawn-wrap-spawned-workers-with-auto-register-mryiqgzx/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/cvg-spawn-wrap-spawned-workers-with-auto-register-mryiqgzx' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/cvg-spawn-wrap-spawned-workers-with-auto-register-mryiqgzx/download' --output '.skill-downloads/cvg-spawn-wrap-spawned-workers-with-auto-register-mryiqgzx/SKILL.md.part' && mv '.skill-downloads/cvg-spawn-wrap-spawned-workers-with-auto-register-mryiqgzx/SKILL.md.part' '.skill-downloads/cvg-spawn-wrap-spawned-workers-with-auto-register-mryiqgzx/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.

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

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/cvg-spawn-wrap-spawned-workers-with-auto-register-mryiqgzx/SKILL.md' && test -s '.skill-downloads/cvg-spawn-wrap-spawned-workers-with-auto-register-mryiqgzx/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/cvg-spawn' && cp -R '.skill-downloads/cvg-spawn-wrap-spawned-workers-with-auto-register-mryiqgzx' '.claude/skills/cvg-spawn'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/cvg-spawn-wrap-spawned-workers-with-auto-register-mryiqgzx'

openskills read 'cvg-spawn-wrap-spawned-workers-with-auto-register-mryiqgzx'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

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/cvg-spawn-wrap-spawned-workers-with-auto-register-mryiqgzx/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