Synthèse automatique
Cette compétence orchestre une partie de Puissance 4 entre deux agents IA (Bleu et Rouge) sur un plateau 6x7, en utilisant la fonctionnalité expérimentale de teams d'agents de Claude Code.
Points forts
- Démonstration pratique de l'orchestration multi-agents avec Claude Code
- Validation rigoureuse des coups et détection automatique des victoires
- Interface visuelle claire du plateau après chaque coup
- Gestion des erreurs et des coups invalides
Limites
- Nécessite la fonctionnalité expérimentale Agent Teams activée manuellement
- Les agents peuvent parfois proposer des coups invalides, nécessitant un renvoi
- Pas de mode solo ou contre l'ordinateur ; deux agents uniquement
Lorsque vous souhaitez vous divertir en observant deux agents IA jouer au Puissance 4, ou pour tester les capacités d'orchestration multi-agents de Claude Code.
Si vous cherchez un jeu rapide ou contre un adversaire humain, car le match repose entièrement sur des agents IA et peut être lent ou imprévisible.
Analyse de sécurité
SûrThe skill only uses Bash to check an environment variable, and all other tools are for creating/managing agents to play a game. No destructive or exfiltrating actions are instructed.
Aucun point d'attention détecté
Comment cette analyse est faiteExemples
let's play Connect Four玩四子棋四目並べで遊ぼうname: connect-four description: This skill should be used when the user says "来一盘四子棋", "我要玩四子棋", "玩四子棋", "四连棋", "コネクトフォーで遊ぼう", "四目並べ", "play Connect Four", "let's play Connect Four", "start a Connect Four game", or any request in any language to play a game of Connect Four / 四子棋 / 四目並べ. version: 0.1.0 allowed-tools: Bash, TeamCreate, TaskCreate, TaskUpdate, Agent, SendMessage, TeamDelete
Connect Four Skill
Two AI agents — Blue and Red — play Connect Four on a 6×7 board. You (team-lead) orchestrate the game, display the board after every move, and referee the result.
Step 1 — Prerequisites Check
Run this Bash command:
printenv CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS
If the output is NOT exactly 1, output the following message and stop immediately (do not proceed to any further steps):
⚠️ Connect Four requires the experimental Agent Teams feature.
To enable it, add the following to the "env" section of ~/.claude/settings.json:
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
Then restart Claude Code and try again.
Step 2 — Create the Team
Call TeamCreate with:
team_name:"connect-four"description:"Connect Four — Blue vs Red"
Step 3 — Spawn Both Player Agents (in parallel)
In a single message, make two Agent tool calls simultaneously:
Call 1 — blue-player:
subagent_type:"general-purpose"team_name:"connect-four"name:"blue-player"prompt: (see Appendix A below)
Call 2 — red-player:
subagent_type:"general-purpose"team_name:"connect-four"name:"red-player"prompt: (see Appendix B below)
Step 4 — Initialize the Board
The board is a 42-character flat string (6 rows × 7 columns, row-major, top to bottom):
.= empty cellB= blue pieceR= red piece- Cell index formula:
index = row * 7 + col(row 0 = top row, row 5 = bottom row; col 0..6 = left..right) - Column numbers shown to users: 1–7 (col_index = column_number − 1)
Initial board: ".........................................." (exactly 42 dots)
Render and display the initial empty board to the user (see Board Rendering below), then proceed to the game loop.
Step 5 — Game Loop
Track these variables:
board— the current 42-char board stringmove_count— starts at 0, increments each movecurrent_player— starts as"blue-player"current_piece— starts as"B"(blue goes first)last_move_description— starts as"Game start"
Repeat the following until game_over:
5a — Send board to current player
Call SendMessage with:
type: "message"
recipient: <current_player>
content:
BOARD: <42-char board string>
TURN: <move_count>
YOUR_PIECE: <current_piece>
OPPONENT_PIECE: <R if current_piece is B, else B>
LAST_MOVE: <last_move_description>
summary: "Your turn — choose column 1-7"
5b — Receive and parse the response
The player's reply will arrive automatically. Extract from the content:
MOVE: N— the column chosen (1–7)BOARD: <42-char string>— the updated board after placing their piece
5c — Validate the move
Check:
- The new board string is exactly 42 characters.
- The new board has exactly one more occurrence of
current_piececompared to the old board. - All other characters are unchanged.
If validation fails, re-send the original board with an error note:
ERROR: Your board update was invalid. Please re-read the rules and try again.
BOARD: <original 42-char board>
TURN: <move_count>
YOUR_PIECE: <current_piece>
OPPONENT_PIECE: <opponent_piece>
LAST_MOVE: <last_move_description>
5d — Update state and render
Set board to the new board string.
Set last_move_description to "Blue played column N" or "Red played column N".
Increment move_count.
Render the board for the user (see Board Rendering below), including the move description.
5e — Check for win
After each move, check whether current_piece has four in a row anywhere on the board.
Use the index formula board[row*7+col].
Horizontal (4 checks per row, 6 rows = 24 checks):
For r = 0..5, c = 0..3:
→ win if board[r7+c], board[r7+c+1], board[r7+c+2], board[r7+c+3] are all current_piece
Vertical (3 starting rows per column, 7 columns = 21 checks):
For r = 0..2, c = 0..6:
→ win if board[r*7+c], board[(r+1)*7+c], board[(r+2)*7+c], board[(r+3)*7+c] are all current_piece
Diagonal ↘ (down-right, 3 rows × 4 starting cols = 12 checks):
For r = 0..2, c = 0..3:
→ win if board[r*7+c], board[(r+1)*7+c+1], board[(r+2)*7+c+2], board[(r+3)*7+c+3] are all current_piece
Diagonal ↙ (down-left, 3 rows × 4 starting cols = 12 checks):
For r = 0..2, c = 3..6:
→ win if board[r*7+c], board[(r+1)*7+c-1], board[(r+2)*7+c-2], board[(r+3)*7+c-3] are all current_piece
If any check passes → win detected, proceed to Step 6.
5f — Check for draw
If move_count == 42 and no win was detected → draw, proceed to Step 6.
5g — Rotate player
Swap:
current_player:"blue-player"↔"red-player"current_piece:"B"↔"R"
Continue the loop.
Board Rendering
To display the board after each move, convert the 42-char string to a visual grid:
Character mapping:
.→⚪B→🔵R→🔴
Format (output this to the user):
1 2 3 4 5 6 7
+---------------------+
| ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ | ← row 0 (chars 0–6)
| ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ | ← row 1 (chars 7–13)
| ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ | ← row 2 (chars 14–20)
| ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ | ← row 3 (chars 21–27)
| ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ | ← row 4 (chars 28–34)
| ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ | ← row 5 (chars 35–41)
+---------------------+
Move N — 🔵 Blue played column 4
Next: 🔴 Red's turn
For the initial board, omit the "Move" and "Next" lines and instead print: 🎮 Game started! 🔵 Blue goes first.
Step 6 — End the Game
Display the final board (rendered), then announce the result:
- Blue win:
🎉 Game over! 🔵 Blue wins in N moves! - Red win:
🎉 Game over! 🔴 Red wins in N moves! - Draw:
🤝 Game over! It's a draw — the board is full!
Cleanup
Send shutdown requests to both players in parallel (single message, two SendMessage calls):
SendMessage type="shutdown_request" recipient="blue-player" content="Game over, thanks for playing!"
SendMessage type="shutdown_request" recipient="red-player" content="Game over, thanks for playing!"
After both shutdown_response messages are received, call TeamDelete.
Appendix A — blue-player Prompt
Use this verbatim as the prompt parameter when spawning blue-player:
You are blue-player in a Connect Four game, part of team "connect-four". Your piece color is BLUE, represented as the character 'B'.
## Your Role
You wait for messages from team-lead. Each message contains the current board state and asks you to make a move. You choose a column, place your piece, and reply with the updated board.
## Board Format
The board is a 42-character string (6 rows × 7 columns, row-major, top to bottom).
- Index formula: position = row * 7 + col (row 0 = top, row 5 = bottom; col 0 = leftmost, col 6 = rightmost)
- Characters: '.' = empty, 'B' = blue piece, 'R' = red piece
- Columns are numbered 1–7 for humans (col_index = column_number - 1)
## When You Receive a Message
team-lead will send you a message containing lines like:
BOARD: <42-char string>
YOUR_PIECE: B
OPPONENT_PIECE: R
Do the following:
1. Parse the 42-character board string carefully.
2. Decide which column (1–7) to play. Use strategic reasoning:
- If the opponent has 3 in a row with an open end, block it immediately.
- If you have 3 in a row with an open end, complete it for the win.
- Otherwise, prefer the center column (4), then adjacent columns.
3. Determine the target cell: scan rows 5 down to 0 in your chosen column (col_index = column - 1). The first '.' you find is where your piece lands. If the entire column is full (no '.'), pick a different column.
4. Replace that '.' with 'B' in the 42-char string. All other characters must remain identical.
5. Double-check: your new board string is exactly 42 characters and contains exactly one more 'B' than the original.
## How to Respond
After deciding your move, send a message back to team-lead using SendMessage:
type: "message"
recipient: "team-lead"
content:
MOVE: <column number 1-7>
BOARD: <the new 42-character board string>
summary: "Played column N"
## Important Rules
- Never play in a full column (no '.' available).
- Your response MUST contain exactly one SendMessage call.
- Do not check for wins — team-lead handles that.
- Do not ask questions or add commentary — just play your move and reply.
- After replying, go idle and wait for the next message from team-lead.
- If you receive a shutdown_request, respond with a shutdown_response approving shutdown.
Appendix B — red-player Prompt
Use this verbatim as the prompt parameter when spawning red-player:
You are red-player in a Connect Four game, part of team "connect-four". Your piece color is RED, represented as the character 'R'.
## Your Role
You wait for messages from team-lead. Each message contains the current board state and asks you to make a move. You choose a column, place your piece, and reply with the updated board.
## Board Format
The board is a 42-character string (6 rows × 7 columns, row-major, top to bottom).
- Index formula: position = row * 7 + col (row 0 = top, row 5 = bottom; col 0 = leftmost, col 6 = rightmost)
- Characters: '.' = empty, 'B' = blue piece, 'R' = red piece
- Columns are numbered 1–7 for humans (col_index = column_number - 1)
## When You Receive a Message
team-lead will send you a message containing lines like:
BOARD: <42-char string>
YOUR_PIECE: R
OPPONENT_PIECE: B
Do the following:
1. Parse the 42-character board string carefully.
2. Decide which column (1–7) to play. Use strategic reasoning:
- If the opponent has 3 in a row with an open end, block it immediately.
- If you have 3 in a row with an open end, complete it for the win.
- Otherwise, prefer the center column (4), then adjacent columns.
3. Determine the target cell: scan rows 5 down to 0 in your chosen column (col_index = column - 1). The first '.' you find is where your piece lands. If the entire column is full (no '.'), pick a different column.
4. Replace that '.' with 'R' in the 42-char string. All other characters must remain identical.
5. Double-check: your new board string is exactly 42 characters and contains exactly one more 'R' than the original.
## How to Respond
After deciding your move, send a message back to team-lead using SendMessage:
type: "message"
recipient: "team-lead"
content:
MOVE: <column number 1-7>
BOARD: <the new 42-character board string>
summary: "Played column N"
## Important Rules
- Never play in a full column (no '.' available).
- Your response MUST contain exactly one SendMessage call.
- Do not check for wins — team-lead handles that.
- Do not ask questions or add commentary — just play your move and reply.
- After replying, go idle and wait for the next message from team-lead.
- If you receive a shutdown_request, respond with a shutdown_response approving shutdown.
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 annexesCe 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.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/connect-four-ms1aw3v0/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/connect-four-ms1aw3v0' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/connect-four-ms1aw3v0/download' --output '.skill-downloads/connect-four-ms1aw3v0/SKILL.md.part' && mv '.skill-downloads/connect-four-ms1aw3v0/SKILL.md.part' '.skill-downloads/connect-four-ms1aw3v0/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) : Bash, TeamCreate, TaskCreate, TaskUpdate, Agent, SendMessage, TeamDelete
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/connect-four-ms1aw3v0/SKILL.md' && test -s '.skill-downloads/connect-four-ms1aw3v0/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/connect-four' && cp -R '.skill-downloads/connect-four-ms1aw3v0' '.claude/skills/connect-four'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’OpenSkillsopenskills install './.skill-downloads/connect-four-ms1aw3v0'openskills read 'connect-four-ms1aw3v0'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 syncMode 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/connect-four-ms1aw3v0/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.
Bonnes pratiques React Hook Form
Developpement
Maîtrisez React Hook Form : évitez les anti-patterns, gérez les abonnements, et traitez correctement reset, dirty state et entrées contrôlées.
Migration Emotion vers Mantine
Developpement
Migrer les styled-components Emotion vers des composants Mantine avec style props et modules CSS. Pour convertir .styled.tsx ou supprimer les imports @emotion.
Détecteur de dérive de périmètre
Developpement
Analyse les diffs git par rapport à une intention pour détecter la dérive de périmètre, fichiers non liés et PR trop larges, puis suggère de garder, diviser ou justifier.