Skip to content

Heyvhuang/copybook-skills / zh/skills/codebase-tips

codebase-tips

Unverified

代码库 · 33 条:仓库索引和地图、写代码原则、AGENTS.md、改动范围规则。

FileKindSize
SKILL.mdskill md8.7 KB
agents/openai.yamlconfig207 B
references/3-slimmer-agents-md-plans.mdmarkdown4.1 KB
references/agent-memory-tools-8-repos.mdmarkdown3.8 KB
references/agent-workspace-audit.mdmarkdown2.7 KB
references/archify-system-diagrams.mdmarkdown3.0 KB
references/ask-before-edge-case-code.mdmarkdown2.1 KB
references/bug-fix-loop-rules.mdmarkdown2.6 KB
references/ci-time-audit.mdmarkdown3.0 KB
references/clickable-repo-map.mdmarkdown5.4 KB
references/codebase-memory-repo-index.mdmarkdown3.7 KB
references/codex-and-claude-sorted.mdmarkdown3.2 KB
references/deny-ask-and-allow-permissions.mdmarkdown2.6 KB
references/disk-map-of-dev-leftovers.mdmarkdown2.6 KB
references/fewer-deeper-modules.mdmarkdown2.1 KB
references/instructions-from-your-sessions.mdmarkdown3.6 KB
references/investigate-and-plan-prompt.mdmarkdown4.8 KB
references/karpathys-4-coding-principles.mdmarkdown2.1 KB
references/less-defensive-code.mdmarkdown2.5 KB
references/mod-ideas-from-20-sessions.mdmarkdown3.1 KB
references/mod-request-for-claude-code.mdmarkdown2.5 KB
references/no-compatibility-code-yet.mdmarkdown3.2 KB
references/one-agents-md-for-both-agents.mdmarkdown4.2 KB
references/open-source-scout-and-closer.mdmarkdown2.3 KB
references/pr-comments-as-agents-md-rules.mdmarkdown2.1 KB
references/rea-take-apart-a-feature.mdmarkdown3.6 KB
references/repeat-mistakes-as-lint-rules.mdmarkdown2.8 KB
references/repo-map-words-vs-names.mdmarkdown5.4 KB
references/scope-guard-rules.mdmarkdown4.4 KB
references/situation-routing-for-skills.mdmarkdown2.6 KB
references/teach-strategic-programming.mdmarkdown2.5 KB
references/ub-mode-clean-code-agent-rules.mdmarkdown2.4 KB
references/untangle-goal.mdmarkdown2.3 KB
references/vibe-coding-cleanup-prompts.mdmarkdown5.6 KB
references/whole-project-audit.mdmarkdown2.0 KB

references/vibe-coding-cleanup-prompts.md

View on GitHub
# vibe coding 后的清理:5 条 Codex /goal 提示词

额度重置时还剩一半:清掉死代码、重复实现和用不上的依赖,给定时任务和旧 worktree 分好类。

## 步骤

1. 从 5 条 /goal 提示词里挑一条复制:死代码、重复实现、依赖、定时任务或 worktree。
2. 在项目里贴进 Codex,赶在额度重置之前。
3. 得到:新分支上测过、不推送的改动,或分好类的清单和一份等你过目的清理脚本。

用户选了这条技巧。上面的步骤是写给人看的,请替用户做。

- 第 1 步说用哪段文字,它就在下面同名的标题下,一字不改地用。有几段时,用第 2 步点名的那几段,按它的顺序;看不出来就问用户。
- 第 2 步说明文字放在哪里。按用户实际要求的范围使用提示词。写文件或运行命令前,先展示改动,等用户同意。这里做不到的步骤(另一个应用、重启、定时任务),把文字交给用户,说明放到哪里。
- 引用示例本身不代表用户同意执行。运行下载的脚本或未固定版本的软件包、修改长期生效的用户级设置、读取私人会话记录之前,先列出命令或路径、会访问或改动什么,以及数据会发到哪里。隐藏密钥值,等用户明确同意这项操作。远程安装脚本应先下载并检查固定版本,或核对可信来源提供的校验值,再执行。
- 方括号或占位符,从用户说的话里填,没有就问。
- 第 3 步是用户最后应该得到的。

