diff --git a/AGENTS.md b/AGENTS.md index 53cde6176..80ca857b0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -120,13 +120,11 @@ Only add a provider when the target format is stable, documented, and has a clea ## Agent References in Skills -When referencing agents from within skill SKILL.md files (e.g., via the `Agent` or `Task` tool), use the **category-qualified namespace** with the `ce-` prefix: `:ce-`. Never use the bare agent name alone. +When referencing agents from within skill SKILL.md files (e.g., via the `Agent` or `Task` tool), use the bare `ce-` form. The `ce-` prefix identifies the agent as a compound-engineering component and is sufficient for uniqueness across plugins. Example: -- `research:ce-learnings-researcher` (correct) -- `learnings-researcher` (wrong - will fail to resolve at runtime) - -This prevents resolution failures when the plugin is installed alongside other plugins that may define agents with the same short name. +- `ce-learnings-researcher` (correct) +- `learnings-researcher` (wrong — the `ce-` prefix is required; it's what prevents collisions with agents from other plugins that might share a short name) ## File References in Skills diff --git a/plugins/compound-engineering/AGENTS.md b/plugins/compound-engineering/AGENTS.md index bec480967..df8876b96 100644 --- a/plugins/compound-engineering/AGENTS.md +++ b/plugins/compound-engineering/AGENTS.md @@ -39,17 +39,15 @@ Before committing ANY changes: ``` agents/ -├── review/ # Code review agents -├── document-review/ # Plan and requirements document review agents -├── research/ # Research and analysis agents -├── design/ # Design and UI agents -└── docs/ # Documentation agents +└── ce-*.agent.md # All agents live flat under agents/, prefixed with ce- skills/ ├── ce-*/ # Core workflow skills (ce-plan, ce-code-review, etc.) └── */ # All other skills ``` +Agents are grouped topically in `README.md` (Review, Document Review, Research, Design, Workflow, Docs) for reader navigation — those groupings are conceptual, not filesystem subdirectories. + > **Note:** Commands were migrated to skills in v2.39.0. All former > `/command-name` slash commands now live under `skills/command-name/SKILL.md` > and work identically in Claude Code. Other targets may convert or map these references differently. @@ -74,7 +72,7 @@ Important: Just because the developer's installed plugin may be out of date, it' **Why `ce-`?** Claude Code has built-in `/plan` and `/review` commands. The `ce-` prefix (short for compound-engineering) makes it immediately clear these components belong to this plugin. The hyphen is used instead of a colon to avoid filesystem issues on Windows and to align directory names with frontmatter names. -**Agents** follow the same convention: `ce-adversarial-reviewer`, `ce-learnings-researcher`, etc. When referencing agents from skills, use the category-qualified format: `:ce-` (e.g., `review:ce-adversarial-reviewer`). +**Agents** follow the same convention: `ce-adversarial-reviewer`, `ce-learnings-researcher`, etc. When referencing agents from skills, use the bare `ce-` form (e.g., `ce-adversarial-reviewer`) — the `ce-` prefix is sufficient for uniqueness across plugins. ## Known External Limitations @@ -210,7 +208,7 @@ grep -E '^description:' skills/*/SKILL.md ## Adding Components - **New skill:** Create `skills//SKILL.md` with required YAML frontmatter (`name`, `description`). Reference files go in `skills//references/`. Add the skill to the appropriate category table in `README.md` and update the skill count. -- **New agent:** Create `agents//.md` with frontmatter. Categories: `review`, `document-review`, `research`, `design`, `docs`, `workflow`. Add the agent to `README.md` and update the agent count. +- **New agent:** Create `agents/ce-.agent.md` with frontmatter (the `ce-` prefix is required). Add the agent to the appropriate topical section of `README.md` (Review, Document Review, Research, Design, Workflow, Docs) and update the agent count. ### Adding a New Plugin to This Repo diff --git a/plugins/compound-engineering/agents/document-review/ce-adversarial-document-reviewer.agent.md b/plugins/compound-engineering/agents/ce-adversarial-document-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/document-review/ce-adversarial-document-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-adversarial-document-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-adversarial-reviewer.agent.md b/plugins/compound-engineering/agents/ce-adversarial-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-adversarial-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-adversarial-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-agent-native-reviewer.agent.md b/plugins/compound-engineering/agents/ce-agent-native-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-agent-native-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-agent-native-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/docs/ce-ankane-readme-writer.agent.md b/plugins/compound-engineering/agents/ce-ankane-readme-writer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/docs/ce-ankane-readme-writer.agent.md rename to plugins/compound-engineering/agents/ce-ankane-readme-writer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-api-contract-reviewer.agent.md b/plugins/compound-engineering/agents/ce-api-contract-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-api-contract-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-api-contract-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-architecture-strategist.agent.md b/plugins/compound-engineering/agents/ce-architecture-strategist.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-architecture-strategist.agent.md rename to plugins/compound-engineering/agents/ce-architecture-strategist.agent.md diff --git a/plugins/compound-engineering/agents/research/ce-best-practices-researcher.agent.md b/plugins/compound-engineering/agents/ce-best-practices-researcher.agent.md similarity index 100% rename from plugins/compound-engineering/agents/research/ce-best-practices-researcher.agent.md rename to plugins/compound-engineering/agents/ce-best-practices-researcher.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-cli-agent-readiness-reviewer.agent.md b/plugins/compound-engineering/agents/ce-cli-agent-readiness-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-cli-agent-readiness-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-cli-agent-readiness-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-cli-readiness-reviewer.agent.md b/plugins/compound-engineering/agents/ce-cli-readiness-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-cli-readiness-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-cli-readiness-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-code-simplicity-reviewer.agent.md b/plugins/compound-engineering/agents/ce-code-simplicity-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-code-simplicity-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-code-simplicity-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/document-review/ce-coherence-reviewer.agent.md b/plugins/compound-engineering/agents/ce-coherence-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/document-review/ce-coherence-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-coherence-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-correctness-reviewer.agent.md b/plugins/compound-engineering/agents/ce-correctness-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-correctness-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-correctness-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-data-integrity-guardian.agent.md b/plugins/compound-engineering/agents/ce-data-integrity-guardian.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-data-integrity-guardian.agent.md rename to plugins/compound-engineering/agents/ce-data-integrity-guardian.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-data-migration-expert.agent.md b/plugins/compound-engineering/agents/ce-data-migration-expert.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-data-migration-expert.agent.md rename to plugins/compound-engineering/agents/ce-data-migration-expert.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-data-migrations-reviewer.agent.md b/plugins/compound-engineering/agents/ce-data-migrations-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-data-migrations-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-data-migrations-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-deployment-verification-agent.agent.md b/plugins/compound-engineering/agents/ce-deployment-verification-agent.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-deployment-verification-agent.agent.md rename to plugins/compound-engineering/agents/ce-deployment-verification-agent.agent.md diff --git a/plugins/compound-engineering/agents/design/ce-design-implementation-reviewer.agent.md b/plugins/compound-engineering/agents/ce-design-implementation-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/design/ce-design-implementation-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-design-implementation-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/design/ce-design-iterator.agent.md b/plugins/compound-engineering/agents/ce-design-iterator.agent.md similarity index 100% rename from plugins/compound-engineering/agents/design/ce-design-iterator.agent.md rename to plugins/compound-engineering/agents/ce-design-iterator.agent.md diff --git a/plugins/compound-engineering/agents/document-review/ce-design-lens-reviewer.agent.md b/plugins/compound-engineering/agents/ce-design-lens-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/document-review/ce-design-lens-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-design-lens-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-dhh-rails-reviewer.agent.md b/plugins/compound-engineering/agents/ce-dhh-rails-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-dhh-rails-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-dhh-rails-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/document-review/ce-feasibility-reviewer.agent.md b/plugins/compound-engineering/agents/ce-feasibility-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/document-review/ce-feasibility-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-feasibility-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/design/ce-figma-design-sync.agent.md b/plugins/compound-engineering/agents/ce-figma-design-sync.agent.md similarity index 100% rename from plugins/compound-engineering/agents/design/ce-figma-design-sync.agent.md rename to plugins/compound-engineering/agents/ce-figma-design-sync.agent.md diff --git a/plugins/compound-engineering/agents/research/ce-framework-docs-researcher.agent.md b/plugins/compound-engineering/agents/ce-framework-docs-researcher.agent.md similarity index 100% rename from plugins/compound-engineering/agents/research/ce-framework-docs-researcher.agent.md rename to plugins/compound-engineering/agents/ce-framework-docs-researcher.agent.md diff --git a/plugins/compound-engineering/agents/research/ce-git-history-analyzer.agent.md b/plugins/compound-engineering/agents/ce-git-history-analyzer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/research/ce-git-history-analyzer.agent.md rename to plugins/compound-engineering/agents/ce-git-history-analyzer.agent.md diff --git a/plugins/compound-engineering/agents/research/ce-issue-intelligence-analyst.agent.md b/plugins/compound-engineering/agents/ce-issue-intelligence-analyst.agent.md similarity index 100% rename from plugins/compound-engineering/agents/research/ce-issue-intelligence-analyst.agent.md rename to plugins/compound-engineering/agents/ce-issue-intelligence-analyst.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-julik-frontend-races-reviewer.agent.md b/plugins/compound-engineering/agents/ce-julik-frontend-races-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-julik-frontend-races-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-julik-frontend-races-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-kieran-python-reviewer.agent.md b/plugins/compound-engineering/agents/ce-kieran-python-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-kieran-python-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-kieran-python-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-kieran-rails-reviewer.agent.md b/plugins/compound-engineering/agents/ce-kieran-rails-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-kieran-rails-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-kieran-rails-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-kieran-typescript-reviewer.agent.md b/plugins/compound-engineering/agents/ce-kieran-typescript-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-kieran-typescript-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-kieran-typescript-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/research/ce-learnings-researcher.agent.md b/plugins/compound-engineering/agents/ce-learnings-researcher.agent.md similarity index 100% rename from plugins/compound-engineering/agents/research/ce-learnings-researcher.agent.md rename to plugins/compound-engineering/agents/ce-learnings-researcher.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-maintainability-reviewer.agent.md b/plugins/compound-engineering/agents/ce-maintainability-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-maintainability-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-maintainability-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-pattern-recognition-specialist.agent.md b/plugins/compound-engineering/agents/ce-pattern-recognition-specialist.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-pattern-recognition-specialist.agent.md rename to plugins/compound-engineering/agents/ce-pattern-recognition-specialist.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-performance-oracle.agent.md b/plugins/compound-engineering/agents/ce-performance-oracle.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-performance-oracle.agent.md rename to plugins/compound-engineering/agents/ce-performance-oracle.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-performance-reviewer.agent.md b/plugins/compound-engineering/agents/ce-performance-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-performance-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-performance-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/workflow/ce-pr-comment-resolver.agent.md b/plugins/compound-engineering/agents/ce-pr-comment-resolver.agent.md similarity index 100% rename from plugins/compound-engineering/agents/workflow/ce-pr-comment-resolver.agent.md rename to plugins/compound-engineering/agents/ce-pr-comment-resolver.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-previous-comments-reviewer.agent.md b/plugins/compound-engineering/agents/ce-previous-comments-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-previous-comments-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-previous-comments-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/document-review/ce-product-lens-reviewer.agent.md b/plugins/compound-engineering/agents/ce-product-lens-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/document-review/ce-product-lens-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-product-lens-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-project-standards-reviewer.agent.md b/plugins/compound-engineering/agents/ce-project-standards-reviewer.agent.md similarity index 95% rename from plugins/compound-engineering/agents/review/ce-project-standards-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-project-standards-reviewer.agent.md index 62fa82021..8fc03bc77 100644 --- a/plugins/compound-engineering/agents/review/ce-project-standards-reviewer.agent.md +++ b/plugins/compound-engineering/agents/ce-project-standards-reviewer.agent.md @@ -29,7 +29,7 @@ In either case, identify which sections apply to the file types in the diff. A s - **Reference file inclusion mistakes** -- markdown links (`[file](./references/file.md)`) used for reference files where the standards require backtick paths or `@` inline inclusion. Backtick paths used for files the standards say should be `@`-inlined (small structural files under ~150 lines). `@` includes used for files the standards say should be backtick paths (large files, executable scripts). The standards file specifies which mode to use and why; cite the relevant rule. -- **Broken cross-references** -- agent names that are not fully qualified (e.g., `ce-learnings-researcher` instead of `research:ce-learnings-researcher`). Skill-to-skill references using slash syntax inside a SKILL.md where the standards say to use semantic wording. References to tools by platform-specific names without naming the capability class. +- **Broken cross-references** -- agent names that are not fully qualified (e.g., `ce-learnings-researcher` instead of `ce-learnings-researcher`). Skill-to-skill references using slash syntax inside a SKILL.md where the standards say to use semantic wording. References to tools by platform-specific names without naming the capability class. - **Cross-platform portability violations** -- platform-specific tool names used without equivalents (e.g., `TodoWrite` instead of `TaskCreate`/`TaskUpdate`/`TaskList`). Slash references in pass-through SKILL.md files that won't be remapped. Assumptions about tool availability that break on other platforms. diff --git a/plugins/compound-engineering/agents/review/ce-reliability-reviewer.agent.md b/plugins/compound-engineering/agents/ce-reliability-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-reliability-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-reliability-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/research/ce-repo-research-analyst.agent.md b/plugins/compound-engineering/agents/ce-repo-research-analyst.agent.md similarity index 100% rename from plugins/compound-engineering/agents/research/ce-repo-research-analyst.agent.md rename to plugins/compound-engineering/agents/ce-repo-research-analyst.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-schema-drift-detector.agent.md b/plugins/compound-engineering/agents/ce-schema-drift-detector.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-schema-drift-detector.agent.md rename to plugins/compound-engineering/agents/ce-schema-drift-detector.agent.md diff --git a/plugins/compound-engineering/agents/document-review/ce-scope-guardian-reviewer.agent.md b/plugins/compound-engineering/agents/ce-scope-guardian-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/document-review/ce-scope-guardian-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-scope-guardian-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/document-review/ce-security-lens-reviewer.agent.md b/plugins/compound-engineering/agents/ce-security-lens-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/document-review/ce-security-lens-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-security-lens-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-security-reviewer.agent.md b/plugins/compound-engineering/agents/ce-security-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-security-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-security-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-security-sentinel.agent.md b/plugins/compound-engineering/agents/ce-security-sentinel.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-security-sentinel.agent.md rename to plugins/compound-engineering/agents/ce-security-sentinel.agent.md diff --git a/plugins/compound-engineering/agents/research/ce-session-historian.agent.md b/plugins/compound-engineering/agents/ce-session-historian.agent.md similarity index 100% rename from plugins/compound-engineering/agents/research/ce-session-historian.agent.md rename to plugins/compound-engineering/agents/ce-session-historian.agent.md diff --git a/plugins/compound-engineering/agents/research/ce-slack-researcher.agent.md b/plugins/compound-engineering/agents/ce-slack-researcher.agent.md similarity index 100% rename from plugins/compound-engineering/agents/research/ce-slack-researcher.agent.md rename to plugins/compound-engineering/agents/ce-slack-researcher.agent.md diff --git a/plugins/compound-engineering/agents/workflow/ce-spec-flow-analyzer.agent.md b/plugins/compound-engineering/agents/ce-spec-flow-analyzer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/workflow/ce-spec-flow-analyzer.agent.md rename to plugins/compound-engineering/agents/ce-spec-flow-analyzer.agent.md diff --git a/plugins/compound-engineering/agents/review/ce-testing-reviewer.agent.md b/plugins/compound-engineering/agents/ce-testing-reviewer.agent.md similarity index 100% rename from plugins/compound-engineering/agents/review/ce-testing-reviewer.agent.md rename to plugins/compound-engineering/agents/ce-testing-reviewer.agent.md diff --git a/plugins/compound-engineering/agents/research/ce-web-researcher.agent.md b/plugins/compound-engineering/agents/ce-web-researcher.agent.md similarity index 100% rename from plugins/compound-engineering/agents/research/ce-web-researcher.agent.md rename to plugins/compound-engineering/agents/ce-web-researcher.agent.md diff --git a/plugins/compound-engineering/skills/ce-brainstorm/SKILL.md b/plugins/compound-engineering/skills/ce-brainstorm/SKILL.md index 3dc582ad3..13741354f 100644 --- a/plugins/compound-engineering/skills/ce-brainstorm/SKILL.md +++ b/plugins/compound-engineering/skills/ce-brainstorm/SKILL.md @@ -112,7 +112,7 @@ If nothing obvious appears after a short scan, say so and continue. Two rules go **Slack context** (opt-in, Standard and Deep only) — never auto-dispatch. Route by condition: -- **Tools available + user asked**: Dispatch `research:ce-slack-researcher` with a brief summary of the brainstorm topic alongside Phase 1.1 work. Incorporate findings into constraint and context awareness. +- **Tools available + user asked**: Dispatch `ce-slack-researcher` with a brief summary of the brainstorm topic alongside Phase 1.1 work. Incorporate findings into constraint and context awareness. - **Tools available + user didn't ask**: Note in output: "Slack tools detected. Ask me to search Slack for organizational context at any point, or include it in your next prompt." - **No tools + user asked**: Note in output: "Slack context was requested but no Slack tools are available. Install and authenticate the Slack plugin to enable organizational context search." diff --git a/plugins/compound-engineering/skills/ce-code-review/SKILL.md b/plugins/compound-engineering/skills/ce-code-review/SKILL.md index 24cb1556a..4a71d2177 100644 --- a/plugins/compound-engineering/skills/ce-code-review/SKILL.md +++ b/plugins/compound-engineering/skills/ce-code-review/SKILL.md @@ -112,42 +112,42 @@ Routing rules: | Agent | Focus | |-------|-------| -| `review:ce-correctness-reviewer` | Logic errors, edge cases, state bugs, error propagation | -| `review:ce-testing-reviewer` | Coverage gaps, weak assertions, brittle tests | -| `review:ce-maintainability-reviewer` | Coupling, complexity, naming, dead code, abstraction debt | -| `review:ce-project-standards-reviewer` | CLAUDE.md and AGENTS.md compliance -- frontmatter, references, naming, portability | -| `review:ce-agent-native-reviewer` | Verify new features are agent-accessible | -| `research:ce-learnings-researcher` | Search docs/solutions/ for past issues related to this PR | +| `ce-correctness-reviewer` | Logic errors, edge cases, state bugs, error propagation | +| `ce-testing-reviewer` | Coverage gaps, weak assertions, brittle tests | +| `ce-maintainability-reviewer` | Coupling, complexity, naming, dead code, abstraction debt | +| `ce-project-standards-reviewer` | CLAUDE.md and AGENTS.md compliance -- frontmatter, references, naming, portability | +| `ce-agent-native-reviewer` | Verify new features are agent-accessible | +| `ce-learnings-researcher` | Search docs/solutions/ for past issues related to this PR | **Cross-cutting conditional (selected per diff):** | Agent | Select when diff touches... | |-------|---------------------------| -| `review:ce-security-reviewer` | Auth, public endpoints, user input, permissions | -| `review:ce-performance-reviewer` | DB queries, data transforms, caching, async | -| `review:ce-api-contract-reviewer` | Routes, serializers, type signatures, versioning | -| `review:ce-data-migrations-reviewer` | Migrations, schema changes, backfills | -| `review:ce-reliability-reviewer` | Error handling, retries, timeouts, background jobs | -| `review:ce-adversarial-reviewer` | Diff >=50 changed non-test/non-generated/non-lockfile lines, or auth, payments, data mutations, external APIs | -| `review:ce-cli-readiness-reviewer` | CLI command definitions, argument parsing, CLI framework usage, command handler implementations | -| `review:ce-previous-comments-reviewer` | Reviewing a PR that has existing review comments or threads | +| `ce-security-reviewer` | Auth, public endpoints, user input, permissions | +| `ce-performance-reviewer` | DB queries, data transforms, caching, async | +| `ce-api-contract-reviewer` | Routes, serializers, type signatures, versioning | +| `ce-data-migrations-reviewer` | Migrations, schema changes, backfills | +| `ce-reliability-reviewer` | Error handling, retries, timeouts, background jobs | +| `ce-adversarial-reviewer` | Diff >=50 changed non-test/non-generated/non-lockfile lines, or auth, payments, data mutations, external APIs | +| `ce-cli-readiness-reviewer` | CLI command definitions, argument parsing, CLI framework usage, command handler implementations | +| `ce-previous-comments-reviewer` | Reviewing a PR that has existing review comments or threads | **Stack-specific conditional (selected per diff):** | Agent | Select when diff touches... | |-------|---------------------------| -| `review:ce-dhh-rails-reviewer` | Rails architecture, service objects, session/auth choices, or Hotwire-vs-SPA boundaries | -| `review:ce-kieran-rails-reviewer` | Rails application code where conventions, naming, and maintainability are in play | -| `review:ce-kieran-python-reviewer` | Python modules, endpoints, scripts, or services | -| `review:ce-kieran-typescript-reviewer` | TypeScript components, services, hooks, utilities, or shared types | -| `review:ce-julik-frontend-races-reviewer` | Stimulus/Turbo controllers, DOM events, timers, animations, or async UI flows | +| `ce-dhh-rails-reviewer` | Rails architecture, service objects, session/auth choices, or Hotwire-vs-SPA boundaries | +| `ce-kieran-rails-reviewer` | Rails application code where conventions, naming, and maintainability are in play | +| `ce-kieran-python-reviewer` | Python modules, endpoints, scripts, or services | +| `ce-kieran-typescript-reviewer` | TypeScript components, services, hooks, utilities, or shared types | +| `ce-julik-frontend-races-reviewer` | Stimulus/Turbo controllers, DOM events, timers, animations, or async UI flows | **CE conditional (migration-specific):** | Agent | Select when diff includes migration files | |-------|------------------------------------------| -| `review:ce-schema-drift-detector` | Cross-references schema.rb against included migrations | -| `review:ce-deployment-verification-agent` | Produces deployment checklist with SQL verification queries | +| `ce-schema-drift-detector` | Cross-references schema.rb against included migrations | +| `ce-deployment-verification-agent` | Produces deployment checklist with SQL verification queries | ## Review Scope diff --git a/plugins/compound-engineering/skills/ce-code-review/references/persona-catalog.md b/plugins/compound-engineering/skills/ce-code-review/references/persona-catalog.md index fcec1be5b..15cba0034 100644 --- a/plugins/compound-engineering/skills/ce-code-review/references/persona-catalog.md +++ b/plugins/compound-engineering/skills/ce-code-review/references/persona-catalog.md @@ -10,17 +10,17 @@ Spawned on every review regardless of diff content. | Persona | Agent | Focus | |---------|-------|-------| -| `correctness` | `review:ce-correctness-reviewer` | Logic errors, edge cases, state bugs, error propagation, intent compliance | -| `testing` | `review:ce-testing-reviewer` | Coverage gaps, weak assertions, brittle tests, missing edge case tests | -| `maintainability` | `review:ce-maintainability-reviewer` | Coupling, complexity, naming, dead code, premature abstraction | -| `project-standards` | `review:ce-project-standards-reviewer` | CLAUDE.md and AGENTS.md compliance -- frontmatter, references, naming, cross-platform portability, tool selection | +| `correctness` | `ce-correctness-reviewer` | Logic errors, edge cases, state bugs, error propagation, intent compliance | +| `testing` | `ce-testing-reviewer` | Coverage gaps, weak assertions, brittle tests, missing edge case tests | +| `maintainability` | `ce-maintainability-reviewer` | Coupling, complexity, naming, dead code, premature abstraction | +| `project-standards` | `ce-project-standards-reviewer` | CLAUDE.md and AGENTS.md compliance -- frontmatter, references, naming, cross-platform portability, tool selection | **CE agents (unstructured output, synthesized separately):** | Agent | Focus | |-------|-------| -| `review:ce-agent-native-reviewer` | Verify new features are agent-accessible | -| `research:ce-learnings-researcher` | Search docs/solutions/ for past issues related to this PR's modules and patterns | +| `ce-agent-native-reviewer` | Verify new features are agent-accessible | +| `ce-learnings-researcher` | Search docs/solutions/ for past issues related to this PR's modules and patterns | ## Conditional (8 personas) @@ -28,14 +28,14 @@ Spawned when the orchestrator identifies relevant patterns in the diff. The orch | Persona | Agent | Select when diff touches... | |---------|-------|---------------------------| -| `security` | `review:ce-security-reviewer` | Auth middleware, public endpoints, user input handling, permission checks, secrets management | -| `performance` | `review:ce-performance-reviewer` | Database queries, ORM calls, loop-heavy data transforms, caching layers, async/concurrent code | -| `api-contract` | `review:ce-api-contract-reviewer` | Route definitions, serializer/interface changes, event schemas, exported type signatures, API versioning | -| `data-migrations` | `review:ce-data-migrations-reviewer` | Migration files, schema changes, backfill scripts, data transformations | -| `reliability` | `review:ce-reliability-reviewer` | Error handling, retry logic, circuit breakers, timeouts, background jobs, async handlers, health checks | -| `adversarial` | `review:ce-adversarial-reviewer` | Diff has >=50 changed non-test, non-generated, non-lockfile lines, OR touches auth, payments, data mutations, external API integrations, or other high-risk domains | -| `cli-readiness` | `review:ce-cli-readiness-reviewer` | CLI command definitions, argument parsing, CLI framework usage, command handler implementations | -| `previous-comments` | `review:ce-previous-comments-reviewer` | **PR-only.** Reviewing a PR that has existing review comments or review threads from prior review rounds. Skip entirely when no PR metadata was gathered in Stage 1. | +| `security` | `ce-security-reviewer` | Auth middleware, public endpoints, user input handling, permission checks, secrets management | +| `performance` | `ce-performance-reviewer` | Database queries, ORM calls, loop-heavy data transforms, caching layers, async/concurrent code | +| `api-contract` | `ce-api-contract-reviewer` | Route definitions, serializer/interface changes, event schemas, exported type signatures, API versioning | +| `data-migrations` | `ce-data-migrations-reviewer` | Migration files, schema changes, backfill scripts, data transformations | +| `reliability` | `ce-reliability-reviewer` | Error handling, retry logic, circuit breakers, timeouts, background jobs, async handlers, health checks | +| `adversarial` | `ce-adversarial-reviewer` | Diff has >=50 changed non-test, non-generated, non-lockfile lines, OR touches auth, payments, data mutations, external API integrations, or other high-risk domains | +| `cli-readiness` | `ce-cli-readiness-reviewer` | CLI command definitions, argument parsing, CLI framework usage, command handler implementations | +| `previous-comments` | `ce-previous-comments-reviewer` | **PR-only.** Reviewing a PR that has existing review comments or review threads from prior review rounds. Skip entirely when no PR metadata was gathered in Stage 1. | ## Stack-Specific Conditional (5 personas) @@ -43,11 +43,11 @@ These reviewers keep their original opinionated lens. They are additive with the | Persona | Agent | Select when diff touches... | |---------|-------|---------------------------| -| `dhh-rails` | `review:ce-dhh-rails-reviewer` | Rails architecture, service objects, authentication/session choices, Hotwire-vs-SPA boundaries, or abstractions that may fight Rails conventions | -| `kieran-rails` | `review:ce-kieran-rails-reviewer` | Rails controllers, models, views, jobs, components, routes, or other application-layer Ruby code where clarity and conventions matter | -| `kieran-python` | `review:ce-kieran-python-reviewer` | Python modules, endpoints, services, scripts, or typed domain code | -| `kieran-typescript` | `review:ce-kieran-typescript-reviewer` | TypeScript components, services, hooks, utilities, or shared types | -| `julik-frontend-races` | `review:ce-julik-frontend-races-reviewer` | Stimulus/Turbo controllers, DOM event wiring, timers, async UI flows, animations, or frontend state transitions with race potential | +| `dhh-rails` | `ce-dhh-rails-reviewer` | Rails architecture, service objects, authentication/session choices, Hotwire-vs-SPA boundaries, or abstractions that may fight Rails conventions | +| `kieran-rails` | `ce-kieran-rails-reviewer` | Rails controllers, models, views, jobs, components, routes, or other application-layer Ruby code where clarity and conventions matter | +| `kieran-python` | `ce-kieran-python-reviewer` | Python modules, endpoints, services, scripts, or typed domain code | +| `kieran-typescript` | `ce-kieran-typescript-reviewer` | TypeScript components, services, hooks, utilities, or shared types | +| `julik-frontend-races` | `ce-julik-frontend-races-reviewer` | Stimulus/Turbo controllers, DOM event wiring, timers, async UI flows, animations, or frontend state transitions with race potential | ## CE Conditional Agents (migration-specific) @@ -55,8 +55,8 @@ These CE-native agents provide specialized analysis beyond what the persona agen | Agent | Focus | |-------|-------| -| `review:ce-schema-drift-detector` | Cross-references schema.rb changes against included migrations to catch unrelated drift | -| `review:ce-deployment-verification-agent` | Produces Go/No-Go deployment checklist with SQL verification queries and rollback procedures | +| `ce-schema-drift-detector` | Cross-references schema.rb changes against included migrations to catch unrelated drift | +| `ce-deployment-verification-agent` | Produces Go/No-Go deployment checklist with SQL verification queries and rollback procedures | ## Selection rules diff --git a/plugins/compound-engineering/skills/ce-compound/SKILL.md b/plugins/compound-engineering/skills/ce-compound/SKILL.md index 4d85ad74b..5366ff922 100644 --- a/plugins/compound-engineering/skills/ce-compound/SKILL.md +++ b/plugins/compound-engineering/skills/ce-compound/SKILL.md @@ -168,7 +168,7 @@ Launch research subagents. Each returns text data to the orchestrator. #### 4. **Session Historian** (foreground, after launching the above — only if the user opted in) - **Skip entirely** if the user declined session history in the follow-up question - - Dispatched as `research:ce-session-historian` + - Dispatched as `ce-session-historian` - Dispatch in **foreground** — this agent reads session files outside the working directory (`~/.claude/projects/`, `~/.codex/sessions/`, `~/.cursor/projects/`) which background agents may not have access to - Searches prior Claude Code, Codex, and Cursor sessions for the same project to find related investigation context - Correlates sessions by repo name across all platforms (matches sessions from main checkouts, worktrees, and Conductor workspaces) @@ -314,13 +314,13 @@ After the learning is written and the refresh decision is made, check whether th Based on problem type, optionally invoke specialized agents to review the documentation: -- **performance_issue** → `review:ce-performance-oracle` -- **security_issue** → `review:ce-security-sentinel` -- **database_issue** → `review:ce-data-integrity-guardian` -- Any code-heavy issue → always run `review:ce-code-simplicity-reviewer`, and additionally run the kieran reviewer that matches the repo's primary stack: - - Ruby/Rails → also run `review:ce-kieran-rails-reviewer` - - Python → also run `review:ce-kieran-python-reviewer` - - TypeScript/JavaScript → also run `review:ce-kieran-typescript-reviewer` +- **performance_issue** → `ce-performance-oracle` +- **security_issue** → `ce-security-sentinel` +- **database_issue** → `ce-data-integrity-guardian` +- Any code-heavy issue → always run `ce-code-simplicity-reviewer`, and additionally run the kieran reviewer that matches the repo's primary stack: + - Ruby/Rails → also run `ce-kieran-rails-reviewer` + - Python → also run `ce-kieran-python-reviewer` + - TypeScript/JavaScript → also run `ce-kieran-typescript-reviewer` - Other stacks → no kieran reviewer needed @@ -509,20 +509,20 @@ Writes the final learning directly into `docs/solutions/`. Based on problem type, these agents can enhance documentation: ### Code Quality & Review -- **review:ce-kieran-rails-reviewer**: Reviews code examples for Rails best practices -- **review:ce-kieran-python-reviewer**: Reviews code examples for Python best practices -- **review:ce-kieran-typescript-reviewer**: Reviews code examples for TypeScript best practices -- **review:ce-code-simplicity-reviewer**: Ensures solution code is minimal and clear -- **review:ce-pattern-recognition-specialist**: Identifies anti-patterns or repeating issues +- **ce-kieran-rails-reviewer**: Reviews code examples for Rails best practices +- **ce-kieran-python-reviewer**: Reviews code examples for Python best practices +- **ce-kieran-typescript-reviewer**: Reviews code examples for TypeScript best practices +- **ce-code-simplicity-reviewer**: Ensures solution code is minimal and clear +- **ce-pattern-recognition-specialist**: Identifies anti-patterns or repeating issues ### Specific Domain Experts -- **review:ce-performance-oracle**: Analyzes performance_issue category solutions -- **review:ce-security-sentinel**: Reviews security_issue solutions for vulnerabilities -- **review:ce-data-integrity-guardian**: Reviews database_issue migrations and queries +- **ce-performance-oracle**: Analyzes performance_issue category solutions +- **ce-security-sentinel**: Reviews security_issue solutions for vulnerabilities +- **ce-data-integrity-guardian**: Reviews database_issue migrations and queries ### Enhancement & Research -- **research:ce-best-practices-researcher**: Enriches solution with industry best practices -- **research:ce-framework-docs-researcher**: Links to framework/library documentation references +- **ce-best-practices-researcher**: Enriches solution with industry best practices +- **ce-framework-docs-researcher**: Links to framework/library documentation references ### When to Invoke - **Auto-triggered** (optional): Agents can run post-documentation for enhancement diff --git a/plugins/compound-engineering/skills/ce-doc-review/SKILL.md b/plugins/compound-engineering/skills/ce-doc-review/SKILL.md index 7d94111c4..3355d1989 100644 --- a/plugins/compound-engineering/skills/ce-doc-review/SKILL.md +++ b/plugins/compound-engineering/skills/ce-doc-review/SKILL.md @@ -109,15 +109,15 @@ Reviewing with: ### Build Agent List Always include: -- `document-review:ce-coherence-reviewer` -- `document-review:ce-feasibility-reviewer` +- `ce-coherence-reviewer` +- `ce-feasibility-reviewer` Add activated conditional personas: -- `document-review:ce-product-lens-reviewer` -- `document-review:ce-design-lens-reviewer` -- `document-review:ce-security-lens-reviewer` -- `document-review:ce-scope-guardian-reviewer` -- `document-review:ce-adversarial-document-reviewer` +- `ce-product-lens-reviewer` +- `ce-design-lens-reviewer` +- `ce-security-lens-reviewer` +- `ce-scope-guardian-reviewer` +- `ce-adversarial-document-reviewer` ### Dispatch diff --git a/plugins/compound-engineering/skills/ce-frontend-design/SKILL.md b/plugins/compound-engineering/skills/ce-frontend-design/SKILL.md index 696111fdf..931604d1a 100644 --- a/plugins/compound-engineering/skills/ce-frontend-design/SKILL.md +++ b/plugins/compound-engineering/skills/ce-frontend-design/SKILL.md @@ -243,7 +243,7 @@ Use the first available option: One iteration. Take a screenshot, assess against the litmus checks, fix any glaring issues, and move on. Include the screenshot in the deliverable (PR description, conversation output, etc.). -For iterative refinement beyond a single pass (multiple rounds of screenshot-assess-fix), see the `design:ce-design-iterator` agent. +For iterative refinement beyond a single pass (multiple rounds of screenshot-assess-fix), see the `ce-design-iterator` agent. --- diff --git a/plugins/compound-engineering/skills/ce-ideate/SKILL.md b/plugins/compound-engineering/skills/ce-ideate/SKILL.md index fadcb8b39..02127039a 100644 --- a/plugins/compound-engineering/skills/ce-ideate/SKILL.md +++ b/plugins/compound-engineering/skills/ce-ideate/SKILL.md @@ -191,11 +191,11 @@ Run grounding agents in parallel in the **foreground** (do not background — re > > Focus hint: {focus_hint} -2. **Learnings search** — dispatch `research:ce-learnings-researcher` with a brief summary of the ideation focus. +2. **Learnings search** — dispatch `ce-learnings-researcher` with a brief summary of the ideation focus. 3. **Web research** (always-on; see "Web research" subsection below for skip-phrase and V15 cache handling). -4. **Issue intelligence** (conditional) — if issue-tracker intent was detected in Phase 0.3, dispatch `research:ce-issue-intelligence-analyst` with the focus hint. Run in parallel with the other agents. +4. **Issue intelligence** (conditional) — if issue-tracker intent was detected in Phase 0.3, dispatch `ce-issue-intelligence-analyst` with the focus hint. Run in parallel with the other agents. If the agent returns an error (gh not installed, no remote, auth failure), log a warning to the user ("Issue analysis unavailable: {reason}. Proceeding with standard ideation.") and continue with the remaining grounding. @@ -205,7 +205,7 @@ Run grounding agents in parallel in the **foreground** (do not background — re 1. **User-context synthesis** — dispatch a general-purpose sub-agent (cheapest capable model) to read the user-supplied context from Phase 0.4 intake plus any rich-prompt material, and return a structured grounding summary that mirrors the codebase-context shape (project shape → topic shape; notable patterns → stated constraints; pain points → user-named pain points; leverage points → opportunity hooks the context implies). This keeps Phase 2 sub-agents agnostic to grounding source. -2. **Learnings search** *(elsewhere-software only; skipped by default in elsewhere-non-software)* — dispatch `research:ce-learnings-researcher` with the topic summary in case relevant institutional knowledge exists (skill-design patterns, prior solutions in similar shape). Skip for elsewhere-non-software: the CWD's `docs/solutions/` is unlikely to be topically relevant for non-digital topics, and running it risks polluting generation with unrelated engineering patterns. +2. **Learnings search** *(elsewhere-software only; skipped by default in elsewhere-non-software)* — dispatch `ce-learnings-researcher` with the topic summary in case relevant institutional knowledge exists (skill-design patterns, prior solutions in similar shape). Skip for elsewhere-non-software: the CWD's `docs/solutions/` is unlikely to be topically relevant for non-digital topics, and running it risks polluting generation with unrelated engineering patterns. 3. **Web research** — same as repo mode (see subsection below). @@ -213,11 +213,11 @@ Issue intelligence does not apply in elsewhere mode. Slack research is opt-in fo #### Web Research (V5, V15) -Always-on for both modes. Skip when the user said "no external research", "skip web research", or equivalent in their prompt or earlier answers; in that case, omit `research:ce-web-researcher` from dispatch and note the skip in the consolidated grounding summary. +Always-on for both modes. Skip when the user said "no external research", "skip web research", or equivalent in their prompt or earlier answers; in that case, omit `ce-web-researcher` from dispatch and note the skip in the consolidated grounding summary. -Reuse prior web research within a session via a sidecar cache — see `references/web-research-cache.md` for the cache file shape, reuse check, append behavior, and platform-degradation rules. Read it the first time `research:ce-web-researcher` would be dispatched in this run (and on every subsequent dispatch where the cache might apply). +Reuse prior web research within a session via a sidecar cache — see `references/web-research-cache.md` for the cache file shape, reuse check, append behavior, and platform-degradation rules. Read it the first time `ce-web-researcher` would be dispatched in this run (and on every subsequent dispatch where the cache might apply). -When dispatching `research:ce-web-researcher`, pass: the focus hint, a brief planning context summary (one or two sentences), and the mode. Do not pass codebase content — the agent operates externally. +When dispatching `ce-web-researcher`, pass: the focus hint, a brief planning context summary (one or two sentences), and the mode. Do not pass codebase content — the agent operates externally. #### Consolidated Grounding Summary @@ -229,9 +229,9 @@ Consolidate all dispatched results into a short grounding summary using these se - **External context** *(when web research ran)* — prior art, adjacent solutions, market signals, cross-domain analogies. Note "(reused from earlier dispatch)" when V15 reuse fired - **Slack context** *(when present)* — organizational context -**Failure handling.** Grounding agent failures follow "warn and proceed" — never block on grounding failure. If `research:ce-web-researcher` fails (network, tool unavailable), log a warning ("External research unavailable: {reason}. Proceeding with internal grounding only.") and continue. If elsewhere-mode intake produced no usable context, note in the grounding summary that context is thin so Phase 2 sub-agents can compensate with broader generation. +**Failure handling.** Grounding agent failures follow "warn and proceed" — never block on grounding failure. If `ce-web-researcher` fails (network, tool unavailable), log a warning ("External research unavailable: {reason}. Proceeding with internal grounding only.") and continue. If elsewhere-mode intake produced no usable context, note in the grounding summary that context is thin so Phase 2 sub-agents can compensate with broader generation. -**Slack context** (opt-in, both modes) — never auto-dispatch. When the user asks for Slack context and Slack tools are available (look for any `slack-researcher` agent or `slack` MCP tools in the current environment), dispatch `research:ce-slack-researcher` with the focus hint in parallel with other Phase 1 agents. When tools are present but the user did not ask, mention availability in the grounding summary so they can opt in. When the user asked but no Slack tools are reachable, surface the install hint instead. +**Slack context** (opt-in, both modes) — never auto-dispatch. When the user asks for Slack context and Slack tools are available (look for any `slack-researcher` agent or `slack` MCP tools in the current environment), dispatch `ce-slack-researcher` with the focus hint in parallel with other Phase 1 agents. When tools are present but the user did not ask, mention availability in the grounding summary so they can opt in. When the user asked but no Slack tools are reachable, surface the install hint instead. ### Phase 2: Divergent Ideation diff --git a/plugins/compound-engineering/skills/ce-optimize/SKILL.md b/plugins/compound-engineering/skills/ce-optimize/SKILL.md index d663e0cdb..05fbb0733 100644 --- a/plugins/compound-engineering/skills/ce-optimize/SKILL.md +++ b/plugins/compound-engineering/skills/ce-optimize/SKILL.md @@ -218,7 +218,7 @@ Check whether the input is: ### 0.3 Search Prior Learnings -Dispatch `research:ce-learnings-researcher` to search for prior optimization work on similar topics. If relevant learnings exist, incorporate them into the approach. +Dispatch `ce-learnings-researcher` to search for prior optimization work on similar topics. If relevant learnings exist, incorporate them into the approach. ### 0.4 Run Identity Detection @@ -373,7 +373,7 @@ Read the code within `scope.mutable` to understand: - Obvious improvement opportunities - Constraints and dependencies between components -Optionally dispatch `research:ce-repo-research-analyst` for deeper codebase analysis if the scope is large or unfamiliar. +Optionally dispatch `ce-repo-research-analyst` for deeper codebase analysis if the scope is large or unfamiliar. ### 2.2 Generate Hypothesis List diff --git a/plugins/compound-engineering/skills/ce-plan/SKILL.md b/plugins/compound-engineering/skills/ce-plan/SKILL.md index ac34bf16f..27e22aa1a 100644 --- a/plugins/compound-engineering/skills/ce-plan/SKILL.md +++ b/plugins/compound-engineering/skills/ce-plan/SKILL.md @@ -174,8 +174,8 @@ Prepare a concise planning context summary (a paragraph or two) to pass as input Run these agents in parallel: -- Task research:ce-repo-research-analyst(Scope: technology, architecture, patterns. {planning context summary}) -- Task research:ce-learnings-researcher(planning context summary) +- Task ce-repo-research-analyst(Scope: technology, architecture, patterns. {planning context summary}) +- Task ce-learnings-researcher(planning context summary) Collect: - Technology stack and versions (used in section 1.2 to make sharper external research decisions) - Architectural patterns and conventions to follow @@ -185,7 +185,7 @@ Collect: **Slack context** (opt-in) — never auto-dispatch. Route by condition: -- **Tools available + user asked**: Dispatch `research:ce-slack-researcher` with the planning context summary in parallel with other Phase 1.1 agents. If the origin document has a Slack context section, pass it verbatim so the researcher focuses on gaps. Include findings in consolidation. +- **Tools available + user asked**: Dispatch `ce-slack-researcher` with the planning context summary in parallel with other Phase 1.1 agents. If the origin document has a Slack context section, pass it verbatim so the researcher focuses on gaps. Include findings in consolidation. - **Tools available + user didn't ask**: Note in output: "Slack tools detected. Ask me to search Slack for organizational context at any point, or include it in your next prompt." - **No tools + user asked**: Note in output: "Slack context was requested but no Slack tools are available. Install and authenticate the Slack plugin to enable organizational context search." @@ -243,8 +243,8 @@ Announce the decision briefly before continuing. Examples: If Step 1.2 indicates external research is useful, run these agents in parallel: -- Task research:ce-best-practices-researcher(planning context summary) -- Task research:ce-framework-docs-researcher(planning context summary) +- Task ce-best-practices-researcher(planning context summary) +- Task ce-framework-docs-researcher(planning context summary) #### 1.4 Consolidate Research @@ -272,7 +272,7 @@ This ensures flow analysis (Phase 1.5) runs and the confidence check (Phase 5.3) For **Standard** or **Deep** plans, or when user flow completeness is still unclear, run: -- Task workflow:ce-spec-flow-analyzer(planning context summary, research findings) +- Task ce-spec-flow-analyzer(planning context summary, research findings) Use the output to: - Identify missing edge cases, state transitions, or handoff gaps diff --git a/plugins/compound-engineering/skills/ce-plan/references/deepening-workflow.md b/plugins/compound-engineering/skills/ce-plan/references/deepening-workflow.md index 58a623c91..aa06c8826 100644 --- a/plugins/compound-engineering/skills/ce-plan/references/deepening-workflow.md +++ b/plugins/compound-engineering/skills/ce-plan/references/deepening-workflow.md @@ -96,43 +96,43 @@ Use fully-qualified agent names inside Task calls. **Deterministic Section-to-Agent Mapping:** **Requirements Trace / Open Questions classification** -- `workflow:ce-spec-flow-analyzer` for missing user flows, edge cases, and handoff gaps -- `research:ce-repo-research-analyst` (Scope: `architecture, patterns`) for repo-grounded patterns, conventions, and implementation reality checks +- `ce-spec-flow-analyzer` for missing user flows, edge cases, and handoff gaps +- `ce-repo-research-analyst` (Scope: `architecture, patterns`) for repo-grounded patterns, conventions, and implementation reality checks **Context & Research / Sources & References gaps** -- `research:ce-learnings-researcher` for institutional knowledge and past solved problems -- `research:ce-framework-docs-researcher` for official framework or library behavior -- `research:ce-best-practices-researcher` for current external patterns and industry guidance -- Add `research:ce-git-history-analyzer` only when historical rationale or prior art is materially missing +- `ce-learnings-researcher` for institutional knowledge and past solved problems +- `ce-framework-docs-researcher` for official framework or library behavior +- `ce-best-practices-researcher` for current external patterns and industry guidance +- Add `ce-git-history-analyzer` only when historical rationale or prior art is materially missing **Key Technical Decisions** -- `review:ce-architecture-strategist` for design integrity, boundaries, and architectural tradeoffs -- Add `research:ce-framework-docs-researcher` or `research:ce-best-practices-researcher` when the decision needs external grounding beyond repo evidence +- `ce-architecture-strategist` for design integrity, boundaries, and architectural tradeoffs +- Add `ce-framework-docs-researcher` or `ce-best-practices-researcher` when the decision needs external grounding beyond repo evidence **High-Level Technical Design** -- `review:ce-architecture-strategist` for validating that the technical design accurately represents the intended approach and identifying gaps -- `research:ce-repo-research-analyst` (Scope: `architecture, patterns`) for grounding the technical design in existing repo patterns and conventions -- Add `research:ce-best-practices-researcher` when the technical design involves a DSL, API surface, or pattern that benefits from external validation +- `ce-architecture-strategist` for validating that the technical design accurately represents the intended approach and identifying gaps +- `ce-repo-research-analyst` (Scope: `architecture, patterns`) for grounding the technical design in existing repo patterns and conventions +- Add `ce-best-practices-researcher` when the technical design involves a DSL, API surface, or pattern that benefits from external validation **Implementation Units / Verification** -- `research:ce-repo-research-analyst` (Scope: `patterns`) for concrete file targets, patterns to follow, and repo-specific sequencing clues -- `review:ce-pattern-recognition-specialist` for consistency, duplication risks, and alignment with existing patterns -- Add `workflow:ce-spec-flow-analyzer` when sequencing depends on user flow or handoff completeness +- `ce-repo-research-analyst` (Scope: `patterns`) for concrete file targets, patterns to follow, and repo-specific sequencing clues +- `ce-pattern-recognition-specialist` for consistency, duplication risks, and alignment with existing patterns +- Add `ce-spec-flow-analyzer` when sequencing depends on user flow or handoff completeness **System-Wide Impact** -- `review:ce-architecture-strategist` for cross-boundary effects, interface surfaces, and architectural knock-on impact +- `ce-architecture-strategist` for cross-boundary effects, interface surfaces, and architectural knock-on impact - Add the specific specialist that matches the risk: - - `review:ce-performance-oracle` for scalability, latency, throughput, and resource-risk analysis - - `review:ce-security-sentinel` for auth, validation, exploit surfaces, and security boundary review - - `review:ce-data-integrity-guardian` for migrations, persistent state safety, consistency, and data lifecycle risks + - `ce-performance-oracle` for scalability, latency, throughput, and resource-risk analysis + - `ce-security-sentinel` for auth, validation, exploit surfaces, and security boundary review + - `ce-data-integrity-guardian` for migrations, persistent state safety, consistency, and data lifecycle risks **Risks & Dependencies / Operational Notes** - Use the specialist that matches the actual risk: - - `review:ce-security-sentinel` for security, auth, privacy, and exploit risk - - `review:ce-data-integrity-guardian` for persistent data safety, constraints, and transaction boundaries - - `review:ce-data-migration-expert` for migration realism, backfills, and production data transformation risk - - `review:ce-deployment-verification-agent` for rollout checklists, rollback planning, and launch verification - - `review:ce-performance-oracle` for capacity, latency, and scaling concerns + - `ce-security-sentinel` for security, auth, privacy, and exploit risk + - `ce-data-integrity-guardian` for persistent data safety, constraints, and transaction boundaries + - `ce-data-migration-expert` for migration realism, backfills, and production data transformation risk + - `ce-deployment-verification-agent` for rollout checklists, rollback planning, and launch verification + - `ce-performance-oracle` for capacity, latency, and scaling concerns **Agent Prompt Shape:** diff --git a/plugins/compound-engineering/skills/ce-resolve-pr-feedback/SKILL.md b/plugins/compound-engineering/skills/ce-resolve-pr-feedback/SKILL.md index 98c8bd6bb..8ab4705cf 100644 --- a/plugins/compound-engineering/skills/ce-resolve-pr-feedback/SKILL.md +++ b/plugins/compound-engineering/skills/ce-resolve-pr-feedback/SKILL.md @@ -143,7 +143,7 @@ Previously-resolved threads (from `cross_invocation.resolved_threads`) participa #### Individual dispatch (default) -**For review threads** (`review_threads`): Spawn a `workflow:ce-pr-comment-resolver` agent for each new thread that is NOT already assigned to a cluster from step 3. Clustered threads are handled by cluster dispatch below -- do not dispatch them individually. +**For review threads** (`review_threads`): Spawn a `ce-pr-comment-resolver` agent for each new thread that is NOT already assigned to a cluster from step 3. Clustered threads are handled by cluster dispatch below -- do not dispatch them individually. Each agent receives: - The thread ID @@ -153,11 +153,11 @@ Each agent receives: - The feedback type (`review_thread`) - The `isOutdated` flag from the thread node (tells the agent the reported line may have drifted) -**For PR comments and review bodies** (`pr_comments`, `review_bodies`): These lack file/line context. Spawn a `workflow:ce-pr-comment-resolver` agent for each actionable non-clustered item. The agent receives the comment ID, body text, PR number, and feedback type (`pr_comment` or `review_body`). The agent must identify the relevant files from the comment text and the PR diff. +**For PR comments and review bodies** (`pr_comments`, `review_bodies`): These lack file/line context. Spawn a `ce-pr-comment-resolver` agent for each actionable non-clustered item. The agent receives the comment ID, body text, PR number, and feedback type (`pr_comment` or `review_body`). The agent must identify the relevant files from the comment text and the PR diff. #### Cluster dispatch -For each cluster identified in step 3, dispatch ONE `workflow:ce-pr-comment-resolver` agent that receives: +For each cluster identified in step 3, dispatch ONE `ce-pr-comment-resolver` agent that receives: - The `` XML block - All thread details for threads in the cluster (IDs, file paths, line numbers, comment text) - The PR number @@ -376,7 +376,7 @@ This fetches thread IDs and their first comment IDs (minimal fields, no bodies) ### 2. Fix, Reply, Resolve -Spawn a single `workflow:ce-pr-comment-resolver` agent for the thread. Pass the same fields full mode does, including `isOutdated` and the location fields (`line`, `originalLine`, `startLine`, `originalStartLine`) -- targeted threads can be outdated too and need the same relocation handling. Then follow the same validate -> commit -> push -> reply -> resolve flow as Full Mode steps 6-8. +Spawn a single `ce-pr-comment-resolver` agent for the thread. Pass the same fields full mode does, including `isOutdated` and the location fields (`line`, `originalLine`, `startLine`, `originalStartLine`) -- targeted threads can be outdated too and need the same relocation handling. Then follow the same validate -> commit -> push -> reply -> resolve flow as Full Mode steps 6-8. --- diff --git a/plugins/compound-engineering/skills/ce-sessions/SKILL.md b/plugins/compound-engineering/skills/ce-sessions/SKILL.md index f88a34f89..8ec9f0571 100644 --- a/plugins/compound-engineering/skills/ce-sessions/SKILL.md +++ b/plugins/compound-engineering/skills/ce-sessions/SKILL.md @@ -26,7 +26,7 @@ If the lines above resolved to plain values (a folder name like `my-repo` and a If no argument is provided, ask what the user wants to know about their session history. Use the platform's blocking question tool (`AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini). If no question tool is available, ask in plain text and wait for a reply. -Dispatch `research:ce-session-historian` with the user's question as the task prompt. Omit the `mode` parameter so the user's configured permission settings apply. Include in the dispatch prompt: +Dispatch `ce-session-historian` with the user's question as the task prompt. Omit the `mode` parameter so the user's configured permission settings apply. Include in the dispatch prompt: - The user's question - The current working directory diff --git a/plugins/compound-engineering/skills/ce-slack-research/SKILL.md b/plugins/compound-engineering/skills/ce-slack-research/SKILL.md index 8fdb45642..b8b54dea5 100644 --- a/plugins/compound-engineering/skills/ce-slack-research/SKILL.md +++ b/plugins/compound-engineering/skills/ce-slack-research/SKILL.md @@ -29,7 +29,7 @@ The input can be a keyword, a natural language question, or include Slack search If no argument is provided, ask what topic to research. Use the platform's blocking question tool (`AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini). If no question tool is available, ask in plain text and wait for a reply. -Dispatch `research:ce-slack-researcher` with the user's topic as the task prompt. Omit the `mode` parameter so the user's configured permission settings apply. +Dispatch `ce-slack-researcher` with the user's topic as the task prompt. Omit the `mode` parameter so the user's configured permission settings apply. The agent handles everything from here -- Slack MCP discovery, search execution, thread reads, and synthesis. It returns a digest with: diff --git a/plugins/compound-engineering/skills/ce-todo-resolve/SKILL.md b/plugins/compound-engineering/skills/ce-todo-resolve/SKILL.md index 6454b4baf..e961c5867 100644 --- a/plugins/compound-engineering/skills/ce-todo-resolve/SKILL.md +++ b/plugins/compound-engineering/skills/ce-todo-resolve/SKILL.md @@ -30,7 +30,7 @@ Create a task list grouped by type (e.g., `TaskCreate` in Claude Code, `update_p ### 3. Implement (PARALLEL) -Spawn a `workflow:ce-pr-comment-resolver` agent per item. Prefer parallel; fall back to sequential respecting dependency order. +Spawn a `ce-pr-comment-resolver` agent per item. Prefer parallel; fall back to sequential respecting dependency order. **Batching:** 1-4 items: direct parallel returns. 5+ items: batches of 4, each returning only a short status summary (todo handled, files changed, tests run/skipped, blockers). diff --git a/src/targets/codex.ts b/src/targets/codex.ts index dac7ed8a1..5bfeb80dd 100644 --- a/src/targets/codex.ts +++ b/src/targets/codex.ts @@ -91,10 +91,19 @@ export async function writeCodexBundle(outputRoot: string, bundle: CodexBundle): await cleanupRemovedAgents(agentsRoot, manifest, currentAgents) if (agents.length > 0) { for (const agent of agents) { - const agentFile = `${sanitizePathName(agent.name)}.toml` + const agentBaseName = sanitizePathName(agent.name) + const agentFile = `${agentBaseName}.toml` + // If the agent declares no sidecars, remove any same-basename sibling + // directory left behind by a prior install that did. The manifest-driven + // cleanupRemovedAgents sweep above only removes the sibling dir when the + // TOML itself is being removed; a same-name agent that loses its sidecar + // would otherwise leave an orphan directory. + if ((agent.sidecarDirs ?? []).length === 0 && isSafeManagedPath(agentsRoot, agentBaseName)) { + await fs.rm(path.join(agentsRoot, agentBaseName), { recursive: true, force: true }) + } await writeText(path.join(agentsRoot, agentFile), renderCodexAgentToml(agent) + "\n") for (const sidecar of agent.sidecarDirs ?? []) { - await copyDir(sidecar.sourceDir, path.join(agentsRoot, sanitizePathName(agent.name), sidecar.targetName)) + await copyDir(sidecar.sourceDir, path.join(agentsRoot, agentBaseName, sidecar.targetName)) } } } @@ -290,9 +299,19 @@ async function cleanupLegacyAgentSkillDirs( const currentSkillSet = new Set(currentSkills) const legacySkillNames = new Set() for (const agent of bundle.agents ?? []) { - const finalSegment = agent.name.includes("-ce-") ? agent.name.split("-ce-").pop() : agent.name legacySkillNames.add(sanitizePathName(agent.name)) - if (finalSegment) legacySkillNames.add(`ce-${sanitizePathName(finalSegment)}`) + // Cross-layout cleanup for plugins with nested agent directories: if the + // Codex-built agent name contains an embedded `-ce-` (e.g. `review-ce-foo` + // for `agents/review/ce-foo.md`), the same logical agent may have + // previously been installed under the flat-alias name (`ce-foo`) by an + // earlier plugin layout. Seeding the flat alias as a cleanup candidate + // sweeps that orphan skill dir on upgrade. For flat-only layouts (such as + // compound-engineering itself) `agent.name` has no embedded `-ce-` and + // this produces harmless non-matching candidates like `ce-ce-`. + if (agent.name.includes("-ce-")) { + const finalSegment = agent.name.split("-ce-").pop() + if (finalSegment) legacySkillNames.add(`ce-${sanitizePathName(finalSegment)}`) + } } for (const name of getLegacyCodexArtifacts({ pluginName, diff --git a/tests/codex-converter.test.ts b/tests/codex-converter.test.ts index 6079a0df8..8c8b7ef8d 100644 --- a/tests/codex-converter.test.ts +++ b/tests/codex-converter.test.ts @@ -326,19 +326,19 @@ Task compound-engineering:review:ce-security-reviewer(code_diff)`, name: "ce-repo-research-analyst", description: "Repo research", body: "Research repositories.", - sourcePath: "/tmp/plugin/agents/research/ce-repo-research-analyst.agent.md", + sourcePath: "/tmp/plugin/agents/ce-repo-research-analyst.agent.md", }, { name: "ce-learnings-researcher", description: "Learning research", body: "Search learnings.", - sourcePath: "/tmp/plugin/agents/research/ce-learnings-researcher.agent.md", + sourcePath: "/tmp/plugin/agents/ce-learnings-researcher.agent.md", }, { name: "ce-security-reviewer", description: "Security review", body: "Review security.", - sourcePath: "/tmp/plugin/agents/review/ce-security-reviewer.agent.md", + sourcePath: "/tmp/plugin/agents/ce-security-reviewer.agent.md", }, ], skills: [], @@ -355,14 +355,54 @@ Task compound-engineering:review:ce-security-reviewer(code_diff)`, expect(commandSkill).toBeDefined() const parsed = parseFrontmatter(commandSkill!.content) - expect(parsed.body).toContain("Spawn the custom agent `research-ce-repo-research-analyst` with task: feature_description") - expect(parsed.body).toContain("Spawn the custom agent `research-ce-learnings-researcher` with task: feature_description") - expect(parsed.body).toContain("Spawn the custom agent `review-ce-security-reviewer` with task: code_diff") + expect(parsed.body).toContain("Spawn the custom agent `ce-repo-research-analyst` with task: feature_description") + expect(parsed.body).toContain("Spawn the custom agent `ce-learnings-researcher` with task: feature_description") + expect(parsed.body).toContain("Spawn the custom agent `ce-security-reviewer` with task: code_diff") // Original namespaced Task syntax should not remain expect(parsed.body).not.toContain("Task compound-engineering:") }) + test("retains - naming for nested-layout plugins (dead-code fallback)", () => { + // This test pins the behavior of getAgentCategory() for any third-party + // plugin that still uses agents//.md layout. The + // compound-engineering plugin itself is flat, but the converter must keep + // working for other plugins passed through the CLI. + const plugin: ClaudePlugin = { + ...fixturePlugin, + commands: [ + { + name: "plan", + description: "Planning with agents from a nested-layout plugin", + body: `- Task compound-engineering:review:ce-security-reviewer(code_diff)`, + sourcePath: "/tmp/plugin/commands/plan.md", + }, + ], + agents: [ + { + name: "ce-security-reviewer", + description: "Security review", + body: "Review security.", + sourcePath: "/tmp/plugin/agents/review/ce-security-reviewer.agent.md", + }, + ], + skills: [], + } + + const bundle = convertClaudeToCodex(plugin, { + agentMode: "subagent", + inferTemperature: false, + permissions: "none", + codexIncludeSkills: true, + }) + + const commandSkill = bundle.generatedSkills.find((s) => s.name === "plan") + expect(commandSkill).toBeDefined() + const parsed = parseFrontmatter(commandSkill!.content) + + expect(parsed.body).toContain("Spawn the custom agent `review-ce-security-reviewer` with task: code_diff") + }) + test("transforms zero-argument Task calls", () => { const plugin: ClaudePlugin = { ...fixturePlugin, @@ -379,7 +419,7 @@ Task compound-engineering:review:ce-security-reviewer(code_diff)`, name: "ce-code-simplicity-reviewer", description: "Simplicity review", body: "Review simplicity.", - sourcePath: "/tmp/plugin/agents/review/ce-code-simplicity-reviewer.agent.md", + sourcePath: "/tmp/plugin/agents/ce-code-simplicity-reviewer.agent.md", }, ], skills: [], @@ -395,7 +435,7 @@ Task compound-engineering:review:ce-security-reviewer(code_diff)`, const commandSkill = bundle.generatedSkills.find((s) => s.name === "review") expect(commandSkill).toBeDefined() const parsed = parseFrontmatter(commandSkill!.content) - expect(parsed.body).toContain("Spawn the custom agent `review-ce-code-simplicity-reviewer`") + expect(parsed.body).toContain("Spawn the custom agent `ce-code-simplicity-reviewer`") expect(parsed.body).not.toContain("compound-engineering:") expect(parsed.body).not.toContain("skill to:") }) diff --git a/tests/codex-writer.test.ts b/tests/codex-writer.test.ts index 9cd585c8b..2def3395b 100644 --- a/tests/codex-writer.test.ts +++ b/tests/codex-writer.test.ts @@ -395,6 +395,60 @@ describe("writeCodexBundle", () => { } }) + test("sweeps flat-alias skill dir left by a prior layout when the new bundle's agent name has embedded -ce-", async () => { + // Third-party plugins with nested agent directories (e.g. agents/review/ce-foo.md) + // produce Codex agent names like `review-ce-foo`. If the same logical agent + // was previously installed under a flat layout (raw codex name `ce-foo`), + // the now-orphaned skill dir at `.codex/skills//ce-foo/` should be + // moved into legacy-backup on the next install. This is the only cleanup + // path available for third-party plugins, which have no entry in the + // historical allow-list used by getLegacyCodexArtifacts. + const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "codex-nested-xmigrate-")) + const codexRoot = path.join(tempRoot, ".codex") + const pluginName = "third-party-nested" + const managedSkillsRoot = path.join(codexRoot, "skills", pluginName) + + // Simulate orphan flat-alias skill dir from the earlier layout. + await fs.mkdir(path.join(managedSkillsRoot, "ce-foo"), { recursive: true }) + await fs.writeFile( + path.join(managedSkillsRoot, "ce-foo", "SKILL.md"), + "stale flat-alias skill from prior install", + ) + + await writeCodexBundle(codexRoot, { + pluginName, + prompts: [], + skillDirs: [], + generatedSkills: [], + agents: [ + { + name: "review-ce-foo", + description: "Nested-layout agent", + instructions: "Do review work on foo.", + }, + ], + }) + + // The current install writes the nested-layout agent, not a same-named skill dir. + expect(await exists(path.join(codexRoot, "agents", pluginName, "review-ce-foo.toml"))).toBe(true) + + // The orphan flat-alias skill dir should have been relocated. + expect(await exists(path.join(managedSkillsRoot, "ce-foo"))).toBe(false) + + // And should be reachable under legacy-backup. + const backupRoot = path.join(codexRoot, pluginName, "legacy-backup") + expect(await exists(backupRoot)).toBe(true) + const timestamps = await fs.readdir(backupRoot) + let foundBackup = false + for (const ts of timestamps) { + const skillsBackup = path.join(backupRoot, ts, "skills") + if (!(await exists(skillsBackup))) continue + const backed = await fs.readdir(skillsBackup) + if (backed.includes("ce-foo")) foundBackup = true + } + expect(foundBackup).toBe(true) + }) + test("agents-only install preserves namespaced skills previously installed via Codex native plugin flow", async () => { // Regression for the bug where re-running `install --to codex` after a // native `/plugins` install moved currently-active namespaced skills @@ -765,6 +819,87 @@ Workflow handoff: expect(installedSkill).not.toContain("/prompts:settings") expect(installedSkill).not.toContain("https://prompts:www.proofeditor.ai") }) + + test("removes orphan sidecar dir when retained agent declares no sidecars", async () => { + const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "codex-test-")) + const agentsRoot = path.join(tempRoot, ".codex", "agents") + const orphanDir = path.join(agentsRoot, "ce-foo", "stale-content") + await fs.mkdir(orphanDir, { recursive: true }) + await fs.writeFile(path.join(orphanDir, "leftover.txt"), "stale", "utf8") + await fs.writeFile(path.join(agentsRoot, "ce-foo.toml"), "old-toml", "utf8") + + const bundle: CodexBundle = { + prompts: [], + skillDirs: [], + generatedSkills: [], + agents: [ + { + name: "ce-foo", + description: "Foo agent", + instructions: "Do foo.", + }, + ], + mcpServers: {}, + } + + await writeCodexBundle(tempRoot, bundle) + + expect(await entryExists(path.join(agentsRoot, "ce-foo"))).toBe(false) + expect(await exists(path.join(agentsRoot, "ce-foo.toml"))).toBe(true) + }) + + test("keeps sidecar dir when retained agent declares sidecars", async () => { + const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "codex-test-")) + const sidecarSource = await fs.mkdtemp(path.join(os.tmpdir(), "codex-sidecar-src-")) + await fs.writeFile(path.join(sidecarSource, "script.sh"), "#!/bin/sh\necho hi\n", "utf8") + + const bundle: CodexBundle = { + prompts: [], + skillDirs: [], + generatedSkills: [], + agents: [ + { + name: "ce-foo", + description: "Foo agent", + instructions: "Do foo.", + sidecarDirs: [{ sourceDir: sidecarSource, targetName: "scripts" }], + }, + ], + mcpServers: {}, + } + + await writeCodexBundle(tempRoot, bundle) + + const agentsRoot = path.join(tempRoot, ".codex", "agents") + expect(await exists(path.join(agentsRoot, "ce-foo.toml"))).toBe(true) + expect(await exists(path.join(agentsRoot, "ce-foo", "scripts", "script.sh"))).toBe(true) + }) + + test("leaves unrelated directories under agentsRoot alone", async () => { + const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "codex-test-")) + const agentsRoot = path.join(tempRoot, ".codex", "agents") + const unrelatedDir = path.join(agentsRoot, "ce-bar-extra") + await fs.mkdir(unrelatedDir, { recursive: true }) + await fs.writeFile(path.join(unrelatedDir, "keep-me.txt"), "keep", "utf8") + + const bundle: CodexBundle = { + prompts: [], + skillDirs: [], + generatedSkills: [], + agents: [ + { + name: "ce-foo", + description: "Foo agent", + instructions: "Do foo.", + }, + ], + mcpServers: {}, + } + + await writeCodexBundle(tempRoot, bundle) + + expect(await exists(path.join(unrelatedDir, "keep-me.txt"))).toBe(true) + }) }) describe("renderCodexConfig", () => { diff --git a/tests/kiro-writer.test.ts b/tests/kiro-writer.test.ts index eefdce210..fd1ee1e89 100644 --- a/tests/kiro-writer.test.ts +++ b/tests/kiro-writer.test.ts @@ -38,7 +38,7 @@ describe("writeKiroBundle", () => { const kiroRoot = path.join(tempRoot, ".kiro") await fs.mkdir(path.join(kiroRoot, "agents", "prompts"), { recursive: true }) const sessionHistorianDescription = await pluginDescription( - "plugins/compound-engineering/agents/research/ce-session-historian.agent.md", + "plugins/compound-engineering/agents/ce-session-historian.agent.md", ) await fs.writeFile( diff --git a/tests/legacy-cleanup.test.ts b/tests/legacy-cleanup.test.ts index 697193186..02c53a68b 100644 --- a/tests/legacy-cleanup.test.ts +++ b/tests/legacy-cleanup.test.ts @@ -257,14 +257,14 @@ describe("cleanupStaleAgents", () => { path.join(root, "adversarial-reviewer.md"), agentContent( "adversarial-reviewer", - await pluginDescription("plugins/compound-engineering/agents/review/ce-adversarial-reviewer.agent.md"), + await pluginDescription("plugins/compound-engineering/agents/ce-adversarial-reviewer.agent.md"), ), ) await createFile( path.join(root, "learnings-researcher.md"), agentContent( "learnings-researcher", - await pluginDescription("plugins/compound-engineering/agents/research/ce-learnings-researcher.agent.md"), + await pluginDescription("plugins/compound-engineering/agents/ce-learnings-researcher.agent.md"), ), ) @@ -281,14 +281,14 @@ describe("cleanupStaleAgents", () => { path.join(root, "security-sentinel.agent.md"), agentContent( "security-sentinel", - await pluginDescription("plugins/compound-engineering/agents/review/ce-security-sentinel.agent.md"), + await pluginDescription("plugins/compound-engineering/agents/ce-security-sentinel.agent.md"), ), ) await createFile( path.join(root, "performance-oracle.agent.md"), agentContent( "performance-oracle", - await pluginDescription("plugins/compound-engineering/agents/review/ce-performance-oracle.agent.md"), + await pluginDescription("plugins/compound-engineering/agents/ce-performance-oracle.agent.md"), ), ) @@ -304,14 +304,14 @@ describe("cleanupStaleAgents", () => { path.join(root, "slack-researcher.json"), kiroAgentConfigContent( "slack-researcher", - await pluginDescription("plugins/compound-engineering/agents/research/ce-slack-researcher.agent.md"), + await pluginDescription("plugins/compound-engineering/agents/ce-slack-researcher.agent.md"), ), ) await createFile( path.join(root, "session-historian.json"), kiroAgentConfigContent( "session-historian", - await pluginDescription("plugins/compound-engineering/agents/research/ce-session-historian.agent.md"), + await pluginDescription("plugins/compound-engineering/agents/ce-session-historian.agent.md"), ), ) await createFile( @@ -336,14 +336,14 @@ describe("cleanupStaleAgents", () => { path.join(root, "code-simplicity-reviewer"), skillContent( "code-simplicity-reviewer", - await pluginDescription("plugins/compound-engineering/agents/review/ce-code-simplicity-reviewer.agent.md"), + await pluginDescription("plugins/compound-engineering/agents/ce-code-simplicity-reviewer.agent.md"), ), ) await createDir( path.join(root, "repo-research-analyst"), skillContent( "repo-research-analyst", - await pluginDescription("plugins/compound-engineering/agents/research/ce-repo-research-analyst.agent.md"), + await pluginDescription("plugins/compound-engineering/agents/ce-repo-research-analyst.agent.md"), ), ) @@ -618,7 +618,7 @@ describe("idempotency", () => { path.join(root, "adversarial-reviewer.md"), agentContent( "adversarial-reviewer", - await pluginDescription("plugins/compound-engineering/agents/review/ce-adversarial-reviewer.agent.md"), + await pluginDescription("plugins/compound-engineering/agents/ce-adversarial-reviewer.agent.md"), ), ) diff --git a/tests/pi-writer.test.ts b/tests/pi-writer.test.ts index 0b4a99365..3a1d4d28c 100644 --- a/tests/pi-writer.test.ts +++ b/tests/pi-writer.test.ts @@ -32,7 +32,7 @@ describe("writePiBundle", () => { const outputRoot = path.join(tempRoot, ".pi") const sessionHistorianDescription = await pluginDescription( - "plugins/compound-engineering/agents/research/ce-session-historian.agent.md", + "plugins/compound-engineering/agents/ce-session-historian.agent.md", ) await fs.mkdir(path.join(outputRoot, "skills", "session-historian"), { recursive: true }) diff --git a/tests/pipeline-review-contract.test.ts b/tests/pipeline-review-contract.test.ts index 25fe6c5ed..44a8b1d76 100644 --- a/tests/pipeline-review-contract.test.ts +++ b/tests/pipeline-review-contract.test.ts @@ -597,7 +597,7 @@ describe("ce-compound frontmatter schema expansion contract", () => { describe("ce-learnings-researcher domain-agnostic contract", () => { test("agent prompt frames as domain-agnostic not bug-focused", async () => { const agent = await readRepoFile( - "plugins/compound-engineering/agents/research/ce-learnings-researcher.agent.md" + "plugins/compound-engineering/agents/ce-learnings-researcher.agent.md" ) // Domain-agnostic identity framing diff --git a/tests/review-skill-contract.test.ts b/tests/review-skill-contract.test.ts index 8c0d9d312..226a81ce7 100644 --- a/tests/review-skill-contract.test.ts +++ b/tests/review-skill-contract.test.ts @@ -205,11 +205,11 @@ describe("ce-code-review contract", () => { ) for (const agent of [ - "review:ce-dhh-rails-reviewer", - "review:ce-kieran-rails-reviewer", - "review:ce-kieran-python-reviewer", - "review:ce-kieran-typescript-reviewer", - "review:ce-julik-frontend-races-reviewer", + "ce-dhh-rails-reviewer", + "ce-kieran-rails-reviewer", + "ce-kieran-python-reviewer", + "ce-kieran-typescript-reviewer", + "ce-julik-frontend-races-reviewer", ]) { expect(content).toContain(agent) expect(catalog).toContain(agent) @@ -222,23 +222,23 @@ describe("ce-code-review contract", () => { test("stack-specific reviewer agents follow the structured findings contract", async () => { const reviewers = [ { - path: "plugins/compound-engineering/agents/review/ce-dhh-rails-reviewer.agent.md", + path: "plugins/compound-engineering/agents/ce-dhh-rails-reviewer.agent.md", reviewer: "dhh-rails", }, { - path: "plugins/compound-engineering/agents/review/ce-kieran-rails-reviewer.agent.md", + path: "plugins/compound-engineering/agents/ce-kieran-rails-reviewer.agent.md", reviewer: "kieran-rails", }, { - path: "plugins/compound-engineering/agents/review/ce-kieran-python-reviewer.agent.md", + path: "plugins/compound-engineering/agents/ce-kieran-python-reviewer.agent.md", reviewer: "kieran-python", }, { - path: "plugins/compound-engineering/agents/review/ce-kieran-typescript-reviewer.agent.md", + path: "plugins/compound-engineering/agents/ce-kieran-typescript-reviewer.agent.md", reviewer: "kieran-typescript", }, { - path: "plugins/compound-engineering/agents/review/ce-julik-frontend-races-reviewer.agent.md", + path: "plugins/compound-engineering/agents/ce-julik-frontend-races-reviewer.agent.md", reviewer: "julik-frontend-races", }, ] @@ -262,7 +262,7 @@ describe("ce-code-review contract", () => { test("leaves data-migration-expert as the unstructured review format", async () => { const content = await readRepoFile( - "plugins/compound-engineering/agents/review/ce-data-migration-expert.agent.md", + "plugins/compound-engineering/agents/ce-data-migration-expert.agent.md", ) expect(content).toContain("## Reviewer Checklist") @@ -304,7 +304,7 @@ describe("ce-code-review contract", () => { describe("testing-reviewer contract", () => { test("includes behavioral-changes-with-no-test-additions check", async () => { - const content = await readRepoFile("plugins/compound-engineering/agents/review/ce-testing-reviewer.agent.md") + const content = await readRepoFile("plugins/compound-engineering/agents/ce-testing-reviewer.agent.md") // New check exists in "What you're hunting for" section expect(content).toContain("Behavioral changes with no test additions")