AgentSkillsCN

Create Feature

完整的 TDD 功能开发流程与规划

SKILL.md
--- frontmatter
description: Full TDD feature workflow with planning

/create-feature — Create a New Feature

Complete workflow: plan → test → implement → verify → review.

Execution

Phase 1: Plan

  1. Enter plan mode (EnterPlanMode)
  2. Draft implementation plan — which crate(s), HA compat impact, tests needed
  3. Save plan to working/plans/YYYY-MM-DD_description.md
  4. Get user approval before proceeding

Phase 2: TDD Red (Write Failing Tests)

  1. Write tests that describe the desired behavior
  2. Run make test-rust — confirm tests FAIL
  3. If tests pass, STOP — the feature already exists or the test is wrong

Phase 3: TDD Green (Implement)

  1. Write minimum code to make tests pass
  2. Run make test-rust — confirm tests PASS

Phase 4: Refactor

  1. Clean up while keeping tests green
  2. Run make test-rust after each change

Phase 5: Verify

  1. Run full verification: make build && make test-rust && make lint
  2. Run ./scripts/lint-alpha.py --all

Phase 6: Review (via subagents)

  1. Spawn review subagents using Task tool:
code
Task(subagent_type="senior-code-reviewer",
     prompt="<.claude/agents/code-reviewer.md content>\n\nReview: {changed_files}")

For API changes, also spawn:

code
Task(subagent_type="security-code-auditor",
     prompt="<.claude/agents/security-reviewer.md content>\n\nAudit: {changed_files}")

Phase 7: Fix & Score

  1. Address Critical/Major review findings (max 3 rounds)
  2. Run python3 scripts/score.py --summary
  3. Present summary with quality score

Arguments

  • /create-feature entity-history — feature name/description

HA Compatibility

For features affecting the API:

  • Check vendor/ha-core/ for Python HA behavior
  • Run make test-ha-compat to verify compatibility