|
| 1 | +# Skill: Read Docs & Interfaces |
| 2 | + |
| 3 | +Purpose |
| 4 | +- Guide an AI assistant where to look for documentation and TypeScript interfaces in this slickgrid-universal monorepo. |
| 5 | + |
| 6 | +Behavior summary |
| 7 | +- When asked to find information, prefer human-written docs first, then fall back to code (TypeScript interfaces and types) when docs are missing or insufficient. The AI may choose to read interfaces first for highly technical type questions. |
| 8 | + |
| 9 | +Search order (recommended) |
| 10 | +1. Root docs: `docs/` — vanilla JS/TS documentation, how-tos, features, and API overviews. |
| 11 | +2. Package READMEs: `packages/*/README.md` — package-specific usage and examples (including `packages/web-mcp/README.md`). |
| 12 | +3. Framework docs: `frameworks/*/docs/` — framework-specific implementations and integration notes (Angular, React, Vue, Aurelia). |
| 13 | +4. Demos and demo READMEs: `demos/*/` — runnable examples and demo-specific notes (often show how services are registered). |
| 14 | +5. Tests and coverage notes: `test/` and `test/vitest-coverage/` — can provide practical usage and uncovered code paths. |
| 15 | +6. Code (interfaces and types): `packages/**/src/**/*.ts`, `frameworks/**/src/**/*.ts` — read exported `interface`, `type`, class public methods and JSDoc comments. |
| 16 | + |
| 17 | +Useful file patterns and places to check |
| 18 | +- Project root: `README.md`, `CHANGELOG.md`, `docs/**` |
| 19 | +- Core package: `packages/common` — primary interfaces and shared types used across packages. |
| 20 | +- Optional packages (external resources/plugins): `packages/excel-export`, `packages/pdf-export`, `packages/graphql`, `packages/odata`, `packages/web-mcp`, etc. — check each `README.md` and `src/` for exported APIs. |
| 21 | +- Framework wrappers: `frameworks/angular-slickgrid`, `frameworks/slickgrid-react`, `frameworks/slickgrid-vue`, `frameworks/aurelia-slickgrid` — check `docs/` in each framework folder, then `src/` for public adapters. |
| 22 | +- Demos: `demos/vanilla`, `demos/angular`, `demos/react`, `demos/vue`, `demos/aurelia` — example files often show how to instantiate services like `WebMcpService`. |
| 23 | + |
| 24 | +How to choose between docs vs interfaces |
| 25 | +- Use docs first for conceptual questions, feature overviews, and examples. Docs will often mention cross-package considerations and recommended usage. |
| 26 | +- Use interfaces/types first for precise API shapes, parameter and return types, required fields, and method names. |
| 27 | +- If the question is about behavior (how-to, examples, backwards-compatibility), prefer docs. If the question is about typing, method signatures or exact option names, prefer reading the TypeScript sources. |
| 28 | + |
| 29 | +Practical search tips for the AI |
| 30 | +- Look for keywords in docs: "WebMCP", "WebMcpService", "ExternalResource", "applyGridState", "getStructuredSchema". |
| 31 | +- Grep/search patterns to run programmatically: `packages/**/src/**/*.{ts,tsx}`, `frameworks/**/docs/**`, `docs/**`, `packages/*/README.md`, `demos/**/src/**`. |
| 32 | +- When reading TypeScript, focus on exported members (`export interface`, `export class`, `export type`, `export function`). Prefer the package's public entry (`packages/<name>/src/index.ts` or `packages/<name>/README.md`) for the public surface. |
| 33 | + |
| 34 | +Fallback and completeness |
| 35 | +- If docs and package READMEs don't answer the question, traverse `packages/*/src` and `frameworks/*/src` to collect all exported interfaces and classes related to the topic. |
| 36 | +- For compatibility questions, check migration docs under `docs/migrations/` and changelogs at package roots. |
| 37 | + |
| 38 | +Example workflow |
| 39 | +1. Question: "How does WebMCP apply filters?" |
| 40 | +2. Check `docs/ai/ai-toolkit.md` for a conceptual overview and examples. |
| 41 | +3. If specifics needed, open `packages/web-mcp/src/web-mcp.service.ts` and `packages/common/src/*` to inspect `applyGridState` and related interfaces (`FilterService`, `CurrentFilter`). |
| 42 | + |
| 43 | +Notes for implementers |
| 44 | +- Keep this skill up to date when adding new top-level docs or moving package READMEs. The monorepo structure is stable but new packages may be added. |
0 commit comments