AGENT SKILL

readable-code

Make the source a branch changes read plainly, and prove its behaviour unchanged. Use when asked to make this branch readable, for a readability pass, or to simplify or untangle the code a branch changes. Works on the files the branch changes against its target branch, narrowed to the paths passed. Takes a baseline of the full suite, and of the synthesized output where the branch holds infrastructure code, then has the author approve groups of like files and the decisions they share, and launches one task-executor agent per group to apply the team's readability and comment rules with no behaviour change and no rename for taste. Runs both again, asks whether to revert or keep any file whose change made a difference, has the wave-reviewer agent read the pass, sends its blocker and should-fix findings back to the executors to fix, and hands back with the report skill. Not for a test cleanup, which is tighten-tests's; not for a bug, which is bugfix's; not for a new change, which is start-task's. Commits nothing.

License 许可
MIT
所属仓库
sabind/ponderly
最近更新
2026-11-14
Stars
★ 0
Forks
1

01 前言 Front Matter

name
readable-code
description
Make the source a branch changes read plainly, and prove its behaviour unchanged. Use when asked to make this branch readable, for a readability pass, or to simplify or untangle the code a branch changes. Works on the files the branch changes against its target branch, narrowed to the paths passed. Takes a baseline of the full suite, and of the synthesized output where the branch holds infrastructure code, then has the author approve groups of like files and the decisions they share, and launches one task-executor agent per group to apply the team's readability and comment rules with no behaviour change and no rename for taste. Runs both again, asks whether to revert or keep any file whose change made a difference, has the wave-reviewer agent read the pass, sends its blocker and should-fix findings back to the executors to fix, and hands back with the report skill. Not for a test cleanup, which is tighten-tests's; not for a bug, which is bugfix's; not for a new change, which is start-task's. Commits nothing.
allowed-tools
Bash(git status *) Bash(git branch *) Bash(git rev-parse *) Bash(git config --get *) Bash(git log *) Bash(git merge-base *) Bash(git diff *) Bash(git ls-files *) Bash(cp *) Bash(mktemp *)
argument-hint
[paths]

03 SKILL.md 正文

Make a branch readable

Run a readability pass over the source a branch changes: one executor per group of like files, all following one list of shared decisions, applies the "Write for the reader." bullet of the code-changes rule and the comments rule to them, then the full suite, and the synthesized output where there is infrastructure code, prove that nothing behaves differently, and the reviewer reads the pass. The pass changes how the code reads, never what it does.

The author is accountable for the code. A difference from the Baseline is the author's to judge: name the file and ask, never decide it alone. Commit nothing, and change no file yourself beyond restoring one the author chose to revert.

Paths to narrow the pass to, if the author gave any: $ARGUMENTS

Terms used below:

  • The Scope is the files the branch changes against its target branch, uncommitted and untracked work included, narrowed to the paths passed when there are any.
  • A source file is a file in Scope that holds code the project runs or deploys. Tests, documentation, configuration, lock files and generated files are not source files; a test cleanup is tighten-tests's.
  • Infrastructure code is infrastructure-as-code that generates deployment templates. Its synthesized output is the templates the project's command that generates them produces.
  • The Run_Folder is the folder step 2 makes in the session's scratchpad for this run's own records: the Baseline copies and the synthesized outputs. Each run makes a new one and leaves any earlier run's in place.
  • The Baseline is what step 2 records before anything changes: the full suite's result, the synthesized output where Scope holds infrastructure code, and a copy of each source file in Scope.
  • A File_Group is the source files in Scope that share a template, role or pattern, such as several pages of one kind, worked by one executor so the issues they share are fixed the same way. A file with no peers is a group of one, and no file is in two groups.
  • The Shared_Decisions are a short list, written before any executor starts, of how each issue that recurs across Scope is to be handled, one line each, given to every executor so their choices agree.
  • An executor is the plugin's task-executor agent, launched as ponderly:task-executor, one per File_Group. Its own definition holds its procedure and the shape of its Summary.
  • The reviewer is the plugin's wave-reviewer agent, launched as ponderly:wave-reviewer, once per run. Its own definition holds its procedure and the shape of its Findings.

