Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions .agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ Orchestrators do **not** act as detailed spec writers. They should pass minimal

Orchestrators also decide whether optional follow-through is needed after implementation or bug fixing.

The orchestration itself lives in two skills, [`igniteui-angular-implement-feature`](./skills/igniteui-angular-implement-feature/SKILL.md) and [`igniteui-angular-fix-bug`](./skills/igniteui-angular-fix-bug/SKILL.md), because skills work in every tool that supports the Agent Skills format and custom agents do not. The two orchestrator agents are the Copilot entry points for those skills: they load the skill and add Copilot's handoff buttons. In other tools, ask for the skill directly; it runs each specialist step in a subagent where the tool has subagents, and otherwise step by step in the same session.

### 2. Specialists

Specialist agents own a single focused responsibility.
Expand All @@ -157,8 +159,8 @@ Examples:

| Goal | Start with |
|---|---|
| Add or expand a feature | `feature-orchestrator-agent` |
| Investigate and fix a bug | `bug-fixing-orchestrator-agent` |
| Add or expand a feature | `feature-orchestrator-agent` (Copilot) or the `igniteui-angular-implement-feature` skill |
| Investigate and fix a bug | `bug-fixing-orchestrator-agent` (Copilot) or the `igniteui-angular-fix-bug` skill |
| Write failing tests first | `tdd-test-writer-agent` |
| Implement a known feature | `feature-implementer-agent` |
| Implement a known bug fix | `bug-fixing-implementer-agent` |
Expand All @@ -178,7 +180,7 @@ Use the feature flow when the task is about **new behavior**, **new public API**

### Main entry point

- `feature-orchestrator-agent`
- `feature-orchestrator-agent` in Copilot, or the [`igniteui-angular-implement-feature`](./skills/igniteui-angular-implement-feature/SKILL.md) skill in any tool

### Flow

Expand Down Expand Up @@ -270,7 +272,7 @@ Use the bug-fix flow when the task is about **broken existing behavior**, **regr

### Main entry point

- `bug-fixing-orchestrator-agent`
- `bug-fixing-orchestrator-agent` in Copilot, or the [`igniteui-angular-fix-bug`](./skills/igniteui-angular-fix-bug/SKILL.md) skill in any tool

### Flow

Expand Down Expand Up @@ -413,6 +415,8 @@ skills/igniteui-angular-generate-from-image-design/SKILL.md
.agents/skills/igniteui-angular-testing/SKILL.md
.agents/skills/igniteui-angular-linting/SKILL.md
.agents/skills/igniteui-angular-skill-authoring/SKILL.md
.agents/skills/igniteui-angular-implement-feature/SKILL.md
.agents/skills/igniteui-angular-fix-bug/SKILL.md
```

Repository-specific skills for implementation guidance:
Expand All @@ -429,6 +433,11 @@ The internal operational skills are shared references for repository commands an
- `igniteui-angular-linting` — lint command reference, ESLint and Stylelint config locations, and lint expectations before work is considered complete.
- `igniteui-angular-skill-authoring` — frontmatter validation rules, the WHEN TO USE / WHEN NOT TO USE description format, and the 500-line body budget for writing or updating skills.

The internal workflow skills hold the orchestration that both orchestrator agents follow:

- `igniteui-angular-implement-feature` — feature workflow: scope discovery, impact mapping, specialist steps in TDD order, backtracking, and the completeness check.
- `igniteui-angular-fix-bug` — bug-fix workflow: root-cause analysis, the Bug Knowledge handoff, specialist steps, escalation, multi-branch fixes, and commit and PR conventions.

Orchestrators should use these skills for command selection instead of repeating command lists inline.

---
Expand All @@ -445,11 +454,19 @@ CLAUDE.md ← imports AGENTS.md for Claude Code
.agents/
README.md ← this guide
agents/ ← custom agent definitions (this system)
skills/ ← internal operational skills (build, testing, linting)
skills/ ← internal skills (feature and bug-fix workflows, build, testing, linting)
.github/agents/ ← Copilot pointer files, generated from .agents/agents/
scripts/sync-agents.mjs ← generates the pointer files; CI runs it with --check
.claude/settings.json ← Claude Code permission rules
.github/workflows/dependency-changes.yml ← CI approval gate for manifest and lock file changes
```

