chore: skill rename to doc#92
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the codebase by renaming the concept of 'skills' to 'docs' (and 'SKILL.md' to 'DOC.md') across all APIs, CLI commands, tests, and build scripts, as well as removing the title_en field from the document schema. Feedback on the changes highlights two issues: a critical bug in applyTokenBudget where direct mutation of doc.content pollutes cached objects, and a potential side effect in buildDocMap caused by sorting the libs array in-place.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
This PR renames the core “skill” concept to “doc” throughout the TypeScript codebase, removes the unused title_en metadata field, and updates build/retrieval tooling and CLI/API surfaces accordingly.
Changes:
- Renamed
Skill/SkillIndex/SkillInfotoDoc/DocIndex/DocInfoand updated JSON index shape fromskills[]todocs[]. - Updated zvec index build + schema naming and retrieval pipeline to operate on docs.
- Updated CLI commands, public API exports, and tests to use the new doc terminology; bumped package version and added
publishConfig.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/scripts/build.ts | Generates doc-based JSON indexes and drops title_en from parsed frontmatter. |
| src/scripts/build-zvec.ts | Builds zvec indexes from docs in the JSON index and renames variables accordingly. |
| src/index.ts | Updates CLI description from skills to docs. |
| src/core/types.ts | Renames core public types to Doc* and removes title_en. |
| src/core/token-budget.ts | Renames token-budget helpers to operate on Doc instead of Skill. |
| src/core/retriever.ts | Updates retrieval pipeline to return Doc[] and uses doc maps/info. |
| src/core/retrieval/zvec-store.ts | Renames scalar-field constants and zvec schema builder to “doc”. |
| src/core/retrieval/embedder.ts | Formatting/wording updates to align terminology (skill → doc) and improves readability. |
| src/core/index-loader.ts | Loads DocIndex and builds Doc maps; renames list/get/info helpers to doc variants. |
| src/commands/retrieve.ts | CLI retrieve now outputs docs and “DOC CONSTRAINTS” blocks. |
| src/commands/list.ts | CLI list now lists docs and groups by library using Doc type. |
| src/commands/info.ts | CLI info command now uses doc terminology. |
| src/commands/get.ts | CLI get command now returns a doc by ID. |
| src/api.ts | Public API now exports doc-based types/functions (getDocById, listDocs, etc.). |
| package.json | Bumps version to 0.1.4-beta.1 and adds npm publishConfig. |
| tests/token-budget.test.ts | Updates token-budget tests to use Doc and removes title_en assumptions. |
| tests/retrieve.test.ts | Updates test naming to “docs”. |
| tests/info.test.ts | Updates test naming to “doc info” terminology. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import { | ||
| loadIndex, | ||
| availableLibraries, | ||
| buildSkillMap, | ||
| getSkillInfo as _getSkillInfo, | ||
| getSkillById as _getSkillById, | ||
| listSkills as _listSkills, | ||
| buildDocMap, | ||
| getDocInfo as _getDocInfo, | ||
| getDocById as _getDocById, | ||
| listDocs as _listDocs | ||
| } from './index-loader'; |
| // --------------------------------------------------------------------------- | ||
| // Exports for backward compatibility — redirect to index-loader | ||
| // --------------------------------------------------------------------------- | ||
|
|
skill重命名为doctitle_en字段