AgentSkillsCN

green-frontend

启用已禁用的Selenium测试,并验证其顺利通过(TDD绿色阶段)。检查前置条件,移除@Disabled注解,运行浏览器测试,确认测试结果为绿色。在用户希望验证Selenium测试的实现效果,或提及“/green-selenium”命令时使用此功能。

SKILL.md
--- frontmatter
name: green-frontend
description: Implement frontend logic to make ONE skipped Vitest test pass (TDD green phase). Reads test, implements minimal .logic.ts code, removes .skip, verifies green state. Use when user wants to implement frontend logic or mentions /green-frontend command.

/green-frontend - Implement Frontend Logic (Green Phase)

Orchestrates green-agent for frontend-logic layer.

Usage

code
/green-frontend "Story name" "Scenario name"
/green-frontend 2 "Validate email"
/green-frontend                                        # Interactive selection

Workflow

  1. Parse user input (story, scenario)
  2. Load agent instructions from .claude/agents/green-agent.md
  3. Load layer template from .claude/templates/frontend/implementation.md
  4. Execute the following steps:
    • Find skipped test (.skip) in frontend/src/
    • Read test (understand expectations) - READ-ONLY
    • Implement minimal production code in .logic.ts file
    • Remove .skip from the test (ONLY allowed test change)
    • Run test using Skill tool: skill="test-frontend", args="{test-file-pattern}"
    • Verify GREEN state
    • Run all tests using Skill tool: skill="test-frontend"
    • Verify no regression
  5. Return result summary

Key Rules

  • TESTS ARE READ-ONLY - only remove .skip
  • Implement MINIMAL code to pass the test
  • Pure functions only in .logic.ts (no React, no fetch, no side effects)
  • Use Skill tool for test execution (not npx directly)

Story Mapping

#Story
01Login/Logout
02Registration
03Password Reset
04Connect Calendar
05Create Task
06Edit Task
07Delete Task
08Archive/Restore Task
09Task Detail View
10Activity Log
11Dashboard
12Billing & Subscription

Next Step

After green phase: /refactor or proceed to next scenario