--- name: andes-init description: "Install or refresh the shared Andes standards in this repository: writes the managed block in the root AGENTS.md (read by Claude Code and GitHub Copilot), scaffolds the project's own sections on first install, wires CLAUDE.md to it, and offers opt-in settings and cleanup of old drop-in copies. Run on request only." --- # andes-init Run only when the user asked for `andes-init` (for example `/andes-core:andes-init` in Claude Code or `/andes-init` in Copilot CLI). Never start it on your own. Installs the Andes always-on standards into the current repository and keeps them current. Safe to re-run: a second run with nothing new changes nothing. The template is `assets/agents-block.md` in this skill's own directory (resolve it relative to this `SKILL.md`, not the user's repo); `assets/project-section.md` next to it is the scaffold for the project's own sections; `assets/copilot-hooks.json` and `../../scripts/check-links.mjs` are the repo-level link-check hook and the script it runs. Work from the repository root (`git rev-parse --show-toplevel`). Never touch text outside the `andes` markers, and never delete a file without the user's explicit yes. ## 1. AGENTS.md Read the template. Then, in the repo root: - **No `AGENTS.md`** → create it with the template, a blank line, and the contents of `assets/project-section.md` (placeholder sections — About this repository, Layout, Build/test/run, Conventions — that the team fills in; tell the user they are placeholders). Only a first install adds the scaffold. - **Exactly one `` … `` pair** → replace everything from the begin marker through the end marker with the template. If it is already identical, report "AGENTS.md is up to date". - **No markers** → append a blank line and the template to the end of the file. - **Anything else** (one marker without the other, several pairs, nested markers) → stop, show the user the marker lines found, and ask how to proceed. Do not guess. ## 2. CLAUDE.md Claude Code reads `AGENTS.md` natively only when no `CLAUDE.md`, `.claude/CLAUDE.md`, or `CLAUDE.local.md` exists — one personal `CLAUDE.local.md` silently turns it off. An `@AGENTS.md` import is immune to that and never loads the file twice. - If `CLAUDE.md` or `.claude/CLAUDE.md` exists and neither contains a line that is exactly `@AGENTS.md`, add that line at the top of the one that exists (root first). - If neither exists, create `CLAUDE.md` containing exactly `@AGENTS.md`. - If `.github/copilot-instructions.md` exists, tell the user Copilot loads it **and** `AGENTS.md`; offer to move anything project-specific into `AGENTS.md` (outside the markers) and delete it. Never delete it without a yes. ## 3. Detect the stacks From `git ls-files`: `*.csproj` / `*.sln` / `*.slnx` → `andes-dotnet`; `*.razor` → `andes-dotnet-wasm`; `angular.json` → `andes-angular`; `*.tf` → `andes-terraform`; `.github/workflows/*` → `andes-github`; `azure-pipelines.yml` or an existing `## Azure DevOps` section in `AGENTS.md` → `andes-azure-devops` (a hint only — Azure Pipelines does not imply Azure Boards). `andes-core` is always included. Report which plugins match and which of them are not installed. ## 4. Opt-in settings Plugins cannot ship settings, so offer these **one at a time**, show the exact diff, and apply only on a yes. Merge into existing JSON; never drop or reorder existing keys. 1. `.claude/settings.json` — team rollout for Claude Code: - `extraKnownMarketplaces.andes`: `{ "source": { "source": "github", "repo": "RorroRojas3/awesome-claude-copilot" } }` - `enabledPlugins`: `"@andes": true` for each detected plugin - when `andes-angular` is enabled: `permissions.deny` gains `"mcp__plugin_andes-angular_angular-cli__ai_tutor"` (the Angular CLI server has no flag to drop its tutor tool; a bare-name deny removes it from context) 2. `.claude/settings.json` — `"effortLevel": "xhigh"` (the Andes default; costs more per turn — ask separately). 3. `.github/hooks/` — the broken-link check for the Copilot cloud agent. The cloud agent never loads plugins, so the `andes-core` hooks do not run there; it reads only the repository's `.github/hooks/*.json`. On a yes, copy `assets/copilot-hooks.json` to `.github/hooks/andes-links.json` and `../../scripts/check-links.mjs` to `.github/hooks/andes/check-links.mjs` with a file copy (`cp`, `Copy-Item`), never by retyping the script. On a re-run, refresh either file when it differs from the plugin's copy. Never touch other files in `.github/hooks/`. Tell the user the hook needs Node.js 18 or later on the agent's `PATH` (GitHub-hosted runners include it; a custom `copilot-setup-steps.yml` environment may not), and that Copilot CLI then runs this repository copy while the plugin's own link-check hook stands down. 4. `.gitignore` — a `docs/plans/` line, so the planner's working plans are never committed. Skip when the root `.gitignore` already ignores that folder; create the file when it is missing. Do not offer VS Code settings (`chat.plugins.*`, `chat.useAgentsMdFile`): the agents load in VS Code, but installing and configuring the plugins there is untested. ## 5. Old drop-in copies Earlier versions of these standards were copied into repositories. Look for, and list with paths: - `.claude/rules/{csharp,aspnet-rest-apis,azure-functions-csharp,blazor-wasm,csharp-mcp-server,terraform,api-architecture,ui-architecture}.md` and `.github/instructions/.instructions.md` - `.claude/agents/{csharp-code-reviewer,angular-code-reviewer,github-actions-reviewer,prd-generator,se-technical-writer}.md` and `.github/agents/*.agent.md` for the same roles plus `planner-expert`, `csharp-expert`, `angular-expert`, `full-stack-expert`, `csharp-dotnet-janitor`, `csharp-mcp-expert` - `.claude/skills/` or `.github/skills/` for any skill an installed Andes plugin also ships - `microsoft-learn`, `angular-cli`, `context7`, `terraform`, or `azure-devops` servers in `.mcp.json` / `.vscode/mcp.json` (the plugins start their own) - `microsoft-docs@claude-plugins-official` in `enabledPlugins` (it starts a second Microsoft Learn server) These load the same guidance twice or contradict the plugins. Offer to delete them as one batch; delete only on a yes. ## 6. Report End with a short list: files created or changed (name the placeholder sections if you scaffolded them), settings applied or declined, the cloud-agent link-check hook installed, refreshed, or declined, whether `docs/plans/` is git-ignored, leftovers kept, and plugins still to install (`/plugin install @andes` in Claude Code; `copilot plugin install @andes` in Copilot CLI).