【计算机工具类-开发工具Skills】cc-skill-project-guidelines-example 技能

发布时间:2026/8/22 12:04:39
【计算机工具类-开发工具Skills】cc-skill-project-guidelines-example 技能 Project Guidelines Skill (Example) - 项目指南技能示例用于特定项目的架构、代码模式和部署工作流程。技能概述cc-skill-project-guidelines-example 技能是一个项目特定技能的示例模板。该技能包含了项目的架构概览、文件结构、代码模式、测试要求和部署工作流程。基于真实的生产应用程序 ZenithAI驱动的客户发现平台构建。下载地址https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/cc-skill-project-guidelines-example主要功能架构概览: 提供完整的技术栈信息包括前端、后端、数据库、AI服务和部署配置文件结构: 详细的项目目录结构说明帮助开发者快速定位代码代码模式: 提供标准化的代码模板包括API响应格式、前端API调用、Claude AI集成等测试要求: 明确的测试标准和覆盖率要求包括后端pytest和前端React Testing Library部署工作流程: 完整的部署前检查清单和部署命令触发条件在以下情况下应该调用此技能:当开发人员需要了解项目的整体架构和技术栈时当需要参考标准代码模式和最佳实践时当需要了解测试要求和部署流程时当为新项目创建类似的技能模板时技术架构技术栈前端: Next.js 15 (App Router), TypeScript, React后端: FastAPI (Python), Pydantic models数据库: Supabase (PostgreSQL)AI: Claude API with tool calling and structured output部署: Google Cloud Run测试: Playwright (E2E), pytest (backend), React Testing Library代码模式示例API响应格式 (FastAPI)from pydantic import BaseModelfrom typing import Generic, TypeVar, OptionalT TypeVar(T)class ApiResponse(BaseModel, Generic[T]):success: booldata: Optional[T] Noneerror: Optional[str] Noneclassmethoddef ok(cls, data: T) - ApiResponse[T]:return cls(successTrue, datadata)classmethoddef fail(cls, error: str) - ApiResponse[T]:return cls(successFalse, errorerror)前端API调用 (TypeScript)interface ApiResponseT {success: booleandata?: Terror?: string}async function fetchApiT(endpoint: string,options?: RequestInit): PromiseApiResponseT {try {const response await fetch(/api${endpoint}, {...options,headers: {Content-Type: application/json,...options?.headers,},})if (!response.ok) {return { success: false, error: HTTP ${response.status} }}return await response.json()} catch (error) {return { success: false, error: String(error) }}}测试要求后端测试 (pytest)# 运行所有测试poetry run pytest tests/# 运行覆盖率测试poetry run pytest tests/ --cov. --cov-reporthtml# 运行特定测试文件poetry run pytest tests/test_auth.py -v前端测试 (React Testing Library)# 运行测试npm run test# 运行覆盖率测试npm run test -- --coverage# 运行E2E测试npm run test:e2e部署工作流程部署前检查清单所有测试在本地通过前端构建成功 (npm run build)后端测试通过 (poetry run pytest)没有硬编码的密钥环境变量已文档化数据库迁移已准备部署命令# 构建并部署前端 cd frontend npm run build gcloud run deploy frontend --source . # 构建并部署后端 cd backend gcloud run deploy backend --source .关键规则禁止表情符号: 代码、注释或文档中不得使用表情符号不可变性: 永远不要改变对象或数组TDD: 在实现之前编写测试80%覆盖率: 最低测试覆盖率要求小文件: 典型200-400行最多800行禁止console.log: 生产代码中不得使用正确的错误处理: 使用try/catch输入验证: 使用Pydantic/Zod相关技能coding-standards.md: 通用编码最佳实践backend-patterns.md: API和数据库模式frontend-patterns.md: React和Next.js模式tdd-workflow/: 测试驱动开发方法论使用限制仅在任务明确匹配上述范围时使用此技能。不要将输出作为环境特定验证、测试或专家审查的替代品。如果缺少所需的输入、权限、安全边界或成功标准请停止并寻求澄清。