[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F338XH0KVHWTT5XYTY5DDB":3,"skill-same:01M7F338XH0KVHWTT5XYTY5DDB":45},{"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":28,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7F338XH0KVHWTT5XYTY5DDB","naizo",null,"Build and update self-persisting interactive HTML applications (dashboards, interactive studios, personal trackers, design option labs, calculators, visual canvases, engineering notebooks, plans, specs, checklists, triage boards, and custom micro-tools) using naizo.js and its built-in #naizodb JSON database. Activate whenever generating an interactive HTML application or inspecting\u002Fediting an existing HTML file that uses \u003Cscript id=\"naizodb\" type=\"application\u002Fjson\"> or naizo \u002F data-naizo attributes.","nickosh\u002Fnaizo","nickosh","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F47059645?v=4","01M7F32Y2ANPX7G8YB2RS46YZM","01M7F32Y318379N8SXGBXXGS9X",1,"MIT","https:\u002F\u002Fgithub.com\u002Fnickosh\u002Fnaizo\u002Fblob\u002Fmain\u002Fskills\u002Fnaizo\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: naizo\nlicense: MIT\ndescription: 'Build and update self-persisting interactive HTML applications (dashboards, interactive studios, personal trackers, design option labs, calculators, visual canvases, engineering notebooks, plans, specs, checklists, triage boards, and custom micro-tools) using naizo.js and its built-in #naizodb JSON database. Activate whenever generating an interactive HTML application or inspecting\u002Fediting an existing HTML file that uses \u003Cscript id=\"naizodb\" type=\"application\u002Fjson\"> or naizo \u002F data-naizo attributes.'\n---\n\n# Naizo (`naizo.js`) — Self-Persisting HTML & AI Agent Co-Editing Skill\n\nUse **`naizo.js`** (npm package `naizojs`) to turn any single `.html` file into a living, self-persisting application whose state syncs between the browser DOM, `localStorage`, and `\u003Cscript id=\"naizodb\" type=\"application\u002Fjson\">` on disk.\n\nIn Japanese, **_naizō_ (ないぞう)** means both **内蔵 (_built-in \u002F housed within_)** and **内臓 (_internal organs_)**: `\u003Cscript id=\"naizodb\">` is the built-in JSON database inside `\u003Chead>`, and `naizo.js` provides the reactive internal organs that bind inputs, repeat lists, and sync human browser edits with AI agent disk edits.\n\n---\n\n## 1. Golden Rules for AI Agents (Never Violate)\n\n1. **`\u003Cbody>` is the template; `\u003Cscript id=\"naizodb\">` is the canonical data:**\n   - When linked to a local file via the File System Access API (`⌘S` \u002F `Ctrl+S` or `Link Disk`), `naizo.js` surgically rewrites **only** the `\u003Cscript id=\"naizodb\">...\u003C\u002Fscript>` block on disk (`D16`). It does **not** rewrite `\u003Cbody>` markup on disk during normal saves.\n   - **To read human edits from disk:** Always parse `\u003Cscript id=\"naizodb\" type=\"application\u002Fjson\">` in `\u003Chead>`. Never scrape `\u003Cbody>` input `value` or `checked` attributes to read current state.\n   - **To update data on disk:** Modify the JSON inside `\u003Cscript id=\"naizodb\">` (formatted with 2-space indentation and `\u003C` escaped as `\\u003c`). If the user has the file open and linked in their browser, `naizo.js` detects `file.lastModified` within ~2 seconds and merges your changes into the live page without clobbering `document.activeElement`.\n   - **To update the UI or layout:** Edit the HTML\u002FCSS inside `\u003Cbody>` (and add matching initial keys to `#naizodb` if needed).\n2. **Preserve pass-through keys (`D15`, `EC14`):**\n   - `naizo.js` maintains an in-memory `NaizoDatabase` store and maps each rendered `[naizo-item]` DOM row to its source object via a `WeakMap`.\n   - Unbound keys in `fields`, unbound arrays in `lists`, and extra properties on list item objects (such as `\"id\"`, `\"estimate\"`, `\"updatedAt\"`, or custom per-card dictionary keys) pass through untouched. When editing `#naizodb` on disk, always preserve existing keys you did not intend to remove.\n3. **Explicit binding only (`D08`, `D12`, `EC11`, `EC49`):**\n   - Bind elements exclusively with `naizo=\"key\"` or `data-naizo=\"key\"`. Unannotated inputs (like search bars or filter dropdowns) are never implicitly captured, and `id` or `name` attributes are never used as fallback binding keys.\n4. **Wrap `\u003Clabel>` around inputs inside `[naizo-item]` (`EC39`):**\n   - Never use `\u003Clabel for=\"some-id\">` + `\u003Cinput id=\"some-id\">` inside a repeating `[naizo-item]`, because cloned rows would share duplicate DOM `id` attributes. Always wrap `\u003Clabel>` directly around the control (`\u003Clabel>\u003Cinput type=\"checkbox\" naizo=\"done\" \u002F>\u003Cspan>Done\u003C\u002Fspan>\u003C\u002Flabel>`).\n5. **Scope documents with `\u003Chtml naizo-id=\"...\">` (`D13`, `EC11`):**\n   - Add a descriptive `naizo-id=\"project-artifact-slug\"` on `\u003Chtml>` (or `\"_meta\": { \"id\": \"...\" }`) so `localStorage` caches and IndexedDB file handles never collide when multiple HTML tools are opened on `localhost` or `file:\u002F\u002F`.\n6. **Never filter `[naizo-item]` rows by removing them from the DOM (`D43`):**\n   - Removing a `[naizo-item]` node deletes its object from `db.lists`. For search or category filtering, toggle `row.hidden = !matches` (or CSS `display: none`).\n\n---\n\n## 2. Core HTML Structure & `#naizodb` Schema\n\nEvery `naizo.js` HTML document embeds `\u003Cscript id=\"naizodb\" type=\"application\u002Fjson\">` at the top of `\u003Chead>` followed by `naizo.js`:\n\n```html\n\u003C!doctype html>\n\u003Chtml lang=\"en\" naizo-id=\"my-artifact-id\">\n  \u003Chead>\n    \u003Cmeta charset=\"UTF-8\" \u002F>\n    \u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" \u002F>\n    \u003Ctitle>Artifact Title\u003C\u002Ftitle>\n\n    \u003C!-- 1. Canonical #naizodb JSON state (2-space indented, '\u003C' escaped as \\u003c) -->\n    \u003Cscript id=\"naizodb\" type=\"application\u002Fjson\">\n      {\n        \"_meta\": {\n          \"id\": \"my-artifact-id\"\n        },\n        \"fields\": {\n          \"title\": \"Artifact Title\",\n          \"owner\": \"Alex\",\n          \"status\": \"Draft\"\n        },\n        \"lists\": {\n          \"tasks\": [\n            {\n              \"id\": \"task-1\",\n              \"done\": false,\n              \"task\": \"First action item\",\n              \"priority\": \"High\"\n            }\n          ]\n        },\n        \"custom\": {}\n      }\n    \u003C\u002Fscript>\n\n    \u003C!-- 2. Load naizo.js via npm CDN (jsDelivr or unpkg) or local .\u002Fdist\u002Fnaizo.js -->\n    \u003Cscript src=\"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fnaizojs@latest\u002Fdist\u002Fnaizo.js\" defer>\u003C\u002Fscript>\n  \u003C\u002Fhead>\n  \u003Cbody>\n    \u003C!-- 3. Declarative bindings in \u003Cbody> -->\n  \u003C\u002Fbody>\n\u003C\u002Fhtml>\n```\n\n### CDN & Local Script Options (`D17`, `D34`, `D39`)\n\n- **jsDelivr (readable):** `https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fnaizojs@latest\u002Fdist\u002Fnaizo.js`\n- **jsDelivr (minified, ~15.7 KB gzipped):** `https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fnaizojs@latest\u002Fdist\u002Fnaizo.min.js`\n- **unpkg:** `https:\u002F\u002Funpkg.com\u002Fnaizojs@latest\u002Fdist\u002Fnaizo.js`\n- **Pinned version:** replace `@latest` with a specific published version tag\n- **Local \u002F offline:** `\u003Cscript src=\".\u002Fdist\u002Fnaizo.js\" defer>\u003C\u002Fscript>` (inside the `naizo` repository examples, use `..\u002Fdist\u002Fnaizo.js`)\n- **Experimental \u002F in-development (`main` branch `dist\u002Fnaizo.js`):** `https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002Fnickosh\u002Fnaizo@main\u002Fdist\u002Fnaizo.js` (unreleased; pair with the `@main` skill below)\n\n---\n\n## 3. Declarative HTML Attributes (`naizo` \u002F `data-naizo`)\n\nBoth short `naizo` \u002F `naizo-*` attributes and HTML5 `data-naizo` \u002F `data-naizo-*` aliases are supported everywhere (`D08`):\n\n| Short Attribute                     | HTML5 `data-*` Alias                     | Placement                                                                                              | Behavior                                                                                                                                        |\n| ----------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |\n| `naizo=\"key\"`                       | `data-naizo=\"key\"`                       | `\u003Cinput>`, `\u003Ctextarea>`, `\u003Cselect>`, `\u003Cdetails>`, `[contenteditable]`, leaf element, or `[naizo-item]` | Binds to `db.fields[\"key\"]` when standalone, or to `item[\"key\"]` when inside or on a `[naizo-item]`.                                            |\n| `naizo-list=\"name\"`                 | `data-naizo-list=\"name\"`                 | Container (`\u003Cdiv>`, `\u003Cul>`, `\u003Col>`, `\u003Ctbody>`, `\u003Ctable>`)                                              | Binds direct `[naizo-item]` children to `db.lists[\"name\"]` and injects `+ Add Item` below the list unless `naizo-no-controls` is present.       |\n| `naizo-item`                        | `data-naizo-item`                        | Direct child of `[naizo-list]` (`\u003Cdiv>`, `\u003Cli>`, `\u003Ctr>`, etc.)                                         | Marks a repeating row\u002Fcard; injects hover `↑` `↓` `×` toolbar unless `naizo-no-controls` is set on the list.                                    |\n| `naizo-template`                    | `data-naizo-template`                    | Direct child `\u003Ctemplate>` inside `[naizo-list]`                                                        | Optional explicit blueprint for new items. If omitted, `naizo.js` auto-infers `data-naizo-auto-template=\"true\"` from the first `[naizo-item]`.  |\n| `naizo-add=\"name\"`                  | `data-naizo-add=\"name\"`                  | `\u003Cbutton>` (anywhere in document)                                                                      | Appends a new blank item to `[naizo-list=\"name\"]` and focuses its first text field (`EC31`).                                                    |\n| `naizo-remove`                      | `data-naizo-remove`                      | `\u003Cbutton>` inside `[naizo-item]`                                                                       | Deletes the enclosing `[naizo-item]` from DOM and `db.lists`.                                                                                   |\n| `naizo-move=\"up\\|down\"`             | `data-naizo-move=\"up\\|down\"`             | `\u003Cbutton>` inside `[naizo-item]`                                                                       | Moves the enclosing `[naizo-item]` up or down in DOM and `db.lists`.                                                                            |\n| `naizo-no-controls`                 | `data-naizo-no-controls`                 | `[naizo-list]`                                                                                         | Suppresses auto-injected `↑ ↓ ×` and `+ Add Item` buttons so you can use custom buttons or modals.                                              |\n| `naizo-ignore`                      | `data-naizo-ignore`                      | Any element                                                                                            | Excludes the element and its subtree from state binding while preserving it in auto-templates and exported HTML (`D12`, `EC07`).                |\n| `naizo-strip`                       | `data-naizo-strip`                       | Any element                                                                                            | Excludes the element and its subtree from state binding and strips it from auto-templates and `exportHTML()` \u002F `downloadHTML()` (`D12`, `D47`). |\n| `naizo-id=\"scope\"`                  | `data-naizo-id=\"scope\"`                  | `\u003Chtml>` or `\u003Cbody>`                                                                                   | Scopes `localStorage` and IndexedDB keys (`\u003Cpath>::\u003Cscope>`) to avoid collisions on `localhost`.                                                |\n| `naizo-mode=\"online\\|local\\|auto\"`  | `data-naizo-mode=\"online\\|local\\|auto\"`  | `\u003Chtml>` or `\u003Cbody>`                                                                                   | Overrides automatic Local Mode vs. Online Mode detection (`D41`, `EC48`).                                                                       |\n| `naizo-manual`                      | `data-naizo-manual`                      | `\u003Chtml>`, `\u003Cbody>`, or `\u003Cscript>`                                                                      | Disables automatic `initNaizo()` boot when loading the browser IIFE bundle.                                                                     |\n| `naizo-get=\"url\"`                   | `data-naizo-get=\"url\"`                   | `\u003Cbutton>`, `\u003Ca>`, or any element                                                                      | Fetches JSON or text via `GET` and routes `2xx` responses via `naizo-into` (or hydrates `#naizodb` when `naizo-into` is omitted, `D43`, `D51`). |\n| `naizo-post=\"url\"`                  | `data-naizo-post=\"url\"`                  | `\u003Cbutton>` or any element                                                                              | Flushes pending edits and sends a CORS-safelisted `text\u002Fplain;charset=UTF-8` JSON `POST` (fire-and-forget unless `naizo-into` is set, `D51`).   |\n| `naizo-into=\"target\"`               | `data-naizo-into=\"target\"`               | Element with `naizo-get` \u002F `naizo-post`                                                                | Routes response into `field:\u003Ckey>`, `list:\u003Cname>` (`Naizo.setList`), `custom:\u003Ckey>`, `db`, or DOM-only `#selector` (`textContent`, `D22`).      |\n| `naizo-path=\"a.b.0\"`                | `data-naizo-path=\"a.b.0\"`                | Element with `naizo-get` \u002F `naizo-post`                                                                | Extracts a nested property or array index from parsed JSON using `Object.hasOwn()` at each step (`EC24`, `EC50`).                               |\n| `naizo-body=\"source\"`               | `data-naizo-body=\"source\"`               | Element with `naizo-post`                                                                              | Selects outgoing `POST` payload: `db` (default), `fields`, `custom`, `list:\u003Cname>`, or `field:\u003Ckey>`.                                           |\n| `naizo-trigger=\"click\\|init\\|load\"` | `data-naizo-trigger=\"click\\|init\\|load\"` | Element with `naizo-get` \u002F `naizo-post`                                                                | Fires on `click` (default), `init` (boot only when target is empty), or `load` (every boot).                                                    |\n| `naizo-cors=\"no-cors\"`              | `data-naizo-cors=\"no-cors\"`              | Element with `naizo-post`                                                                              | Sends an opaque fire-and-forget webhook `POST` when `naizo-into` is omitted (`D43`).                                                            |\n\n### Scalar Element Coercion & Safety Rules (`D14`, `D22`, `EC12`, `EC15`, `EC18`, `EC21`, `EC25`)\n\n- **Text inputs & `\u003Ctextarea>`:** `string` (`.value`), preserving stored numbers\u002Fbooleans when the string representation is unchanged (`EC25`).\n- **`\u003Cinput type=\"number\">` & `\u003Cinput type=\"range\">`:** finite `number` or `null` when empty (`EC12`).\n- **`\u003Cinput type=\"checkbox\">`:** `boolean` (`.checked`), coercing `\"false\"`, `\"0\"`, `\"\"`, `\"no\"`, and `\"off\"` to `false` (`EC25`).\n- **`\u003Cinput type=\"radio\">`:** `string` value of the checked radio; inside `[naizo-item]`, radio `name` attributes are automatically scoped per row and restored on export (`EC13`).\n- **`\u003Cselect>` & `\u003Cselect multiple>`:** `string` or `string[]`. If `#naizodb` contains a value with no matching `\u003Coption>` yet, `naizo.js` logs a warning and preserves the stored value in memory instead of overwriting it with `\"\"` (`EC15`).\n- **`\u003Cdetails naizo=\"key\">`:** `boolean` (`open` state via capture-phase `toggle` listener, `EC12`).\n- **`[contenteditable]` (`\"\"`, `\"true\"`, `\"plaintext-only\"`):** plain text via `textContent` (`D22`, `EC18` — never `innerHTML`).\n- **Self-bound `[naizo-item]`:** `\u003Cli naizo-item contenteditable=\"true\" naizo=\"text\">` binds the item root directly while isolating `textContent` from injected `.naizo-item-tools` and `[naizo-ignore]` \u002F `[naizo-strip]` children (`D47`, `EC46`).\n- **Tables (`\u003Ctbody naizo-list>` \u002F `\u003Ctr naizo-item>`):** `.naizo-item-tools` is placed inside the last `\u003Ctd>`\u002F`\u003Cth>` of each row and `.naizo-list-footer` is placed immediately after `\u003Ctable>` (`EC13`).\n- **Skipped inputs (`EC21`):** `password`, `file`, `button`, `submit`, `reset`, and `image` are always skipped.\n\n---\n\n## 4. Programmatic API (`window.Naizo` \u002F `window.NaizoDB`) & Events\n\n```javascript\n\u002F\u002F 1. Custom JSON State (db.custom)\nconst activeId = Naizo.get('activeNoteId'); \u002F\u002F Omit key to get full NaizoDatabase\nNaizo.set('activeNoteId', 'note-102'); \u002F\u002F Validates finite JSON value (EC35)\nNaizo.delete('obsoleteKey');\n\n\u002F\u002F 2. Standalone Fields (db.fields)\nconst status = Naizo.getField('status');\nNaizo.setField('status', 'Approved'); \u002F\u002F Updates db.fields.status + all bound [naizo=\"status\"] DOM nodes\nNaizo.deleteField('legacyField'); \u002F\u002F Deletes key + clears bound DOM inputs\n\n\u002F\u002F 3. Lists (db.lists)\nconst items = Naizo.getList('tasks');\nNaizo.setList('tasks', [{ id: 't-1', done: false, task: 'Synced from API', priority: 'High' }]); \u002F\u002F Replaces or clears ([] ) list safely (M8.1)\nNaizo.addItem('tasks', { id: 't-2', done: false, task: 'New task', priority: 'Med' });\nNaizo.updateItem('tasks', 0, { done: true }); \u002F\u002F Shallow-merges into item 0, preserving extra keys\nNaizo.moveItem('tasks', 2, 0);\nNaizo.removeItem('tasks', 1);\n\n\u002F\u002F 4. Mini-API Client, Dynamic Subtrees, Persistence, Reset, & Export\nconst apiRes = await Naizo.fetch('https:\u002F\u002Fapi.example.com\u002Ftasks', {\n  method: 'GET', \u002F\u002F 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'\n  path: 'data.items',\n  into: 'list:tasks', \u002F\u002F 'field:\u003Ckey>' | 'list:\u003Cname>' | 'custom:\u003Ckey>' | 'db' | '#selector'\n}); \u002F\u002F Resolves { url, method, ok, status, target, data, error } without throwing\nNaizo.bind(containerEl); \u002F\u002F Hydrate dynamically inserted DOM from store\nconst ok = await Naizo.save(); \u002F\u002F Flush cache + await single-flight disk write (Promise\u003Cboolean>)\nNaizo.reset(); \u002F\u002F Back up dirty state to ↺ Restore and reset to initial boot baseline\nawait Naizo.unlink(); \u002F\u002F Forget linked FileSystemFileHandle\nconst json = await Naizo.copyJSON(); \u002F\u002F Copy 2-space #naizodb JSON to clipboard\nconst html = Naizo.exportHTML(); \u002F\u002F Clean HTML snapshot with baked attributes & stripped runtime UI\nconst dlHtml = Naizo.downloadHTML('app.html'); \u002F\u002F Download portable HTML with dist\u002Fnaizo.min.js CDN URL\n\n\u002F\u002F 5. Window Lifecycle & Mutation Events\nwindow.addEventListener('naizo:hydrate', (e) => {\n  \u002F\u002F Fired on boot, external disk merge, cross-tab storage sync, full-DB fetch, ↺ Restore, and ↺ Reset\n  console.log('Hydrated store:', e.detail);\n});\nwindow.addEventListener('naizo:change', (e) => {\n  \u002F\u002F e.detail: { scope: 'fields' | 'lists' | 'custom' | 'db' | 'reset' | 'restore', action?, list?, key?, index?, value?, db }\n  console.log('Changed:', e.detail);\n});\nwindow.addEventListener('naizo:item', (e) => {\n  \u002F\u002F e.detail: { list, item, data, index }\n  console.log('New list row:', e.detail);\n});\nwindow.addEventListener('naizo:fetch', (e) => {\n  \u002F\u002F e.detail: { url, method, ok, status, target, data, error }\n  console.log('API result:', e.detail);\n});\n```\n\n---\n\n## 5. Canonical Application Blueprints\n\nChoose the blueprint that best matches the user's request (full templates live in `examples\u002Fstarter.html`, `examples\u002Fchecklist.html`, `examples\u002Fnotes.html`, `examples\u002Finventory.html`, and `examples\u002Fweather.html` in the `naizo` repository):\n\n### Blueprint A: Project Spec & Milestones (`starter.html`) \u002F Release Checklist (`checklist.html`)\n\nUse for implementation plans, PR review checklists, bug triage sheets, and release sign-offs. Needs **zero custom JavaScript**:\n\n```html\n\u003Ch1 contenteditable=\"true\" naizo=\"checklist_title\">Pre-Release Verification Checklist\u003C\u002Fh1>\n\n\u003Csection class=\"card\">\n  \u003Cdiv class=\"meta-row\">\n    \u003Clabel>\n      Reviewer\n      \u003Cinput type=\"text\" naizo=\"reviewer\" value=\"Jordan\" \u002F>\n    \u003C\u002Flabel>\n    \u003Clabel>\n      Target Environment\n      \u003Cselect naizo=\"environment\">\n        \u003Coption value=\"Local\">Local\u003C\u002Foption>\n        \u003Coption value=\"Staging\" selected>Staging\u003C\u002Foption>\n        \u003Coption value=\"Production\">Production\u003C\u002Foption>\n      \u003C\u002Fselect>\n    \u003C\u002Flabel>\n    \u003Clabel class=\"ready-toggle\">\n      \u003Cinput type=\"checkbox\" naizo=\"ready_for_release\" \u002F>\n      \u003Cspan>Ready for Release\u003C\u002Fspan>\n    \u003C\u002Flabel>\n  \u003C\u002Fdiv>\n\u003C\u002Fsection>\n\n\u003Csection class=\"card\">\n  \u003Ch2>Verification Items\u003C\u002Fh2>\n  \u003Cdiv naizo-list=\"checks\">\n    \u003Cdiv class=\"check-row\" naizo-item>\n      \u003Clabel>\n        \u003Cinput type=\"checkbox\" naizo=\"done\" \u002F>\n        \u003Cspan class=\"sr-only\">Done\u003C\u002Fspan>\n      \u003C\u002Flabel>\n      \u003Clabel>\n        \u003Cspan class=\"sr-only\">Verification item\u003C\u002Fspan>\n        \u003Cinput type=\"text\" naizo=\"task\" placeholder=\"Add verification step...\" \u002F>\n      \u003C\u002Flabel>\n      \u003Clabel>\n        \u003Cspan class=\"sr-only\">Priority\u003C\u002Fspan>\n        \u003Cselect naizo=\"priority\">\n          \u003Coption value=\"High\">High\u003C\u002Foption>\n          \u003Coption value=\"Med\">Med\u003C\u002Foption>\n          \u003Coption value=\"Low\">Low\u003C\u002Foption>\n        \u003C\u002Fselect>\n      \u003C\u002Flabel>\n    \u003C\u002Fdiv>\n  \u003C\u002Fdiv>\n\u003C\u002Fsection>\n```\n\n### Blueprint B: Zero-DOM-Wipe Master–Detail Workspace (`notes.html`, `D40`)\n\nUse for multi-note engineering notebooks, ADR explorers, prompt libraries, or multi-document editors with a sidebar list and active editor pane.\n\n- **Key architectural rule:** Never wipe and copy note text into a single shared `\u003Ctextarea>`. Instead, render every note as a live `[naizo-item]` inside `\u003Cdiv naizo-list=\"notes\" naizo-no-controls>`, store the selected ID in `db.custom.activeNoteId`, and toggle `.is-active` (`display: flex` vs. `display: none`) on the matching `[naizo-item]` pane via CSS:\n\n```html\n\u003Cstyle>\n  [naizo-list='notes'] > .note-pane {\n    display: none;\n  }\n  [naizo-list='notes'] > .note-pane.is-active {\n    display: flex;\n    flex-direction: column;\n  }\n\u003C\u002Fstyle>\n\n\u003C!-- Sidebar index (persisted category filter; ephemeral search and rendered list excluded via naizo-ignore) -->\n\u003Caside>\n  \u003Cinput id=\"note-search\" type=\"search\" naizo-ignore placeholder=\"Search notes...\" \u002F>\n  \u003Cselect id=\"category-filter\" naizo=\"category_filter\">\n    \u003Coption value=\"all\" selected>All Categories\u003C\u002Foption>\n    \u003Coption value=\"Architecture\">Architecture\u003C\u002Foption>\n    \u003Coption value=\"Runbook\">Runbook\u003C\u002Foption>\n  \u003C\u002Fselect>\n  \u003Cbutton id=\"new-note-btn\" type=\"button\" naizo-ignore>+ New Note\u003C\u002Fbutton>\n  \u003Cdiv id=\"note-sidebar-list\" naizo-ignore>\u003C\u002Fdiv>\n\u003C\u002Faside>\n\n\u003C!-- Declarative [naizo-list] where each [naizo-item] is a full editor pane -->\n\u003Cmain naizo-list=\"notes\" naizo-no-controls>\n  \u003Carticle class=\"note-pane\" naizo-item>\n    \u003Clabel>\u003Cinput type=\"text\" naizo=\"title\" placeholder=\"Note title...\" \u002F>\u003C\u002Flabel>\n    \u003Clabel>\n      \u003Cselect naizo=\"category\">\n        \u003Coption value=\"Architecture\">Architecture\u003C\u002Foption>\n        \u003Coption value=\"Runbook\">Runbook\u003C\u002Foption>\n      \u003C\u002Fselect>\n    \u003C\u002Flabel>\n    \u003Clabel>\u003Cinput type=\"checkbox\" naizo=\"pinned\" \u002F> Pinned\u003C\u002Flabel>\n    \u003Clabel>\u003Ctextarea naizo=\"body\" rows=\"12\">\u003C\u002Ftextarea>\u003C\u002Flabel>\n  \u003C\u002Farticle>\n\u003C\u002Fmain>\n\n\u003Cscript>\n  let syncing = false;\n  function syncNotebookUi() {\n    if (syncing) return;\n    syncing = true;\n    try {\n      const notes = Naizo.getList('notes');\n      const activeId = Naizo.get('activeNoteId') || notes[0]?.id;\n      const panes = document.querySelectorAll('[naizo-list=\"notes\"] > [naizo-item]');\n      panes.forEach((pane, idx) => {\n        pane.classList.toggle('is-active', notes[idx]?.id === activeId);\n      });\n      \u002F\u002F Render clickable sidebar items into #note-sidebar-list that call Naizo.set('activeNoteId', note.id)\n    } finally {\n      syncing = false;\n    }\n  }\n  document.getElementById('new-note-btn').addEventListener('click', () => {\n    const id = 'note-' + Date.now();\n    Naizo.addItem('notes', {\n      id,\n      title: 'Untitled',\n      category: 'Architecture',\n      pinned: false,\n      updatedAt: new Date().toISOString(),\n      body: '',\n    });\n    Naizo.set('activeNoteId', id);\n  });\n  window.addEventListener('naizo:hydrate', syncNotebookUi);\n  window.addEventListener('naizo:change', syncNotebookUi);\n\u003C\u002Fscript>\n```\n\n### Blueprint C: Filterable Card Grid with Per-Item Custom Keys (`inventory.html`, `D15`)\n\nUse for asset trackers, issue boards, or component catalogs where cards have standard bound fields plus arbitrary custom key-value properties:\n\n- Bind standard card fields (`sku`, `name`, `status`, `location`, `qty`, `unitCost`, `notes`) inside `\u003Cdiv naizo-list=\"inventory\" naizo-no-controls>`.\n- Store arbitrary custom metadata keys directly on each item object in `db.lists.inventory[i]` (assigning keys via `Object.defineProperty` \u002F `Naizo.updateItem('inventory', index, partial)` so even keys like `__proto__` are safe, `EC38`).\n- Render a `[naizo-ignore]` badge container inside each `[naizo-item]` card to display and edit those pass-through keys.\n- Use CSS Grid `cardEl.style.order = String(rank)` for non-destructive sorting without mutating array indices.\n\n### Blueprint D: Lightweight Vanilla Search\u002FFilter & Persisted Tabs (`D43`)\n\n**Non-destructive list search (`row.hidden`):**\n\n```javascript\nfunction applyFilter() {\n  const q = document.getElementById('search-input').value.trim().toLowerCase();\n  const rows = document.querySelectorAll('[naizo-list=\"tasks\"] > [naizo-item]');\n  const items = Naizo.getList('tasks');\n  rows.forEach((row, i) => {\n    const text = JSON.stringify(items[i] ?? {}).toLowerCase();\n    row.hidden = q !== '' && !text.includes(q);\n  });\n}\ndocument.getElementById('search-input').addEventListener('input', applyFilter);\nwindow.addEventListener('naizo:hydrate', applyFilter);\nwindow.addEventListener('naizo:change', applyFilter);\n```\n\n**Persisted collapsible sections & tabs:**\n\n- For collapsible sections, bind `\u003Cdetails naizo=\"section_open\" open>` directly (zero JS required).\n- For view tabs, bind radio buttons `\u003Cinput type=\"radio\" name=\"tab\" value=\"overview\" naizo=\"active_tab\" checked>` and toggle `panel.hidden = panel.dataset.tab !== (Naizo.getField('active_tab') || 'overview')` on `naizo:hydrate` and `naizo:change`.\n\n### Blueprint E: Interactive Option Lab & Human Review Prototype (`D45`)\n\nWhen helping a user compare design directions, layout options, architecture trade-offs, or copy variants, generate a self-persisting `naizo.js` comparison page (`design-lab.html`):\n\n- Bind option controls (`\u003Cinput type=\"radio\" name=\"direction\" value=\"washi\" naizo=\"direction\">`, `\u003Cselect naizo=\"measure\">`, `\u003Cselect naizo=\"inspector_layout\">`) and a review notes `\u003Ctextarea naizo=\"design_notes\" rows=\"4\">` to `#naizodb`.\n- Listen to `naizo:hydrate` and `naizo:change` to switch live preview styles or layout attributes (`document.documentElement.dataset.direction = Naizo.getField('direction')`) in real time.\n- Ask the user to explore the options in their browser, write feedback in the notes box, and press **`⌘S` \u002F `Ctrl+S`** to save to disk. On the next turn, read `\u003Cscript id=\"naizodb\" type=\"application\u002Fjson\">` directly from disk to apply their exact selected options and written notes.\n\n### Blueprint F: Declarative Mini-API Client, Webhooks, & `#net` Network Rules (`naizo-get` \u002F `naizo-post`, `D43`, `D50`, `D51`, `D52`)\n\nUse `naizo-get`, `naizo-post`, or `Naizo.fetch()` when an HTML app needs to seed or sync `#naizodb` from public JSON APIs, static `.json` files, or a `localhost` agent server, or push `#naizodb` payloads to webhooks:\n\n```html\n\u003C!-- Seed a list once on first boot only when empty (never overwrites user edits on F5 reload) -->\n\u003Cdiv\n  naizo-get=\"https:\u002F\u002Fapi.github.com\u002Frepos\u002Fnickosh\u002Fnaizo\u002Fissues\"\n  naizo-into=\"list:issues\"\n  naizo-trigger=\"init\"\n>\u003C\u002Fdiv>\n\n\u003C!-- Pull a nested JSON scalar into db.fields on click -->\n\u003Cbutton\n  type=\"button\"\n  naizo-get=\"https:\u002F\u002Fapi.example.com\u002Fstatus.json\"\n  naizo-path=\"release.latestTag\"\n  naizo-into=\"field:release_tag\"\n>\n  Sync Tag\n\u003C\u002Fbutton>\n\n\u003C!-- Push db.fields to a webhook via CORS-safelisted text\u002Fplain;charset=UTF-8 POST -->\n\u003Cbutton type=\"button\" naizo-post=\"https:\u002F\u002Fhooks.example.com\u002Fnotify\" naizo-body=\"fields\">\n  Send Update\n\u003C\u002Fbutton>\n```\n\n- **Store-first vs. DOM-only vs. raw fetch targets (`D15`, `D22`, `D51`, `D52`):** Use `naizo-into=\"field:\u003Ckey>\"`, `list:\u003Cname>`, `custom:\u003Ckey>`, or `db` (also the default when `naizo-into` is omitted on declarative `naizo-get`) to persist into `#naizodb`. `naizo-into=\"#selector\"` writes strictly via `textContent` (never `innerHTML`) as a transient DOM preview without mutating `#naizodb`. Omitting `naizo-into` on declarative `naizo-post` or omitting `options.into` on programmatic `await Naizo.fetch(url)` (any HTTP method) is non-mutating—returning `{ ok, status, data }` so custom JS can transform external API JSON before calling `Naizo.setList()` \u002F `Naizo.setField()`.\n- **Rightmost `#net` wired-globe indicator & debugging (`D50`, `EC36`):** Automatically appears at the right end of the status pill (`API idle`, `API active` `L→R` wave held `>= 600 ms`, or `API request failed` red pulse with click-to-clear) while keeping `#dot` and `#status` exclusively for storage durability (see `examples\u002Fweather.html` for a complete map + forecast + webhook blueprint). `naizo.js` intentionally omits a built-in network inspector so the runtime stays light and flexible—inspect failed requests in the browser's DevTools `Network` tab.\n- **Local Mode vs. Online Mode network rules (`D43`):**\n  - **Local Mode (`file:\u002F\u002F` or `http:\u002F\u002Flocalhost`):** Fetched state persists into `localStorage` and surgically into `\u003Cscript id=\"naizodb\">` on disk when linked so CLI AI agents immediately see remote data. Note that `file:\u002F\u002F` sends `Origin: null` (requiring `Access-Control-Allow-Origin: *` to read responses, or `naizo-cors=\"no-cors\"` without `naizo-into` for blind `POST` webhooks) and blocks relative `fetch('.\u002Fdata.json')` unless served via `http:\u002F\u002Flocalhost`.\n  - **Online Mode (`https:\u002F\u002F` static hosts):** Relative `naizo-get=\".\u002Fpreset.json\"` works out of the box and bakes fetched data into **`⬇ Save to PC`** downloads; browsers block mixed-content `http:\u002F\u002F` on `https:\u002F\u002F` pages and require `Access-Control-Allow-Private-Network: true` for `localhost` loopback calls.\n\n---\n\n## 6. Human-First Typography & Minimalist Design (`D45` — Fallback When Author Has No Style Preference)\n\n1. **Always follow the author's explicit preferences first:**\n   - If the user or project specifies a visual style, layout structure, color palette, component library, or CSS framework (e.g., Tailwind, brutalist, dense dashboard grid, neon dark theme, or existing brand tokens), **honor the author's direction completely**. Never override explicit user preferences with a default house style.\n2. **Default fallback when the author has NOT specified styling preferences (`Washi Editorial` minimalism):**\n   - When the user asks for an HTML tool, doc, plan, or app without specifying visual styling, avoid stereotypical AI \"neuro-slop\" (nested multi-column bento cards, heavy drop shadows, neon gradients, uppercase pill-badge clutter on every heading, and cramped multi-pane sidebars).\n   - Default to a calm, human-readable **editorial layout**:\n     - **Palette:** Warm paper background in light mode (`#faf8f5` surface, `#ffffff` elevated inputs, `#1c1b18` ink, `#57534e` muted prose, `#e5e0d8` hair-thin `1px` borders, `#a8432b` terracotta accent) and warm charcoal in dark mode (`#141311` surface, `#1c1b18` elevated inputs, `#ece8e1` ink, `#a6a096` muted prose, `#2e2c28` borders, `#e07a5f` accent).\n     - **Typography & Measure:** Pair an editorial serif (`'Newsreader'`, `'Iowan Old Style'`, `Georgia`, `serif`) for headings with a clean humanist sans-serif (`'Plus Jakarta Sans'`, `system-ui`, `sans-serif`) for body copy (`16px–16.5px`, `line-height: 1.65–1.75`) inside a calm single-column container (`max-width: 760px–900px`), separating sections with hair-thin `1px` horizontal rules instead of nested boxes.\n     - **Punctuation & Tables:** Prefer spaced en-dashes (`–`) over unspaced em-dashes in prose. Keep reference tables to at most **3 balanced columns** (grouping secondary metadata as compact block badges inside the first cell) and never set `white-space: nowrap` on columns containing long attribute or method signatures.\n3. **Theme persistence without dirtying initial boot state (`\"theme\": \"system\"`, `EC48`, `D45`):**\n   - When adding a persistent Light\u002FDark theme toggle (`naizo=\"theme\"`), initialize `\"theme\": \"system\"` in `#naizodb` and let CSS `@media (prefers-color-scheme: dark) { html:not([data-theme='light']) { ... } }` handle OS dark-mode detection automatically.\n   - **Never** call `Naizo.setField('theme', 'dark')` on initial page load based on `window.matchMedia`, because mutating `store` on boot marks the document dirty against `initialDiskDb` and prematurely surfaces the Online Mode `↺ Reset` button before the user has made any edits. Call `Naizo.setField('theme', nextTheme)` only when the user explicitly clicks the theme toggle.\n\n---\n\n## 7. Surgical Disk Editing Protocol for CLI \u002F IDE AI Agents\n\nWhen modifying an existing `naizo.js` `.html` file on disk to update data (`fields`, `lists`, or `custom`):\n\n1. Read the file and extract the JSON inside `\u003Cscript id=\"naizodb\" type=\"application\u002Fjson\">...\u003C\u002Fscript>`.\n2. Parse the JSON and update `db.fields`, `db.lists`, or `db.custom` while keeping untouched keys intact.\n3. Update `db._meta = { ...db._meta, updatedAt: new Date().toISOString() }`.\n4. Serialize with `JSON.stringify(db, null, 2).replace(\u002F\u003C\u002Fg, '\\\\u003c')` and replace **only** the `\u003Cscript id=\"naizodb\">...\u003C\u002Fscript>` block in the HTML file (using a callback replacement function so `$1` or `$&` inside user JSON values are never interpreted as regex capture groups):\n\n```bash\nnode -e '\nconst fs = require(\"fs\");\nconst file = \"plan.html\";\nconst html = fs.readFileSync(file, \"utf8\");\nconst re = \u002F(\u003Cscript\\b[^>]*\\bid\\s*=\\s*(?:\"naizodb\"|\\x27naizodb\\x27|naizodb(?=[>\\s\u002F]))[^>]*>)([\\s\\S]*?)(\u003C\\\u002Fscript>)\u002Fi;\nconst match = html.match(re);\nif (!match) throw new Error(\"Missing #naizodb block\");\nconst db = JSON.parse(match[2]);\n\n\u002F\u002F Mutate db.fields, db.lists, or db.custom here:\ndb.fields.status = \"Approved\";\ndb._meta = { ...db._meta, updatedAt: new Date().toISOString() };\n\nconst json = JSON.stringify(db, null, 2).replace(\u002F\u003C\u002Fg, \"\\\\u003c\");\nfs.writeFileSync(file, html.replace(re, (_m, open, _inner, close) => `${open}\\n${json}\\n${close}`), \"utf8\");\n'\n```\n\n---\n\n## 8. Installing This Skill in Your Workspace\n\nTo equip Claude Code, Antigravity, Cursor, GitHub Copilot, Gemini CLI, or Codex with this skill in any repository, install it via the GitHub CLI (`gh skill`), the npm Skills CLI (`npx skills`), or `curl`:\n\n```bash\n# 1. GitHub CLI (gh v2.90+ — installs from the latest published release)\ngh skill install nickosh\u002Fnaizo naizo\n\n# 2. npm Skills CLI (npx skills)\nnpx skills add nickosh\u002Fnaizo --skill naizo\n\n# 3. Direct curl \u002F file copy (no CLI required)\nmkdir -p .agents\u002Fskills\u002Fnaizo && curl -fsSL https:\u002F\u002Fnaizo.js.org\u002FSKILL.md -o .agents\u002Fskills\u002Fnaizo\u002FSKILL.md\nmkdir -p .claude\u002Fskills\u002Fnaizo && curl -fsSL https:\u002F\u002Fnaizo.js.org\u002FSKILL.md -o .claude\u002Fskills\u002Fnaizo\u002FSKILL.md\n```\n\n### Experimental \u002F In-Development (`main` Branch)\n\nTo preview unreleased features from `main` before the next tagged release is published, pair the in-development `dist\u002Fnaizo.js` bundle with the `@main` skill (note: `main` is under active development and may contain experimental or not-yet-released changes):\n\n```html\n\u003C!-- In-development runtime directly from main (or local .\u002Fdist\u002Fnaizo.js) -->\n\u003Cscript src=\"https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002Fnickosh\u002Fnaizo@main\u002Fdist\u002Fnaizo.js\" defer>\u003C\u002Fscript>\n```\n\n```bash\n# In-development AI skill from main\ngh skill install nickosh\u002Fnaizo naizo@main\nnpx skills add nickosh\u002Fnaizo@main --skill naizo\nmkdir -p .agents\u002Fskills\u002Fnaizo && curl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002Fnickosh\u002Fnaizo\u002Fmain\u002Fskills\u002Fnaizo\u002FSKILL.md -o .agents\u002Fskills\u002Fnaizo\u002FSKILL.md\n```\n","# Naizo (`naizo.js`) — Self-Persisting HTML & AI Agent Co-Editing Skill\n\nUse **`naizo.js`** (npm package `naizojs`) to turn any single `.html` file into a living, self-persisting application whose state syncs between the browser DOM, `localStorage`, and `\u003Cscript id=\"naizodb\" type=\"application\u002Fjson\">` on disk.\n\nIn Japanese, **_naizō_ (ないぞう)** means both **内蔵 (_built-in \u002F housed within_)** and **内臓 (_internal organs_)**: `\u003Cscript id=\"naizodb\">` is the built-in JSON database inside `\u003Chead>`, and `naizo.js` provides the reactive internal organs that bind inputs, repeat lists, and sync human browser edits with AI agent disk edits.\n\n---\n\n## 1. Golden Rules for AI Agents (Never Violate)\n\n1. **`\u003Cbody>` is the template; `\u003Cscript id=\"naizodb\">` is the canonical data:**\n   - When linked to a local file via the File System Access API (`⌘S` \u002F `Ctrl+S` or `Link Disk`), `naizo.js` surgically rewrites **only** the `\u003Cscript id=\"naizodb\">...\u003C\u002Fscript>` block on disk (`D16`). It does **not** rewrite `\u003Cbody>` markup on disk during normal saves.\n   - **To read human edits from disk:** Always parse `\u003Cscript id=\"naizodb\" type=\"application\u002Fjson\">` in `\u003Chead>`. Never scrape `\u003Cbody>` input `value` or `checked` attributes to read current state.\n   - **To update data on disk:** Modify the JSON inside `\u003Cscript id=\"naizodb\">` (formatted with 2-space indentation and `\u003C` escaped as `\\u003c`). If the user has the file open and linked in their browser, `naizo.js` detects `file.lastModified` within ~2 seconds and merges your changes into the live page without clobbering `document.activeElement`.\n   - **To update the UI or layout:** Edit the HTML\u002FCSS inside `\u003Cbody>` (and add matching initial keys to `#naizodb` if needed).\n2. **Preserve pass-through keys (`D15`, `EC14`):**\n   - `naizo.js` maintains an in-memory `NaizoDatabase` store and maps each rendered `[naizo-item]` DOM row to its source object via a `WeakMap`.\n   - Unbound keys in `fields`, unbound arrays in `lists`, and extra properties on list item objects (such as `\"id\"`, `\"estimate\"`, `\"updatedAt\"`, or custom per-card dictionary keys) pass through untouched. When editing `#naizodb` on disk, always preserve existing keys you did not intend to remove.\n3. **Explicit binding only (`D08`, `D12`, `EC11`, `EC49`):**\n   - Bind elements exclusively with `naizo=\"key\"` or `data-naizo=\"key\"`. Unannotated inputs (like search bars or filter dropdowns) are never implicitly captured, and `id` or `name` attributes are never used as fallback binding keys.\n4. **Wrap `\u003Clabel>` around inputs inside `[naizo-item]` (`EC39`):**\n   - Never use `\u003Clabel for=\"some-id\">` + `\u003Cinput id=\"some-id\">` inside a repeating `[naizo-item]`, because cloned rows would share duplicate DOM `id` attributes. Always wrap `\u003Clabel>` directly around the control (`\u003Clabel>\u003Cinput type=\"checkbox\" naizo=\"done\" \u002F>\u003Cspan>Done\u003C\u002Fspan>\u003C\u002Flabel>`).\n5. **Scope documents with `\u003Chtml naizo-id=\"...\">` (`D13`, `EC11`):**\n   - Add a descriptive `naizo-id=\"project-artifact-slug\"` on `\u003Chtml>` (or `\"_meta\": { \"id\": \"...\" }`) so `localStorage` caches and IndexedDB file handles never collide when multiple HTML tools are opened on `localhost` or `file:\u002F\u002F`.\n6. **Never filter `[naizo-item]` rows by removing them from the DOM (`D43`):**\n   - Removing a `[naizo-item]` node deletes its object from `db.lists`. For search or category filtering, toggle `row.hidden = !matches` (or CSS `display: none`).\n\n---\n\n## 2. Core HTML Structure & `#naizodb` Schema\n\nEvery `naizo.js` HTML document embeds `\u003Cscript id=\"naizodb\" type=\"application\u002Fjson\">` at the top of `\u003Chead>` followed by `naizo.js`:\n\n```html\n\u003C!doctype html>\n\u003Chtml lang=\"en\" naizo-id=\"my-artifact-id\">\n  \u003Chead>\n    \u003Cmeta charset=\"UTF-8\" \u002F>\n    \u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" \u002F>\n    \u003Ctitle>Artifact Title\u003C\u002Ftitle>\n\n    \u003C!-- 1. Canonical #naizodb JSON state (2-space indented, '\u003C' escaped as \\u003c) -->\n    \u003Cscript id=\"naizodb\" type=\"application\u002Fjson\">\n      {\n        \"_meta\": {\n          \"id\": \"my-artifact-id\"\n        },\n        \"fields\": {\n          \"title\": \"Artifact Title\",\n          \"owner\": \"Alex\",\n          \"status\": \"Draft\"\n        },\n        \"lists\": {\n          \"tasks\": [\n            {\n              \"id\": \"task-1\",\n              \"done\": false,\n              \"task\": \"First action item\",\n              \"priority\": \"High\"\n            }\n          ]\n        },\n        \"custom\": {}\n      }\n    \u003C\u002Fscript>\n\n    \u003C!-- 2. Load naizo.js via npm CDN (jsDelivr or unpkg) or local .\u002Fdist\u002Fnaizo.js -->\n    \u003Cscript src=\"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fnaizojs@latest\u002Fdist\u002Fnaizo.js\" defer>\u003C\u002Fscript>\n  \u003C\u002Fhead>\n  \u003Cbody>\n    \u003C!-- 3. Declarative bindings in \u003Cbody> -->\n  \u003C\u002Fbody>\n\u003C\u002Fhtml>\n```\n\n### CDN & Local Script Options (`D17`, `D34`, `D39`)\n\n- **jsDelivr (readable):** `https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fnaizojs@latest\u002Fdist\u002Fnaizo.js`\n- **jsDelivr (minified, ~15.7 KB gzipped):** `https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fnaizojs@latest\u002Fdist\u002Fnaizo.min.js`\n- **unpkg:** `https:\u002F\u002Funpkg.com\u002Fnaizojs@latest\u002Fdist\u002Fnaizo.js`\n- **Pinned version:** replace `@latest` with a specific published version tag\n- **Local \u002F offline:** `\u003Cscript src=\".\u002Fdist\u002Fnaizo.js\" defer>\u003C\u002Fscript>` (inside the `naizo` repository examples, use `..\u002Fdist\u002Fnaizo.js`)\n- **Experimental \u002F in-development (`main` branch `dist\u002Fnaizo.js`):** `https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002Fnickosh\u002Fnaizo@main\u002Fdist\u002Fnaizo.js` (unreleased; pair with the `@main` skill below)\n\n---\n\n## 3. Declarative HTML Attributes (`naizo` \u002F `data-naizo`)\n\nBoth short `naizo` \u002F `naizo-*` attributes and HTML5 `data-naizo` \u002F `data-naizo-*` aliases are supported everywhere (`D08`):\n\n| Short Attribute                     | HTML5 `data-*` Alias                     | Placement                                                                                              | Behavior                                                                                                                                        |\n| ----------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |\n| `naizo=\"key\"`                       | `data-naizo=\"key\"`                       | `\u003Cinput>`, `\u003Ctextarea>`, `\u003Cselect>`, `\u003Cdetails>`, `[contenteditable]`, leaf element, or `[naizo-item]` | Binds to `db.fields[\"key\"]` when standalone, or to `item[\"key\"]` when inside or on a `[naizo-item]`.                                            |\n| `naizo-list=\"name\"`                 | `data-naizo-list=\"name\"`                 | Container (`\u003Cdiv>`, `\u003Cul>`, `\u003Col>`, `\u003Ctbody>`, `\u003Ctable>`)                                              | Binds direct `[naizo-item]` children to `db.lists[\"name\"]` and injects `+ Add Item` below the list unless `naizo-no-controls` is present.       |\n| `naizo-item`                        | `data-naizo-item`                        | Direct child of `[naizo-list]` (`\u003Cdiv>`, `\u003Cli>`, `\u003Ctr>`, etc.)                                         | Marks a repeating row\u002Fcard; injects hover `↑` `↓` `×` toolbar unless `naizo-no-controls` is set on the list.                                    |\n| `naizo-template`                    | `data-naizo-template`                    | Direct child `\u003Ctemplate>` inside `[naizo-list]`                                                        | Optional explicit blueprint for new items. If omitted, `naizo.js` auto-infers `data-naizo-auto-template=\"true\"` from the first `[naizo-item]`.  |\n| `naizo-add=\"name\"`                  | `data-naizo-add=\"name\"`                  | `\u003Cbutton>` (anywhere in document)                                                                      | Appends a new blank item to `[naizo-list=\"name\"]` and focuses its first text field (`EC31`).                                                    |\n| `naizo-remove`                      | `data-naizo-remove`                      | `\u003Cbutton>` inside `[naizo-item]`                                                                       | Deletes the enclosing `[naizo-item]` from DOM and `db.lists`.                                                                                   |\n| `naizo-move=\"up\\|down\"`             | `data-naizo-move=\"up\\|down\"`             | `\u003Cbutton>` inside `[naizo-item]`                                                                       | Moves the enclosing `[naizo-item]` up or down in DOM and `db.lists`.                                                                            |\n| `naizo-no-controls`                 | `data-naizo-no-controls`                 | `[naizo-list]`                                                                                         | Suppresses auto-injected `↑ ↓ ×` and `+ Add Item` buttons so you can use custom buttons or modals.                                              |\n| `naizo-ignore`                      | `data-naizo-ignore`                      | Any element                                                                                            | Excludes the element and its subtree from state binding while preserving it in auto-templates and exported HTML (`D12`, `EC07`).                |\n| `naizo-strip`                       | `data-naizo-strip`                       | Any element                                                                                            | Excludes the element and its subtree from state binding and strips it from auto-templates and `exportHTML()` \u002F `downloadHTML()` (`D12`, `D47`). |\n| `naizo-id=\"scope\"`                  | `data-naizo-id=\"scope\"`                  | `\u003Chtml>` or `\u003Cbody>`                                                                                   | Scopes `localStorage` and IndexedDB keys (`\u003Cpath>::\u003Cscope>`) to avoid collisions on `localhost`.                                                |\n| `naizo-mode=\"online\\|local\\|auto\"`  | `data-naizo-mode=\"online\\|local\\|auto\"`  | `\u003Chtml>` or `\u003Cbody>`                                                                                   | Overrides automatic Local Mode vs. Online Mode detection (`D41`, `EC48`).                                                                       |\n| `naizo-manual`                      | `data-naizo-manual`                      | `\u003Chtml>`, `\u003Cbody>`, or `\u003Cscript>`                                                                      | Disables automatic `initNaizo()` boot when loading the browser IIFE bundle.                                                                     |\n| `naizo-get=\"url\"`                   | `data-naizo-get=\"url\"`                   | `\u003Cbutton>`, `\u003Ca>`, or any element                                                                      | Fetches JSON or text via `GET` and routes `2xx` responses via `naizo-into` (or hydrates `#naizodb` when `naizo-into` is omitted, `D43`, `D51`). |\n| `naizo-post=\"url\"`                  | `data-naizo-post=\"url\"`                  | `\u003Cbutton>` or any element                                                                              | Flushes pending edits and sends a CORS-safelisted `text\u002Fplain;charset=UTF-8` JSON `POST` (fire-and-forget unless `naizo-into` is set, `D51`).   |\n| `naizo-into=\"target\"`               | `data-naizo-into=\"target\"`               | Element with `naizo-get` \u002F `naizo-post`                                                                | Routes response into `field:\u003Ckey>`, `list:\u003Cname>` (`Naizo.setList`), `custom:\u003Ckey>`, `db`, or DOM-only `#selector` (`textContent`, `D22`).      |\n| `naizo-path=\"a.b.0\"`                | `data-naizo-path=\"a.b.0\"`                | Element with `naizo-get` \u002F `naizo-post`                                                                | Extracts a nested property or array index from parsed JSON using `Object.hasOwn()` at each step (`EC24`, `EC50`).                               |\n| `naizo-body=\"source\"`               | `data-naizo-body=\"source\"`               | Element with `naizo-post`                                                                              | Selects outgoing `POST` payload: `db` (default), `fields`, `custom`, `list:\u003Cname>`, or `field:\u003Ckey>`.                                           |\n| `naizo-trigger=\"click\\|init\\|load\"` | `data-naizo-trigger=\"click\\|init\\|load\"` | Element with `naizo-get` \u002F `naizo-post`                                                                | Fires on `click` (default), `init` (boot only when target is empty), or `load` (every boot).                                                    |\n| `naizo-cors=\"no-cors\"`              | `data-naizo-cors=\"no-cors\"`              | Element with `naizo-post`                                                                              | Sends an opaque fire-and-forget webhook `POST` when `naizo-into` is omitted (`D43`).                                                            |\n\n### Scalar Element Coercion & Safety Rules (`D14`, `D22`, `EC12`, `EC15`, `EC18`, `EC21`, `EC25`)\n\n- **Text inputs & `\u003Ctextarea>`:** `string` (`.value`), preserving stored numbers\u002Fbooleans when the string representation is unchanged (`EC25`).\n- **`\u003Cinput type=\"number\">` & `\u003Cinput type=\"range\">`:** finite `number` or `null` when empty (`EC12`).\n- **`\u003Cinput type=\"checkbox\">`:** `boolean` (`.checked`), coercing `\"false\"`, `\"0\"`, `\"\"`, `\"no\"`, and `\"off\"` to `false` (`EC25`).\n- **`\u003Cinput type=\"radio\">`:** `string` value of the checked radio; inside `[naizo-item]`, radio `name` attributes are automatically scoped per row and restored on export (`EC13`).\n- **`\u003Cselect>` & `\u003Cselect multiple>`:** `string` or `string[]`. If `#naizodb` contains a value with no matching `\u003Coption>` yet, `naizo.js` logs a warning and preserves the stored value in memory instead of overwriting it with `\"\"` (`EC15`).\n- **`\u003Cdetails naizo=\"key\">`:** `boolean` (`open` state via capture-phase `toggle` listener, `EC12`).\n- **`[contenteditable]` (`\"\"`, `\"true\"`, `\"plaintext-only\"`):** plain text via `textContent` (`D22`, `EC18` — never `innerHTML`).\n- **Self-bound `[naizo-item]`:** `\u003Cli naizo-item contenteditable=\"true\" naizo=\"text\">` binds the item root directly while isolating `textContent` from injected `.naizo-item-tools` and `[naizo-ignore]` \u002F `[naizo-strip]` children (`D47`, `EC46`).\n- **Tables (`\u003Ctbody naizo-list>` \u002F `\u003Ctr naizo-item>`):** `.naizo-item-tools` is placed inside the last `\u003Ctd>`\u002F`\u003Cth>` of each row and `.naizo-list-footer` is placed immediately after `\u003Ctable>` (`EC13`).\n- **Skipped inputs (`EC21`):** `password`, `file`, `button`, `submit`, `reset`, and `image` are always skipped.\n\n---\n\n## 4. Programmatic API (`window.Naizo` \u002F `window.NaizoDB`) & Events\n\n```javascript\n\u002F\u002F 1. Custom JSON State (db.custom)\nconst activeId = Naizo.get('activeNoteId'); \u002F\u002F Omit key to get full NaizoDatabase\nNaizo.set('activeNoteId', 'note-102'); \u002F\u002F Validates finite JSON value (EC35)\nNaizo.delete('obsoleteKey');\n\n\u002F\u002F 2. Standalone Fields (db.fields)\nconst status = Naizo.getField('status');\nNaizo.setField('status', 'Approved'); \u002F\u002F Updates db.fields.status + all bound [naizo=\"status\"] DOM nodes\nNaizo.deleteField('legacyField'); \u002F\u002F Deletes key + clears bound DOM inputs\n\n\u002F\u002F 3. Lists (db.lists)\nconst items = Naizo.getList('tasks');\nNaizo.setList('tasks', [{ id: 't-1', done: false, task: 'Synced from API', priority: 'High' }]); \u002F\u002F Replaces or clears ([] ) list safely (M8.1)\nNaizo.addItem('tasks', { id: 't-2', done: false, task: 'New task', priority: 'Med' });\nNaizo.updateItem('tasks', 0, { done: true }); \u002F\u002F Shallow-merges into item 0, preserving extra keys\nNaizo.moveItem('tasks', 2, 0);\nNaizo.removeItem('tasks', 1);\n\n\u002F\u002F 4. Mini-API Client, Dynamic Subtrees, Persistence, Reset, & Export\nconst apiRes = await Naizo.fetch('https:\u002F\u002Fapi.example.com\u002Ftasks', {\n  method: 'GET', \u002F\u002F 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'\n  path: 'data.items',\n  into: 'list:tasks', \u002F\u002F 'field:\u003Ckey>' | 'list:\u003Cname>' | 'custom:\u003Ckey>' | 'db' | '#selector'\n}); \u002F\u002F Resolves { url, method, ok, status, target, data, error } without throwing\nNaizo.bind(containerEl); \u002F\u002F Hydrate dynamically inserted DOM from store\nconst ok = await Naizo.save(); \u002F\u002F Flush cache + await single-flight disk write (Promise\u003Cboolean>)\nNaizo.reset(); \u002F\u002F Back up dirty state to ↺ Restore and reset to initial boot baseline\nawait Naizo.unlink(); \u002F\u002F Forget linked FileSystemFileHandle\nconst json = await Naizo.copyJSON(); \u002F\u002F Copy 2-space #naizodb JSON to clipboard\nconst html = Naizo.exportHTML(); \u002F\u002F Clean HTML snapshot with baked attributes & stripped runtime UI\nconst dlHtml = Naizo.downloadHTML('app.html'); \u002F\u002F Download portable HTML with dist\u002Fnaizo.min.js CDN URL\n\n\u002F\u002F 5. Window Lifecycle & Mutation Events\nwindow.addEventListener('naizo:hydrate', (e) => {\n  \u002F\u002F Fired on boot, external disk merge, cross-tab storage sync, full-DB fetch, ↺ Restore, and ↺ Reset\n  console.log('Hydrated store:', e.detail);\n});\nwindow.addEventListener('naizo:change', (e) => {\n  \u002F\u002F e.detail: { scope: 'fields' | 'lists' | 'custom' | 'db' | 'reset' | 'restore', action?, list?, key?, index?, value?, db }\n  console.log('Changed:', e.detail);\n});\nwindow.addEventListener('naizo:item', (e) => {\n  \u002F\u002F e.detail: { list, item, data, index }\n  console.log('New list row:', e.detail);\n});\nwindow.addEventListener('naizo:fetch', (e) => {\n  \u002F\u002F e.detail: { url, method, ok, status, target, data, error }\n  console.log('API result:', e.detail);\n});\n```\n\n---\n\n## 5. Canonical Application Blueprints\n\nChoose the blueprint that best matches the user's request (full templates live in `examples\u002Fstarter.html`, `examples\u002Fchecklist.html`, `examples\u002Fnotes.html`, `examples\u002Finventory.html`, and `examples\u002Fweather.html` in the `naizo` repository):\n\n### Blueprint A: Project Spec & Milestones (`starter.html`) \u002F Release Checklist (`checklist.html`)\n\nUse for implementation plans, PR review checklists, bug triage sheets, and release sign-offs. Needs **zero custom JavaScript**:\n\n```html\n\u003Ch1 contenteditable=\"true\" naizo=\"checklist_title\">Pre-Release Verification Checklist\u003C\u002Fh1>\n\n\u003Csection class=\"card\">\n  \u003Cdiv class=\"meta-row\">\n    \u003Clabel>\n      Reviewer\n      \u003Cinput type=\"text\" naizo=\"reviewer\" value=\"Jordan\" \u002F>\n    \u003C\u002Flabel>\n    \u003Clabel>\n      Target Environment\n      \u003Cselect naizo=\"environment\">\n        \u003Coption value=\"Local\">Local\u003C\u002Foption>\n        \u003Coption value=\"Staging\" selected>Staging\u003C\u002Foption>\n        \u003Coption value=\"Production\">Production\u003C\u002Foption>\n      \u003C\u002Fselect>\n    \u003C\u002Flabel>\n    \u003Clabel class=\"ready-toggle\">\n      \u003Cinput type=\"checkbox\" naizo=\"ready_for_release\" \u002F>\n      \u003Cspan>Ready for Release\u003C\u002Fspan>\n    \u003C\u002Flabel>\n  \u003C\u002Fdiv>\n\u003C\u002Fsection>\n\n\u003Csection class=\"card\">\n  \u003Ch2>Verification Items\u003C\u002Fh2>\n  \u003Cdiv naizo-list=\"checks\">\n    \u003Cdiv class=\"check-row\" naizo-item>\n      \u003Clabel>\n        \u003Cinput type=\"checkbox\" naizo=\"done\" \u002F>\n        \u003Cspan class=\"sr-only\">Done\u003C\u002Fspan>\n      \u003C\u002Flabel>\n      \u003Clabel>\n        \u003Cspan class=\"sr-only\">Verification item\u003C\u002Fspan>\n        \u003Cinput type=\"text\" naizo=\"task\" placeholder=\"Add verification step...\" \u002F>\n      \u003C\u002Flabel>\n      \u003Clabel>\n        \u003Cspan class=\"sr-only\">Priority\u003C\u002Fspan>\n        \u003Cselect naizo=\"priority\">\n          \u003Coption value=\"High\">High\u003C\u002Foption>\n          \u003Coption value=\"Med\">Med\u003C\u002Foption>\n          \u003Coption value=\"Low\">Low\u003C\u002Foption>\n        \u003C\u002Fselect>\n      \u003C\u002Flabel>\n    \u003C\u002Fdiv>\n  \u003C\u002Fdiv>\n\u003C\u002Fsection>\n```\n\n### Blueprint B: Zero-DOM-Wipe Master–Detail Workspace (`notes.html`, `D40`)\n\nUse for multi-note engineering notebooks, ADR explorers, prompt libraries, or multi-document editors with a sidebar list and active editor pane.\n\n- **Key architectural rule:** Never wipe and copy note text into a single shared `\u003Ctextarea>`. Instead, render every note as a live `[naizo-item]` inside `\u003Cdiv naizo-list=\"notes\" naizo-no-controls>`, store the selected ID in `db.custom.activeNoteId`, and toggle `.is-active` (`display: flex` vs. `display: none`) on the matching `[naizo-item]` pane via CSS:\n\n```html\n\u003Cstyle>\n  [naizo-list='notes'] > .note-pane {\n    display: none;\n  }\n  [naizo-list='notes'] > .note-pane.is-active {\n    display: flex;\n    flex-direction: column;\n  }\n\u003C\u002Fstyle>\n\n\u003C!-- Sidebar index (persisted category filter; ephemeral search and rendered list excluded via naizo-ignore) -->\n\u003Caside>\n  \u003Cinput id=\"note-search\" type=\"search\" naizo-ignore placeholder=\"Search notes...\" \u002F>\n  \u003Cselect id=\"category-filter\" naizo=\"category_filter\">\n    \u003Coption value=\"all\" selected>All Categories\u003C\u002Foption>\n    \u003Coption value=\"Architecture\">Architecture\u003C\u002Foption>\n    \u003Coption value=\"Runbook\">Runbook\u003C\u002Foption>\n  \u003C\u002Fselect>\n  \u003Cbutton id=\"new-note-btn\" type=\"button\" naizo-ignore>+ New Note\u003C\u002Fbutton>\n  \u003Cdiv id=\"note-sidebar-list\" naizo-ignore>\u003C\u002Fdiv>\n\u003C\u002Faside>\n\n\u003C!-- Declarative [naizo-list] where each [naizo-item] is a full editor pane -->\n\u003Cmain naizo-list=\"notes\" naizo-no-controls>\n  \u003Carticle class=\"note-pane\" naizo-item>\n    \u003Clabel>\u003Cinput type=\"text\" naizo=\"title\" placeholder=\"Note title...\" \u002F>\u003C\u002Flabel>\n    \u003Clabel>\n      \u003Cselect naizo=\"category\">\n        \u003Coption value=\"Architecture\">Architecture\u003C\u002Foption>\n        \u003Coption value=\"Runbook\">Runbook\u003C\u002Foption>\n      \u003C\u002Fselect>\n    \u003C\u002Flabel>\n    \u003Clabel>\u003Cinput type=\"checkbox\" naizo=\"pinned\" \u002F> Pinned\u003C\u002Flabel>\n    \u003Clabel>\u003Ctextarea naizo=\"body\" rows=\"12\">\u003C\u002Ftextarea>\u003C\u002Flabel>\n  \u003C\u002Farticle>\n\u003C\u002Fmain>\n\n\u003Cscript>\n  let syncing = false;\n  function syncNotebookUi() {\n    if (syncing) return;\n    syncing = true;\n    try {\n      const notes = Naizo.getList('notes');\n      const activeId = Naizo.get('activeNoteId') || notes[0]?.id;\n      const panes = document.querySelectorAll('[naizo-list=\"notes\"] > [naizo-item]');\n      panes.forEach((pane, idx) => {\n        pane.classList.toggle('is-active', notes[idx]?.id === activeId);\n      });\n      \u002F\u002F Render clickable sidebar items into #note-sidebar-list that call Naizo.set('activeNoteId', note.id)\n    } finally {\n      syncing = false;\n    }\n  }\n  document.getElementById('new-note-btn').addEventListener('click', () => {\n    const id = 'note-' + Date.now();\n    Naizo.addItem('notes', {\n      id,\n      title: 'Untitled',\n      category: 'Architecture',\n      pinned: false,\n      updatedAt: new Date().toISOString(),\n      body: '',\n    });\n    Naizo.set('activeNoteId', id);\n  });\n  window.addEventListener('naizo:hydrate', syncNotebookUi);\n  window.addEventListener('naizo:change', syncNotebookUi);\n\u003C\u002Fscript>\n```\n\n### Blueprint C: Filterable Card Grid with Per-Item Custom Keys (`inventory.html`, `D15`)\n\nUse for asset trackers, issue boards, or component catalogs where cards have standard bound fields plus arbitrary custom key-value properties:\n\n- Bind standard card fields (`sku`, `name`, `status`, `location`, `qty`, `unitCost`, `notes`) inside `\u003Cdiv naizo-list=\"inventory\" naizo-no-controls>`.\n- Store arbitrary custom metadata keys directly on each item object in `db.lists.inventory[i]` (assigning keys via `Object.defineProperty` \u002F `Naizo.updateItem('inventory', index, partial)` so even keys like `__proto__` are safe, `EC38`).\n- Render a `[naizo-ignore]` badge container inside each `[naizo-item]` card to display and edit those pass-through keys.\n- Use CSS Grid `cardEl.style.order = String(rank)` for non-destructive sorting without mutating array indices.\n\n### Blueprint D: Lightweight Vanilla Search\u002FFilter & Persisted Tabs (`D43`)\n\n**Non-destructive list search (`row.hidden`):**\n\n```javascript\nfunction applyFilter() {\n  const q = document.getElementById('search-input').value.trim().toLowerCase();\n  const rows = document.querySelectorAll('[naizo-list=\"tasks\"] > [naizo-item]');\n  const items = Naizo.getList('tasks');\n  rows.forEach((row, i) => {\n    const text = JSON.stringify(items[i] ?? {}).toLowerCase();\n    row.hidden = q !== '' && !text.includes(q);\n  });\n}\ndocument.getElementById('search-input').addEventListener('input', applyFilter);\nwindow.addEventListener('naizo:hydrate', applyFilter);\nwindow.addEventListener('naizo:change', applyFilter);\n```\n\n**Persisted collapsible sections & tabs:**\n\n- For collapsible sections, bind `\u003Cdetails naizo=\"section_open\" open>` directly (zero JS required).\n- For view tabs, bind radio buttons `\u003Cinput type=\"radio\" name=\"tab\" value=\"overview\" naizo=\"active_tab\" checked>` and toggle `panel.hidden = panel.dataset.tab !== (Naizo.getField('active_tab') || 'overview')` on `naizo:hydrate` and `naizo:change`.\n\n### Blueprint E: Interactive Option Lab & Human Review Prototype (`D45`)\n\nWhen helping a user compare design directions, layout options, architecture trade-offs, or copy variants, generate a self-persisting `naizo.js` comparison page (`design-lab.html`):\n\n- Bind option controls (`\u003Cinput type=\"radio\" name=\"direction\" value=\"washi\" naizo=\"direction\">`, `\u003Cselect naizo=\"measure\">`, `\u003Cselect naizo=\"inspector_layout\">`) and a review notes `\u003Ctextarea naizo=\"design_notes\" rows=\"4\">` to `#naizodb`.\n- Listen to `naizo:hydrate` and `naizo:change` to switch live preview styles or layout attributes (`document.documentElement.dataset.direction = Naizo.getField('direction')`) in real time.\n- Ask the user to explore the options in their browser, write feedback in the notes box, and press **`⌘S` \u002F `Ctrl+S`** to save to disk. On the next turn, read `\u003Cscript id=\"naizodb\" type=\"application\u002Fjson\">` directly from disk to apply their exact selected options and written notes.\n\n### Blueprint F: Declarative Mini-API Client, Webhooks, & `#net` Network Rules (`naizo-get` \u002F `naizo-post`, `D43`, `D50`, `D51`, `D52`)\n\nUse `naizo-get`, `naizo-post`, or `Naizo.fetch()` when an HTML app needs to seed or sync `#naizodb` from public JSON APIs, static `.json` files, or a `localhost` agent server, or push `#naizodb` payloads to webhooks:\n\n```html\n\u003C!-- Seed a list once on first boot only when empty (never overwrites user edits on F5 reload) -->\n\u003Cdiv\n  naizo-get=\"https:\u002F\u002Fapi.github.com\u002Frepos\u002Fnickosh\u002Fnaizo\u002Fissues\"\n  naizo-into=\"list:issues\"\n  naizo-trigger=\"init\"\n>\u003C\u002Fdiv>\n\n\u003C!-- Pull a nested JSON scalar into db.fields on click -->\n\u003Cbutton\n  type=\"button\"\n  naizo-get=\"https:\u002F\u002Fapi.example.com\u002Fstatus.json\"\n  naizo-path=\"release.latestTag\"\n  naizo-into=\"field:release_tag\"\n>\n  Sync Tag\n\u003C\u002Fbutton>\n\n\u003C!-- Push db.fields to a webhook via CORS-safelisted text\u002Fplain;charset=UTF-8 POST -->\n\u003Cbutton type=\"button\" naizo-post=\"https:\u002F\u002Fhooks.example.com\u002Fnotify\" naizo-body=\"fields\">\n  Send Update\n\u003C\u002Fbutton>\n```\n\n- **Store-first vs. DOM-only vs. raw fetch targets (`D15`, `D22`, `D51`, `D52`):** Use `naizo-into=\"field:\u003Ckey>\"`, `list:\u003Cname>`, `custom:\u003Ckey>`, or `db` (also the default when `naizo-into` is omitted on declarative `naizo-get`) to persist into `#naizodb`. `naizo-into=\"#selector\"` writes strictly via `textContent` (never `innerHTML`) as a transient DOM preview without mutating `#naizodb`. Omitting `naizo-into` on declarative `naizo-post` or omitting `options.into` on programmatic `await Naizo.fetch(url)` (any HTTP method) is non-mutating—returning `{ ok, status, data }` so custom JS can transform external API JSON before calling `Naizo.setList()` \u002F `Naizo.setField()`.\n- **Rightmost `#net` wired-globe indicator & debugging (`D50`, `EC36`):** Automatically appears at the right end of the status pill (`API idle`, `API active` `L→R` wave held `>= 600 ms`, or `API request failed` red pulse with click-to-clear) while keeping `#dot` and `#status` exclusively for storage durability (see `examples\u002Fweather.html` for a complete map + forecast + webhook blueprint). `naizo.js` intentionally omits a built-in network inspector so the runtime stays light and flexible—inspect failed requests in the browser's DevTools `Network` tab.\n- **Local Mode vs. Online Mode network rules (`D43`):**\n  - **Local Mode (`file:\u002F\u002F` or `http:\u002F\u002Flocalhost`):** Fetched state persists into `localStorage` and surgically into `\u003Cscript id=\"naizodb\">` on disk when linked so CLI AI agents immediately see remote data. Note that `file:\u002F\u002F` sends `Origin: null` (requiring `Access-Control-Allow-Origin: *` to read responses, or `naizo-cors=\"no-cors\"` without `naizo-into` for blind `POST` webhooks) and blocks relative `fetch('.\u002Fdata.json')` unless served via `http:\u002F\u002Flocalhost`.\n  - **Online Mode (`https:\u002F\u002F` static hosts):** Relative `naizo-get=\".\u002Fpreset.json\"` works out of the box and bakes fetched data into **`⬇ Save to PC`** downloads; browsers block mixed-content `http:\u002F\u002F` on `https:\u002F\u002F` pages and require `Access-Control-Allow-Private-Network: true` for `localhost` loopback calls.\n\n---\n\n## 6. Human-First Typography & Minimalist Design (`D45` — Fallback When Author Has No Style Preference)\n\n1. **Always follow the author's explicit preferences first:**\n   - If the user or project specifies a visual style, layout structure, color palette, component library, or CSS framework (e.g., Tailwind, brutalist, dense dashboard grid, neon dark theme, or existing brand tokens), **honor the author's direction completely**. Never override explicit user preferences with a default house style.\n2. **Default fallback when the author has NOT specified styling preferences (`Washi Editorial` minimalism):**\n   - When the user asks for an HTML tool, doc, plan, or app without specifying visual styling, avoid stereotypical AI \"neuro-slop\" (nested multi-column bento cards, heavy drop shadows, neon gradients, uppercase pill-badge clutter on every heading, and cramped multi-pane sidebars).\n   - Default to a calm, human-readable **editorial layout**:\n     - **Palette:** Warm paper background in light mode (`#faf8f5` surface, `#ffffff` elevated inputs, `#1c1b18` ink, `#57534e` muted prose, `#e5e0d8` hair-thin `1px` borders, `#a8432b` terracotta accent) and warm charcoal in dark mode (`#141311` surface, `#1c1b18` elevated inputs, `#ece8e1` ink, `#a6a096` muted prose, `#2e2c28` borders, `#e07a5f` accent).\n     - **Typography & Measure:** Pair an editorial serif (`'Newsreader'`, `'Iowan Old Style'`, `Georgia`, `serif`) for headings with a clean humanist sans-serif (`'Plus Jakarta Sans'`, `system-ui`, `sans-serif`) for body copy (`16px–16.5px`, `line-height: 1.65–1.75`) inside a calm single-column container (`max-width: 760px–900px`), separating sections with hair-thin `1px` horizontal rules instead of nested boxes.\n     - **Punctuation & Tables:** Prefer spaced en-dashes (`–`) over unspaced em-dashes in prose. Keep reference tables to at most **3 balanced columns** (grouping secondary metadata as compact block badges inside the first cell) and never set `white-space: nowrap` on columns containing long attribute or method signatures.\n3. **Theme persistence without dirtying initial boot state (`\"theme\": \"system\"`, `EC48`, `D45`):**\n   - When adding a persistent Light\u002FDark theme toggle (`naizo=\"theme\"`), initialize `\"theme\": \"system\"` in `#naizodb` and let CSS `@media (prefers-color-scheme: dark) { html:not([data-theme='light']) { ... } }` handle OS dark-mode detection automatically.\n   - **Never** call `Naizo.setField('theme', 'dark')` on initial page load based on `window.matchMedia`, because mutating `store` on boot marks the document dirty against `initialDiskDb` and prematurely surfaces the Online Mode `↺ Reset` button before the user has made any edits. Call `Naizo.setField('theme', nextTheme)` only when the user explicitly clicks the theme toggle.\n\n---\n\n## 7. Surgical Disk Editing Protocol for CLI \u002F IDE AI Agents\n\nWhen modifying an existing `naizo.js` `.html` file on disk to update data (`fields`, `lists`, or `custom`):\n\n1. Read the file and extract the JSON inside `\u003Cscript id=\"naizodb\" type=\"application\u002Fjson\">...\u003C\u002Fscript>`.\n2. Parse the JSON and update `db.fields`, `db.lists`, or `db.custom` while keeping untouched keys intact.\n3. Update `db._meta = { ...db._meta, updatedAt: new Date().toISOString() }`.\n4. Serialize with `JSON.stringify(db, null, 2).replace(\u002F\u003C\u002Fg, '\\\\u003c')` and replace **only** the `\u003Cscript id=\"naizodb\">...\u003C\u002Fscript>` block in the HTML file (using a callback replacement function so `$1` or `$&` inside user JSON values are never interpreted as regex capture groups):\n\n```bash\nnode -e '\nconst fs = require(\"fs\");\nconst file = \"plan.html\";\nconst html = fs.readFileSync(file, \"utf8\");\nconst re = \u002F(\u003Cscript\\b[^>]*\\bid\\s*=\\s*(?:\"naizodb\"|\\x27naizodb\\x27|naizodb(?=[>\\s\u002F]))[^>]*>)([\\s\\S]*?)(\u003C\\\u002Fscript>)\u002Fi;\nconst match = html.match(re);\nif (!match) throw new Error(\"Missing #naizodb block\");\nconst db = JSON.parse(match[2]);\n\n\u002F\u002F Mutate db.fields, db.lists, or db.custom here:\ndb.fields.status = \"Approved\";\ndb._meta = { ...db._meta, updatedAt: new Date().toISOString() };\n\nconst json = JSON.stringify(db, null, 2).replace(\u002F\u003C\u002Fg, \"\\\\u003c\");\nfs.writeFileSync(file, html.replace(re, (_m, open, _inner, close) => `${open}\\n${json}\\n${close}`), \"utf8\");\n'\n```\n\n---\n\n## 8. Installing This Skill in Your Workspace\n\nTo equip Claude Code, Antigravity, Cursor, GitHub Copilot, Gemini CLI, or Codex with this skill in any repository, install it via the GitHub CLI (`gh skill`), the npm Skills CLI (`npx skills`), or `curl`:\n\n```bash\n# 1. GitHub CLI (gh v2.90+ — installs from the latest published release)\ngh skill install nickosh\u002Fnaizo naizo\n\n# 2. npm Skills CLI (npx skills)\nnpx skills add nickosh\u002Fnaizo --skill naizo\n\n# 3. Direct curl \u002F file copy (no CLI required)\nmkdir -p .agents\u002Fskills\u002Fnaizo && curl -fsSL https:\u002F\u002Fnaizo.js.org\u002FSKILL.md -o .agents\u002Fskills\u002Fnaizo\u002FSKILL.md\nmkdir -p .claude\u002Fskills\u002Fnaizo && curl -fsSL https:\u002F\u002Fnaizo.js.org\u002FSKILL.md -o .claude\u002Fskills\u002Fnaizo\u002FSKILL.md\n```\n\n### Experimental \u002F In-Development (`main` Branch)\n\nTo preview unreleased features from `main` before the next tagged release is published, pair the in-development `dist\u002Fnaizo.js` bundle with the `@main` skill (note: `main` is under active development and may contain experimental or not-yet-released changes):\n\n```html\n\u003C!-- In-development runtime directly from main (or local .\u002Fdist\u002Fnaizo.js) -->\n\u003Cscript src=\"https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002Fnickosh\u002Fnaizo@main\u002Fdist\u002Fnaizo.js\" defer>\u003C\u002Fscript>\n```\n\n```bash\n# In-development AI skill from main\ngh skill install nickosh\u002Fnaizo naizo@main\nnpx skills add nickosh\u002Fnaizo@main --skill naizo\nmkdir -p .agents\u002Fskills\u002Fnaizo && curl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002Fnickosh\u002Fnaizo\u002Fmain\u002Fskills\u002Fnaizo\u002FSKILL.md -o .agents\u002Fskills\u002Fnaizo\u002FSKILL.md\n```\n",{"name":5,"license":14,"description":7},"main","12318f688f3fce5023e4dbe031d484339f6d9c20","skills\u002Fnaizo",0,"https:\u002F\u002Fgithub.com\u002Fnickosh\u002Fnaizo","http:\u002F\u002Fnaizo.js.org\u002F","https:\u002F\u002Fgithub.com\u002Fnickosh","2026-11-14 18:33:41",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add nickosh\u002Fnaizo --skill naizo",{"tool":37,"command":38},"bunx","bunx skills add nickosh\u002Fnaizo --skill naizo",{"tool":40,"command":41},"pnpm","pnpm dlx skills add nickosh\u002Fnaizo --skill naizo","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fnickosh\u002Fnaizo\u002Fblob\u002Fmain\u002Fskills\u002Fnaizo\u002FSKILL.md",true,[],[46,52],{"skillNo":47,"name":48,"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":49,"categories":50,"keywords":51,"publishedAt":18},"01M7F334RWFE07BQXX8AWADJJM","site","https:\u002F\u002Fgithub.com\u002Fnickosh\u002Fnaizo\u002Fblob\u002Fmain\u002Fsite\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":18},"01M7F32ZRC840DC6S2ZN84ZDD5","naizo-closeout","Close naizo development sessions, useful development slices, and milestones by reconciling implementation evidence with the project memory documents. Use when wrapping up or handing off work, ending a state-changing session, finishing a PLAN task or milestone, or updating project memory after implementation. Do not use for read-only exploration that produced no durable decision, blocker, reproduced edge case, or repository change.","https:\u002F\u002Fgithub.com\u002Fnickosh\u002Fnaizo\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fnaizo-closeout\u002FSKILL.md",[],[]]