Files
mvanderbend-msoft ebd22496dd Add acreadiness-cockpit plugin (AgentRC measure -> generate -> maintain) 🤖🤖🤖 (#1593)
* Add acreadiness-cockpit plugin

Adds a new plugin that drives Microsoft AgentRC from Copilot chat,
framing every interaction inside AgentRC's Measure -> Generate ->
Maintain loop.

Custom agent (agents/ai-readiness-reporter.agent.md):
  Runs `agentrc readiness --json`, interprets every result against
  the 9-pillar / 5-level maturity model, then renders a self-contained
  reports/index.html from a fixed HTML/CSS template (bundled with the
  acreadiness-assess skill) so every user gets an identically styled
  dashboard. Honours policies (disabled criteria, overrides, pass-rate
  thresholds) and surfaces extras separately.

Skills:
  - acreadiness-assess: Measure step. Wraps `agentrc readiness --json`
    and hands off to the @ai-readiness-reporter agent. Bundles the
    canonical report-template.html.
  - acreadiness-generate-instructions: Generate step. Wraps
    `agentrc instructions`. Defaults to .github/copilot-instructions.md
    (Copilot-native). Asks flat vs nested. For monorepos, emits per-area
    .github/instructions/<area>.instructions.md files with applyTo
    globs taken from agentrc.config.json.
  - acreadiness-policy: Maintain step. Helps pick, scaffold, or apply an
    AgentRC policy (criteria.disable, criteria.override, extras,
    thresholds) and wire it into CI via --fail-level.

Plugin (plugins/acreadiness-cockpit/):
  Declarative plugin.json referencing the agent and three skills.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR review feedback

- Align documented slash-command names with plugin manifest:
  /acreadiness-assess, /acreadiness-generate-instructions,
  /acreadiness-policy (was /assess, /generate-instructions, /policy
  inside SKILL bodies and argument-hints).
- Move the literal % from the report template into the substituted
  values for {{passRate}} and {{threshold}} so an N/A value of '—'
  no longer renders as '—%'. Updated the agent placeholder contract
  accordingly.
- Point the report footer at the canonical plugin folder under
  github/awesome-copilot instead of the personal source fork.
- Add explicit HTML-escaping rules to the agent: HTML-escape every
  {{placeholder}} substitution, and replace </script with <\/script
  inside the embedded JSON block so untrusted repo content cannot
  break the markup or inject scripts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-04 14:11:14 +10:00

97 lines
3.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: acreadiness-policy
description: 'Help the user pick, write, or apply an AgentRC policy. Policies customise readiness scoring by disabling irrelevant checks, overriding impact/level, setting pass-rate thresholds, or chaining org baselines with team overrides. Use when the user asks about strict mode, AI-only scoring, custom weights, CI gating, or wants org-wide standardisation.'
argument-hint: "[show | new <name> | apply <path-or-pkg>] — e.g. /acreadiness-policy show, /acreadiness-policy new strict-frontend"
---
# /acreadiness-policy — AgentRC policies
Use this skill when the user asks about **policies**, **strict mode**, **custom scoring**, **disabling checks**, **org standards**, or **CI gating** of readiness.
A policy is a small JSON file with three optional sections — `criteria`, `extras`, `thresholds` — that customise how AgentRC scores readiness.
## Built-in examples
AgentRC ships with three example policies in `examples/policies/`:
| Policy | What it does |
|---|---|
| `strict.json` | 100% pass rate, raises impact on key criteria |
| `ai-only.json` | Disables all repo-health checks, focuses on AI tooling |
| `repo-health-only.json` | Disables AI checks, focuses on traditional quality |
Recommend these as starting points before writing a custom policy.
## Policy schema
```jsonc
{
"name": "my-policy",
"criteria": {
"disable": ["env-example", "observability", "dependabot"],
"override": {
"readme": { "impact": "high", "level": 2 },
"lint-config": { "title": "Linter required" }
}
},
"extras": {
"disable": ["pre-commit"]
},
"thresholds": {
"passRate": 0.9
}
}
```
### Impact weights
| Impact | Weight |
|---|---|
| critical | 5 |
| high | 4 |
| medium | 3 |
| low | 2 |
| info | 0 |
`Score = 1 (deductions / max possible weight)`. Grades: **A** ≥ 0.9, **B** ≥ 0.8, **C** ≥ 0.7, **D** ≥ 0.6, **F** < 0.6.
## Sub-commands
### `show`
List policies currently in effect (from `agentrc.config.json` `policies` array, or none).
### `new <name>`
Scaffold `policies/<name>.json` with sensible defaults. Walk the user through:
1. **What to disable** — irrelevant pillars or extras for their stack (e.g. disable `observability` for a static site).
2. **What to raise** — override `impact` to `high` or `critical` for must-haves (e.g. `readme`, `codeowners`).
3. **Pass-rate threshold** — typical org baselines: `0.7` (lenient), `0.85` (standard), `1.0` (strict).
4. Reference the policy from `agentrc.config.json`:
```json
{ "policies": ["./policies/<name>.json"] }
```
### `apply <path-or-pkg>`
Run `agentrc readiness --json --policy <source>` and re-render the report by handing off to the `assess` skill / `ai-readiness-reporter` agent. Supports chaining:
```bash
npx -y github:microsoft/agentrc readiness --json --policy ./org-baseline.json,./team-frontend.json
```
## CI gating
Combine policies with `--fail-level` to enforce a minimum maturity level in CI:
```yaml
- run: npx -y github:microsoft/agentrc readiness --policy ./policies/strict.json --fail-level 3
```
## Advanced
JSON policies can disable, override, and set thresholds — but **cannot add new criteria**. For new detection logic, point users at AgentRC's TypeScript plugin system (`docs/dev/plugins.md`).
## Operating rules
- **Never silently disable a pillar.** If the user wants to disable `observability`, confirm and explain the trade-off.
- **Prefer overriding `impact` over disabling.** Disabling hides the gap entirely; overriding lets it still appear in the report.
- **Recommend extras stay enabled.** They cost nothing — they don't affect the score.
- **Suggest layering** — most orgs want a baseline policy + per-team overrides chained with `--policy a.json,b.json`.