Files
mp-xieyingeng/AGENTS.md
2026-04-24 21:44:22 +08:00

78 lines
5.8 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Repository Guidelines
## 项目结构与模块组织
本仓库是 `Cocos Creator 3.8.8` 小游戏项目。主入口在 `assets/main.ts`,主场景是 `assets/main.scene`。页面与弹窗组件集中在 `assets/prefabs/`,命名通常为 `PageXxx.ts``PassModal.ts`。公共逻辑位于 `assets/scripts/``core/` 放页面基类与视图管理,`utils/` 放 SDK、鉴权、存储、网络等工具`config/` 放接口配置,`types/` 放类型定义。静态资源在 `assets/resources/`,编辑器配置在 `settings/v2/packages/`,设计说明在 `docs/` 与根目录分析文档中。
## 构建、调试与开发命令
先运行 `npm install`,同步 `minigame-api-typings` 依赖。日常开发主要通过 Cocos Creator 编辑器完成:使用 3.8.8 打开仓库,点击 `Play` 预览,使用 `Project > Build``Cmd+B` 构建小游戏包。若编辑器已生成 `temp/tsconfig.cocos.json`,可执行 `npx tsc --noEmit` 做一次 TypeScript 静态检查。
## 代码风格与命名约定
项目使用 TypeScript当前代码统一为 4 空格缩进。组件类、页面类、管理器类使用 `PascalCase`,实例属性与私有方法使用 `camelCase` / `_camelCase`,管理器统一使用 `XxxManager` 后缀。新增页面、预制体、脚本请保持同名,例如 `PageLevel.prefab` 对应 `PageLevel.ts`。优先把复用逻辑放入 `assets/scripts/utils/``assets/scripts/core/`不要把业务代码散落到场景脚本中。Cocos 资源的 `.meta` 文件必须一并提交。
## 测试与验证
仓库当前未配置 Jest、Vitest 一类自动化测试。提交前至少完成三项验证1. 编辑器预览主流程可进入页面2. 目标平台构建成功3. 涉及微信能力时,在真机或开发者工具验证登录、分享、隐私授权等流程。若修改接口或体力/关卡逻辑,补充手动验证步骤到 PR 描述。
## 提交与 Pull Request 规范
Git 历史采用 Conventional Commits且摘要多为中文例如 `feat: 支持分享关卡通关上报``fix: 修复关卡排序``docs: 添加设计文档`。请继续使用 `feat:``fix:``perf:``docs:` 前缀首行聚焦单一变更。PR 需说明改动范围、影响页面或模块、验证方式;涉及 UI 请附截图或录屏,涉及微信环境差异请写明复现条件与平台。
<claude-mem-context>
# Memory Context
# [mp-xieyingeng] recent context, 2026-04-24 9:39pm GMT+8
Legend: 🎯session 🔴bugfix 🟣feature 🔄refactor ✅change 🔵discovery ⚖decision 🚨security_alert 🔐security_note
Format: ID TIME TYPE TITLE
Fetch details: get_observations([IDs]) | Search: mem-search skill
Stats: 45 obs (10,437t read) | 520,499t work | 98% savings
### Apr 24, 2026
101 8:46a 🟣 Live label display format updated to X/Y format
114 6:40p 🟣 Dynamic Input Layout Initialization in PageLevel Prefab
115 6:41p 🟣 Dynamic Punch Block Layout for PageLevel.prefab
116 " 🔵 Layout Component Configuration for Input and Punch Blocks
119 6:42p 🟣 Dynamic Input Blocks and Punch Layout System Implemented
121 " 🟣 PageLevel Prefab Updated with punchLayout Property
122 " 🔄 Cleanup After Dynamic Block Refactoring
124 " ✅ TypeScript Compilation Check in Progress
126 6:43p ✅ TypeScript Compilation Check Extended
127 " 🔄 Complete Diff of PageLevel.ts Dynamic Block System
128 " 🔵 PageLevel.prefab Changes Not Persisted
129 6:44p 🟣 PageLevel Prefab Correctly Updated with punchLayout
130 " ✅ TypeScript Compilation Blocked - Permission Required
133 6:45p 🔄 Extracted getPunchBlockLabel Helper Method
134 " 🔄 Template Node Hiding Logic Improved
136 6:48p ⚖️ TypeScript diagnostics disabled, using IDE/linter instead
138 " 🔄 PageLevel 输入方式从单框改为逐字格子
139 " 🔄 谐音梗展示从 Label 改为动态 Block 节点
140 " ✅ PageLevel.prefab 布局位置微调
165 8:08p 🟣 PageLevel input layout simplified to single-character boxes with auto-distribution
167 8:09p 🔵 PageLevel.ts input block structure and callback stubs discovered
168 " 🟣 Auto-distribute characters across input boxes and auto-submit on completion implemented
169 " 🔴 PageLevel.ts node cleanup now calls removeFromParent before destroy
170 8:10p 🔄 PageLevel.ts full diff: single EditBox replaced with per-character block system
171 " 🔴 distributeInputText() wrapped in try/finally to guarantee flag reset
179 8:23p ✅ Game011_3.ttf font relocated from resources/ to dedicated fonts/ bundle directory
180 " 🟣 PageLoading.ts now loads fonts as a dynamic bundle after level data, before UI
181 " 🔄 AssetManager import switched to type-only import in PageLoading.ts
182 8:31p 🟣 PageLevel input UX improvement: full-string editing support
183 " 🟣 PageLevel input UX: full-string editing implemented
186 8:34p 🔴 PageLevel: clear input text on wrong answer
187 8:35p 🟣 PageLevel: delay pass modal to show punchline
189 8:36p 🔄 PageLevel: level completion reporting made fire-and-forget
191 8:45p 🔴 PageLevel: punchline block cleanup improved
192 8:46p 🟣 PageLevel.ts TitleLevel Label variable reserved
193 8:47p 🔵 PageLevel.ts level number tracking mechanism discovered
195 " 🟣 PageLevel.ts TitleLevel dynamic label update implemented
196 8:53p 🔵 PageLevel punchline not updated from enterLevel API
198 " 🔴 LevelDataManager updateLevelDetails now includes punchline
199 " 🔴 PageLevel punchline flow and empty state layout fixed
200 8:54p 🔴 LevelDataManager preserves existing punchline when enter returns null
203 9:06p 🟣 PageLevel.ts 新增图片描述标签绑定字段
205 9:07p 🟣 PageLevel.ts 图片描述标签字段对接完成
206 9:09p ✅ PageLevel.ts 回退图片描述标签字段命名
208 9:11p 🟣 LevelDataManager 增加图片描述字段存储
Access 520k tokens of past work via get_observations([IDs]) or mem-search skill.
</claude-mem-context>