007
免费Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.
中文简介正在准备中。当前显示原文说明。
Creates TanStack Query hooks for API features with authentication. Use when connecting frontend to backend endpoints, creating data fetching hooks.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
Creates TanStack Query hooks for API features with automatic authentication.
Generate latest API types (backend must be running):
cd front && pnpm run generate:api
NEVER call API directly in components!
Feature Hooks (use-items.ts)
↓ uses
Base Auth Hooks (use-api.ts: useAuthenticatedQuery/Mutation)
↓ uses
Generated SDK (lib/api/*.gen.ts from OpenAPI)
// lib/hooks/use-my-feature.ts
import { useSuspenseQuery, useMutation, useQueryClient } from '@tanstack/react-query';
import { useAuthenticatedQuery, useAuthenticatedMutation } from './use-api';
import {
getMyFeatures,
createMyFeature,
updateMyFeature,
deleteMyFeature,
} from '@/lib/api/sdk.gen';
import type { CreateMyFeatureRequest, MyFeatureResponse } from '@/lib/api/types.gen';
// Query key factory - prevents cache bugs
export const myFeatureKeys = {
all: ['my-feature'] as const,
list: (userId?: string) => [...myFeatureKeys.all, 'list', userId] as const,
detail: (id: string) => [...myFeatureKeys.all, 'detail', id] as const,
};
// Regular query (for optional data)
export function useMyFeatures(userId?: string) {
return useAuthenticatedQuery({
queryKey: myFeatureKeys.list(userId),
queryFn: async (token) => {
const response = await getMyFeatures({
headers: { Authorization: `Bearer ${token}` },
});
return response.data ?? [];
},
enabled: !!userId,
});
}
// Suspense query (for required data - use in content components)
export function useMyFeaturesSuspense(userId: string) {
return useAuthenticatedQuery({
queryKey: myFeatureKeys.list(userId),
queryFn: async (token) => {
const response = await getMyFeatures({
headers: { Authorization: `Bearer ${token}` },
});
return response.data ?? [];
},
suspense: true, // Enables Suspense mode
});
}
export function useCreateMyFeature() {
const queryClient = useQueryClient();
return useAuthenticatedMutation({
mutationFn: async (data: CreateMyFeatureRequest, token) => {
const response = await createMyFeature({
headers: { Authorization: `Bearer ${token}` },
body: data,
});
return response.data;
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: myFeatureKeys.all });
},
showSuccessToast: 'Created successfully!',
showErrorToast: true, // Default error handling
});
}
export function useDeleteMyFeature() {
const queryClient = useQueryClient();
return useAuthenticatedMutation({
mutationFn: async (id: string, token) => {
await deleteMyFeature({
headers: { Authorization: `Bearer ${token}` },
path: { id },
});
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: myFeatureKeys.all });
},
showSuccessToast: 'Deleted successfully!',
});
}
Always use query key factories to prevent cache bugs:
export const myFeatureKeys = {
all: ['my-feature'] as const,
list: (userId?: string) => [...myFeatureKeys.all, 'list', userId] as const,
detail: (id: string) => [...myFeatureKeys.all, 'detail', id] as const,
filtered: (filters: Filters) => [...myFeatureKeys.all, 'filtered', filters] as const,
};
// Content component (with Suspense)
function MyFeatureContent({ userId }: { userId: string }) {
const { data } = useMyFeaturesSuspense(userId);
const createMutation = useCreateMyFeature();
const handleCreate = async (data: CreateMyFeatureRequest) => {
await createMutation.mutateAsync(data);
};
return (
<div>
{data.map((item) => <div key={item.id}>{item.name}</div>)}
<button onClick={() => handleCreate({ name: 'New' })}>
Create
</button>
</div>
);
}
Automatic via useAuthenticatedMutation:
DO NOT add manual error handling in components.
Types are auto-generated from backend OpenAPI:
// Import from generated types
import type { CreateMyFeatureRequest, MyFeatureResponse } from '@/lib/api/types.gen';
// Import API functions
import { getMyFeatures, createMyFeature } from '@/lib/api/sdk.gen';
DO NOT edit files in lib/api/ - regenerate instead.
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.
中文简介正在准备中。当前显示原文说明。
Guides the creation of agile user stories and Gherkin feature files. Use when the user wants to create a user story, write acceptance criteria, define Gherkin scenarios, or author BDD feature files. This should trigger for requests such as Create a user story; Write a user story; I need to write a user story. Part of cursor-rules-java project
中文简介正在准备中。当前显示原文说明。
Facilitates conversational discovery to create Architectural Decision Records (ADRs) for non-functional requirements using the ISO/IEC 25010:2023 quality model. Use when the user wants to document quality attributes, NFR decisions, security/performance/scalability architecture, or design systems with measurable quality criteria. This should trigger for requests such as Create ADR for Non-functional requirements; Document Non-functional requirements; Capture Non-functional requirements; Generate Non-functional requirements in an ADR. Part of cursor-rules-java project
中文简介正在准备中。当前显示原文说明。
Run a health check on an existing project: dependency audit, security scan, test runner detection, CI/CD evaluation, and missing configuration analysis. Maps the three execution gates (pre/in/post) from /10x-bootstrapper to an assessment framework for existing codebases. Reads optional context/foundation/stack-assessment.md from /10x-stack-assess to focus checks on identified gaps. Writes context/foundation/health-check.md with findings, prioritized fixes, and an agent-readiness verdict. Use when the user has an existing project and wants to verify its health before working with an agent. Trigger phrases: "health check", "check my project", "audit my project", "is my project healthy", "sprawdź projekt", "audyt projektu", "health-check", "project health". Use AFTER /10x-stack-assess (brownfield chain), BEFORE agent onboarding (m1-l4).
中文简介正在准备中。当前显示原文说明。
You MUST use this when building projects end-to-end. Orchestrates all 12 team roles — automatically switches between CTO, architect, PM, engineers, SRE, security, DBA, QA, and EM based on the current phase of work. Starts with brainstorming before any implementation.
中文简介正在准备中。当前显示原文说明。
Use when you need to add or configure Maven plugins in your pom.xml — including quality tools (enforcer, surefire, failsafe, jacoco, pitest, spotbugs, pmd), security scanning (OWASP), code formatting (Spotless), version management, container image build (Jib), build information tracking, and benchmarking (JMH) — through a consultative, modular step-by-step approach that only adds what you actually need. This should trigger for requests such as Add Maven plugins in pom.xml; Improve Maven plugins in pom.xml. Part of cursor-rules-java project
中文简介正在准备中。当前显示原文说明。