optimize
Audit an existing project for agent-native development and produce a ranked plan - verification, AGENTS.md, structure enforced by lint and types, vertical slices, test quality - at the depth I pick, then carry it out one verified step at a time. Use for /optimize. For a brand-new project use /init-project.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- optimize
- description
- Audit an existing project for agent-native development and produce a ranked plan - verification, AGENTS.md, structure enforced by lint and types, vertical slices, test quality - at the depth I pick, then carry it out one verified step at a time. Use for /optimize. For a brand-new project use /init-project.
- disable-model-invocation
- true
02 资源文件 1
- 参考文档agents/openai.yaml43 B
03 SKILL.md 正文
Optimize
Make an existing repo easier for agents to work in, so changes are verified, mistakes get caught by structure, and every feature is easy to find. Audit first, plan second, change code only for the items I pick.
1. Pick the depth
Ask once, recommending one based on the repo's size and state:
| Depth | What it covers | Typical result |
|---|---|---|
| quick | AGENTS.md, commands, verification gaps, obvious slop tests | a handful of fixes done in one session |
| standard | quick + mistakes agents keep repeating (git history, my T3 threads), lint and type rules, duplicate patterns, giant files | a plan for a few sessions |
| deep | standard + restructure toward vertical slices and deep modules, sequenced as a migration | a multi-step restructure plan |
Also ask whether there's an area I care about most (a feature, a pain point).
2. Audit
Use read-only subagents for the parallel parts. Every finding cites file:line, a commit, or a thread title. No finding without evidence.
- Verification. Can an agent launch the app, use it like a user, and see the result (screens, logs, data)? Is there a
verify-*skill, and does it still match the app? Are checks fast, and is there one command for them? Is test data realistic? Check tests againstprinciple-test-behavior-not-implementation: list tests that would pass if every function returned undefined. - Steering. Is AGENTS.md a short, accurate map, or a long rulebook? List claims that are stale, contradict the code, or that nothing enforces. Find duplicate ways of doing the same thing, half-finished migrations, and dead code an agent might copy.
- Repeated mistakes (standard and deep). Run the
correctskill's "find the mistake classes" step over recent commits, reverts and fix-ups. Then read my past agent sessions for this repo and find where I corrected or pushed back on the agent. A correction I gave twice is a mistake class. Sources, use whichever exist:- T3 Code threads:
t3_project_list(matchworkspaceRoot), thent3_thread_listandt3_thread_read. - Claude Code sessions:
~/.claude/projects/<repo path with separators as dashes>/*.jsonl(also its worktree paths). - Codex sessions:
~/.codex/sessions/**/*.jsonl; keep the ones whosecwdis this repo or one of its worktrees. Read user messages only, newest first, and stop when new sessions stop adding new mistake classes.
- T3 Code threads:
- Locality. By feature or by layer? List the largest source files with line counts. Pick two real features and count the files you'd have to open to change each one. Note hidden wiring (dynamic names, magic strings, global state) that grep can't follow. Use
principle-minimize-reader-loadandcodebase-design. - Safety. Ways an agent could touch live data, production deploys, my real profiles or secrets. Whether the repo works in a fresh worktree (env files, ports).
Gaps every one of my projects had (check these first)
From the 2026-10-12 audits of krida, Studi and kriyan (reports/ in the skill library):
- The main checkout is behind
origin/mainor has brokennode_modules. T3 copies.env.localfrom it, so every new worktree starts broken. - No
.gitattributes, so line endings churn. - Hard-coded dev port; parallel worktrees collide.
- All worktrees share one dev backend, so a branch's functions overwrite another's.
- No doctor: broken setup or dead credentials show up mid-task.
- Production commands written in AGENTS.md as routine; destructive admin functions with no deployment check.
- Dozens of stale worktrees with stranded uncommitted work.
- Tests listed by hand (some never run); e2e that skips on a missing function and looks like a pass.
- Agents said done without driving the changed screens.
- T3's worktree-create script never ran. With project settings folded, T3 only reads
projectSettingsOverridesin~/.t3/userdata/settings.json, and scripts saved throught3_project_updateare ignored. Noworktree-<app>orship-<app>skill, so the main checkout falls weeks behind.
3. Plan
Write the plan as an HTML page, never Markdown: I read it. Save it where this repo keeps plans (look for .agent/plans, docs/plans, or similar; otherwise .agents/plans/), named <date>-optimize.html. Keep a status block on it that you update as items finish.
- Snapshot: stack, layout, size, and the agent setup today.
- Findings, grouped by the five audit areas, each with evidence.
- Plan: numbered items ranked by value for effort, grouped as quick wins, medium, and deep. Each item says what changes, why (the finding it fixes), how it will be verified, and roughly how big it is.
- For deep: the restructure as an ordered migration, one feature folder at a time, each step leaving the app working.
Show me the plan and wait. I pick the items.
4. Carry it out
- One item at a time. Each ends in a state you checked: known-good, one change, check, next.
- Prefer the strongest fix: make the mistake impossible (structure, types), then a lint rule whose error says what to do instead, then a test, then docs last (the
correctskill's order). - Missing verification comes first. If there's no
verify-*skill, runcreate-verification-skillbefore restructuring anything, so every later step can be proven. If one exists but may be stale, runmaintain-verification-skill. If there's noworktree-<app>orship-<app>skill, runcreate-project-flows. - Restructures move code without changing behavior, so behavior tests and the verify skill must pass before and after each step.
- Never commit, push or deploy unless I ask. Update the plan file as items finish.
04 同仓库更多 Skills
writing-for-agents
Write docs that agents read (skills, AGENTS.md, CLAUDE.md). Use when creating or editing a skill, or changing AGENTS.md or CLAUDE.md.
unslop
Make prose sound human, not AI-written. Use whenever you write a PR description, commit message, doc, README, release note, post, email or UI copy, or when asked to unslop or de-AI text.
tutor
Run a study session from my exam plan and progress files in the study repo. Use when I say study, teach me, quiz me, practice for an exam, or check whether I really understand a topic.
threads
Start, steer and read T3 threads on my laptop or Mac mini from either machine. Use to move a thread to the Mac, get a Windows check from the laptop, manage threads on both, or answer a message from the other machine.
statechart
Check a TLA+ model and draw it as a Mermaid statechart, with the shortest path to each broken rule. Use for /statechart, to read a TLC result, or to show a bug as a path through states.
sol-loop
Review a change with GPT Sol in a loop until we both agree. Use when I say "sol loop".