vscode-fabric
AGENTS.md44 starsChanged 13 months agoMITView on GitHub
Audience: Contributors modifying the core extension (extension) and shared packages (api, util). Emphasis: safe core evolution, API contract stewardship, and maximal reuse of @microsoft/vscode-fabric-util. Treat as public surface. Before changing an interface: Always check util/src before introducing new helpers: Commands (root orchestrates sequencing):
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.MD into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Treat as public surface. Before changing an interface:
- Distinctive: line 18
If adding: prefer additive optional properties / new interfaces.
- Very specific: line 23
Always check util/src before introducing new helpers:
- Distinctive: line 30
If a new helper would aid both core & satellites, add it to util (not core) and keep API free of implementation types.
- Very specific: line 47
Avoid coupling: core files must not import satellite implementation classes (internal satellites live under internalSatellites/ and are …
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AI Assistant Instructions (Core Fabric Extension)
Audience: Contributors modifying the core extension (extension) and shared packages (api, util). Emphasis: safe core evolution, API contract stewardship, and maximal reuse of @microsoft/vscode-fabric-util.
1. Core Architecture (Mental Model)
- Layers: API (contracts only) → Util (cross‑cut helpers) → Core (VS Code behaviors & DI wiring). Satellites consume API+Util; they must not depend on core internals.
- Core surfaces a single public export:
IFabricExtensionManager(service access + extension registration). Keep this minimal; resist feature creep (see RFC_002 for telemetry rationale). - Service collection triad:
accountManager(auth context),workspaceManager(workspace + item listing/cache),artifactManager(CRUD + definition materialization + workflow orchestration). - Artifact workflows: Core delegates to an
IArtifactHandlerif present; otherwiseDefaultArtifactHandler. Handlers implement optional granular workflow objects (avoid adding new broad “legacy” hooks).
2. When Editing API Contracts (api)
Treat as public surface. Before changing an interface:
- Can the behavior be achieved via a new optional workflow hook instead of modifying an existing signature?
- Will satellites break? (Search for symbol usage in repo; assume unknown external usage.)
- If adding: prefer additive optional properties / new interfaces. If removing/renaming: require version note + deprecation path.
- Mirror definition mutations: if guidance changes (e.g., new required field) document in
doc/extensibility-overview.mdand update samples.
3. Util Package Usage (Prefer Reuse)
Always check util/src before introducing new helpers:
- Telemetry:
TelemetryService, activity helpers. Don’t embed telemetry plumbing in core managers. - Errors:
FabricError,withErrorHandling,doFabricActionfor consistent UX & telemetry classification. - Logging: Provided logger utilities (avoid ad‑hoc
console.log). - URI & content:
FabricUriHandler, zip utilities,MemoryFileSystem. - Config & environment:
ConfigurationProvider,FabricEnvironmentProvider. - If a new helper would aid both core & satellites, add it to util (not core) and keep API free of implementation types.
4. Build / Test Workflow
Commands (root orchestrates sequencing):
- Build all:
npm run compile| Production bundle:npm run package| VSIX:npm run vsix -w extension. - Watch (code + tests): run task
Watch All(spawns per‑package watch + test watchers). - Tests:
npm run test(aggregate). Core‑specific depth:test:unit,test:integration,test:e2e,uitest(needsVSCODE_FABRIC_ENABLE_TEST_FAKES=true). - Localization export after string changes:
npm run localization -w extension. - Clean:
npm run clean --ws; hard reset:npm run clean-node-modules && npm install.
5. Coding Conventions (Core)
- Dependency Injection: use
@wessberg/di; keep constructors slim; avoid static singletons. - Minimize surface of
IFabricExtensionManager—do not add telemetry/logging convenience; rely on util patterns. - Workflow Hook Rule: mutate
definition→ also updateoptions.body.definitionto keep REST payload consistent. - Avoid coupling: core files must not import satellite implementation classes (internal satellites live under
internalSatellites/and are treated as examples/plugin modules). - Localization: only add
%extension.*%keys; run export before committing if new keys. Do not add any translations, these are handled externally.
6. Common Pitfalls
- Forgetting to update
options.body.definitionafter mutating a definition → results in stale upload. - Adding broad “onBeforeRequest” style hooks—prefer targeted workflow hook additions.
- Introducing util‑like helpers inside core (harder for satellites to reuse). Move them to util early.
- Expanding API contracts with implementation types (breaks layering & increases downstream churn).
7. Versioning & Change Management
- Preview semver (
0.x) still requires discipline: avoid breaking field/interface removals without deprecation comment + CHANGELOG note.
8. Quick Reference Commands
npm run compile | npm run test:unit -w extension | npm run test:integration -w extension | npm run uitest -w extension | npm run vsix -w extension
9. Satellite Context (Minimal Need-to-Know)
Satellites plug in via addExtension() supplying handlers/providers. Core changes must preserve backward behavior for absent satellites (graceful fallback to defaults). Avoid requiring satellites to change unless enabling a new optional capability.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

