EveryInc/compound-engineering-plugin · error · Error

is not the compound-engineering repository

Error message

${repoRoot} is not the compound-engineering repository

What it means

assertCompoundEngineeringRepo guards the codex:dev workflow: it reads <repoRoot>/package.json and requires its name field to be exactly "compound-engineering". If it is not, the library concludes the resolved git toplevel is not this repository and refuses to proceed, because the workflow only makes sense inside the plugin's own checkout.

Solutions

  1. cd out of the nested repo to a directory inside the actual compound-engineering checkout and re-run.
  2. Check package.json at the repo root: jq .name package.json — it must be "compound-engineering".
  3. If you are in a fork/monorepo, restore the root package.json name or run against a real checkout of this repository.

Example fix

// before: package.json in the resolved repo root
{ "name": "my-fork" }
// after
{ "name": "compound-engineering" }
Defensive patterns

Strategy: validation

Validate before calling

import { readFile } from "node:fs/promises"
const pkg = JSON.parse(await readFile("package.json", "utf8"))
if (pkg.name !== "compound-engineering") {
  throw new Error("Not the compound-engineering checkout; cd there first")
}

Type guard

function isCompoundRepo(pkg: unknown): pkg is { name: "compound-engineering" } {
  return typeof pkg === "object" && pkg !== null && (pkg as { name?: unknown }).name === "compound-engineering"
}

Try / catch

try {
  await runCodexDev(command)
} catch (error) {
  if ((error as Error).message.includes("is not the compound-engineering repository")) {
    console.error("cd into the compound-engineering checkout and retry")
  } else throw error
}

Prevention

When it happens

Trigger: resolveCodexDevContext or inspectLocalCollection runs git rev-parse --show-toplevel from the current directory and the resulting repo root's package.json has a name other than "compound-engineering" (src/dev/codex-dev.ts:126).

Common situations: Running the dev command from a subdirectory of an unrelated nested git repo (e.g. a vendored dependency or docs repo inside the checkout); a fork renamed the package; a monorepo where the inner repo root is not the plugin root; running inside a temp fixture repo during tests.

Related errors


AI-assisted analysis of EveryInc/compound-engineering-plugin@c9c10f8c75 (2026-08-31). Data as JSON: /api/errors/00b524836351014f. Report an issue: GitHub.

Appendix: source

Thrown at src/dev/codex-dev.ts:126

function resolveHomePath(value: string, home: string): string {
  if (value === "~") return home
  if (value.startsWith("~/")) return path.join(home, value.slice(2))
  return path.resolve(value)
}

async function readJson(filePath: string): Promise<Record<string, unknown>> {
  try {
    return JSON.parse(await fs.readFile(filePath, "utf8")) as Record<string, unknown>
  } catch (error) {
    throw new Error(`Could not read ${filePath}: ${error instanceof Error ? error.message : String(error)}`)
  }
}

async function assertCompoundEngineeringRepo(repoRoot: string): Promise<void> {
  const packageJson = await readJson(path.join(repoRoot, "package.json"))
  if (packageJson.name !== "compound-engineering") {
    throw new Error(`${repoRoot} is not the compound-engineering repository`)
  }
  const pluginJson = await readJson(path.join(repoRoot, ".codex-plugin", "plugin.json"))
  if (pluginJson.name !== "compound-engineering") {
    throw new Error(`${repoRoot} is not the compound-engineering repository`)
  }

  const skills = pluginJson.skills
  if (typeof skills !== "string" || path.resolve(repoRoot, skills) !== path.join(repoRoot, "skills")) {
    throw new Error("The Codex plugin manifest does not point at this repository's skills directory")
  }

  const unsupported = ["apps", "hooks", "mcpServers"].filter((key) => pluginJson[key] !== undefined)
  if (unsupported.length > 0) {
    throw new Error(
      `Local skill mode cannot represent Codex runtime components: ${unsupported.join(", ")}. Update the developer workflow before using it.`,
    )
  }

View on GitHub (pinned to c9c10f8c75)