Skip to main content

add-model

Use when adding a new module or component that follows an existing pattern in the codebase (e.g., a new API endpoint, model class, proposer, handler)

来源信息

仓库
pzheng460/claude-workflow-plugin
最近来源活动
2026年3月3日 04:58
检测到的 SKILL.md 语言
英语
星标
0
分支
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
add-model
description
Use when adding a new module or component that follows an existing pattern in the codebase (e.g., a new API endpoint, model class, proposer, handler)
# Add Model Step-by-step guide for adding a new module that follows an existing pattern. ## Step 0: Gather Required Information Before implementation, collect all required information. If called from `issue-to-pr`, the issue should provide these. If standalone, brainstorm with the user. ### Required Information Checklist | # | Item | Description | |---|------|-------------| | 1 | **Name** | Module/component name and naming convention | | 2 | **Definition** | What this module does, its responsibilities | | 3 | **Type/Category** | Which directory/package it belongs to | | 4 | **Interface** | What traits/interfaces/protocols it implements | | 5 | **Fields/Parameters** | What data it holds or accepts | | 6 | **Behavior** | Key methods and their semantics | | 7 | **Reference implementation** | Existing module to use as template | If any item is missing, ask the user. Do NOT proceed until complete. ## Step 1: Study Reference Implementation Read the reference implementation identified in Step 0. Understand: - File structure and organization pattern - Required trait/interface implementations - Registration/discovery mechanism (if any) - Test patterns used ## Step 2: Implement Create the new module following the reference pattern: 1. Create source file in the correct directory 2. Implement required interfaces/traits 3. Follow existing naming conventions 4. Register the module (mod.rs, __init__.py, index.ts, etc.) ## Step 3: Write Tests Create tests alongside the implementation: - Construction/initialization test - Core behavior test (key methods work correctly) - Edge cases and error handling - Serialization round-trip (if applicable) Link tests following project convention (inline, separate file, or test directory). ## Step 4: Register and Integrate Update all registration points: - Module registry (mod.rs, __init__.py, index.ts, etc.) - CLI dispatch table (if applicable) - Configuration files (if applicable) - Documentation (if applicable) ## Step 5: Verify Run project test and lint commands (from CLAUDE.md), then invoke `workflow:review-implementation` to verify completeness. ## Common Mistakes | Mistake | Fix | |---------|-----| | Skipping registration | Check all registration points from reference implementation | | Inventing new patterns | Follow the reference — consistency over creativity | | Missing test linkage | Follow project's test organization convention | | Not reading CLAUDE.md | Project conventions are defined there, read first |
在 GitHub 查看