Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add tranhieutt/software_development_department --skill frontend-patternsgit clone --depth 1 https://github.com/tranhieutt/software_development_departmentWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/tranhieutt/software_development_department/frontend-patterns)<a href="https://agentmods.dev/skills/tranhieutt/software_development_department/frontend-patterns"><img src="https://agentmods.dev/badge/skills/tranhieutt/software_development_department/frontend-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/tranhieutt/software_development_department/frontend-patterns"><img src="https://agentmods.dev/badge/skills/tranhieutt/software_development_department/frontend-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00063 | $0.01406 |
| Opus 5.5 | $0.00025 | $0.00562 |
| Sonnet 5.5 | $0.00013 | $0.00281 |
| Haiku 4.5 | $0.00006 | $0.00141 |
Grade A, and why
frontend-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 155 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Frontend Patterns
Critical rules (non-obvious)
- Stale closure in
useEffect: always list all dependencies; useuseReffor values that shouldn't trigger re-run useEffectwithasync: never make the callbackasyncdirectly — create inner async fn and call it- Object/array as dependency: memoize with
useMemo/useCallbackor use primitive values; otherwise infinite loop - Key prop on lists: use stable IDs, never
indexwhen list can reorder or items get deleted React.memois not free: only wrap components with expensive renders and stable prop references
Component composition patterns
// Compound component with Context
const TabsContext = createContext<{ active: string; setActive: (v: string) => void } | null>(null);
function Tabs({ children, defaultValue }: { children: React.ReactNode; defaultValue: string }) {
const [active, setActive] = useState(defaultValue);
return <TabsContext.Provider value={{ active, setActive }}>{children}</TabsContext.Provider>;
}
Tabs.Trigger = function TabsTrigger({ value, children }: { value: string; children: React.ReactNode }) {
const ctx = useContext(TabsContext)!;
return <button onClick={() => ctx.setActive(value)} aria-selected={ctx.active === value}>{children}</button>;
};
Tabs.Content = function TabsContent({ value, children }: { value: string; children: React.ReactNode }) {
const { active } = useContext(TabsContext)!;
return active === value ? <>{children}</> : null;
};
State management decision
| Scope | Solution |
|---|---|
| Single component | useState, useReducer |
| Subtree | Context + useContext |
| Client global (UI) | Zustand / Jotai |
| Server state (API) | TanStack Query |
| Form state | React Hook Form |
| URL state | useSearchParams (Next.js) |
Data fetching with TanStack Query
// Fetch
const { data, isLoading, error } = useQuery({
queryKey: ["products", filters], // filters in key → auto-refetch on change
queryFn: () => api.getProducts(filters),
staleTime: 5 * 60 * 1000, // don't refetch for 5 min
});
// Mutate with optimistic update
const mutation = useMutation({
mutationFn: api.updateProduct,
onMutate: async (newProduct) => {
await queryClient.cancelQueries({ queryKey: ["products"] });
const prev = queryClient.getQueryData(["products"]);
queryClient.setQueryData(["products"], (old) => old.map(p => p.id === newProduct.id ? newProduct : p));
return { prev };
},
onError: (_, __, ctx) => queryClient.setQueryData(["products"], ctx?.prev),
onSettled: () => queryClient.invalidateQueries({ queryKey: ["products"] }),
});
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 155 lines · 63 tokens per session scan A 1339e0c8fe41
frontend-patterns is a skill published in the GitHub repository tranhieutt/software_development_department (73 stars, last pushed 5mo ago), licensed MIT. It adds 63 tokens to every session and 1,406 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
playwright-frontend
For frontend engineers authoring UI — how to make components reliably locatable by tests and AI agents. Covers the official Playwright locator priority, semantic/accessible markup first, and how to add valid, unique, stable data-testid attributes (naming convention, uniqueness in lists, stability rules) for React…
astro-integrations
Use when adding React, Vue, Svelte, Solid, Preact, or another UI framework to an Astro project via @astrojs/ integrations.
chrome-extension-wxt
Build Chrome extensions with the WXT framework and TypeScript, React, Vue, or Svelte. Use when creating browser extensions or cross-browser add-ons. Triggers on "chrome extension", "browser extension", WXT, manifest v3, or wxt.config.ts.
component-api-design
Design clean, composable React/Vue component APIs with accessibility built in. Use when designing or reviewing a component's props, composition, events or accessibility, or when a component API has grown hard to use.
nextjs
Skill "nextjs" from DongDuong2001/pudo-code-system, covering next.js 15 (app router) pudo checklist, 1. plan (architecture & strategy), 2. understand (context & auditing), 3. develop (implementation) and 4. optimize (performance & review).
btc-connect
A Bitcoin wallet connection guide for React, Vue, Next.js, and Nuxt 3 applications. It covers UniSat and OKX wallets, network changes, server-rendered setups, and a shared Hook interface.