codeskill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecodeskill — AI Project Intelligence System
codeskill — AI项目智能系统
You manage the directory in projects — rules, behaviours, memory, snapshots, sessions, incidents, and learning loops.
.ai/你负责管理项目中的目录,涵盖规则、行为模式、记忆、快照、会话、事件记录和学习循环。
.ai/Command Routing
命令路由
Parse to determine which command to execute:
$ARGUMENTSARGS = "$ARGUMENTS"解析以确定要执行的命令:
$ARGUMENTSARGS = "$ARGUMENTS"If ARGS starts with "init"
若ARGS以"init"开头
Scaffold a new directory in the current project.
.ai/- Check if already exists. If yes, ask user: "
.ai/already exists. Overwrite? (This won't delete logs/memory)".ai/ - Detect project type by reading go.mod, package.json, pyproject.toml, etc.
- Get the user's GitHub username: and
git config user.namegit config user.email - Create the directory structure:
bash
mkdir -p .ai/{behaviours,skills/{backend,frontend,infra},workflows,guides} mkdir -p .ai/{snippets,prompts,memory/{feedback,decisions},templates} mkdir -p .ai/{logs/{sessions,activity,incidents},plans/features,tasks,snapshots,handoffs} - Create Tier 0 files:
- — project-specific rules (start with generated code table, code style, commits)
.ai/RULES.md - — empty with header and instructions
.ai/HOTFIXES.md - — project taste template with @username placeholders
.ai/taste.md
- Create Tier 1 files:
- — if project type detected, scan main dirs and describe structure
.ai/ARCHITECTURE.md - — extract from dependency files (go.mod, package.json, etc.)
.ai/STACK.md - — empty with header
.ai/PATTERNS.md
- Create domain skill files based on project type:
- Go project → ,
.ai/skills/backend/RULES.md,PATTERNS.mdSNIPPETS.md - Node project → ,
.ai/skills/frontend/RULES.md,PATTERNS.mdSNIPPETS.md
- Go project →
- Create INDEX.md files for: ,
snippets/,prompts/,memory/,logs/sessions/,logs/activity/,logs/incidents/,plans/snapshots/ - Create from
.ai/TASKS.md(master checklist)templates/tasks-index.md - Create directory and
.ai/memory/tasks/from.ai/memory/TASKS_LOG.mdtemplates/tasks-log.md - Create behaviour files: ,
default.md,careful.md,review.md,debug.mdwithscaffold.mdbehaviours/README.md - Copy templates from this skill's directory into
templates/.ai/templates/ - Create :
.ai/.gitignorelogs/ CONTINUATION.md memory/decisions/ tasks/ - Run the command to generate CLAUDE.md
sync - Report: "initialized. Edit RULES.md and taste.md, then run
.ai/."/codeskill sync
在当前项目中搭建新的目录。
.ai/- 检查是否已存在。若存在,询问用户:"
.ai/已存在。是否覆盖?(此操作不会删除日志/记忆内容)".ai/ - 通过读取go.mod、package.json、pyproject.toml等文件检测项目类型。
- 获取用户的GitHub用户名:执行和
git config user.namegit config user.email - 创建目录结构:
bash
mkdir -p .ai/{behaviours,skills/{backend,frontend,infra},workflows,guides} mkdir -p .ai/{snippets,prompts,memory/{feedback,decisions},templates} mkdir -p .ai/{logs/{sessions,activity,incidents},plans/features,tasks,snapshots,handoffs} - 创建Tier 0文件:
- — 项目专属规则(以生成的代码表、代码风格、提交规范开头)
.ai/RULES.md - — 空文件,包含标题和使用说明
.ai/HOTFIXES.md - — 项目风格模板,包含@username占位符
.ai/taste.md
- 创建Tier 1文件:
- — 若检测到项目类型,扫描主目录并描述结构
.ai/ARCHITECTURE.md - — 从依赖文件(go.mod、package.json等)中提取信息
.ai/STACK.md - — 空文件,包含标题
.ai/PATTERNS.md
- 根据项目类型创建领域技能文件:
- Go项目 → 、
.ai/skills/backend/RULES.md、PATTERNS.mdSNIPPETS.md - Node项目 → 、
.ai/skills/frontend/RULES.md、PATTERNS.mdSNIPPETS.md
- Go项目 →
- 为以下目录创建INDEX.md文件:、
snippets/、prompts/、memory/、logs/sessions/、logs/activity/、logs/incidents/、plans/snapshots/ - 从创建
templates/tasks-index.md(主任务清单).ai/TASKS.md - 创建目录,并从
.ai/memory/tasks/创建templates/tasks-log.md.ai/memory/TASKS_LOG.md - 创建行为模式文件:、
default.md、careful.md、review.md、debug.md,并附带scaffold.mdbehaviours/README.md - 将本技能目录中的模板复制到
templates/.ai/templates/ - 创建:
.ai/.gitignorelogs/ CONTINUATION.md memory/decisions/ tasks/ - 运行命令生成CLAUDE.md
sync - 反馈:"初始化完成。请编辑RULES.md和taste.md,然后运行
.ai/。"/codeskill sync
If ARGS starts with "sync"
若ARGS以"sync"开头
Regenerate CLAUDE.md from Tier 0 files.
.ai/- Read these source files (skip any that don't exist):
- (if global dir exists)
.ai/global/RULES.md .ai/RULES.md- (if global dir exists)
.ai/global/taste.md .ai/taste.md.ai/HOTFIXES.md- (or current active behaviour)
.ai/behaviours/default.md
- Read — get the last session entry for "Where We Left Off"
.ai/logs/sessions/INDEX.md - Read the CLAUDE.md template from this skill's
templates/claude-md.md - Assemble CLAUDE.md:
- Header with generation notice
- "Where We Left Off" section from last session
- Critical Rules (concatenate global + project RULES.md)
- Active Hotfixes
- Taste (global, then project overrides)
- Active Behaviour
- Memory Protocol instructions
- Exploration Protocol instructions
- Before Starting Work checklist
- Auto-Behaviour Hints
- Workflow Index (scan for files)
.ai/workflows/ - After Session instructions
- Reference links
- Write to project root
CLAUDE.md - Report: "CLAUDE.md regenerated. Tier 0: ~[X] lines."
从的Tier 0文件重新生成CLAUDE.md。
.ai/- 读取以下源文件(跳过不存在的文件):
- (若global目录存在)
.ai/global/RULES.md .ai/RULES.md- (若global目录存在)
.ai/global/taste.md .ai/taste.md.ai/HOTFIXES.md- (或当前激活的行为模式)
.ai/behaviours/default.md
- 读取— 获取最后一条会话记录作为“上次进度”
.ai/logs/sessions/INDEX.md - 读取本技能中的CLAUDE.md模板
templates/claude-md.md - 组装CLAUDE.md:
- 包含生成说明的标题
- 来自最后一次会话的“上次进度”部分
- 关键规则(合并全局+项目RULES.md内容)
- 当前激活的热修复
- 风格偏好(全局设置,后接项目覆盖内容)
- 当前激活的行为模式
- 记忆协议说明
- 探索协议说明
- 开始工作前的检查清单
- 自动行为模式提示
- 工作流索引(扫描中的文件)
.ai/workflows/ - 会话结束后的操作说明
- 参考链接
- 写入项目根目录的
CLAUDE.md - 反馈:"CLAUDE.md已重新生成。Tier 0内容约[X]行。"
If ARGS starts with "behaviour"
若ARGS以"behaviour"开头
Switch or list behaviour profiles.
If ARGS is "behaviour list":
- Glob (exclude README.md)
.ai/behaviours/*.md - For each, read the frontmatter and
namedescription - Print table: name, description, active?
If ARGS is "behaviour [name]":
- Check exists
.ai/behaviours/<name>.md - If not, list available behaviours and ask user to pick
- Read the behaviour file
- Run to regenerate CLAUDE.md with new active behaviour
sync - Report: "Switched to mode."
<name>
切换或列出行为模式配置文件。
若ARGS为"behaviour list":
- 匹配(排除README.md)
.ai/behaviours/*.md - 对每个文件,读取前置元数据中的和
namedescription - 打印表格:名称、描述、是否激活?
若ARGS为"behaviour [name]":
- 检查是否存在
.ai/behaviours/<name>.md - 若不存在,列出可用的行为模式并请用户选择
- 读取该行为模式文件
- 运行以使用新的激活行为模式重新生成CLAUDE.md
sync - 反馈:"已切换至模式。"
<name>
If ARGS starts with "learn"
若ARGS以"learn"开头
Mid-session learning — save AND apply immediately in the current session.
This is the user saying "learn this NOW" — not waiting for session end.
- Parse what to learn from ARGS after "learn"
- Classify the learning type:
- Contains "always"/"never" → rule candidate
- Contains "I prefer"/"I hate"/"I like" → taste candidate
- Contains code/pattern → snippet/pattern candidate
- Contains "remember"/"don't forget" → factual memory
- Otherwise → correction/feedback
- Classify scope (project/global_candidate) using standard logic
- Check for duplicates in memory/feedback/ and RULES.md
- If similar exists → update it instead of creating new
- Save to with
.ai/memory/feedback/<slug>.mdtrigger: "user explicit (learn this)" - APPLY IMMEDIATELY — add to your working context for the rest of this session:
- Treat it as highest-priority rule for current conversation
- Don't wait for session end
- Check promotion: Is this the 3rd+ time this correction was saved?
- If yes → propose adding to RULES.md or taste.md right now
- If no → report occurrence count
- If this looks like a taste update (style/naming/preference):
- Ask: "Should I update taste.md with this? (It will apply to all future sessions)"
- Report: "Learned and applying now: <summary>. Occurrence #<N>."
Undo: If user says "undo the last thing I told you to learn" or "I changed my mind about X":
- Find the most recent feedback/ entry from this session (or matching X)
- Delete it
- Remove from in-session working context
- Report: "Removed: <summary>. No longer applying."
会话中即时学习 — 保存并立即在当前会话中应用。
这表示用户要求“立即学习这个” — 无需等到会话结束。
- 解析ARGS中"learn"之后的学习内容
- 分类学习类型:
- 包含"always"/"never" → 规则候选
- 包含"I prefer"/"I hate"/"I like" → 风格偏好候选
- 包含代码/模式 → 代码片段/模式候选
- 包含"remember"/"don't forget" → 事实记忆
- 其他 → 修正/反馈
- 使用标准逻辑分类范围(项目/全局候选)
- 检查memory/feedback/和RULES.md中是否存在重复内容
- 若存在相似内容 → 更新已有条目而非创建新条目
- 将内容保存至,并标记
.ai/memory/feedback/<slug>.mdtrigger: "user explicit (learn this)" - 立即应用 — 将其添加到当前会话的工作上下文:
- 在当前对话中视为最高优先级规则
- 无需等待会话结束
- 检查升级条件:此修正是否已保存3次及以上?
- 若是 → 提议立即添加到RULES.md或taste.md
- 若否 → 报告出现次数
- 若此更新属于风格偏好(样式/命名/偏好):
- 询问:"是否要将此更新到taste.md?(将应用于所有未来会话)"
- 反馈:"已学习并立即应用:<摘要>。出现次数#<N>。"
撤销:若用户说"undo the last thing I told you to learn"或"I changed my mind about X":
- 查找本次会话中最近的feedback/条目(或匹配X的条目)
- 删除该条目
- 从会话工作上下文中移除
- 反馈:"已移除:<摘要>。不再应用。"
If ARGS starts with "session start"
若ARGS以"session start"开头
Load context and report status.
- Get user info: ,
git config user.namegit config user.email - Check for in project root:
CONTINUATION.md- If exists: read it, report "Resuming from: [task]", delete the file
- Read — report active hotfixes count
.ai/HOTFIXES.md - Read — get last session date
.ai/logs/sessions/INDEX.md - Session diff: run to see what changed
git log --oneline --since="<last_session_date>" - Check snapshot staleness: for each snapshot in , run
.ai/snapshots/INDEX.mdgit diff --name-only <hash> HEAD -- <globs> - Report:
Session started for @<username> Last session: <date> — <goal> Since then: <N> commits, <files changed> Hotfixes active: <N> Snapshots: <N> fresh, <N> stale
加载上下文并报告状态。
- 获取用户信息:、
git config user.namegit config user.email - 检查项目根目录中是否存在:
CONTINUATION.md- 若存在:读取内容,反馈"恢复自:[任务]",然后删除该文件
- 读取— 报告当前激活的热修复数量
.ai/HOTFIXES.md - 读取— 获取最后一次会话的日期
.ai/logs/sessions/INDEX.md - 会话差异:执行查看变更内容
git log --oneline --since="<last_session_date>" - 检查快照时效性:对于中的每个快照,执行
.ai/snapshots/INDEX.mdgit diff --name-only <hash> HEAD -- <globs> - 反馈:
已为@<username>启动会话 上次会话:<日期> — <目标> 自上次以来:<N>次提交,<N>个文件变更 当前激活热修复:<N> 快照状态:<N>个最新,<N>个过期
If ARGS starts with "session end"
若ARGS以"session end"开头
Write session summary and activity log.
- Get user info from git config
- Ask user (or infer from conversation): "What was the goal of this session?"
- Scan the conversation for:
- Files changed (from tool calls)
- Decisions made
- Corrections received
- Mistakes / incidents
- Generate timestamp:
date +%Y-%m-%d-%H%M - Write session log to using template:
.ai/logs/sessions/<timestamp>.mdmarkdown# Session: <timestamp> **User**: <name> (<email>) **GitHub**: @<username> **Goal**: <goal> **Outcome**: <completed|partial|failed> **Behaviour**: <active behaviour> **Files Changed**: <count> ## Actions - <bullet list of what was done> ## Decisions Made - <decisions, linked to memory/decisions/ if saved> ## Corrections Received - <corrections, linked to memory/feedback/ if saved> ## Mistakes - <any mistakes or incidents> - Write activity log to using compact format:
.ai/logs/activity/<timestamp>.mdmarkdown# Activity: <timestamp> **User**: <name> (<email>) **GitHub**: @<username> **Behaviour**: <active> **Prompt Count**: <N> --- ## #1 — <time> "<user prompt>" → Loaded: <workflow> | Files: <files> | Correction: <yes/no> ## #2 — <time> ... - Update — append one-line entry
.ai/logs/sessions/INDEX.md - Update — append one-line entry
.ai/logs/activity/INDEX.md - Update "Where We Left Off" and run to regenerate CLAUDE.md
sync - Check promotion thresholds:
- Any feedback item with 3+ occurrences? → suggest RULES.md update
- Any hotfix 30+ days without recurrence? → suggest graduation/archive
- Report: "Session logged. <N> corrections saved, <N> decisions logged."
写入会话摘要和活动日志。
- 从git配置中获取用户信息
- 询问用户(或从对话中推断):"本次会话的目标是什么?"
- 扫描对话内容以获取:
- 变更的文件(来自工具调用)
- 做出的决策
- 收到的修正
- 错误/事件
- 生成时间戳:
date +%Y-%m-%d-%H%M - 使用模板将会话日志写入:
.ai/logs/sessions/<timestamp>.mdmarkdown# Session: <timestamp> **User**: <name> (<email>) **GitHub**: @<username> **Goal**: <goal> **Outcome**: <completed|partial|failed> **Behaviour**: <active behaviour> **Files Changed**: <count> ## Actions - <完成操作的项目符号列表> ## Decisions Made - <决策内容,若已保存则链接到memory/decisions/> ## Corrections Received - <修正内容,若已保存则链接到memory/feedback/> ## Mistakes - <任何错误或事件> - 使用紧凑格式将活动日志写入:
.ai/logs/activity/<timestamp>.mdmarkdown# Activity: <timestamp> **User**: <name> (<email>) **GitHub**: @<username> **Behaviour**: <active> **Prompt Count**: <N> --- ## #1 — <time> "<user prompt>" → Loaded: <workflow> | Files: <files> | Correction: <yes/no> ## #2 — <time> ... - 更新— 添加一行条目
.ai/logs/sessions/INDEX.md - 更新— 添加一行条目
.ai/logs/activity/INDEX.md - 更新“上次进度”并运行重新生成CLAUDE.md
sync - 检查升级阈值:
- 任何反馈条目出现3次及以上?→ 建议更新RULES.md
- 任何热修复30天及以上未复发?→ 建议升级/归档
- 反馈:"会话已记录。已保存<N>条修正,已记录<N>项决策。"
If ARGS starts with "continue"
若ARGS以"continue"开头
Load emergency resume file.
- Check for in project root
CONTINUATION.md - If not found: "No continuation file found. Start a fresh session with ."
/codeskill session start - If found: read and display it, then delete it
- Report: "Loaded resume point. Continuation file deleted."
加载紧急恢复文件。
- 检查项目根目录中是否存在
CONTINUATION.md - 若未找到:"未找到恢复文件。请使用启动新会话。"
/codeskill session start - 若找到:读取并显示内容,然后删除该文件
- 反馈:"已加载恢复点。恢复文件已删除。"
If ARGS starts with "feedback"
若ARGS以"feedback"开头
Save a user correction to memory.
- Get user info from git config
- Parse the correction from ARGS (after "feedback"), or ask user to describe it
- Classify:
- Does it reference project-specific files/paths? →
scope: project - Is it about general coding/AI behaviour? →
scope: global_candidate
- Does it reference project-specific files/paths? →
- Check for duplicates: grep for similar content
.ai/memory/feedback/- If similar exists: update the existing entry instead of creating new
- Generate filename from correction summary (slugified)
- Write to :
.ai/memory/feedback/<slug>.mdmarkdown--- date: <today> type: correction user: "@<username>" scope: <project|global_candidate> trigger: "<what AI did wrong>" --- <correction content> - Update
.ai/memory/INDEX.md - Apply immediately in current session (add to working context)
- If scope is : "This looks global (no project-specific refs). Consider adding to your global repo."
global_candidate - Report: "Saved correction to memory/feedback/<slug>.md. Applying for this session."
将用户修正保存到记忆中。
- 从git配置中获取用户信息
- 解析ARGS中"feedback"之后的修正内容,或询问用户描述修正内容
- 分类:
- 是否涉及项目特定文件/路径?→
scope: project - 是否关于通用编码/AI行为?→
scope: global_candidate
- 是否涉及项目特定文件/路径?→
- 检查重复内容:在中搜索相似内容
.ai/memory/feedback/- 若存在相似内容:更新已有条目而非创建新条目
- 根据修正摘要生成文件名(slug格式)
- 将内容写入:
.ai/memory/feedback/<slug>.mdmarkdown--- date: <today> type: correction user: "@<username>" scope: <project|global_candidate> trigger: "<AI的错误行为>" --- <修正内容> - 更新
.ai/memory/INDEX.md - 在当前会话中立即应用(添加到工作上下文)
- 若范围为:"此内容看起来是全局通用的(无项目特定引用)。考虑添加到你的全局仓库。"
global_candidate - 反馈:"已将修正保存到memory/feedback/<slug>.md。将在本次会话中应用。"
If ARGS starts with "decide"
若ARGS以"decide"开头
Log an AI decision to memory.
- Get user info from git config
- Parse decision title and context from ARGS
- Ask user if not provided:
- What was decided?
- What alternatives were considered?
- Why this choice?
- Classify scope (same logic as feedback)
- Write to :
.ai/memory/decisions/<slug>.mdmarkdown--- date: <today> type: decision user: "@<username>" scope: <project|global_candidate> context: "<what prompted this decision>" --- # <Decision Title> **Decision**: <what was decided> **Alternatives**: <what else was considered> **Why**: <reasoning> **Trade-off**: <what we gave up> **Outcome**: pending review - Update
.ai/memory/INDEX.md - Report: "Decision logged to memory/decisions/<slug>.md"
将AI决策记录到记忆中。
- 从git配置中获取用户信息
- 解析ARGS中的决策标题和上下文
- 若未提供则询问用户:
- 做出了什么决策?
- 考虑过哪些替代方案?
- 为何选择此方案?
- 分类范围(与feedback逻辑相同)
- 将内容写入:
.ai/memory/decisions/<slug>.mdmarkdown--- date: <today> type: decision user: "@<username>" scope: <project|global_candidate> context: "<触发此决策的场景>" --- # <决策标题> **Decision**: <决策内容> **Alternatives**: <其他考虑的方案> **Why**: <决策理由> **Trade-off**: <做出的妥协> **Outcome**: pending review - 更新
.ai/memory/INDEX.md - 反馈:"决策已记录到memory/decisions/<slug>.md"
If ARGS starts with "incident"
若ARGS以"incident"开头
Create an incident report.
- Get user info from git config
- Parse description from ARGS, or ask user to describe what went wrong
- Check for similar past incidents (same category)
.ai/logs/incidents/INDEX.md - Count recurrences
- Generate timestamp filename
- Write to :
.ai/logs/incidents/<date>-<slug>.mdmarkdown# Incident: <short description> **Date**: <today> **User**: @<username> **Severity**: <low|medium|high|critical> **Category**: <generated-code|db-access|graphql|config|deployment|testing|other> **Rule Violated**: <ref or "none — new rule needed"> **Recurrence**: <1st|2nd|Nth> ## What Happened <description> ## Root Cause <why the AI made this mistake> ## Detection Signal <how to catch this next time> ## Prevention - [ ] Added to HOTFIXES.md (if recurrence >= 2) - [ ] Updated relevant workflow/rule - [ ] Saved correction to memory/feedback/ - Update
.ai/logs/incidents/INDEX.md - If recurrence >= 2: auto-add to and run
.ai/HOTFIXES.mdsync - Report: "Incident logged. Recurrence: <N>." + hotfix promotion if applicable
创建事件报告。
- 从git配置中获取用户信息
- 解析ARGS中的描述内容,或询问用户描述问题
- 检查中是否存在相似的过往事件(同一类别)
.ai/logs/incidents/INDEX.md - 统计复发次数
- 生成时间戳文件名
- 将内容写入:
.ai/logs/incidents/<date>-<slug>.mdmarkdown# Incident: <简短描述> **Date**: <today> **User**: @<username> **Severity**: <low|medium|high|critical> **Category**: <generated-code|db-access|graphql|config|deployment|testing|other> **Rule Violated**: <规则引用或"none — new rule needed"> **Recurrence**: <1st|2nd|Nth> ## What Happened <事件描述> ## Root Cause <AI犯错的原因> ## Detection Signal <下次如何检测此类问题> ## Prevention - [ ] 添加到HOTFIXES.md(若复发次数>=2) - [ ] 更新相关工作流/规则 - [ ] 将修正保存到memory/feedback/ - 更新
.ai/logs/incidents/INDEX.md - 若复发次数>=2:自动添加到并运行
.ai/HOTFIXES.mdsync - 反馈:"事件已记录。复发次数:<N>。" + 若适用则提示热修复升级
If ARGS starts with "hotfix"
若ARGS以"hotfix"开头
If ARGS is "hotfix add [description]":
- Parse description
- Assign next HF-NNN number (read HOTFIXES.md for highest)
- Append to
.ai/HOTFIXES.md - Run to update CLAUDE.md
sync - Report: "Added HF-<NNN> to HOTFIXES.md."
If ARGS is "hotfix review":
- Read
.ai/HOTFIXES.md - For each hotfix, check for last recurrence date
.ai/logs/incidents/INDEX.md - Flag hotfixes with no recurrence in 30+ days
- For each stale hotfix, ask user: "Graduate to RULES.md, or archive?"
- Apply changes, run
sync
若ARGS为"hotfix add [description]":
- 解析描述内容
- 分配下一个HF-NNN编号(读取HOTFIXES.md中的最高编号)
- 将内容追加到
.ai/HOTFIXES.md - 运行更新CLAUDE.md
sync - 反馈:"已添加HF-<NNN>到HOTFIXES.md。"
若ARGS为"hotfix review":
- 读取
.ai/HOTFIXES.md - 对每个热修复,检查中的最后复发日期
.ai/logs/incidents/INDEX.md - 标记30天及以上未复发的热修复
- 对每个过期热修复,询问用户:"升级到RULES.md,还是归档?"
- 应用变更,运行
sync
If ARGS starts with "snapshot"
若ARGS以"snapshot"开头
If ARGS is "snapshot list":
- Read
.ai/snapshots/INDEX.md - For each entry, run:
git diff --name-only <git_hash> HEAD -- <watched_globs> - Print table: topic | last updated | status (fresh/stale) | files changed
If ARGS is "snapshot check [topic]":
- Read frontmatter
.ai/snapshots/<topic>.md - Run:
git diff --name-only <git_hash> HEAD -- <watched_globs> - Report: "fresh" or "stale (N files changed: ...)"
If ARGS is "snapshot refresh [topic]":
- Read frontmatter for
.ai/snapshots/<topic>.mdfiles_watched - Spawn an Explore agent scoped to those file globs
- Write exploration findings to with fresh git_hash from
.ai/snapshots/<topic>.mdgit rev-parse HEAD - Update
.ai/snapshots/INDEX.md - Report: "Snapshot <topic> refreshed."
If ARGS is "snapshot refresh --all":
- Run snapshot list logic, find all stale snapshots
- For each stale one, run snapshot refresh
If ARGS is "snapshot create [topic]":
- Ask user: "What files/dirs should this snapshot cover?" (get globs)
- Spawn Explore agent for that area
- Write with frontmatter: topic, description, git_hash, files_watched
.ai/snapshots/<topic>.md - Update
.ai/snapshots/INDEX.md - Report: "Snapshot <topic> created."
若ARGS为"snapshot list":
- 读取
.ai/snapshots/INDEX.md - 对每个条目,执行:
git diff --name-only <git_hash> HEAD -- <watched_globs> - 打印表格:主题 | 最后更新时间 | 状态(最新/过期) | 变更文件
若ARGS为"snapshot check [topic]":
- 读取的前置元数据
.ai/snapshots/<topic>.md - 执行:
git diff --name-only <git_hash> HEAD -- <watched_globs> - 反馈:"最新"或"过期(N个文件变更:...)"
若ARGS为"snapshot refresh [topic]":
- 读取前置元数据中的
.ai/snapshots/<topic>.mdfiles_watched - 生成Explore代理,限定在这些文件匹配规则范围内
- 将探索结果写入,并使用
.ai/snapshots/<topic>.md获取的最新git_hashgit rev-parse HEAD - 更新
.ai/snapshots/INDEX.md - 反馈:"已刷新快照<topic>。"
若ARGS为"snapshot refresh --all":
- 执行snapshot list逻辑,找出所有过期快照
- 对每个过期快照,执行snapshot refresh
若ARGS为"snapshot create [topic]":
- 询问用户:"此快照应涵盖哪些文件/目录?"(获取匹配规则)
- 生成该区域的Explore代理
- 写入,包含前置元数据:topic、description、git_hash、files_watched
.ai/snapshots/<topic>.md - 更新
.ai/snapshots/INDEX.md - 反馈:"已创建快照<topic>。"
If ARGS starts with "snippet"
若ARGS以"snippet"开头
If ARGS is "snippet [name]":
-
Searchfor matching name/tags
.ai/snippets/INDEX.md -
If found: display it
-
If not found: ask user for code, tags, usage context
-
Write to:
.ai/snippets/<name>.mdmarkdown# Snippet: <Name> **Tags**: <tag1, tag2> **Used in**: <context> ## Code ```<lang> <code>When to Use
<description> ``` -
Update
.ai/snippets/INDEX.md
若ARGS为"snippet [name]":
-
在中搜索匹配的名称/标签
.ai/snippets/INDEX.md -
若找到:显示内容
-
若未找到:询问用户获取代码、标签、使用场景
-
将内容写入:
.ai/snippets/<name>.mdmarkdown# Snippet: <Name> **Tags**: <tag1, tag2> **Used in**: <使用场景> ## Code ```<lang> <code>When to Use
<使用说明>undefined -
更新
.ai/snippets/INDEX.md
If ARGS starts with "prompt"
若ARGS以"prompt"开头
If ARGS is "prompt [name]":
- Search for matching name
.ai/prompts/INDEX.md - If found: display it
- If not found: ask user for template text, tags, workflow reference
- Write to :
.ai/prompts/<name>.mdmarkdown# Prompt: <Name> **Tags**: <tag1, tag2> **Workflow**: <workflow reference or "none"> **Behaviour**: <recommended behaviour> ## Template <prompt template text with [PLACEHOLDERS]> ## Variants <optional variant prompts> - Update
.ai/prompts/INDEX.md
若ARGS为"prompt [name]":
- 在中搜索匹配的名称
.ai/prompts/INDEX.md - 若找到:显示内容
- 若未找到:询问用户获取模板文本、标签、工作流引用
- 将内容写入:
.ai/prompts/<name>.mdmarkdown# Prompt: <Name> **Tags**: <tag1, tag2> **Workflow**: <工作流引用或"none"> **Behaviour**: <推荐的行为模式> ## Template <包含[PLACEHOLDERS]的提示词模板文本> ## Variants <可选的变体提示词> - 更新
.ai/prompts/INDEX.md
If ARGS starts with "plan"
若ARGS以"plan"开头
Manage feature plans. Plans live in .
.ai/plans/features/If ARGS is "plan [title]" — Create a new feature plan:
- Parse title from ARGS, generate slug (kebab-case)
- Ensure exists — if not, create from
.ai/plans/PLAN.mdtemplates/plan-index.md - Ensure directory exists
.ai/plans/features/ - Ask user for: goal, non-goals, requirements with priorities
- Write to using
.ai/plans/features/<slug>-plan.mdtemplates/plan.md - Update — add entry to Active Plans table
.ai/plans/PLAN.md - Report: "Plan created at plans/features/<slug>-plan.md"
If ARGS is "plan list" — Show all plans:
- Read
.ai/plans/PLAN.md - Display active and completed tables
If ARGS is "plan archive [slug]" — Archive a completed plan:
- Move to
.ai/plans/features/<slug>-plan.md.ai/memory/plans/<slug>-plan.md - Move entry from Active to Completed in PLAN.md
- Report: "Plan archived to memory/plans/"
管理功能计划。计划存储在中。
.ai/plans/features/若ARGS为"plan [title]" — 创建新的功能计划:
- 解析ARGS中的标题,生成slug(短横线分隔格式)
- 确保存在 — 若不存在,从
.ai/plans/PLAN.md创建templates/plan-index.md - 确保目录存在
.ai/plans/features/ - 询问用户获取:目标、非目标、带优先级的需求
- 使用将内容写入
templates/plan.md.ai/plans/features/<slug>-plan.md - 更新— 在活动计划表格中添加条目
.ai/plans/PLAN.md - 反馈:"计划已创建于plans/features/<slug>-plan.md"
若ARGS为"plan list" — 显示所有计划:
- 读取
.ai/plans/PLAN.md - 显示活动计划和已完成计划表格
若ARGS为"plan archive [slug]" — 归档已完成的计划:
- 将移动到
.ai/plans/features/<slug>-plan.md.ai/memory/plans/<slug>-plan.md - 在PLAN.md中将条目从活动计划移至已完成计划
- 反馈:"计划已归档到memory/plans/"
If ARGS starts with "task"
若ARGS以"task"开头
Manage the task system. Tasks live as individual files in with a master checklist at .
.ai/tasks/.ai/TASKS.mdIf ARGS is "task add [description]" — Create a new task:
- Parse description and infer priority (or ask user)
- Determine next ID: scan and
.ai/tasks/for highest.ai/memory/tasks/, next = N+1task{N}_*.md - Generate slug from description (kebab-case)
- Write :
.ai/tasks/task{id}_{slug}.mdmarkdown--- id: {id} title: '<title>' status: pending priority: <high|medium|low> feature: '<feature or plan name if relevant>' dependencies: [] created_at: "<timestamp>" --- ## Description <what needs to be done> ## Details - <specific requirements or steps> ## Test Strategy <how to verify this is done> - Update — append entry:
.ai/TASKS.md- [ ] **ID {id}: {Title}** (Priority: {priority})> {Description} - Report: "Task {id} created: {title}"
If ARGS is "task list" — Show all tasks:
- Read and display
.ai/TASKS.md
If ARGS is "task start [id]" — Start working on a task:
- Read task file, check dependencies are all completed
- If dependencies not met → report which are blocking
- Complexity check — before starting, assess if the task needs expansion:
- Involves changes across 3+ unrelated files/modules?
- Has 5+ acceptance criteria or detail items?
- Would take more than ~2-3 hours of focused work?
- Has high uncertainty or multiple distinct outcomes? If YES to 2+ of these → recommend expansion:
- Propose sub-tasks with titles, descriptions, dependencies
- Ask user: "This task looks complex. Expand into sub-tasks?"
- If user agrees → create sub-tasks as ,
task{id}.1, etc.task{id}.2 - Update parent task's Details section with sub-task list
- If user declines → proceed normally
- Update task YAML: ,
status: inprogressstarted_at: <timestamp> - Update entry:
.ai/TASKS.md→[ ][-] - Report: "Started task {id}: {title}"
If ARGS is "task done [id]" — Mark task completed:
- If task has → ask user: "Run tests or mark complete?"
## Test Strategy - Update task YAML: ,
status: completedcompleted_at: <timestamp> - Update entry:
.ai/TASKS.md→[-][x] - Report: "Completed task {id}: {title}"
If ARGS is "task fail [id] [reason]" — Mark task failed:
- Update task YAML: ,
status: failed,error_log: <reason>completed_at: <timestamp> - Update entry →
.ai/TASKS.md[!] ... (Failed) - Report: "Failed task {id}: {reason}"
If ARGS is "task next" — Start the next available task:
- Read , find first
.ai/TASKS.md(pending) entry[ ] - Check its dependencies
- If met → start it (same as )
task start - If not met → find next pending with met dependencies
If ARGS is "task archive" — Archive completed/failed tasks:
- Scan for files with
.ai/tasks/orstatus: completedstatus: failed - For each:
- Read full content (title, description, dependencies)
- Move file to
.ai/memory/tasks/ - Append to :
.ai/memory/TASKS_LOG.md- Archived **ID {id}: {Title}** (Status: {status}) on {timestamp}> {Description} - Remove entry from
.ai/TASKS.md
- Report: "Archived {N} tasks to memory/tasks/"
If ARGS is "task show [id]" — Show task details:
- Find in
task{id}_*.mdor.ai/tasks/.ai/memory/tasks/ - Display full content
TASKS.md icons:
- pending
[ ] - in-progress
[-] - completed
[x] - failed
[!]
管理任务系统。任务作为单独文件存储在中,主任务清单位于。
.ai/tasks/.ai/TASKS.md若ARGS为"task add [description]" — 创建新任务:
- 解析描述内容并推断优先级(或询问用户)
- 确定下一个ID:扫描和
.ai/tasks/中的最高.ai/memory/tasks/,下一个ID为N+1task{N}_*.md - 根据描述生成slug(短横线分隔格式)
- 写入:
.ai/tasks/task{id}_{slug}.mdmarkdown--- id: {id} title: '<title>' status: pending priority: <high|medium|low> feature: '<相关功能或计划名称>' dependencies: [] created_at: "<timestamp>" --- ## Description <任务内容> ## Details - <具体需求或步骤> ## Test Strategy <验证任务完成的方式> - 更新— 添加条目:
.ai/TASKS.md- [ ] **ID {id}: {Title}** (Priority: {priority})> {Description} - 反馈:"已创建任务{id}:{title}"
若ARGS为"task list" — 显示所有任务:
- 读取并显示
.ai/TASKS.md
若ARGS为"task start [id]" — 开始处理任务:
- 读取任务文件,检查所有依赖是否已完成
- 若依赖未满足 → 报告阻塞的依赖项
- 复杂度检查 — 开始前评估任务是否需要拆分:
- 是否涉及3个及以上不相关文件/模块的变更?
- 是否有5个及以上验收标准或细节项?
- 是否需要超过约2-3小时的专注工作?
- 是否存在高度不确定性或多种不同结果? 若以上有2项及以上为是 → 建议拆分:
- 提出子任务的标题、描述、依赖关系
- 询问用户:"此任务看起来复杂。是否拆分为子任务?"
- 若用户同意 → 创建子任务为、
task{id}.1等task{id}.2 - 更新父任务的Details部分,添加子任务列表
- 若用户拒绝 → 正常进行
- 更新任务YAML:,
status: inprogressstarted_at: <timestamp> - 更新中的条目:
.ai/TASKS.md→[ ][-] - 反馈:"已开始任务{id}:{title}"
若ARGS为"task done [id]" — 标记任务完成:
- 若任务包含→ 询问用户:"运行测试还是标记完成?"
## Test Strategy - 更新任务YAML:,
status: completedcompleted_at: <timestamp> - 更新中的条目:
.ai/TASKS.md→[-][x] - 反馈:"已完成任务{id}:{title}"
若ARGS为"task fail [id] [reason]" — 标记任务失败:
- 更新任务YAML:,
status: failed,error_log: <reason>completed_at: <timestamp> - 更新中的条目 →
.ai/TASKS.md[!] ... (Failed) - 反馈:"任务{id}失败:{reason}"
若ARGS为"task next" — 开始下一个可用任务:
- 读取,找到第一个
.ai/TASKS.md(待处理)条目[ ] - 检查其依赖项
- 若依赖满足 → 开始任务(与相同)
task start - 若依赖未满足 → 找到下一个依赖满足的待处理任务
若ARGS为"task archive" — 归档已完成/失败的任务:
- 扫描中
.ai/tasks/或status: completed的文件status: failed - 对每个文件:
- 读取完整内容(标题、描述、依赖关系)
- 将文件移动到
.ai/memory/tasks/ - 将内容追加到:
.ai/memory/TASKS_LOG.md- Archived **ID {id}: {Title}** (Status: {status}) on {timestamp}> {Description} - 从中移除条目
.ai/TASKS.md
- 反馈:"已归档{N}个任务到memory/tasks/"
若ARGS为"task show [id]" — 显示任务详情:
- 在或
.ai/tasks/中查找.ai/memory/tasks/task{id}_*.md - 显示完整内容
TASKS.md图标说明:
- 待处理
[ ] - 进行中
[-] - 已完成
[x] - 失败
[!]
If ARGS starts with "handoff"
若ARGS以"handoff"开头
Generate a handoff document for downstream repos/teams.
If ARGS is "handoff [plan-slug]" — Generate handoff from a plan:
- Read
.ai/plans/features/<slug>-plan.md - If plan has no "Handoff Context" section or it's empty → ask user:
- What downstream repo needs this?
- What was built? (endpoints, schemas, events)
- What's the interface contract? (response shapes, payloads)
- Decisions that affect downstream?
- How to sync? (SDK regen command, config update)
- Fill the "Handoff Context" section in the plan
- Also generate a standalone handoff file at :
.ai/handoffs/<slug>.mdmarkdown# Handoff: <Plan Title> **From**: <this repo> **To**: <downstream repo> **Date**: <today> **Plan**: plans/features/<slug>-plan.md ## What Was Built <endpoints, schemas, APIs, events> ## Interface Contract <response shapes, payloads, types> ## Decisions Affecting Downstream <key choices that downstream needs to know about> ## How to Sync <commands to run, config to update, deploy steps> ## Tasks for Downstream - [ ] <suggested task 1> - [ ] <suggested task 2> - Report: "Handoff generated. Share with downstream repo."
.ai/handoffs/<slug>.md
If ARGS is "handoff list" — Show all handoffs:
- List files in
.ai/handoffs/
为下游仓库/团队生成交接文档。
若ARGS为"handoff [plan-slug]" — 根据计划生成交接文档:
- 读取
.ai/plans/features/<slug>-plan.md - 若计划中没有"Handoff Context"部分或为空 → 询问用户:
- 哪个下游仓库需要此文档?
- 构建了什么?(端点、 schema、事件)
- 接口契约是什么?(响应格式、负载)
- 影响下游的决策有哪些?
- 如何同步?(SDK重新生成命令、配置更新)
- 填充计划中的"Handoff Context"部分
- 同时生成独立的交接文件:
.ai/handoffs/<slug>.mdmarkdown# Handoff: <Plan Title> **From**: <当前仓库> **To**: <下游仓库> **Date**: <today> **Plan**: plans/features/<slug>-plan.md ## What Was Built <端点、schema、API、事件> ## Interface Contract <响应格式、负载、类型> ## Decisions Affecting Downstream <下游需要了解的关键决策> ## How to Sync <要运行的命令、要更新的配置、部署步骤> ## Tasks for Downstream - [ ] <建议的任务1> - [ ] <建议的任务2> - 反馈:"交接文档已生成。请分享给下游仓库。"
.ai/handoffs/<slug>.md
若ARGS为"handoff list" — 显示所有交接文档:
- 列出中的文件
.ai/handoffs/
If ARGS starts with "memory search"
若ARGS以"memory search"开头
Search feedback and decisions.
- Parse query from ARGS after "memory search"
- Grep and
.ai/memory/feedback/for the query.ai/memory/decisions/ - Display matching entries with file paths
搜索反馈和决策内容。
- 解析ARGS中"memory search"之后的查询内容
- 在和
.ai/memory/feedback/中搜索查询内容.ai/memory/decisions/ - 显示匹配的条目及其文件路径
If ARGS starts with "status"
若ARGS以"status"开头
Show current system state.
- Read active behaviour (from CLAUDE.md or behaviours/)
- Count active hotfixes in HOTFIXES.md
- Count recent incidents (last 30 days) from logs/incidents/INDEX.md
- Check snapshot staleness (summary: N fresh, N stale)
- Count feedback entries and decisions
- Read last session from logs/sessions/INDEX.md
- Print summary:
codeskill status ───────────────── Behaviour: default Hotfixes: 3 active Incidents: 2 (last 30 days) Snapshots: 8 fresh, 2 stale Memory: 12 feedback, 5 decisions Last session: 2026-04-17 by @khanakia — "Add avatar upload"
显示当前系统状态。
- 读取当前激活的行为模式(来自CLAUDE.md或behaviours/)
- 统计HOTFIXES.md中的当前激活热修复数量
- 统计最近30天的事件数量(来自logs/incidents/INDEX.md)
- 检查快照时效性(摘要:N个最新,N个过期)
- 统计反馈条目和决策的数量
- 读取最后一次会话记录(来自logs/sessions/INDEX.md)
- 打印摘要:
codeskill status ───────────────── Behaviour: default Hotfixes: 3 active Incidents: 2 (last 30 days) Snapshots: 8 fresh, 2 stale Memory: 12 feedback, 5 decisions Last session: 2026-04-17 by @khanakia — "Add avatar upload"
If ARGS starts with "health"
若ARGS以"health"开头
Score system health 1-10.
- Freshness (30%): Check dates on snapshots, last session, HOTFIXES
- Relevance (30%): Verify file paths referenced in memory/feedback still exist
- Completeness (20%): Check core files exist (RULES.md, taste.md, HOTFIXES.md, at least 1 snapshot)
- Actionability (20%): Check "Where We Left Off" in CLAUDE.md is present and specific
- Compute weighted score
- Print per-dimension scores and total
- If < 5: suggest
/codeskill recover
为系统健康度评分(1-10分)。
- 新鲜度(30%):检查快照、上次会话、HOTFIXES的日期
- 相关性(30%):验证memory/feedback中引用的文件路径是否仍存在
- 完整性(20%):检查核心文件是否存在(RULES.md、taste.md、HOTFIXES.md、至少1个快照)
- 可执行性(20%):检查CLAUDE.md中的“上次进度”是否存在且具体
- 计算加权得分
- 打印各维度得分和总分
- 若得分<5:建议运行
/codeskill recover
If ARGS starts with "compress"
若ARGS以"compress"开头
Run auto-compression on logs, memory, hotfixes.
- Check line counts of:
- (cap: 75 lines)
HOTFIXES.md - (cap: 150 lines)
logs/sessions/INDEX.md - individual files (cap: 150 lines each)
logs/activity/ - (cap: 150 lines)
memory/feedback/INDEX.md
- For each file over cap:
- HOTFIXES: suggest graduating oldest to RULES.md or archiving
- Session INDEX: archive entries older than 30 days
- Activity logs: truncate oldest prompts, keep corrections
- Memory INDEX: merge similar entries
- Report: "Compressed N files. Removed N stale entries."
对日志、记忆、热修复进行自动压缩。
- 检查以下文件的行数:
- (上限:75行)
HOTFIXES.md - (上限:150行)
logs/sessions/INDEX.md - 中的单个文件(上限:150行)
logs/activity/ - (上限:150行)
memory/feedback/INDEX.md
- 对每个超过上限的文件:
- HOTFIXES:建议将最旧的条目升级到RULES.md或归档
- 会话INDEX:归档30天以上的条目
- 活动日志:截断最旧的提示词,保留修正内容
- 记忆INDEX:合并相似条目
- 反馈:"已压缩{N}个文件。已移除{N}个过期条目。"
If ARGS starts with "recover"
若ARGS以"recover"开头
Recovery mode — rebuild from git + code.
- Warn user: "Recovery mode will re-explore the codebase and verify all stored data. Continue?"
- Scan project: read go.mod/package.json, README, directory structure
- Read git history:
git log --oneline -20 - Re-explore and regenerate all stale snapshots
- Verify file paths in memory/feedback/ and memory/decisions/ — flag broken refs
- Rebuild ARCHITECTURE.md and STACK.md if missing
- Run to regenerate CLAUDE.md
sync - Report: "Recovery complete. Health score: <N>/10"
恢复模式 — 从git和代码重建系统。
- 警告用户:"恢复模式将重新探索代码库并验证所有存储的数据。是否继续?"
- 扫描项目:读取go.mod/package.json、README、目录结构
- 读取git历史:
git log --oneline -20 - 重新探索并重新生成所有过期快照
- 验证memory/feedback/和memory/decisions/中的文件路径 — 标记无效引用
- 若缺失则重建ARCHITECTURE.md和STACK.md
- 运行重新生成CLAUDE.md
sync - 反馈:"恢复完成。健康度评分:<N>/10"
If ARGS starts with "save-state"
若ARGS以"save-state"开头
Write emergency CONTINUATION.md.
- Scan conversation for: current task, files being edited, what's done, what's in progress
- Write to project root (max 50 lines):
CONTINUATION.mdmarkdown# Continue: <task> Resume from: `<file:line>` — <what was being done> ## State - [x] <completed items> - [ ] <in progress items> - [ ] <remaining items> ## Immediate Next Action <exact next step> - Report: "State saved to CONTINUATION.md. Next session will auto-load it."
写入紧急CONTINUATION.md文件。
- 扫描对话内容获取:当前任务、正在编辑的文件、已完成内容、进行中的内容
- 将内容写入项目根目录的(最多50行):
CONTINUATION.mdmarkdown# Continue: <task> Resume from: `<file:line>` — <正在进行的工作> ## State - [x] <已完成项> - [ ] <进行中项> - [ ] <剩余项> ## Immediate Next Action <具体的下一步操作> - 反馈:"状态已保存到CONTINUATION.md。下次会话将自动加载。"
If ARGS starts with "export"
若ARGS以"export"开头
If ARGS is "export cursor":
- Read ,
.ai/RULES.md,.ai/taste.md.ai/PATTERNS.md - Generate files from the content
.cursor/rules/ - Report: "Generated .cursor/rules/ from .ai/"
If ARGS is "export copilot":
- Read ,
.ai/RULES.md,.ai/taste.md.ai/PATTERNS.md - Generate
.github/copilot-instructions.md - Report: "Generated copilot-instructions.md from .ai/"
若ARGS为"export cursor":
- 读取、
.ai/RULES.md、.ai/taste.md.ai/PATTERNS.md - 根据内容生成文件
.cursor/rules/ - 反馈:"已从.ai/生成.cursor/rules/"
若ARGS为"export copilot":
- 读取、
.ai/RULES.md、.ai/taste.md.ai/PATTERNS.md - 生成
.github/copilot-instructions.md - 反馈:"已从.ai/生成copilot-instructions.md"
If ARGS is empty or "help"
若ARGS为空或"help"
Show available commands:
codeskill — AI Project Intelligence System
Setup:
init Scaffold .ai/ directory
sync Regenerate CLAUDE.md from .ai/ files
status Show current state
Behaviours:
behaviour <name> Switch mode (default, careful, review, debug, scaffold)
behaviour list List available behaviours
Session:
session start Load context, check staleness, report status
session end Write session log + activity log
continue Load CONTINUATION.md resume point
save-state Write emergency CONTINUATION.md
Learning:
learn <lesson> Learn NOW — save + apply immediately in current session
feedback <correction> Save user correction to memory
decide <title> Log a decision to memory
incident <description> Create incident report
hotfix add <desc> Add to active hotfixes
hotfix review Review stale hotfixes for graduation
Assets:
snippet <name> Find or create code snippet
prompt <name> Find or create prompt template
Planning:
plan <title> Create feature plan in plans/features/
plan list Show all active and completed plans
plan archive <slug> Move completed plan to memory/plans/
handoff <plan-slug> Generate handoff doc for downstream repo/team
handoff list Show all handoffs
Tasks:
task add <description> Create task file + add to TASKS.md
task list Show master checklist (TASKS.md)
task start <id> Start task (check dependencies first)
task done <id> Mark task completed
task fail <id> <reason> Mark task failed with reason
task next Start next available pending task
task archive Archive completed/failed to memory/tasks/
task show <id> Show full task details
Memory:
memory search <query> Search feedback and decisions
Snapshots:
snapshot list Show all + staleness
snapshot check <topic> Check specific snapshot
snapshot refresh <topic> Re-explore and update
snapshot refresh --all Refresh all stale
snapshot create <topic> Create new snapshot
Maintenance:
health Score system health 1-10
compress Auto-compress logs, memory, hotfixes
recover Rebuild from git + code
Export:
export cursor Generate .cursor/rules/
export copilot Generate copilot-instructions.md显示可用命令:
codeskill — AI Project Intelligence System
Setup:
init 搭建.ai/目录
sync 从.ai/文件重新生成CLAUDE.md
status 显示当前状态
Behaviours:
behaviour <name> 切换模式(default、careful、review、debug、scaffold)
behaviour list 列出可用行为模式
Session:
session start 加载上下文,检查时效性,报告状态
session end 写入会话日志 + 活动日志
continue 加载CONTINUATION.md恢复点
save-state 写入紧急CONTINUATION.md
Learning:
learn <lesson> 立即学习 — 保存并在当前会话中立即应用
feedback <correction> 将用户修正保存到记忆
decide <title> 将决策记录到记忆
incident <description> 创建事件报告
hotfix add <desc> 添加到当前激活热修复
hotfix review 回顾过期热修复以进行升级
Assets:
snippet <name> 查找或创建代码片段
prompt <name> 查找或创建提示词模板
Planning:
plan <title> 在plans/features/中创建功能计划
plan list 显示所有活动和已完成计划
plan archive <slug> 将已完成计划移动到memory/plans/
handoff <plan-slug> 为下游仓库/团队生成交接文档
handoff list 显示所有交接文档
Tasks:
task add <description> 创建任务文件并添加到TASKS.md
task list 显示主任务清单(TASKS.md)
task start <id> 开始任务(先检查依赖)
task done <id> 标记任务完成
task fail <id> <reason> 标记任务失败并记录原因
task next 开始下一个可用的待处理任务
task archive 将已完成/失败任务归档到memory/tasks/
task show <id> 显示完整任务详情
Memory:
memory search <query> 搜索反馈和决策内容
Snapshots:
snapshot list 显示所有快照及其时效性
snapshot check <topic> 检查特定快照
snapshot refresh <topic> 重新探索并更新快照
snapshot refresh --all 刷新所有过期快照
snapshot create <topic> 创建新快照
Maintenance:
health 为系统健康度评分(1-10分)
compress 自动压缩日志、记忆、热修复
recover 从git和代码重建系统
Export:
export cursor 生成.cursor/rules/
export copilot 生成copilot-instructions.mdImportant Rules for This Skill
本技能的重要规则
- Never modify CLAUDE.md directly — always run to regenerate it
sync - Every feedback/decision entry needs: date, user (@username), scope (project/global_candidate/global)
- Auto-save corrections: When you detect user corrections during normal work (not just when this skill is invoked), save them to memory/feedback/
- Check before exploring: Always check snapshots before spawning Explore agents
- Compact encoding: All .ai/ files use tables > prose, file:line refs, one-line summaries
- Never store secrets in any .ai/ file
- 切勿直接修改CLAUDE.md — 始终运行重新生成
sync - 每个反馈/决策条目必须包含:日期、用户(@username)、范围(project/global_candidate/global)
- 自动保存修正:在正常工作中检测到用户修正时(不仅在调用本技能时),将其保存到memory/feedback/
- 探索前检查:生成Explore代理前始终检查快照
- 紧凑编码:所有.ai/文件优先使用表格而非散文,使用file:line引用和单行摘要
- 切勿在任何.ai/文件中存储机密信息