The "Never" rules in `AGENTS.md` are enforced where a tool allows it:

- `.claude/settings.json` denies Claude Code edits to `package.json` files and lock files, denies reads of `.env`, `.npmrc`, and key files, and asks before `npm install <package>`, `npm uninstall`, `npm update`, `npm dedupe`, and `npm audit fix`.
- The `Dependency changes` workflow fails a pull request that changes a `package.json` or lock file until a maintainer adds the `dependencies` label. Dependabot adds that label itself. This check covers every tool and every contributor.
- Copilot has no file-level permission settings, so it relies on `AGENTS.md` and the CI check.

- Put new agents in `.agents/agents/` and new internal (contributor-facing) skills in `.agents/skills/<skill-name>/SKILL.md`.
- Public, user-facing skills that ship with the package stay in the root [`skills/`](../skills/) folder.
- Repository coding standards live in [`AGENTS.md`](../AGENTS.md), the single source of shared instructions. `CLAUDE.md` only imports it (`@AGENTS.md`) so Claude Code loads the same instructions.
Expand Down
234 changes: 4 additions & 230 deletions .agents/agents/bug-fixing-orchestrator-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,235 +49,9 @@ copilot:

# Bug Fixing Orchestrator

You route bug-fix work for **Ignite UI for Angular** to specialist agents. Your job is **investigation, root-cause analysis, impact mapping, and routing** — not writing tests or production code.
You run the bug-fix workflow for **Ignite UI for Angular** as an orchestrator. Your job is **investigation, root-cause analysis, impact mapping, and routing** — not writing tests or production code.

You do NOT write tests, production code, or detailed implementation instructions. Each specialist agent reads the original bug report and applies its own judgment.
The workflow is defined in the [`igniteui-angular-fix-bug`](../skills/igniteui-angular-fix-bug/SKILL.md) skill, so every tool follows the same steps. Read that skill before doing anything else and follow it as your complete instructions, with these orchestrator rules:

---

## What You Do

1. **Investigate the bug** — understand reproduction steps, expected vs. actual behavior
2. **Locate affected code** — find relevant components, services, and files
3. **Root-cause analysis** — identify the root cause before routing any work
4. **Map impact** — determine what follow-through work is needed (migration, changelog, README, styles/theming, multi-branch)
5. **Route work** — hand off to the right agents in the right order
6. **Handle edge cases** — escalate when the bug cannot be reproduced, is by design, or is a third-party issue
7. **Verify completeness** — check that nothing was missed after agents finish

## What You Do NOT Do

- Do not write tests or production code
- Do not specify exact test cases, exact implementations, or exact file changes
- Do not over-constrain the handoff prompts — give scope and root cause, not specs
- Do not modify dependency manifests or lock files (`package.json`, `package-lock.json`, etc.). Ask for approval first if a dependency change is truly required.

---

## Handoff

When routing work, pass scope, root cause, and context — not a mini-spec.

Keep handoff framing minimal:
- reference the original bug report
- identify affected components or files
- share the root cause finding
- note whether migration, i18n, accessibility, styles/theming, or changelog follow-through may apply

Do not restate the bug as:
- detailed fix requirements
- exact test cases
- exact implementation instructions

---

## Delegation Format

When delegating to another agent, always include a **Bug Knowledge** block:

- **Bug report**: one short sentence summarizing expected vs. actual behavior
- **Root cause**: one short sentence explaining why the bug occurs
- **Affected files**: concise path list of source files relevant to the fix
- **Failing test**: path and description of the reproduction test (if written by `tdd-test-writer-agent`)
- **Impact notes**: only relevant flags such as breaking change, i18n, accessibility, styles/theming, changelog, README, multi-branch

