Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
435 changes: 218 additions & 217 deletions .claude/skills/course/SKILL.md

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions .claude/skills/course/lessons.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
{
"title": "Learn Claude Code",
"title": "学习 Claude Code",
"parts": [
{
"name": "Introduction",
"lessons": [{ "id": "00", "title": "Welcome", "file": "00-intro.md" }]
"name": "介绍",
"lessons": [{ "id": "00", "title": "欢迎", "file": "00-intro.md" }]
},
{
"name": "Getting Started",
"name": "入门",
"lessons": [
{
"id": "01",
"title": "Your First Session",
"title": "你的第一次会话",
"file": "01-first-session.md"
},
{
"id": "02",
"title": "CLI Navigation",
"title": "命令行导航",
"file": "02-cli-navigation.md"
},
{ "id": "03", "title": "Managing Context", "file": "03-context.md" },
{ "id": "04", "title": "Modes", "file": "04-modes.md" }
{ "id": "03", "title": "管理上下文", "file": "03-context.md" },
{ "id": "04", "title": "模式", "file": "04-modes.md" }
]
},
{
"name": "Project Context",
"name": "项目上下文",
"lessons": [
{ "id": "05", "title": "CLAUDE.md", "file": "05-claude-md.md" },
{ "id": "06", "title": "Writing Rules", "file": "06-writing-rules.md" },
{ "id": "07", "title": "Prompting", "file": "07-prompting.md" },
{ "id": "06", "title": "编写规则", "file": "06-writing-rules.md" },
{ "id": "07", "title": "提示词技巧", "file": "07-prompting.md" },
{
"id": "08",
"title": "Creating Skills",
"title": "创建技能",
"file": "08-creating-skills.md"
}
]
},
{
"name": "Agents",
"name": "智能体",
"lessons": [
{ "id": "09", "title": "Subagents", "file": "09-claude-agents.md" },
{ "id": "09", "title": "子智能体", "file": "09-claude-agents.md" },
{
"id": "10",
"title": "Application Agents",
"title": "应用智能体",
"file": "10-application-agents.md"
}
]
Expand Down
30 changes: 15 additions & 15 deletions .claude/skills/lesson/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
---
name: lesson
description: Create a structured lesson on a Claude Code topic
argument-hint: "[topic]"
description: 创建关于 Claude Code 主题的结构化课程
argument-hint: "[主题]"
---

# Create a Lesson
# 创建课程

Write a lesson about **$ARGUMENTS**.
写一篇关于 **$ARGUMENTS** 的课程。

## Structure
## 结构

1. **What is it?** - Brief explanation
2. **Why use it?** - When and why it's useful
3. **How it works** - Step-by-step with examples
4. **Quick reference** - Cheat sheet / table
5. **Try it** - Hands-on exercise
1. **它是什么?** - 简要解释
2. **为什么使用它?** - 何时以及为什么有用
3. **它是如何工作的** - 分步示例
4. **快速参考** - 备忘单/表格
5. **试试看** - 动手练习

## Guidelines
## 指南

- Keep explanations concise
- Use tables for comparisons
- Include real examples
- End with something to try
- 保持解释简洁
- 使用表格进行比较
- 包含真实示例
- 以可以尝试的东西结束
68 changes: 34 additions & 34 deletions .claude/skills/review-lesson/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
---
name: review-lesson
description: Review a lesson for accuracy against Claude Code docs
argument-hint: "<lesson-file or number>"
description: 根据 Claude Code 官方文档审查课程准确性
argument-hint: "<课程文件或编号>"
---

# Review Lesson
# 审查课程

Review the lesson **$ARGUMENTS** for accuracy against official Claude Code documentation.
根据官方 Claude Code 文档审查 **$ARGUMENTS** 的准确性。

## Steps
## 步骤

1. **Read the lesson**
1. **阅读课程**

- If a number is given (e.g., "04"), read `learn-claude/04-*.md`
- If a file path is given, read that file
- 如果给出编号(例如,"04"),读取 `learn-claude/04-*.md`
- 如果给出文件路径,读取该文件

2. **Check against official docs**
2. **对照官方文档检查**

- Fetch https://docs.anthropic.com/en/docs/claude-code for reference
- Also check https://docs.anthropic.com/en/docs/claude-code/cli-usage
- Cross-reference any claims in the lesson
- https://docs.anthropic.com/en/docs/claude-code 获取参考
- 同时检查 https://docs.anthropic.com/en/docs/claude-code/cli-usage
- 交叉引用课程中的任何声明

3. **Review for**
- **Accuracy** - Is the information correct?
- **Completeness** - Is anything important missing?
- **Currency** - Is anything outdated?
- **Clarity** - Is it easy to understand?
3. **审查**
- **准确性** - 信息正确吗?
- **完整性** - 有什么重要的遗漏吗?
- **时效性** - 有什么过时的吗?
- **清晰度** - 容易理解吗?

## Output Format
## 输出格式

```markdown
## Lesson Review: [Title]
## 课程审查:[标题]

### Accuracy
### 准确性

- ✅ Correct: [list accurate claims]
- ❌ Incorrect: [list inaccuracies with corrections]
- ⚠️ Outdated: [list outdated info with updates]
- ✅ 正确:[列出准确的声明]
- ❌ 不正确:[列出错误及更正]
- ⚠️ 过时:[列出过时的信息及更新]

### Missing
### 遗漏

- [Important topics not covered]
- [未涵盖的重要主题]

### Suggestions
### 建议

- [Improvements to make]
- [改进建议]

### Verdict
### 结论

[PASS / NEEDS UPDATES / MAJOR REVISION NEEDED]
[通过 / 需要更新 / 需要重大修订]
```

## Guidelines
## 指南

- Be specific about what's wrong and how to fix it
- Reference the official docs for corrections
- Note if something couldn't be verified
- Prioritize factual accuracy over style
- 具体说明有什么问题以及如何修复
- 引用官方文档进行更正
- 注意如果有无法验证的内容
- 优先考虑事实准确性而非风格
146 changes: 73 additions & 73 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,104 +1,104 @@
# Game Development Rules
# 游戏开发规则

When creating or modifying game artifacts, always keep these elements in sync. Reference the **UI Component Reference** section below for component names and locations.
在创建或修改游戏元素时,请始终保持这些元素同步。请参考下方的 **UI 组件参考** 部分了解组件名称和位置。

## Characters
## 角色

When adding or modifying characters:
在添加或修改角色时:

1. **Data File**: Add to `data/characters.json`
2. **Portrait Art**: Create pixel art in `ui/portraits.js` if it doesn't exist
3. **Talk Button**: Enable via `updateTalkButton()` in Actions Section
4. **Portrait Display**: Character appears via `showPortrait()` when talking
5. **Terminal Output**: Character mentioned in room description text
1. **数据文件**:添加到 `data/characters.json`
2. **肖像艺术**:如果不存在,在 `ui/portraits.js` 中创建像素艺术
3. **对话按钮**:通过操作区的 `updateTalkButton()` 启用
4. **肖像显示**:对话时通过 `showPortrait()` 显示角色
5. **终端输出**:在房间描述文本中提及角色

## Rooms
## 房间

When adding or modifying rooms:
在添加或修改房间时:

1. **Data File**: Add to `data/rooms.json`
2. **Location Name**: Updates via `updateLocation()` in Location Section
3. **Mini Map**: Update `mapLayout` grid in `ui/ui.js`
4. **Map Visualization**: Synced by `updateMap()`
5. **Terminal Output**: Room description shown via `print()`
6. **Exits**: Ensure room exits match the spatial grid layout
1. **数据文件**:添加到 `data/rooms.json`
2. **位置名称**:通过位置区的 `updateLocation()` 更新
3. **小地图**:在 `ui/ui.js` 中更新 `mapLayout` 网格
4. **地图可视化**:通过 `updateMap()` 同步
5. **终端输出**:通过 `print()` 显示房间描述
6. **出口**:确保房间出口与空间网格布局匹配

## Items
## 物品

When adding or modifying items:
在添加或修改物品时:

1. **Data File**: Add to `data/items.json`
2. **Take Button**: Enable via `updateTakeButton()` in Actions Section
3. **Inventory List**: Updates via `updateInventory()` in Inventory Section
4. **Terminal Output**: Item mentioned in room description when present
5. **Mini Map**: Ensure minimap continues to work as expected.
1. **数据文件**:添加到 `data/items.json`
2. **拾取按钮**:通过操作区的 `updateTakeButton()` 启用
3. **物品清单**:通过物品区的 `updateInventory()` 更新
4. **终端输出**:当物品存在时,在房间描述中提及
5. **小地图**:确保小地图继续正常工作

## Enemies
## 敌人

When adding or modifying enemies:
在添加或修改敌人时:

1. **Data File**: Add to `data/enemies.json`
2. **Attack Button**: Enable via `updateAttackButton()` in Actions Section
3. **Pixel Art**: Create in `ui/portraits.js` if it doesn't exist
4. **Terminal Output**: Enemy mentioned in room description when present
1. **数据文件**:添加到 `data/enemies.json`
2. **攻击按钮**:通过操作区的 `updateAttackButton()` 启用
3. **像素艺术**:如果不存在,在 `ui/portraits.js` 中创建
4. **终端输出**:当敌人存在时,在房间描述中提及

## Navigation
## 导航

- Support arrow keys ONLY for keyboard navigation
- DO NOT add WASD (w/a/s/d) key support — it interferes with text input
- Arrow keys: ArrowUp, ArrowDown, ArrowLeft, ArrowRight
- 键盘导航**仅**支持方向键
- **不要**添加 WASD (w/a/s/d) 键支持 —— 它会干扰文本输入
- 方向键:ArrowUpArrowDownArrowLeftArrowRight

## Reference Implementation
## 参考实现

- The `reference/complete/` directory contains the complete, finished version of the game
- When implementing features, check reference/complete/game.js, reference/complete/ui/ui.js, and reference/complete/data/ for reference
- Use these as guardrails to ensure your implementations match the intended patterns and structure
- `reference/complete/` 目录包含游戏的完整、成品版本
- 在实现功能时,请检查 reference/complete/game.jsreference/complete/ui/ui.js reference/complete/data/ 作为参考
- 使用这些作为指导,确保你的实现符合预期的模式和结构

## General Principle
## 一般原则

When you add any game artifact (character, room, item, enemy), update:
当你添加任何游戏元素(角色、房间、物品、敌人)时,请更新:

1. The data file (JSON)
2. The UI elements that display/interact with it
3. Any visual assets (pixel art) if applicable
1. 数据文件(JSON
2. 显示/与之交互的 UI 元素
3. 任何视觉资源(像素艺术)(如适用)

---

## UI Component Reference
## UI 组件参考

Understanding the game's UI structure helps when adding features. Here's the complete hierarchy:
了解游戏的 UI 结构有助于添加功能。以下是完整的层次结构:

### Layout Structure
### 布局结构

**Status Panel** (Left Sidebar)
**状态面板**(左侧边栏)

- **Status Section**: HP Display with hearts and text (100/100)
- **Location Section**: Location Name, Mini Map grid, Map Legend
- **Inventory Section**: Inventory List of carried items
- **Actions Section**: Action Buttons Grid containing:
- Look Button, Inventory Button, Help Button (always visible)
- Take Button (appears when items present)
- Talk Button (appears when characters present)
- Attack Button (appears when enemies present)
- **状态区**:HP 显示,带心形和文本(100/100
- **位置区**:位置名称、小地图网格、地图图例
- **物品区**:携带物品的物品清单
- **操作区**:操作按钮网格,包含:
- 查看按钮、物品按钮、帮助按钮(始终可见)
- 拾取按钮(当存在物品时显示)
- 对话按钮(当存在角色时显示)
- 攻击按钮(当存在敌人时显示)

**Main Panel** (Right Side)
**主面板**(右侧)

- **Portrait Display**: Character portraits during conversations
- **Terminal Output**: Game text messages and room descriptions
- **Command Input**: Text field for player commands
- **肖像显示**:对话期间的角色肖像
- **终端输出**:游戏文本消息和房间描述
- **命令输入**:玩家命令的文本字段

### Code References
### 代码参考

| Component Name | HTML/CSS Reference | Update Function |
| ---------------- | ------------------------------------ | ---------------------------------- |
| Status Panel | `.status-panel` | N/A (container) |
| HP Display | `.hp-display`, `#hp-bar`, `#hp-text` | `updateHpBar()` |
| Location Name | `#location-name` | `updateLocation()` |
| Mini Map | `#pixel-map` | `updateMap()` |
| Inventory List | `#inventory-list` | `updateInventory()` |
| Take Button | `#take-btn` | `updateTakeButton()` |
| Talk Button | `#talk-btn` | `updateTalkButton()` |
| Attack Button | `#attack-btn` | `updateAttackButton()` |
| Portrait Display | `#portrait-container` | `showPortrait()`, `hidePortrait()` |
| Terminal Output | `#output` | `print(text, className)` |
| Command Input | `#command` | N/A (user input) |
| 组件名称 | HTML/CSS 引用 | 更新函数 |
| ---------- | ------------------------------------ | ---------------------------------- |
| 状态面板 | `.status-panel` | N/A(容器) |
| HP 显示 | `.hp-display`, `#hp-bar`, `#hp-text` | `updateHpBar()` |
| 位置名称 | `#location-name` | `updateLocation()` |
| 小地图 | `#pixel-map` | `updateMap()` |
| 物品清单 | `#inventory-list` | `updateInventory()` |
| 拾取按钮 | `#take-btn` | `updateTakeButton()` |
| 对话按钮 | `#talk-btn` | `updateTalkButton()` |
| 攻击按钮 | `#attack-btn` | `updateAttackButton()` |
| 肖像显示 | `#portrait-container` | `showPortrait()`, `hidePortrait()` |
| 终端输出 | `#output` | `print(text, className)` |
| 命令输入 | `#command` | N/A(用户输入) |
Loading