一键导入
project-helper
Custom skill for project-specific tasks and coding standards
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Custom skill for project-specific tasks and coding standards
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | project-helper |
| description | Custom skill for project-specific tasks and coding standards |
| triggers | ["help with project","project standards","create component","generate test","check code style"] |
This skill provides project-specific assistance, including coding standards enforcement, component generation, and test creation.
Activate this skill when the user:
UserProfile.tsx)formatDate.ts)API_ENDPOINTS.ts).test suffix (UserProfile.test.tsx)Follow the configured code style preset. Key rules:
Imports: Group and sort imports
Exports: Prefer named exports over default exports
Functions: Prefer arrow functions for components
Types: Define types/interfaces above their usage
React components should follow this structure:
// 1. Imports
import React from 'react';
import { useQuery } from '@tanstack/react-query';
import { Button } from '@/components/ui';
import { formatDate } from '@/utils';
import styles from './ComponentName.module.css';
// 2. Types
interface ComponentNameProps {
title: string;
onAction: () => void;
}
// 3. Component
export const ComponentName: React.FC<ComponentNameProps> = ({
title,
onAction,
}) => {
// 3a. Hooks
const { data, isLoading } = useQuery(['key'], fetchData);
// 3b. Handlers
const handleClick = () => {
onAction();
};
// 3c. Render helpers
const renderContent = () => {
if (isLoading) return <Loading />;
return <Content data={data} />;
};
// 3d. Return
return (
<div className={styles.container}>
<h1>{title}</h1>
{renderContent()}
<Button onClick={handleClick}>Action</Button>
</div>
);
};
When asked to create a component:
Determine the component type:
Create the file structure:
ComponentName/
|-- index.ts # Re-exports
|-- ComponentName.tsx # Main component
|-- ComponentName.test.tsx # Tests
+-- ComponentName.module.css # Styles (if needed)
Generate boilerplate following project standards
Add basic tests
// ComponentName.tsx
import React from 'react';
interface {ComponentName}Props {
// Add props here
}
export const {ComponentName}: React.FC<{ComponentName}Props> = (props) => {
return (
<div>
{/* Component content */}
</div>
);
};
// index.ts
export { {ComponentName} } from './{ComponentName}';
export type { {ComponentName}Props } from './{ComponentName}';
When asked to generate tests:
Identify what to test:
Follow testing patterns:
import { render, screen, fireEvent } from '@testing-library/react';
import { describe, it, expect, vi } from 'vitest';
import { ComponentName } from './ComponentName';
describe('ComponentName', () => {
it('renders correctly', () => {
render(<ComponentName title="Test" />);
expect(screen.getByText('Test')).toBeInTheDocument();
});
it('handles user interaction', () => {
const onAction = vi.fn();
render(<ComponentName title="Test" onAction={onAction} />);
fireEvent.click(screen.getByRole('button'));
expect(onAction).toHaveBeenCalled();
});
it('displays loading state', () => {
render(<ComponentName title="Test" isLoading />);
expect(screen.getByTestId('loading')).toBeInTheDocument();
});
});
import { describe, it, expect } from 'vitest';
import { functionName } from './functionName';
describe('functionName', () => {
it('handles normal input', () => {
expect(functionName('input')).toBe('expected');
});
it('handles edge cases', () => {
expect(functionName('')).toBe('');
expect(functionName(null)).toBeNull();
});
it('throws on invalid input', () => {
expect(() => functionName(undefined)).toThrow();
});
});
When asked to check code style:
any)This skill uses the following configuration options:
projectName: Used in generated comments and documentationcodeStyle: Determines which style rules to enforcetestFramework: Determines test syntax and patternscomponentPath: Default location for new componentsenableAutoFix: When true, offer to automatically fix issues