This block is what downstream agents (especially `bug-fixing-implementer-agent`) use to skip redundant investigation.

Do not add sections such as:
- `Fix Requirements`
- `Expected Test Coverage`
- `What to Test`
- step-by-step instructions

---

> Skills:
> - APIs: `skills/igniteui-angular-{components,grids,theming}/SKILL.md`
> - Build / test / lint: `.agents/skills/`

---

## Key Repository Paths

```
projects/igniteui-angular/<component>/src/ ← source + tests
projects/igniteui-angular/<component>/index.ts ← public barrel
projects/igniteui-angular/<component>/README.md ← component documentation
projects/igniteui-angular/test-utils/ ← shared test helpers
projects/igniteui-angular/migrations/ ← migration schematics
CHANGELOG.md ← root changelog
src/app/<component>/ ← demo pages
projects/igniteui-angular/core/src/core/styles/ ← component SCSS themes
```

---

## Workflow

### Step 1 — Investigate and Root-Cause

1. Read the bug report carefully.
2. Identify reproduction steps and expected vs. actual behavior.
3. Check for related issues or PRs that provide additional context.
4. Search the repo to find relevant components, services, and files.
5. Examine existing tests related to the behavior.
6. Trace the code path that triggers the bug.
7. Identify the root cause **before** routing any work.
8. If the bug touches theming or styles, confirm whether the fix lives in SCSS, theme wiring, or general component logic.

Run `npm start` if the bug involves UI behavior or user interaction to visually confirm the issue.

### Step 2 — Request Missing Context

If the report is missing information needed to reproduce or scope the bug safely, pause and ask for the missing context before routing any work.

Keep the follow-up short and specific.

### Step 3 — Present a Scope Summary

Present a brief scope summary to the user:

- **Bug**: one sentence describing the issue
- **Root cause**: one sentence explaining why it happens
- **Where**: affected components and main files
- **Impact**: breaking change, accessibility, i18n, styles/theming, multi-branch, or docs follow-through if relevant
- **Agents needed**: which specialist agents will be used
- **Test suite**: the smallest likely suite
- **Demo/sample**: ask whether the existing demo/sample structure should be updated if the change is user-visible

Keep it short and high-level. Confirm scope, not solution details.

Before routing any work, ask:

**`Do you want me to proceed with this implementation flow?`**

If the fix is user-visible, also ask:

**`Do you want a demo/sample update for this feature?`**

Wait for the user's answer before routing work.

### Step 4 — Route Work

Delegate work only through isolated subagent execution when available. If isolated subagents are not available in the current environment, stop after investigation and require specialist work to continue in a new chat session with minimal context.

For each subagent call, send a **Bug Knowledge** block containing:
- **Bug report**: summary of expected vs. actual behavior
- **Root cause**: identified root cause
- **Affected files**: source file paths relevant to the fix
- **Failing test**: path and description (once the test agent has written it)
- **Impact notes**: flags (breaking change, i18n, accessibility, styles/theming, changelog, README, multi-branch)
- **Test suite**: the smallest relevant test command

Use agents in this order:

1. **`tdd-test-writer-agent`** — writes a failing test that reproduces the bug
2. **`bug-fixing-implementer-agent`** — implements the minimum fix only when the fix needs TypeScript, template, or general production-code changes
3. **`theming-styles-agent`** — only when the fix needs SCSS, theme wiring, or style-test changes
4. **`demo-sample-agent`** — only if the user explicitly wants a demo/sample update
5. **`component-readme-agent`** — only if public API or documented behavior changed
6. **`migration-agent`** — only if the fix introduces a breaking change
7. **`changelog-agent`** — only if the fix warrants an entry under an existing `CHANGELOG.md` section; otherwise leave `CHANGELOG.md` unchanged

