Team Init — Repo Onboarding
Analyze the host repo and fill in .github/copilot-instructions.md placeholders automatically.
Steps
0. Detect installation context
Before beginning, determine how the agent team was installed:
Check: Do .agent.md files exist in the project's .github/agents/ directory?
Plugin context (no local agent files — team runs from a plugin):
- Inform the user: "Agents are provided by the copilot-agent-team plugin — no agent files will be copied into your repo."
- Skip Check for agent collisions — plugin agents are read-only
- In Fill or merge template, only create/update
.github/copilot-instructions.md and .github/agent-journals/ directory
- Do NOT copy agent files, instruction files, or prompt files into the project
- Remind the user: "To customize an agent, copy its
.agent.md from the plugin into .github/agents/ — local agents override plugin agents."
- Also tell the user about the
team-export skill and when to use it: full local ownership, broad customization across many agents, stricter audit/review workflows, or exporting before uninstalling the plugin.
Local context (agent files exist in .github/agents/):
- Proceed with the full flow including collision detection and file management
1. Detect project type
- Scan repo root for:
package.json, *.csproj/*.sln, pyproject.toml/setup.py, go.mod, Cargo.toml, pom.xml/build.gradle, Gemfile, composer.json, mix.exs
- Note monorepo indicators:
workspaces, lerna.json, nx.json, turbo.json
2. Check for agent collisions
Before writing any files, scan the host repo for agents that may conflict with the incoming team.
Locate existing agents:
- Search for
*.agent.md files anywhere in the repo (common paths: .github/agents/, .vscode/agents/, .copilot/agents/)
- Also check
AGENTS.md / agents.md for inline agent definitions
- If nothing is found, skip the rest of this step silently
Source-control context (required before collision decisions):
- If source control is available (for example Git), inspect repository changes before resolving collisions.
- For any candidate colliding file, review source-control status and diff first (new, modified, deleted, renamed).
- Use source-control diff context as a primary input when proposing keep/merge/replace outcomes.
- If source control is unavailable, continue with content-only comparison and state that limitation explicitly.
Parsing AGENTS.md:
AGENTS.md files have no standard format. Try these extraction strategies in order:
- YAML frontmatter blocks — look for
--- delimited blocks with name and description keys
- Heading-based sections — each
## or ### heading is an agent name; the body text below is the description
- Markdown tables — columns like
Name | Description | …; each row is an agent
- Prose paragraphs — look for bold agent names (
**name**) followed by a colon and description text
Extract from each agent found: a name and a description (first 200 chars if longer).
Build a collision map:
For each existing agent found, extract:
- Its filename stem (e.g.
guru from guru.agent.md)
- Its
description frontmatter field — or the first 200 chars of body text if no frontmatter
- All "Use when:" trigger phrases
Compare against every incoming team agent (coordinator, clerk, platform-engineer, developer, tester, designer, agent-creator, product, reviewer) using three detection layers.
Layer 1 — Name collision (exact match or known alias):
Check the existing agent's filename stem against this alias table:
| Incoming agent |
Also matches these names |
coordinator |
lead, orchestrator, manager, hub, conductor |
clerk |
writer, docs, scribe, secretary, note-taker |
platform-engineer |
devops, infra, sre, ops, infrastructure, deploy |
developer |
coder, dev, engineer, programmer, implementer |
tester |
qa, quality, test-engineer, test-runner, testing |
designer |
ux, ui, ux-designer, ui-engineer, design, css |
agent-creator |
agent-builder, factory, agent-maker, meta-agent |
product |
pm, product-manager, product-owner, po, planner |
reviewer |
auditor, checker, code-reviewer, linter, gate |
Before comparing, normalize all names: lowercase, then replace underscores and spaces with hyphens (e.g. platform_engineer → platform-engineer). A hit on any alias → flag as name collision.
Layer 2 — Keyword overlap (proportional threshold):
Tokenize "Use when:" trigger phrases by splitting on commas, then trimming whitespace, and discarding any empty tokens (for example, from trailing commas or ellipses). Treat each comma-separated phrase as one keyword (e.g. "shell scripting" is one keyword, not two). Comparison is case-insensitive.
Compute: overlap_ratio = overlapping_keywords / min(count_A, count_B), where count_A and count_B are the numbers of non-empty keywords for each agent after tokenization.
Flag a keyword collision when overlap_ratio ≥ 0.30 (i.e. ≥ 30% of the shorter keyword list overlaps).
Layer 3 — Semantic domain judgment:
Even when Layers 1 and 2 find no match, flag a semantic collision if, in your judgment, both agents would be invoked for the same class of user requests. Two agents can describe the same functional domain using entirely different vocabulary (e.g. "manages deployment pipelines, container orchestration" vs. "Docker CLI, Dockerfile, docker-compose"). Consider:
- Would a user's request plausibly route to both agents?
- Do they operate on the same file types, tools, or system boundaries?
- Do their descriptions target the same workflow stage (build, test, deploy, review)?
If any layer flags a collision, proceed to the interview below.
Conduct an interview for each detected collision:
Present a collision card:
⚠️ Potential conflict detected
Incoming agent : platform-engineer
Your agent : guru (.github/agents/guru.agent.md)
--- Incoming "Use when" ---
command line, shell scripting, bash, zsh, PowerShell, terminal, CLI tools,
cross-platform scripting, GitHub Actions, CI/CD …
--- Your "Use when" ---
command line, shell scripting, bash, zsh, PowerShell, terminal …
Overlapping keywords: command line, shell scripting, bash, zsh, PowerShell, terminal
When available, add a Source-control diff context block to the collision card summarizing what changed in the colliding file and why that affects the recommendation.
Then ask the user:
How would you like to resolve this?
A — Keep the incoming agent (platform-engineer replaces guru)
B — Keep your agent (skip installing platform-engineer)
C — Keep both (rename the incoming one, e.g. team-platform-engineer)
D — Merge (draft a combined agent together)
E — Show me the full content of both agents first
- D (Merge): Draft a merged
description and system-prompt that combines both. Present it, iterate until the user approves, and use the merged file going forward.
- E (Review): Display full file contents of both agents side by side, then loop back to the choice.
Collect all decisions before proceeding. Do not write any agent files until every collision is resolved.
Carry these decisions forward into the later step where you write or overwrite agent files:
- A / D: write the incoming (or merged) agent file, overwriting the existing one
- B: skip writing that incoming agent entirely
- C: write the incoming agent under the agreed new name; leave the existing file untouched
3. Infer product info
- Read
README.md — first H1 = product name, first paragraph = description
- Fallbacks:
package.json name+description, pyproject.toml [project], *.csproj <RootNamespace>, Cargo.toml [package]
4. Detect commands
package.json → scripts (build, dev, start, test, lint)
Makefile → target names; pyproject.toml → [project.scripts]; fallback pytest
.csproj/.sln → dotnet build/run/test; go.mod → go build/run/test ./...
Cargo.toml → cargo build/run/test; docker-compose.yml → docker compose up
5. Map architecture
- List top-level dirs; identify
src/, lib/, app/, api/, web/, packages/, services/
- Build depth-2 directory tree → Solution structure block
- Identify key components (API, UI, DB, shared libs) → Key components table
6. Detect conventions
- Framework: infer from deps (
react, next, vue, angular, fastapi, flask, django, express, blazor, gin)
- Styling:
tailwind.config.*, postcss.config.*, *.module.css, *.scss, styled-components
- Testing:
jest.config.*, vitest.config.*, playwright.config.*, pytest.ini, *.test.*, *.spec.*
- API:
graphql, trpc, REST patterns, .proto files
- Naming: observe existing files — kebab-case, PascalCase, snake_case
7. Detect routes
- Next.js:
app/ or pages/ dirs; React Router: <Route, createBrowserRouter
- ASP.NET:
[Route(, MapGet(, MapPost(; FastAPI/Flask: @app.get, @app.route, @router
- Express:
router.get, app.get; Rails: config/routes.rb
- Fill Page Routes table; omit if no routes found
8. Fill or merge template
Plugin context: Only create/update .github/copilot-instructions.md with discovered values and ensure .github/agent-journals/ directory exists. Do not copy any agent, instruction, or prompt files. Continue with Ask user.
If .github/copilot-instructions.md does not exist:
- Create it from plugin template
templates/copilot-instructions.md.
- Then continue with Greenfield/Brownfield logic below.
Greenfield (template placeholders present):
- Replace every
[placeholder] in .github/copilot-instructions.md with discovered values
- Remove unfilled placeholder rows; preserve Agent Team and MCP Servers sections
Brownfield (existing copilot-instructions.md with real content):
- Read the existing file fully before making changes
- Identify which sections already have project-specific content — preserve them
- For sections that exist in both: propose a merged version, showing what's new from the team template alongside existing content. Never silently overwrite user content.
- For sections only in the template (e.g., Agent Team, MCP Servers): append them
- For sections only in the existing file: keep them untouched
- If the existing file uses a different structure/format: adapt the team sections to match, don't restructure the user's file
- Show a diff-style summary of proposed changes before writing
9. Ask user
- Ask the user for anything not auto-detected (goals, state management, patterns)
- Batch related questions into a single prompt
10. Verify
- Show the filled-in file and ask for confirmation before writing
- Apply requested changes and re-confirm
11. Handoff to team-export (informational)
- After completion, remind the user that
team-export is available if they want to locally own all team files.
- Explain why they might use it: repository-local customization at scale, auditable commits for agent changes, and easier long-term divergence from plugin defaults.
- Do not run
team-export automatically; only run it if the user asks.
Source: pr0nin/copilot-agent-team — distributed by TomeVault.
1---2name: pr0nin-copilot-agent-team-team-init3description: Team Init — Repo Onboarding4---56# Team Init — Repo Onboarding78Analyze the host repo and fill in `.github/copilot-instructions.md` placeholders automatically.910## Steps1112### 0. Detect installation context1314Before beginning, determine how the agent team was installed:1516**Check**: Do `.agent.md` files exist in the project's `.github/agents/` directory?1718**Plugin context** (no local agent files — team runs from a plugin):19- Inform the user: *"Agents are provided by the copilot-agent-team plugin — no agent files will be copied into your repo."*20- Skip **Check for agent collisions** — plugin agents are read-only21- In **Fill or merge template**, only create/update `.github/copilot-instructions.md` and `.github/agent-journals/` directory22- Do NOT copy agent files, instruction files, or prompt files into the project23- Remind the user: *"To customize an agent, copy its `.agent.md` from the plugin into `.github/agents/` — local agents override plugin agents."*24- Also tell the user about the `team-export` skill and when to use it: full local ownership, broad customization across many agents, stricter audit/review workflows, or exporting before uninstalling the plugin.2526**Local context** (agent files exist in `.github/agents/`):27- Proceed with the full flow including collision detection and file management2829### 1. Detect project type30- Scan repo root for: `package.json`, `*.csproj`/`*.sln`, `pyproject.toml`/`setup.py`, `go.mod`, `Cargo.toml`, `pom.xml`/`build.gradle`, `Gemfile`, `composer.json`, `mix.exs`31- Note monorepo indicators: `workspaces`, `lerna.json`, `nx.json`, `turbo.json`3233### 2. Check for agent collisions3435Before writing any files, scan the host repo for agents that may conflict with the incoming team.3637**Locate existing agents:**38- Search for `*.agent.md` files anywhere in the repo (common paths: `.github/agents/`, `.vscode/agents/`, `.copilot/agents/`)39- Also check `AGENTS.md` / `agents.md` for inline agent definitions40- If nothing is found, skip the rest of this step silently4142**Source-control context (required before collision decisions):**43- If source control is available (for example Git), inspect repository changes before resolving collisions.44- For any candidate colliding file, review source-control status and diff first (new, modified, deleted, renamed).45- Use source-control diff context as a primary input when proposing keep/merge/replace outcomes.46- If source control is unavailable, continue with content-only comparison and state that limitation explicitly.4748**Parsing `AGENTS.md`:**49AGENTS.md files have no standard format. Try these extraction strategies in order:501. **YAML frontmatter blocks** — look for `---` delimited blocks with `name` and `description` keys512. **Heading-based sections** — each `##` or `###` heading is an agent name; the body text below is the description523. **Markdown tables** — columns like `Name | Description | …`; each row is an agent534. **Prose paragraphs** — look for bold agent names (`**name**`) followed by a colon and description text5455Extract from each agent found: a name and a description (first 200 chars if longer).5657**Build a collision map:**58For each existing agent found, extract:59- Its filename stem (e.g. `guru` from `guru.agent.md`)60- Its `description` frontmatter field — or the first 200 chars of body text if no frontmatter61- All "Use when:" trigger phrases6263Compare against every incoming team agent (coordinator, clerk, platform-engineer, developer, tester, designer, agent-creator, product, reviewer) using three detection layers.6465**Layer 1 — Name collision (exact match or known alias):**6667Check the existing agent's filename stem against this alias table:6869| Incoming agent | Also matches these names |70|---|---|71| `coordinator` | `lead`, `orchestrator`, `manager`, `hub`, `conductor` |72| `clerk` | `writer`, `docs`, `scribe`, `secretary`, `note-taker` |73| `platform-engineer` | `devops`, `infra`, `sre`, `ops`, `infrastructure`, `deploy` |74| `developer` | `coder`, `dev`, `engineer`, `programmer`, `implementer` |75| `tester` | `qa`, `quality`, `test-engineer`, `test-runner`, `testing` |76| `designer` | `ux`, `ui`, `ux-designer`, `ui-engineer`, `design`, `css` |77| `agent-creator` | `agent-builder`, `factory`, `agent-maker`, `meta-agent` |78| `product` | `pm`, `product-manager`, `product-owner`, `po`, `planner` |79| `reviewer` | `auditor`, `checker`, `code-reviewer`, `linter`, `gate` |8081Before comparing, normalize all names: lowercase, then replace underscores and spaces with hyphens (e.g. `platform_engineer` → `platform-engineer`). A hit on any alias → flag as name collision.8283**Layer 2 — Keyword overlap (proportional threshold):**8485Tokenize "Use when:" trigger phrases by splitting on commas, then trimming whitespace, and discarding any empty tokens (for example, from trailing commas or ellipses). Treat each comma-separated phrase as one keyword (e.g. "shell scripting" is one keyword, not two). Comparison is case-insensitive.8687Compute: `overlap_ratio = overlapping_keywords / min(count_A, count_B)`, where `count_A` and `count_B` are the numbers of non-empty keywords for each agent after tokenization.8889Flag a **keyword collision** when `overlap_ratio ≥ 0.30` (i.e. ≥ 30% of the shorter keyword list overlaps).9091**Layer 3 — Semantic domain judgment:**9293Even when Layers 1 and 2 find no match, flag a **semantic collision** if, in your judgment, both agents would be invoked for the same class of user requests. Two agents can describe the same functional domain using entirely different vocabulary (e.g. "manages deployment pipelines, container orchestration" vs. "Docker CLI, Dockerfile, docker-compose"). Consider:94- Would a user's request plausibly route to both agents?95- Do they operate on the same file types, tools, or system boundaries?96- Do their descriptions target the same workflow stage (build, test, deploy, review)?9798If any layer flags a collision, proceed to the interview below.99100**Conduct an interview for each detected collision:**101102Present a collision card:103104```105⚠️ Potential conflict detected106107Incoming agent : platform-engineer108Your agent : guru (.github/agents/guru.agent.md)109110--- Incoming "Use when" ---111command line, shell scripting, bash, zsh, PowerShell, terminal, CLI tools,112cross-platform scripting, GitHub Actions, CI/CD …113114--- Your "Use when" ---115command line, shell scripting, bash, zsh, PowerShell, terminal …116117Overlapping keywords: command line, shell scripting, bash, zsh, PowerShell, terminal118```119120When available, add a **Source-control diff context** block to the collision card summarizing what changed in the colliding file and why that affects the recommendation.121122Then ask the user:123124> How would you like to resolve this?125>126> **A** — Keep the **incoming agent** (`platform-engineer` replaces `guru`) 127> **B** — Keep **your agent** (skip installing `platform-engineer`) 128> **C** — Keep **both** (rename the incoming one, e.g. `team-platform-engineer`) 129> **D** — **Merge** (draft a combined agent together) 130> **E** — Show me the full content of both agents first131132- **D (Merge):** Draft a merged `description` and system-prompt that combines both. Present it, iterate until the user approves, and use the merged file going forward.133- **E (Review):** Display full file contents of both agents side by side, then loop back to the choice.134135Collect all decisions before proceeding. Do not write any agent files until every collision is resolved.136137**Carry these decisions forward into the later step where you write or overwrite agent files:**138- **A / D**: write the incoming (or merged) agent file, overwriting the existing one139- **B**: skip writing that incoming agent entirely140- **C**: write the incoming agent under the agreed new name; leave the existing file untouched141142### 3. Infer product info143- Read `README.md` — first H1 = product name, first paragraph = description144- Fallbacks: `package.json` `name`+`description`, `pyproject.toml` `[project]`, `*.csproj` `<RootNamespace>`, `Cargo.toml` `[package]`145146### 4. Detect commands147- `package.json` → `scripts` (`build`, `dev`, `start`, `test`, `lint`)148- `Makefile` → target names; `pyproject.toml` → `[project.scripts]`; fallback `pytest`149- `.csproj`/`.sln` → `dotnet build/run/test`; `go.mod` → `go build/run/test ./...`150- `Cargo.toml` → `cargo build/run/test`; `docker-compose.yml` → `docker compose up`151152### 5. Map architecture153- List top-level dirs; identify `src/`, `lib/`, `app/`, `api/`, `web/`, `packages/`, `services/`154- Build depth-2 directory tree → **Solution structure** block155- Identify key components (API, UI, DB, shared libs) → **Key components** table156157### 6. Detect conventions158- **Framework**: infer from deps (`react`, `next`, `vue`, `angular`, `fastapi`, `flask`, `django`, `express`, `blazor`, `gin`)159- **Styling**: `tailwind.config.*`, `postcss.config.*`, `*.module.css`, `*.scss`, `styled-components`160- **Testing**: `jest.config.*`, `vitest.config.*`, `playwright.config.*`, `pytest.ini`, `*.test.*`, `*.spec.*`161- **API**: `graphql`, `trpc`, REST patterns, `.proto` files162- **Naming**: observe existing files — kebab-case, PascalCase, snake_case163164### 7. Detect routes165- **Next.js**: `app/` or `pages/` dirs; **React Router**: `<Route`, `createBrowserRouter`166- **ASP.NET**: `[Route(`, `MapGet(`, `MapPost(`; **FastAPI/Flask**: `@app.get`, `@app.route`, `@router`167- **Express**: `router.get`, `app.get`; **Rails**: `config/routes.rb`168- Fill **Page Routes** table; omit if no routes found169170### 8. Fill or merge template171172**Plugin context**: Only create/update `.github/copilot-instructions.md` with discovered values and ensure `.github/agent-journals/` directory exists. Do not copy any agent, instruction, or prompt files. Continue with **Ask user**.173174**If `.github/copilot-instructions.md` does not exist**:175- Create it from plugin template `templates/copilot-instructions.md`.176- Then continue with Greenfield/Brownfield logic below.177178**Greenfield** (template placeholders present):179- Replace every `[placeholder]` in `.github/copilot-instructions.md` with discovered values180- Remove unfilled placeholder rows; preserve **Agent Team** and **MCP Servers** sections181182**Brownfield** (existing `copilot-instructions.md` with real content):183- Read the existing file fully before making changes184- Identify which sections already have project-specific content — preserve them185- For sections that exist in both: propose a merged version, showing what's new from the team template alongside existing content. Never silently overwrite user content.186- For sections only in the template (e.g., Agent Team, MCP Servers): append them187- For sections only in the existing file: keep them untouched188- If the existing file uses a different structure/format: adapt the team sections to match, don't restructure the user's file189- Show a diff-style summary of proposed changes before writing190191### 9. Ask user192- Ask the user for anything not auto-detected (goals, state management, patterns)193- Batch related questions into a single prompt194195### 10. Verify196- Show the filled-in file and ask for confirmation before writing197- Apply requested changes and re-confirm198199### 11. Handoff to team-export (informational)200- After completion, remind the user that `team-export` is available if they want to locally own all team files.201- Explain why they might use it: repository-local customization at scale, auditable commits for agent changes, and easier long-term divergence from plugin defaults.202- Do not run `team-export` automatically; only run it if the user asks.203204---205> Source: [pr0nin/copilot-agent-team](https://github.com/pr0nin/copilot-agent-team) — distributed by [TomeVault](https://tomevault.io).206<!-- tomevault:4.0:skill_md:2026-05-23 -->