gentellab/trustclaw/game-code

Claude Code and agent skill by gentellab/trustclaw

Trust tier 2
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

生成HTML5小游戏代码(需要Python 3.10+)。支持两种模式:(1) 预设模板快速生成经典游戏 (2) 调用AI大模型根据需求实时编写自定义游戏代码。

Install

npx vskill@latest install gentellab/trustclaw/game-code

SKILL.md

Game Code (HTML5游戏代码生成器)

使用此技能生成完整的HTML5小游戏代码。支持模板模式和AI生成模式。

模式一:AI大模型生成(推荐)

根据你的需求描述,调用AI大模型实时生成自定义游戏代码。

bash
python3 {baseDir}/scripts/game_gen.py --mode ai --prompt "你的游戏需求描述" --output <output_dir> [--model <model_name>] [--api-key <key>]
示例
bash
# 使用OpenAI生成自定义游戏
python3 {baseDir}/scripts/game_gen.py --mode ai \
--prompt "创建一个太空射击游戏,玩家控制飞船躲避陨石并射击敌人" \
--output ~/games/space-shooter \
--model gpt-4o
# 使用Claude生成游戏
python3 {baseDir}/scripts/game_gen.py --mode ai \
--prompt "做一个2048数字合并游戏,要有漂亮的动画效果" \
--output ~/games/2048 \
--model claude-3-5-sonnet \
--api-key $ANTHROPIC_API_KEY
# 使用环境变量中的API Key
export OPENAI_API_KEY="your-key"
python3 {baseDir}/scripts/game_gen.py --mode ai \
--prompt "创建一个跑酷游戏,角色需要跳跃躲避障碍物" \
--output ~/games/runner
支持的AI模型
模型环境变量说明
gpt-4o (默认)OPENAI_API_KEYOpenAI GPT-4o
gpt-4o-miniOPENAI_API_KEYOpenAI GPT-4o Mini
claude-3-5-sonnetANTHROPIC_API_KEYAnthropic Claude
deepseek-chatDEEPSEEK_API_KEYDeepSeek

模式二:模板生成(快速)

使用预设模板快速生成经典游戏。

bash
python3 {baseDir}/scripts/game_gen.py --mode template --type <game_type> --output <output_dir> [--title <game_title>]
支持的游戏模板
类型说明
snake经典贪吃蛇游戏
tetris俄罗斯方块
breakout打砖块
pong乒乓球
flappy跳跃小鸟
memory记忆翻牌
示例
bash
# 生成贪吃蛇游戏
python3 {baseDir}/scripts/game_gen.py --mode template --type snake --output ~/games/snake --title "我的贪吃蛇"
# 生成俄罗斯方块
python3 {baseDir}/scripts/game_gen.py --mode template --type tetris --output ~/games/tetris

输出内容

每个游戏输出到指定目录,包含:

  • index.html - 完整的游戏页面
  • game.js - 游戏逻辑代码
  • style.css - 游戏样式

注意事项

  • 输出目录必须是空目录或不存在(脚本会自动创建)
  • AI模式需要配置对应的API Key(环境变量或--api-key参数)
  • 生成完成后,直接用浏览器打开 index.html 即可游玩
  • 所有游戏都支持键盘控制,部分支持触屏

Security

  • Security scanPassed, 96 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
48
Repository forks
5
7-day trend score
19

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 25 Mar 2026, 7 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/gentellab/trustclaw/game-code/badge)](https://verified-skill.com/skills/gentellab/trustclaw/game-code)

Something wrong with this skill or its page? Tell us.