chore: apply claude skills to realize template#1122
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds comprehensive documentation for a Claude-based workflow system designed to help implement, validate, and fix features in an AutoBE-generated NestJS backend. The documentation provides detailed, step-by-step guidance for using Claude AI to work with a TypeScript/NestJS/Prisma codebase.
Changes:
- Added main reference documentation (CLAUDE.md) explaining project structure, build commands, tech stack, naming conventions, and known issues
- Created 4 validation skills that analyze and report issues in database schema, interfaces, providers, and tests
- Created 4 fix skills that automatically resolve compilation errors in the respective layers
- Added an add-feature skill with three detailed flow documents covering implementation, test design, and iterative test execution
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| CLAUDE.md | Main reference guide documenting project overview, tech stack, directory structure, build commands, naming conventions, and available Claude skills |
| validate-db/SKILL.md | Read-only skill for validating Prisma schema against requirements, checking entity coverage, field types, relations, and naming conventions |
| validate-interface/SKILL.md | Read-only skill for validating controllers and DTOs, checking API coverage, interface completeness, and path naming |
| validate-provider/SKILL.md | Read-only skill for validating providers, collectors, and transformers against interfaces, checking coverage and type safety |
| validate-test/SKILL.md | Read-only skill for validating test infrastructure, checking prepare/generate functions and test scenario coverage |
| fix-db/SKILL.md | Automated skill for fixing Prisma schema compilation errors following codebase conventions |
| fix-interface/SKILL.md | Automated skill for fixing interface and controller compilation errors, handling empty interfaces and type issues |
| fix-provider/SKILL.md | Automated skill for fixing provider errors by creating collectors and transformers |
| fix-test/SKILL.md | Automated skill for fixing test compilation errors, focusing on empty prepare functions and type issues |
| add-feature/SKILL.md | Main skill template for implementing features with a self-testing loop until 100% test pass rate |
| flow-implement.md | Phase 1 documentation detailing implementation steps: schema updates, interfaces, collectors, transformers, providers, and controllers |
| flow-test-design.md | Phase 2 documentation covering test preparation functions, test scenario categorization, and comprehensive test coverage |
| flow-test-loop.md | Phase 3 documentation describing the iterative test-fix loop with failure diagnosis and fix strategies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| id: record.id, | ||
| name: record.name, | ||
| status: record.status, | ||
| created_at: toISOStringSafe(record.created_at), |
There was a problem hiding this comment.
The toSummary function returns created_at field, but this field is not defined in the ISummary interface shown in flow-implement.md (lines 79-83). This creates an inconsistency where the implementation doesn't match the interface definition. Either remove created_at from this example or update the corresponding ISummary interface definition in the documentation to include it.
| created_at: toISOStringSafe(record.created_at), |
| Location: `/test/prepare/prepare_random_{prefix}_{entity}.ts` | ||
|
|
||
| ```typescript | ||
| import { I{Prefix}{Entity} } from "@ORGANIZATION/PROJECT-api/lib/structures/I{Prefix}{Entity}"; |
There was a problem hiding this comment.
The import path uses placeholder @ORGANIZATION/PROJECT-api which should be documented or explained somewhere. Users implementing this template need to understand what these placeholders should be replaced with. Consider adding a section explaining all placeholders used throughout the documentation.
| |---------------|-----| | ||
| | Empty interface `{}` | Read Prisma schema, define all fields | | ||
| | Missing typia tag | Add appropriate `tags.Format<>` | | ||
| | Nullable mismatch | Add `\| null` for nullable fields | |
There was a problem hiding this comment.
The pipe character is escaped with a backslash (|) but this is unnecessary in markdown table cells. It should just be | null without the backslash. The backslash will appear in the rendered output.
| | Nullable mismatch | Add `\| null` for nullable fields | | |
| | Nullable mismatch | Add `| null` for nullable fields | |
| ### DON'T | ||
|
|
||
| - Use `as any` type casting | ||
| - Use `console` in providers, collectors, transformers (remove them) |
There was a problem hiding this comment.
The wording "Use console in providers, collectors, transformers (remove them)" is confusing. It should be clearer, such as "Don't use console in providers, collectors, transformers" or "Remove console statements from providers, collectors, transformers". The current wording with "Use" followed by "(remove them)" is contradictory and unclear.
| - Use `console` in providers, collectors, transformers (remove them) | |
| - Don't use `console` in providers, collectors, transformers |
c11a78b to
1609857
Compare
This pull request introduces a comprehensive, step-by-step skill template for implementing new features with a self-testing loop, designed for use with Claude workflows. The template breaks down the process into three main phases—implementation, test design, and iterative test/fix loop—providing detailed guidance, code samples, and troubleshooting strategies for each step. The documentation enforces best practices, such as type safety and test completeness, and organizes all instructions and code snippets in a clear, reusable format.
The most important changes are:
Skill Template & Workflow Overview
add-featureskill template (SKILL.md) that outlines a strict, phased workflow for implementing new features, including forbidden TypeScript patterns, a visual workflow diagram, and explicit exit criteria for success and failure.Phase 1: Implementation Guidance
flow-implement.mddetailing the implementation phase: analyzing requirements, updating the Prisma schema, defining interfaces and DTOs, creating collectors/transformers/providers/controllers, and verifying the build. Each step includes example code and file locations.Phase 2: Test Design Guidance
flow-test-design.mdthat covers test preparation and generation functions, categorizes tests into happy path, error, and edge cases, and provides example test code and file organization for comprehensive coverage.Phase 3: Automated Test Loop
flow-test-loop.mddescribing an iterative test loop: building, running, analyzing, and fixing until all tests pass or manual intervention is required. Includes diagnosis tables, fix strategies for test/business/interface issues, and troubleshooting tips.These additions collectively provide a reusable, detailed blueprint for safely and reliably adding new features to a TypeScript/NestJS/Prisma codebase, ensuring high test coverage and code quality throughout the process.