Skip to content

zenstory-ai/oh-story-claudecode / skills/story-setup

story-setup

Flagged

网文写作工具集基础设施部署与检查。为 Claude Code / OpenCode / Codex / Google Antigravity / ZCode / OpenClaw / Reasonix 提供内置适配;Web AI / 通用 Agent 可走 skills + AGENTS.md 文件模式。触发方式:/story-setup、$story-setup、「准备写书」「帮我搭一下环境」「配置写作项目」「检查写作环境」。

FileKindSize
SKILL.mdskill md16.8 KB
UPGRADING.mdmarkdown17.1 KB
references/agent-references/agent-quality.mdmarkdown3.7 KB
references/agent-references/agent-reference-profiles.mdmarkdown4.3 KB
references/agent-references/banned-words.mdmarkdown10.9 KB
references/agent-references/benchmark-style-load.mdmarkdown10.1 KB
references/agent-references/character-basics.mdmarkdown12.3 KB
references/agent-references/character-relations.mdmarkdown10.2 KB
references/agent-references/cross-book-recall.mdmarkdown3.9 KB
references/agent-references/deslop-gates.mdmarkdown2.3 KB
references/agent-references/dialogue-mastery.mdmarkdown11.0 KB
references/agent-references/expression.mdmarkdown9.6 KB
references/agent-references/female-audience-writing.mdmarkdown7.5 KB
references/agent-references/format-and-structure.mdmarkdown8.0 KB
references/agent-references/genre-prose-cards.mdmarkdown7.0 KB
references/agent-references/genre-prose-cards/东方仙侠.mdmarkdown2.3 KB
references/agent-references/genre-prose-cards/传统玄幻.mdmarkdown1.9 KB
references/agent-references/genre-prose-cards/历史古代.mdmarkdown1.7 KB
references/agent-references/genre-prose-cards/历史脑洞.mdmarkdown2.0 KB
references/agent-references/genre-prose-cards/双男主.mdmarkdown2.3 KB
references/agent-references/genre-prose-cards/古言脑洞.mdmarkdown1.8 KB
references/agent-references/genre-prose-cards/古风世情.mdmarkdown2.3 KB
references/agent-references/genre-prose-cards/女频悬疑.mdmarkdown1.8 KB
references/agent-references/genre-prose-cards/女频种田.mdmarkdown1.8 KB
references/agent-references/genre-prose-cards/宫斗宅斗.mdmarkdown1.6 KB
references/agent-references/genre-prose-cards/年代.mdmarkdown2.1 KB
references/agent-references/genre-prose-cards/快穿.mdmarkdown1.9 KB
references/agent-references/genre-prose-cards/悬疑灵异.mdmarkdown1.7 KB
references/agent-references/genre-prose-cards/悬疑脑洞.mdmarkdown1.9 KB
references/agent-references/genre-prose-cards/战神赘婿.mdmarkdown1.9 KB
references/agent-references/genre-prose-cards/抗战谍战.mdmarkdown1.8 KB
references/agent-references/genre-prose-cards/星光璀璨.mdmarkdown1.8 KB
references/agent-references/genre-prose-cards/民国言情.mdmarkdown1.9 KB
references/agent-references/genre-prose-cards/流派兜底.mdmarkdown8.4 KB
references/agent-references/genre-prose-cards/游戏体育.mdmarkdown1.9 KB
references/agent-references/genre-prose-cards/玄幻脑洞.mdmarkdown2.0 KB
references/agent-references/genre-prose-cards/玄幻言情.mdmarkdown1.7 KB
references/agent-references/genre-prose-cards/现言脑洞.mdmarkdown1.8 KB
references/agent-references/genre-prose-cards/科幻末世.mdmarkdown1.7 KB
references/agent-references/genre-prose-cards/职场婚恋.mdmarkdown1.7 KB
references/agent-references/genre-prose-cards/西方奇幻.mdmarkdown1.9 KB
references/agent-references/genre-prose-cards/豪门总裁.mdmarkdown2.3 KB
references/agent-references/genre-prose-cards/都市修真.mdmarkdown1.7 KB
references/agent-references/genre-prose-cards/都市日常.mdmarkdown2.8 KB
references/agent-references/genre-prose-cards/都市种田.mdmarkdown1.7 KB
references/agent-references/genre-prose-cards/都市脑洞.mdmarkdown2.4 KB
references/agent-references/genre-prose-cards/都市高武.mdmarkdown2.0 KB
references/agent-references/genre-prose-cards/青春甜宠.mdmarkdown1.8 KB
references/agent-references/genre-readers.mdmarkdown6.9 KB
references/agent-references/long-chapter-hooks.mdmarkdown6.5 KB
references/agent-references/long-emotional-methods.mdmarkdown7.9 KB
references/agent-references/long-genre-catalog.mdmarkdown11.9 KB
references/agent-references/long-genre-mechanics.mdmarkdown8.3 KB
references/agent-references/long-quality.mdmarkdown3.2 KB
references/agent-references/long-reversal.mdmarkdown12.3 KB
references/agent-references/long-suspense.mdmarkdown9.2 KB
references/agent-references/narrative-focus.mdmarkdown6.7 KB
references/agent-references/opening-design.mdmarkdown4.5 KB
references/agent-references/outline-methods.mdmarkdown12.5 KB
references/agent-references/plot-core-methods.mdmarkdown5.3 KB
references/agent-references/short-chapter-hooks.mdmarkdown8.0 KB
references/agent-references/short-emotional-methods.mdmarkdown4.6 KB
references/agent-references/short-genre-formulas.mdmarkdown18.8 KB
references/agent-references/short-quality.mdmarkdown2.8 KB
references/agent-references/short-reversal.mdmarkdown12.7 KB
references/agent-references/story-logic.mdmarkdown5.9 KB
references/agent-references/style-combat-face.mdmarkdown9.1 KB
references/agent-references/style-resolution.mdmarkdown3.0 KB
references/agent-references/writing-craft.mdmarkdown23.6 KB
references/antigravity/hooks/hooks.jsonconfig1.0 KB
references/antigravity/hooks/story_antigravity_hook.jsscript8.3 KB
references/antigravity/hooks/story_hook_core.jsscript59.9 KB
references/antigravity/rules/oh-story.mdmarkdown3.7 KB
references/codex/AGENTS.md.tmplother3.8 KB
references/codex/agents/chapter-extractor.tomlconfig14.0 KB
references/codex/agents/character-designer.tomlconfig5.1 KB
references/codex/agents/consistency-checker.tomlconfig12.0 KB
references/codex/agents/narrative-writer.tomlconfig15.7 KB
references/codex/agents/story-architect.tomlconfig9.0 KB
references/codex/agents/story-explorer.tomlconfig11.7 KB
references/codex/agents/story-researcher.tomlconfig10.6 KB
references/codex/hooks/hooks.jsonconfig6.8 KB
references/codex/hooks/run-story-hook.cmdscript699 B
references/codex/hooks/run-story-hook.shexecutablescript769 B
references/codex/hooks/story_codex_hook.pyexecutablescript74.2 KB
references/deploy-antigravity.mdmarkdown8.8 KB
references/deploy-claude-code.mdmarkdown7.6 KB
references/deploy-codex.mdmarkdown6.0 KB
references/deploy-generic.mdmarkdown2.5 KB
references/deploy-openclaw.mdmarkdown3.0 KB
references/deploy-opencode.mdmarkdown14.7 KB
references/deploy-reasonix.mdmarkdown3.5 KB
references/deploy-zcode.mdmarkdown7.5 KB
references/diagnostics.mdmarkdown4.3 KB
references/generic/AGENTS.md.tmplother4.4 KB
references/openclaw/AGENTS.md.tmplother5.0 KB
references/opencode/AGENTS.md.tmplother3.2 KB
references/opencode/agents/chapter-extractor.mdmarkdown13.8 KB
references/opencode/agents/character-designer.mdmarkdown4.7 KB
references/opencode/agents/consistency-checker.mdmarkdown11.5 KB
references/opencode/agents/narrative-writer.mdmarkdown15.3 KB
references/opencode/agents/story-architect.mdmarkdown8.5 KB
references/opencode/agents/story-explorer.mdmarkdown11.2 KB
references/opencode/agents/story-researcher.mdmarkdown10.1 KB
references/opencode/commands/browser-cdp.mdmarkdown284 B
references/opencode/commands/story-cover.mdmarkdown189 B
references/opencode/commands/story-deslop.mdmarkdown222 B
references/opencode/commands/story-import.mdmarkdown235 B
references/opencode/commands/story-long-analyze.mdmarkdown214 B
references/opencode/commands/story-long-scan.mdmarkdown232 B
references/opencode/commands/story-long-write.mdmarkdown200 B
references/opencode/commands/story-publish.mdmarkdown224 B
references/opencode/commands/story-review.mdmarkdown212 B
references/opencode/commands/story-setup.mdmarkdown322 B
references/opencode/commands/story-short-analyze.mdmarkdown209 B
references/opencode/commands/story-short-scan.mdmarkdown215 B
references/opencode/commands/story-short-write.mdmarkdown192 B
references/opencode/commands/story.mdmarkdown243 B
references/opencode/plugin.tsscript12.2 KB
references/opencode/pre-commit.shscript4.3 KB
references/opencode/story_hook_core.jsscript59.9 KB
references/reasonix/AGENTS.md.tmplother5.3 KB
references/templates/.gitkeepother0 B
references/templates/CLAUDE.md.tmplother3.2 KB
references/templates/agents/chapter-extractor.mdmarkdown13.9 KB
references/templates/agents/character-designer.mdmarkdown4.5 KB
references/templates/agents/consistency-checker.mdmarkdown11.3 KB
references/templates/agents/narrative-writer.mdmarkdown15.2 KB
references/templates/agents/story-architect.mdmarkdown8.4 KB
references/templates/agents/story-explorer.mdmarkdown10.9 KB
references/templates/agents/story-researcher.mdmarkdown10.0 KB
references/templates/hooks/check-prose-after-write.shscript6.0 KB
references/templates/hooks/detect-story-gaps.shexecutablescript7.0 KB
references/templates/hooks/guard-outline-before-prose.shscript14.4 KB
references/templates/hooks/lib/common.shscript7.7 KB
references/templates/hooks/lib/sentinel.shscript1.5 KB
references/templates/hooks/post-compact.shexecutablescript698 B
references/templates/hooks/pre-compact.shexecutablescript1.0 KB
references/templates/hooks/session-end.shexecutablescript946 B
references/templates/hooks/session-start.shexecutablescript11.2 KB
references/templates/hooks/story_hook_cli.jsscript10.6 KB
references/templates/hooks/story_hook_core.jsscript59.9 KB
references/templates/hooks/validate-story-commit.shexecutablescript6.4 KB
references/templates/rules/story-consistency.mdmarkdown2.5 KB
references/templates/rules/story-format.mdmarkdown3.4 KB
references/templates/rules/story-narrative.mdmarkdown1.5 KB
references/templates/rules/story-outline.mdmarkdown3.5 KB
references/templates/settings-hooks.jsonconfig2.0 KB
references/zcode/AGENTS.md.tmplother4.4 KB
references/zcode/agents/chapter-extractor.mdmarkdown13.5 KB
references/zcode/agents/character-designer.mdmarkdown4.4 KB
references/zcode/agents/consistency-checker.mdmarkdown11.3 KB
references/zcode/agents/narrative-writer.mdmarkdown15.0 KB
references/zcode/agents/story-architect.mdmarkdown8.3 KB
references/zcode/agents/story-explorer.mdmarkdown11.0 KB
references/zcode/agents/story-researcher.mdmarkdown9.9 KB
references/zcode/commands/browser-cdp.mdmarkdown221 B
references/zcode/commands/story-cover.mdmarkdown204 B
references/zcode/commands/story-deslop.mdmarkdown234 B
references/zcode/commands/story-import.mdmarkdown200 B
references/zcode/commands/story-long-analyze.mdmarkdown218 B
references/zcode/commands/story-long-scan.mdmarkdown206 B
references/zcode/commands/story-long-write.mdmarkdown202 B
references/zcode/commands/story-publish.mdmarkdown247 B
references/zcode/commands/story-review.mdmarkdown217 B
references/zcode/commands/story-setup.mdmarkdown363 B
references/zcode/commands/story-short-analyze.mdmarkdown214 B
references/zcode/commands/story-short-scan.mdmarkdown217 B
references/zcode/commands/story-short-write.mdmarkdown204 B
references/zcode/commands/story.mdmarkdown221 B
references/zcode/config.json.patchother1.7 KB
references/zcode/hooks/hooks.jsonconfig1.6 KB
references/zcode/hooks/story_hook_core.jsscript59.9 KB
references/zcode/hooks/story_zcode_hook.jsexecutablescript6.7 KB
scripts/copy-path-safety.pyexecutablescript5.1 KB
scripts/deploy-antigravity-skills.pyexecutablescript4.5 KB
scripts/generate-antigravity-agents.mjsexecutablescript12.4 KB
scripts/merge-antigravity-hooks.pyexecutablescript2.3 KB
scripts/merge-claude-settings.pyexecutablescript4.6 KB
scripts/merge-codex-hooks.pyscript5.2 KB
scripts/merge-project-instructions.pyscript10.5 KB

