-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add context-drift skill for detecting documentation drift #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,243 @@ | ||||||||||||||||||
| # Context Drift Reference | ||||||||||||||||||
|
|
||||||||||||||||||
| Detailed patterns, heuristics, and thresholds for drift detection. | ||||||||||||||||||
|
|
||||||||||||||||||
| --- | ||||||||||||||||||
|
|
||||||||||||||||||
| ## Context File Types | ||||||||||||||||||
|
|
||||||||||||||||||
| ### Skills (`.claude/skills/*/SKILL.md`) | ||||||||||||||||||
|
|
||||||||||||||||||
| **Frontmatter fields**: | ||||||||||||||||||
| ```yaml | ||||||||||||||||||
| --- | ||||||||||||||||||
| name: skill-name # Required | ||||||||||||||||||
| description: ... # Required | ||||||||||||||||||
| user-invocable: true # Optional, defaults to true | ||||||||||||||||||
| --- | ||||||||||||||||||
| ``` | ||||||||||||||||||
|
|
||||||||||||||||||
| **Common references to check**: | ||||||||||||||||||
| - File paths in code blocks | ||||||||||||||||||
| - Bash commands with `!` prefix | ||||||||||||||||||
| - Tool names (Read, Write, Bash, Grep, etc.) | ||||||||||||||||||
| - Referenced `REFERENCE.md`, `WORKFLOWS.md` files | ||||||||||||||||||
|
|
||||||||||||||||||
| ### Commands (`.claude/commands/*.md`) | ||||||||||||||||||
|
|
||||||||||||||||||
| **Frontmatter fields**: | ||||||||||||||||||
| ```yaml | ||||||||||||||||||
| --- | ||||||||||||||||||
| description: ... # Optional | ||||||||||||||||||
| argument-hint: <args> # Optional | ||||||||||||||||||
| --- | ||||||||||||||||||
| ``` | ||||||||||||||||||
|
|
||||||||||||||||||
| **Common references to check**: | ||||||||||||||||||
| - Variable substitutions (`${VAR}`, `$1`, `$ARGUMENTS`) | ||||||||||||||||||
| - Bash scripts in code blocks | ||||||||||||||||||
| - File path patterns | ||||||||||||||||||
| - CLI tool invocations (`npm`, `git`, `gh`, etc.) | ||||||||||||||||||
|
|
||||||||||||||||||
| ### Agents (`.claude/agents/*.md`) | ||||||||||||||||||
|
|
||||||||||||||||||
| **Frontmatter fields**: | ||||||||||||||||||
| ```yaml | ||||||||||||||||||
| --- | ||||||||||||||||||
| name: agent-name # Required | ||||||||||||||||||
| description: ... # Required | ||||||||||||||||||
| tools: Tool1, Tool2 # Required (comma-separated) | ||||||||||||||||||
| model: sonnet|opus|haiku # Optional | ||||||||||||||||||
| permissionMode: ... # Optional | ||||||||||||||||||
| --- | ||||||||||||||||||
| ``` | ||||||||||||||||||
|
|
||||||||||||||||||
| **Common references to check**: | ||||||||||||||||||
| - Tool list validity | ||||||||||||||||||
| - Model name validity | ||||||||||||||||||
| - Permission mode validity | ||||||||||||||||||
|
|
||||||||||||||||||
| --- | ||||||||||||||||||
|
|
||||||||||||||||||
| ## Reference Extraction Patterns | ||||||||||||||||||
|
|
||||||||||||||||||
| ### File Paths | ||||||||||||||||||
|
|
||||||||||||||||||
| Extract paths from these patterns: | ||||||||||||||||||
|
|
||||||||||||||||||
| | Pattern | Example | Regex | | ||||||||||||||||||
| |---------|---------|-------| | ||||||||||||||||||
| | Code block paths | `` `src/utils.ts` `` | `` `([^`]+\.(ts|js|py|go|rs|md))` `` | | ||||||||||||||||||
| | At-mentions | `@src/utils.ts` | `@([\w/./-]+\.\w+)` | | ||||||||||||||||||
| | Quoted paths | `"src/utils.ts"` | `"([\w/./-]+\.\w+)"` | | ||||||||||||||||||
| | In bash commands | `cat src/file.ts` | `(cat\|head\|tail\|read) ([\w/./-]+)` | | ||||||||||||||||||
|
Comment on lines
+71
to
+73
|
||||||||||||||||||
| | At-mentions | `@src/utils.ts` | `@([\w/./-]+\.\w+)` | | |
| | Quoted paths | `"src/utils.ts"` | `"([\w/./-]+\.\w+)"` | | |
| | In bash commands | `cat src/file.ts` | `(cat\|head\|tail\|read) ([\w/./-]+)` | | |
| | At-mentions | `@src/utils.ts` | `@([\w/._-]+\.\w+)` | | |
| | Quoted paths | `"src/utils.ts"` | `"([\w/._-]+\.\w+)"` | | |
| | In bash commands | `cat src/file.ts` | `(cat\|head\|tail\|read) ([\w/._-]+)` | |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern uses escaped pipe characters (cat\|head\|tail\|read) which would match literal text like "cat|head" rather than "cat OR head OR tail OR read". In regex, pipes should not be escaped when used for alternation. The pattern should be (cat|head|tail|read) ([\w/._-]+) instead.
| | In bash commands | `cat src/file.ts` | `(cat\|head\|tail\|read) ([\w/./-]+)` | | |
| | In bash commands | `cat src/file.ts` | `(cat|head|tail|read) ([\w/._-]+)` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern for "At-mentions" has an issue with the character class. The pattern
@([\w/./-]+\.\w+)contains/./-which is problematic because the dash-should either be escaped or placed at the beginning or end of the character class. Currently, it could be interpreted as a range from/to/which is not valid. Consider changing to@([\w/._-]+\.\w+)to properly match paths with dots, underscores, and hyphens.