Init agent config

From yigitkonur/skills-by-yigitkonur · View interactive version

Init agent config is an AI agent skill from the GitHub repository yigitkonur/skills-by-yigitkonur. Use if creating, auditing, or migrating CLAUDE.md/AGENTS.md/REVIEW.md instruction files.

How to use this skill

Skill file

Init Agent Config

AGENTS-first instruction hierarchies, built from real repo evidence. AGENTS.md is the source of truth for how agents work. CLAUDE.md is its sibling companion. REVIEW.md is the optional review-standardization layer. Native review adapters (Copilot, Devin, Greptile) are configurable last-stage outputs.

Default Claude compatibility: every finalized AGENTS.md gets a sibling CLAUDE.md symlink. If symlinks are impossible in the target environment, fall back to a one-line @AGENTS.md wrapper and call out the exception in your response.

When to use

Do NOT use for

File responsibilities

Keep the split clear. One file = one purpose.

| Surface | Purpose | Default status |

|---------|---------|----------------|

| AGENTS.md | How agents should work, where code lives, what local boundaries exist | Required |

| CLAUDE.md | Compatibility companion for each finalized AGENTS.md | Required symlink or @AGENTS.md wrapper |

| REVIEW.md | What diffs should be flagged, protected, or held to a higher bar | Default when in scope or evidence warrants |

| Folder AGENTS.md | Local delta only — never restate root | Conditional on Wave 2 evidence |

| .github/copilot-instructions.md | Copilot review adapter | Configurable final step |

| Devin review files | Devin Bug Catcher adapters | Configurable final step |

| .greptile/config.json | Greptile review adapter | Configurable final step |

Quick boundary:

Non-negotiables