Working with the author

  • Stops. Most runs stop at two points: the approval of the File_Groups and Shared_Decisions in step 3, and the hand-back of step 7.
    • Only when something is wrong: the stop in step 1 when Scope holds no source file; the question in step 2 when the project has no test suite or the suite fails at the Baseline; the revert-or-keep question in step 5 for each file whose change made a difference, and in step 6 for each file a fix left differing; the stop in step 4 or 6 when an executor's deleted: names a path that was not its own, or its Summary has no deleted: field; the stop when the task-executor agent, the wave-reviewer agent or the report skill is missing.
  • How it asks. With the AskUserQuestion tool, fixed options plus free text: whether the File_Groups and Shared_Decisions are approved (header Groups: approved, changes needed, with the changes as free text), whether to go on after a failing Baseline (go on, stop), whether to go on without a test suite (go on with a manual check the author names, stop), and for each differing file whether to revert or keep its change, all such files in one call.
  • Hand-backs. The Scope line of step 1; the hand-back of step 7, written by the report skill, with every stopped executor, every difference kept, every finding still open after two fix attempts and every nit under its problems.
  • Hand-offs. tighten-tests to clean up the branch's tests now that the code reads plainly; pr to open the pull request.

The plugin's rules on working with and writing to the author apply throughout; this skill does not restate them.

1. State the Scope

Find the target branch. When the repository has an origin remote and git rev-parse --abbrev-ref origin/HEAD names a branch, the target is that branch, origin/<default>. Otherwise the target is the local default branch, the branch git config --get init.defaultBranch names when it exists, else main. Find the base with git merge-base <target> HEAD.

Scope is every file git diff --name-only <base> lists, which compares the working tree with the base so that uncommitted edits count, with the untracked files git ls-files --others --exclude-standard lists, narrowed to the paths in the arguments when there are any. Keep the files that still exist. Of what is left, the source files are the work.

Say the Scope in one line before changing anything, naming the target branch and any paths passed, such as "Scope: 6 source files the branch changes against origin/main, under src/api". If Scope holds no source file, say so in that line, name what it did hold if anything, and stop without changing anything.

2. Take the Baseline

Before any file changes:

  1. Make the Run_Folder with mktemp -d "<scratchpad>/readable-code-run-XXXXXX", where <scratchpad> is this session's scratchpad directory, and use the path it prints. Copy each source file in Scope into the Run_Folder, keeping its path, so that a file's change can later be reverted without touching what the branch already holds uncommitted.
  2. Run the project's full test suite, the way the project runs it, and record the result: which tests pass, which fail, and the counts.
  3. Where Scope holds infrastructure code, run the project's command that generates its deployment templates, with its output directed into the Run_Folder, and keep that output.

If the project has no test suite, say so, and ask whether to go on with a manual check the author names, run at the Baseline and again in step 5 in place of the suite, or to stop. Do not add a test framework.

If the suite fails at the Baseline, report the failing tests with their output verbatim, and ask whether to go on, with the failing tests as the known failures the later comparison allows, or to stop. Change nothing until the author answers. On stop, delete the Run_Folder and end there.

3. Group the files and agree the decisions

Read the source files in Scope. Sort them into File_Groups: files that share a template, role or pattern, such as several pages of one kind or several handlers of one shape, go in one group; a file with no peers is a group of one; no file is in two groups. Then write the Shared_Decisions: each readability issue that recurs across Scope, in a line with how it is to be handled, such as "Name the request body payload in every handler." When nothing recurs, say so in place of the list.

Show the File_Groups, each with its files and, in a line, why they belong together, then the Shared_Decisions. Then state the Effort_Proposal for the executors and the Wave_Reviewer: medium for every launch, except that the Wave_Reviewer is proposed at high, naming the criterion met, when a High_Effort_Criterion holds: the author named a level in the request, or the request or the files name security, authentication or sign-in, money or payments, deleting or migrating data, or concurrency. Where it proposes high, say what that is expected to cost against medium: about $0.28 more for a median Wave_Reviewer launch, whose median at high is about $1.26, in list prices, not what a subscription bills. These criteria are a starting judgement. Ask with the AskUserQuestion tool, header Groups, whether they are approved, with the options Approved and Changes needed, the changes as free text, which can also change the effort. On changes, apply them and ask again. Change no file until the answer is a plain approval.

4. Launch the executors

