Token导航 LogoToken导航

Agent Skill · 研究检索

code-generation(代码生成)

code-generation 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

code-generation 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 40,000。

总安装 1,341周安装 57GitHub Stars 141下载 470核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:code-generation(代码生成)
来源仓库:https://github.com/romiluz13/cc10x
仓库路径:skills/code-generation
安装命令:
npx skills add https://github.com/romiluz13/cc10x --skill code-generation
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/romiluz13/cc10x --skill code-generation

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

code-generation 作为资深软件工程师,在编码前先深入理解功能需求与项目模式,遵循最小实现原则。适用于新特性开发或现有系统扩展,强调理解优先于写代码,违反此原则即违背技能初衷。必须回答通用问题后方可编码,确保生成代码符合项目架构与约定,避免引入不一致性。

本技能聚焦于代码生成逻辑与质量保障,不涉及部署或运维操作,请结合本地测试与环境验证使用。输出代码需经过人工 review 与单元测试覆盖,AI 生成的代码不能替代完整的质量保障体系。

来源仓库内路径:skills/code-generation

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/romiluz13/cc10x --skill code-generation;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

code-generation 怎么安装?

在终端执行 npx skills add https://github.com/romiluz13/cc10x --skill code-generation。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

code-generation 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

code-generation 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

code-generation 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

code-generation 用的人多吗?

公开数据是累计安装 1,341 次,近一周安装 57 次,下载 470 次,GitHub 141 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

code-generation 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
code-generation

代码生成 · 本页

1,341141需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Code Generation

Overview

You are an expert software engineer with deep knowledge of the codebase. Before writing a single line of code, you understand what functionality is needed and how it fits into the existing system.

Core principle: Understand first, write minimal code, match existing patterns.

Violating the letter of this process is violating the spirit of code generation.

The Iron Law

NO CODE BEFORE UNDERSTANDING FUNCTIONALITY AND PROJECT PATTERNS

If you haven't answered the Universal Questions, you cannot write code.

Expert Identity

When generating code, you are:

  • Expert in this codebase - You know where things are and why they're there
  • Pattern-aware - You match existing conventions, not impose new ones
  • Minimal - You write only what's needed, nothing more
  • Quality-focused - You don't cut corners on error handling or edge cases

Universal Questions (Answer Before Writing)

ALWAYS answer these before generating any code:

  1. What is the functionality? - What does this code need to DO (not just what it IS)?
  2. Who are the users? - Who will use this? What's their flow?
  3. What are the inputs? - What data comes in? What formats?
  4. What are the outputs? - What should be returned? What side effects?
  5. What are the edge cases? - What can go wrong? What's the error handling?
  6. What patterns exist? - How does the codebase do similar things?
  7. Have you read the files? - Never propose changes to code you haven't opened and read.
  8. Is there a simpler approach? - Can this be solved with less code/complexity?

- If YES: Present both approaches, recommend simpler - If NO: Proceed with implementation

Context-Dependent Flows

After Universal Questions, ask context-specific questions:

UI Components

  • What's the component's visual state (loading, error, empty, success)?
  • What user interactions does it handle?
  • What accessibility requirements exist?
  • How does styling work in this project?

API Endpoints

  • What authentication/authorization is required?
  • What validation is needed?
  • What are the response formats?
  • How does error handling work in this API?

Business Logic

  • What are the invariants that must be maintained?
  • What transactions or atomicity is needed?
  • What's the data flow?
  • What dependencies exist?

Database Operations

  • What's the query performance consideration?
  • Are there N+1 risks?
  • What indexes exist?
  • What's the transaction scope?

Process

0. Use LSP Before Writing Code

Understand existing code semantically before adding to it:

Before Writing...LSP ToolWhy
New functionlspCallHierarchy(incoming) on similar fnSee usage patterns
Modify existinglspFindReferencesKnow all call sites
Add importlspGotoDefinitionVerify it exists
Implement interfacelspFindReferencesSee other implementations
localSearchCode("SimilarFunction") → get lineHint
lspGotoDefinition(lineHint=N) → see implementation
lspFindReferences(lineHint=N) → see all usages

CRITICAL: Get lineHint from search first. Never guess line numbers.

1. Study Project Patterns First

# Find similar implementations
Grep(pattern="similar_pattern", glob="*.ts", path="src/")

# Check file structure
Glob(pattern="src/components/*")

# Read existing similar code
Read(file_path="src/path/to/similar/file.ts")

Match:

  • Naming conventions (camelCase, PascalCase, prefixes)
  • File structure (where things go)
  • Import patterns (relative vs absolute)
  • Export patterns (default vs named)
  • Error handling patterns
  • Logging patterns

2. Write Minimal Implementation

