{"title":"Fedwiki Page Skill","story":[{"type":"markdown","id":"574a18963844493f","text":"The **fedwiki-page** skill creates federated wiki page JSON files. Pages are stored as JSON files (no extension) in a wiki domain's `pages/` folder. This skill covers file locations, story item types, ID generation, journal format, and the reindex step."},{"type":"markdown","id":"9b40a4f3af234916","text":"## File Locations\n\nTwo separate wiki systems — write to the correct one:\n\n**Local/private wikis** (served on port 3000):\n```\n~/Music/Guides/Private/{wiki-domain}/pages/{page-slug}\n```\n\n**Public wikis** (synced via Nextcloud to remote server):\n```\n~/Nextcloud/fedwiki/{wiki-domain}/pages/{page-slug}\n```\n\nThe local server does NOT read from `~/Nextcloud/fedwiki/`. Page slug = title lowercased with spaces as hyphens."},{"type":"markdown","id":"f95168dc0c024954","text":"## Story Item Types\n\nDefault to **`markdown`** for all prose, headings, and formatted text. Use `code` for shell commands and config snippets. Use `paragraph` sparingly — only for plain sentences needing no markup.\n\n```json\n{\"type\": \"markdown\", \"id\": \"a1b2c3d4e5f60001\", \"text\": \"**Bold**, `code`, [[Wiki Link]]\"}\n{\"type\": \"code\",     \"id\": \"a1b2c3d4e5f60002\", \"text\": \"wiki-start\"}\n{\"type\": \"paragraph\",\"id\": \"a1b2c3d4e5f60003\", \"text\": \"Plain sentence.\"}\n{\"type\": \"assets\",   \"id\": \"a1b2c3d4e5f60099\", \"text\": \"page-slug\"}\n```\n\nStory order: opening markdown → section headings → content → `# Assets` heading + assets item at the bottom."},{"type":"markdown","id":"eae6fc7bbc694e8b","text":"## IDs\n\nEach item needs a unique 16-character hex ID. Generate with:\n```bash\npython3 -c \"import uuid; print(uuid.uuid4().hex[:16])\"\n```\nNever reuse IDs within a page or across pages in the same wiki."},{"type":"markdown","id":"9b62152293ed4974","text":"## Journal — Critical Rule\n\nThe `journal` must contain a `create` entry whose `item.story` is the **complete story array** — every item, identical to the top-level `story`, in the same order. Never use `\"story\": []` and never include only the first item. This is what allows rewinding to the creation state.\n\n```json\n\"journal\": [{\n  \"type\": \"create\",\n  \"item\": {\n    \"title\": \"Page Title\",\n    \"story\": [\n      {\"type\": \"markdown\", \"id\": \"a1b2c3d4e5f60001\", \"text\": \"Opening item.\"},\n      {\"type\": \"markdown\", \"id\": \"a1b2c3d4e5f60002\", \"text\": \"## Section\"},\n      {\"type\": \"markdown\", \"id\": \"a1b2c3d4e5f60003\", \"text\": \"Every item — same order as top-level story.\"}\n    ]\n  },\n  \"date\": 1781004226000,\n  \"certificate\": \"from marvin\"\n}]\n```\n\n`certificate: \"from marvin\"` identifies the creating agent. `date` is current Unix timestamp in milliseconds."},{"type":"markdown","id":"137a0de1c2064ae1","text":"## After Saving — Reindex\n\nAfter writing any page file to disk, delete the cached sitemap so the wiki server rebuilds it:\n\n```bash\nFARM=\"$HOME/Music/Guides/Private\"\nDOMAIN=\"localhost\"\nrm -f \"$FARM/$DOMAIN/status/sitemap.json\"\nrm -f \"$FARM/$DOMAIN/status/site-index.json\"\ncurl -s \"http://$DOMAIN/system/sitemap.json\" > /dev/null\necho \"Reindexed $DOMAIN\"\n```\n\nThe wiki server must be running for the `curl` step to trigger a rebuild."},{"type":"markdown","id":"264367d51d214210","text":"## Checklist\n\n- [ ] Slug matches title (lowercase, hyphenated)\n- [ ] Correct `pages/` folder (local vs public wiki)\n- [ ] All IDs unique 16-char hex\n- [ ] Default item type is `markdown` not `paragraph`\n- [ ] Backtick markup on paths and commands in markdown items\n- [ ] Journal `create` entry contains the **full** story array\n- [ ] `\"certificate\": \"from marvin\"` on the create entry\n- [ ] Reindexed after saving"},{"type":"markdown","id":"50845e4cd7231d95","text":"# Assets"},{"type":"assets","id":"965c7e2c127f1cfc","text":"fedwiki-page-skill"},{"type":"markdown","id":"bd1763c991b44965","text":"## Related Skills\n\n- [[Fedwiki Journal Skill]] — strip a page journal down to a clean create entry\n- [[Fedwiki Ghost Skill]] — generate pages dynamically without storing them\n- [[Claude Ghost Skill]] — Claude-powered ghost pages via FastAPI"}],"journal":[{"type":"create","item":{"title":"Fedwiki Page Skill","story":[{"type":"markdown","id":"574a18963844493f","text":"The **fedwiki-page** skill creates federated wiki page JSON files. Pages are stored as JSON files (no extension) in a wiki domain's `pages/` folder. This skill covers file locations, story item types, ID generation, journal format, and the reindex step."},{"type":"markdown","id":"9b40a4f3af234916","text":"## File Locations\n\nTwo separate wiki systems — write to the correct one:\n\n**Local/private wikis** (served on port 3000):\n```\n~/Music/Guides/Private/{wiki-domain}/pages/{page-slug}\n```\n\n**Public wikis** (synced via Nextcloud to remote server):\n```\n~/Nextcloud/fedwiki/{wiki-domain}/pages/{page-slug}\n```\n\nThe local server does NOT read from `~/Nextcloud/fedwiki/`. Page slug = title lowercased with spaces as hyphens."},{"type":"markdown","id":"f95168dc0c024954","text":"## Story Item Types\n\nDefault to **`markdown`** for all prose, headings, and formatted text. Use `code` for shell commands and config snippets. Use `paragraph` sparingly — only for plain sentences needing no markup.\n\n```json\n{\"type\": \"markdown\", \"id\": \"a1b2c3d4e5f60001\", \"text\": \"**Bold**, `code`, [[Wiki Link]]\"}\n{\"type\": \"code\",     \"id\": \"a1b2c3d4e5f60002\", \"text\": \"wiki-start\"}\n{\"type\": \"paragraph\",\"id\": \"a1b2c3d4e5f60003\", \"text\": \"Plain sentence.\"}\n{\"type\": \"assets\",   \"id\": \"a1b2c3d4e5f60099\", \"text\": \"page-slug\"}\n```\n\nStory order: opening markdown → section headings → content → `# Assets` heading + assets item at the bottom."},{"type":"markdown","id":"eae6fc7bbc694e8b","text":"## IDs\n\nEach item needs a unique 16-character hex ID. Generate with:\n```bash\npython3 -c \"import uuid; print(uuid.uuid4().hex[:16])\"\n```\nNever reuse IDs within a page or across pages in the same wiki."},{"type":"markdown","id":"9b62152293ed4974","text":"## Journal — Critical Rule\n\nThe `journal` must contain a `create` entry whose `item.story` is the **complete story array** — every item, identical to the top-level `story`, in the same order. Never use `\"story\": []` and never include only the first item. This is what allows rewinding to the creation state.\n\n```json\n\"journal\": [{\n  \"type\": \"create\",\n  \"item\": {\n    \"title\": \"Page Title\",\n    \"story\": [\n      {\"type\": \"markdown\", \"id\": \"a1b2c3d4e5f60001\", \"text\": \"Opening item.\"},\n      {\"type\": \"markdown\", \"id\": \"a1b2c3d4e5f60002\", \"text\": \"## Section\"},\n      {\"type\": \"markdown\", \"id\": \"a1b2c3d4e5f60003\", \"text\": \"Every item — same order as top-level story.\"}\n    ]\n  },\n  \"date\": 1781004226000,\n  \"certificate\": \"from marvin\"\n}]\n```\n\n`certificate: \"from marvin\"` identifies the creating agent. `date` is current Unix timestamp in milliseconds."},{"type":"markdown","id":"137a0de1c2064ae1","text":"## After Saving — Reindex\n\nAfter writing any page file to disk, delete the cached sitemap so the wiki server rebuilds it:\n\n```bash\nFARM=\"$HOME/Music/Guides/Private\"\nDOMAIN=\"localhost\"\nrm -f \"$FARM/$DOMAIN/status/sitemap.json\"\nrm -f \"$FARM/$DOMAIN/status/site-index.json\"\ncurl -s \"http://$DOMAIN/system/sitemap.json\" > /dev/null\necho \"Reindexed $DOMAIN\"\n```\n\nThe wiki server must be running for the `curl` step to trigger a rebuild."},{"type":"markdown","id":"264367d51d214210","text":"## Checklist\n\n- [ ] Slug matches title (lowercase, hyphenated)\n- [ ] Correct `pages/` folder (local vs public wiki)\n- [ ] All IDs unique 16-char hex\n- [ ] Default item type is `markdown` not `paragraph`\n- [ ] Backtick markup on paths and commands in markdown items\n- [ ] Journal `create` entry contains the **full** story array\n- [ ] `\"certificate\": \"from marvin\"` on the create entry\n- [ ] Reindexed after saving"},{"type":"markdown","id":"bd1763c991b44965","text":"## Related Skills\n\n- [[Fedwiki Journal Skill]] — strip a page journal down to a clean create entry\n- [[Ghost Pages Skill]] — generate pages dynamically without storing them\n- [[Claude Ghost Skill]] — Claude-powered ghost pages via FastAPI"}]},"date":1781004226000,"certificate":"from marvin"},{"type":"add","id":"50845e4cd7231d95","item":{"type":"markdown","id":"50845e4cd7231d95","text":"# Assets"},"date":1782590716835,"certificate":"from marvin","after":"264367d51d214210"},{"type":"add","id":"965c7e2c127f1cfc","item":{"type":"assets","id":"965c7e2c127f1cfc","text":"fedwiki-page-skill"},"after":"50845e4cd7231d95","date":1782590716835,"certificate":"from marvin"}]}