Read these every run. They are the hard guardrails.

  1. Inspect the repo before drafting anything. No template-first writing.
  2. AGENTS.md comes first. Companion files (CLAUDE.md, GEMINI.md, .cursor/rules/*) come after the AGENTS hierarchy exists.
  3. Sibling CLAUDE.md after each finalized AGENTS.md. Symlink by default; @AGENTS.md wrapper only when symlinks are unsupported (call it out).
  4. REVIEW.md decision comes after AGENTS+CLAUDE. Generate by default for review-standardization runs or when discovery exposes repo-specific risks; otherwise document why it was skipped.
  5. Native review adapters are the LAST step. Do not ask about Copilot/Devin/Greptile until AGENTS+CLAUDE+REVIEW are complete.
  6. Wave-based discovery. Wave 1 (broad architecture) → Wave 2 (folder deep dives) → write. Never skip Wave 2 just because Wave 1 found the stack.
  7. Folder rule. Treat each meaningful first-level src/*, apps/*, packages/*, services/* folder as a local AGENTS.md candidate. Skip only when Wave 2 proves the local delta is empty.
  8. Verify commands and paths against real files. Never invent. Mark [unverified] when you cannot confirm.
  9. Complement existing config; do not blind-replace it. Preserve Always, Ask, Never, WARNING, CRITICAL, DO NOT rules unless the repo proves them obsolete.
  10. High-signal directives over prose. If a line would not prevent a mistake, cut it.
  11. Audit report before edits when existing files are present, unless the user explicitly waives it.

Anti-derail guardrails

| Derail | Correction |

|--------|------------|

| Writing from templates before discovery is complete | Run Wave 1 + Wave 2; templates load only after the file plan exists |

| Skipping Wave 2 because Wave 1 found the stack | Wave 2 is mandatory before folder files |

| Writers start from partial findings | Merge both waves before writer dispatch |

| Child AGENTS.md repeats root rules | Keep child files lean — local delta only |

| REVIEW.md becomes a second copy of AGENTS.md | Operating guidance vs diff scrutiny — separate concerns |

| CLAUDE.md grows into a second source of truth | Symlink to AGENTS.md; Claude-only behavior lives in .claude/ |

| Universal content trapped in CLAUDE.md or GEMINI.md | Promote it to AGENTS.md |

| Native adapter generated as the default deliverable | Adapters are configurable last-step outputs only |

| Shared defaults written into AGENTS.override.md or CLAUDE.local.md | Those are override/personal layers — not for shared defaults |

| Existing config is mostly correct and you rewrote it anyway | Switch to audit/tighten mode |

Scripts

Resolve script paths relative to this skill directory.

| Script | Use when | Mutates |

|--------|----------|---------|

| scripts/audit-agents-md.sh | Step 1 audit of existing instruction surfaces, line counts, companion status, native adapters, duplicate-source risks. See scripts/audit-agents-md.sh.md. | No |

| scripts/scaffold-agents-md.sh | After discovery and file planning, emit one minimal root/folder AGENTS.md or REVIEW.md skeleton. See scripts/scaffold-agents-md.sh.md. | Only with explicit --write |

Workflow

1. Scope the request

Classify before reading deeply.

| Request type | Output contract |

|-------------|-----------------|

| New setup | Root + evidence-gated folder AGENTS.md hierarchy, sibling CLAUDE.md companions, review-context decision/output, then optional adapter question |

| Audit | Quality report first, then targeted edits to unstable files, companion status, review-context gaps |

| Migration | Extract shared rules into AGENTS.md, move agent-native behavior out, preserve critical warnings, repair companions, decide review context |

| Extension | Add missing folder files or entrypoints without rewriting stable root files; touch review context only if new scope warrants |

Inventory existing instruction surfaces:

Run scripts/audit-agents-md.sh (or equivalent read-only checks) before editing anything.

2. Build the folder map locally

Use the filesystem before dispatching explorers.

3. Wave 1 — broad architecture

Goal: identify architecture shape, command sources, critical workflows, major boundaries, and existing instruction debt.

Wait for all Wave 1 findings. Compare overlap, contradictions, gaps before moving on.

4. Wave 2 — folder-specific deep dives

Trigger only after Wave 1 is merged.

Wait for all Wave 2 findings. Merge overlaps and resolve contradictions before writing.

5. Synthesize the AGENTS hierarchy before writing

Translate findings into a file plan:

6. Audit report before rewriting existing files

When the repo already has agent instructions, output the audit before edits.

Use references/audit-and-migration.md. Output structure:

  1. ## Agent Instructions Quality Report
  2. summary counts and average score
  3. file-by-file scores with concrete evidence
  4. recommended changes
  5. apply edits only after the report — unless the user explicitly waives it

7. Draft AGENTS.md files

Top-down. Use the WHAT / WHY / HOW filter from references/agents-md-format.md.

8. Create companion entrypoints

After the AGENTS hierarchy is stable:

See references/agent-entrypoints.md for the full support matrix and per-agent rules.

9. Writer-agent pass (optional)

After both discovery waves are merged, dispatch writers if the file plan is wide.

10. Generate the review-context layer

After AGENTS is written, decide whether the same evidence warrants REVIEW.md.

See references/review-context.md for purpose, exceptions, section order, scoped review rules, and adapter relationships.

11. Validate before finalizing

12. Final configurable step — native review adapters

Only after Step 11 passes, ask one concise question:

The AGENTS.md hierarchy is complete and the REVIEW.md decision is recorded. Which native review adapters should also be generated for this repo: Copilot, Devin, Greptile, or none?

Adapter defaults:

Reference routing

Read the smallest reference set that unblocks the current decision.

| Need | Reference |

|------|-----------|

| Wave 1, Wave 2, or writer prompt scaffolds | references/discovery-prompts.md |

| REVIEW.md purpose, exceptions, root/scoped split, adapter relationships | references/review-context.md |

| AGENTS authoring, folder scoping, WHAT/WHY/HOW, derailment catalog | references/agents-md-format.md |

| Companion entrypoints, native review adapters, setup gotchas, cross-agent surfaces | references/agent-entrypoints.md |

| Auditing existing files, report format, migrations | references/audit-and-migration.md |

| Starter templates for root and folder files | references/project-templates.md |

Quick-start mapping

| Situation | Start with | Then read |

|-----------|------------|-----------|

| New repo with no agent files | references/project-templates.md | references/agents-md-format.md |

| Existing CLAUDE.md-only repo | references/audit-and-migration.md | references/agent-entrypoints.md |

| Monorepo or large src/ tree | references/agents-md-format.md | references/project-templates.md, references/agent-entrypoints.md |

| Multi-agent team (Codex + Cursor + Claude + Gemini) | references/agent-entrypoints.md | references/agents-md-format.md |

| Folder-level instruction writing | references/agents-md-format.md | references/project-templates.md |

| Existing noisy / duplicated config | references/audit-and-migration.md | references/agents-md-format.md |

| AGENTS+REVIEW done, user wants Copilot/Devin/Greptile adapters | references/agent-entrypoints.md | stay in this skill and generate them |

Start with one or two references. Expand only if the task truly needs more.

Final output expectations

When you generate or revise files, return:

  1. instruction hierarchy created or changed
  2. repo evidence that drove the hierarchy
  3. audit report before edits when existing files were present
  4. review-context output, or explicit reason it was not generated
  5. companion entrypoint status for each finalized AGENTS.md
  6. verification rung reached
  7. unresolved unknowns called out outside the generated files
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.