For each File_Group, create its executor's own folder with mktemp -d "<scratchpad>/readable-code-executor-XXXXXX": one per launch, outside the Run_Folder, so no two executors share one. Then launch one executor per File_Group, all in one message so they run concurrently, each with the Agent tool as subagent_type: ponderly:task-executor, passing model as haiku when the group's work is a Small_Task by the test in the executor's description, and as sonnet otherwise or when that cannot be told, and passing effort only when the chosen effort is not medium, and a prompt that holds:

  • Request: "Make <paths> read plainly: apply the "Write for the reader." bullet of the code-changes rule and the comments rule to the code the branch added or changed in them, fix the issues they share the same way in each, and leave untouched code elsewhere in the files as it is.", with <paths> the group's files.
  • Lines in scope: for each of the group's files, the lines the branch added or changed in it, from git diff <base> -- <path>, or the whole file when it is untracked.
  • Shared decisions: the approved Shared_Decisions, verbatim, with the sentence, verbatim, "Follow these decisions wherever the issue they name appears in your files."
  • Constraints: the sentence, verbatim, "No behaviour change, no rename for taste, prove it with the existing tests.", followed by the sentence, verbatim, "Renaming a one-letter, misleading or terse name to a descriptive one is what "Write for the reader." asks for; a rename for taste swaps one clear name for another clear name.", followed by the sentence, verbatim, "To see the old code, read its Baseline copy at <copy>; never run git stash, git checkout or git reset.", given once for each of the group's files, with <copy> the path of that file's Baseline copy in the Run_Folder, each followed by the sentence, verbatim with the same <copy>, "<copy> is the launcher's: read it, but never change or delete it.", then the sentence, verbatim with the group's own folder in place of <own>, "Your own folder is <own>: keep every scratch file in it, delete it when you finish, and delete nothing else in the scratchpad."
  • In flight: the source files of the other File_Groups being made readable in this run, with the instruction to touch only the group's own files.
  • Boundaries: the sentence, verbatim, "Make only this change. Commit nothing. Return the Summary."

Nothing more. Never say, in any words, that the task comes from a spec: a readability pass is not a spec task, and the executor must run in its standalone mode. The constraints sentence is what keeps that mode from adding a test for a change with no new behaviour. The executor's own definition carries its procedure and the instruction to stop on drift, and the plugin's SubagentStart hook puts the handbook rules in its context, so the launch restates none of them.

If the Agent tool cannot find ponderly:task-executor, say that the plugin's task-executor agent is missing and stop. Do not make the readability changes yourself.

If a launch that passes effort fails with an error that names effort, because the Claude Code version is older than 2.1.292, launch it again without effort and tell the author the chosen level could not be applied.

Wait until every executor has returned. Then check each Summary's deleted: field before its status: every entry must be the own folder that launch named, a path inside it, or a file listed under its files changed. Show each entry outside those to the author, quoted, as a problem: the executor deleted something that was not its own. A Summary with no deleted: field is a problem too, shown the same way, since what it deleted cannot be checked. On either, stop there, before step 5 compares against a Baseline copy that may be gone, leaving the Run_Folder in place and naming its full path in the stop, so the author can inspect it or restore a file from its Baseline copy.

Then, for each Summary:

  • stopped: show the Summary verbatim. If the group's launch ran on haiku, first make one Escalation without asking: launch a new executor for the group on sonnet, never beyond it, as in step 4 for that group, with a new own folder and the same Shared_Decisions and constraints sentences, plus the Haiku Summary's stopped because, quoted, and the files that already hold partial edits. A done Escalation is handled as any done Summary below, and the Haiku stop is not carried to the hand-back's problems, only named there as escalated; a stopped Escalation follows the rule that comes next, and is never escalated again. Do not relaunch it or work around it. Leave the group's files as the executor left them, name any partial edits it lists under files changed, and carry the group's files and its stopped because to the hand-back's problems. Its partial edits stay in the comparison of step 5.
  • done: a Summary whose files changed names a file outside its group goes under the hand-back's problems with that file named. Collect its unsure items for the hand-back. For a group whose launch ran on haiku, a done Summary with a failed check under checks run gets one Escalation first, without asking: a new executor on sonnet, launched as above, given the Haiku Summary and the failing output; the rules here then apply to its Summary.

5. Prove no behaviour changed

Run the full suite again, the same way, and compare it with the Baseline: the same tests pass and the same tests fail. To see how the old code behaved, run it from its Baseline copy in the Run_Folder; never run git stash, git checkout or git reset, which would touch the branch's uncommitted work and the stash every worktree shares. Where Scope holds infrastructure code, run the synthesis again into the Run_Folder and diff its output against the Baseline's.

If both match, say so in one line and go on to step 6.

