{
  "schemaVersion": "1.0",
  "item": {
    "slug": "tdd-guide",
    "name": "Tdd Guide",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/alirezarezvani/tdd-guide",
    "canonicalUrl": "https://clawhub.ai/alirezarezvani/tdd-guide",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/tdd-guide",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=tdd-guide",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "HOW_TO_USE.md",
      "README.md",
      "SKILL.md",
      "assets/expected_output.json",
      "assets/sample_input_python.json",
      "assets/sample_input_typescript.json"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "slug": "tdd-guide",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-01T09:57:37.070Z",
      "expiresAt": "2026-05-08T09:57:37.070Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=tdd-guide",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=tdd-guide",
        "contentDisposition": "attachment; filename=\"tdd-guide-2.1.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "tdd-guide"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/tdd-guide"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/tdd-guide",
    "agentPageUrl": "https://openagent3.xyz/skills/tdd-guide/agent",
    "manifestUrl": "https://openagent3.xyz/skills/tdd-guide/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/tdd-guide/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "TDD Guide",
        "body": "Test-driven development skill for generating tests, analyzing coverage, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, and Vitest."
      },
      {
        "title": "Generate Tests from Code",
        "body": "Provide source code (TypeScript, JavaScript, Python, Java)\nSpecify target framework (Jest, Pytest, JUnit, Vitest)\nRun test_generator.py with requirements\nReview generated test stubs\nValidation: Tests compile and cover happy path, error cases, edge cases"
      },
      {
        "title": "Analyze Coverage Gaps",
        "body": "Generate coverage report from test runner (npm test -- --coverage)\nRun coverage_analyzer.py on LCOV/JSON/XML report\nReview prioritized gaps (P0/P1/P2)\nGenerate missing tests for uncovered paths\nValidation: Coverage meets target threshold (typically 80%+)"
      },
      {
        "title": "TDD New Feature",
        "body": "Write failing test first (RED)\nRun tdd_workflow.py --phase red to validate\nImplement minimal code to pass (GREEN)\nRun tdd_workflow.py --phase green to validate\nRefactor while keeping tests green (REFACTOR)\nValidation: All tests pass after each cycle"
      },
      {
        "title": "Test Generation — Input → Output (Pytest)",
        "body": "Input source function (math_utils.py):\n\ndef divide(a: float, b: float) -> float:\n    if b == 0:\n        raise ValueError(\"Cannot divide by zero\")\n    return a / b\n\nCommand:\n\npython scripts/test_generator.py --input math_utils.py --framework pytest\n\nGenerated test output (test_math_utils.py):\n\nimport pytest\nfrom math_utils import divide\n\nclass TestDivide:\n    def test_divide_positive_numbers(self):\n        assert divide(10, 2) == 5.0\n\n    def test_divide_negative_numerator(self):\n        assert divide(-10, 2) == -5.0\n\n    def test_divide_float_result(self):\n        assert divide(1, 3) == pytest.approx(0.333, rel=1e-3)\n\n    def test_divide_by_zero_raises_value_error(self):\n        with pytest.raises(ValueError, match=\"Cannot divide by zero\"):\n            divide(10, 0)\n\n    def test_divide_zero_numerator(self):\n        assert divide(0, 5) == 0.0"
      },
      {
        "title": "Coverage Analysis — Sample P0/P1/P2 Output",
        "body": "Command:\n\npython scripts/coverage_analyzer.py --report lcov.info --threshold 80\n\nSample output:\n\nCoverage Report — Overall: 63% (threshold: 80%)\n\nP0 — Critical gaps (uncovered error paths):\n  auth/login.py:42-58   handle_expired_token()       0% covered\n  payments/process.py:91-110  handle_payment_failure()   0% covered\n\nP1 — High-value gaps (core logic branches):\n  users/service.py:77   update_profile() — else branch  0% covered\n  orders/cart.py:134    apply_discount() — zero-qty guard  0% covered\n\nP2 — Low-risk gaps (utility / helper functions):\n  utils/formatting.py:12  format_currency()            0% covered\n\nRecommended: Generate tests for P0 items first to reach 80% threshold."
      },
      {
        "title": "Key Tools",
        "body": "ToolPurposeUsagetest_generator.pyGenerate test cases from code/requirementspython scripts/test_generator.py --input source.py --framework pytestcoverage_analyzer.pyParse and analyze coverage reportspython scripts/coverage_analyzer.py --report lcov.info --threshold 80tdd_workflow.pyGuide red-green-refactor cyclespython scripts/tdd_workflow.py --phase red --test test_auth.pyfixture_generator.pyGenerate test data and mockspython scripts/fixture_generator.py --entity User --count 5\n\nAdditional scripts: framework_adapter.py (convert between frameworks), metrics_calculator.py (quality metrics), format_detector.py (detect language/framework), output_formatter.py (CLI/desktop/CI output)."
      },
      {
        "title": "Input Requirements",
        "body": "For Test Generation:\n\nSource code (file path or pasted content)\nTarget framework (Jest, Pytest, JUnit, Vitest)\nCoverage scope (unit, integration, edge cases)\n\nFor Coverage Analysis:\n\nCoverage report file (LCOV, JSON, or XML format)\nOptional: Source code for context\nOptional: Target threshold percentage\n\nFor TDD Workflow:\n\nFeature requirements or user story\nCurrent phase (RED, GREEN, REFACTOR)\nTest code and implementation status"
      },
      {
        "title": "Limitations",
        "body": "ScopeDetailsUnit test focusIntegration and E2E tests require different patternsStatic analysisCannot execute tests or measure runtime behaviorLanguage supportBest for TypeScript, JavaScript, Python, JavaReport formatsLCOV, JSON, XML only; other formats need conversionGenerated testsProvide scaffolding; require human review for complex logic\n\nWhen to use other tools:\n\nE2E testing: Playwright, Cypress, Selenium\nPerformance testing: k6, JMeter, Locust\nSecurity testing: OWASP ZAP, Burp Suite"
      }
    ],
    "body": "TDD Guide\n\nTest-driven development skill for generating tests, analyzing coverage, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, and Vitest.\n\nWorkflows\nGenerate Tests from Code\nProvide source code (TypeScript, JavaScript, Python, Java)\nSpecify target framework (Jest, Pytest, JUnit, Vitest)\nRun test_generator.py with requirements\nReview generated test stubs\nValidation: Tests compile and cover happy path, error cases, edge cases\nAnalyze Coverage Gaps\nGenerate coverage report from test runner (npm test -- --coverage)\nRun coverage_analyzer.py on LCOV/JSON/XML report\nReview prioritized gaps (P0/P1/P2)\nGenerate missing tests for uncovered paths\nValidation: Coverage meets target threshold (typically 80%+)\nTDD New Feature\nWrite failing test first (RED)\nRun tdd_workflow.py --phase red to validate\nImplement minimal code to pass (GREEN)\nRun tdd_workflow.py --phase green to validate\nRefactor while keeping tests green (REFACTOR)\nValidation: All tests pass after each cycle\nExamples\nTest Generation — Input → Output (Pytest)\n\nInput source function (math_utils.py):\n\ndef divide(a: float, b: float) -> float:\n    if b == 0:\n        raise ValueError(\"Cannot divide by zero\")\n    return a / b\n\n\nCommand:\n\npython scripts/test_generator.py --input math_utils.py --framework pytest\n\n\nGenerated test output (test_math_utils.py):\n\nimport pytest\nfrom math_utils import divide\n\nclass TestDivide:\n    def test_divide_positive_numbers(self):\n        assert divide(10, 2) == 5.0\n\n    def test_divide_negative_numerator(self):\n        assert divide(-10, 2) == -5.0\n\n    def test_divide_float_result(self):\n        assert divide(1, 3) == pytest.approx(0.333, rel=1e-3)\n\n    def test_divide_by_zero_raises_value_error(self):\n        with pytest.raises(ValueError, match=\"Cannot divide by zero\"):\n            divide(10, 0)\n\n    def test_divide_zero_numerator(self):\n        assert divide(0, 5) == 0.0\n\nCoverage Analysis — Sample P0/P1/P2 Output\n\nCommand:\n\npython scripts/coverage_analyzer.py --report lcov.info --threshold 80\n\n\nSample output:\n\nCoverage Report — Overall: 63% (threshold: 80%)\n\nP0 — Critical gaps (uncovered error paths):\n  auth/login.py:42-58   handle_expired_token()       0% covered\n  payments/process.py:91-110  handle_payment_failure()   0% covered\n\nP1 — High-value gaps (core logic branches):\n  users/service.py:77   update_profile() — else branch  0% covered\n  orders/cart.py:134    apply_discount() — zero-qty guard  0% covered\n\nP2 — Low-risk gaps (utility / helper functions):\n  utils/formatting.py:12  format_currency()            0% covered\n\nRecommended: Generate tests for P0 items first to reach 80% threshold.\n\nKey Tools\nTool\tPurpose\tUsage\ntest_generator.py\tGenerate test cases from code/requirements\tpython scripts/test_generator.py --input source.py --framework pytest\ncoverage_analyzer.py\tParse and analyze coverage reports\tpython scripts/coverage_analyzer.py --report lcov.info --threshold 80\ntdd_workflow.py\tGuide red-green-refactor cycles\tpython scripts/tdd_workflow.py --phase red --test test_auth.py\nfixture_generator.py\tGenerate test data and mocks\tpython scripts/fixture_generator.py --entity User --count 5\n\nAdditional scripts: framework_adapter.py (convert between frameworks), metrics_calculator.py (quality metrics), format_detector.py (detect language/framework), output_formatter.py (CLI/desktop/CI output).\n\nInput Requirements\n\nFor Test Generation:\n\nSource code (file path or pasted content)\nTarget framework (Jest, Pytest, JUnit, Vitest)\nCoverage scope (unit, integration, edge cases)\n\nFor Coverage Analysis:\n\nCoverage report file (LCOV, JSON, or XML format)\nOptional: Source code for context\nOptional: Target threshold percentage\n\nFor TDD Workflow:\n\nFeature requirements or user story\nCurrent phase (RED, GREEN, REFACTOR)\nTest code and implementation status\nLimitations\nScope\tDetails\nUnit test focus\tIntegration and E2E tests require different patterns\nStatic analysis\tCannot execute tests or measure runtime behavior\nLanguage support\tBest for TypeScript, JavaScript, Python, Java\nReport formats\tLCOV, JSON, XML only; other formats need conversion\nGenerated tests\tProvide scaffolding; require human review for complex logic\n\nWhen to use other tools:\n\nE2E testing: Playwright, Cypress, Selenium\nPerformance testing: k6, JMeter, Locust\nSecurity testing: OWASP ZAP, Burp Suite"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/alirezarezvani/tdd-guide",
    "publisherUrl": "https://clawhub.ai/alirezarezvani/tdd-guide",
    "owner": "alirezarezvani",
    "version": "2.1.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/tdd-guide",
    "downloadUrl": "https://openagent3.xyz/downloads/tdd-guide",
    "agentUrl": "https://openagent3.xyz/skills/tdd-guide/agent",
    "manifestUrl": "https://openagent3.xyz/skills/tdd-guide/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/tdd-guide/agent.md"
  }
}