[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73G78T2E5EKJ07GGEKSP83D":3,"skill-same:01M73G78T2E5EKJ07GGEKSP83D":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M73G78T2E5EKJ07GGEKSP83D","tdd",null,"Use when implementing features or fixing bugs with test-driven development. Enforces RED→GREEN→REFACTOR cycle with vertical slicing and multi-agent context isolation. Triggers on: 'implement with TDD', 'write tests first', 'red green refactor', 'test-driven', '\u002Ftdd \u003Cfeature>'. Supports Jest, Vitest, pytest, Go test, cargo test, RSpec, PHPUnit.","Horonomos-laps\u002FYana-AI","Horonomos-laps","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F355299122?v=4","01M76B3QPXE88ET2SQPDPVATZT"," Horonomos-laps","01M72ZQRJPCYPSSWT4D00VJR2A",13,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Ftdd\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: tdd\ndescription: \"Use when implementing features or fixing bugs with test-driven development. Enforces RED→GREEN→REFACTOR cycle with vertical slicing and multi-agent context isolation. Triggers on: 'implement with TDD', 'write tests first', 'red green refactor', 'test-driven', '\u002Ftdd \u003Cfeature>'. Supports Jest, Vitest, pytest, Go test, cargo test, RSpec, PHPUnit.\"\n---\n\n# TDD Skill — Red Green Refactor\n\nEnforce disciplined RED→GREEN→REFACTOR cycles using multi-agent context isolation.\nThe core constraint: **Test Writer never sees implementation. Implementer never sees the spec.**\nThis prevents the model from leaking implementation intent into test design.\n\n## Invocation\n\n| Form | Behavior |\n|------|----------|\n| `\u002Ftdd \u003Cfeature>` | Interactive — pause for approval at each checkpoint |\n| `\u002Ftdd --auto \u003Cfeature>` | Autonomous — run all slices, stop only on unrecoverable error |\n| `\u002Ftdd --resume` | Resume from `.tdd-state.json` in project root |\n| `\u002Ftdd --dry-run \u003Cfeature>` | Validate pipeline, render prompts, write no code |\n\n## Architecture\n\n```\nORCHESTRATOR (this skill)\n├─ Phase 0: Setup    — detect framework, verify baseline\n├─ Phase 1: Decompose — vertical slices, user approves\n│\n├─ FOR EACH SLICE:\n│   ├─ Phase 2 RED:      Task(Test Writer)   ← spec + API only\n│   ├─ Phase 3 GREEN:    Task(Implementer)   ← failing test + error only\n│   └─ Phase 4 REFACTOR: Task(Refactorer)   ← all code + green results\n│\n└─ Phase 5: Summary\n```\n\n### Context Boundaries\n\n| Agent | Sees | Does NOT See |\n|-------|------|--------------|\n| **Test Writer** | Slice spec, public API signatures, framework conventions | Implementation code, other slices, plans |\n| **Implementer** | Failing test code, error output, file tree, existing source | Original spec, slice descriptions |\n| **Refactorer** | All implementation + all tests + green results | Original spec, decomposition rationale |\n\n---\n\n## Phase 0 — Setup\n\n### Step 1: Detect framework\n\n```bash\nls package.json pyproject.toml go.mod Cargo.toml Gemfile composer.json 2>\u002Fdev\u002Fnull\n```\n\nMap to framework:\n- `package.json` → check scripts for `jest` or `vitest`\n- `pyproject.toml` or `pytest.ini` → pytest\n- `go.mod` → go test\n- `Cargo.toml` → cargo test\n- `Gemfile` → rspec\n- `composer.json` → phpunit\n\nIf ambiguous, ask: \"What command runs your tests?\"\n\n### Step 2: Verify green baseline\n\nRun the full test suite and show output:\n\n```bash\n# Jest\u002FVitest\nnpx jest --passWithNoTests 2>&1 | tail -10\n# or: npx vitest run 2>&1 | tail -10\n\n# pytest\npython -m pytest -q 2>&1 | tail -10\n\n# Go\ngo test .\u002F... 2>&1 | tail -10\n\n# Cargo\ncargo test 2>&1 | tail -10\n\n# RSpec\nbundle exec rspec --format progress 2>&1 | tail -10\n```\n\n- **All pass** → proceed\n- **Tests fail** → STOP. \"Existing tests are failing. TDD requires a green baseline before starting.\"\n- **No tests \u002F error with 0 tests** → greenfield project, proceed\n\n### Step 3: Extract public API surface\n\n```bash\n# TypeScript\u002FJS — exported symbols\ngrep -rn \"^export \" src\u002F --include=\"*.ts\" --include=\"*.js\" 2>\u002Fdev\u002Fnull | head -60\n\n# Python — public functions\u002Fclasses\ngrep -rn \"^def \\|^class \" src\u002F --include=\"*.py\" 2>\u002Fdev\u002Fnull | grep -v \"^.*test\" | head -60\n\n# Go — exported identifiers (capital-letter functions\u002Ftypes)\ngrep -rn \"^func [A-Z]\\|^type [A-Z]\" . --include=\"*.go\" 2>\u002Fdev\u002Fnull | grep -v \"_test.go\" | head -60\n```\n\nSave output as `{API_SURFACE}`. Empty on greenfield — that's fine.\n\n### Step 4: Create state file `.tdd-state.json`\n\n```json\n{\n  \"feature\": \"\u003Cuser description>\",\n  \"framework\": \"\u003Cjest|vitest|pytest|go|cargo|rspec|phpunit>\",\n  \"language\": \"\u003Ctypescript|javascript|python|go|rust|ruby|php>\",\n  \"test_command\": \"\u003Cfull command>\",\n  \"source_dir\": \"src\u002F\",\n  \"auto_mode\": false,\n  \"slices\": [],\n  \"current_slice\": 0,\n  \"phase\": \"setup\",\n  \"files_modified\": [],\n  \"test_files_created\": []\n}\n```\n\n---\n\n## Phase 1 — Decompose into Vertical Slices\n\nBreak the feature into **ordered, testable behaviors** — one behavior per slice.\n\n### Inside-Out Ordering\n\nSort slices from innermost to outermost layer:\n\n1. **domain** — pure business logic, no dependencies, no mocks\n2. **domain-service** — cross-aggregate operations using real domain objects\n3. **application** — use-case orchestration with in-memory fakes for ports\n4. **infrastructure** — repos, external APIs, framework adapters\n\n**Why inside-out?** Domain slices produce real objects that later slices use directly. Minimizes mocking, catches integration issues early, ensures business rules exist before infrastructure.\n\nPresent to user:\n\n```\nI've broken this into N slices (inside-out order):\n\nDomain:\n  1. [behavior] — [what the test verifies]\n\nApplication:\n  2. [behavior] — [what the test verifies]\n\nInfrastructure:\n  3. [behavior] — [what the test verifies]\n\nEach slice: RED → GREEN → REFACTOR before the next.\nDoes this look right?\n```\n\n**Wait for approval** — even in `--auto` mode. Slice decomposition always needs sign-off.\n\nUpdate state: write `slices` array with `layer` field on each.\n\n---\n\n## Phase 2 — RED: Write One Failing Test\n\n### Step 1: Refresh API surface (re-run grep from Phase 0 Step 3)\n\n### Step 2: Launch Test Writer\n\n```\nTask(subagent_type=\"general-purpose\", prompt=\"\"\"\nYou are the Test Writer. Your ONLY job is to write ONE failing test for this behavior.\n\nBEHAVIOR TO TEST:\n{SLICE_SPEC}\n\nPUBLIC API (what you may call):\n{API_SURFACE}\n\nLANGUAGE: {LANGUAGE}\nTEST FRAMEWORK: {FRAMEWORK}\nTEST FILE: {TEST_FILE_PATH}\nEXISTING TEST FILE CONTENT (if any): {EXISTING_TEST_CONTENT}\n\nSTRICT CONSTRAINTS:\n- Write exactly ONE test function\n- The test MUST fail because the behavior doesn't exist yet\n- Do NOT look at or guess implementation details\n- Use real objects — no mocks for domain-layer tests\n- Test name must describe the behavior, not the implementation\n- For domain layer: never import mocking libraries\n\nReturn ONLY a JSON object:\n{\n  \"test_name\": \"descriptive_test_name\",\n  \"test_file_path\": \"path\u002Fto\u002Ftest_file\",\n  \"imports_needed\": [\"import statements\"],\n  \"test_code\": \"complete test function code\",\n  \"description\": \"one sentence: what behavior this verifies\"\n}\n\"\"\")\n```\n\n### Step 3: Write the test file\n\nApply the test code. If file exists, append the test function. If new, create it.\n\n### Step 4: Run to confirm RED\n\n```bash\n# Run only the new test\n# Jest: npx jest --testPathPattern=\u003Cfile> -t \"\u003Ctest_name>\"\n# pytest: pytest \u003Cfile>::\u003Ctest_name> -v\n# Go: go test -run \u003CTestName> .\u002F...\n```\n\nShow full output.\n\n| Result | Action |\n|--------|--------|\n| Assertion failure | **Proper RED** — proceed |\n| Import\u002Fmodule error | Create minimal stub so import resolves, re-run |\n| Test passes | Behavior already exists — log \"skip: already implemented\", move to next slice |\n| Syntax error | Fix test file, re-run. After 2 attempts, ask user |\n\n### Step 5 (interactive only): Present checkpoint\n\n```\nRED: Test failing as expected.\n\nTest: {test_name}\nFile: {test_file_path}\nFailure: {error message}\nVerifies: {description}\n\nProceed to GREEN? (or adjust the test?)\n```\n\n---\n\n## Phase 3 — GREEN: Minimal Implementation\n\n### Step 1: Collect context (test code + error output only)\n\n```bash\ncat {TEST_FILE_PATH}\n# + failure output from Phase 2 Step 4\n```\n\n### Step 2: Build source file tree\n\n```bash\nfind {SOURCE_DIR} -type f \\( -name \"*.ts\" -o -name \"*.js\" -o -name \"*.py\" -o -name \"*.go\" -o -name \"*.rs\" -o -name \"*.rb\" -o -name \"*.php\" \\) \\\n  | grep -v test | grep -v spec | grep -v node_modules | grep -v __pycache__ | head -50\n```\n\n### Step 3: Launch Implementer\n\n```\nTask(subagent_type=\"general-purpose\", prompt=\"\"\"\nYou are the Implementer. Your ONLY job is to make this failing test pass.\n\nFAILING TEST:\n{FAILING_TEST_CODE}\n\nTEST FAILURE OUTPUT:\n{TEST_FAILURE_OUTPUT}\n\nSOURCE FILE TREE:\n{FILE_TREE}\n\nEXISTING SOURCE (relevant files):\n{EXISTING_SOURCE}\n\nLAYER CONSTRAINT: {LAYER}\n- domain: no imports from application or infrastructure\n- domain-service: may use domain objects, no infrastructure imports\n- application: may use ports\u002Finterfaces, no concrete infrastructure\n- infrastructure: no restrictions\n\nSTRICT CONSTRAINTS:\n- Write the MINIMUM code to pass this one test\n- Do NOT read the original spec or feature description\n- Do NOT implement anything not required by the test\n- One file change at a time where possible\n\nReturn ONLY a JSON object:\n{\n  \"explanation\": \"what you implemented and why\",\n  \"files\": [\n    {\n      \"path\": \"relative\u002Fpath\u002Fto\u002Ffile.ts\",\n      \"action\": \"create|overwrite|edit\",\n      \"content\": \"complete file content\"\n    }\n  ]\n}\n\"\"\")\n```\n\n### Step 4: Apply changes and verify GREEN\n\nApply each file. Then run the specific test:\n\n```bash\n# Same command as Phase 2 Step 4\n```\n\n**Retry loop** (max 5 attempts):\n- If still failing: re-launch fresh Implementer with previous attempt's explanation + new error\n- If failing after 5 attempts: STOP, present to user\n\n### Step 5: Run full suite — check for regressions\n\n```bash\n# Full test command (same as Phase 0 Step 2)\n```\n\n- Regressions found → launch fresh Implementer targeting only the regression failures, up to 3 attempts\n- Still regressing after 3 → STOP, ask user\n\n### Step 6 (interactive only): Present checkpoint\n\n```\nGREEN: Test passing.\n\nImplementation: {explanation}\nFiles changed: {list}\nFull suite: {N} passing, {N} failing\n\nProceed to REFACTOR? (or adjust?)\n```\n\n---\n\n## Phase 4 — REFACTOR\n\n### Step 1: Launch Refactorer\n\n```\nTask(subagent_type=\"general-purpose\", prompt=\"\"\"\nYou are the Refactorer. Tests are green. Improve the code without changing behavior.\n\nGREEN TEST OUTPUT:\n{GREEN_TEST_OUTPUT}\n\nALL TEST CODE:\n{ALL_TEST_CODE}\n\nALL IMPLEMENTATION CODE:\n{ALL_IMPLEMENTATION_CODE}\n\nLAYER(S) TOUCHED: {SLICE_LAYERS}\n\nYOUR JOB:\n- Remove duplication\n- Improve naming\n- Simplify logic\n- Fix dependency direction violations (inner layers must not import outer)\n- Do NOT add features not tested\n\nReturn ONLY a JSON object:\n{\n  \"suggestions\": [\n    {\n      \"priority\": \"high|medium|low\",\n      \"description\": \"what and why\",\n      \"file\": \"path\u002Fto\u002Ffile\",\n      \"old_code\": \"exact code to replace\",\n      \"new_code\": \"replacement code\"\n    }\n  ]\n}\nReturn empty suggestions array if nothing needs changing.\n\"\"\")\n```\n\n### Step 2: Apply suggestions one at a time (high priority first)\n\nFor each suggestion:\n1. Apply the edit\n2. Run full test suite\n3. If any test fails → **revert immediately**, skip this suggestion\n4. If all pass → keep the change\n\n### Step 3 (interactive only): Report\n\n```\nREFACTOR: {N} applied, {N} skipped (reverted on test failure).\nAll tests: {count} passing.\n```\n\n---\n\n## Phase 5 — Next Slice or Complete\n\n- More slices → increment `current_slice`, return to Phase 2\n- All slices done → present summary:\n\n```\nTDD Complete: {feature}\n\nSlices: {N}\nTests written: {N}\nFiles created\u002Fmodified: {list}\nAll tests passing: yes\n```\n\nRemove `.tdd-state.json` (ask in interactive mode, silent in `--auto`).\n\n---\n\n## Resume Support\n\n`\u002Ftdd --resume`:\n1. Read `.tdd-state.json`\n2. Report: \"Found session for '{feature}'. Slice {N}\u002F{total}, phase: {phase}.\"\n3. Resume from current phase of current slice\n\n---\n\n## Dry-Run Mode\n\nFor `--dry-run`: run Phase 0 and Phase 1 fully, then for each slice render the three agent prompts with variables filled in but **call no Task() and write no files**. Print prompt sizes and variable resolution status. Report summary. Do not clean up state file.\n\n---\n\n## Edge Cases\n\n**Greenfield**: No tests yet — proceed from Phase 0. Test Writer creates test files and framework config from scratch.\n\n**Bug fix**: Write a test demonstrating the bug (RED confirms bug exists). Fix in GREEN. Verify with `verify-before-done` skill after completing.\n\n**Flaky test**: If a test sometimes passes\u002Ffails — stop, report, fix flakiness before continuing.\n\n**User-provided test**: Confirm it fails (RED), skip to Phase 3 (GREEN). Do not modify without asking.\n\n---\n\n## Constraints\n\n- Never write implementation before a failing test exists.\n- Never modify a test to make it pass — fix the implementation.\n- Never write all tests upfront — one slice at a time.\n- Never skip RED phase, even for \"trivial\" cases.\n- Domain code must never import infrastructure — dependency direction is inward only.\n- After all slices: run `verify-before-done` skill before claiming done.\n- On unexpected errors: use `debug-protocol` skill — do not guess fixes.\n\n---\n\n## Framework Quick Reference\n\n| Framework | Single test | Full suite |\n|-----------|------------|------------|\n| Jest | `npx jest -t \"\u003Cname>\" \u003Cfile>` | `npx jest` |\n| Vitest | `npx vitest run \u003Cfile> -t \"\u003Cname>\"` | `npx vitest run` |\n| pytest | `pytest \u003Cfile>::\u003Cname> -v` | `pytest -v` |\n| Go | `go test -run \u003CName> .\u002F...` | `go test .\u002F...` |\n| Cargo | `cargo test \u003Cname>` | `cargo test` |\n| RSpec | `rspec \u003Cfile>:\u003Cline>` | `rspec` |\n| PHPUnit | `phpunit --filter \u003Cname>` | `phpunit` |\n\n---\n\nAttribution: Core RED→GREEN→REFACTOR orchestration pattern and context-isolation architecture adapted from glebis\u002Fclaude-skills (MIT License). Rewritten for YAMTAM ENGINE — self-contained, no external scripts, integrated with verify-before-done and debug-protocol skills.\n","# TDD Skill — Red Green Refactor\n\nEnforce disciplined RED→GREEN→REFACTOR cycles using multi-agent context isolation.\nThe core constraint: **Test Writer never sees implementation. Implementer never sees the spec.**\nThis prevents the model from leaking implementation intent into test design.\n\n## Invocation\n\n| Form | Behavior |\n|------|----------|\n| `\u002Ftdd \u003Cfeature>` | Interactive — pause for approval at each checkpoint |\n| `\u002Ftdd --auto \u003Cfeature>` | Autonomous — run all slices, stop only on unrecoverable error |\n| `\u002Ftdd --resume` | Resume from `.tdd-state.json` in project root |\n| `\u002Ftdd --dry-run \u003Cfeature>` | Validate pipeline, render prompts, write no code |\n\n## Architecture\n\n```\nORCHESTRATOR (this skill)\n├─ Phase 0: Setup    — detect framework, verify baseline\n├─ Phase 1: Decompose — vertical slices, user approves\n│\n├─ FOR EACH SLICE:\n│   ├─ Phase 2 RED:      Task(Test Writer)   ← spec + API only\n│   ├─ Phase 3 GREEN:    Task(Implementer)   ← failing test + error only\n│   └─ Phase 4 REFACTOR: Task(Refactorer)   ← all code + green results\n│\n└─ Phase 5: Summary\n```\n\n### Context Boundaries\n\n| Agent | Sees | Does NOT See |\n|-------|------|--------------|\n| **Test Writer** | Slice spec, public API signatures, framework conventions | Implementation code, other slices, plans |\n| **Implementer** | Failing test code, error output, file tree, existing source | Original spec, slice descriptions |\n| **Refactorer** | All implementation + all tests + green results | Original spec, decomposition rationale |\n\n---\n\n## Phase 0 — Setup\n\n### Step 1: Detect framework\n\n```bash\nls package.json pyproject.toml go.mod Cargo.toml Gemfile composer.json 2>\u002Fdev\u002Fnull\n```\n\nMap to framework:\n- `package.json` → check scripts for `jest` or `vitest`\n- `pyproject.toml` or `pytest.ini` → pytest\n- `go.mod` → go test\n- `Cargo.toml` → cargo test\n- `Gemfile` → rspec\n- `composer.json` → phpunit\n\nIf ambiguous, ask: \"What command runs your tests?\"\n\n### Step 2: Verify green baseline\n\nRun the full test suite and show output:\n\n```bash\n# Jest\u002FVitest\nnpx jest --passWithNoTests 2>&1 | tail -10\n# or: npx vitest run 2>&1 | tail -10\n\n# pytest\npython -m pytest -q 2>&1 | tail -10\n\n# Go\ngo test .\u002F... 2>&1 | tail -10\n\n# Cargo\ncargo test 2>&1 | tail -10\n\n# RSpec\nbundle exec rspec --format progress 2>&1 | tail -10\n```\n\n- **All pass** → proceed\n- **Tests fail** → STOP. \"Existing tests are failing. TDD requires a green baseline before starting.\"\n- **No tests \u002F error with 0 tests** → greenfield project, proceed\n\n### Step 3: Extract public API surface\n\n```bash\n# TypeScript\u002FJS — exported symbols\ngrep -rn \"^export \" src\u002F --include=\"*.ts\" --include=\"*.js\" 2>\u002Fdev\u002Fnull | head -60\n\n# Python — public functions\u002Fclasses\ngrep -rn \"^def \\|^class \" src\u002F --include=\"*.py\" 2>\u002Fdev\u002Fnull | grep -v \"^.*test\" | head -60\n\n# Go — exported identifiers (capital-letter functions\u002Ftypes)\ngrep -rn \"^func [A-Z]\\|^type [A-Z]\" . --include=\"*.go\" 2>\u002Fdev\u002Fnull | grep -v \"_test.go\" | head -60\n```\n\nSave output as `{API_SURFACE}`. Empty on greenfield — that's fine.\n\n### Step 4: Create state file `.tdd-state.json`\n\n```json\n{\n  \"feature\": \"\u003Cuser description>\",\n  \"framework\": \"\u003Cjest|vitest|pytest|go|cargo|rspec|phpunit>\",\n  \"language\": \"\u003Ctypescript|javascript|python|go|rust|ruby|php>\",\n  \"test_command\": \"\u003Cfull command>\",\n  \"source_dir\": \"src\u002F\",\n  \"auto_mode\": false,\n  \"slices\": [],\n  \"current_slice\": 0,\n  \"phase\": \"setup\",\n  \"files_modified\": [],\n  \"test_files_created\": []\n}\n```\n\n---\n\n## Phase 1 — Decompose into Vertical Slices\n\nBreak the feature into **ordered, testable behaviors** — one behavior per slice.\n\n### Inside-Out Ordering\n\nSort slices from innermost to outermost layer:\n\n1. **domain** — pure business logic, no dependencies, no mocks\n2. **domain-service** — cross-aggregate operations using real domain objects\n3. **application** — use-case orchestration with in-memory fakes for ports\n4. **infrastructure** — repos, external APIs, framework adapters\n\n**Why inside-out?** Domain slices produce real objects that later slices use directly. Minimizes mocking, catches integration issues early, ensures business rules exist before infrastructure.\n\nPresent to user:\n\n```\nI've broken this into N slices (inside-out order):\n\nDomain:\n  1. [behavior] — [what the test verifies]\n\nApplication:\n  2. [behavior] — [what the test verifies]\n\nInfrastructure:\n  3. [behavior] — [what the test verifies]\n\nEach slice: RED → GREEN → REFACTOR before the next.\nDoes this look right?\n```\n\n**Wait for approval** — even in `--auto` mode. Slice decomposition always needs sign-off.\n\nUpdate state: write `slices` array with `layer` field on each.\n\n---\n\n## Phase 2 — RED: Write One Failing Test\n\n### Step 1: Refresh API surface (re-run grep from Phase 0 Step 3)\n\n### Step 2: Launch Test Writer\n\n```\nTask(subagent_type=\"general-purpose\", prompt=\"\"\"\nYou are the Test Writer. Your ONLY job is to write ONE failing test for this behavior.\n\nBEHAVIOR TO TEST:\n{SLICE_SPEC}\n\nPUBLIC API (what you may call):\n{API_SURFACE}\n\nLANGUAGE: {LANGUAGE}\nTEST FRAMEWORK: {FRAMEWORK}\nTEST FILE: {TEST_FILE_PATH}\nEXISTING TEST FILE CONTENT (if any): {EXISTING_TEST_CONTENT}\n\nSTRICT CONSTRAINTS:\n- Write exactly ONE test function\n- The test MUST fail because the behavior doesn't exist yet\n- Do NOT look at or guess implementation details\n- Use real objects — no mocks for domain-layer tests\n- Test name must describe the behavior, not the implementation\n- For domain layer: never import mocking libraries\n\nReturn ONLY a JSON object:\n{\n  \"test_name\": \"descriptive_test_name\",\n  \"test_file_path\": \"path\u002Fto\u002Ftest_file\",\n  \"imports_needed\": [\"import statements\"],\n  \"test_code\": \"complete test function code\",\n  \"description\": \"one sentence: what behavior this verifies\"\n}\n\"\"\")\n```\n\n### Step 3: Write the test file\n\nApply the test code. If file exists, append the test function. If new, create it.\n\n### Step 4: Run to confirm RED\n\n```bash\n# Run only the new test\n# Jest: npx jest --testPathPattern=\u003Cfile> -t \"\u003Ctest_name>\"\n# pytest: pytest \u003Cfile>::\u003Ctest_name> -v\n# Go: go test -run \u003CTestName> .\u002F...\n```\n\nShow full output.\n\n| Result | Action |\n|--------|--------|\n| Assertion failure | **Proper RED** — proceed |\n| Import\u002Fmodule error | Create minimal stub so import resolves, re-run |\n| Test passes | Behavior already exists — log \"skip: already implemented\", move to next slice |\n| Syntax error | Fix test file, re-run. After 2 attempts, ask user |\n\n### Step 5 (interactive only): Present checkpoint\n\n```\nRED: Test failing as expected.\n\nTest: {test_name}\nFile: {test_file_path}\nFailure: {error message}\nVerifies: {description}\n\nProceed to GREEN? (or adjust the test?)\n```\n\n---\n\n## Phase 3 — GREEN: Minimal Implementation\n\n### Step 1: Collect context (test code + error output only)\n\n```bash\ncat {TEST_FILE_PATH}\n# + failure output from Phase 2 Step 4\n```\n\n### Step 2: Build source file tree\n\n```bash\nfind {SOURCE_DIR} -type f \\( -name \"*.ts\" -o -name \"*.js\" -o -name \"*.py\" -o -name \"*.go\" -o -name \"*.rs\" -o -name \"*.rb\" -o -name \"*.php\" \\) \\\n  | grep -v test | grep -v spec | grep -v node_modules | grep -v __pycache__ | head -50\n```\n\n### Step 3: Launch Implementer\n\n```\nTask(subagent_type=\"general-purpose\", prompt=\"\"\"\nYou are the Implementer. Your ONLY job is to make this failing test pass.\n\nFAILING TEST:\n{FAILING_TEST_CODE}\n\nTEST FAILURE OUTPUT:\n{TEST_FAILURE_OUTPUT}\n\nSOURCE FILE TREE:\n{FILE_TREE}\n\nEXISTING SOURCE (relevant files):\n{EXISTING_SOURCE}\n\nLAYER CONSTRAINT: {LAYER}\n- domain: no imports from application or infrastructure\n- domain-service: may use domain objects, no infrastructure imports\n- application: may use ports\u002Finterfaces, no concrete infrastructure\n- infrastructure: no restrictions\n\nSTRICT CONSTRAINTS:\n- Write the MINIMUM code to pass this one test\n- Do NOT read the original spec or feature description\n- Do NOT implement anything not required by the test\n- One file change at a time where possible\n\nReturn ONLY a JSON object:\n{\n  \"explanation\": \"what you implemented and why\",\n  \"files\": [\n    {\n      \"path\": \"relative\u002Fpath\u002Fto\u002Ffile.ts\",\n      \"action\": \"create|overwrite|edit\",\n      \"content\": \"complete file content\"\n    }\n  ]\n}\n\"\"\")\n```\n\n### Step 4: Apply changes and verify GREEN\n\nApply each file. Then run the specific test:\n\n```bash\n# Same command as Phase 2 Step 4\n```\n\n**Retry loop** (max 5 attempts):\n- If still failing: re-launch fresh Implementer with previous attempt's explanation + new error\n- If failing after 5 attempts: STOP, present to user\n\n### Step 5: Run full suite — check for regressions\n\n```bash\n# Full test command (same as Phase 0 Step 2)\n```\n\n- Regressions found → launch fresh Implementer targeting only the regression failures, up to 3 attempts\n- Still regressing after 3 → STOP, ask user\n\n### Step 6 (interactive only): Present checkpoint\n\n```\nGREEN: Test passing.\n\nImplementation: {explanation}\nFiles changed: {list}\nFull suite: {N} passing, {N} failing\n\nProceed to REFACTOR? (or adjust?)\n```\n\n---\n\n## Phase 4 — REFACTOR\n\n### Step 1: Launch Refactorer\n\n```\nTask(subagent_type=\"general-purpose\", prompt=\"\"\"\nYou are the Refactorer. Tests are green. Improve the code without changing behavior.\n\nGREEN TEST OUTPUT:\n{GREEN_TEST_OUTPUT}\n\nALL TEST CODE:\n{ALL_TEST_CODE}\n\nALL IMPLEMENTATION CODE:\n{ALL_IMPLEMENTATION_CODE}\n\nLAYER(S) TOUCHED: {SLICE_LAYERS}\n\nYOUR JOB:\n- Remove duplication\n- Improve naming\n- Simplify logic\n- Fix dependency direction violations (inner layers must not import outer)\n- Do NOT add features not tested\n\nReturn ONLY a JSON object:\n{\n  \"suggestions\": [\n    {\n      \"priority\": \"high|medium|low\",\n      \"description\": \"what and why\",\n      \"file\": \"path\u002Fto\u002Ffile\",\n      \"old_code\": \"exact code to replace\",\n      \"new_code\": \"replacement code\"\n    }\n  ]\n}\nReturn empty suggestions array if nothing needs changing.\n\"\"\")\n```\n\n### Step 2: Apply suggestions one at a time (high priority first)\n\nFor each suggestion:\n1. Apply the edit\n2. Run full test suite\n3. If any test fails → **revert immediately**, skip this suggestion\n4. If all pass → keep the change\n\n### Step 3 (interactive only): Report\n\n```\nREFACTOR: {N} applied, {N} skipped (reverted on test failure).\nAll tests: {count} passing.\n```\n\n---\n\n## Phase 5 — Next Slice or Complete\n\n- More slices → increment `current_slice`, return to Phase 2\n- All slices done → present summary:\n\n```\nTDD Complete: {feature}\n\nSlices: {N}\nTests written: {N}\nFiles created\u002Fmodified: {list}\nAll tests passing: yes\n```\n\nRemove `.tdd-state.json` (ask in interactive mode, silent in `--auto`).\n\n---\n\n## Resume Support\n\n`\u002Ftdd --resume`:\n1. Read `.tdd-state.json`\n2. Report: \"Found session for '{feature}'. Slice {N}\u002F{total}, phase: {phase}.\"\n3. Resume from current phase of current slice\n\n---\n\n## Dry-Run Mode\n\nFor `--dry-run`: run Phase 0 and Phase 1 fully, then for each slice render the three agent prompts with variables filled in but **call no Task() and write no files**. Print prompt sizes and variable resolution status. Report summary. Do not clean up state file.\n\n---\n\n## Edge Cases\n\n**Greenfield**: No tests yet — proceed from Phase 0. Test Writer creates test files and framework config from scratch.\n\n**Bug fix**: Write a test demonstrating the bug (RED confirms bug exists). Fix in GREEN. Verify with `verify-before-done` skill after completing.\n\n**Flaky test**: If a test sometimes passes\u002Ffails — stop, report, fix flakiness before continuing.\n\n**User-provided test**: Confirm it fails (RED), skip to Phase 3 (GREEN). Do not modify without asking.\n\n---\n\n## Constraints\n\n- Never write implementation before a failing test exists.\n- Never modify a test to make it pass — fix the implementation.\n- Never write all tests upfront — one slice at a time.\n- Never skip RED phase, even for \"trivial\" cases.\n- Domain code must never import infrastructure — dependency direction is inward only.\n- After all slices: run `verify-before-done` skill before claiming done.\n- On unexpected errors: use `debug-protocol` skill — do not guess fixes.\n\n---\n\n## Framework Quick Reference\n\n| Framework | Single test | Full suite |\n|-----------|------------|------------|\n| Jest | `npx jest -t \"\u003Cname>\" \u003Cfile>` | `npx jest` |\n| Vitest | `npx vitest run \u003Cfile> -t \"\u003Cname>\"` | `npx vitest run` |\n| pytest | `pytest \u003Cfile>::\u003Cname> -v` | `pytest -v` |\n| Go | `go test -run \u003CName> .\u002F...` | `go test .\u002F...` |\n| Cargo | `cargo test \u003Cname>` | `cargo test` |\n| RSpec | `rspec \u003Cfile>:\u003Cline>` | `rspec` |\n| PHPUnit | `phpunit --filter \u003Cname>` | `phpunit` |\n\n---\n\nAttribution: Core RED→GREEN→REFACTOR orchestration pattern and context-isolation architecture adapted from glebis\u002Fclaude-skills (MIT License). Rewritten for YAMTAM ENGINE — self-contained, no external scripts, integrated with verify-before-done and debug-protocol skills.\n",{"name":5,"description":7},"main","481dcd7dd2e288b9d627a2bd017db70e64e6c6fa","core\u002Fskills\u002Ftdd",2,"https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI","https:\u002F\u002Fyana.vutam.link\u002F","https:\u002F\u002Fgithub.com\u002FHoronomos-laps","https:\u002F\u002Fyana.vutam.link","An open-source governed runtime & execution environment for multi-agent AI systems.","2026-11-14 13:24:09",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add Horonomos-laps\u002FYana-AI --skill tdd",{"tool":40,"command":41},"bunx","bunx skills add Horonomos-laps\u002FYana-AI --skill tdd",{"tool":43,"command":44},"pnpm","pnpm dlx skills add Horonomos-laps\u002FYana-AI --skill tdd","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Ftdd\u002FSKILL.md",true,[],[49,57,64,72,80,88],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M735GKET5YVYKAY62W2P5YXB","openai--sentry--sentry","Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.","MIT","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fopenai--sentry--sentry\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M73DCAP83T17HY7SMGK7MGFE","ito-basket-compare","Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fito-basket-compare\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":68,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M734CYEMZFDR3KH6SW0JP8TD","implementing-network-traffic-baselining","Build network traffic baselines from NetFlow\u002FIPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly\u002Fdaily traffic pattern profiling","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":76,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M73ASZ6NJRJM44Z2P84NGQ3Q","detecting-evasion-techniques-in-endpoint-logs","Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":84,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M734AFNXD06Z78QRK0VKGT7Q","implementing-microsegmentation-with-guardicore","Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M736TK27QMCXK0DVCH25SJN5","ramdisk-tmpfs-patterns","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Framdisk-tmpfs-patterns\u002FSKILL.md",[],[]]