---
name: sensei
description: "Iteratively improve skill frontmatter to achieve good routing test coverage. WHEN: run sensei, sensei help, improve skill routing"
license: MIT
metadata:
  author: Microsoft
  version: "1.0.6"
title: sensei
canonical_url: https://skilld.dev/gh/microsoft/github-copilot-for-azure/sensei
last_updated: 2026-09-29T12:26:00.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/CONVENTIONS.md](https://skilld.dev/api/skills-raw/microsoft/github-copilot-for-azure/sensei/references/CONVENTIONS.md).
>
> If the user asked to install this Skill, run `npx skilld install microsoft/github-copilot-for-azure/sensei`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/sensei`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/microsoft/github-copilot-for-azure/sensei) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/sensei`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/sensei --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/sensei --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

## Help

When user says "sensei help" or asks how to use sensei, show this:

```
╔══════════════════════════════════════════════════════════════════╗
║  SENSEI - Skill Frontmatter Compliance Improver                  ║
╠══════════════════════════════════════════════════════════════════╣
║                                                                  ║
║  USAGE:                                                          ║
║    Run sensei on <skill-name>              # Single skill        ║
║    Run sensei on <skill1>, <skill2>, ...   # Multiple skills     ║
║    Run sensei on all skills                # All skills          ║
║                                                                  ║
║  EXAMPLES:                                                       ║
║    Run sensei on appinsights-instrumentation                     ║
║    Run sensei on azure-ai, azure-compute                         ║
║                                                                  ║
║  WHAT IT DOES:                                                   ║
║    1. READ      - Load skill's SKILL.md and tests                ║
║    2. VERIFY    - Compare skill frontmatter with convention      ║
║    3. SCAFFOLD  - Create tests from frontmatter if missing       ║
║    4. IMPROVE   - Add WHEN: triggers                             ║
║    5. TEST      - Run tests, fix if needed                       ║
║    6. SUMMARY   - Show before/after with suggestions             ║
║    7. PROMPT    - Ask: Commit, Create Issue, or Skip?            ║
║    8. REPEAT    - Until routing tests pass                       ║
╚══════════════════════════════════════════════════════════════════╝
```

## Main Loop

For each skill, execute this loop until the frontmatter aligns with convention, have thorough routing tests AND routing tests pass:

1. **READ** - Load `plugins/{plugin}/skills/{skill-name}/SKILL.md`, and vally eval suites in `evals/{skill-name}/*.yaml`.
2. **VERIFY** - Compare the skill frontmatter with conventions in [CONVENTIONS](https://skilld.dev/api/skills-raw/microsoft/github-copilot-for-azure/sensei/references/CONVENTIONS.md). If the skill's frontmatter violates any written convention, notify the user and propose a fix to align the frontmatter with the convention.
3. **SCAFFOLD** - If `evals/{skill-name}/` doesn't exist, follow instructions in `vally-eval` skill to scaffold a set of routing tests. The routing tests test if the skill can be invoked for target user prompts. Generate user prompts that match the target scenario of the skill's description.
4. **IMPROVE** - If the skill description doesn't already have WHEN: triggers, add them.
5. **TEST** - Follow instructions in `vally-eval` skill to run the routing tests. If there are failed tests, suggest fixes.
6. **SUMMARY** - Display before/after comparison with unimplemented suggestions.
7. **PROMPT** - Ask user to commit the fixes or take any alternative actions.
8. **REPEAT** - Go to step 2 (max 5 iterations per skill)

## Constraints

- Only modify `plugins/{plugin}/skills/` - these are the Azure skills used by Copilot
- Files in `.github/skills/` should be left as is
- Max 5 iterations per skill before moving on

## Related Skills

- [vally-eval](https://skilld.dev/.github/skills/vally-eval) - vally eval suite writing guidelines
