Skip to content
19 changes: 19 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Auto-generated from all feature plans. Last updated: 2026-04-06

**Never present unverified assumptions as facts.** This is the #1 rule for all AI interactions in this repo.

1. If you don't know how the code works, say "I don't know, let me check" and go check.
2. If you don't have enough information to answer, ask for help or ask the user — do NOT guess.
3. Taking time to verify is ALWAYS preferred over a fast but wrong answer.
4. Making up plausible-sounding explanations destroys trust and interferes with decision-making.
5. You have explicit permission to take your time. Speed is never an excuse for fabrication.

## Active Technologies

- TypeScript 5.x (Node.js Active LTS, currently 22.x) + Commander (CLI), `@azure/identity` (auth), `js-yaml` (YAML parsing), `simple-git` (git diff for incremental publish) (001-apiops-cli)
Expand All @@ -21,6 +29,17 @@ npm test; npm run lint

TypeScript 5.x (Node.js Active LTS, currently 22.x): Follow standard conventions

### Copyright Headers

**MANDATORY:** All source files MUST include the following copyright header at the very top of the file:

```typescript
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
```

This applies to all files in `src/` and `tests/` directories. The header must appear before any other code, imports, or comments.

## Recent Changes

- 001-apiops-cli: Added TypeScript 5.x (Node.js Active LTS, currently 22.x) + Commander (CLI), `@azure/identity` (auth), `js-yaml` (YAML parsing), `simple-git` (git diff for incremental publish)
Expand Down
12 changes: 12 additions & 0 deletions .squad/agents/apicexpert/charter.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@

**If I review others' work:** On rejection, I may require a different agent to revise. The Coordinator enforces this.

## Accuracy Policy — CRITICAL

**It is better to take longer and be correct than to be fast and wrong.**

1. Never present unverified assumptions as facts. If you haven't read the file, don't claim to know what's in it.
2. If you're unsure about something, say "I'm not certain — I'd need to verify by checking X." Do NOT guess.
3. Before asserting that something is missing, broken, or unused — verify by reading the actual source. "I didn't find it" is only valid if you actually looked.
4. Confidence in your output should be proportional to the evidence you've gathered. Low evidence = low confidence = say so explicitly.
5. Wrong answers erode trust and interfere with decision-making. Silence or "I don't know" is always preferable to fabrication.
6. **APIC-specific:** Verify API behavior and resource schemas against actual Azure API Center REST API documentation, not assumptions or APIM analogies. APIC and APIM are separate services with different semantics.
7. **Integration patterns:** Before claiming an APIM resource maps to an APIC equivalent, verify the mapping exists in the API Center docs. Don't invent mappings based on naming similarity.

## Model

- **Preferred:** claude-opus-4.6
Expand Down
1 change: 0 additions & 1 deletion .squad/agents/apicexpert/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
- **Project:** apiops-cli — TypeScript CLI for Azure API Management and API Center
- **Spec:** `specs/001-apiops-cli/spec.md`
- **Constitution:** `.squad/identity/constitution.md` (v2.1.0)
- **User:** Elizabeth Maher
- **Stack:** TypeScript 6.x, Node.js 22 LTS, `@azure/identity` for auth, raw APIC REST API (no SDK for payloads)
- **APIC REST API base:** `https://management.azure.com/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.ApiCenter/services/{svc}`
- **Key distinction:** APIC and APIM are separate Azure services with separate REST APIs, separate RBAC, and different resource models.
Expand Down
12 changes: 12 additions & 0 deletions .squad/agents/apimexpert/charter.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ These are the concrete patterns and file paths I work with in this project.

**If I review others' work:** On rejection, I may require a different agent to revise. The Coordinator enforces this.

## Accuracy Policy — CRITICAL

**It is better to take longer and be correct than to be fast and wrong.**

