[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6P3ST45ZT99MRQ2KQV010YD":3,"skill-same:01M6P3ST45ZT99MRQ2KQV010YD":71},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":14,"categories":15,"keywords":16,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":12,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M6P3ST45ZT99MRQ2KQV010YD","flutter-network-dio",null,"dexter-cnx\u002Fagent-engineering-toolkit","dexter-cnx","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F73522389?v=4","01M6K09WYAAXJXMR26H00WJ2AT","01M6P370Z0XCZ7NC67MJ2MRW94",0,"MIT","https:\u002F\u002Fgithub.com\u002Fdexter-cnx\u002Fagent-engineering-toolkit\u002Fblob\u002Fmain\u002Foverlays\u002Fmobile-flutter\u002Fskills\u002Fflutter-network-dio\u002FSKILL.md",[],[17,18,19],"network","flutter","flutter network dio","2026-11-10 10:12:30",false,"# flutter-network-dio\n\n## Purpose\nDesign and implement a governed Dio HTTP boundary for a Flutter app so that transport,\nauth headers, retry policy, DTO mapping, and error handling stay behind a typed network layer.\n\n## Use when\n- The app needs a reusable Dio client with interceptors, auth headers, retry logic, and error mapping\n- Network code should stay out of widgets and presentation state\n- The change needs to preserve clean-architecture boundaries\n- You need a typed boundary that can be reviewed, tested, and promoted safely\n\n## Do NOT use when\n- The task is only adding one-off ad hoc HTTP calls in a prototype\n- The app does not use Dio and should keep its current networking stack\n- The request is purely about UI rendering, routing, or state management without network boundary changes\n- You need a backend API redesign instead of a Flutter client boundary update\n\n## Inputs required\n- Current Dio setup file path or the file that will own the HTTP boundary\n- Auth source for access tokens or session credentials\n- Retry and timeout requirements\n- DTO or API contract shape that the client must decode\n- Error mapping rules for transport and server failures\n\n## Constraints\n- Keep interceptors, auth headers, and retry policy inside the HTTP boundary\n- Keep DTO parsing and error mapping typed\n- Avoid calling Dio directly from widgets or view models\n- Avoid hardcoding environment-specific URLs inside UI code\n- Preserve existing clean-architecture layer boundaries\n\n## Step-by-step workflow\n1. Locate the current network entry point and identify the file that should own the Dio client.\n2. Define the base URL, timeout, auth header strategy, retry strategy, and logging policy.\n3. Implement or update the Dio client so interceptors attach auth headers before requests are sent.\n4. Add typed DTO parsing and map transport or server failures to a typed domain error.\n5. Keep repository or datasource code as the only consumer of the Dio client.\n6. Add or update tests for success, unauthorized, timeout, and error-mapping cases.\n7. Run Flutter analysis and the relevant tests before any promotion or handoff.\n\n## Output contract\n- A Dio client factory or provider in the network layer\n- Typed request\u002Fresponse mapping for the API boundary\n- Auth and retry interceptors kept behind the boundary\n- Typed error mapping for transport and server failures\n- Tests that cover the critical boundary behavior\n\n## Validation checklist\n- Run `flutter analyze` and confirm there are no dependency or boundary violations\n- Run the targeted Flutter tests for the network boundary and confirm they pass\n- Grep the presentation layer for direct `Dio()` usage and confirm it is absent\n- Confirm the auth header is attached by the network layer and not by widgets\n- Inspect the error mapping and confirm network failures become typed failures\n\n## Related skills\n- `policy-clean-architecture`\n- `policy-no-business-logic-in-widget`\n- `policy-testing-minimum`\n\n## References\n- [`..\u002F..\u002Fexamples\u002Fflutter_deeplink_full_cycle.md`](..\u002F..\u002Fexamples\u002Fflutter_deeplink_full_cycle.md)\n- [`..\u002F..\u002F..\u002Fdocs\u002Fkarpathy-guide.md`](..\u002F..\u002F..\u002Fdocs\u002Fkarpathy-guide.md)\n- [`prompts\u002Fgovernance-prompt.md`](prompts\u002Fgovernance-prompt.md)\n- [`eval\u002Fcases\u002Fgovernance-smoke\u002FREADME.md`](eval\u002Fcases\u002Fgovernance-smoke\u002FREADME.md)\n- [`skill.contract.yaml`](skill.contract.yaml)\n\n## Real example\nA Flutter app uses a `DioClient` provider in the data layer. The provider injects a base URL,\nadds an auth interceptor that reads the current token, retries idempotent requests once on\ntransient network errors, and maps `401` responses to a typed `UnauthorizedFailure`.\n\n## Real file output sample\n```text\nlib\u002Fcore\u002Fnetwork\u002Fdio_client.dart\nlib\u002Fcore\u002Fnetwork\u002Fdio_interceptors.dart\nlib\u002Fcore\u002Fnetwork\u002Fapi_failure.dart\nlib\u002Ffeatures\u002Forders\u002Fdata\u002Forders_remote_data_source.dart\ntest\u002Fcore\u002Fnetwork\u002Fdio_client_test.dart\n```\n",{},"main","3035171e2986d5fdb445e694b9013fbdf58b3ff6","overlays\u002Fmobile-flutter\u002Fskills\u002Fflutter-network-dio","https:\u002F\u002Fgithub.com\u002Fdexter-cnx\u002Fagent-engineering-toolkit","https:\u002F\u002Fgithub.com\u002Fdexter-cnx","https:\u002F\u002Fdexter-cnx.github.io\u002Fportfolio\u002F","2026-05-26 14:24:27",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add dexter-cnx\u002Fagent-engineering-toolkit --skill flutter-network-dio",{"tool":37,"command":38},"bunx","bunx skills add dexter-cnx\u002Fagent-engineering-toolkit --skill flutter-network-dio",{"tool":40,"command":41},"pnpm","pnpm dlx skills add dexter-cnx\u002Fagent-engineering-toolkit --skill flutter-network-dio","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdexter-cnx\u002Fagent-engineering-toolkit\u002Fblob\u002Fmain\u002Foverlays\u002Fmobile-flutter\u002Fskills\u002Fflutter-network-dio\u002FSKILL.md",true,[45,51,55,59,63,67],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"eval\u002Fcases\u002Fgovernance-smoke\u002Fexpected_result.json","REFERENCE","参考文档",848,"https:\u002F\u002Fgithub.com\u002Fdexter-cnx\u002Fagent-engineering-toolkit\u002Fblob\u002Fmain\u002Foverlays\u002Fmobile-flutter\u002Fskills\u002Fflutter-network-dio\u002Feval\u002Fcases\u002Fgovernance-smoke\u002Fexpected_result.json",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"eval\u002Fcases\u002Fgovernance-smoke\u002FREADME.md",473,"https:\u002F\u002Fgithub.com\u002Fdexter-cnx\u002Fagent-engineering-toolkit\u002Fblob\u002Fmain\u002Foverlays\u002Fmobile-flutter\u002Fskills\u002Fflutter-network-dio\u002Feval\u002Fcases\u002Fgovernance-smoke\u002FREADME.md",{"path":56,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":57,"sourceHtmlUrl":58},"examples\u002Fgovernance-example.md",352,"https:\u002F\u002Fgithub.com\u002Fdexter-cnx\u002Fagent-engineering-toolkit\u002Fblob\u002Fmain\u002Foverlays\u002Fmobile-flutter\u002Fskills\u002Fflutter-network-dio\u002Fexamples\u002Fgovernance-example.md",{"path":60,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":61,"sourceHtmlUrl":62},"prompts\u002Fgovernance-prompt.md",517,"https:\u002F\u002Fgithub.com\u002Fdexter-cnx\u002Fagent-engineering-toolkit\u002Fblob\u002Fmain\u002Foverlays\u002Fmobile-flutter\u002Fskills\u002Fflutter-network-dio\u002Fprompts\u002Fgovernance-prompt.md",{"path":64,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":65,"sourceHtmlUrl":66},"README.md",96,"https:\u002F\u002Fgithub.com\u002Fdexter-cnx\u002Fagent-engineering-toolkit\u002Fblob\u002Fmain\u002Foverlays\u002Fmobile-flutter\u002Fskills\u002Fflutter-network-dio\u002FREADME.md",{"path":68,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":69,"sourceHtmlUrl":70},"skill.contract.yaml",443,"https:\u002F\u002Fgithub.com\u002Fdexter-cnx\u002Fagent-engineering-toolkit\u002Fblob\u002Fmain\u002Foverlays\u002Fmobile-flutter\u002Fskills\u002Fflutter-network-dio\u002Fskill.contract.yaml",[72,98,118,127,139,151],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":20},"01M6P4P9S9017DTSFMRKGA7XW2","toolkit-i18n-operator","Use the toolkit-i18n CLI for repeated Flutter localization workflows with compact outputs, CSV validation, key coverage reporting, generated JSON exports, and safe non-mutating behavior.","https:\u002F\u002Fgithub.com\u002Fdexter-cnx\u002Fagent-engineering-toolkit\u002Fblob\u002Fmain\u002Ftools\u002Ftoolkit-i18n\u002Fskills\u002Ftoolkit-i18n-operator\u002FSKILL.md",[],[79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,18,94,95,96,97],"toolkit i18n operator","i18n","operator","toolkit","flutter localization","cli","safe","workflows","for","validation","with","csv","compact","reporting","json","behavior","coverage","generated","use",{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":114,"publishedAt":20},"01M6P4NREKE3P0XYV3RBBWC987","toolkit-design-operator","Use the toolkit-design CLI for repeated repository workflows.","https:\u002F\u002Fgithub.com\u002Fdexter-cnx\u002Fagent-engineering-toolkit\u002Fblob\u002Fmain\u002Ftools\u002Ftoolkit-design\u002Fskills\u002Ftoolkit-design-operator\u002FSKILL.md",[104,109],{"categoryNo":105,"categoryName":106,"taxonomyType":107,"taxonomyTypeDesc":108},"01JBSEEDCAT000000000000015","视觉设计","SCENARIO","使用场景",{"categoryNo":110,"categoryName":111,"taxonomyType":112,"taxonomyTypeDesc":113},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[115,81,82,116,87,84,86,117,97],"toolkit design operator","design","repository",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":20},"01M6P4NNSQ09QFPYG2PMPWEA94","toolkit-ci-operator","Use the toolkit-ci CLI for repeated repository workflows.","https:\u002F\u002Fgithub.com\u002Fdexter-cnx\u002Fagent-engineering-toolkit\u002Fblob\u002Fmain\u002Ftools\u002Ftoolkit-ci\u002Fskills\u002Ftoolkit-ci-operator\u002FSKILL.md",[],[125,126,81,82,117,84,86,97,87],"toolkit ci operator","ci",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":20},"01M6P4NK636991P6WWQ6X8HDYX","toolkit-arch-operator","Use the toolkit-arch CLI for repeated repository workflows, including Flutter i18n usage scans, layer checks, and localization coverage.","https:\u002F\u002Fgithub.com\u002Fdexter-cnx\u002Fagent-engineering-toolkit\u002Fblob\u002Fmain\u002Ftools\u002Ftoolkit-arch\u002Fskills\u002Ftoolkit-arch-operator\u002FSKILL.md",[],[134,135,82,81,80,136,137,87,97,95,18,138,117,86,84],"toolkit arch operator","arch","usage","layer","localization",{"skillNo":140,"name":141,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":147,"publishedAt":20},"01M6P4NF18XGVSG2NR01E1DX0R","web-testing","https:\u002F\u002Fgithub.com\u002Fdexter-cnx\u002Fagent-engineering-toolkit\u002Fblob\u002Fmain\u002Foverlays\u002Fweb-frontend\u002Fskills\u002Fweb-testing\u002Fskill.md",[144],{"categoryNo":145,"categoryName":146,"taxonomyType":107,"taxonomyTypeDesc":108},"01JBSEEDCAT000000000000008","测试与质量",[148,149,150],"web testing","web","testing",{"skillNo":152,"name":153,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":20},"01M6P4MVK07EJ75FQTFN54AGPM","web-state","https:\u002F\u002Fgithub.com\u002Fdexter-cnx\u002Fagent-engineering-toolkit\u002Fblob\u002Fmain\u002Foverlays\u002Fweb-frontend\u002Fskills\u002Fweb-state\u002Fskill.md",[],[149,157,158],"state","web state"]