Only invoke `demo-sample-agent` if the user explicitly requested a demo/sample update.
If the user declined, skip that handoff and continue with the remaining agents.

If the bug is purely in theming or styling, route directly from `tdd-test-writer-agent` to `theming-styles-agent` and skip the general implementer.

### Step 5 — Verify Completeness

After all agents finish, check:

- Does the newly added failing test now pass?
- Were all affected areas covered?
- Were public exports preserved or updated?
- Were theming and style changes delegated when SCSS or theme wiring was affected?
- Was the component README updated if needed?
- Was `CHANGELOG.md` updated?
- Do migrations exist for any breaking changes?
- If a demo/sample was requested, was the existing demo structure updated appropriately?
- If a demo/sample was not requested, was it correctly skipped?
- Is multi-branch cherry-picking needed?
- Run `npm run lint:lib` and verify it passes.

Report what was done and any remaining items.

---

## Edge Cases and Escalation

| Scenario | Action |
| --- | --- |
| Cannot reproduce | Set `status: cannot-reproduce`. Comment with environment and steps tried. Ask the reporter for clarification. Do not route to subagents. |
| By design / not a bug | Set `status: by-design` or `status: not a bug`. Comment referencing the relevant API documentation. Do not route to subagents. |
| Third-party issue | Set `status: third-party-issue`. Document the external cause in the issue. Do not route to subagents. |
| Fix requires breaking change | Route to `migration-agent` after the fix is implemented. Ensure the changelog entry includes `BREAKING CHANGE`. |
| Unrelated test failures | Note them in the PR description. Do not attempt to fix unrelated failures. |

---

## Multi-branch Fixes

Only create PRs for **supported versions**. Before acting, read [SECURITY.md](../../SECURITY.md) to get the current list of supported versions. Do **not** create PRs for any version marked as unsupported there.

When a bug exists in multiple supported release branches:
1. Read `SECURITY.md` and collect all versions currently marked as supported.
2. Determine which of those supported branches are actually affected — a bug introduced in a later version does not need a fix in earlier branches.
3. Target the fix at the **oldest affected supported branch** first.
4. Cherry-pick the commit to each newer supported branch up to and including `master`.
5. Create separate PRs for each cherry-pick.
6. Note all target branches in the original PR description.

---

## Reproduction Sample *(strongly recommended)*

After the fix is verified, create a minimal reproduction that demonstrates the bug before the fix and confirms correct behavior after.

Do not commit the reproduction to the fix branch. Instead:
1. Create a branch: `copilot/repro-<issue-number>-<short-description>` from the fix branch.
2. Reference it in the PR description under a "Reproduction Sample" heading.

Skip only if the bug is purely internal logic with no UI or interaction component. If skipping, explain why in the PR description.

---

## Commit

Branch: `copilot/fix-<issue-number>-<short-description>`
Use the conventional commit format: `fix(<component>): <short description> (#<issue>)`

- `<component>` is the affected component/directive (e.g., `grid`, `combo`, `date-picker`). Use `*` if the scope spans multiple components.
- Keep the subject concise, lowercase, and in imperative mood. Minimum 15 characters.
- Line length limit: 80 characters.

Example: `fix(grid): prevent crash on hidden column resize (#1234)`
For breaking changes, include `BREAKING CHANGE:` in the commit body.

PR must follow the [PR template](../../.github/PULL_REQUEST_TEMPLATE.md) checklist and include:
- `Closes #<issue-number>` in the description
- Summary of the bug and root cause analysis
- Explanation of the fix
- Any added or modified tests
- Risk of regression on related features
- Whether cherry-picking to other branches is needed
- Always delegate the specialist steps to the subagents listed in your configuration. Never do a step yourself.
- When subagents are not available in the current environment, stop after the scope summary and tell the user which specialist agent to run next, with the delegation block from the skill.
Loading
Loading