[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AWSXWAS7A0H6ATFFCCKCCN":3,"skill-same:01M7AWSXWAS7A0H6ATFFCCKCCN":62},{"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":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7AWSXWAS7A0H6ATFFCCKCCN","m01-ownership",null,"CRITICAL: Use for ownership\u002Fborrow\u002Flifetime issues. Triggers: E0382, E0597, E0506, E0507, E0515, E0716, E0106, value moved, borrowed value does not live long enough, cannot move out of, use of moved value, ownership, borrow, lifetime, 'a, 'static, move, clone, Copy, 所有权, 借用, 生命周期","wxxb789\u002Fmarkturbo","wxxb789","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F49564443?v=4","01M7AWR3AB19SNE4ATARY9KV3W","01M7AWR3AZ5Y5ADAY47KF3RBRJ",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fwxxb789\u002Fmarkturbo\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fm01-ownership\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: m01-ownership\ndescription: \"CRITICAL: Use for ownership\u002Fborrow\u002Flifetime issues. Triggers: E0382, E0597, E0506, E0507, E0515, E0716, E0106, value moved, borrowed value does not live long enough, cannot move out of, use of moved value, ownership, borrow, lifetime, 'a, 'static, move, clone, Copy, 所有权, 借用, 生命周期\"\nuser-invocable: false\n---\n\n# Ownership & Lifetimes\n\n> **Layer 1: Language Mechanics**\n\n## Core Question\n\n**Who should own this data, and for how long?**\n\nBefore fixing ownership errors, understand the data's role:\n- Is it shared or exclusive?\n- Is it short-lived or long-lived?\n- Is it transformed or just read?\n\n---\n\n## Error → Design Question\n\n| Error | Don't Just Say | Ask Instead |\n|-------|----------------|-------------|\n| E0382 | \"Clone it\" | Who should own this data? |\n| E0597 | \"Extend lifetime\" | Is the scope boundary correct? |\n| E0506 | \"End borrow first\" | Should mutation happen elsewhere? |\n| E0507 | \"Clone before move\" | Why are we moving from a reference? |\n| E0515 | \"Return owned\" | Should caller own the data? |\n| E0716 | \"Bind to variable\" | Why is this temporary? |\n| E0106 | \"Add 'a\" | What is the actual lifetime relationship? |\n\n---\n\n## Thinking Prompt\n\nBefore fixing an ownership error, ask:\n\n1. **What is this data's domain role?**\n   - Entity (unique identity) → owned\n   - Value Object (interchangeable) → clone\u002Fcopy OK\n   - Temporary (computation result) → maybe restructure\n\n2. **Is the ownership design intentional?**\n   - By design → work within constraints\n   - Accidental → consider redesign\n\n3. **Fix symptom or redesign?**\n   - If Strike 3 (3rd attempt) → escalate to Layer 2\n\n---\n\n## Trace Up ↑\n\nWhen errors persist, trace to design layer:\n\n```\nE0382 (moved value)\n    ↑ Ask: What design choice led to this ownership pattern?\n    ↑ Check: m09-domain (is this Entity or Value Object?)\n    ↑ Check: domain-* (what constraints apply?)\n```\n\n| Persistent Error | Trace To | Question |\n|-----------------|----------|----------|\n| E0382 repeated | m02-resource | Should use Arc\u002FRc for sharing? |\n| E0597 repeated | m09-domain | Is scope boundary at right place? |\n| E0506\u002FE0507 | m03-mutability | Should use interior mutability? |\n\n---\n\n## Trace Down ↓\n\nFrom design decisions to implementation:\n\n```\n\"Data needs to be shared immutably\"\n    ↓ Use: Arc\u003CT> (multi-thread) or Rc\u003CT> (single-thread)\n\n\"Data needs exclusive ownership\"\n    ↓ Use: move semantics, take ownership\n\n\"Data is read-only view\"\n    ↓ Use: &T (immutable borrow)\n```\n\n---\n\n## Quick Reference\n\n| Pattern | Ownership | Cost | Use When |\n|---------|-----------|------|----------|\n| Move | Transfer | Zero | Caller doesn't need data |\n| `&T` | Borrow | Zero | Read-only access |\n| `&mut T` | Exclusive borrow | Zero | Need to modify |\n| `clone()` | Duplicate | Alloc + copy | Actually need a copy |\n| `Rc\u003CT>` | Shared (single) | Ref count | Single-thread sharing |\n| `Arc\u003CT>` | Shared (multi) | Atomic ref count | Multi-thread sharing |\n| `Cow\u003CT>` | Clone-on-write | Alloc if mutated | Might modify |\n\n## Error Code Reference\n\n| Error | Cause | Quick Fix |\n|-------|-------|-----------|\n| E0382 | Value moved | Clone, reference, or redesign ownership |\n| E0597 | Reference outlives owner | Extend owner scope or restructure |\n| E0506 | Assign while borrowed | End borrow before mutation |\n| E0507 | Move out of borrowed | Clone or use reference |\n| E0515 | Return local reference | Return owned value |\n| E0716 | Temporary dropped | Bind to variable |\n| E0106 | Missing lifetime | Add `'a` annotation |\n\n---\n\n## Anti-Patterns\n\n| Anti-Pattern | Why Bad | Better |\n|--------------|---------|--------|\n| `.clone()` everywhere | Hides design issues | Design ownership properly |\n| Fight borrow checker | Increases complexity | Work with the compiler |\n| `'static` for everything | Restricts flexibility | Use appropriate lifetimes |\n| Leak with `Box::leak` | Memory leak | Proper lifetime design |\n\n---\n\n## Related Skills\n\n| When | See |\n|------|-----|\n| Need smart pointers | m02-resource |\n| Need interior mutability | m03-mutability |\n| Data is domain entity | m09-domain |\n| Learning ownership concepts | m14-mental-model |\n","# Ownership & Lifetimes\n\n> **Layer 1: Language Mechanics**\n\n## Core Question\n\n**Who should own this data, and for how long?**\n\nBefore fixing ownership errors, understand the data's role:\n- Is it shared or exclusive?\n- Is it short-lived or long-lived?\n- Is it transformed or just read?\n\n---\n\n## Error → Design Question\n\n| Error | Don't Just Say | Ask Instead |\n|-------|----------------|-------------|\n| E0382 | \"Clone it\" | Who should own this data? |\n| E0597 | \"Extend lifetime\" | Is the scope boundary correct? |\n| E0506 | \"End borrow first\" | Should mutation happen elsewhere? |\n| E0507 | \"Clone before move\" | Why are we moving from a reference? |\n| E0515 | \"Return owned\" | Should caller own the data? |\n| E0716 | \"Bind to variable\" | Why is this temporary? |\n| E0106 | \"Add 'a\" | What is the actual lifetime relationship? |\n\n---\n\n## Thinking Prompt\n\nBefore fixing an ownership error, ask:\n\n1. **What is this data's domain role?**\n   - Entity (unique identity) → owned\n   - Value Object (interchangeable) → clone\u002Fcopy OK\n   - Temporary (computation result) → maybe restructure\n\n2. **Is the ownership design intentional?**\n   - By design → work within constraints\n   - Accidental → consider redesign\n\n3. **Fix symptom or redesign?**\n   - If Strike 3 (3rd attempt) → escalate to Layer 2\n\n---\n\n## Trace Up ↑\n\nWhen errors persist, trace to design layer:\n\n```\nE0382 (moved value)\n    ↑ Ask: What design choice led to this ownership pattern?\n    ↑ Check: m09-domain (is this Entity or Value Object?)\n    ↑ Check: domain-* (what constraints apply?)\n```\n\n| Persistent Error | Trace To | Question |\n|-----------------|----------|----------|\n| E0382 repeated | m02-resource | Should use Arc\u002FRc for sharing? |\n| E0597 repeated | m09-domain | Is scope boundary at right place? |\n| E0506\u002FE0507 | m03-mutability | Should use interior mutability? |\n\n---\n\n## Trace Down ↓\n\nFrom design decisions to implementation:\n\n```\n\"Data needs to be shared immutably\"\n    ↓ Use: Arc\u003CT> (multi-thread) or Rc\u003CT> (single-thread)\n\n\"Data needs exclusive ownership\"\n    ↓ Use: move semantics, take ownership\n\n\"Data is read-only view\"\n    ↓ Use: &T (immutable borrow)\n```\n\n---\n\n## Quick Reference\n\n| Pattern | Ownership | Cost | Use When |\n|---------|-----------|------|----------|\n| Move | Transfer | Zero | Caller doesn't need data |\n| `&T` | Borrow | Zero | Read-only access |\n| `&mut T` | Exclusive borrow | Zero | Need to modify |\n| `clone()` | Duplicate | Alloc + copy | Actually need a copy |\n| `Rc\u003CT>` | Shared (single) | Ref count | Single-thread sharing |\n| `Arc\u003CT>` | Shared (multi) | Atomic ref count | Multi-thread sharing |\n| `Cow\u003CT>` | Clone-on-write | Alloc if mutated | Might modify |\n\n## Error Code Reference\n\n| Error | Cause | Quick Fix |\n|-------|-------|-----------|\n| E0382 | Value moved | Clone, reference, or redesign ownership |\n| E0597 | Reference outlives owner | Extend owner scope or restructure |\n| E0506 | Assign while borrowed | End borrow before mutation |\n| E0507 | Move out of borrowed | Clone or use reference |\n| E0515 | Return local reference | Return owned value |\n| E0716 | Temporary dropped | Bind to variable |\n| E0106 | Missing lifetime | Add `'a` annotation |\n\n---\n\n## Anti-Patterns\n\n| Anti-Pattern | Why Bad | Better |\n|--------------|---------|--------|\n| `.clone()` everywhere | Hides design issues | Design ownership properly |\n| Fight borrow checker | Increases complexity | Work with the compiler |\n| `'static` for everything | Restricts flexibility | Use appropriate lifetimes |\n| Leak with `Box::leak` | Memory leak | Proper lifetime design |\n\n---\n\n## Related Skills\n\n| When | See |\n|------|-----|\n| Need smart pointers | m02-resource |\n| Need interior mutability | m03-mutability |\n| Data is domain entity | m09-domain |\n| Learning ownership concepts | m14-mental-model |\n",{"name":5,"description":7,"user-invocable":19},"main","0f3f41ed51c357d4f79561a132514089c1aaa97d",".agents\u002Fskills\u002Fm01-ownership",0,"https:\u002F\u002Fgithub.com\u002Fwxxb789\u002Fmarkturbo","https:\u002F\u002Fgithub.com\u002Fwxxb789","2026-11-15 04:06:53",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add wxxb789\u002Fmarkturbo --skill m01-ownership",{"tool":36,"command":37},"bunx","bunx skills add wxxb789\u002Fmarkturbo --skill m01-ownership",{"tool":39,"command":40},"pnpm","pnpm dlx skills add wxxb789\u002Fmarkturbo --skill m01-ownership","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fwxxb789\u002Fmarkturbo\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fm01-ownership\u002FSKILL.md",true,[44,50,54,58],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"comparison.md","REFERENCE","参考文档",5712,"https:\u002F\u002Fgithub.com\u002Fwxxb789\u002Fmarkturbo\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fm01-ownership\u002Fcomparison.md",{"path":51,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":52,"sourceHtmlUrl":53},"examples\u002Fbest-practices.md",6681,"https:\u002F\u002Fgithub.com\u002Fwxxb789\u002Fmarkturbo\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fm01-ownership\u002Fexamples\u002Fbest-practices.md",{"path":55,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":56,"sourceHtmlUrl":57},"patterns\u002Fcommon-errors.md",5024,"https:\u002F\u002Fgithub.com\u002Fwxxb789\u002Fmarkturbo\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fm01-ownership\u002Fpatterns\u002Fcommon-errors.md",{"path":59,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":60,"sourceHtmlUrl":61},"patterns\u002Flifetime-patterns.md",4508,"https:\u002F\u002Fgithub.com\u002Fwxxb789\u002Fmarkturbo\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fm01-ownership\u002Fpatterns\u002Flifetime-patterns.md",[63,70,76,83,90,96],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M7AWXVVZ6JEJVFGGT2WBSEN0","hello-diagrams","A valid, fully-populated Agent Skill, shown here so the Skills inspector has something correct to display.","https:\u002F\u002Fgithub.com\u002Fwxxb789\u002Fmarkturbo\u002Fblob\u002Fmain\u002Fsample\u002F.claude\u002Fskills\u002Fhello-diagrams\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M7AWXTNG6ZV6WW5CHJZXJYEC","Broken-Example","https:\u002F\u002Fgithub.com\u002Fwxxb789\u002Fmarkturbo\u002Fblob\u002Fmain\u002Fsample\u002F.claude\u002Fskills\u002Fbroken-example\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":18},"01M7AWXS5WN306ENF2MYJYP7VM","valid-skill","A fully conformant skill with every optional field populated.","https:\u002F\u002Fgithub.com\u002Fwxxb789\u002Fmarkturbo\u002Fblob\u002Fmain\u002Ffixtures\u002Fskills\u002Fskills\u002Fvalid-skill\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":18},"01M7AWXR0NY08YVHE0G8VTJJ97","a-different-name","The name does not match the directory, which is a conformance warning.","https:\u002F\u002Fgithub.com\u002Fwxxb789\u002Fmarkturbo\u002Fblob\u002Fmain\u002Ffixtures\u002Fskills\u002Fskills\u002Fname-mismatch\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":18},"01M7AWXQ5EV9JCA0WG9Q1WB13Y","missing-metadata","https:\u002F\u002Fgithub.com\u002Fwxxb789\u002Fmarkturbo\u002Fblob\u002Fmain\u002Ffixtures\u002Fskills\u002Fskills\u002Fmissing-metadata\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":18},"01M7AWXP8GT7FATM53B914ZN50","malformed-yaml","https:\u002F\u002Fgithub.com\u002Fwxxb789\u002Fmarkturbo\u002Fblob\u002Fmain\u002Ffixtures\u002Fskills\u002Fskills\u002Fmalformed-yaml\u002FSKILL.md",[],[]]