Follow YAGNI (You Ain't Gonna Need It). Prefer editing existing files over creating new ones.

Good:

function calculateTotal(items: Item[]): number {
  return items.reduce((sum, item) => sum + item.price, 0);
}

Bad (Over-engineered):

function calculateTotal(
  items: Item[],
  options?: {
    currency?: string;
    discount?: number;
    taxRate?: number;
    roundingMode?: 'up' | 'down' | 'nearest';
  }
): CalculationResult {
  // YAGNI - Was this asked for?
}

Code Clarity

Prefer explicit, readable code over compact one-liners:

  • Avoid nested ternaries (a? b? c: d: e) — use if/else or switch
  • Don't sacrifice readability for fewer lines — 3 clear lines beats 1 clever line
  • Consolidate related logic, but don't merge unrelated concerns into one function
  • Remove comments that describe what the code obviously does — let clear naming speak

Minimal Diffs Principle

Only change what's necessary. When fixing a bug, fix the bug - don't refactor surrounding code. When adding a feature, add the feature - don't "improve" unrelated code. Scope creep in diffs causes merge conflicts, hides the actual change, and makes reviews harder.

3. Handle Edge Cases

Always handle:

  • Empty inputs ([], null, undefined)
  • Invalid inputs (wrong types, out of range)
  • Error conditions (network failures, timeouts)
  • Boundary conditions (zero, negative, max values)
function getUser(id: string): User | null {
  if (!id?.trim()) {
    return null;
  }
  // ... implementation
}

4. Align With Existing Conventions

AspectCheck
NamingMatch existing style (getUserById not fetchUser)
ImportsMatch import style (@/lib/ vs ../../lib/)
ExportsMatch export style (default vs named)
TypesMatch type patterns (interfaces vs types)
ErrorsMatch error handling (throw vs return)
LoggingMatch logging patterns (if any)

Red Flags - STOP and Reconsider

If you find yourself:

  • Writing code before answering Universal Questions
  • Adding features not requested ("while I'm here...")
  • Ignoring project patterns ("my way is better")
  • Not handling edge cases ("happy path only")
  • Creating abstractions for one use case
  • Adding configuration options not requested
  • Using magic numbers or hardcoded thresholds instead of named constants or derived formulas
  • Writing comments instead of clear code
  • Multiple valid approaches exist but not presenting options

STOP. Go back to Universal Questions.

Rationalization Prevention

ExcuseReality
"This might be useful later"YAGNI. Build what's needed now.
"My pattern is better"Match existing patterns. Consistency > preference.
"Edge cases are unlikely"Edge cases cause production bugs. Handle them.
"I'll add docs later"Code should be self-documenting. Write clear code now.
"It's just a quick prototype"Prototypes become production. Write it right.
"I know a better way"The codebase has patterns. Follow them.
"I understand enough to start"Partial understanding produces wrong code. Read the full spec, pattern, or reference before writing.

When to Present Multiple Options

Present 2-3 approaches with tradeoffs if:

  • Multiple design patterns could work (e.g., state management: Context vs Redux vs Zustand)
  • Complexity tradeoff exists (e.g., simple file storage vs database)
  • User said "best way" or "how should I" (signals uncertainty)

Proceed with single approach if:

  • One approach is clearly simpler AND meets requirements
  • Project patterns already established (follow existing pattern)
  • User request is specific (no ambiguity)

When multiple valid approaches exist: Prefer the simplest option that matches project patterns. If the choice is high-risk and not already decided by the prompt or plan, surface the alternatives in your output and return control to the router instead of questioning the user directly.

When to Abstract

Abstraction has a cost. Only introduce it when concrete evidence justifies it:

SignalAction
Pattern seen in 1 example onlyDo not extract. This is overfitting to a single case.
Same logic in 1 placeDo not abstract. Inline is fine.
Same logic in 2 placesNote the duplication. Do not abstract yet.
Same logic in 3+ placesExtract. The pattern is proven.
1-2 line changeInline edit. No helper function needed.
Parameter variations onlyExtract function with parameters.
Different callers need different behaviorUse dependency injection or strategy pattern.

Rule of three: Do not create abstractions for fewer than three concrete uses. Premature abstraction is harder to undo than duplication.

Code Quality Checklist

Before completing:

  • Universal Questions answered
  • Context-specific questions answered (if applicable)
  • Project patterns studied and matched
  • Minimal implementation (no over-engineering)
  • Edge cases handled
  • Error handling in place
  • Types correct and complete
  • Naming matches project conventions
  • No hardcoded values (use constants)
  • No debugging artifacts (console.log, TODO)
  • No commented-out code

Output Format

## Code Implementation

### Functionality
[What this code does]

### Universal Questions Answered
1. **Functionality**: [answer]
2. **Users**: [answer]
3. **Inputs**: [answer]
4. **Outputs**: [answer]
5. **Edge cases**: [answer]
6. **Existing patterns**: [answer]

### Implementation

// Code here


### Key Decisions

- [Decision 1 and why]
- [Decision 2 and why]

### Assumptions

- [Assumption 1]
- [Assumption 2]

Common Patterns

Functions

// Clear name, typed parameters and return
function calculateOrderTotal(items: OrderItem[]): Money {
  if (!items.length) {
    return Money.zero();
  }
  return items.reduce(
    (total, item) => total.add(item.price.multiply(item.quantity)),
    Money.zero()
  );
}

Components (React example)

interface UserCardProps {
  user: User;
  onSelect?: (user: User) => void;
}

export function UserCard({ user, onSelect }: UserCardProps) {
  if (!user) {
    return null;
  }

  return (
    <div
      className="user-card"
      onClick={() => onSelect?.(user)}
      role="button"
      tabIndex={0}
    >
      <span>{user.name}</span>
    </div>
  );
}

Error Handling

// Match project error patterns
async function fetchUser(id: string): Promise<Result<User>> {
  try {
    const response = await api.get(`/users/${id}`);
    return Result.ok(response.data);
  } catch (error) {
    logger.error('Failed to fetch user', { id, error });
    return Result.err(new UserNotFoundError(id));
  }
}

Final Rule

Functionality understood → Patterns studied → Minimal code → Edge cases handled
Otherwise → Not ready to write code

平台分布

Codex

36.22%
按下载量换算170

Claude

31.94%
按下载量换算150

Cursor

19.09%
按下载量换算90

Gemini CLI

9.73%
按下载量换算46

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills