.agents/skills/new-page/SKILL.md
Scaffold a complete new Next.js dashboard page for the WealthWise web app. Triggers when asked to "add a page", "create a dashboard screen", "build a UI for <feature>", or scaffold any new frontend feature end-to-end. Does not trigger for API-only or backend tasks.
npx skillsauth add hoangsonww/WealthWise-Finance-Tracker new-pageInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Scaffold a complete new dashboard page for the WealthWise web app following all project conventions.
The page/feature name is provided in the task prompt.
Create all four layers in this order:
apps/web/src/hooks/use-<entity>.tsimport { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
import { apiClient } from '@/lib/api-client';
import { toast } from 'sonner';
export const use<Entity>s = () =>
useQuery({
queryKey: ['<entities>'],
queryFn: () => apiClient.get<{ data: <Entity>Response[] }>('<entities>'),
});
export const use<Entity> = (id: string) =>
useQuery({
queryKey: ['<entities>', id],
queryFn: () => apiClient.get<{ data: <Entity>Response }>(`<entities>/${id}`),
enabled: !!id,
});
export const useCreate<Entity> = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: (data: Create<Entity>Input) =>
apiClient.post<{ data: <Entity>Response }>('<entities>', data),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['<entities>'] });
toast.success('<Entity> created successfully');
},
onError: () => toast.error('Failed to create <entity>'),
});
};
// useUpdate<Entity> and useDelete<Entity> follow same pattern
Rules:
apiClient from @/lib/api-client — never raw fetchuseQuery, useMutation)onSuccessapps/web/src/components/<entity>/Create at minimum:
<Entity>List.tsx — table or card list with loading skeleton, error state, empty state<Entity>Form.tsx — create/edit formAll components must:
zodResolver with schema from @wealthwise/shared-typescomponents/ui/ before building custom elements<Skeleton />), error, and empty states explicitly.dark class)apps/web/src/app/(dashboard)/<route>/page.tsximport { Metadata } from 'next';
import { Suspense } from 'react';
export const metadata: Metadata = {
title: '<Feature> | WealthWise',
};
export default function <Feature>Page() {
return (
<Suspense fallback={<SkeletonFallback />}>
<Feature>Content />
</Suspense>
);
}
Default export required by Next.js.
apps/web/src/components/layout/sidebar.tsxlucide-react iconany types. No raw fetch. No useEffect + fetch patterns.zodResolver with schemas from @wealthwise/shared-types.undefined from queries explicitly.After scaffolding, run:
npx turbo lint --filter=@wealthwise/web
npx turbo test --filter=@wealthwise/web
Report all created file paths and the URL path for the new page.
development
Run the WealthWise test suite with coverage reporting and summarize the results. Triggers when asked to "run tests with coverage", "check test coverage", "show coverage report", or "how many tests pass". Can be scoped to api, web, or types.
testing
Run the full WealthWise pre-PR checklist and report a pass/fail for each gate. Triggers when asked to "run pre-PR checks", "check if this is ready to merge", "validate before opening a PR", or "run the full check". Does NOT trigger implicitly.
development
Scaffold a new Mongoose model and its CRUD service for the WealthWise API. Triggers when asked to "create a model", "add a Mongoose schema", or add the data layer for a new entity without a full endpoint. Does NOT scaffold routes, controllers, or frontend code. Use $api-endpoint for the full stack.
development
Check the health of the running WealthWise API, web app, and MongoDB services. Triggers when asked to "check if the app is running", "verify the API is up", "is the server healthy", or "show service status".