If either differs, name the file that caused each difference: the source file the failing test exercises or the stack trace points at, or the source file that defines the resource whose synthesized output changed. When the evidence points at more than one file, name each. Where a named file belongs to a group whose launch ran on haiku, first make one Escalation for that group without asking: a new executor on sonnet, launched as in step 4, given the Haiku Summary and the difference with its output; run step 5 again on the result, and the rest of this step applies to what still differs. Report each difference with its output verbatim, then ask, for each named file, whether to revert its change or keep it, naming the file or files each answer covers. On revert, restore each named file from its Baseline copy, then run the suite, and the synthesis where it applies, once more and say whether they now match. A kept difference goes to the hand-back's problems with its output.

6. Review the pass

Launch the reviewer once, with the Agent tool as subagent_type: ponderly:wave-reviewer, passing effort only when the chosen effort is not medium and no model, and a prompt that holds:

  • the files the pass changed, from the Summaries' files changed, less any reverted in step 5;
  • for each, the path of its Baseline copy in the Run_Folder, with the instruction that the pass's own changes are git diff --no-index <copy> <path>, whose exit status 1 means the files differ and is expected, and that the branch's earlier changes are not under review;
  • what the changes must satisfy: the "Write for the reader." bullet of the code-changes rule and the comments rule, which the hook puts in its context, and the constraints sentence the executors were given, quoted;
  • the files that cite the changed ones: search the repository for each changed file's path and name;
  • the executors' records: the sentence, verbatim, "These are the executors' records of their work. Read them only at the record step of your procedure, after you have judged every change on its own.", then each group's files changed and unsure from its Summary, quoted, headed by the File_Group.

Nothing more, and never the diff. If the Agent tool cannot find ponderly:wave-reviewer, say that the plugin's wave-reviewer agent is missing and stop. Do not review the pass yourself.

Wait for its Findings, and collect the reviewer's unsure items beside them. A records: entry whose check is does not match and a not in any record entry go to the hand-back's problems, quoted, and a quoted line with no entry goes there too, quoted, as not checked; a does not match entry for a file reverted in step 5 is not listed as a problem: its record line stays in its group's record, marked as reverted in step 5. An unsure item that a settled: line settles is reported as settled, with what the code showed. Every other reviewer unsure item is handled by the bullets below, and the executors' unsure items collected in step 4 are carried to the hand-back's problems. Then:

  • A blocker or should-fix, and any reviewer unsure item that is a defect in a file the pass changed, is fixed: send it, quoted, to the executor of the group that holds the file, with the sentence, verbatim with that executor's original own folder in place of <own>, "Your own folder is <own>: keep every scratch file in it, delete it when you finish, and delete nothing else in the scratchpad.", or to a new one launched as in step 4 for that group and given the finding, with a new own folder and the same Shared_Decisions and constraints sentences. A finding on work that ran on haiku always goes to a new executor on sonnet, never as a follow-up to the Haiku one, whose model would stay in force; that launch is the first of the two attempts. A fix is still bound by them: no behaviour change, no rename for taste. Check each fix attempt's deleted: as in step 4, and stop on a problem there as step 4 does, Run_Folder left in place and named, before re-running any check against the Baseline. Up to two attempts per finding.
  • After each attempt, re-run that file's checks yourself: the full suite, compared with the Baseline as in step 5, and, where Scope holds infrastructure code, the synthesis diffed against the Baseline's output. A difference means the attempt failed. If a difference remains after the second attempt, name the file, report the difference verbatim and ask whether to revert or keep, as in step 5.
  • A finding still open after two attempts, every nit, and every reviewer unsure item that is not a defect in the pass's changes go to the hand-back's problems, quoted, with the reason each was not fixed.

No second review after the fixes. A fix's Summary is the executor's record of the fix: it is shown beside the record it amends, marked as not reviewed; its lines are not listed as not checked, and its unsure items are handled like any other.

7. Hand back

Delete the Run_Folder. Then invoke the Skill tool with skill: ponderly:report and args: handback, once; its Message is the hand-back, with nothing written after it. Its done work shows each group's record with the reviewer's records: checks beside it, a line for a file reverted in step 5 marked as reverted, and a fix's record beside the record it amends, marked as not reviewed. Its problems hold every stopped executor, every difference kept, every finding still open after two fix attempts, every nit, every unsure item carried from the executors and the reviewer, every record line that does not match, every line not checked and every file in no record, and any Baseline failure the author chose to go on past. Its Next says the changes sit uncommitted on the current branch, and recommends /ponderly:tighten-tests to clean up the branch's tests now that the code reads plainly, or /ponderly:pr to open the pull request.

