[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C55V1RDCNFJ019HRA16ZHM":3,"skill-same:01M6C55V1RDCNFJ019HRA16ZHM":84},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":25,"publishedAt":45,"linkOnly":46,"markdownContent":47,"markdownBody":48,"frontMatter":49,"refName":57,"commitSha":58,"skillDirectory":59,"forksCount":60,"repositoryHtmlUrl":61,"repositoryHomepageUrl":6,"ownerHtmlUrl":62,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":63,"install":64,"resources":77},"01M6C55V1RDCNFJ019HRA16ZHM","rtk-tdd",null,"Enforces TDD (Red-Green-Refactor) for Rust development. Auto-triggers on implementation, testing, refactoring, and bug fixing tasks. Provides Rust-idiomatic testing patterns with anyhow\u002Fthiserror, cfg(test), and Arrange-Act-Assert workflow.","MDMAtk\u002FTormentNexus","MDMAtk","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F288684999?v=4","01M6C54H4AG0BYB3HTFA4C0CBJ","01M6C54H8146YDG94N9KWXV521",13,"AGPL-3.0","https:\u002F\u002Fgithub.com\u002FMDMAtk\u002FTormentNexus\u002Fblob\u002Fmain\u002Fthird_party\u002Frtk\u002F.claude\u002Fskills\u002Frtk-tdd\u002FSKILL.md",[17,22],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000007","代码审查","SCENARIO","使用场景",{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000008","测试与质量",[26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],"rtk tdd","tdd","rtk","CFG","red-green-refactor","auto","edit","write","read","refactoring","Bash","testing","testing patterns","refactor","development","tasks","test","workflow","rust","2026-11-10 10:12:30",false,"---\nname: rtk-tdd\ndescription: >\n  Enforces TDD (Red-Green-Refactor) for Rust development. Auto-triggers on\n  implementation, testing, refactoring, and bug fixing tasks. Provides\n  Rust-idiomatic testing patterns with anyhow\u002Fthiserror, cfg(test), and\n  Arrange-Act-Assert workflow.\nallowed-tools:\n  - Read\n  - Write\n  - Edit\n  - Bash\neffort: medium\ntags: [tdd, testing, rust, red-green-refactor, rtk]\n---\n\n# Rust TDD Workflow\n\n## Three Laws of TDD\n\n1. Do NOT write production code without a failing test\n2. Write only enough test to fail (including compilation failure)\n3. Write only enough production code to pass the failing test\n\nCycle: **RED** (test fails) -> **GREEN** (minimum to pass) -> **REFACTOR** (cleanup, cargo test)\n\n## Red-Green-Refactor Steps\n\n```\n1. Write test in #[cfg(test)] mod tests of the SAME file\n2. cargo test MODULE::tests::test_name  -- must FAIL (red)\n3. Implement the minimum in the function\n4. cargo test MODULE::tests::test_name  -- must PASS (green)\n5. Refactor if needed, re-run cargo test (still green)\n6. cargo fmt && cargo clippy --all-targets && cargo test  (final gate)\n```\n\nNever skip step 2. If the test passes immediately, it tests nothing.\n\n## Idiomatic Rust Test Patterns\n\n| Pattern | Usage | When |\n|---------|-------|------|\n| Arrange-Act-Assert | Base structure for every test | Always |\n| `assert_eq!` \u002F `assert!` | Direct comparison \u002F booleans | Deterministic values |\n| `assert!(result.is_err())` | Error path testing | Invalid inputs |\n| `Result\u003C()>` return type | Tests with `?` operator | Fallible functions |\n| `#[should_panic]` | Expected panic | Invariants, preconditions |\n| `tempfile::NamedTempFile` | File\u002FI\u002FO tests | Filesystem-dependent code |\n\n## Patterns by Code Type\n\n| Code Type | Test Pattern | Example |\n|-----------|-------------|---------|\n| Pure function (str -> str) | Input literal -> assert output | `assert_eq!(truncate(\"hello\", 3), \"...\")` |\n| Parsing\u002Ffiltering | Raw string -> filter -> contains\u002Fnot-contains | `assert!(filter(raw).contains(\"expected\"))` |\n| Validation\u002Fsecurity | Boundary inputs -> assert bool | `assert!(!is_valid(\"..\u002Fetc\u002Fpasswd\"))` |\n| Error handling | Bad input -> `is_err()` | `assert!(parse(\"garbage\").is_err())` |\n| Struct\u002Fenum roundtrip | Construct -> serialize -> deserialize -> eq | `assert_eq!(from_str(to_str(x)), x)` |\n\n## Naming Convention\n\n```\ntest_{function}_{scenario}\ntest_{function}_{input_type}\n```\n\nExamples: `test_truncate_edge_case`, `test_parse_invalid_input`, `test_filter_empty_string`\n\n## When NOT to Use Pure TDD\n\n- Functions calling `Command::new()` -> test the parser, not the execution\n- `std::process::exit()` -> refactor to `Result` first, then test the Result\n- Direct I\u002FO (SQLite, network) -> use tempfile\u002Fmock or test the pure logic separately\n- Main\u002FCLI wiring -> covered by integration\u002Fsmoke tests\n\n## Pre-Commit Gate\n\n```bash\ncargo fmt --all --check\ncargo clippy --all-targets\ncargo test\n```\n\nAll 3 must pass. No exceptions. No `#[allow(...)]` without documented justification.\n","# Rust TDD Workflow\n\n## Three Laws of TDD\n\n1. Do NOT write production code without a failing test\n2. Write only enough test to fail (including compilation failure)\n3. Write only enough production code to pass the failing test\n\nCycle: **RED** (test fails) -> **GREEN** (minimum to pass) -> **REFACTOR** (cleanup, cargo test)\n\n## Red-Green-Refactor Steps\n\n```\n1. Write test in #[cfg(test)] mod tests of the SAME file\n2. cargo test MODULE::tests::test_name  -- must FAIL (red)\n3. Implement the minimum in the function\n4. cargo test MODULE::tests::test_name  -- must PASS (green)\n5. Refactor if needed, re-run cargo test (still green)\n6. cargo fmt && cargo clippy --all-targets && cargo test  (final gate)\n```\n\nNever skip step 2. If the test passes immediately, it tests nothing.\n\n## Idiomatic Rust Test Patterns\n\n| Pattern | Usage | When |\n|---------|-------|------|\n| Arrange-Act-Assert | Base structure for every test | Always |\n| `assert_eq!` \u002F `assert!` | Direct comparison \u002F booleans | Deterministic values |\n| `assert!(result.is_err())` | Error path testing | Invalid inputs |\n| `Result\u003C()>` return type | Tests with `?` operator | Fallible functions |\n| `#[should_panic]` | Expected panic | Invariants, preconditions |\n| `tempfile::NamedTempFile` | File\u002FI\u002FO tests | Filesystem-dependent code |\n\n## Patterns by Code Type\n\n| Code Type | Test Pattern | Example |\n|-----------|-------------|---------|\n| Pure function (str -> str) | Input literal -> assert output | `assert_eq!(truncate(\"hello\", 3), \"...\")` |\n| Parsing\u002Ffiltering | Raw string -> filter -> contains\u002Fnot-contains | `assert!(filter(raw).contains(\"expected\"))` |\n| Validation\u002Fsecurity | Boundary inputs -> assert bool | `assert!(!is_valid(\"..\u002Fetc\u002Fpasswd\"))` |\n| Error handling | Bad input -> `is_err()` | `assert!(parse(\"garbage\").is_err())` |\n| Struct\u002Fenum roundtrip | Construct -> serialize -> deserialize -> eq | `assert_eq!(from_str(to_str(x)), x)` |\n\n## Naming Convention\n\n```\ntest_{function}_{scenario}\ntest_{function}_{input_type}\n```\n\nExamples: `test_truncate_edge_case`, `test_parse_invalid_input`, `test_filter_empty_string`\n\n## When NOT to Use Pure TDD\n\n- Functions calling `Command::new()` -> test the parser, not the execution\n- `std::process::exit()` -> refactor to `Result` first, then test the Result\n- Direct I\u002FO (SQLite, network) -> use tempfile\u002Fmock or test the pure logic separately\n- Main\u002FCLI wiring -> covered by integration\u002Fsmoke tests\n\n## Pre-Commit Gate\n\n```bash\ncargo fmt --all --check\ncargo clippy --all-targets\ncargo test\n```\n\nAll 3 must pass. No exceptions. No `#[allow(...)]` without documented justification.\n",{"name":5,"tags":50,"effort":51,"description":52,"allowed-tools":53},[27,37,44,30,28],"medium","Enforces TDD (Red-Green-Refactor) for Rust development. Auto-triggers on implementation, testing, refactoring, and bug fixing tasks. Provides Rust-idiomatic testing patterns with anyhow\u002Fthiserror, cfg(test), and Arrange-Act-Assert workflow.\n",[54,55,56,36],"Read","Write","Edit","main","6079b2fd99329bb8a099e7708b0567b93edf8206","third_party\u002Frtk\u002F.claude\u002Fskills\u002Frtk-tdd",2,"https:\u002F\u002Fgithub.com\u002FMDMAtk\u002FTormentNexus","https:\u002F\u002Fgithub.com\u002FMDMAtk","2026-11-07 14:28:49",{"source":8,"skillName":5,"commands":65,"prompt":75,"zipAvailable":76},[66,69,72],{"tool":67,"command":68},"npx","npx skills add MDMAtk\u002FTormentNexus --skill rtk-tdd",{"tool":70,"command":71},"bunx","bunx skills add MDMAtk\u002FTormentNexus --skill rtk-tdd",{"tool":73,"command":74},"pnpm","pnpm dlx skills add MDMAtk\u002FTormentNexus --skill rtk-tdd","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMDMAtk\u002FTormentNexus\u002Fblob\u002Fmain\u002Fthird_party\u002Frtk\u002F.claude\u002Fskills\u002Frtk-tdd\u002FSKILL.md",true,[78],{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Ftesting-patterns.md","REFERENCE","参考文档",3572,"https:\u002F\u002Fgithub.com\u002FMDMAtk\u002FTormentNexus\u002Fblob\u002Fmain\u002Fthird_party\u002Frtk\u002F.claude\u002Fskills\u002Frtk-tdd\u002Freferences\u002Ftesting-patterns.md",[85,104,116,129,146,159],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":92,"publishedAt":45},"01M6C5659TDGC363E5EWMQZJGZ","tdd-rust","TDD workflow for RTK filter development. Red-Green-Refactor with Rust idioms. Real fixtures, token savings assertions, snapshot tests with insta. Auto-triggers on new filter implementation.","https:\u002F\u002Fgithub.com\u002FMDMAtk\u002FTormentNexus\u002Fblob\u002Fmain\u002Fthird_party\u002Frtk\u002F.claude\u002Fskills\u002Ftdd-rust\u002FSKILL.md",[91],{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},[93,27,44,37,94,95,96,97,30,98,31,99,100,101,36,40,102,103,42,43],"tdd rust","coverage","token-savings","snapshots","filters","test coverage","fix","implement","command","add command","write tests",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":45},"01M6C562NZPX3J6W8F6P4KZMV1","ship","Build, commit, push & version bump workflow - automates the complete release cycle","https:\u002F\u002Fgithub.com\u002FMDMAtk\u002FTormentNexus\u002Fblob\u002Fmain\u002Fthird_party\u002Frtk\u002F.claude\u002Fskills\u002Fship\u002FSKILL.md",[],[106,111,112,32,33,34,36,113,114,115,43],"grep","version","push","release","commit",{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":45},"01M6C55ZXSNWBB861V5GGYR775","security-guardian","CLI security expert for RTK - command injection, shell escaping, hook security","https:\u002F\u002Fgithub.com\u002FMDMAtk\u002FTormentNexus\u002Fblob\u002Fmain\u002Fthird_party\u002Frtk\u002F.claude\u002Fskills\u002Fsecurity-guardian\u002FSKILL.md",[],[123,124,125,28,101,111,36,126,127,128,34],"security","security guardian","guardian","shell","injection","cli",{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":45},"01M6C55XHCBK612DXDAD08GGE1","rtk-triage","Triage complet RTK : exécute issue-triage + pr-triage en parallèle, puis croise les données pour détecter doubles couvertures, trous sécurité, P0 sans PR, et conflits internes. Sauvegarde dans claudedocs\u002FRTK-YYYY-MM-DD.md. Args: \"en\"\u002F\"fr\" pour la langue (défaut: fr), \"save\" pour forcer la sauvegarde.","https:\u002F\u002Fgithub.com\u002FMDMAtk\u002FTormentNexus\u002Fblob\u002Fmain\u002Fthird_party\u002Frtk\u002F.claude\u002Fskills\u002Frtk-triage\u002FSKILL.md",[],[136,28,137,138,139,140,123,141,142,33,34,36,143,144,145],"rtk triage","triage","issues","pr","orchestration","dd","cross-analysis","save","analysis","sans",{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":45},"01M6C55RQ5QH5MBSYXMC8KF0WV","repo-recap","Generate a comprehensive repo recap (PRs, issues, releases) for sharing with team. Pass \"en\" or \"fr\" as argument for language (default fr).","https:\u002F\u002Fgithub.com\u002FMDMAtk\u002FTormentNexus\u002Fblob\u002Fmain\u002Fthird_party\u002Frtk\u002F.claude\u002Fskills\u002Frepo-recap\u002FSKILL.md",[],[153,154,155,34,111,36,156,157,138,158],"repo recap","repo","recap","team","sharing","generate",{"skillNo":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":165,"publishedAt":45},"01M6C55PB2B52ADBYHV6H0NMHD","pr-triage","PR triage: audit open PRs, deep review selected ones, draft and post review comments. Args: \"all\" to review all, PR numbers to focus (e.g. \"42 57\"), \"en\"\u002F\"fr\" for language, no arg = audit only in French.","https:\u002F\u002Fgithub.com\u002FMDMAtk\u002FTormentNexus\u002Fblob\u002Fmain\u002Fthird_party\u002Frtk\u002F.claude\u002Fskills\u002Fpr-triage\u002FSKILL.md",[],[137,139,166,167,168,169,34,170,36,111,28,171,172,173,174],"pr triage","code","code-review","github","open","audit","only","deep review","review"]