agentleFS
funky-eyesfunky-eyes/best-copilot/CLAUDE.md

best-copilot

CLAUDE.md12 starsChanged 6 months agoApache-2.0View on GitHub

best-copilot is a multi-runtime agent-team workflow plugin for Claude Code, Codex, and GitHub Copilot CLI. It is not a compiled application — all artifacts are Markdown (agents, skills, instructions) and JSON (manifests). There is no build step, no test suite, and no linter beyond JSON/YAML validation. The project serves three runtimes from shared sources using an adapter pattern: Key rule: shared behavior stays in skills/, incompatible runtime metadata stays in agents/, claude-agents/, .codex-plugin/, or .agents/. Never mix them. Shared behavior…

The file

We split this CLAUDE.md into the rules it gives an agent

10 rules. About 0 are common, 4 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After editing agents/skills/instructions, reinstall the plugin or run /reload-plugins in Claude Code before testing.

    line 63
  2. Very specific:

    When plugin.json version changes, update the init contract version in best-copilot.md, all repo-init-* skills, the best-copilot.md sample …

    line 64
  3. Distinctive:

    When installed in another repository, persistent state goes to that target repo — never to this plugin package:

    line 68
  4. Distinctive:

    MUST warn the user: if impact analysis returns HIGH or CRITICAL risk before proceeding with edits.

    line 91
  5. Very specific:

    When GitNexus is selected for unfamiliar code, use gitnexus_query({query: "concept"}) to find execution flows instead of grepping.

    line 92
  6. Very specific:

    When you need full context on a specific symbol — callers, callees, which execution flows it participates in — use gitnexus_context({name: …

    line 93
  7. Distinctive:

    NEVER edit a function, class, or method without first obtaining equivalent impact/context evidence from the selected provider.

    line 97
  8. Distinctive:

    NEVER ignore HIGH or CRITICAL risk warnings from impact analysis.

    line 98
  9. Very specific:

    When GitNexus is selected, NEVER rename symbols with find-and-replace — use gitnexus_rename which understands the call graph.

    line 99
  10. Very specific:

    When GitNexus is selected, NEVER commit changes without running gitnexus_detect_changes() to check affected scope.

    line 100

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What This Is

best-copilot is a multi-runtime agent-team workflow plugin for Claude Code, Codex, and GitHub Copilot CLI. It is not a compiled application — all artifacts are Markdown (agents, skills, instructions) and JSON (manifests). There is no build step, no test suite, and no linter beyond JSON/YAML validation.

Validation Commands

CheckCommand
Validate all JSON manifestsruby -rjson -e 'JSON.parse(File.read("plugin.json")); JSON.parse(File.read(".codex-plugin/plugin.json")); JSON.parse(File.read("claude-plugin/.claude-plugin/plugin.json")); JSON.parse(File.read(".claude-plugin/marketplace.json")); JSON.parse(File.read("settings.json")); JSON.parse(File.read("marketplace.json")); JSON.parse(File.read(".github/plugin/marketplace.json")); JSON.parse(File.read(".agents/plugins/marketplace.json")); puts "json ok"'
Validate YAML frontmatter in all agents/skills`ruby -ryaml -e 'Dir["{agents,skills,claude-agents}/**/*.{md,agent.md}"].sort.uniq.each {fs=File.read(f); next unless s.start_with?("---"); YAML.safe_load(s.split("---",3)[1], permitted_classes: [Symbol]); }; puts "frontmatter ok"'`
List skillsfind skills -maxdepth 3 -name SKILL.md | sort
List Copilot agentsfind agents -maxdepth 1 -name '*.agent.md' | sort
List Claude agentsfind claude-agents -maxdepth 1 -name '*.md' | sort
Verify Claude plugin inventoryclaude --plugin-dir /absolute/path/to/best-copilot/claude-plugin plugin details best-copilot (should show 8 agents, 39 skills)
Check for leftover placeholdersrg --hidden -n "legacy-template-name|project-specific-name|internal-host" .
Whitespace issuesgit diff --check

Architecture

Multi-Runtime Adapter Pattern

The project serves three runtimes from shared sources using an adapter pattern:

  • Shared layer — skills/core-workflow-contract/SKILL.md: cross-role contracts (source priority, dispatch packets, review/verification gates, memory/spec rules, closeout). Role-specific behavior lives in skills/*-workflow/SKILL.md.
  • Copilot CLI layer — agents/*.agent.md: Copilot-specific metadata (model names, user_invocable, agents, handoffs). Skills loaded from root skills/.
  • Claude Code layer — claude-agents/*.md: Claude-specific metadata (Claude model aliases opus / sonnet / haiku, agent-team rules, read-only restrictions). Skills exposed via claude-plugin/skills -> ../skills symlink. Agents via claude-plugin/agents -> ../claude-agents symlink.
  • Codex layer — .codex-plugin/plugin.json, .agents/plugins/marketplace.json, and plugins/best-copilot/: Codex plugin/marketplace metadata. The installable Codex subpackage has its own .codex-plugin/plugin.json and skills -> ../../skills; .agents/skills -> ../skills exposes the same skills for direct repo-scoped Codex use.

Key rule: shared behavior stays in skills/, incompatible runtime metadata stays in agents/, claude-agents/, .codex-plugin/, or .agents/. Never mix them.

Reliability Gates

Shared behavior in skills/core-workflow-contract/SKILL.md and .github/instructions/must.instructions.md requires explicit assumptions/tradeoffs, the simplest viable approach, surgical diffs, read-before-write evidence for code edits, goal-driven verification, and done/verified/left checkpoints for multi-step work. Target bootstrap templates must carry the same gates.

Agent Team (8 roles)

Senior Project Expert owns orchestration (intent, scope, dispatch, fan-in, closeout). Seven specialists own their domain: Technical Architect (SDD design, implementation), Developer (frozen slices), Frontend Designer (UI), Specification Writer (requirements/specs), Quality Assurance Expert (verification/merge readiness), Security Reviewer (auth/deps/release surface), Root Cause Fixer (failure triage).

Skill Loading

  • Claude agents declare skills: in frontmatter — only core-workflow-contract + matching role workflow are preloaded. Senior Project Expert also preloads repo-init-gate; repo-init-scan is loaded only when the sentinel gate fails. In shell-capable Claude Code, the preferred failed-gate path is the bundled repo-init-gate/scripts/run-preflight.sh helper, which preserves the sentinel fast path and directly runs the scan bootstrap on failure.
  • Focused skills (e.g., structured-review, test-driven-development) are on-demand via namespaced slash commands such as /best-copilot:skill-name when installed as a plugin.
  • Codex loads bundled skills through the plugin or .agents/skills; invoke @best-copilot or a bundled $skill explicitly when a workflow must be used. Codex subagent workflows require explicit spawn/delegation instructions and are not automatic on plugin install.
  • In agent teams, teammate skills: frontmatter is ignored — spawn prompts must name skills explicitly or the teammate returns NEEDS_CONTEXT missing_required_skill.
  • A Skill(...) Successfully loaded line means Claude loaded instructions; it does not mean the workflow ran. Repo init is complete only after the target files are created or verified on disk and the preflight/scan path reports required_artifacts_verified: yes, sentinel_written: yes, and next_task_ready: yes.

Code Intelligence MCP

Structural code intelligence is capability-aware and optional. Choose by current tool inventory in this order: codebase-memory-mcp graph tools, GitNexus (mcp__gitnexus__*), CodeGraph (mcp__codegraph__*), language-server navigation/diagnostics, then built-in Read/Grep/Glob plus shell rg. Use the selected provider for symbol discovery, call-chain/context tracing, impact assessment, and review scope; record missing chain evidence when native search is the only option. A local binary or plugin inventory entry is not enough, and absent tools must not be called.

Init Gate (mandatory preflight)

Before any substantive target-repository work: repo-init-gate reads the target root best-copilot.md sentinel. If frontmatter version: "0.8.0" matches, skip repo-init-scan. Otherwise run the preflight/scan bootstrap path, which orchestrates official init (/init or copilot init), normalizes facts into .github/instructions/project.instructions.md, and bootstraps missing scaffolds. Work is fail-closed until init is verified.

Editing Conventions

  • Edit Codex install metadata in .codex-plugin/ and .agents/, Copilot agents in agents/*.agent.md, Claude agents in claude-agents/*.md, shared skills in skills/.
  • .github/instructions/** contains repo-level rules: must.instructions.md (core rules), project.instructions.md (project facts), skills-index.instructions.md (skill routing).
  • After editing agents/skills/instructions, reinstall the plugin or run /reload-plugins in Claude Code before testing. Copilot CLI reads from its installed plugin cache; Codex local plugin tests should restart the thread/session after marketplace or plugin changes.
  • When plugin.json version changes, update the init contract version in best-copilot.md, all repo-init-* skills, the best-copilot.md sample in target-instructions-bootstrap/SKILL.md, .codex-plugin/plugin.json, and all marketplace metadata.

Target Repository Integration

When installed in another repository, persistent state goes to that target repo — never to this plugin package:

  • .github/instructions/project.instructions.md — project facts
  • memories/repo/** — persistent task recovery
  • spec/** — requirements, design, tasks
  • best-copilot.md — init sentinel (frontmatter version: "0.8.0")

Bootstrap skills (target-instructions-bootstrap, target-memory-bootstrap, target-spec-bootstrap) create these scaffolds on first use.

<!-- gitnexus:start -->

Code Intelligence — Provider Fallback

Use the highest exposed provider in this order: codebase-memory-mcp graph tools, GitNexus, CodeGraph, language-server tooling, then native Read/Grep/Glob and rg. Use it for symbol discovery, context and caller/callee tracing, impact analysis, change-scope review, and semantic refactoring when available. Record the selected provider and any missing chain evidence. Do not call absent tools or block solely because a provider is unavailable.

GitNexus — Fallback Provider

This project is indexed by GitNexus as best-copilot (1294 symbols, 1301 relationships, 0 execution flows). Use its MCP tools when codebase-memory-mcp is not exposed.

If any GitNexus tool warns the index is stale, run npx gitnexus analyze in terminal first.

Always Do

  • When GitNexus is selected, run impact analysis before editing a symbol. Before modifying a function, class, or method, run gitnexus_impact({target: "symbolName", direction: "upstream"}) and report the blast radius (direct callers, affected processes, risk level) to the user.
  • When GitNexus is selected, run gitnexus_detect_changes() before committing to verify your changes only affect expected symbols and execution flows.
  • MUST warn the user if impact analysis returns HIGH or CRITICAL risk before proceeding with edits.
  • When GitNexus is selected for unfamiliar code, use gitnexus_query({query: "concept"}) to find execution flows instead of grepping. It returns process-grouped results ranked by relevance.
  • When you need full context on a specific symbol — callers, callees, which execution flows it participates in — use gitnexus_context({name: "symbolName"}).

Never Do

  • NEVER edit a function, class, or method without first obtaining equivalent impact/context evidence from the selected provider.
  • NEVER ignore HIGH or CRITICAL risk warnings from impact analysis.
  • When GitNexus is selected, NEVER rename symbols with find-and-replace — use gitnexus_rename which understands the call graph.
  • When GitNexus is selected, NEVER commit changes without running gitnexus_detect_changes() to check affected scope.

Resources

ResourceUse for
gitnexus://repo/best-copilot/contextCodebase overview, check index freshness
gitnexus://repo/best-copilot/clustersAll functional areas
gitnexus://repo/best-copilot/processesAll execution flows
gitnexus://repo/best-copilot/process/{name}Step-by-step execution trace

CLI

TaskRead this skill file
Understand architecture / "How does X work?".claude/skills/gitnexus/gitnexus-exploring/SKILL.md
Blast radius / "What breaks if I change X?".claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md
Trace bugs / "Why is X failing?".claude/skills/gitnexus/gitnexus-debugging/SKILL.md
Rename / extract / split / refactor.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md
Tools, resources, schema reference.claude/skills/gitnexus/gitnexus-guide/SKILL.md
Index, status, clean, wiki CLI commands.claude/skills/gitnexus/gitnexus-cli/SKILL.md
<!-- gitnexus:end -->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.