# Tdd Green

> テストを通すための最小限の実装を行う。REDの次フェーズ。「実装して」「green」で起動。

- **Type:** Skill
- **Install:** `agentstack add skill-morodomi-tdd-skills-tdd-green`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [morodomi](https://agentstack.voostack.com/s/morodomi)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [morodomi](https://github.com/morodomi)
- **Source:** https://github.com/morodomi/tdd-skills/tree/main/plugins/tdd-core/skills/tdd-green

## Install

```sh
agentstack add skill-morodomi-tdd-skills-tdd-green
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# TDD GREEN Phase

テストを通すための最小限の実装を行う（並列実行がデフォルト）。

## Progress Checklist

```
GREEN Progress:
- [ ] Cycle doc確認、WIPテスト抽出
- [ ] ファイル依存関係分析
- [ ] green-worker並列起動
- [ ] 結果収集・マージ
- [ ] 全テスト実行→成功確認
- [ ] Cycle doc更新（WIP→DONE）
- [ ] REFACTOR自動実行
```

## 禁止事項

- 過剰な実装（テストに必要ない機能）
- リファクタリング（REFACTORで行う）
- 新しいテスト作成（REDで行う）

## Workflow

### Step 1: Cycle doc確認

```bash
ls -t docs/cycles/*.md 2>/dev/null | head -1
```

WIPのテストケースを抽出。

### Step 2: ファイル依存関係分析

テストケースを対象ファイル別にグルーピング:

| ファイル | テストケース |
|----------|-------------|
| src/Auth.php | TC-01, TC-02 |
| src/User.php | TC-03 |

**原則**: 同一ファイル→同一workerに割り当て（競合回避）

### Step 3: green-worker並列起動

Taskツールで `tdd-core:green-worker` を並列起動:

```
Task 1: TC-01, TC-02 → src/Auth.php
Task 2: TC-03 → src/User.php
```

### Step 4: 結果収集・マージ

全workerの完了を待ち、結果を統合。失敗時は該当workerのみ再試行。

### Step 5: 全テスト実行→成功確認

```bash
php artisan test  # PHP
pytest            # Python
```

**期待**: 全テストが**成功**すること（GREEN状態）

### Verification Gate

| 結果 | 判定 | アクション |
|------|------|-----------|
| 全テスト成功 | PASS | REFACTORへ自動進行 |
| テスト失敗 | BLOCK | 該当worker再試行 |

### Step 6: 完了→REFACTOR自動実行

```
GREEN完了。全テスト成功を確認しました。
REFACTORフェーズを開始します。
```

`Skill(tdd-core:tdd-refactor)` を実行してREFACTORフェーズへ進む。

## Reference

- 詳細: [reference.md](reference.md)
- green-worker: [../../agents/green-worker.md](../../agents/green-worker.md)
- Phase Completion（圧縮ガイダンス）: [reference.md#phase-completion](reference.md#phase-completion)

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [morodomi](https://github.com/morodomi)
- **Source:** [morodomi/tdd-skills](https://github.com/morodomi/tdd-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-morodomi-tdd-skills-tdd-green
- Seller: https://agentstack.voostack.com/s/morodomi
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
