Skip to content

feat: add harness engineering improvements#35929

Open
tudorpopams wants to merge 18 commits intomicrosoft:masterfrom
tudorpopams:feat/copilot-agents
Open

feat: add harness engineering improvements#35929
tudorpopams wants to merge 18 commits intomicrosoft:masterfrom
tudorpopams:feat/copilot-agents

Conversation

@tudorpopams
Copy link
Copy Markdown
Contributor

@tudorpopams tudorpopams commented Mar 30, 2026

Summary

Implement harness engineering best practices for AI agent instructions in the Fluent UI repo.

  • Restructure agent instructions following progressive disclosure: AGENTS.md as a concise map, detailed docs in docs/
  • Add CLAUDE.md symlinked to AGENTS.md for cross-tool compatibility
  • Add agent skills for common development tasks under .agents/skills/ with thin .claude/skills/ wrappers
  • Improve ESLint rule error messages with doc URLs and fix instructions so AI agents can self-correct on failure
  • Fix all npx references to yarn across docs, skills, and copilot instructions to match the repo's package manager

What's included

Harness Engineering (docs/ restructure)

  • AGENTS.md slimmed to ~60 lines as a pointer-only map
  • .github/instructions/copilot.instructions.md reduced from 473 to ~50 lines
  • Detailed guidance moved to:
  • docs/architecture/component-patterns.md — v9 hooks, slots, Griffel
  • docs/architecture/design-tokens.md — token categories and usage
  • docs/architecture/layers.md — package dependency tiers
  • docs/workflows/contributing.md — PR checklist and commands
  • docs/workflows/testing.md — test types and SSR safety
  • docs/team-routing.md — teams, labels, CODEOWNERS
  • docs/quality-grades.md — per-package quality tracking
  • docs/tech-debt-tracker.md — known debt items for agents

Agent Skills (.agents/skills/ + .claude/skills/)

Skills live in .agents/skills/ (tool-agnostic source of truth). Claude Code wrappers in .claude/skills/ reference them via @ relative path — no
symlinks, Windows-compatible.

Skill Command Purpose
v9-component /v9-component Name Scaffold a new v9 component with all required files
change /change Create beachball change file from current diff
lint-check /lint-check [pkg] Run lint, parse errors, and auto-fix common issues
token-lookup /token-lookup val Find the design token for a hardcoded CSS value
package-info /package-info pkg Quick package lookup: path, deps, owner, tests
visual-test /visual-test Name Visually verify a component via Storybook + playwright-cli
review-pr /review-pr #123 Review a PR with confidence scoring and category checks

ESLint Error Message Improvements

Updated 5 existing rules (ban-context-export, ban-instanceof-html-element, no-global-react, no-restricted-imports, no-context-default-value) to
include fix instructions and docs/ references in error messages.

npx → yarn

All command references in docs, skills, and copilot instructions updated from npx to yarn to match the repo's package manager.

Test plan

  • Verify ESLint rules produce updated error messages with doc URLs
  • Verify CLAUDE.md symlink resolves correctly to AGENTS.md
  • Verify skills are available via / menu in Claude Code
  • Test /package-info react-button returns correct package details
  • Test /token-lookup #0078d4 suggests the right design token
  • Test /visual-test Button launches Storybook and captures a screenshot
  • Test /review-pr produces structured output with confidence score
  • Review docs for accuracy against current v9 patterns

@github-actions github-actions bot added the CI label Mar 30, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 30, 2026

📊 Bundle size report

✅ No changes found

@github-actions
Copy link
Copy Markdown

Pull request demo site: URL

@tudorpopams tudorpopams marked this pull request as ready for review April 7, 2026 15:21
@tudorpopams tudorpopams requested review from a team as code owners April 7, 2026 15:21
@tudorpopams tudorpopams force-pushed the feat/copilot-agents branch from b4ca5af to eefc38b Compare April 7, 2026 15:22
@tudorpopams tudorpopams changed the title feat: add Copilot agentic workflows and harness engineering improvements feat: add harness engineering improvements Apr 8, 2026
@tudorpopams tudorpopams force-pushed the feat/copilot-agents branch from eefc38b to 09fa5eb Compare April 8, 2026 14:04
tudorpopams and others added 14 commits April 9, 2026 14:25
…, docs, and skills improvement

