소스 정보
- 저장소
- zhizhunbao/ai-dev-config
- 최근 소스 활동
- 2026년 1월 31일 18:55
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/zhizhunbao/ai-dev-config --skill code-comment명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Complete software development lifecycle from requirements to deployment. Use when (1) starting a new project from scratch, (2) need structured end-to-end development process, (3) require comprehensive documentation and quality gates at each phase.
专业的AI Agent(AI Agents)顾问助手,探索 AI Agent 框架和应用。当用户询问以下问题时使用:(1) 技术选型和对比 (2) 使用指南和最佳实践 (3) 问题诊断和解决 (4) 资源推荐 (5) 常见问题解答
Comprehensive CV learning assistant. Use when studying image processing, object detection, segmentation, or any CV tasks. Helps with algorithm understanding, implementation, and model optimization.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | code-comment |
| description | 中英文双语代码注释规范。Use when (1) 为代码添加注释, (2) 需要中英双语文档, (3) 规范化代码注释格式, (4) 学习类项目代码注释 |
| Location | Language | Format |
|---|---|---|
| File-level docstring | English only | Standard docstring |
| Function docstring | Chinese + English | Two-line format: Chinese first line, English second line |
| Inline comments | Chinese + English | Chinese line, then English line, above code |
| Code spacing | - | Blank line between code blocks |
"""
Lab 2: Q-Learning Agent for Cliff Walking
Student ID: 041107730
Implements Q-Learning using Bellman equation: Q(s,a) = r + γ * max Q(s',a')
Modified from Hybrid Activity 1 to solve the Cliff Walking problem.
"""
Two lines with Chinese first line, English second line:
def train(env, episodes: int = 50, gamma: float = 0.9) -> list:
"""训练Q-Learning智能体
Train Q-Learning agent"""
def reset() -> tuple:
"""重置环境到初始状态
Reset environment to initial state"""
Rules:
"""Chinese comment immediately followed by English comment, placed ABOVE code:
# 初始化Q表,使用随机值
# Initialize Q-table with random values
qtable = [[random.random() for _ in range(env.actions())] for _ in range(env.states())]
# 增加步数计数
# Increment step count
steps += 1
Rules:
# 使用贝尔曼方程更新Q表:Q(s,a) = r + γ * max Q(s',a')
# Update Q-table using Bellman equation: Q(s,a) = r + γ * max Q(s',a')
qtable[state][action] = reward + gamma * max(qtable[next_state])
# 衰减探索率,随着学习进行减少随机探索
# Decay exploration rate, reduce random exploration as learning progresses
epsilon -= decay * epsilon
IMPORTANT: Always add blank lines between code blocks:
def main():
# 打印程序标题
# Print program header
print("=" * 50)
# 创建悬崖行走环境
# Create Cliff Walking environment
env = GridEnv(size=12)
# 设置超参数
# Set hyperparameters
EPISODES = 50
GAMMA = 0.9
Rules:
For complex logic with multiple lines, keep Chinese and English paired line-by-line:
# 使用贝尔曼方程更新Q表:Q(s,a) = r + γ * max Q(s',a')
# Update Q-table using Bellman equation: Q(s,a) = r + γ * max Q(s',a')
# 这里alpha=1,即完全替换旧值(不使用加权平均)
# Here alpha=1, meaning completely replace old value (no weighted average)
# 完整公式应为:Q(s,a) = Q(s,a) + α * [r + γ * max Q(s',a') - Q(s,a)]
# Full formula should be: Q(s,a) = Q(s,a) + α * [r + γ * max Q(s',a') - Q(s,a)]
qtable[state][action] = reward + gamma * max(qtable[next_state])
# 检查是否掉下悬崖(底行,第1-10列)
# Check if agent fell off cliff (bottom row, columns 1-10)
# 原因:悬崖行走问题的核心机制,大负奖励惩罚掉入悬崖
# Reason: Core mechanism of Cliff Walking problem, large negative reward penalizes falling
if self.y == 3 and 1 <= self.x <= 10:
reward = -100
Add bilingual comments above imports:
# 导入抽象基类模块,用于定义环境接口
# Import abstract base class module for defining environment interface
import abc
# 导入操作系统、时间和随机模块
# Import os, time and random modules
import os
import time
import random
# 程序入口点,运行主函数
# Program entry point, run main function
if __name__ == "__main__":
main()
Before finishing:
# File docstring (English only)
"""
Lab 2: Q-Learning Agent
Implements Q-Learning algorithm
"""
# Function docstring (two-line bilingual)
def train(env):
"""训练Q-Learning智能体
Train Q-Learning agent"""
# Inline comment (line-by-line bilingual, above code)
# 初始化Q表,使用随机值
# Initialize Q-table with random values
qtable = [[random.random() for _ in range(env.actions())] for _ in range(env.states())]
# 增加步数计数
# Increment step count
steps += 1
"""
Lab 2: Q-Learning Agent for Cliff Walking
Student ID: 041107730
Implements Q-Learning using Bellman equation
"""
# 导入抽象基类模块,用于定义环境接口
# Import abstract base class module for defining environment interface
import abc
# 导入操作系统、时间和随机模块
# Import os, time and random modules
import os
import time
import random
class Env(abc.ABC):
"""环境抽象基类
Environment abstract base class"""
@abc.abstractmethod
def actions(self) -> int:
"""返回动作空间的大小
Return the size of action space"""
raise NotImplementedError()
def train(env, episodes: int = 50, gamma: float = 0.9) -> list:
"""训练Q-Learning智能体
Train Q-Learning agent"""
# 初始化Q表,使用随机值
# Initialize Q-table with random values
qtable = [[random.random() for _ in range(env.actions())] for _ in range(env.states())]
# 训练主循环,遍历所有回合
# Main training loop, iterate through all episodes
for episode in range(episodes):
# 重置环境,获取初始状态
# Reset environment and get initial state
state = env.reset()
# 使用贝尔曼方程更新Q表
qtable[state][action] = reward + gamma * (qtable[next_state])
qtable
__name__ == :
main()