Formik Form Patterns
ChrisWiles/claude-code-showcase
Shows how to build forms with Formik and Yup validation, including conditional rules, field helpers, GraphQL submission, edit forms and multi-step flows.
Teaches React Hooks for reusing stateful logic across components.
$ npx skills add zosmaai/zosma-cowork --skill hooks-pattern -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install zosmaai/zosma-cowork hooks-pattern --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/zosmaai/zosma-cowork.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/hooks-pattern .claude/skills/hooks-pattern && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "hooks-pattern" agent skill from https://github.com/zosmaai/zosma-cowork/tree/main/.agents/skills/hooks-pattern into .claude/skills/hooks-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hooks-pattern", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/zosmaai/zosma-cowork/tree/main/.agents/skills/hooks-patternType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add zosmaai/zosma-cowork --skill hooks-pattern -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install zosmaai/zosma-cowork hooks-pattern --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/zosmaai/zosma-cowork.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/hooks-pattern .agents/skills/hooks-pattern && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "hooks-pattern" agent skill from https://github.com/zosmaai/zosma-cowork/tree/main/.agents/skills/hooks-pattern into .agents/skills/hooks-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hooks-pattern", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add zosmaai/zosma-cowork --skill hooks-pattern -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install zosmaai/zosma-cowork hooks-pattern --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/zosmaai/zosma-cowork.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/hooks-pattern .cursor/skills/hooks-pattern && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "hooks-pattern" agent skill from https://github.com/zosmaai/zosma-cowork/tree/main/.agents/skills/hooks-pattern into .cursor/skills/hooks-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hooks-pattern", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/zosmaai/zosma-cowork.git --path .agents/skills/hooks-pattern--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add zosmaai/zosma-cowork --skill hooks-pattern -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install zosmaai/zosma-cowork hooks-pattern --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/zosmaai/zosma-cowork.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/hooks-pattern .gemini/skills/hooks-pattern && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "hooks-pattern" agent skill from https://github.com/zosmaai/zosma-cowork/tree/main/.agents/skills/hooks-pattern into .gemini/skills/hooks-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hooks-pattern", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install zosmaai/zosma-cowork hooks-patternInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add zosmaai/zosma-cowork --skill hooks-pattern -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/zosmaai/zosma-cowork.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/hooks-pattern .github/skills/hooks-pattern && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "hooks-pattern" agent skill from https://github.com/zosmaai/zosma-cowork/tree/main/.agents/skills/hooks-pattern into .github/skills/hooks-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hooks-pattern", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add zosmaai/zosma-cowork --skill hooks-pattern -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install zosmaai/zosma-cowork hooks-pattern --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/zosmaai/zosma-cowork.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/hooks-pattern .opencode/skills/hooks-pattern && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "hooks-pattern" agent skill from https://github.com/zosmaai/zosma-cowork/tree/main/.agents/skills/hooks-pattern into .opencode/skills/hooks-pattern/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hooks-pattern", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
hooks-patternTeaches React Hooks for reusing stateful logic across components.
Hooks Pattern is an agent skill from zosmaai/zosma-cowork. Teaches React Hooks for reusing stateful logic across components. Use when extracting shared behavior like form handling, subscriptions, or side effects into reusable custom hooks.
Its SKILL.md is about 5.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Frontend & Design, covering React components and Forms and validation. It works with React, Tauri and TypeScript. The repository describes itself as: A web-based AI workspace with a local execution daemon, with an emerging control-plane architecture for remotely operating AI coworkers across machines. The licence is MIT.
2 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 490fa70. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadGrepGlobFrom allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
react.devgithub.comusehooks.comnikgraf.github.iopatterns.devFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Hooks Pattern loads about 5.1k tokens when it runs. Until then it costs about 49 tokens; SKILL.md has 2,345 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from zosmaai/zosma-cowork at commit 490fa70, republished under its MIT licence (© zosmaai). 2,345 words, ~5,099 tokens.
.claude/skills/hooks-pattern/SKILL.md (or your agent's skills folder).React 16.8 introduced a new feature called Hooks. Hooks make it possible to use React state and lifecycle methods, without having to use an ES2015 class component.
Although Hooks are not necessarily a design pattern, Hooks play a very important role in your application design. Many traditional design patterns can be replaced by Hooks.
useState for local state and useEffect for side effects in functional componentsuse) to encapsulate and share reusable logicuseEffect — compute derived state directly in the component bodyuseMemo/useCallback where possibleBefore Hooks were introduced in React, we had to use class components in order to add state and lifecycle methods to components. A typical class component in React can look something like:
class MyComponent extends React.Component {
/* Adding state and binding custom methods */
constructor() {
super()
this.state = { ... }
this.customMethodOne = this.customMethodOne.bind(this)
this.customMethodTwo = this.customMethodTwo.bind(this)
}
/* Lifecycle Methods */
componentDidMount() { ...}
componentWillUnmount() { ... }
/* Custom methods */
customMethodOne() { ... }
customMethodTwo() { ... }
render() { return { ... }}
}A class component can contain a state in its constructor, lifecycle methods such as componentDidMount and componentWillUnmount to perform side effects based on a component's lifecycle, and custom methods to add extra logic to a class.
Although we can still use class components after the introduction of React Hooks, using class components can have some downsides! Let's look at some of the most common issues when using class components.
Since class components were the only component that could handle state and lifecycle methods before React Hooks, we often ended up having to refactor functional components into a class components, in order to add the extra functionality.
In this example, we have a simple div that functions as a button.
function Button() {
return <div className="btn">disabled</div>;
}Instead of always displaying disabled, we want to change it to enabled when the user clicks on the button, and add some extra CSS styling to the button when that happens.
In order to do that, we need to add state to the component in order to know whether the status is enabled or disabled. This means that we'd have to refactor the functional component entirely, and make it a class component that keeps track of the button's state.
export default class Button extends React.Component {
constructor() {
super();
this.state = { enabled: false };
}
render() {
const { enabled } = this.state;
const btnText = enabled ? "enabled" : "disabled";
return (
<div
className={`btn enabled-${enabled}`}
onClick={() => this.setState({ enabled: !enabled })}
>
{btnText}
</div>
);
}
}In this example, the component is very small and refactoring wasn't a such a great deal. However, your real-life components probably contain of many more lines of code, which makes refactoring the component a lot more difficult.
Besides having to make sure you don't accidentally change any behavior while refactoring the component, you also need to understand how ES2015 classes work. Why do we have to bind the custom methods? What does the constructor do? Where does the this keyword come from? It can be difficult to know how to refactor a component properly without accidentally changing the data flow.
The common way to share code among several components, is by using the Higher Order Component or Render Props pattern. Although both patterns are valid and a good practice, adding those patterns at a later point in time requires you to restructure your application.
Besides having to restructure your app, which is trickier the bigger your components are, having many wrapping components in order to share code among deeper nested components can lead to something that's best referred to as a wrapper hell. It's not uncommon to open your dev tools and seeing a structure similar to:
<WrapperOne>
<WrapperTwo>
<WrapperThree>
<WrapperFour>
<WrapperFive>
<Component>
<h1>Finally in the component!</h1>
</Component>
</WrapperFive>
</WrapperFour>
</WrapperThree>
</WrapperTwo>
</WrapperOne>The wrapper hell can make it difficult to understand how data is flowing through your application, which can make it harder to figure out why unexpected behavior is happening.
As we add more logic to class components, the size of the component increases fast. Logic within that component can get tangled and unstructured, which can make it difficult for developers to understand where certain logic is used in the class component. This can make debugging and optimizing performance more difficult.
Lifecycle methods also require quite a lot of duplication in the code.
Although a component may be small, the logic within the component can already be quite tangled. Whereas certain parts are specific for the counter logic, other parts are specific for the width logic. As your component grows, it can get increasingly difficult to structure logic within your component, find related logic within the component.
Besides tangled logic, we're also duplicating some logic within the lifecycle methods. In both componentDidMount and componentWillUnmount, we're customizing the behavior of the app based on the window's resize event.
It's quite clear that class components aren't always a great feature in React. In order to solve the common issues that React developers can run into when using class components, React introduced React Hooks. React Hooks are functions that you can use to manage a components state and lifecycle methods. React Hooks make it possible to:
componentDidMount and componentWillUnmountFirst, let's take a look at how we can add state to a functional component, using React Hooks.
React provides a hook that manages state within a functional component, called useState.
Let's see how a class component can be restructured into a functional component, using the useState hook. We have a class component called Input, which simply renders an input field. The value of input in the state updates, whenever the user types anything in the input field.
class Input extends React.Component {
constructor() {
super();
this.state = { input: "" };
this.handleInput = this.handleInput.bind(this);
}
handleInput(e) {
this.setState({ input: e.target.value });
}
render() {
<input onChange={handleInput} value={this.state.input} />;
}
}In order to use the useState hook, we need to access the useState method that React provides for us. The useState method expects an argument: this is the initial value of the state, an empty string in this case.
We can destructure two values from the useState method:
const [value, setValue] = React.useState(initialValue);The first value can be compared to a class component's this.state.[value].
The second value can be compared to a class component's this.setState method.
Since we're dealing with the value of an input, let's call the current value of the state input, and the method in order to update the state setInput. The initial value should be an empty string.
const [input, setInput] = React.useState("");We can now refactor the Input class component into a stateful functional component.
function Input() {
const [input, setInput] = React.useState("");
return <input onChange={(e) => setInput(e.target.value)} value={input} />;
}The value of the input field is equal to the current value of the input state, just like in the class component example. When the user types in the input field, the value of the input state updates accordingly, using the setInput method.
We've seen we can use the useState component to handle state within a functional component, but another benefit of class components was the possibility to add lifecycle methods to a component.
With the useEffect hook, we can "hook into" a components lifecycle. The useEffect hook effectively combines the componentDidMount, componentDidUpdate, and componentWillUnmount lifecycle methods.
componentDidMount() { ... }
useEffect(() => { ... }, [])
componentWillUnmount() { ... }
useEffect(() => { return () => { ... } }, [])
componentDidUpdate() { ... }
useEffect(() => { ... })Let's use the input example we used in the State Hook section. Whenever the user is typing anything in the input field, we also want to log that value to the console.
We need to use a useEffect hook that "listens" to the input value. We can do so, by adding input to the dependency array of the useEffect hook. The dependency array is the second argument that the useEffect hook receives.
useEffect(() => {
console.log(`The user typed ${input}`);
}, [input]);The value of the input now gets logged to the console whenever the user types a value.
Besides the built-in hooks that React provides (useState, useEffect, useReducer, useRef, useContext, useMemo, useImperativeHandle, useLayoutEffect, useDebugValue, useCallback), we can easily create our own custom hooks.
You may have noticed that all hooks start with use. It's important to start your hooks with use in order for React to check if it violates the Rules of Hooks.
Let's say we want to keep track of certain keys the user may press when writing the input. Our custom hook should be able to receive the key we want to target as its argument.
function useKeyPress(targetKey) {
const [keyPressed, setKeyPressed] = React.useState(false);
function handleDown({ key }) {
if (key === targetKey) {
setKeyPressed(true);
}
}
function handleUp({ key }) {
if (key === targetKey) {
setKeyPressed(false);
}
}
React.useEffect(() => {
window.addEventListener("keydown", handleDown);
window.addEventListener("keyup", handleUp);
return () => {
window.removeEventListener("keydown", handleDown);
window.removeEventListener("keyup", handleUp);
};
}, []);
return keyPressed;
}Instead of keeping the key press logic local to the Input component, we can now reuse the useKeyPress hook throughout multiple components, without having to rewrite the same logic over and over.
Another great advantage of Hooks, is that the community can build and share hooks. Here are some websites that list all the hooks built by the community, and ready to use in your application:
By rewriting the counter and width example using React Hooks, we can break the logic of the App function into several pieces:
useCounter: A custom hook that returns the current value of count, an increment method, and a decrement method.useWindowWidth: A custom hook that returns the window's current width.App: A functional, stateful component that returns the Counter and Width component.By using React Hooks instead of a class component, we were able to break the logic down into smaller, reusable pieces that separated the logic.
Using React Hooks just made it much clearer to separate the logic of our component into several smaller pieces. Reusing the same stateful logic just became much easier, and we no longer have to rewrite functional components into class components if we want to make the component stateful. A good knowledge of ES2015 classes is no longer required, and having reusable stateful logic increases the testability, flexibility and readability of components.
Like other components, there are special functions that are used when you want to add Hooks to the code you have written. Here's a brief overview of some common Hook functions:
useStateThe useState Hook enables developers to update and manipulate state inside function components without needing to convert it to a class component. One advantage of this Hook is that it is simple and does not require as much complexity as other React Hooks.
useEffectThe useEffect Hook is used to run code during major lifecycle events in a function component. The main body of a function component does not allow mutations, subscriptions, timers, logging, and other side effects. If they are allowed, it could lead to confusing bugs and inconsistencies within the UI. The useEffect hook prevents all of these "side effects" and allows the UI to run smoothly. It is a combination of componentDidMount, componentDidUpdate, and componentWillUnmount, all in one place.
useContextThe useContext Hook accepts a context object, which is the value returned from React.createContext, and returns the current context value for that context. The useContext Hook also works with the React Context API in order to share data throughout the app without the need to pass your app props down through various levels.
It should be noted that the argument passed to the useContext hook must be the context object itself and any component calling the useContext always re-renders whenever the context value changes.
useReducerThe useReducer Hook gives an alternative to setState and is especially preferable to it when you have complex state logic that involves multiple sub-values or when the next state depends on the previous one. It takes on a reducer function and an initial state input and returns the current state and a dispatch function as output by means of array destructuring. useReducer also optimizes the performance of components that trigger deep updates.
Hooks allows you group code by concern and functionality, and not by lifecycle. This makes the code not only cleaner and concise but also shorter. Below is a comparison of a simple stateful component of a searchable product data table using React, and how it looks in Hooks after using the useState keyword.
class TweetSearchResults extends React.Component {
constructor(props) {
super(props);
this.state = {
filterText: "",
inThisLocation: false,
};
this.handleFilterTextChange = this.handleFilterTextChange.bind(this);
this.handleInThisLocationChange =
this.handleInThisLocationChange.bind(this);
}
handleFilterTextChange(filterText) {
this.setState({
filterText: filterText,
});
}
handleInThisLocationChange(inThisLocation) {
this.setState({
inThisLocation: inThisLocation,
});
}
render() {
return (
<div>
<SearchBar
filterText={this.state.filterText}
inThisLocation={this.state.inThisLocation}
onFilterTextChange={this.handleFilterTextChange}
onInThisLocationChange={this.handleInThisLocationChange}
/>
<TweetList
tweets={this.props.tweets}
filterText={this.state.filterText}
inThisLocation={this.state.inThisLocation}
/>
</div>
);
}
}Same component with Hooks
const TweetSearchResults = ({ tweets }) => {
const [filterText, setFilterText] = useState("");
const [inThisLocation, setInThisLocation] = useState(false);
return (
<div>
<SearchBar
filterText={filterText}
inThisLocation={inThisLocation}
setFilterText={setFilterText}
setInThisLocation={setInThisLocation}
/>
<TweetList
tweets={tweets}
filterText={filterText}
inThisLocation={inThisLocation}
/>
</div>
);
};JavaScript classes can be difficult to manage, hard to use with hot reloading and may not minify as well. React Hooks solves these problems and ensures functional programming is made easy. With the implementation of Hooks, We don't need to have class components.
Classes in JavaScript encourage multiple levels of inheritance that quickly increase overall complexity and potential for errors. However, Hooks allow you to use state, and other React features without writing a class. With React, you can always reuse stateful logic without the need to rewrite the code over and over again. This reduces the chances of errors and allows for composition with plain functions.
Until the implementation of Hooks, React had no way of extracting and sharing non-visual logic. This eventually led to more complexities, such as the HOC patterns and Render props, just to solve a common problem. But, the introduction of Hooks has solved this problem because it allows for the extraction of stateful logic to a simple JavaScript function.
There are of course some potential downsides to Hooks worth keeping in mind:
When Hooks were introduced to React, it created a new problem: how do we know when to use function components with Hooks and class components? With the help of Hooks, it is possible to get state and partial lifecycle Hooks even in function components. Hooks also allow you to use local state and other React features without writing a class.
Here are some differences between Hooks and Classes to help you decide:
| React Hooks | Classes |
|---|---|
| It helps avoid multiple hierarchies and make code clearer | Generally, when you use HOC or renderProps, you have to restructure your App with multiple hierarchies when you try to see it in DevTools |
| It provides uniformity across React components. | Classes confuse both humans and machines due to the need to understand binding and the context in which functions are called. |
© zosmaai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/hooks-pattern of zosmaai/zosma-cowork.
Open the folder on GitHubat commit 490fa70
Hooks Pattern next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Hooks Pattern this skillzosmaai/zosma-cowork | 123 | — | ~5.1k | Automated safety check: Pass | MIT | |
| Formik Form PatternsChrisWiles/claude-code-showcase | 6.1k | 3 repos | ~2.1k | Automated safety check: Pass | None | |
| Web Artifacts Builderanthropics/skills | 180k | 40 repos | ~769 | Automated safety check: Pass | Apache-2.0 | |
| Dify Component Writing Guidelanggenius/dify | 158k | — | ~626 | Automated safety check: Pass | Custom licence | |
| React Frontend Development Guidelinesdiet103/claude-code-infrastructure-showcase | 10k | 2 repos | ~2.9k | Automated safety check: Pass | MIT | |
| Animated React Component LibrariesHainrixz/editor-pro-max | 260 | 1 repos | ~5.7k | Automated safety check: Pass | Custom licence |
ChrisWiles/claude-code-showcase
Shows how to build forms with Formik and Yup validation, including conditional rules, field helpers, GraphQL submission, edit forms and multi-step flows.
anthropics/skills
Builds multi-component claude.ai HTML artifacts as a small React, TypeScript and Tailwind project, then bundles it into one shareable HTML file.
langgenius/dify
Use when implementing or refactoring React/TypeScript components and the task requires decisions about component ownership, feature boundaries, state, data…
diet103/claude-code-infrastructure-showcase
Guidelines for React 18 and TypeScript apps covering Suspense data fetching, lazy loading, feature folders, MUI v7 styling, TanStack Router and performance.
Hainrixz/editor-pro-max
Helps choose and drop in animated React components from Magic UI and React Bits for landing pages, marketing sites and dashboards, instead of hand-coding animations.
internet-development/www-sacred
Keep www-sacred's TypeScript fast to type-check and fast to run.
zosmaai/zosma-cowork
Reach for the react-call library (createCallable) when building UI that resolves a value back to its caller — confirmations, dialogs, form modals, toasts, notifications, context menus, pickers.
zosmaai/zosma-cowork
Tauri development guidelines for building cross-platform desktop applications with TypeScript, Rust, and modern web technologies
Works with
Categories
Teaches React Hooks for reusing stateful logic across components. Hooks Pattern is an agent skill from zosmaai/zosma-cowork. Teaches React Hooks for reusing stateful logic across components.
Hooks Pattern fits situations like: extracting shared behavior like form handling; side effects into reusable custom hooks.
Run `npx skills add zosmaai/zosma-cowork --skill hooks-pattern -a claude-code`. Or copy the skill folder (.agents/skills/hooks-pattern in zosmaai/zosma-cowork) into .claude/skills/hooks-pattern in your project. Claude Code loads it when a task matches its description.
Run `npx skills add zosmaai/zosma-cowork --skill hooks-pattern -a codex`. Or copy the skill folder (.agents/skills/hooks-pattern in zosmaai/zosma-cowork) into .agents/skills/hooks-pattern in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zosmaai/zosma-cowork --skill hooks-pattern -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/hooks-pattern, .gemini/skills/hooks-pattern, .github/skills/hooks-pattern and .opencode/skills/hooks-pattern in your project.
SKILL.md names no scripts, command-line tools or credentials: Hooks Pattern is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Grep, Glob.
SKILL.md names 5 domains. As links in the text: react.dev, github.com, usehooks.com, nikgraf.github.io and patterns.dev. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Hooks Pattern is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 5.1k tokens (SKILL.md is roughly 20k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Hooks Pattern: Formik Form Patterns (ChrisWiles/claude-code-showcase, 6.1k stars), Web Artifacts Builder (anthropics/skills, 180k stars), Dify Component Writing Guide (langgenius/dify, 158k stars) and React Frontend Development Guidelines (diet103/claude-code-infrastructure-showcase, 10k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
zosmaai (a GitHub organization) maintains it in zosmaai/zosma-cowork, which has 123 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 6, 2026.
Source: zosmaai/zosma-cowork on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.