actions
Skill0 starsChanged 4 days agoMITView on GitHub
How to write, register and test an action, the one definition of a capability that the UI, the assistant and the action CLI all call. Use when adding or changing anything that reads or writes app data.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- JetBrains/intellij-communitytheir own version, first seen Nov 13, 2026
- JetBrains/MPStheir own version, first seen Nov 3, 2026
- spotify/portal-ai-pluginstheir own version, first seen Oct 8, 2026
- DenchHQ/ironclawtheir own version, first seen Oct 8, 2026
- DenchHQ/DenchClawtheir own version, first seen Oct 8, 2026
- DetachHead/rebasedtheir own version, first seen Oct 8, 2026
Used with
Projects with it also use ship.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
AWSSkillship
Finalize dev work on an issue branch — update docs, push, and open a PR.
Also in 3 projects that use this
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- JetBrains/intellij-community★ 21ksame name
- BuilderIO/agent-native★ 7.6ksame name
- DetachHead/rebased★ 6.5ksame name
- spotify/portal-ai-plugins★ 2.8ksame name
- JetBrains/MPS★ 1.7ksame name
- DenchHQ/DenchClaw★ 1.7ksame name
- DenchHQ/ironclaw★ 1.7ksame name
- aborroy/aiup-alfresco★ 14same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- accessibilitySkill
- adding-a-featureSkill
- agent-workflowSkill
- app-contextSkill
- approval-and-safetySkill
- backend-proxySkill
- background-workSkill
- build-an-appSkill
- capture-learningsSkill
- clean-architectureSkill
- customizing-the-assistantSkill
- delegate-to-agentSkill
- edit-boundariesSkill
- i18n-and-rtlSkill
- model-providersSkill
- performanceSkill
- permissions-and-platformSkill
- read-the-docsSkill
- reliable-mutationsSkill
- routingSkill
- secretsSkill
- state-managementSkill
- storing-dataSkill
- testingSkill
- ui-designSkill
- upgrade-the-frameworkSkill
- verifySkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
0
Distinctive
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
- Very specific: line 8
Don't load this for wiring a whole feature end to end.
- Very specific: line 12
Every capability is one AgentAction in lib/domain/actions/, registered through AppActions in lib/domain/actions/app_actions.dart.
- Very specific: line 25
Surface: keep the set small and orthogonal.
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Actions
Don't load this for wiring a whole feature end to end; see adding-a-feature.
Rule
Every capability is one AgentAction in lib/domain/actions/, registered through AppActions in lib/domain/actions/app_actions.dart. Screens call it with registry.run(action, input), the assistant calls it by name, and tool/action.dart runs it from the command line. Nothing writes data any other way.
Why
One definition means the assistant can do whatever the UI can, and the person sees the same result either way. The registry checks every definition at startup, gates approval, times calls out, redacts key-shaped text and emits change events so screens refresh.
How
Copy the shape of CreateItem in lib/domain/actions/items_actions.dart:
- Name:
snake_case, verb first (create_item,set_theme_mode). The registry rejects names that are notsnake_caseat startup; verb first is a convention for you to keep. - Description: one complete line saying what it does. The model chooses tools by it.
- Input: an
S.object(...)schema. Every field has a description (the builder requires one).buildonly maps the checked JSON to the input type. Trim and validate insiderun, before anything is written, by throwingActionFailure('invalid_input', ...)with the field path indetails, like_titleand_descriptiondo: the UI'sregistry.runpasses typed input and skips the JSON schema, so checks inbuildnever see its calls. - Surface: keep the set small and orthogonal. One patch action per resource (
update_itemtakes optional fields) instead of one action per field. - Failures: throw
ActionFailure(code, message), list your codes infailureCodes, never return an error value (theno_error_returns_in_actionslint flags it).not_foundis the usual one. The registry copies receipts recorded before the throw onto the failure (ActionFailure.receipts), so a partial write still shows in the chat. - Writes: validate everything first, then write, then re-read and record
context.receipt(..., verified: true), with akeyandargsso the chat shows it in the app's language (seei18n-and-rtl). Return the stored record so the model gets its id. - Flags:
readOnlyfor actions that change nothing; otherwise list the data inresources(the registry refuses a writing action without them).needsApprovalfor deletes, bulk or irreversible changes.agentTool => falsefor anything the assistant must not call, such asset_api_keyinlib/domain/actions/settings_actions.dart. - No model calls inside an action. Judgment work belongs to the assistant in the chat.
- Register the new action in
AppActions(field, constructor,all). - Regenerate the reference:
dart run tool/action.dart --write-referencerewrites.agents/skills/actions/references/action-reference.md.
Try it without the UI:
dart run tool/action.dart --list
dart run tool/action.dart set_language '{"locale":"fa"}'
dart run tool/action.dart <action_name> '<json>' --approvedThe CLI uses a scratch database under .dart_tool/, never the app's data, and runs as caller cli, so actions that need approval need --approved.
Anti-patterns
- A screen calling
repository.createItem(...)directly: the assistant cannot do it, nothing is recorded, nothing refreshes through change events. return {'error': 'not found'}fromrun: the model reads it as success.- Validating after the first write, so a failure leaves half a change behind.
- One action per field (
set_item_title,set_item_description). - Putting a key, or anything secret, in an action's output or receipt.
Verification
- Each action needs
test/actions/<action_name>_test.dart;test/actions/create_item_test.dartis the model to copy. UseActionsHarnessfromtest/support/actions_harness.dart(registry over an in-memory database):h.call(name, json, approved: ...)runs as the assistant,h.registry.run(h.actions.x, input)as the UI (callrefusesCaller.ui),failsWith(code)matches a failure. Assert on the stored data andresult.receipts. - The registry's startup checks reject bad names, descriptions, missing resources and field descriptions.
- The parity test reports an action without a test file (or one that never mentions the action's name), a stale action reference, and an assistant-callable action without an
action_<name>label in everyassets/lang/file. dart run tool/action.dart <name> '<json>'shows the real output and receipts.tool/check.shruns all of this and ends withAll checks passed.
Related skills
adding-a-feature— wiring an action into a screen, a test and the screen table.approval-and-safety— when an action needs approval or must stay UI-only.app-context— the ids and summaries the model sees when it calls your action.delegate-to-agent— when the work needs judgment rather than a fixed rule.testing— which other tests a change needs.verify— running the gate before saying an action is done.
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.

