Skip to content

Commit dcf60e9

Browse files
authored
Merge pull request #27 from microsoft/agents-md-guidance
Add AGENTS guidance for AI coding agents
2 parents e5ca11c + f6f511c commit dcf60e9

3 files changed

Lines changed: 70 additions & 2 deletions

File tree

.github/copilot-instructions.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

AGENTS.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# AGENTS.md
2+
3+
This repo packages the **Microsoft Events** assistant plugin and the `@microsoft/events-cli` CLI. The plugin helps agents use live Microsoft Build and Ignite session catalogs; the CLI fetches, caches, normalizes, and searches those catalogs.
4+
5+
## Plugin ecosystems
6+
7+
The repo publishes plugin metadata for GitHub Copilot and Claude Code. Keep shared product identity fields aligned across the manifests when changing the plugin name, description, version, author, repository, keywords, license, skills path, or MCP wiring.
8+
9+
**Shared assets** used by the plugin ecosystems:
10+
- `skills\microsoft-build\SKILL.md` — the active skill prompt
11+
- `.mcp.json` — Microsoft Learn MCP endpoint config
12+
- `cli\` — source for the `@microsoft/events-cli` package used by the skill
13+
14+
**GitHub Copilot**`.github\plugin\plugin.json` is the Copilot marketplace manifest and points at the repo root.
15+
16+
**Claude Code**`.claude-plugin\plugin.json` defines the Claude Code plugin package; `.claude-plugin\marketplace.json` defines Claude Code marketplace publishing metadata.
17+
18+
## Sync rules
19+
20+
- Event support is duplicated by design between the CLI and skill docs. When adding, removing, or renaming events, update `cli\src\config.ts`, the supported/default event guidance in `skills\microsoft-build\SKILL.md`, and affected tests/docs together.
21+
- Treat `skills\microsoft-build\SKILL.md` as the product contract for event-session behavior. For Build, Ignite, or event-session work: default "Build" to `build-2026`, get session metadata from the live catalog through `msevents` or the endpoint, get SDK/API facts from Microsoft Learn MCP, and never invent session IDs, speakers, schedules, or links.
22+
- Keep README install/client guidance aligned with plugin manifest, skill, MCP, or CLI behavior changes.
23+
24+
## CLI
25+
26+
Source is in `cli\src\`, built output is `cli\dist\`, and the published binary is `msevents`. Targets Node.js 22+. TypeScript source is ESM/NodeNext: local imports between TS modules use `.js` extensions.
27+
28+
Run from `cli\`:
29+
30+
```powershell
31+
npm ci
32+
npm run build
33+
npm test
34+
npx vitest run test\search.test.ts
35+
npx vitest run test\search.test.ts -t "finds sessions by title keyword"
36+
npm run smoke:fixture
37+
```
38+
39+
`npm run smoke:live` hits the live catalog; CI only runs it outside pull requests.
40+
41+
## CLI behavior contracts
42+
43+
- Catalog data has inconsistent shapes: fields may be strings, `{ displayValue }` objects, arrays, or empty values. Normalize through the helpers in `cli\src\data\normalize.ts`; records without `sessionCode` are intentionally skipped.
44+
- Cache behavior is part of the CLI contract. `ensureCache` loads cached sessions, revalidates when due, fetches missing event caches, and only falls back to stale cache when the stale data is scoped to the request. Tests use `MSEVENTS_CACHE_DIR` to isolate cache state.
45+
- Search behavior is intentionally specialized: the `msevents sessions` command requires `--query`, `--tech`, or `--speaker`; code-like queries exact-match session codes and variants; technology search spans product/tags/topic/solution area/languages/title/description; speaker search post-filters on the queried last name.
46+
47+
## General principles
48+
49+
- Make the smallest synchronized set of edits that keeps plugin manifests, skills, CLI behavior, and user-facing docs coherent.
50+
- Prefer fixing drift between ecosystems immediately over documenting known inconsistency.

cli/src/index.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env node
22

3+
import { readFileSync } from 'node:fs';
34
import { Command } from 'commander';
45
import { refresh } from './commands/refresh.js';
56
import { sessions } from './commands/sessions.js';
@@ -10,12 +11,30 @@ import { KNOWN_EVENTS } from './config.js';
1011

1112
const knownIds = KNOWN_EVENTS.map((e) => e.id).join(', ');
1213

14+
function readPackageVersion(): string {
15+
const packageJson: unknown = JSON.parse(
16+
readFileSync(new URL('../package.json', import.meta.url), 'utf-8'),
17+
);
18+
19+
if (
20+
typeof packageJson !== 'object'
21+
|| packageJson === null
22+
|| !('version' in packageJson)
23+
|| typeof packageJson.version !== 'string'
24+
|| packageJson.version.length === 0
25+
) {
26+
throw new Error('Expected package.json to define a string version');
27+
}
28+
29+
return packageJson.version;
30+
}
31+
1332
const program = new Command();
1433

1534
program
1635
.name('msevents')
1736
.description('Search Microsoft flagship event sessions (Build, Ignite)')
18-
.version('0.1.0')
37+
.version(readPackageVersion())
1938
.addHelpText('after', `
2039
Run "msevents status" to see available events and cache freshness.
2140
Use --json on any command for structured output (recommended for scripts and agents).`);

0 commit comments

Comments
 (0)