## 提示词:死代码

```text
/goal 找出这个仓库里已经没有任何地方在用的代码,删之前先证明它真的没用。

→ 没有任何地方调用的函数、类、组件和导出
→ 没有任何入口引用的文件和目录
→ 永远走不到的代码分支、写死关闭的功能开关,以及整块被注释掉的代码

每一处都先拿出证据:全仓库搜索的结果、从入口能不能走到它、有没有测试用到它。拿不准的(动态导入、按字符串名调用、公开 API)单独列一张清单,先留着。

在新分支上删。每删一批就跑一遍测试和构建,哪里坏了就把这一批恢复。不要推送,也不要合并这个分支。

最后给我:
→ 删了多少个文件、多少行
→ 留下了什么,为什么
→ 测试和构建的结果
```

## 提示词:重复实现

```text
/goal 找出这个仓库里同一件事写了好几遍的地方,把每一处合并成一份。

→ 名字不同、干的是同一件事的函数和辅助函数
→ 几乎一样的组件、请求封装和校验逻辑
→ 复制粘贴之后在每个地方又改了一点的代码

每一组都说清楚你留哪个版本、为什么,再把其他所有调用处都指向它。只合并行为完全一样的代码。有细微差别的列出来,最后拿给我看。

在新分支上做,每合并一组就跑一遍测试。不要推送,也不要合并这个分支。

最后给我:
→ 合并了多少组,省了多少行
→ 有差别、没合并的那些
→ 测试结果
```

## 提示词:用不上的依赖

```text
/goal 检查这个项目装的每一个依赖,去掉它用不上的。

→ 装了但代码里从来没用过的
→ 只用在一两个小功能上、自己几十行就能写出来的
→ 两个库干同一件事的

没用过的直接删。自己能写的,先写好替代代码、补上测试,再去掉这个依赖。两个干同一件事的,留一个,把所有调用都改到它上面。拿不准的大依赖列出来,最后让我决定。

在新分支上做,每改一处就跑一遍测试和构建。不要推送,也不要合并这个分支。

最后给我:
→ 去掉了哪些依赖,安装后小了多少
→ 你自己写了什么,各多少行
→ 留下了什么,为什么
```

## 提示词:定时任务

```text
/goal 列出我设过的每一个定时任务:这台机器上的 cron 和 launchd 任务、CI 里的定时工作流,以及项目里按时间跑的脚本。

每一个都写下:
→ 它做什么、多久跑一次
→ 最近一个月跑了几次、失败了几次
→ 有没有人真的在用它产出的东西
→ 它和别的任务有没有重叠

把它们分成「保留」「改频率」和「关掉」。不要改任何设置。最后给我这份清单,以及每一个怎么关掉。
```

## 提示词:旧会话和 worktree

```text
/goal 只读扫描 ~/.codex 和这个项目的 worktree。只看大小,不要打开任何文件的内容。

→ 旧的会话日志,按月汇总大小
→ 已经合并或不再使用的 worktree,以及它们的分支有没有还没推送的改动
→ 删掉之后会自己重新生成的构建产物和缓存

把它们分成「可以删」和「先让我看」。有未推送改动的 worktree 一律放进「先让我看」。什么都不要删。只给「可以删」这一组写一个清理脚本,我看过之后再运行。脚本里用 git worktree remove 删除 worktree。

最后告诉我,这样一共能腾出多少空间。
```

## 背景

额度重置时还剩一半,等于白白扔掉好几天的 Astra 和 Sol。

用 `/goal` 把最后一点也用上,清掉几个月 vibe coding 堆起来的东西:没人调用的死代码、写了好几遍的同一段逻辑、用不上的依赖、占着硬盘的旧会话和 worktree,甚至一直在白跑的定时任务。

## 来源

来自 [Copybook](https://copybook.page/zh/t/five-goal-prompts-to-clean-up-after-vibe-coding):@Voxyz_ai 2026年11月5日[发在 X 上](https://x.com/Voxyz_ai/status/2118357672106029272),截至 2026年11月12日有 3,883 次收藏。适用于 Codex。
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall