AgentSkillsCN

Docs

文档

SKILL.md

Agent Skill Protocol

Applies to: ALL agents (Architect, Designer, Implementer, Validator, Debugger). Priority: These rules override convenience. For trivial tasks, use judgment.


1. Think Before Coding

Don't assume. Don't hide confusion. Surface tradeoffs.

Before implementing:

  • State your assumptions explicitly. If uncertain, ask.
  • If multiple interpretations exist, present them — don't pick silently.
  • If a simpler approach exists, say so. Push back when warranted.
  • If something is unclear, stop. Name what's confusing. Ask.

Per agent:

AgentWhat "think first" means
ArchitectClarify scope before writing PCD. Ask about edge cases, not assume.
DesignerConfirm visual direction before producing spec. Show options if ambiguous.
ImplementerRead PCD + design-spec fully before writing code. Flag contradictions.
ValidatorDefine pass/fail criteria before testing. Don't test assumptions — test specs.
DebuggerReproduce the bug first. State root cause hypothesis before fixing.

2. Simplicity First

Minimum code that solves the problem. Nothing speculative.

  • No features beyond what was asked.
  • No abstractions for single-use code.
  • No "flexibility" or "configurability" that wasn't requested.
  • No error handling for impossible scenarios.
  • If you write 200 lines and it could be 50, rewrite it.

Self-check: "Would a senior engineer say this is overcomplicated?" If yes, simplify.

Per agent:

AgentWhat "simplicity" means
ArchitectShortest PCD that fully specifies the solution. No speculative sections.
DesignerFewest CSS rules that achieve the design. No unused classes.
ImplementerFewest lines that pass all criteria. No helper functions nobody calls.
ValidatorTest what matters. Don't write 20 tests when 5 cover the same paths.
DebuggerSmallest fix that resolves the bug. No drive-by refactors.

3. Surgical Changes

Touch only what you must. Clean up only your own mess.

When editing existing code:

  • Don't "improve" adjacent code, comments, or formatting.
  • Don't refactor things that aren't broken.
  • Match existing style, even if you'd do it differently.
  • If you notice unrelated dead code, mention it — don't delete it.

When your changes create orphans:

  • Remove imports/variables/functions that YOUR changes made unused.
  • Don't remove pre-existing dead code unless asked.

The test: Every changed line should trace directly to the user's request.

Per agent:

AgentWhat "surgical" means
ArchitectUpdate only the PCD sections affected by new requirements.
DesignerChange only the CSS/HTML the design change requires.
ImplementerEdit only files and functions the PCD specifies.
ValidatorReport only real failures. Don't flag style preferences as bugs.
DebuggerFix only the reported bug. Don't touch anything else.

4. Goal-Driven Execution

Define success criteria. Loop until verified.

Transform tasks into verifiable goals:

  • "Add validation" → "Invalid inputs show user-facing error message"
  • "Fix the bug" → "Reproduce the failure, then confirm it no longer occurs"
  • "Refactor X" → "Behavior is identical before and after"

For multi-step tasks, state a brief plan:

code
1. [Step] → verify: [check]
2. [Step] → verify: [check]
3. [Step] → verify: [check]

Strong success criteria let you loop independently. Weak criteria ("make it work") require clarification — ask for it.

Per agent:

AgentVerification method
ArchitectPCD covers every user requirement. No gaps, no extras.
DesignerDesign-spec matches PCD. Every UI element has a defined state.
ImplementerCode matches PCD + design-spec. Runs without errors.
ValidatorEvery PCD requirement has a test with evidence (screenshot, output, log).
DebuggerBug is reproduced, fixed, and verified. Nothing else changed.