add-action-and-hook
Installation
SKILL.md
Adding a New Action and Hook to AppKit
This skill describes the end-to-end process of adding a new action (getXxx / watchXxx) and a corresponding React hook (useXxx) to the AppKit library. Follow each step in order, consulting existing examples as reference.
Step 1: Create the Action in appkit
There are two types of actions:
- Get actions — fetch data asynchronously (
getXxx). Used for one-time reads. - Watch actions — subscribe to state changes (
watchXxx). Used when the value can change over time and the UI needs to react.
1.1 Study existing actions
Before creating your own, look at similar actions in packages/appkit/src/actions/ to understand the pattern.
Get action example:
packages/appkit/src/actions/network/get-networks.ts