scripts/generate-antigravity-agents.mjs

View on GitHub
#!/usr/bin/env node
"use strict"

// Generate Antigravity 2.0 Markdown agents from the Claude Markdown source of
// truth. Antigravity and Claude both use Markdown bodies, but their frontmatter,
// tool names, model tiers, and deployed reference roots differ.

import fs from "node:fs"
import path from "node:path"
import process from "node:process"
import { fileURLToPath } from "node:url"

const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url))
const DEFAULT_SOURCE = path.resolve(SCRIPT_DIR, "../references/templates/agents")
const DEFAULT_DEST = path.resolve(SCRIPT_DIR, "../references/antigravity/agents")

const TOOL_MAP = new Map([
  ["Read", ["view_file"]],
  ["Glob", ["find_by_name"]],
  ["Grep", ["grep_search"]],
  ["Write", ["write_to_file"]],
  ["Edit", ["replace_file_content", "multi_replace_file_content"]],
  ["Bash", ["run_command"]],
])
const CAPABILITY_FIELDS = new Set(["tools", "disallowedTools"])
const CAPABILITY_NAME_RE = /^[A-Za-z][A-Za-z0-9_-]*$/

function fail(message) {
  process.stderr.write(`generate-antigravity-agents: ${message}\n`)
  process.exit(2)
}

