---
name: cosmobot-fund-page-editor
description: Use when Margarita sends Cosmobot a fund.getmagic.cloud encyclopedia page link and asks to change/update/rewrite/fix/add something. Edit the underlying Markdown page in /home/spazio/cosmos_luminosity_encyclopedia using the page's current text plus Margarita's instruction/transcript, then verify the live page.
---

# Cosmobot Fund Page Editor

## Trigger

Use this skill whenever Margarita sends a message containing:

- a `fund.getmagic.cloud` page URL, including hash routes like `https://fund.getmagic.cloud/#/hacking-foundation`;
- an instruction/transcript describing what should change on that page;
- or a Telegram voice message that Hermes has transcribed and that refers to a fund page.

Act directly. Do **not** ask Margarita to open `/itsme`, use the web editor, or provide the page text again unless the URL/instruction is genuinely missing.

## Repository

- Site root: `/home/spazio/cosmos_luminosity_encyclopedia`
- Content files: `/home/spazio/cosmos_luminosity_encyclopedia/content/*.md`
- Server: `cosmobot-fund-site.service`
- Public site: `https://fund.getmagic.cloud/`

## URL → content mapping

1. Extract the slug from the URL:
   - `https://fund.getmagic.cloud/#/voice-editing` → `voice-editing`
   - `https://fund.getmagic.cloud/itsme` → usually `index`, unless the message names another page
   - `https://fund.getmagic.cloud/` → `index`
2. Fetch `https://fund.getmagic.cloud/api/article/<slug>` to confirm title/file/body when possible.
3. If API fetch fails, search the local content directory for frontmatter `slug: <slug>`.
4. Never edit files outside `/home/spazio/cosmos_luminosity_encyclopedia/content/` for a page-content request.

## Editing workflow

1. Read the current article body from the API or the matching Markdown file.
2. Treat Margarita's message/transcript as the edit instruction, not as raw Markdown to paste.
3. Generate a complete updated Markdown body that preserves:
   - YAML frontmatter exactly unless the instruction explicitly changes title/summary/category/links;
   - wiki links like `[[page]]` or `[[slug|Label]]`;
   - existing headings and important facts unless instructed to remove them;
   - the Cosmos Luminosity tone: clear, symbolic, grounded, living-encyclopedia style.
4. Apply the edit to the Markdown file with `patch` or `write_file` only after reading the existing file.
5. Before overwriting, create a timestamped backup under `/home/spazio/cosmos_luminosity_encyclopedia/.backups/` if the site endpoint does not already do so.
6. Keep changes surgical: update only the requested page and only the requested meaning/content.

## Verification

After editing:

1. Run syntax/service smoke checks:
   ```bash
   node --check /home/spazio/cosmos_luminosity_encyclopedia/server.mjs
   node --check /home/spazio/cosmos_luminosity_encyclopedia/public/app.js
   systemctl is-active cosmobot-fund-site.service
   ```
2. Fetch the updated article:
   ```bash
   curl -sS https://fund.getmagic.cloud/api/article/<slug>
   ```
3. Fetch the live page shell:
   ```bash
   curl -sS -o /dev/null -w '%{http_code}\n' 'https://fund.getmagic.cloud/?v=<timestamp>#/<slug>'
   ```
4. If the change affects rendered UI or links, use browser verification with a cache-busting query.

## Response style

Reply to Margarita/Vasily concisely in Russian:

- state which page was updated;
- summarize what changed in 2–4 bullets;
- include verification status codes;
- mention backup path only if useful;
- do not expose secrets or internal auth tokens.

## Pitfalls

- Do not paste a speech transcript directly into Markdown unless Margarita explicitly asks for a raw transcript.
- Do not edit `public/app.js` or server code for content-only page updates.
- Do not use OpenAI website API keys for this workflow; the Hermes/Cosmobot model should perform the text rewrite as part of the chat turn, then file tools save the Markdown.
- If the instruction is ambiguous but low risk, make a conservative edit and say what assumption you made.
