ketcher-flow
Skill927 starsChanged 2 days agoApache-2.0View on GitHub
Route a Ketcher scope (a feature, a bug, a refactor, a small change, a list of symptoms, a batch of tasks of any kinds, or open PRs with review comments) to its flow and run it to a reviewed PR.
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Read the request and the conversation.
- Very specific: line 41
When the scope is an issue, check that no open PR already closes it before the first branch: gh pr list --state open --json …
- Distinctive: line 43
When no row fits, ask the user, offering the kinds that fit.
- Very specific: line 63
Triage: When your tool gives you no way to dispatch a subagent, report cannot dispatch and end.
- Very specific: line 87
Every change a user can see in the editor is proven with the verify-ketcher skill (its SKILL.md) before review: the verifier role follows …
- Distinctive: line 91
Every flow ends in a PR on its own branch, per TRACKER.md: you commit, push, and open it without asking (AGENTS.md, Git and commits).
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Ketcher flow
You have a scope: whatever the user wants done. First you name its kind. The kind picks the flow file you read and run.
Reference
A file named without a link lives in flows/ (one per kind), roles/ (what a dispatched subagent follows), or shared/ (what flows and roles both read). Read these when the step you are on needs them:
- LOCATIONS.md: the run directory, worktrees,
<base>, branches. Read before the first run directory or worktree. - TRACKER.md: GitHub issues, the PR title and body, comments. Read when a flow reads, files, or comments on issues, or opens a PR.
- REVIEW.md: the cleanup, the reviewer panel, and the review rounds. Read when the flow reaches its review step.
- ROLES.md: the roles a flow dispatches and the model each one runs on, per tool. Read before the first dispatch.
- QUALITY.md: how code is shaped, written, tested, fixed, and reviewed. Every implementer and reviewer dispatch carries its path.
The flows call three vendored skills at fixed steps: diagnosing-bugs and tdd (from RED.md) and codebase-design (for Design It Twice). The Ketcher specifics live in the flow file that calls them, and win where the two differ. Call them with your tool's skill command, or read their SKILL.md when it has none.
Kinds
Read the request and the conversation. Take the first row that fits:
| The scope is | Kind | Flow |
| open PRs with review comments to address: PR numbers, or "follow up on my PRs" | follow-up | FOLLOW-UP.md |
| two or more symptoms: what the user saw go wrong while testing by hand, one per line, in their words | symptoms | HUNT.md |
| two or more tasks, of any kinds: issue numbers, a list, or a query such as "fix the open bugs" | batch | BATCH.md |
| one wrong behavior, in prose or as one issue | bug | BUG.md |
| new or changed product behavior: a feature request, an OpenSpec change, or a goal in the conversation, including one that also names bugs | feature | FEATURE.md |
| a change to structure that keeps behavior and moves an interface or spans modules: extract, move, dedupe, simplify, rewrite a file in TypeScript | refactor | REFACTOR.md |
one reason, one PR, and no user sees a difference: a lint-rule cleanup, an any removal, copy, config, a dependency bump, docs | small | SMALL.md |
A feature scope that names bugs in the behavior it adds or changes stays one feature run. Each such bug becomes a task with Kind: bug, as FEATURE.md says. A bug elsewhere is a second task, and the scope is a batch.
A scope whose diff will qualify as a large-scale change (the Qualifies rule in review-workflow.md) runs its flow and also follows that protocol: the split decision comes before the first branch.
When the scope is an issue, check that no open PR already closes it before the first branch: gh pr list --state open --json number,title,closingIssuesReferences. When one does, name the PR to the user and stop. A batch drops such issues itself (BATCH.md step 1).
When no row fits, ask the user, offering the kinds that fit. Done when you have told the user the kind in one line ("Kind: bug, #12365") and read its flow file. Then run the flow.
Where a flow stops
Code on a branch, a draft PR, and files in the run directory are reversible, so a flow goes on without asking. It stops for the user only at a decision that is theirs (product or design) or a write other people see on the tracker, and decides and records everything else. Each flow names its stops, on top of the open-PR stop in Kinds:
| Kind | Stops |
| follow-up | a comment that needs a product decision, posting the replies (FOLLOW-UP.md) |
| bug | the escalations in BUG.md |
| small | none |
| feature | the proposal (FEATURE.md step 3) |
| refactor | target.md and the worktree choice (REFACTOR.md step 2) |
| symptoms | the issues to file (HUNT.md step 4) |
| batch | a large input set, its tasks' stops in one message, tracker writes (BATCH.md) |
Dispatched by a batch
A batch dispatches you as a task orchestrator: one task, a task run directory <batch run dir>/<id>/, the baseline path, a port block, and the roles table with the user's overrides. Run the task as one flow:
- Triage. When your tool gives you no way to dispatch a subagent, report
cannot dispatchand end. Otherwise create the task worktree as LOCATIONS.md says, then follow TRIAGE.md. An outcome other thanreadyends the run: remove the worktree, delete its branch, and report the outcome. - Flow. Read the flow file of the kind triage named and run it whole, with the task run directory as its run directory. Use the baseline you were given in place of saving one, and take every app port from your block. At a gate, put only the work in
stop.md: the roles table and the worktree choice come with the dispatch. - Stops. At each stop of the flow, write what you would show the user to
<task run dir>/stop.md, and end with the reportstopped: <step>. The batch resumes you with the user's answer: go on from that step. - Report when the flow ends: the PR, one outcome line for the run report, the paths the branch changed, and the Lessons. Put the brief (The brief in BATCH.md) at the top of the PR body. Draft tracker comments in
<task run dir>/comment.mdin place of posting them.
Done when you have reported stopped: <step> or the final report.
Checks
The repo's checks are its full validation:
npm testfrom the root.npm run test:typeswhenexample/ordemo/changed.npm run check:agent-docswhenAGENTS.md,.memory-bank/,.agents/, or.claude/changed.npx openspec validate --all --strictwhenopenspec/changed.
Playwright E2E runs in CI. Run only the specs a change touches locally (.memory-bank/testing/testing.md says how).
A check can already fail on <base>, so compare, never count. Each run saves a baseline once, before its first fix: every check's output on <base> in <run dir>/baseline/<check>.txt. A branch passes a check when its output adds no failing line the baseline lacks. Name the pre-existing failures rather than folding them into the work.
A test that times out only while several builds run at once is load, not code. Assertion failures and missing exports are real.
Proof in the app
Every change a user can see in the editor is proven with the verify-ketcher skill (its SKILL.md) before review: the verifier role follows VERIFY.md. The verdict and its evidence go in the PR body, as ketcher-pr says.
Landing
Every flow ends in a PR on its own branch, per TRACKER.md: you commit, push, and open it without asking (AGENTS.md, Git and commits). A change that alters what the canvas draws also runs SNAPSHOTS.md once the PR is open. You never merge.
Every flow's final report ends with Lessons: each blocker or major that review found and that a rule could have caught before review (a lint rule, a rule in review-rules.md, a line in QUALITY.md), with the rule you would add. Propose it only: a new rule is a scope of its own, not part of this PR. Write Lessons: none when no finding fits.
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- add-localstorage-settingSkill
- codebase-designSkill
- code-reviewSkill
- commitSkill
- create-releaseSkill
- create-verification-skillSkill
- diagnosing-bugsSkill
- generate-autotestsSkill
- ketcher-prSkill
- maintain-verification-skillSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- openspec-sync-specsSkill
- openspec-update-changeSkill
- prepare-releaseSkill
- review-prSkill
- split-componentSkill
- tddSkill
- verify-ketcherSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

