git:20260907.154c80c to git:20260907.987ba37

59 added, 572 removed. Audit B to A.

---
name: multi-game-codes-hub
- description: 快速为任何 Roblox 游戏生成完整的代码页面。包含一键复制、多语言支持、过期追踪、FAQ Schema 和自动更新机制。
+ description: Generate a Next.js Roblox codes page from validated JSON using a reusable TSX template. Use when creating or regenerating a single game's active/expired codes page with metadata, copy controls, FAQ, and breadcrumb schema.
metadata:
- keywords: roblox codes, promo codes, game codes, code page generator, multilingual
+ keywords: roblox codes, promo codes, game codes, nextjs page generator, faq schema
---
- # Multi-Game Codes Hub - 多游戏代码聚合中心
-
- 这个 skill 帮助你在 5 分钟内为任何 Roblox 游戏创建一个完整的、SEO 优化的代码页面。
-
- ## 核心价值主张
-
- 代码页面是 Roblox 游戏网站的最高流量入口。这个 skill 提供了一个统一的模板系统,让你可以快速复制成功的代码页面结构到新游戏。
-
- ## 功能特性
-
- ### ✅ 核心功能
-
- 1. **Active/Expired 分区** - 清晰区分有效和过期代码
- 2. **一键复制按钮** - 提升用户体验,降低跳出率
- 3. **多语言支持** - 自动生成西班牙语、葡萄牙语、俄语版本
- 4. **FAQ Schema** - 抢占 Google "People Also Ask" 版块
- 5. **过期时间追踪** - 自动标记即将过期的代码
- 6. **兑换指南** - 图文并茂的分步说明
- 7. **相关内容推荐** - 智能内链到 Tier List、Wiki 等页面
-
- ### 🚀 高级功能
-
- 1. **自动更新检测** - 监控 Discord/Twitter 新代码
- 2. **代码验证** - 自动测试代码是否仍然有效
- 3. **奖励计算器** - 显示代码总价值
- 4. **社区贡献** - 允许用户提交新代码
- 5. **历史记录** - 追踪代码发布和过期时间线
-
- ## 页面结构
-
- ### 标准代码页面布局
-
- ```
- ┌─────────────────────────────────────┐
- │ Hero Section │
- │ - H1: [Game] Codes (March 2026) │
- │ - 简短介绍 │
- │ - "Last Updated" 时间戳 │
- └─────────────────────────────────────┘
-
- ┌─────────────────────────────────────┐
- │ Active Codes (绿色徽章) │
- │ ┌───────────────────────────────┐ │
- │ │ Code │ Reward │ Copy Btn │ │
- │ │ CODE123 │ 50 Spins│ 📋 │ │
- │ └───────────────────────────────┘ │
- └─────────────────────────────────────┘
-
- ┌─────────────────────────────────────┐
- │ How to Redeem (图文教程) │
- │ Step 1: Launch Game │
- │ Step 2: Open Settings │
- │ Step 3: Enter Code │
- └─────────────────────────────────────┘
+ # Multi-Game Codes Hub
- ┌─────────────────────────────────────┐
- │ Expired Codes (灰色徽章) │
- │ - 历史代码参考 │
- │ - 帮助用户排查输入错误 │
- └─────────────────────────────────────┘
+ Generate one Next.js codes page from explicit game data. The included generator renders a TSX template; it does not discover, monitor, translate, or validate codes against Roblox.
- ┌─────────────────────────────────────┐
- │ FAQ (Schema Markup) │
- │ - 如何兑换代码? │
- │ - 为什么代码无效? │
- │ - 多久发布新代码? │
- └─────────────────────────────────────┘
+ ## Implemented resources
- ┌─────────────────────────────────────┐
- │ Related Content │
- │ - Tier List │
- │ - Wiki │
- │ - Trading Guide │
- └─────────────────────────────────────┘
- ```
+ - [resources/generate_code_page.py](resources/generate_code_page.py): validates JSON and renders a page.
+ - [resources/templates/codes_page.tsx](resources/templates/codes_page.tsx): Next.js page template for active/expired codes, redemption guidance, metadata, FAQ, and breadcrumbs.
+ - [resources/components/CopyButton.tsx](resources/components/CopyButton.tsx): client-side copy control with a fallback.
+ - [resources/components/CodeTable.tsx](resources/components/CodeTable.tsx): optional reusable code table.
+ - [resources/schemas/faq_schema.ts](resources/schemas/faq_schema.ts): FAQ, breadcrumb, and item-list schema helpers.
+ - [USAGE.md](USAGE.md): concise CLI reference.
- ## 使用方法
+ The generated template imports `@/components/CopyButton`; copy the included component into that alias or change the import for the target project.
- ### 快速开始: 为新游戏创建代码页
+ ## Input contract
- ```bash
- # 1. 准备代码数据 (JSON 格式)
- cat > yba_codes.json << EOF
+ ```json
{
"gameName": "Your Bizarre Adventure",
"gameSlug": "yba",
+ "baseUrl": "https://example.com",
"activeCodes": [
{
- "code": "PARAGONLUCK",
- "reward": "1 Lucky Arrow",
- "expiryDate": "2026-04-01"
- },
- {
- "code": "6YEARS",
- "reward": "2x EXP + 1 Lucky Arrow",
- "expiryDate": "2026-03-31"
+ "code": "CODE123",
+ "reward": "50 Spins",
+ "expiryDate": "2026-04-30",
+ "conditions": "Optional"
}
],
"expiredCodes": [
{
- "code": "CHRISTMAS2025",
- "reward": "1 Lucky Arrow + Christmas Present",
- "expiredDate": "2026-01-15"
+ "code": "OLDCODE",
+ "reward": "25 Spins"
}
]
}
- EOF
-
- # 2. 生成页面
- python resources/generate_code_page.py \
- --input yba_codes.json \
- --output ./src/app/yba/page.tsx
-
- # 3. 验证生成的页面
- npm run build
- npm run lint
-
- # 完成! 页面已生成在 /yba
```
- ### 场景 1: 批量创建多个游戏的代码页
-
- ```bash
- # 准备多个游戏的数据
- games=(
- "yba:Your Bizarre Adventure"
- "kaizen:Kaizen"
- "blue-lock:Blue Lock Rivals"
- "volleyball:Volleyball Legends"
- )
-
- for game in "${games[@]}"; do
- slug="${game%%:*}"
- name="${game##*:}"
-
- python resources/generate_code_page.py \
- --game-name "$name" \
- --game-slug "$slug" \
- --template resources/templates/codes_page.tsx \
- --output "./src/app/$slug/page.tsx"
- done
-
- echo "✅ 已生成 ${#games[@]} 个代码页面"
- ```
-
- ### 场景 2: 更新现有代码页
+ Required top-level fields:
- ```bash
- # 添加新代码
- python resources/update_codes.py \
- --game yba \
- --add-code "NEWCODE2026" \
- --reward "5 Lucky Arrows" \
- --expiry "2026-04-15"
+ - `gameName`: non-empty string.
+ - `gameSlug`: lowercase letters/digits separated by single hyphens.
+ - `baseUrl`: absolute HTTP(S) site URL without credentials, query, or fragment. A trailing slash is normalized away.
+ - `activeCodes` and `expiredCodes`: arrays when provided; each entry requires non-empty string `code` and `reward`.
- # 标记代码为过期
- python resources/update_codes.py \
- --game yba \
- --expire-code "OLDCODE" \
- --expired-date "2026-03-20"
+ `baseUrl` drives canonical and breadcrumb URLs. Never reuse an example domain for a real site.
- # 自动触发重新部署
- git add src/app/yba/
- git commit -m "chore: update YBA codes"
- git push
- ```
+ ## Generate a page
- ### 场景 3: 多语言版本生成
+ From the Skill directory:
```bash
- # 生成英语、西班牙语、葡萄牙语版本
- python resources/generate_multilingual.py \
- --game yba \
- --languages en,es,pt \
- --output ./src/app/
-
- # 输出:
- # - /yba/page.tsx (英语)
- # - /es/yba/page.tsx (西班牙语)
- # - /pt/yba/page.tsx (葡萄牙语)
-
- # 自动添加 hreflang 标签
- ```
-
- ## 关键文件说明
-
- ### `resources/templates/codes_page.tsx`
-
- 统一的代码页面模板:
-
- ```tsx
- import { Metadata } from 'next';
- import { CopyButton } from '@/components/CopyButton';
- import { CodeTable } from '@/components/CodeTable';
-
- export const metadata: Metadata = {
- title: '{{gameName}} Codes (March 2026) | Active & Expired',
- description: 'All working {{gameName}} codes for March 2026. Get free {{rewards}}. Updated daily!',
- };
-
- export default function {{gameSlug}}CodesPage() {
- const activeCodes = {{activeCodesData}};
- const expiredCodes = {{expiredCodesData}};
-
- return (
- <div className="container">
- <h1>{{gameName}} Codes (March 2026)</h1>
-
- <section>
- <h2>Active Codes</h2>
- <CodeTable codes={activeCodes} status="active" />
- </section>
-
- <section>
- <h2>How to Redeem Codes</h2>
- <RedemptionGuide game="{{gameSlug}}" />
- </section>
-
- <section>
- <h2>Expired Codes</h2>
- <CodeTable codes={expiredCodes} status="expired" />
- </section>
-
- <section>
- <h2>FAQ</h2>
- <FAQ game="{{gameName}}" />
- </section>
-
- <script type="application/ld+json">
- {JSON.stringify(faqSchema)}
- </script>
- </div>
- );
- }
- ```
-
- ### `resources/components/CopyButton.tsx`
-
- 一键复制按钮组件:
-
- ```tsx
- 'use client';
-
- import { useState } from 'react';
-
- export function CopyButton({ code }: { code: string }) {
- const [copied, setCopied] = useState(false);
-
- const handleCopy = async () => {
- await navigator.clipboard.writeText(code);
- setCopied(true);
- setTimeout(() => setCopied(false), 2000);
- };
-
- return (
- <button
- onClick={handleCopy}
- className="copy-btn"
- aria-label={`Copy code ${code}`}
- >
- {copied ? '✓ Copied!' : '📋 Copy'}
- </button>
- );
- }
- ```
-
- ### `resources/components/CodeTable.tsx`
-
- 代码表格组件:
-
- ```tsx
- import { CopyButton } from './CopyButton';
-
- interface Code {
- code: string;
- reward: string;
- expiryDate?: string;
- requirements?: string;
- }
-
- export function CodeTable({
- codes,
- status
- }: {
- codes: Code[];
- status: 'active' | 'expired'
- }) {
- return (
- <div className="code-table">
- <table>
- <thead>
- <tr>
- <th>Code</th>
- <th>Reward</th>
- {status === 'active' && <th>Expires</th>}
- <th>Action</th>
- </tr>
- </thead>
- <tbody>
- {codes.map((code) => (
- <tr key={code.code} className={status}>
- <td>
- <code>{code.code}</code>
- {status === 'active' && (
- <span className="badge-active">Active</span>
- )}
- </td>
- <td>{code.reward}</td>
- {status === 'active' && (
- <td>{code.expiryDate || 'Unknown'}</td>
- )}
- <td>
- <CopyButton code={code.code} />
- </td>
- </tr>
- ))}
- </tbody>
- </table>
- </div>
- );
- }
- ```
-
- ### `resources/schemas/faq_schema.ts`
-
- FAQ Schema 生成器:
-
- ```typescript
- export function generateFAQSchema(gameName: string) {
- return {
- '@context': 'https://schema.org',
- '@type': 'FAQPage',
- mainEntity: [
- {
- '@type': 'Question',
- name: `How do I redeem ${gameName} codes?`,
- acceptedAnswer: {
- '@type': 'Answer',
- text: `Open ${gameName}, click Settings, find the Codes button, enter the code exactly as shown, and click Submit.`
- }
- },
- {
- '@type': 'Question',
- name: `Why isn't my ${gameName} code working?`,
- acceptedAnswer: {
- '@type': 'Answer',
- text: 'Codes are case-sensitive and may have expired. Check the expiration date and ensure correct spelling.'
- }
- },
- {
- '@type': 'Question',
- name: `How often are new ${gameName} codes released?`,
- acceptedAnswer: {
- '@type': 'Answer',
- text: 'New codes are typically released during game updates, milestones, and special events. Check back weekly!'
- }
- }
- ]
- };
- }
- ```
-
- ## 多语言支持
-
- ### 翻译映射
-
- ```typescript
- const translations = {
- en: {
- title: 'Codes',
- active: 'Active Codes',
- expired: 'Expired Codes',
- howToRedeem: 'How to Redeem',
- copy: 'Copy',
- copied: 'Copied!',
- },
- es: {
- title: 'Códigos',
- active: 'Códigos Activos',
- expired: 'Códigos Expirados',
- howToRedeem: 'Cómo Canjear',
- copy: 'Copiar',
- copied: '¡Copiado!',
- },
- pt: {
- title: 'Códigos',
- active: 'Códigos Ativos',
- expired: 'Códigos Expirados',
- howToRedeem: 'Como Resgatar',
- copy: 'Copiar',
- copied: 'Copiado!',
- },
- ru: {
- title: 'Коды',
- active: 'Активные Коды',
- expired: 'Истекшие Коды',
- howToRedeem: 'Как Использовать',
- copy: 'Копировать',
- copied: 'Скопировано!',
- }
- };
- ```
-
- ## 自动化工作流
-
- ### Discord 代码监控
-
- ```python
- # resources/discord_code_monitor.py
- import discord
- import re
-
- class CodeMonitor(discord.Client):
- async def on_message(self, message):
- # 检测代码发布
- if message.channel.id == CODES_CHANNEL_ID:
- code_match = re.search(r'Code:\s*(\w+)', message.content)
- reward_match = re.search(r'Reward:\s*(.+)', message.content)
-
- if code_match and reward_match:
- code = code_match.group(1)
- reward = reward_match.group(1)
-
- # 更新数据库
- add_code(game='yba', code=code, reward=reward)
-
- # 触发网站更新
- trigger_deploy()
-
- # 发送通知
- await message.channel.send(f'✅ Code {code} added to website!')
- ```
-
- ### 定时验证代码
-
- ```python
- # resources/code_validator.py
- import requests
- from datetime import datetime
-
- def validate_codes(game: str):
- """
- 定期验证代码是否仍然有效
- """
- codes = load_codes(game)
-
- for code in codes:
- if code['status'] == 'Active':
- # 尝试通过游戏 API 验证 (如果可用)
- is_valid = check_code_validity(game, code['code'])
-
- if not is_valid:
- # 标记为过期
- code['status'] = 'Expired'
- code['expiredDate'] = datetime.now().isoformat()
-
- print(f'⚠️ Code {code["code"]} has expired')
-
- save_codes(game, codes)
- ```
-
- ## 最佳实践
-
- ### 1. SEO 优化检查清单
-
- - ✅ H1 包含游戏名称和 "Codes"
- - ✅ Meta Description 包含 "free", "working", "2026"
- - ✅ 至少 3 个内部链接
- - ✅ FAQ Schema 正确注入
- - ✅ OG 图片 (1200x630)
- - ✅ "Last Updated" 时间戳
- - ✅ 代码表格使用语义化 HTML
-
- ### 2. 用户体验优化
-
- - ✅ 一键复制按钮
- - ✅ 复制成功反馈
- - ✅ 移动端响应式设计
- - ✅ 快速加载 (< 2 秒)
- - ✅ 清晰的视觉层级
- - ✅ 无广告干扰 (或最小化)
-
- ### 3. 内容更新策略
-
- - 每天检查 Discord/Twitter
- - 每周验证代码有效性
- - 每月更新兑换指南截图
- - 季度性添加新的 FAQ
-
- ## 成功案例
-
- ### 案例 1: Jujutsu Infinite 代码页
-
- - **URL**: `/codes`
- - **月流量**: 50,000+ 访问
- - **跳出率**: 28% (优秀)
- - **平均停留时间**: 1:45 分钟
- - **转化率**: 15% (点击内部链接)
-
- ### 案例 2: YBA 代码页 (新创建)
-
- - **创建时间**: 5 分钟
- - **首页排名**: 第 3 位 (2 周内)
- - **月流量**: 15,000+ 访问
- - **Featured Snippet**: 是 (FAQ 部分)
-
- ## 扩展功能
-
- ### 1. 代码价值计算器
-
- ```tsx
- function CodeValueCalculator({ codes }) {
- const totalValue = codes.reduce((sum, code) => {
- return sum + calculateRewardValue(code.reward);
- }, 0);
-
- return (
- <div className="value-calculator">
- <h3>Total Value of Active Codes</h3>
- <p className="total-value">{totalValue} Spins</p>
- <p className="robux-equivalent">
- ≈ {totalValue * 10} Robux Value
- </p>
- </div>
- );
- }
+ python3 resources/generate_code_page.py \
+ --input resources/examples/yba_codes.json \
+ --output /tmp/yba-codes-page.tsx
```
- ### 2. 社区代码提交
-
- ```tsx
- function CodeSubmissionForm() {
- return (
- <form onSubmit={handleSubmit}>
- <h3>Found a New Code?</h3>
- <input name="code" placeholder="Enter code" />
- <input name="reward" placeholder="What did you get?" />
- <button type="submit">Submit Code</button>
- <p className="note">
- We'll verify and add it within 24 hours!
- </p>
- </form>
- );
- }
- ```
+ The default template is resolved relative to this Skill, so the command also works when the script is invoked from another current working directory. `--input`, `--output`, and an explicitly supplied `--template` retain normal CLI semantics: relative paths resolve from the caller's current directory and absolute paths remain absolute.
- ### 3. 代码历史时间线
+ To use a custom template:
- ```tsx
- function CodeTimeline({ codes }) {
- return (
- <div className="timeline">
- <h3>Code Release History</h3>
- {codes.map(code => (
- <div key={code.code} className="timeline-item">
- <span className="date">{code.releaseDate}</span>
- <span className="code">{code.code}</span>
- <span className="reward">{code.reward}</span>
- </div>
- ))}
- </div>
- );
- }
+ ```bash
+ python3 resources/generate_code_page.py \
+ --input ./game.json \
+ --output ./page.tsx \
+ --template ./custom-codes-page.tsx
```
- ## 故障排查
-
- ### 问题 1: 代码复制按钮不工作
-
- ```typescript
- // 检查浏览器兼容性
- if (!navigator.clipboard) {
- // 回退到旧方法
- const textArea = document.createElement('textarea');
- textArea.value = code;
- document.body.appendChild(textArea);
- textArea.select();
- document.execCommand('copy');
- document.body.removeChild(textArea);
- }
- ```
+ Generation uses the current UTC month, year, and date. It fails before writing output if the JSON is invalid, required values are missing, URLs are invalid, or any `{{templateVariable}}` remains unresolved.
- ### 问题 2: Schema 验证失败
+ ## Template variables
- ```bash
- # 使用 Google Rich Results Test
- https://search.google.com/test/rich-results
+ - `{{gameName}}`
+ - `{{gameSlug}}`
+ - `{{baseUrl}}`
+ - `{{rewards}}`
+ - `{{activeCodesData}}`
+ - `{{expiredCodesData}}`
+ - `{{lastUpdated}}`
+ - `{{currentMonth}}`
+ - `{{currentYear}}`
- # 常见问题:
- # - mainEntity 必须是数组
- # - acceptedAnswer 必须包含 @type
- # - text 字段不能为空
- ```
+ ## Verification
- ### 问题 3: 多语言 hreflang 错误
+ After generation:
- ```tsx
- // 确保每个语言版本都有完整的 hreflang 标签
- <head>
- <link rel="alternate" hreflang="en" href="https://site.com/yba" />
- <link rel="alternate" hreflang="es" href="https://site.com/es/yba" />
- <link rel="alternate" hreflang="pt" href="https://site.com/pt/yba" />
- <link rel="alternate" hreflang="x-default" href="https://site.com/yba" />
- </head>
- ```
+ 1. Confirm the output contains the target `baseUrl` and no unrelated domain.
+ 2. Confirm no `{{...}}` placeholder remains.
+ 3. Copy or adapt the required component imports.
+ 4. Run the target Next.js project's typecheck, lint, and build.
+ 5. Review codes and redemption instructions against a cited primary source; the generator does not verify factual accuracy.
- ---
+ ## Roadmap and boundaries
- **准备好创建你的第一个代码页面了吗?** 准备好游戏数据,让 AI 在 5 分钟内生成完整的页面!
+ Discord/Twitter monitoring, automatic code validity checks, automatic expiry updates, multilingual generation, community submissions, and deployment automation are not implemented. Treat them as roadmap items only; do not invoke nonexistent scripts such as `discord_code_monitor.py`, `code_validator.py`, `update_codes.py`, or `generate_multilingual.py`.