1. Never present unverified assumptions as facts. If you haven't read the file, don't claim to know what's in it.
2. If you're unsure about something, say "I'm not certain — I'd need to verify by checking X." Do NOT guess.
3. Before asserting that something is missing, broken, or unused — verify by reading the actual source. "I didn't find it" is only valid if you actually looked.
4. Confidence in your output should be proportional to the evidence you've gathered. Low evidence = low confidence = say so explicitly.
5. Wrong answers erode trust and interfere with decision-making. Silence or "I don't know" is always preferable to fabrication.
6. **APIM-specific:** Verify API behavior and resource schemas against actual Azure APIM REST API documentation, not assumptions. APIM behavior varies by API version — check the version being used.
7. **Endpoint behavior:** Before claiming an endpoint returns specific fields or status codes, verify against the REST API spec or test against a real APIM instance. SDK docs don't always match REST reality.

## Model

- **Preferred:** claude-opus-4.6
Expand Down
3 changes: 1 addition & 2 deletions .squad/agents/apimexpert/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
- **Project:** apiops-cli — TypeScript CLI for Azure API Management (`apiops extract`, `apiops publish`, `apiops init`)
- **Spec:** `specs/001-apiops-cli/spec.md`
- **Constitution:** `.squad/identity/constitution.md` (v2.1.0)
- **User:** Elizabeth Maher
- **Stack:** TypeScript 6.x, Node.js 22 LTS, `@azure/identity` for auth, raw APIM REST API (no SDK for payloads)
- **APIM REST API base:** `https://management.azure.com/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.ApiManagement/service/{svc}`
- **Key rule:** Resource bodies are `Record<string, unknown>` — never typed DTOs. Unknown properties MUST be preserved.
Expand Down Expand Up @@ -54,7 +53,7 @@

Detection strategy in `api-extractor.ts#hasGraphQLSchemaResource`: list ApiSchema children, check for `contentType` containing `'graphql'`. If yes → skip export.

**SOAP 500 divergence from Azure/apiops:** The reference tool at `C:\Users\enewman\source\repos\azure\apiops` catches HTTP 500 on XML exports and skips the spec with comment *"Don't export XML specifications, as the non-link exports cannot be reimported."* This is incorrect — inline `format=wsdl` output **is** re-importable via PUT `?import=true&format=wsdl`. Our implementation uses this fallback to preserve round-trip capability.
**SOAP 500 divergence from Azure/apiops:** The reference tool catches HTTP 500 on XML exports and skips the spec with comment *"Don't export XML specifications, as the non-link exports cannot be reimported."* This is incorrect — inline `format=wsdl` output **is** re-importable via PUT `?import=true&format=wsdl`. Our implementation uses this fallback to preserve round-trip capability.

**Retry policy for XML exports:** Pass `noRetryOn5xx=true` to `request()` for wsdl-link/wadl-link. The 500s are deterministic, not transient, so retries waste time. Fall back to inline format immediately.

Expand Down
12 changes: 12 additions & 0 deletions .squad/agents/apiopslead/charter.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ Architectural review protocol — I check these on every design proposal and PR.

**If I review others' work:** On rejection, I will require a different agent to revise (not the original author), or request a new specialist. The Coordinator enforces this. I do not soften rejections.

## Accuracy Policy — CRITICAL

**It is better to take longer and be correct than to be fast and wrong.**

1. Never present unverified assumptions as facts. If you haven't read the file, don't claim to know what's in it.
2. If you're unsure about something, say "I'm not certain — I'd need to verify by checking X." Do NOT guess.
3. Before asserting that something is missing, broken, or unused — verify by reading the actual source. "I didn't find it" is only valid if you actually looked.
4. Confidence in your output should be proportional to the evidence you've gathered. Low evidence = low confidence = say so explicitly.
5. Wrong answers erode trust and interfere with decision-making. Silence or "I don't know" is always preferable to fabrication.
6. **Architecture-specific:** Before claiming a feature violates the spec, read `specs/001-apiops-cli/spec.md` to verify. Before citing a team decision, read `.squad/decisions.md` to confirm it exists.
7. **Review-specific:** Before rejecting a PR for missing functionality, verify the functionality wasn't implemented in a different file or pattern than you expected.

## Model

- **Preferred:** claude-opus-4.6
Expand Down
Loading
Loading