agentleFS
funky-eyesfunky-eyes/best-copilot/skills/repo-init-gate/SKILL.md

repo-init-gate

Skill12 starsChanged 6 months agoApache-2.0View on GitHub

Use before repo-init-scan to cheaply decide whether a target repository already satisfies the current best-copilot init contract by reading only the root `best-copilot.md` sentinel.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

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

    Use this tiny skill before loading repo-init-scan.

    line 8
  2. Distinctive:

    When loaded, the next assistant action must be only this gate.

    line 12
  3. Distinctive:

    If the helper cannot be located or shell execution is unavailable, execute the inline gate exactly:

    line 22
  4. Very specific:

    Read only the target root best-copilot.md, or determine that it is missing or unreadable.

    line 24
  5. Very specific:

    If the frontmatter version is current, skip repo-init-scan.

    line 27
  6. Very specific:

    If skill invocation fails, run the preflight helper when available.

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill 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
SKILL.md

Repo Init Gate

Use this tiny skill before loading repo-init-scan. It is the repeat-request fast path.

Immediate Execution Rule

When loaded, the next assistant action must be only this gate.

Preferred shell-capable path: run the bundled preflight helper from the target root when it is discoverable:

<best-copilot-skills-dir>/repo-init-gate/scripts/run-preflight.sh "$PWD" claude

For an installed Claude Code plugin, resolve the helper from CLAUDE_SKILL_DIR when present, or from the active plugin skills/ directory. The helper reads only the target root best-copilot.md on the fast path. If the sentinel frontmatter version is not current, it immediately delegates to repo-init-scan/scripts/bootstrap-after-gate-failure.sh, which owns official init, manual fallback, artifact verification, and the final ## Init Summary.

If the helper cannot be located or shell execution is unavailable, execute the inline gate exactly:

  1. Read only the target root best-copilot.md, or determine that it is missing or unreadable.
  2. Parse only its YAML frontmatter and compare version to the current contract version below.
  3. Emit the ## Repo Init Gate output block below.
  4. If the frontmatter version is current, skip repo-init-scan; otherwise run repo-init-scan or its single-command bootstrap helper before any business-source read/search.

Forbidden before this block: search, grep, glob, source reads, project structure exploration, code intelligence, planning, dispatch, implementation summaries, scaffold writes, or reading .github/instructions/**, memories/**, spec/**, AGENTS.md, or CLAUDE.md.

Contract

Canonical best-copilot.md content written by init:

---
version: "0.8.0"
---
  • Current YAML frontmatter version: "0.8.0": ready + skip_repo_init_scan.
  • Missing, unreadable, invalid frontmatter, missing version, or version mismatch: report the corresponding gate result and run repo-init-scan.
  • Extra content after a current frontmatter block is not a reason to run scan on repeat requests. Writers should still keep the canonical three-line sentinel when creating or repairing the file.
  • Explicit reinitialize/repair requests bypass this gate and run repo-init-scan.
  • This gate is read-only; repo-init-scan owns sentinel creation/repair.
  • If skill invocation fails, run the preflight helper when available. Otherwise do the same single-file read inline and report HARNESS_DEGRADED skill_invocation_unavailable.

Output

## Repo Init Gate
- gate_result: ready|needs_init|version_mismatch|invalid_sentinel
- next_action: skip_repo_init_scan|run_repo_init_scan
- evidence: target_root_best_copilot_md=present|missing|unreadable, observed_version=<version-or-none>

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.