{"id":"b15b160f-30cb-4b12-83c3-b5b3ca20864b","shortId":"PTNgVW","kind":"skill","title":"storage","tagline":"Storage management for Zephyr RTOS. Covers Non-Volatile Storage (NVS) for persistent settings, flash partition management in Devicetree, and runtime flash layout access. Trigger when implementing persistent data storage, managing flash wear leveling, or configuring device partiti","description":"# Zephyr Storage\n\nImplement reliable persistent data handling using Zephyr's storage subsystem and flash management utilities.\n\n## Core Workflows\n\n### 1. NVS Storage\nUtilize Non-Volatile Storage (NVS) for efficient, wear-leveled data persistence.\n- **Reference**: **[nvs_storage.md](references/nvs_storage.md)**\n- **Key Tools**: `nvs_mount()`, `nvs_read()`, `nvs_write()`.\n\n### 2. Flash Management\nConfigure and manage flash partitions and hardware page layouts.\n- **Reference**: **[flash_management.md](references/flash_management.md)**\n- **Key Tools**: `fixed-partitions`, `FLASH_MAP`, `flash_get_page_info_by_offs()`.\n\n## Quick Start (NVS Write)\n```c\n#include <zephyr/storage/nvs/nvs.h>\n\nvoid save_data(struct nvs_fs *fs, uint16_t id, void *data, size_t len) {\n    nvs_write(fs, id, data, len);\n}\n```\n\n## Professional Patterns (Reliability)\n- **Settings Integration**: Use NVS as the backend for the `settings` subsystem for a standard key-value configuration experience.\n- **Collision Prevention**: Define NVS Entry IDs in a centralized header file to prevent accidental overwrites across modules.\n- **Runtime Layout Checks**: Always query the flash controller for page sizes (`flash_get_page_layout`) rather than assuming hardcoded sector sizes.\n\n## Automation Tools\n- **[nvs_id_lint.py](scripts/nvs_id_lint.py)**: Detect duplicate `NVS_ID_*` macro values across source/header files.\n\n## Examples & Templates\n- **[partition_overlay_template.overlay](assets/partition_overlay_template.overlay)**: Starter fixed-partitions overlay for app + storage.\n\n## Validation Checklist\n- [ ] `nvs_mount()` succeeds on boot for the configured storage partition.\n- [ ] Written values survive reset and read back with matching length and content.\n- [ ] Partition layout in DTS matches runtime flash-map queries.\n- [ ] Repeated write cycles do not produce mount/read corruption errors.\n\n## Resources\n\n- **[References](references/)**:\n  - `nvs_storage.md`: Using NVS for data blobs and integers.\n  - `flash_management.md`: Devicetree partitions and page information.\n- **[Scripts](scripts/)**:\n  - `nvs_id_lint.py`: Duplicate ID detector for NVS namespaces.\n- **[Assets](assets/)**:\n  - `partition_overlay_template.overlay`: Flash partitioning template.","tags":["storage","zephyr","agent","skills","beriberikix","agent-skills","agentic-coding","zephyr-rtos"],"capabilities":["skill","source-beriberikix","skill-storage","topic-agent-skills","topic-agentic-coding","topic-zephyr-rtos"],"categories":["zephyr-agent-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/beriberikix/zephyr-agent-skills/storage","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add beriberikix/zephyr-agent-skills","source_repo":"https://github.com/beriberikix/zephyr-agent-skills","install_from":"skills.sh"}},"qualityScore":"0.462","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 25 github stars · SKILL.md body (2,240 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-24T07:01:42.913Z","embedding":null,"createdAt":"2026-04-18T23:05:02.962Z","updatedAt":"2026-04-24T07:01:42.913Z","lastSeenAt":"2026-04-24T07:01:42.913Z","tsv":"'1':58 '2':85 'access':25 'accident':176 'across':178,211 'alway':183 'app':224 'asset':295,296 'assets/partition_overlay_template.overlay':217 'assum':197 'autom':201 'back':244 'backend':150 'blob':277 'boot':232 'c':117 'central':171 'check':182 'checklist':227 'collis':163 'configur':37,88,161,235 'content':249 'control':187 'core':56 'corrupt':267 'cover':7 'cycl':262 'data':30,45,72,122,131,139,276 'defin':165 'detect':205 'detector':291 'devic':38 'devicetre':20,281 'dts':253 'duplic':206,289 'effici':68 'entri':167 'error':268 'exampl':214 'experi':162 'file':173,213 'fix':103,220 'fixed-partit':102,219 'flash':16,23,33,53,86,91,105,107,186,191,257,298 'flash-map':256 'flash_management.md':98,280 'fs':125,126,137 'get':108,192 'handl':46 'hardcod':198 'hardwar':94 'header':172 'id':129,138,168,208,290 'implement':28,42 'includ':118 'info':110 'inform':285 'integ':279 'integr':145 'key':77,100,159 'key-valu':158 'layout':24,96,181,194,251 'len':134,140 'length':247 'level':35,71 'macro':209 'manag':3,18,32,54,87,90 'map':106,258 'match':246,254 'modul':179 'mount':80,229 'mount/read':266 'namespac':294 'non':9,63 'non-volatil':8,62 'nvs':12,59,66,79,81,83,115,124,135,147,166,207,228,274,293 'nvs_id_lint.py':203,288 'nvs_storage.md':75,272 'off':112 'overlay':222 'overwrit':177 'page':95,109,189,193,284 'partit':17,92,104,221,237,250,282,299 'partiti':39 'partition_overlay_template.overlay':216,297 'pattern':142 'persist':14,29,44,73 'prevent':164,175 'produc':265 'profession':141 'queri':184,259 'quick':113 'rather':195 'read':82,243 'refer':74,97,270,271 'references/flash_management.md':99 'references/nvs_storage.md':76 'reliabl':43,143 'repeat':260 'reset':241 'resourc':269 'rtos':6 'runtim':22,180,255 'save':121 'script':286,287 'scripts/nvs_id_lint.py':204 'sector':199 'set':15,144,153 'size':132,190,200 'skill' 'skill-storage' 'source-beriberikix' 'source/header':212 'standard':157 'start':114 'starter':218 'storag':1,2,11,31,41,50,60,65,225,236 'struct':123 'subsystem':51,154 'succeed':230 'surviv':240 'templat':215,300 'tool':78,101,202 'topic-agent-skills' 'topic-agentic-coding' 'topic-zephyr-rtos' 'trigger':26 'uint16':127 'use':47,146,273 'util':55,61 'valid':226 'valu':160,210,239 'void':120,130 'volatil':10,64 'wear':34,70 'wear-level':69 'workflow':57 'write':84,116,136,261 'written':238 'zephyr':5,40,48 'zephyr/storage/nvs/nvs.h':119","prices":[{"id":"2d7d71bb-f424-4842-ad49-2cb7379342db","listingId":"b15b160f-30cb-4b12-83c3-b5b3ca20864b","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"beriberikix","category":"zephyr-agent-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T23:05:02.962Z"}],"sources":[{"listingId":"b15b160f-30cb-4b12-83c3-b5b3ca20864b","source":"github","sourceId":"beriberikix/zephyr-agent-skills/storage","sourceUrl":"https://github.com/beriberikix/zephyr-agent-skills/tree/main/skills/storage","isPrimary":false,"firstSeenAt":"2026-04-18T23:05:02.962Z","lastSeenAt":"2026-04-24T07:01:42.913Z"}],"details":{"listingId":"b15b160f-30cb-4b12-83c3-b5b3ca20864b","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"beriberikix","slug":"storage","github":{"repo":"beriberikix/zephyr-agent-skills","stars":25,"topics":["agent-skills","agentic-coding","zephyr-rtos"],"license":"apache-2.0","html_url":"https://github.com/beriberikix/zephyr-agent-skills","pushed_at":"2026-04-20T21:40:18Z","description":"A complete catalog of Agent Skills (agentskills.io) for Zephyr RTOS development.","skill_md_sha":"7fc358eec021fd1c97d0e03303dffad6f56ab64f","skill_md_path":"skills/storage/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/beriberikix/zephyr-agent-skills/tree/main/skills/storage"},"layout":"multi","source":"github","category":"zephyr-agent-skills","frontmatter":{"name":"storage","description":"Storage management for Zephyr RTOS. Covers Non-Volatile Storage (NVS) for persistent settings, flash partition management in Devicetree, and runtime flash layout access. Trigger when implementing persistent data storage, managing flash wear leveling, or configuring device partitions."},"skills_sh_url":"https://skills.sh/beriberikix/zephyr-agent-skills/storage"},"updatedAt":"2026-04-24T07:01:42.913Z"}}