coding-workflow
Edit code safely (read, plan, edit, run tests, iterate, record)
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 12
- Forks
- 2
01 前言 Front Matter
- name
- coding-workflow
- license
- MIT
- metadata
- { "polyrob-when": "Editing code: read, plan, edit, run tests, iterate", "polyrob-version": "3", "polyrob-priority": "3", "polyrob-triggers": "{\"tool_ids\":[\"coding\",\"code_execution\",\"filesystem\"]}" }
- description
- Edit code safely (read, plan, edit, run tests, iterate, record)
02 资源文件 4
- 参考文档references/build-failure-triage.md3.2 KB
- 参考文档references/cleanup-passes.md3.1 KB
- 参考文档references/debugging-method.md4.1 KB
- 参考文档references/review-lenses.md4.7 KB
03 SKILL.md 正文
Coding Workflow
Edit code safely: read, plan, change, test, iterate. Recommended workflow — adapt it.
Tool availability
Read the coding line of your <tool-catalog>. [loaded] → use it. [loadable] →
call load_tool("coding") first. [gated:…] → follow the remedy it names (see
harness-manual). A delegated sub-agent never holds coding. Without coding, edit
with filesystem_read_file / filesystem_write_file and state how to verify.
The coding verbs:
coding_grep— search the tree (a regex, aglobfilter).coding_str_replace— one exact edit (uniqueold_string, orreplace_all).coding_apply_patch— a multi-hunk unified diff for one file.coding_create_file/coding_move_file/coding_delete_file.coding_run_tests— run the project's tests.coding_snapshots/coding_restore— only when snapshots are on (the schema says so); otherwise undo withgit_diffandgit_checkout.
When to use
Fixing a bug, implementing or refactoring code, adding a function, or running tests.
Workflow
- Read before you write.
coding_grepthe symbol and read the surrounding file so the change fits the existing code. - Plan the smallest diff that solves the problem; match local conventions and comment density. Don't gold-plate.
- Make the edit. Prefer
coding_str_replacefor one exact edit andcoding_apply_patchfor several hunks. Withfilesystem, write content verbatim — never strip or reflow indentation. After an edit, read any<diagnostics>block the result carries. - Iterate on failures — read the error, fix, re-run — don't guess.
- Run the tests LAST.
coding_run_testsreturns the tail of the output and a log path; read the log withfilesystem_read_filewhen the tail is not enough. An edit after a green run voids it: a deploy verb (app_service_deploy,hf_deploy_deploy) refuses a tree with no green run since the last edit (ship == tested). If no test tool is available, state exactly how to verify by hand. - Report and record. Name the files changed and the test result. In a git repo,
follow
git-and-pr-flow:git_status→git_diff→git_add(named paths) →git_commit. Push only when the owner asked; a push is public.
Notes
- Touch only what the task needs; leave unrelated code alone.
- A long command, a dev server or a background job: see
shell-and-sandbox.
Deeper methods — read one only when the step needs it
Load with read_skill_resource(skill_id="coding-workflow", resource_path="references/<file>.md").
review-lenses.md— before you ship a non-trivial diff, or when asked to review one. Its first lens asks which claim has no test behind it.build-failure-triage.md— a build, install, lint or CI run fails with more than one error.debugging-method.md— the cause is not clear after one careful read, a test fails only sometimes, or a first fix did not work.cleanup-passes.md— after the change works and is green, to remove dead code, copies and needless layers without changing behaviour.
04 同仓库更多 Skills
echo-basics
How to use the echo tool from the echo fixture pack.
x-engagement
Operate X account communication on the API rail (the captured-browser rail only where the owner chose it)—read inboxes, post/reply, send DMs, set up the account, with the real write gates and completion evidence
social-discovery
Discover public X/social accounts and conversations with AnySite first (anysite_describe, then anysite_api), using native X account reads where they are authoritative and preserving write gates
polymarket-trading
GATED: place/cancel Polymarket orders. Owner-only, read-first, >$500 confirmation gate; references crypto-trading-safety
polymarket-portfolio-review
Read the configured Polymarket account's positions and trade history from the public Data API (no address parameter); summarize exposure and P&L
polymarket-market-research
Read Polymarket markets (discover, details, price as implied probability, orderbook, spread, volume) with no wallet