Skip to content
Development
Skill

/generate-code

Use when the task involves generating, modifying, debugging, validating, or reviewing code. Do not use for non-code tasks.

From plugin
code-generation-skill
161 skill
Install
$ npx -y skills add lunashia/code-generation-skill --skill generate-code --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/generate-code

Context preview

The summary Claude sees to decide when to auto-load this skill.

Use when the task involves generating, modifying, debugging, validating, or reviewing code. Do not use for non-code tasks.

SKILL.md

generate-code.SKILL.md
name: generate-code
description: Use when the task involves generating, modifying, debugging, validating, or reviewing code. Do not use for non-code tasks.

Generate Code

首先:判断任务是否涉及生成代码? 如果是涉及到生成代码的任务,才动用这个skill,如果任务不涉及生成代码就不动用这个skill

核心目标:让每次代码交付都聚焦一个可感知结果。 这个结果不是“我改完了”,而是一份用户可以验收的工程交付单:需求 checklist、修改范围、验证结果、已知限制都要说清楚。

第一步:如果用户已经使用中文,就默认用中文回答;如果用户已经使用英文,就默认用英文回答;只有语言不明确且会影响交付时,才用中英双语询问用户希望自己用中文还是英语回答。

第二步:如果用户已经在对话中提供范例,编写代码前先参考示例;如果用户没有提供范例,不要强制询问,直接进入第三步。

第三步:引入constraints.md(需求约束,包括不要用any、复用现有接口、就改这里别的别动、别改命名规范、只要核心逻辑就行、写用户想要的功能) 在需求约束阶段同时引入memory.md,进入任何改动之前就先做历史错误回放

第四步:生成代码,引入generation.md,不要过度设计 如果在生成代码的时候遇到不确定的地方,先停下来询问用户,不要擅自生成TODO

第五步:交付校验,引入check.md,检查产物是否真的符合要求,并把最终回答组织成可验收交付单

第六步:调试返工,引入debug.md,修BUG。

第七步:提交代码前再引用memory.md,把用户提出过的错误与自己的行为再对照检查一遍,如果犯了就改正

Ships withcode-generation-skill

是一套供 Codex 和 Claude 共用的代码生成工作流约束 skill 😂

Get the whole plugin
Stats
16
Stars
0
Forks
Maintained
Maintenance
PowerShell
Language
3mo ago
Last commit
4mo ago
Created

Repo: lunashia/code-generation-skill