一键导入
update-code
For repo update tasks, pull the latest code first, then continue with the repo-appropriate local configuration or environment updates.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
For repo update tasks, pull the latest code first, then continue with the repo-appropriate local configuration or environment updates.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | update-code |
| description | For repo update tasks, pull the latest code first, then continue with the repo-appropriate local configuration or environment updates. |
| metadata | {"short-description":"拉代码并执行对应更新"} |
update-code — 拉代码并调整本机环境当用户要求“更新代码”“同步一下”“根据最近提交调整”“拉最新代码后处理本地环境”等任务时使用。适用于任意 git repo,重点是把新代码对本机环境的影响同步到当前机器。
先进入当前 repo root:
git rev-parse --show-toplevel
在做任何后续分析、配置同步、脚本执行或修复前,先记录旧 HEAD 和旧 upstream。若工作区已有本地改动,先把 tracked 和 untracked 改动一起 stash,再按当前 repo / 用户的 git 配置拉取最新代码:
OLD_HEAD="$(git rev-parse HEAD)"
OLD_UPSTREAM="$(git rev-parse --verify @{u} 2>/dev/null || true)"
if ! git diff --quiet || ! git diff --cached --quiet || [ -n "$(git ls-files --others --exclude-standard)" ]; then
STASH_NAME="update-code before pull $(date '+%Y-%m-%dT%H:%M:%S%z')"
git stash push -u -m "$STASH_NAME"
fi
git pull
NEW_HEAD="$(git rev-parse HEAD)"
NEW_UPSTREAM="$(git rev-parse --verify @{u} 2>/dev/null || true)"
git pull 要尊重仓库和用户已有配置,例如 rebase、merge 或 fast-forward 策略;不要额外强制 --ff-only。如果 git pull 失败,停止并报告原因;若已经创建 stash,不要丢弃它。不要 reset、checkout 或 force 更新。
如果第 2 步创建过 stash,拉取完成后立刻恢复它:
git stash pop
如果 git stash pop 产生冲突,不要停在“请用户处理”。继续检查冲突文件,按本地改动和新代码的意图解决冲突;解决后用 git status 确认工作区状态,并在最终回复中说明发生过 stash 冲突以及如何解决。stash pop 冲突时 stash 条目通常仍会保留;只有确认本地改动已经恢复且冲突已解决后,才清理对应的 update-code stash。若无法可靠判断某个冲突应保留哪边,保留冲突状态并明确说明卡点。
读一下新拉到的代码改了什么,再判断当前机器需要做哪些配置或环境调整:
if [ -n "$OLD_UPSTREAM" ] && [ -n "$NEW_UPSTREAM" ] && [ "$OLD_UPSTREAM" != "$NEW_UPSTREAM" ]; then
git log --oneline "$OLD_UPSTREAM..$NEW_UPSTREAM"
git diff --name-only "$OLD_UPSTREAM..$NEW_UPSTREAM"
else
git log --oneline "$OLD_HEAD..$NEW_HEAD"
git diff --name-only "$OLD_HEAD..$NEW_HEAD"
fi
如果没有新远端提交,再按用户语境查看最近几个提交或当前工作区,判断是否仍需要处理。
不要只停在 git pull,要主动把新提交映射到本机需要更新的依赖、配置、生成物、服务状态或验证动作。
最终回复用中文简要说明:
git pull 拉到了哪些提交,或说明已经是最新。git pull,尊重 repo / 用户配置。git stash push -u 保护本地 tracked/untracked 改动,pull 后再 git stash pop 恢复。Create or edit SVG diagrams that must remain editable in diagrams.net/draw.io or the drawio-obsidian plugin, instead of becoming plain static SVG images.
Explain a codebase in four modes: `framework` produces a high-level architecture walkthrough saved to `codebase-walkthrough[-<slug>].md`; `impl <path>` explains a specific implementation saved to `codebase-impl-<slug>.md`; `run <identifier>` explains a specific execution run by tracing code + logs, saved to `codebase-run-<slug>.md`; `debug [<identifier>] [<question>]` diagnoses failures and verifies fixes, saved to `codebase-debug-<slug>.md`. `<slug>` is a short (≤12 chars) tag derived from the identifier so repeated runs don't overwrite each other.
Analyzes the current AXRD tmux session by using the shared TMA mechanism from $HOME/farside/AGENTS.md: one top-level summary TMA Agent summarizes the run, and one workspace TMA analysis Agent deeply analyzes each AXRD workspace.
Create or refine concise skills for task-specific TMA Agent collaboration systems. Use when the user wants to turn a tmux multi-agent workflow into a reusable skill, or update an existing TMA skill based on what happened during one of its invocations. Shared TMA creation/communication conventions live in $HOME/farside/AGENTS.md.
Respawns tmux AI agent panes so they reload current authentication while preserving Codex sessions when possible. Use when Codex panes are logged into an old account, stale after auth changes, or the user asks to refresh all AI windows in tmux.
Agentic monitoring for a user-specified target such as a tmux pane, long-running command, log, service, training run, or remote job. Use when the user asks to watch, monitor, periodically check, supervise, continue/restart when finished, or report when a target fails or needs attention. Defaults to a 30 minute interval when the user does not specify one.