function parseArgs(argv) {
  const result = { source: DEFAULT_SOURCE, dest: DEFAULT_DEST }
  for (let index = 0; index < argv.length; index++) {
    const token = argv[index]
    if (token === "--source" || token === "--dest") {
      const value = argv[++index]
      if (!value) fail(`${token} requires a path`)
      result[token.slice(2)] = path.resolve(value)
    } else {
      fail(`unknown argument: ${token}`)
    }
  }
  return result
}

function parseFrontmatter(text, source) {
  const normalized = text.replace(/^\uFEFF/, "").replace(/\r\n?/g, "\n")
  if (!normalized.startsWith("---\n")) fail(`${source}: missing frontmatter`)
  const end = normalized.indexOf("\n---\n", 4)
  if (end < 0) fail(`${source}: unterminated frontmatter`)
  const raw = normalized.slice(4, end)
  const body = normalized.slice(end + 5).replace(/^\s+/, "")
  const data = {}
  const lines = raw.split(/\r?\n/)
  for (let index = 0; index < lines.length; index++) {
    const match = lines[index].match(/^([A-Za-z_][A-Za-z0-9_-]*):(?:\s*(.*))?$/)
    if (!match) continue
    const [, key, rawValue = ""] = match
    if (rawValue.trim() === "|") {
      const block = []
      while (index + 1 < lines.length && /^(?:\s|$)/.test(lines[index + 1])) {
        const line = lines[++index]
        block.push(line.startsWith("  ") ? line.slice(2) : line.trimStart())
      }
      data[key] = block.join("\n").trim()
    } else {
      const value = rawValue.trim()
      data[key] = CAPABILITY_FIELDS.has(key)
        ? value
        : value.replace(/^['"]|['"]$/g, "")
    }
  }
  return { data, body }
}

function parseCapabilityList(value, field, source) {
  if (value === undefined) return []
  if (!value) fail(`${source}: ${field}: empty or block-style capability declarations are unsupported`)
  const match = String(value).match(/^\[\s*(.*?)\s*\]$/)
  if (!match) fail(`${source}: ${field}: expected an inline list like [Read, Glob]`)
  if (!match[1].trim()) return []
  return match[1].split(",").map((rawItem) => {
    let item = rawItem.trim()
    if (!item) fail(`${source}: ${field}: empty capability-list item`)
    if (item[0] === '"' || item[0] === "'") {
      const quote = item[0]
      if (item.length < 2 || item.at(-1) !== quote || item.slice(1, -1).includes(quote)) {
        fail(`${source}: ${field}: malformed quoted capability ${JSON.stringify(item)}`)
      }
      item = item.slice(1, -1)
    } else if (item.includes('"') || item.includes("'")) {
      fail(`${source}: ${field}: malformed quoted capability ${JSON.stringify(item)}`)
    }
    if (!CAPABILITY_NAME_RE.test(item)) {
      fail(`${source}: ${field}: invalid capability name ${JSON.stringify(item)}`)
    }
    if (!TOOL_MAP.has(item)) {
      fail(`${source}: ${field}: unsupported Antigravity capability ${JSON.stringify(item)}`)
    }
    return item
  })
}

function parseInlineList(value) {
  const match = String(value || "").match(/^\[(.*)\]$/)
  if (!match) return []
  return match[1].split(",").map((item) => item.trim().replace(/^['"]|['"]$/g, "")).filter(Boolean)
}

function adaptBody(body, name, tools) {
  let adapted = body
    .replaceAll(".claude/skills/story-setup/references/agent-references/", ".agents/skills/story-setup/references/agent-references/")
    .replaceAll("当前 Claude 部署", "当前 Antigravity 部署")
    .replaceAll("Claude Code subagent", "Antigravity custom subagent")
    .replaceAll("subagent_type", "TypeName")

  for (const [source, targets] of TOOL_MAP) {
    adapted = adapted.replace(new RegExp(`\\b${source}\\b`, "g"), targets.join("/"))
  }

  if (name === "story-researcher") {
    adapted = adapted
      .replace("WebSearch/webReader 作为兜底。", "CDP 不可用时返回结构化缺口,由父会话完成联网检索。")
      .replace("**核心原则:CDP 优先,WebSearch 兜底。**", "**核心原则:只在 CDP 可用时研究;否则交回父会话。**")
      .replace("CDP 能打开真实页面拿到完整正文;WebSearch 只返回摘要节选,信息量远不如全文。", "Antigravity custom subagent 只通过 `run_command` 使用 CDP;不假定存在额外联网工具。")
      .replace("3. WebSearch / webReader → 兜底(CDP 不可用或页面打不开时)", "3. CDP 不可用或页面打不开 → 返回结构化 research gap,由父会话继续")
      .replaceAll("直接降级到 WebSearch/webReader", "返回结构化 research gap,由父会话继续")
      .replaceAll("降级到 WebSearch/webReader 兜底", "返回结构化 research gap,由父会话继续")
      .replaceAll("降级到 WebSearch", "返回结构化 research gap,由父会话继续")
      .replace(
        /### 第四步:WebSearch\/webReader(兜底)[\s\S]*?(?=\n### 第五步:整理输出)/,
        "### 第四步:CDP 不可用时交回父会话\n\n返回 `status: \"failed\"`,在 `gaps` 中说明 CDP 不可用或页面提取失败,并给出建议检索词与候选来源类型。不要自行声称已调用联网兜底,也不要编造内容。\n",
      )
      .replace("{google | bing | websearch}", "{google | bing}")
  }

  const researchNote = name === "story-researcher"
    ? "- This custom subagent has no WebSearch/webReader tool. Prefer CDP through `run_command`; if CDP is unavailable, return a structured research gap to the parent agent and never claim that web fallback ran.\n"
    : ""

  return `${adapted.trimEnd()}\n\n---\n\nAntigravity adaptation notes:\n` +
    `- Call this agent through \`invoke_subagent\` with \`TypeName: "${name}"\`, a concise \`Role\`, and \`Prompt\`; \`invoke_subagent\` runs asynchronously in the background, so deliver the final structured result or receipt back to the parent conversation via \`send_message\` (or final reply) when done.\n` +
    "- In Antigravity CLI (`agy` / `oneharness`), frontmatter tools `view_file`, `write_to_file`, and `replace_file_content` alias to runtime tool declarations `read_file`, `write_file`, and `edit_file` (with file path argument `Path`). If `find_by_name` or `grep_search` is not exposed in CLI mode, read concrete file paths passed by the parent agent via `read_file` (`view_file`) or use `run_command` only when declared in frontmatter `tools`.\n" +
    "- If the Antigravity runtime does not expose custom subagents, fall back to solo/direct execution and report the fallback.\n" +
    "- Stay within this agent's role boundary; return adjacent work to the parent agent.\n" +
    "- Use only `.agents/skills/story-setup/references/agent-references/`; if it is missing, report an incomplete deployment instead of probing other CLI roots.\n" +
    "- Antigravity tool names and frontmatter are authoritative; do not assume Claude-only fields exist.\n" +
    researchNote
}

function renderAgent(sourceFile) {
  const text = fs.readFileSync(sourceFile, "utf8")
  const { data, body } = parseFrontmatter(text, sourceFile)
  const name = data.name || path.basename(sourceFile, ".md")
  if (name !== path.basename(sourceFile, ".md") || !/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(name)) {
    fail(`${sourceFile}: unsafe or mismatched agent name ${JSON.stringify(name)}`)
  }
  if (!data.description) fail(`${sourceFile}: missing description`)
  if (data.tools === undefined) fail(`${sourceFile}: tools: Antigravity requires an explicit tool list`)
  const sourceTools = parseCapabilityList(data.tools, "tools", sourceFile)
  const deniedTools = new Set(parseCapabilityList(data.disallowedTools, "disallowedTools", sourceFile))
  const effectiveSourceTools = sourceTools.filter((tool) => !deniedTools.has(tool))
  const tools = [...new Set(effectiveSourceTools.flatMap((tool) => TOOL_MAP.get(tool)))]
  if (!tools.length) fail(`${sourceFile}: no supported Antigravity tools mapped`)
  const sourceModel = String(data.model || "").toLowerCase()
  const model = sourceModel === "haiku" ? "flash" : "pro"
  const sourceSkills = parseInlineList(data.skills)
  const description = name === "story-researcher"
    ? String(data.description).replace("WebSearch/webReader 作为兜底", "CDP 不可用时返回缺口,由父会话联网检索")
    : String(data.description)

  const frontmatter = [
    "---",
    `name: ${name}`,
    "description: |",
    ...description.split("\n").map((line) => `  ${line}`),
    "tools:",
    ...tools.map((tool) => `  - ${tool}`),
    "mainAgent: false",
    "subagent: true",
    `model: ${model}`,
    "commandExecutionPolicy: sandbox",
  ]
  if (sourceSkills.length) {
    frontmatter.push("skills:", ...sourceSkills.map((skill) => `  - skills/${skill}`))
  }
  frontmatter.push("---", "")
  return `${frontmatter.join("\n")}\n${adaptBody(body, name, tools)}`
}

function prepareManagedDirectory(target) {
  try {
    const info = fs.lstatSync(target)
    if (info.isSymbolicLink() || !info.isDirectory()) {
      fs.rmSync(target, { recursive: true, force: true })
    }
  } catch (error) {
    if (error?.code !== "ENOENT") throw error
  }
  fs.mkdirSync(target, { recursive: true })
}

function publish(rendered, destination) {
  if (fs.existsSync(destination) && fs.lstatSync(destination).isSymbolicLink()) {
    fail(`destination directory must not be a symlink: ${destination}`)
  }
  if (fs.existsSync(destination) && !fs.statSync(destination).isDirectory()) {
    fail(`destination must be a directory: ${destination}`)
  }
  fs.mkdirSync(path.dirname(destination), { recursive: true })
  const staging = fs.mkdtempSync(path.join(path.dirname(destination), `.${path.basename(destination)}.staging-`))
  const existed = fs.existsSync(destination)
  const replacement = `${destination}.replacement-${process.pid}`
  const backup = `${destination}.backup-${process.pid}`
  try {
    if (existed) {
      for (const entry of fs.readdirSync(destination)) {
        fs.cpSync(path.join(destination, entry), path.join(staging, entry), { recursive: true, force: true })
      }
    }
    for (const [relative, content] of rendered) {
      const name = relative.split(path.sep)[0]
      fs.rmSync(path.join(staging, `${name}.md`), { recursive: true, force: true })
      const agentDir = path.join(staging, name)
      prepareManagedDirectory(agentDir)
      const target = path.join(staging, relative)
      fs.rmSync(target, { recursive: true, force: true })
      fs.writeFileSync(target, content, "utf8")
    }
    fs.rmSync(replacement, { recursive: true, force: true })
    fs.rmSync(backup, { recursive: true, force: true })
    fs.renameSync(staging, replacement)
    if (existed) fs.renameSync(destination, backup)
    fs.renameSync(replacement, destination)
    fs.rmSync(backup, { recursive: true, force: true })
  } catch (error) {
    if (!fs.existsSync(destination) && fs.existsSync(backup)) fs.renameSync(backup, destination)
    throw error
  } finally {
    fs.rmSync(staging, { recursive: true, force: true })
    fs.rmSync(replacement, { recursive: true, force: true })
    fs.rmSync(backup, { recursive: true, force: true })
  }
}

function main() {
  const { source, dest } = parseArgs(process.argv.slice(2))
  if (!fs.existsSync(source) || !fs.statSync(source).isDirectory()) fail(`source directory missing: ${source}`)
  const sources = fs.readdirSync(source).filter((name) => name.endsWith(".md")).sort()
  if (!sources.length) fail(`source directory contains no Markdown agents: ${source}`)
  const rendered = new Map(sources.map((filename) => [
    path.join(path.basename(filename, ".md"), "agent.md"),
    renderAgent(path.join(source, filename)),
  ]))
  publish(rendered, dest)
  process.stdout.write(`Generated ${rendered.size} Antigravity agents in ${dest}\n`)
}

main()
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall