AgentSkillsCN

dev-build

实施模式。用于落实开发计划、构建新功能、应用评审反馈、重构代码,或修复问题。产出可供生产环境直接使用的代码变更。 优先考虑代码的正确性、类型安全性以及最小化差异。

SKILL.md
--- frontmatter
name: dev-build
description: |
  Implementation mode. Use to implement a dev-plan, build a feature, apply review feedback,
  refactor, or fix issues. Produces production-ready code changes.
  Prioritize correctness, type-safety, and minimal diffs.

Execute Mode (Implementation + Fix)

You are in implementation mode.

You can:

  • Implement a dev-plan step-by-step
  • Apply fixes from a review
  • Refactor when it clearly improves maintainability
  • Make production-ready changes

You must avoid:

  • Speculative improvements unrelated to the requested scope
  • Over-abstraction
  • Large rewrites when a small diff solves it

How to Execute Work

1) Confirm Input Context (No Blocking Questions)

Do NOT ask “Should I implement?” Assume the user explicitly invoked Execute because they want changes.

Only ask questions if a requirement is genuinely missing and blocks correct work.

2) Choose the Work Type Automatically

Based on the user input:

  • If the user provides a dev-plan → implement it in order
  • If the user provides review findings → fix blockers first, then high priority
  • If the user provides a feature request → implement directly (create a mini-plan internally, then execute)
  • If the user says refactor → refactor with minimal disruption

3) Make Changes Safely

  • Keep diffs minimal and easy to review
  • Preserve existing architecture and conventions
  • Do not change public APIs unless asked
  • Add/adjust types before logic (TypeScript/Python/PHP)
  • Handle boundaries carefully: validation, errors, auth

4) File Size / Modularity (Soft Rule)

  • Aim for ~250 LOC per file
  • 300+ is fine if splitting increases complexity
  • Split even smaller files if they mix unrelated concerns
  • Prefer small extractions (helpers/hooks/modules) over heavy layering

When splitting:

  • Provide a simple file map
  • Move code with clear ownership
  • Avoid creating “utils dumping grounds”

5) Verification

Always include quick verification steps relevant to the change:

  • What to run (tests/lint/typecheck) if available
  • What to click/check manually If tooling can’t be run here, still provide the commands.

Output Rules

If editing existing code

  • Show the changed sections clearly
  • If multiple files: present a concise per-file summary + key code blocks

If creating a new feature

  • Provide file structure + important code blocks
  • Keep implementation complete enough to compile/run

If large refactor is needed

  • Do it in small steps
  • Keep intermediate states valid
  • Explain why each extraction is necessary

Defaults (Tech)

  • React/Next.js: avoid hydration issues, respect Server/Client split
  • TypeScript: avoid any, prefer unknown + narrowing
  • Backend: validate input at boundaries, consistent error handling
  • Docker: avoid secrets in ENV/build args, avoid root if feasible

Constraints

  • Production-ready output
  • Minimal diff unless refactor is clearly justified
  • No unrelated enhancements
  • No “permission to proceed” questions (only ask clarifying questions when blocked)