[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D6STZ4MBSN7PT5M9G5NT22":3,"skill-same:01M7D6STZ4MBSN7PT5M9G5NT22":49},{"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":29,"commitSha":30,"skillDirectory":31,"forksCount":13,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M7D6STZ4MBSN7PT5M9G5NT22","spawn-instance",null,"Clone this Aeon agent into a new GitHub repo - fork, configure skills, validate, and register in the fleet","LiamVisionary\u002Faeon-template","LiamVisionary","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F102138294?v=4","01M73379NZZ99TT4ZS17XR3Q9D","01M7D6D62V1SGGMKGT08Q1D2R8",0,"MIT","https:\u002F\u002Fgithub.com\u002FLiamVisionary\u002Faeon-template\u002Fblob\u002Fmain\u002Fskills\u002Fspawn-instance\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: spawn-instance\ndescription: Clone this Aeon agent into a new GitHub repo - fork, configure skills, validate, and register in the fleet\nmetadata:\n  title: Spawn Instance\n  category: core\n  var: \"\"\n  tags:\n    - dev\n---\n\u003C!-- autoresearch: variation C — robust: skill-existence validation, exit taxonomy, idempotent recovery, dynamic SETUP.md, pre\u002Fpost-flight verification -->\n\n> **${var}** — Name and purpose of the new instance. Format `name: purpose`, e.g. `crypto-tracker: monitor DeFi protocols and token movements`. If empty, notify the owner and **stop** with exit `SPAWN_INVALID_VAR`.\n\nToday is ${today}. Create a new Aeon instance by forking this repo, configuring it for a specific purpose, validating the configuration, and registering it in the fleet.\n\nRead `memory\u002FMEMORY.md` at the start for context.\n\n## Security Model\n\nThis skill creates the repo and configuration but does **NOT** propagate secrets.\nThe new instance is inert until the owner manually sets secrets (`ANTHROPIC_API_KEY` or `CLAUDE_CODE_OAUTH_TOKEN`, plus notification secrets).\nEach instance has its own API keys for billing isolation and blast-radius containment.\n\n## Exit Taxonomy\n\nEvery run ends with one of these status codes, written to the log and (where relevant) included in the notification:\n\n| Code | Meaning |\n|------|---------|\n| `SPAWN_OK` | Fork created, configured, pushed, Actions enabled, registered. |\n| `SPAWN_FORK_EXISTS_RECOVERED` | Fork already existed but wasn't registered → configured + registered now. |\n| `SPAWN_FORK_EXISTS_REGISTERED` | Fork exists AND is already registered and not archived — refused, no change. |\n| `SPAWN_INVALID_VAR` | var was empty or couldn't be parsed into `name: purpose`. |\n| `SPAWN_NO_SKILLS` | After validation, the skill plan was empty — refused. |\n| `SPAWN_FORK_FAILED` | `gh repo fork` and the fallback `forks` API both failed. |\n| `SPAWN_PUSH_FAILED` | Fork created but push failed — fork left in place, recovery instructions emitted. |\n| `SPAWN_ACTIONS_FAILED` | Configuration pushed but enabling Actions failed — recovery instructions emitted. |\n| `SPAWN_API_ERROR` | Any other GitHub API failure not covered above. |\n\n## Steps\n\n### 1. Parse and validate the var\n\n- If `${var}` is empty, log `SPAWN_INVALID_VAR: empty var` to `memory\u002Flogs\u002F${today}.md`, notify: `spawn-instance: empty var — re-run with \"name: purpose\"`, and **stop**.\n- Split on the first `:` — left is `NAME_RAW`, right is `PURPOSE` (trim whitespace). If either is empty, exit `SPAWN_INVALID_VAR`.\n- Derive `NAME`: lowercase `NAME_RAW`, replace non-alphanumeric runs with `-`, strip leading\u002Ftrailing `-`, truncate to 40 chars. If empty after sanitization, exit `SPAWN_INVALID_VAR`.\n- Set `REPO_NAME=\"aeon-${NAME}\"`.\n\n### 2. Pre-flight checks\n\n```bash\ngh auth status || { echo \"SPAWN_API_ERROR: gh not authenticated\"; exit 1; }\nOWNER=$(gh api user --jq '.login') || { echo \"SPAWN_API_ERROR: cannot read user\"; exit 1; }\nPARENT_REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)\n# If current repo is itself a fork, use the upstream as the parent:\nPARENT_UPSTREAM=$(gh api \"repos\u002F${PARENT_REPO}\" --jq '.parent.full_name \u002F\u002F .full_name')\n```\n\nCheck rate limit:\n```bash\nREMAINING=$(gh api rate_limit --jq '.resources.core.remaining')\n[ \"${REMAINING:-0}\" -lt 50 ] && { echo \"SPAWN_API_ERROR: rate limit too low (${REMAINING})\"; exit 1; }\n```\n\n### 3. Check the fleet registry\n\nRead `memory\u002Finstances.json`. If it doesn't exist, create it with `{\"instances\": []}`.\n\n```json\n{\n  \"instances\": [\n    {\n      \"name\": \"crypto-tracker\",\n      \"repo\": \"OWNER\u002Faeon-crypto-tracker\",\n      \"purpose\": \"monitor DeFi protocols and token movements\",\n      \"created\": \"2026-04-20\",\n      \"status\": \"pending_secrets\",\n      \"skills_enabled\": [\"token-movers\", \"defi-overview\", \"heartbeat\"],\n      \"parent\": \"OWNER\u002Faeon\"\n    }\n  ]\n}\n```\n\n- If an entry with `name == NAME` exists and `status != \"archived\"`, exit `SPAWN_FORK_EXISTS_REGISTERED`, notify, and **stop**.\n- If an entry exists and is archived, remove it — the new run replaces it.\n\n### 4. Build the skill plan from the live catalog\n\n**Do not use a hardcoded skill list.** The catalog in earlier revisions contained broken names (`wallet-digest`, `trending-coins`, `tweet-digest`, `hn-digest` — none of which exist in `skills\u002F`). Always enumerate live.\n\n```bash\n# Build live catalog of available skills and their tags\u002Fdescription.\nfor d in skills\u002F*\u002F; do\n  name=$(basename \"$d\")\n  [ -f \"$d\u002FSKILL.md\" ] || continue\n  # Extract frontmatter fields (description + tags)\n  awk '\u002F^---\u002F{f++;next} f==1{print}' \"$d\u002FSKILL.md\"\ndone\n```\n\nFor each skill, parse the frontmatter `description:` and `tags:` lines. Classify the purpose into themes by keyword match (case-insensitive) and pick skills whose description or tags overlap:\n\n| Purpose keywords | Prefer skills matching tags \u002F keywords |\n|---|---|\n| `crypto`, `defi`, `token`, `chain`, `wallet` | tags `[crypto]` or description contains `token`\u002F`defi`\u002F`chain` |\n| `research`, `paper`, `academic`, `science` | tags `[research]` or name contains `paper`\u002F`research`\u002F`deep-research` |\n| `social`, `twitter`, `x `, `tweet`, `farcaster` | tags `[social]` or name contains `tweet`\u002F`twitter`\u002F`farcaster`\u002F`reply` |\n| `news`, `digest`, `feed`, `brief` | name contains `digest`\u002F`brief`\u002F`morning`\u002F`rss`\u002F`hacker-news` |\n| `dev`, `code`, `github`, `repo`, `pr ` | tags `[dev]` or name contains `github`\u002F`code`\u002F`repo`\u002F`pr-`\u002F`changelog` |\n| `security`, `vuln`, `audit` | tags `[security]` or name contains `security`\u002F`vuln`\u002F`audit` |\n| `prediction`, `polymarket`, `kalshi`, `market` | name contains `polymarket`\u002F`kalshi`\u002F`market`\u002F`narrative` |\n\nRules:\n- **Cap at 8** content skills. Rank by keyword density in description against purpose; tie-break by name.\n- **Always include `heartbeat`** if the file `skills\u002Fheartbeat\u002FSKILL.md` exists (health monitoring).\n- If the purpose doesn't match any theme, fall back to `[reflect, heartbeat]` (filtered against existence).\n- **Validate every candidate** — drop any skill where `skills\u002F${skill}\u002FSKILL.md` doesn't exist; log each drop as `SPAWN_DROPPED_SKILL: ${skill}`.\n- If the final list is empty (no content skills survive), exit `SPAWN_NO_SKILLS`, notify, and **stop**.\n\nSave the final list as `SKILLS_ENABLED`.\n\n### 5. Fork the parent repo\n\n```bash\nif gh api \"repos\u002F${OWNER}\u002F${REPO_NAME}\" --jq '.full_name' >\u002Fdev\u002Fnull 2>&1; then\n  FORK_STATE=\"exists\"\nelse\n  # Try the modern flag first\n  if ! gh repo fork \"${PARENT_UPSTREAM}\" --fork-name \"${REPO_NAME}\" --clone=false 2>\u002Fdev\u002Fnull; then\n    # Fallback: POST to \u002Frepos\u002F{owner}\u002F{repo}\u002Fforks with a custom name\n    gh api \"repos\u002F${PARENT_UPSTREAM}\u002Fforks\" -X POST -f name=\"${REPO_NAME}\" --jq '.full_name' \\\n      || { echo \"SPAWN_FORK_FAILED\"; exit 1; }\n  fi\n  FORK_STATE=\"created\"\nfi\n```\n\n**Wait for fork availability** (GitHub forks are async):\n```bash\nfor i in $(seq 1 10); do\n  gh api \"repos\u002F${OWNER}\u002F${REPO_NAME}\" --jq '.full_name' >\u002Fdev\u002Fnull 2>&1 && break\n  sleep 3\ndone\ngh api \"repos\u002F${OWNER}\u002F${REPO_NAME}\" --jq '.full_name' >\u002Fdev\u002Fnull 2>&1 \\\n  || { echo \"SPAWN_FORK_FAILED: fork not reachable after wait\"; exit 1; }\n```\n\n### 6. Configure the fork\n\n```bash\nTMPDIR=$(mktemp -d)\ntrap 'rm -rf \"$TMPDIR\"' EXIT\ngh repo clone \"${OWNER}\u002F${REPO_NAME}\" \"$TMPDIR\u002Frepo\" -- --quiet \\\n  || { echo \"SPAWN_API_ERROR: clone failed\"; exit 1; }\ncd \"$TMPDIR\u002Frepo\"\ngit config user.name \"aeonframework\"\ngit config user.email \"aeonframework@proton.me\"\n```\n\n#### 6a. Write a customized `aeon.yml`\n\n- Read the parent `aeon.yml` as a base (preserves comments, ordering, and the full skill list).\n- Set `enabled: true` only on skills in `SKILLS_ENABLED`. All others must have `enabled: false`.\n- Do not drop any skills — keep the full inventory so the child can enable more later.\n- **Validate the result**: every skill name with `enabled: true` must correspond to an existing `skills\u002F${skill}\u002FSKILL.md` in the fork's tree. If any enabled skill is missing, abort before pushing (this is a sanity check — step 4 already validated, but the child's repo tree must match).\n\n#### 6b. Write `SETUP.md` dynamically\n\nParse each enabled skill's `skills\u002F${skill}\u002FSKILL.md` for references to uppercase env var names (pattern: `[A-Z][A-Z0-9_]{2,}_(KEY|TOKEN|URL|ID|SECRET)`). Collect the union across enabled skills, excluding built-ins (`GITHUB_TOKEN`, `GH_TOKEN`).\n\nEmit a SETUP.md with three sections:\n\n```markdown\n# Aeon Instance Setup\n\nThis is a managed Aeon instance spawned from `${PARENT_UPSTREAM}`.\n\n## Purpose\n${PURPOSE}\n\n## Enabled Skills\n${comma-separated list with one-line descriptions from each SKILL.md}\n\n## Activate This Instance\n\nGo to **Settings > Secrets and variables > Actions** and add these secrets:\n\n### Required (pick one for Claude auth)\n| Secret | Description |\n|--------|------------|\n| `ANTHROPIC_API_KEY` | Anthropic API key — console.anthropic.com |\n| `CLAUDE_CODE_OAUTH_TOKEN` | Alternative: Claude Code OAuth token |\n\n### Recommended (notifications)\n| Secret | Description |\n|--------|------------|\n| `TELEGRAM_BOT_TOKEN` | Telegram bot token |\n| `TELEGRAM_CHAT_ID` | Telegram chat ID |\n| `DISCORD_WEBHOOK_URL` | Discord webhook URL |\n| `SLACK_WEBHOOK_URL` | Slack webhook URL |\n\n### Required by your enabled skills\n${one row per detected env var, with the list of skills that reference it}\n\n## Fleet Parent\nManaged by `${PARENT_UPSTREAM}`. The parent can dispatch skills and monitor health via `fleet-control`.\n\n## Security Note\nThis instance has NO access to the parent's secrets. Each instance maintains its own API keys and credentials.\n```\n\nIf no env vars are detected beyond the required\u002Frecommended set, omit the \"Required by your enabled skills\" section header (don't leave an empty table).\n\n#### 6c. Update `CLAUDE.md` idempotently\n\nFind the heading line `## About This Repo` (or the first `## ` section if not present). Under it, insert exactly one line:\n```\n- Managed instance of ${PARENT_UPSTREAM}. Purpose: ${PURPOSE}.\n```\n\nIf a line starting with `- Managed instance of` already exists, replace it rather than appending a duplicate.\n\n#### 6d. Reset child memory\n\nThe child starts with a clean slate:\n\n```bash\n# Reset MEMORY.md to a minimal template\ncat > memory\u002FMEMORY.md \u003C\u003CEOF\n# Long-term Memory\n*Last consolidated: never*\n\n## About This Repo\n- Aeon instance of ${PARENT_UPSTREAM}. Purpose: ${PURPOSE}.\n\n## Next Priorities\n- Configure secrets per SETUP.md\n- Wait for first scheduled skill to run\nEOF\n\n# Clear logs, state, topics — safe paths only, never follow symlinks\nfind memory\u002Flogs -mindepth 1 -type f -delete 2>\u002Fdev\u002Fnull || true\nfind memory\u002Ftopics -mindepth 1 -type f -delete 2>\u002Fdev\u002Fnull || true\nfind memory\u002Fissues -mindepth 1 -type f ! -name 'INDEX.md' -delete 2>\u002Fdev\u002Fnull || true\n[ -f memory\u002Fissues\u002FINDEX.md ] && echo \"# Issues — none open\" > memory\u002Fissues\u002FINDEX.md\necho '{}' > memory\u002Fcron-state.json\n# Do NOT clear memory\u002Finstances.json on the child — the child has none.\nrm -f memory\u002Finstances.json 2>\u002Fdev\u002Fnull || true\n```\n\n#### 6e. Commit and push\n\n```bash\ngit add -A\ngit commit -m \"chore: configure instance — ${PURPOSE}\n\nSkills enabled: ${SKILLS_ENABLED_CSV}\nParent: ${PARENT_UPSTREAM}\nSpawned: ${today}\"\ngit push origin main 2>\u002Fdev\u002Fnull \\\n  || git push origin HEAD:main 2>\u002Fdev\u002Fnull \\\n  || { echo \"SPAWN_PUSH_FAILED\"; cd - >\u002Fdev\u002Fnull; exit 1; }\ncd - >\u002Fdev\u002Fnull\n```\n\nIf push fails, **do not delete the fork** — leave it for manual inspection and notify with:\n```\nspawn-instance: fork created but push failed for ${OWNER}\u002F${REPO_NAME}.\nRecover with: gh repo clone ${OWNER}\u002F${REPO_NAME} && push manually, then re-register.\n```\n\n### 7. Enable GitHub Actions on the fork\n\nForks have Actions disabled by default. Use **typed** booleans (`-F`, not `-f`, or `enabled=true` is sent as the string \"true\"):\n\n```bash\ngh api \"repos\u002F${OWNER}\u002F${REPO_NAME}\u002Factions\u002Fpermissions\" -X PUT \\\n  -F enabled=true -f allowed_actions=all \\\n  || { echo \"SPAWN_ACTIONS_FAILED\"; exit 1; }\n```\n\n### 8. Post-flight verification\n\n```bash\n# Fork reachable\ngh api \"repos\u002F${OWNER}\u002F${REPO_NAME}\" --jq '.full_name' >\u002Fdev\u002Fnull \\\n  || { echo \"SPAWN_API_ERROR: post-flight fork check failed\"; exit 1; }\n\n# Our commit is HEAD\nHEAD_SHA=$(gh api \"repos\u002F${OWNER}\u002F${REPO_NAME}\u002Fcommits\u002Fmain\" --jq '.sha' 2>\u002Fdev\u002Fnull)\n[ -n \"$HEAD_SHA\" ] || { echo \"SPAWN_API_ERROR: post-flight HEAD check failed\"; exit 1; }\n\n# Actions enabled\nACTIONS_ON=$(gh api \"repos\u002F${OWNER}\u002F${REPO_NAME}\u002Factions\u002Fpermissions\" --jq '.enabled' 2>\u002Fdev\u002Fnull)\n[ \"$ACTIONS_ON\" = \"true\" ] || { echo \"SPAWN_ACTIONS_FAILED: post-flight\"; exit 1; }\n```\n\n### 9. Register the instance\n\nUpdate `memory\u002Finstances.json` in the **parent** repo. Append:\n```json\n{\n  \"name\": \"${NAME}\",\n  \"repo\": \"${OWNER}\u002F${REPO_NAME}\",\n  \"purpose\": \"${PURPOSE}\",\n  \"created\": \"${today}\",\n  \"status\": \"pending_secrets\",\n  \"skills_enabled\": ${SKILLS_ENABLED_JSON},\n  \"parent\": \"${PARENT_UPSTREAM}\"\n}\n```\n\nIf `FORK_STATE == \"exists\"` at step 5, the final exit status is `SPAWN_FORK_EXISTS_RECOVERED`, otherwise `SPAWN_OK`.\n\n### 10. Log to memory\n\nAppend to `memory\u002Flogs\u002F${today}.md`:\n```\n### spawn-instance\n- Status: ${EXIT_CODE}\n- Instance: ${OWNER}\u002F${REPO_NAME}\n- Purpose: ${PURPOSE}\n- Skills: ${SKILLS_ENABLED_CSV}\n- Dropped skills: ${DROPPED_CSV or \"(none)\"}\n- Actions enabled: yes\n```\n\n### 11. Notify via `.\u002Fnotify`\n\nOn success (`SPAWN_OK` or `SPAWN_FORK_EXISTS_RECOVERED`):\n```\n*New Aeon Instance*\n\nRepo: ${OWNER}\u002F${REPO_NAME}\nPurpose: ${PURPOSE}\nSkills (${N}): ${SKILLS_ENABLED_CSV}\nStatus: ${EXIT_CODE} — PENDING SECRETS\n\nActivate:\n1. https:\u002F\u002Fgithub.com\u002F${OWNER}\u002F${REPO_NAME}\u002Fsettings\u002Fsecrets\u002Factions\n2. Add ANTHROPIC_API_KEY (or CLAUDE_CODE_OAUTH_TOKEN)\n3. Add TELEGRAM_BOT_TOKEN + TELEGRAM_CHAT_ID (or Discord\u002FSlack)\n\nSee SETUP.md in the repo for the full secret list tailored to your enabled skills.\n```\n\nOn refusal (`SPAWN_FORK_EXISTS_REGISTERED`, `SPAWN_INVALID_VAR`, `SPAWN_NO_SKILLS`):\n```\nspawn-instance: ${EXIT_CODE} — ${one-line reason}. No changes made.\n```\n\nOn failure (`SPAWN_FORK_FAILED`, `SPAWN_PUSH_FAILED`, `SPAWN_ACTIONS_FAILED`, `SPAWN_API_ERROR`):\n```\nspawn-instance FAILED: ${EXIT_CODE}\nTarget: ${OWNER}\u002F${REPO_NAME}\nRecovery: ${one-line recovery instruction}\n```\n\n## Network note\n\nThis skill runs entirely through `gh` CLI, which handles auth internally, so no bare `$SECRET` ever lands on the command line for the Bash permission layer to refuse. No WebFetch fallback needed. If `gh` is missing or unauthenticated, the pre-flight step fails with `SPAWN_API_ERROR`.\n\n## Constraints\n\n- **No secret propagation.** Never read or write `ANTHROPIC_API_KEY`, `TELEGRAM_*`, `DISCORD_*`, `SLACK_*`, or any API key into the child repo. The whole security model depends on this.\n- **No hardcoded skill list.** Always enumerate `skills\u002F*\u002FSKILL.md` at runtime to avoid referencing renamed or removed skills.\n- **Idempotent.** Re-running with the same `${var}` must never produce duplicate registry entries, duplicate CLAUDE.md lines, or a second fork.\n- **Never delete a fork.** If anything fails partway through, leave the fork in place and emit recovery guidance — the operator is the only party authorized to delete it.\n- **Never push to the parent without committing `memory\u002Finstances.json` via the normal Aeon workflow.** The parent commit happens through the same path as any other skill output.\n\nWrite complete, working code. No TODOs or placeholders.\n","\u003C!-- autoresearch: variation C — robust: skill-existence validation, exit taxonomy, idempotent recovery, dynamic SETUP.md, pre\u002Fpost-flight verification -->\n\n> **${var}** — Name and purpose of the new instance. Format `name: purpose`, e.g. `crypto-tracker: monitor DeFi protocols and token movements`. If empty, notify the owner and **stop** with exit `SPAWN_INVALID_VAR`.\n\nToday is ${today}. Create a new Aeon instance by forking this repo, configuring it for a specific purpose, validating the configuration, and registering it in the fleet.\n\nRead `memory\u002FMEMORY.md` at the start for context.\n\n## Security Model\n\nThis skill creates the repo and configuration but does **NOT** propagate secrets.\nThe new instance is inert until the owner manually sets secrets (`ANTHROPIC_API_KEY` or `CLAUDE_CODE_OAUTH_TOKEN`, plus notification secrets).\nEach instance has its own API keys for billing isolation and blast-radius containment.\n\n## Exit Taxonomy\n\nEvery run ends with one of these status codes, written to the log and (where relevant) included in the notification:\n\n| Code | Meaning |\n|------|---------|\n| `SPAWN_OK` | Fork created, configured, pushed, Actions enabled, registered. |\n| `SPAWN_FORK_EXISTS_RECOVERED` | Fork already existed but wasn't registered → configured + registered now. |\n| `SPAWN_FORK_EXISTS_REGISTERED` | Fork exists AND is already registered and not archived — refused, no change. |\n| `SPAWN_INVALID_VAR` | var was empty or couldn't be parsed into `name: purpose`. |\n| `SPAWN_NO_SKILLS` | After validation, the skill plan was empty — refused. |\n| `SPAWN_FORK_FAILED` | `gh repo fork` and the fallback `forks` API both failed. |\n| `SPAWN_PUSH_FAILED` | Fork created but push failed — fork left in place, recovery instructions emitted. |\n| `SPAWN_ACTIONS_FAILED` | Configuration pushed but enabling Actions failed — recovery instructions emitted. |\n| `SPAWN_API_ERROR` | Any other GitHub API failure not covered above. |\n\n## Steps\n\n### 1. Parse and validate the var\n\n- If `${var}` is empty, log `SPAWN_INVALID_VAR: empty var` to `memory\u002Flogs\u002F${today}.md`, notify: `spawn-instance: empty var — re-run with \"name: purpose\"`, and **stop**.\n- Split on the first `:` — left is `NAME_RAW`, right is `PURPOSE` (trim whitespace). If either is empty, exit `SPAWN_INVALID_VAR`.\n- Derive `NAME`: lowercase `NAME_RAW`, replace non-alphanumeric runs with `-`, strip leading\u002Ftrailing `-`, truncate to 40 chars. If empty after sanitization, exit `SPAWN_INVALID_VAR`.\n- Set `REPO_NAME=\"aeon-${NAME}\"`.\n\n### 2. Pre-flight checks\n\n```bash\ngh auth status || { echo \"SPAWN_API_ERROR: gh not authenticated\"; exit 1; }\nOWNER=$(gh api user --jq '.login') || { echo \"SPAWN_API_ERROR: cannot read user\"; exit 1; }\nPARENT_REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)\n# If current repo is itself a fork, use the upstream as the parent:\nPARENT_UPSTREAM=$(gh api \"repos\u002F${PARENT_REPO}\" --jq '.parent.full_name \u002F\u002F .full_name')\n```\n\nCheck rate limit:\n```bash\nREMAINING=$(gh api rate_limit --jq '.resources.core.remaining')\n[ \"${REMAINING:-0}\" -lt 50 ] && { echo \"SPAWN_API_ERROR: rate limit too low (${REMAINING})\"; exit 1; }\n```\n\n### 3. Check the fleet registry\n\nRead `memory\u002Finstances.json`. If it doesn't exist, create it with `{\"instances\": []}`.\n\n```json\n{\n  \"instances\": [\n    {\n      \"name\": \"crypto-tracker\",\n      \"repo\": \"OWNER\u002Faeon-crypto-tracker\",\n      \"purpose\": \"monitor DeFi protocols and token movements\",\n      \"created\": \"2026-04-20\",\n      \"status\": \"pending_secrets\",\n      \"skills_enabled\": [\"token-movers\", \"defi-overview\", \"heartbeat\"],\n      \"parent\": \"OWNER\u002Faeon\"\n    }\n  ]\n}\n```\n\n- If an entry with `name == NAME` exists and `status != \"archived\"`, exit `SPAWN_FORK_EXISTS_REGISTERED`, notify, and **stop**.\n- If an entry exists and is archived, remove it — the new run replaces it.\n\n### 4. Build the skill plan from the live catalog\n\n**Do not use a hardcoded skill list.** The catalog in earlier revisions contained broken names (`wallet-digest`, `trending-coins`, `tweet-digest`, `hn-digest` — none of which exist in `skills\u002F`). Always enumerate live.\n\n```bash\n# Build live catalog of available skills and their tags\u002Fdescription.\nfor d in skills\u002F*\u002F; do\n  name=$(basename \"$d\")\n  [ -f \"$d\u002FSKILL.md\" ] || continue\n  # Extract frontmatter fields (description + tags)\n  awk '\u002F^---\u002F{f++;next} f==1{print}' \"$d\u002FSKILL.md\"\ndone\n```\n\nFor each skill, parse the frontmatter `description:` and `tags:` lines. Classify the purpose into themes by keyword match (case-insensitive) and pick skills whose description or tags overlap:\n\n| Purpose keywords | Prefer skills matching tags \u002F keywords |\n|---|---|\n| `crypto`, `defi`, `token`, `chain`, `wallet` | tags `[crypto]` or description contains `token`\u002F`defi`\u002F`chain` |\n| `research`, `paper`, `academic`, `science` | tags `[research]` or name contains `paper`\u002F`research`\u002F`deep-research` |\n| `social`, `twitter`, `x `, `tweet`, `farcaster` | tags `[social]` or name contains `tweet`\u002F`twitter`\u002F`farcaster`\u002F`reply` |\n| `news`, `digest`, `feed`, `brief` | name contains `digest`\u002F`brief`\u002F`morning`\u002F`rss`\u002F`hacker-news` |\n| `dev`, `code`, `github`, `repo`, `pr ` | tags `[dev]` or name contains `github`\u002F`code`\u002F`repo`\u002F`pr-`\u002F`changelog` |\n| `security`, `vuln`, `audit` | tags `[security]` or name contains `security`\u002F`vuln`\u002F`audit` |\n| `prediction`, `polymarket`, `kalshi`, `market` | name contains `polymarket`\u002F`kalshi`\u002F`market`\u002F`narrative` |\n\nRules:\n- **Cap at 8** content skills. Rank by keyword density in description against purpose; tie-break by name.\n- **Always include `heartbeat`** if the file `skills\u002Fheartbeat\u002FSKILL.md` exists (health monitoring).\n- If the purpose doesn't match any theme, fall back to `[reflect, heartbeat]` (filtered against existence).\n- **Validate every candidate** — drop any skill where `skills\u002F${skill}\u002FSKILL.md` doesn't exist; log each drop as `SPAWN_DROPPED_SKILL: ${skill}`.\n- If the final list is empty (no content skills survive), exit `SPAWN_NO_SKILLS`, notify, and **stop**.\n\nSave the final list as `SKILLS_ENABLED`.\n\n### 5. Fork the parent repo\n\n```bash\nif gh api \"repos\u002F${OWNER}\u002F${REPO_NAME}\" --jq '.full_name' >\u002Fdev\u002Fnull 2>&1; then\n  FORK_STATE=\"exists\"\nelse\n  # Try the modern flag first\n  if ! gh repo fork \"${PARENT_UPSTREAM}\" --fork-name \"${REPO_NAME}\" --clone=false 2>\u002Fdev\u002Fnull; then\n    # Fallback: POST to \u002Frepos\u002F{owner}\u002F{repo}\u002Fforks with a custom name\n    gh api \"repos\u002F${PARENT_UPSTREAM}\u002Fforks\" -X POST -f name=\"${REPO_NAME}\" --jq '.full_name' \\\n      || { echo \"SPAWN_FORK_FAILED\"; exit 1; }\n  fi\n  FORK_STATE=\"created\"\nfi\n```\n\n**Wait for fork availability** (GitHub forks are async):\n```bash\nfor i in $(seq 1 10); do\n  gh api \"repos\u002F${OWNER}\u002F${REPO_NAME}\" --jq '.full_name' >\u002Fdev\u002Fnull 2>&1 && break\n  sleep 3\ndone\ngh api \"repos\u002F${OWNER}\u002F${REPO_NAME}\" --jq '.full_name' >\u002Fdev\u002Fnull 2>&1 \\\n  || { echo \"SPAWN_FORK_FAILED: fork not reachable after wait\"; exit 1; }\n```\n\n### 6. Configure the fork\n\n```bash\nTMPDIR=$(mktemp -d)\ntrap 'rm -rf \"$TMPDIR\"' EXIT\ngh repo clone \"${OWNER}\u002F${REPO_NAME}\" \"$TMPDIR\u002Frepo\" -- --quiet \\\n  || { echo \"SPAWN_API_ERROR: clone failed\"; exit 1; }\ncd \"$TMPDIR\u002Frepo\"\ngit config user.name \"aeonframework\"\ngit config user.email \"aeonframework@proton.me\"\n```\n\n#### 6a. Write a customized `aeon.yml`\n\n- Read the parent `aeon.yml` as a base (preserves comments, ordering, and the full skill list).\n- Set `enabled: true` only on skills in `SKILLS_ENABLED`. All others must have `enabled: false`.\n- Do not drop any skills — keep the full inventory so the child can enable more later.\n- **Validate the result**: every skill name with `enabled: true` must correspond to an existing `skills\u002F${skill}\u002FSKILL.md` in the fork's tree. If any enabled skill is missing, abort before pushing (this is a sanity check — step 4 already validated, but the child's repo tree must match).\n\n#### 6b. Write `SETUP.md` dynamically\n\nParse each enabled skill's `skills\u002F${skill}\u002FSKILL.md` for references to uppercase env var names (pattern: `[A-Z][A-Z0-9_]{2,}_(KEY|TOKEN|URL|ID|SECRET)`). Collect the union across enabled skills, excluding built-ins (`GITHUB_TOKEN`, `GH_TOKEN`).\n\nEmit a SETUP.md with three sections:\n\n```markdown\n# Aeon Instance Setup\n\nThis is a managed Aeon instance spawned from `${PARENT_UPSTREAM}`.\n\n## Purpose\n${PURPOSE}\n\n## Enabled Skills\n${comma-separated list with one-line descriptions from each SKILL.md}\n\n## Activate This Instance\n\nGo to **Settings > Secrets and variables > Actions** and add these secrets:\n\n### Required (pick one for Claude auth)\n| Secret | Description |\n|--------|------------|\n| `ANTHROPIC_API_KEY` | Anthropic API key — console.anthropic.com |\n| `CLAUDE_CODE_OAUTH_TOKEN` | Alternative: Claude Code OAuth token |\n\n### Recommended (notifications)\n| Secret | Description |\n|--------|------------|\n| `TELEGRAM_BOT_TOKEN` | Telegram bot token |\n| `TELEGRAM_CHAT_ID` | Telegram chat ID |\n| `DISCORD_WEBHOOK_URL` | Discord webhook URL |\n| `SLACK_WEBHOOK_URL` | Slack webhook URL |\n\n### Required by your enabled skills\n${one row per detected env var, with the list of skills that reference it}\n\n## Fleet Parent\nManaged by `${PARENT_UPSTREAM}`. The parent can dispatch skills and monitor health via `fleet-control`.\n\n## Security Note\nThis instance has NO access to the parent's secrets. Each instance maintains its own API keys and credentials.\n```\n\nIf no env vars are detected beyond the required\u002Frecommended set, omit the \"Required by your enabled skills\" section header (don't leave an empty table).\n\n#### 6c. Update `CLAUDE.md` idempotently\n\nFind the heading line `## About This Repo` (or the first `## ` section if not present). Under it, insert exactly one line:\n```\n- Managed instance of ${PARENT_UPSTREAM}. Purpose: ${PURPOSE}.\n```\n\nIf a line starting with `- Managed instance of` already exists, replace it rather than appending a duplicate.\n\n#### 6d. Reset child memory\n\nThe child starts with a clean slate:\n\n```bash\n# Reset MEMORY.md to a minimal template\ncat > memory\u002FMEMORY.md \u003C\u003CEOF\n# Long-term Memory\n*Last consolidated: never*\n\n## About This Repo\n- Aeon instance of ${PARENT_UPSTREAM}. Purpose: ${PURPOSE}.\n\n## Next Priorities\n- Configure secrets per SETUP.md\n- Wait for first scheduled skill to run\nEOF\n\n# Clear logs, state, topics — safe paths only, never follow symlinks\nfind memory\u002Flogs -mindepth 1 -type f -delete 2>\u002Fdev\u002Fnull || true\nfind memory\u002Ftopics -mindepth 1 -type f -delete 2>\u002Fdev\u002Fnull || true\nfind memory\u002Fissues -mindepth 1 -type f ! -name 'INDEX.md' -delete 2>\u002Fdev\u002Fnull || true\n[ -f memory\u002Fissues\u002FINDEX.md ] && echo \"# Issues — none open\" > memory\u002Fissues\u002FINDEX.md\necho '{}' > memory\u002Fcron-state.json\n# Do NOT clear memory\u002Finstances.json on the child — the child has none.\nrm -f memory\u002Finstances.json 2>\u002Fdev\u002Fnull || true\n```\n\n#### 6e. Commit and push\n\n```bash\ngit add -A\ngit commit -m \"chore: configure instance — ${PURPOSE}\n\nSkills enabled: ${SKILLS_ENABLED_CSV}\nParent: ${PARENT_UPSTREAM}\nSpawned: ${today}\"\ngit push origin main 2>\u002Fdev\u002Fnull \\\n  || git push origin HEAD:main 2>\u002Fdev\u002Fnull \\\n  || { echo \"SPAWN_PUSH_FAILED\"; cd - >\u002Fdev\u002Fnull; exit 1; }\ncd - >\u002Fdev\u002Fnull\n```\n\nIf push fails, **do not delete the fork** — leave it for manual inspection and notify with:\n```\nspawn-instance: fork created but push failed for ${OWNER}\u002F${REPO_NAME}.\nRecover with: gh repo clone ${OWNER}\u002F${REPO_NAME} && push manually, then re-register.\n```\n\n### 7. Enable GitHub Actions on the fork\n\nForks have Actions disabled by default. Use **typed** booleans (`-F`, not `-f`, or `enabled=true` is sent as the string \"true\"):\n\n```bash\ngh api \"repos\u002F${OWNER}\u002F${REPO_NAME}\u002Factions\u002Fpermissions\" -X PUT \\\n  -F enabled=true -f allowed_actions=all \\\n  || { echo \"SPAWN_ACTIONS_FAILED\"; exit 1; }\n```\n\n### 8. Post-flight verification\n\n```bash\n# Fork reachable\ngh api \"repos\u002F${OWNER}\u002F${REPO_NAME}\" --jq '.full_name' >\u002Fdev\u002Fnull \\\n  || { echo \"SPAWN_API_ERROR: post-flight fork check failed\"; exit 1; }\n\n# Our commit is HEAD\nHEAD_SHA=$(gh api \"repos\u002F${OWNER}\u002F${REPO_NAME}\u002Fcommits\u002Fmain\" --jq '.sha' 2>\u002Fdev\u002Fnull)\n[ -n \"$HEAD_SHA\" ] || { echo \"SPAWN_API_ERROR: post-flight HEAD check failed\"; exit 1; }\n\n# Actions enabled\nACTIONS_ON=$(gh api \"repos\u002F${OWNER}\u002F${REPO_NAME}\u002Factions\u002Fpermissions\" --jq '.enabled' 2>\u002Fdev\u002Fnull)\n[ \"$ACTIONS_ON\" = \"true\" ] || { echo \"SPAWN_ACTIONS_FAILED: post-flight\"; exit 1; }\n```\n\n### 9. Register the instance\n\nUpdate `memory\u002Finstances.json` in the **parent** repo. Append:\n```json\n{\n  \"name\": \"${NAME}\",\n  \"repo\": \"${OWNER}\u002F${REPO_NAME}\",\n  \"purpose\": \"${PURPOSE}\",\n  \"created\": \"${today}\",\n  \"status\": \"pending_secrets\",\n  \"skills_enabled\": ${SKILLS_ENABLED_JSON},\n  \"parent\": \"${PARENT_UPSTREAM}\"\n}\n```\n\nIf `FORK_STATE == \"exists\"` at step 5, the final exit status is `SPAWN_FORK_EXISTS_RECOVERED`, otherwise `SPAWN_OK`.\n\n### 10. Log to memory\n\nAppend to `memory\u002Flogs\u002F${today}.md`:\n```\n### spawn-instance\n- Status: ${EXIT_CODE}\n- Instance: ${OWNER}\u002F${REPO_NAME}\n- Purpose: ${PURPOSE}\n- Skills: ${SKILLS_ENABLED_CSV}\n- Dropped skills: ${DROPPED_CSV or \"(none)\"}\n- Actions enabled: yes\n```\n\n### 11. Notify via `.\u002Fnotify`\n\nOn success (`SPAWN_OK` or `SPAWN_FORK_EXISTS_RECOVERED`):\n```\n*New Aeon Instance*\n\nRepo: ${OWNER}\u002F${REPO_NAME}\nPurpose: ${PURPOSE}\nSkills (${N}): ${SKILLS_ENABLED_CSV}\nStatus: ${EXIT_CODE} — PENDING SECRETS\n\nActivate:\n1. https:\u002F\u002Fgithub.com\u002F${OWNER}\u002F${REPO_NAME}\u002Fsettings\u002Fsecrets\u002Factions\n2. Add ANTHROPIC_API_KEY (or CLAUDE_CODE_OAUTH_TOKEN)\n3. Add TELEGRAM_BOT_TOKEN + TELEGRAM_CHAT_ID (or Discord\u002FSlack)\n\nSee SETUP.md in the repo for the full secret list tailored to your enabled skills.\n```\n\nOn refusal (`SPAWN_FORK_EXISTS_REGISTERED`, `SPAWN_INVALID_VAR`, `SPAWN_NO_SKILLS`):\n```\nspawn-instance: ${EXIT_CODE} — ${one-line reason}. No changes made.\n```\n\nOn failure (`SPAWN_FORK_FAILED`, `SPAWN_PUSH_FAILED`, `SPAWN_ACTIONS_FAILED`, `SPAWN_API_ERROR`):\n```\nspawn-instance FAILED: ${EXIT_CODE}\nTarget: ${OWNER}\u002F${REPO_NAME}\nRecovery: ${one-line recovery instruction}\n```\n\n## Network note\n\nThis skill runs entirely through `gh` CLI, which handles auth internally, so no bare `$SECRET` ever lands on the command line for the Bash permission layer to refuse. No WebFetch fallback needed. If `gh` is missing or unauthenticated, the pre-flight step fails with `SPAWN_API_ERROR`.\n\n## Constraints\n\n- **No secret propagation.** Never read or write `ANTHROPIC_API_KEY`, `TELEGRAM_*`, `DISCORD_*`, `SLACK_*`, or any API key into the child repo. The whole security model depends on this.\n- **No hardcoded skill list.** Always enumerate `skills\u002F*\u002FSKILL.md` at runtime to avoid referencing renamed or removed skills.\n- **Idempotent.** Re-running with the same `${var}` must never produce duplicate registry entries, duplicate CLAUDE.md lines, or a second fork.\n- **Never delete a fork.** If anything fails partway through, leave the fork in place and emit recovery guidance — the operator is the only party authorized to delete it.\n- **Never push to the parent without committing `memory\u002Finstances.json` via the normal Aeon workflow.** The parent commit happens through the same path as any other skill output.\n\nWrite complete, working code. No TODOs or placeholders.\n",{"name":5,"metadata":23,"description":7},{"var":24,"tags":25,"title":27,"category":28},"",[26],"dev","Spawn Instance","core","main","fa8f75cd49adcad9214508fdb5d1ead8fab420be","skills\u002Fspawn-instance","https:\u002F\u002Fgithub.com\u002FLiamVisionary\u002Faeon-template","https:\u002F\u002Fgithub.com\u002FLiamVisionary","2026-11-15 04:34:04",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add LiamVisionary\u002Faeon-template --skill spawn-instance",{"tool":41,"command":42},"bunx","bunx skills add LiamVisionary\u002Faeon-template --skill spawn-instance",{"tool":44,"command":45},"pnpm","pnpm dlx skills add LiamVisionary\u002Faeon-template --skill spawn-instance","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLiamVisionary\u002Faeon-template\u002Fblob\u002Fmain\u002Fskills\u002Fspawn-instance\u002FSKILL.md",true,[],[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":18},"01M7D6W8WRJH3JVJ2JQ674AD77","you-web-search","Web search using You.com Search API with high-quality, cited results and optional real-time web crawling","https:\u002F\u002Fgithub.com\u002FLiamVisionary\u002Faeon-template\u002Fblob\u002Fmain\u002Fskills\u002Fyou-web-search\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":18},"01M7D6W2XPBZZPPXPX76WMPSDA","write-tweet","Multi-format tweet studio - standalone drafts (10 across 5 size tiers), a 5-10 tweet thread, or 10 remixes of past tweets, selected via ${var}","https:\u002F\u002Fgithub.com\u002FLiamVisionary\u002Faeon-template\u002Fblob\u002Fmain\u002Fskills\u002Fwrite-tweet\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":18},"01M7D6VZVWK4RATPHM90N71QZD","weekly-aeoncard","Build a weekly token-consumption recap image from memory\u002Ftoken-usage.csv - this week + all-time totals, top skills, rendered as a shareable SVG card.","https:\u002F\u002Fgithub.com\u002FLiamVisionary\u002Faeon-template\u002Fblob\u002Fmain\u002Fskills\u002Fweekly-aeoncard\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M7D6VQ7H3DHAAP0BEWTC3HK4","vuln-tracker","One lifecycle poll over everything vuln-scanner produces - PR and advisory status, PVR triage transitions, and pending-disclosure aging, with a stars-secured impact headline and one action queue.","https:\u002F\u002Fgithub.com\u002FLiamVisionary\u002Faeon-template\u002Fblob\u002Fmain\u002Fskills\u002Fvuln-tracker\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M7D6VDRA94RJKDPKJ65S47KT","vuln-scanner","Audit trending repos for real security vulnerabilities and disclose responsibly - scan and route findings (PVR \u002F dependency PR), re-submit queued advisories, and send armed email disclosures","https:\u002F\u002Fgithub.com\u002FLiamVisionary\u002Faeon-template\u002Fblob\u002Fmain\u002Fskills\u002Fvuln-scanner\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":18},"01M7D6V8BNPHCTPJBJD89H8DZF","video-script","Turn a repo, product page, or update into a recording-ready video script in a receipts-first format - verifies every claim against live sources, then writes timestamped VO + on-screen direction with a plain-language glossary, assets checklist, anti-tells, and a verify-before-recording list","https:\u002F\u002Fgithub.com\u002FLiamVisionary\u002Faeon-template\u002Fblob\u002Fmain\u002Fskills\u002Fvideo-script\u002FSKILL.md",[],[]]