If the Skill tool cannot find ponderly:report, say that the plugin's report skill is missing and stop. Do not write the hand-back yourself.

Commit nothing and push nothing.

04 同仓库更多 Skills

sabind
sabind/ponderly

tighten-tests

Slim a branch's tests without losing a covered line or a proof a requirement needs. Use when asked to slim the tests, tighten, trim or prune them, audit the tests, or when a branch has too many tests. Readability of the source is readable-code's, not this skill's; it asks first whether readable-code has run on the final code and offers to run it. Audits every test the branch adds or changes with a keep, merge or drop verdict the author approves, applies the verdicts without changing a source file, proves the smaller suite no weaker by line coverage and mutation checks, has the changes reviewed and fixed, and hands back with the report skill, offering to file each gap it found as an issue. Commits nothing.

★ 0
sabind
sabind/ponderly

strategy

Write a tech strategy, the highest level view of about a year of work across one or more projects. Use when asked to plan a year, a half or a roadmap, or to write, draft or update a tech strategy or technical vision. Reads the strategies already under .ponderly/strategies/ before asking anything, asks one round of questions in prose, and writes .ponderly/strategies/<name>.md from the plugin's strategy template. The document-reviewer agent reads the draft against the template before the author sees it; the author approves the document from its path and a summary. Ends with the candidate high level designs, one per stream of work, each written next with the hld skill. Needs no source code, so it works in a docs repository. Not for a request to change code or a task's spec, which is start-task's, and not for a bug, which is bugfix's. Writes no code.

★ 0
sabind
sabind/ponderly

start-task

Front door for any request to change code. Reads the code the request touches, then decides whether it goes to the task executor, to the bugfix skill or to a spec, and asks the author when the answer is not a spec. Start a new feature or task by writing its spec before any code. Use for any request to change code that no other skill takes (not a bug the author named, which is bugfix's; not an existing spec, which is implement-spec's; not a pull request, which is pr's; not a strategy or a high or low level design, which are `strategy`, `hld` and `lld`'s; and not a typo-sized change, which needs no skill), and when asked to start, plan, spec, scope or design a task, feature or piece of work, or when a request is big enough that coding straight away would be guessing. Produces requirements.md, design.md and tasks.md in .ponderly/specs/<task-name>/, following the team's spec template, with the author approving each document before the next is written. Does not write code.

★ 0
sabind
sabind/ponderly

review

Review a pull request and return line-anchored findings. Use when asked to review this branch, review this pull request, review these commits or review a base...head range. Takes the range from the argument, or the branch's merge base with the default branch up to the working tree when there is none, launches one review-arm agent per lens in its lenses file, all at once, and merges what they return. The merge relaunches once an arm whose block is missing or malformed, then drops it and names its arm, checks every finding's file and lines at the head, collapses duplicates as --duplicates says, and orders high, medium, low. Has the wave-reviewer agent read the change with the merged findings quoted, folds its findings into the list, and reruns only arms it contradicted, when the budget allows. Returns the findings with their counts and the wave review's verdict, or writes them as JSON to a path outside the repository, or ignored by it, with --json. Changes no tracked file in the repository and commits nothing.

★ 0
sabind
sabind/ponderly

report

Writes the message to the author whenever work comes back from an agent or a check, a choice is open and the author must decide, the author asks what is going on, or what something is or why it happened. Four modes, handback, decision, status or answer, from the optional argument or the conversation. The handback and status templates put problems first; every template names things by what they are. Writes only; edits nothing, launches no agent.

★ 0
sabind
sabind/ponderly

pr

Open or update a GitHub pull request for the current branch using the team's PR standard. Use when asked to open, create, raise, or update a PR. Takes the ticket as its first argument and reads it, then explains each change between the branch and its target as the user and the owner experience it and asks the author to confirm or correct each explanation. A branch built from a ticked spec is drafted from the spec and its implementation reports, with one round of questions. A mechanical change, such as a version bump, gets one question, and a question the author has already answered is never asked again. The branch, commit, Closes and draft questions come together in one call after the walkthrough, except a Closes question for a ticket first named in the prose round, which comes on its own. Drafts the title and description from the repository's own pull request template or the skill's default one, and creates the PR with the gh CLI after the author approves.

★ 0