AgentSkillsCN

research

在修改代码之前先深入理解代码,在进行方案调研时加以应用。

SKILL.md
--- frontmatter
name: research
description: Understand code before changing it. Apply when researching for /plan.
<principles>

Zero Assumption

Never guess from names. saveUser() might delete records. READ THE CODE.

Trust Threshold

Skip deep dive the implementation ONLY if docstring documents:

  • What it does
  • What it returns
  • Side effects
  • Exceptions

"Handles user data" → NOT trustworthy. Read it.

Boundary

Stop at:

  • Third-party libraries (assume documented behavior)
  • Unrelated subsystems
  • Full behavioral understanding

Completeness

Investigation answers:

  1. What does this do, step by step?
  2. What dependencies does it interact with?
  3. What are inputs, outputs, side effects?
  4. What errors can occur?

No Teleportation

Data doesn't appear out of nowhere. Every piece of data must have a traceable path:

  • Origin: Where was it created?
  • Path: What components touch it?
  • Destination: Where is it consumed?

If data appears in component B but you can't trace it from A → investigation is INCOMPLETE.

Corollaries:

  • Every WRITE needs a READER
  • Every READ traces back to a WRITE
  • Every EMIT needs a HANDLER
</principles> <techniques>

Dependency Classification

TypeAction
Core LogicMUST read fully
InfrastructureRead integration patterns
UtilitiesRead if behavior unclear
Third-PartyAssume standard, don't read

Data Lineage

For every data artifact:

  • Origin: Where created?
  • Path: What components touch it?
  • Destination: Where consumed?
  • Orphan check: Every event has handler? Every write has reader?
</techniques> <checklists>

Before Finishing

  • All entry points traced
  • No "probably" or "likely" in findings
  • Completeness questions answered
  • No orphaned events/writes
</checklists> <prohibitions>
  • NEVER assume behavior — read it
  • NEVER be vague — "Handles data" forbidden
  • NEVER leave unknowns — resolve or ask
</prohibitions>