 abel533andCopilot
|
1ca1543662
|
feat: implement 13 minor SkillLoader/Skill differences
Skill record expanded from 19 to 27 fields:
1. hasUserSpecifiedDescription — track if description from frontmatter vs auto-extracted
2. loadedFrom — aligned with TS values (commands_DEPRECATED/skills/plugin/managed/bundled/mcp)
3. skillRoot — base directory for CLAUDE_PLUGIN_ROOT env var support
4. disableModelInvocation — separate from disallowedTools, prevents model SkillTool invocation
5. hideFromSlashCommandTool — hide-from-slash-command-tool frontmatter field
6. isSensitive — is-sensitive frontmatter, args redacted from history
7. contentLength — content.length() for token estimation
8. progressMessage — default 'running' for UI progress display
New computed methods:
9. isHidden() — derived from !userInvocable || hideFromSlashCommandTool
10. isMcp() — check source/loadedFrom for MCP origin
11. estimateFrontmatterTokens() — rough token count for context budget
Validation & parsing improvements:
12. Effort validation — only accept low/medium/high/max/positive integer (parseEffortValue)
13. model 'inherit' — treated as null (use parent model, matching TS)
Additional fixes:
- when_to_use key support (TS uses underscore variant)
- buildSkillsSummary filters hidden/model-disabled skills
- SkillTool blocks model invocation when disableModelInvocation=true
- SkillTool uses skillRoot for base directory
- Brace expansion in paths (splitPathInFrontmatter + expandBraces)
- Backward-compatible 19-arg and 6-arg constructors preserved
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
2026-04-09 23:51:18 +08:00 |
|
 abel533andCopilot
|
b7a7d35025
|
feat: implement 4 major SkillLoader gaps (cache/settings/shell/args)
1. Memoization/Caching
- loadAll() now memoized (volatile loaded flag + double-check lock)
- clearCache() invalidates and notifies listeners
- Dynamic skills map for runtime-discovered skills
- Conditional skills pending map with activation tracking
- onSkillsChanged() listener registration (matches TS onDynamicSkillsLoaded)
2. Setting Source Enforcement
- isSettingSourceEnabled() checks env CLAUDE_CODE_DISABLE_{SOURCE}
- isEnvTruthy() for boolean env vars (1/true/yes)
- CLAUDE_CODE_DISABLE_POLICY_SKILLS skips managed skills
- getManagedSkillsPath() for policy-managed skill directory
- Conditional loading per source (user/project/policy)
3. Shell Command Execution (PromptShellExecution)
- Parse \\\! command \\\ code blocks and !\command\ inline syntax
- Execute via bash or powershell per skill frontmatter shell field
- Output replaces command placeholder in skill content
- 30s timeout, proper error handling
- MCP skills excluded from shell execution (security)
4. Argument Substitution (ArgumentSubstitution)
- \ — full raw arguments string
- \[n] — indexed access
- \ — shorthand for indexed (bash-style)
- Named arguments (\, \) mapped from frontmatter
- Shell-quote aware parsing (handles quoted multi-word args)
- Auto-append 'ARGUMENTS: ...' if no placeholder found
- Progressive argument hints for UI
Also:
- Paths frontmatter: brace expansion (src/*.{ts,tsx} → [src/*.ts, src/*.tsx])
- splitPathInFrontmatter with comma-respecting-braces parsing
- activateConditionalSkillsForPaths() with proper activation model
- 17 new unit tests (104 total, 0 failures)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
2026-04-09 23:44:08 +08:00 |
|
 abel533andCopilot
|
c66d58426f
|
feat: align SkillLoader with original claude-code (7 critical fixes)
1. YAML parsing: SnakeYAML instead of naive string splitting
- Handles arrays, nested objects, glob patterns, special chars
- quoteProblematicValues() fallback on parse failure
- extractDescriptionFromMarkdown() fallback for missing description
2. Frontmatter fields: 3 → 19 fields
- Added: display-name, allowed-tools, disallowed-tools, model, effort,
user-invocable, context, agent, shell, paths, argument-hint, arguments, version
- Skill record expanded with convenience methods (isConditional, isForked, userFacingName)
3. Gitignore filtering: git check-ignore integration
- Skills/commands from gitignored directories are skipped
- Prevents loading malicious skills from node_modules etc.
4. Symlink resolution & deduplication
- toRealPath() resolves symlinks to canonical paths
- Set<Path> tracking prevents duplicate loading
- Handles broken symlinks gracefully
5. AgentLoader: new .claude/agents/ directory support
- Supports AGENT.md directory format and single .md files
- Agent-specific frontmatter: tools, disallowed-tools, max-turns, memory,
isolation, background, model, effort
- User-level (~/.claude/agents/) and project-level loading
6. Conditional skills (paths)
- Parse paths frontmatter field (glob patterns)
- getConditionalSkillsForPaths() with glob matching
- getUnconditionalSkills() for always-active skills
7. Enhanced SkillTool execution
- Inline vs fork execution modes
- Argument substitution: \, \, \
- Named argument support from skill definition
- Tool restrictions in prompt (allowed-tools, disallowed-tools)
- Model and effort hints in prompt
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
2026-04-09 23:26:24 +08:00 |
|
 abel533andCopilot
|
6088678c4f
|
feat: Skills execution system (Phase 2B)
- SkillTool: execute skills by name via forked sub-agent
- BundledSkills: 4 built-in skills (verify, debug, review, commit)
- SkillLoader: bundled skills auto-loaded + budget-aware prompt listing
- /skills command: detail view with /skills <name>
- Budget management: 8K char budget, 250 char per-entry cap
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
2026-04-05 09:39:29 +08:00 |
|