feat(knowledge-base): recognize Anthropic Skills layout for claude-code#49
Merged
jonathansantilli merged 1 commit intomainfrom Apr 21, 2026
Merged
feat(knowledge-base): recognize Anthropic Skills layout for claude-code#49jonathansantilli merged 1 commit intomainfrom
jonathansantilli merged 1 commit intomainfrom
Conversation
Adds skill_paths entries for `.claude/skills/*/SKILL.md` at both project and user scope. Anthropic's Skills system (distinct from Claude Code's older custom-commands system) stores each skill as `<name>/SKILL.md` under `.claude/skills/`, and this layout was not previously first-class in the knowledge base — scanners fell through to the generic `skill.md` regex in scan.ts, which tags the file as `codex-cli`. Risk surface chosen to mirror what Anthropic skills actually bundle: - prompt_injection (SKILL.md is natural-language instructions) - unicode_backdoor (steganographic payloads in headings/frontmatter) - command_exec (skills can ship shell scripts or curl|sh instructions) - mcp_config (skills can bundle .mcp.json / .claude/settings.json) Mirrors the shape of the existing `.opencode/skills/**/*.md` entry in opencode.json.
github-actions Bot
pushed a commit
that referenced
this pull request
Apr 21, 2026
# [0.13.0](v0.12.4...v0.13.0) (2026-04-21) ### Features * **knowledge-base:** recognize Anthropic Skills layout for claude-code ([#49](#49)) ([8762adf](8762adf))
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
skill_pathsentries for.claude/skills/*/SKILL.md(project + user scope) to theclaude-codeknowledge base, making Anthropic's Skills system a first-class artifact in CodeGate's discovery.Why
Anthropic's Skills system stores each skill as
<name>/SKILL.mdunder.claude/skills/, distinct from Claude Code's older custom-commands system (.claude/commands/**/*.md, already in the KB).Before this change, when CodeGate walked a project or user-scope tree it did not match Anthropic skill files via the KB — the
SKILL.mdfilename fell through to the generic regex insrc/scan.ts:127, which tags the file ascodex-cli. The file would still get scanned, but the discovery layer didn't recognize it as a claude-code artifact.What changed
Two entries added to
src/knowledge-base/claude-code.json:{ "path": ".claude/skills/*/SKILL.md", "scope": "project", "type": "anthropic_skill", "risk_surface": ["prompt_injection", "unicode_backdoor", "command_exec", "mcp_config"] }, { "path": ".claude/skills/*/SKILL.md", "scope": "user", "type": "anthropic_skill", "risk_surface": ["prompt_injection", "unicode_backdoor", "command_exec", "mcp_config"] }Risk surface tokens chosen to mirror what Anthropic skills actually bundle:
prompt_injection—SKILL.mdis natural-language instructions the agent followsunicode_backdoor— steganographic payloads in headings or frontmattercommand_exec— skills routinely ship shell scripts orcurl | shinstructionsmcp_config— skills can bundle.mcp.jsonor.claude/settings.jsonShape mirrors the existing
.opencode/skills/**/*.mdentry inopencode.json.Test plan
npm install&&npm run build— builds cleanlynpm test— existing KB tests (tests/layer1/knowledge-base.test.ts) still pass (they only assert tool presence, not path structure)codegate-ai scan <dir-containing-.claude/skills/foo/SKILL.md>— finding'saffected_toolsincludesclaude-code, path classification no longer falls back to thecodex-cliregexcodegate-ai scan <workspace> --include-user-scope—~/.claude/skills/*/SKILL.mdentries get picked up as user-scope artifactsNotes
SKILL.mdpattern insrc/scan.ts:127remains tagged ascodex-clifor backwards compatibility with Codex skills that use the same filename at different paths. Multi-tool tagging is a larger refactor and intentionally out of scope.