Adds five custom Copilot agent profiles (.github/agents/*.agent.md) for:
- triage: classify, label, and route incoming issues
- fix: implement bug fixes and open PRs
- devils-advocate: critically review PRs with confidence scoring
- docs-groomer: audit documentation for staleness and gaps
- skills-improver: analyze agent performance and improve instructions

Also adds global copilot-instructions.md and issue templates for periodic
docs audits and skills reviews.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… skills

Adds five agentic workflows (.md + compiled .lock.yml):
- agent-triage: classifies, labels, and validates incoming issues
- agent-fix: implements bug fixes and opens PRs (triggered by agent:fix label)
- agent-review: devil's advocate review with confidence scoring for agent PRs
- agent-docs-grooming: weekly documentation audit
- agent-skills-improvement: weekly analysis of agent PRs to improve instructions

Also includes gh-aw init scaffolding (agentic-workflows agent, .gitattributes).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These are superseded by the agentic workflows (agent-*.md + .lock.yml).
Keeps copilot-instructions.md as global context for all Copilot agents.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merges global agent context (from .github/copilot-instructions.md) into
AGENTS.md alongside the existing Nx guidelines. CLAUDE.md is a symlink
to AGENTS.md so both Claude Code and Copilot read the same instructions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Applies progressive disclosure, mechanical enforcement, and feedback loop
patterns from OpenAI's harness engineering approach.

1. Progressive disclosure: Slim down copilot.instructions.md (473→50 lines)
   and AGENTS.md into pointer-only maps. Detailed docs moved to docs/:
   - docs/architecture/component-patterns.md (v9 hooks, slots, Griffel)
   - docs/architecture/design-tokens.md (token categories and usage)
   - docs/architecture/layers.md (package dependency tiers)
   - docs/workflows/contributing.md (PR checklist, commands)
   - docs/workflows/testing.md (test types, SSR safety)
   - docs/team-routing.md (teams, labels, CODEOWNERS)

2. Agent-guiding error messages: Updated all custom ESLint rules to include
   doc URLs and fix instructions in error messages so agents self-correct.

3. New ESLint rule: @fluentui/no-hardcoded-style-values — flags hardcoded
   colors and spacing in .styles.ts files, requiring design tokens.

4. Structural validation: check-v9-structure.js validates that component
   packages follow the canonical file structure.

5. Layer boundary validation: check-layer-boundaries.js validates that
   component packages (Tier 3) don't depend on other component packages.

6. Quality tracking: docs/quality-grades.md and docs/tech-debt-tracker.md
   for agents and engineers to track package quality and debt.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Removes no-hardcoded-style-values ESLint rule, check-layer-boundaries.js,
and check-v9-structure.js as requested.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Applies findings from "Increasing AI coding success to 99%" article:
- Add "instructions are source of truth, not existing code" as first line
- Add critical rules as negative constraints ("Never X") in always-loaded context
- Add concrete v9 component code template to override training defaults
- Add legacy anti-patterns section warning about v8 code agents will find
- Add exploration guidance for the large monorepo
- Reframe positive guidance as negative constraints for higher compliance

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove all GitHub Agentic Workflow files (.github/workflows/agent-*,
.github/agents/, .github/aw/) and clean up related references in
AGENTS.md, docs, .prettierignore, and .gitattributes. This PR now
focuses solely on harness engineering improvements.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add 5 slash command skills under .claude/skills/:
- /v9-component — scaffold a new v9 component with all required files
- /change — create beachball change files from current diff
- /lint-check — run lint, parse errors, and auto-fix common issues
- /token-lookup — map hardcoded CSS values to design tokens
- /package-info — quick package lookup (path, deps, owner, tests)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tudorpopams and others added 4 commits April 9, 2026 14:25
Add 6 skills under .agents/skills/ with thin .claude/skills/ wrappers:
- /v9-component — scaffold a new v9 component
- /change — create beachball change files
- /lint-check — run lint and auto-fix common issues
- /token-lookup — map hardcoded CSS values to design tokens
- /package-info — quick package lookup
- /visual-test — visually verify components via Storybook + playwright-cli

Replace all npx references with yarn across docs, skills, and
copilot instructions to match the repo's package manager.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add /review-pr skill that reviews PRs across 8 categories:
change file, V9 patterns, dependency layers, SSR safety,
testing, API surface, accessibility, and security/quality.

Produces a structured report with a 0-100 confidence score
and APPROVE/REQUEST_CHANGES/COMMENT recommendation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- v9-component: use react-component and react-library generators
  instead of manually creating files, add generators reference table
- change: use `yarn change` (repo's beachball script) and
  `yarn check:change` for verification
- package-info: add useful commands section with Nx executors

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tudorpopams tudorpopams force-pushed the feat/copilot-agents branch from 9f19a68 to 79776c7 Compare April 9, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant