Skip to content

Conversation

@altryne
Copy link

@altryne altryne commented Jan 14, 2026

Summary

image image

Implements support for Agent Skills - reusable prompt templates and scripts that extend AI capabilities for specific tasks. This follows the open Agent Skills specification.

Features

  • Skill Discovery: Automatically discovers skills from ~/.chorus/skills/, ~/.claude/skills/, and project-level .chorus/skills/ or .claude/skills/ directories
  • SKILL.md Parser: Parses skill files with YAML frontmatter for metadata (name, description, etc.)
  • Skills Settings UI: New Settings > Skills tab to view, enable/disable, and configure skills
  • System Prompt Injection: Auto-invocation skills are injected into the AI's system prompt so it knows what skills are available
  • Slash Command Autocomplete: Type / in chat to see and select available skills
  • Skill Tools: skills_use, skills_run_script, and skills_list_scripts tools for AI to invoke skills and execute scripts
  • Active Skills Indicator: Shows which skills are currently active in a chat
  • Persistent State: Skill enabled/disabled state and invocation mode persisted with debounced writes

Architecture

src/core/chorus/skills/
├── SkillTypes.ts        # Type definitions
├── SkillParser.ts       # SKILL.md frontmatter parser
├── SkillDiscovery.ts    # Multi-location skill discovery
├── SkillManager.ts      # Singleton state manager
└── SkillExecution.ts    # Skill invocation and script execution

src/core/chorus/toolsets/
└── skills.ts            # Skills toolset (skills_use, etc.)

src/ui/components/
├── SkillsSettings.tsx   # Settings tab
├── SkillCard.tsx        # Individual skill card
├── SkillAutocomplete.tsx # Slash command dropdown
└── ActiveSkillsIndicator.tsx # Active skills badges

Documentation

See docs/SKILLS.md for user-facing documentation.

Test plan

  • Skill Discovery

    • Create a skill in ~/.claude/skills/test-skill/SKILL.md with valid frontmatter
    • Open Settings > Skills - skill should appear
    • Click refresh - should re-discover skills
  • Enable/Disable Skills

    • Toggle a skill off in Settings > Skills
    • Start a new chat - skill should not appear in AI's available skills
    • Toggle back on - skill should reappear
  • Auto Invocation Mode

    • Set a skill to "Auto" mode
    • Start a new chat and ask something relevant to that skill
    • AI should mention/use the skill automatically
  • Manual Invocation Mode

    • Set a skill to "Manual" mode
    • Start a new chat - AI should NOT automatically use this skill
    • Type /skill-name and press Enter
    • Skill should be loaded into the conversation
  • Slash Command Autocomplete

    • In chat input, type /
    • Autocomplete dropdown should appear with enabled skills
    • Use arrow keys to navigate, Enter to select
    • Press Escape to dismiss
  • Skills Toolset

    • Enable the Skills toolset
    • Ask AI "What skills do you have?"
    • AI should be able to use skills_use to load a skill
  • Script Execution (requires Terminal toolset)

    • Create a skill with a scripts/ folder containing a script
    • Ask AI to run the script
    • AI should use skills_run_script and then terminal to execute

🤖 Generated with Claude Code

claude and others added 19 commits January 14, 2026 19:27
This commit establishes the Ralph Wiggum spec-driven development framework
and comprehensive specifications for the Agent Skills feature.

Ralph Wiggum Setup:
- .specify/memory/constitution.md - Project principles and configuration
- templates/spec-template.md - Feature specification template
- templates/checklist-template.md - Implementation checklist template
- scripts/ralph-loop.sh - Spec implementation runner
- AGENTS.md - AI agent guidelines

Agent Skills Specifications (11 specs):
- 000: Implementation order and phasing
- 001: Skill types and interfaces
- 002: Skill parser for SKILL.md files
- 003: Skill discovery system
- 004: Central skill manager
- 005: Skill execution engine
- 006: React hooks and TanStack Query API
- 007: Skills settings UI
- 008: Skill invocation UI (/skill-name commands)
- 009: Active skill context indicator
- 010: Database state persistence
- 011: Sample skills for demonstration

The Agent Skills feature follows the open specification at agentskills.io
and is compatible with skills from Cursor, Claude Code, OpenCode, and
other adopters of the standard.
- Created spec 012 for skill script execution
  - Scripts discovered from skills' scripts/ directories
  - Auto-detect interpreter from file extension (.py, .sh, .js)
  - Leverages existing terminal toolset (mcp-desktopcommander)
  - Configurable allowed interpreters whitelist
  - Permission controls for script execution

- Updated spec 001 with ISkillScript interface
  - Added script type definitions
  - Added allowedInterpreters to ISkillSettings
  - Added INTERPRETER_MAP constant

- Updated implementation order (000)
  - Added spec 012 to Phase 2 (Execution)
  - Updated success criteria to include script execution
Verifies all type definitions from spec 001:
- ISkillMetadata with required and optional fields
- ISkillScript for executable scripts
- ISkillLocation type
- ISkill full skill object
- ISkillState with invocation modes
- ISkillSettings with all configuration options
- INTERPRETER_MAP constant
- DEFAULT_SKILL_SETTINGS constant

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements spec 002 - Skill Parser:
- Parses YAML frontmatter from SKILL.md files
- Validates required fields (name, description)
- Validates name format (lowercase alphanumeric + hyphens, 1-64 chars)
- Validates description length (max 1024 chars)
- Handles optional fields (license, compatibility, metadata, allowed-tools)
- Returns structured ParseResult with clear error messages

Adds js-yaml dependency for YAML parsing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements spec 003 - Skill Discovery System:
- Discovers skills in project directories (.chorus/skills/, .claude/skills/)
- Discovers skills in user directories (~/.chorus/skills/, ~/.claude/skills/)
- Parses SKILL.md files using SkillParser
- Project skills override user skills with same name
- Discovers scripts in skill scripts/ directories
- Discovers reference files in skill folders
- Provides caching with refresh mechanism
- Handles errors gracefully without blocking

Uses Tauri file system APIs for cross-platform compatibility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements spec 004 - Skill Manager:
- Singleton pattern with getInstance()
- Initializes skill discovery on startup
- Tracks enabled/disabled state per skill
- Tracks invocation mode (auto/manual) per skill
- Persists states to Tauri store
- Provides methods: getAllSkills, getEnabledSkills, getAutoSkills, getManualSkills
- Provides getSkill(id), getSkillState(id)
- Provides enableSkill, disableSkill, toggleSkill, setInvocationMode
- Records skill usage timestamps
- Emits 'skills-changed' event on state changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Initialize skill discovery on app startup
- Verified end-to-end: skills in ~/.chorus/skills/ are discovered
- Cleaned up verbose debug logging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add ISkillStorageData with version field for future migrations
- Add useCount tracking with getSkillUseCount() method
- Implement debounced save (500ms) using lodash/debounce
- Add migration from legacy skillStates format to versioned skillData
- Add flushPersist() for immediate saves (e.g., before app close)
- Update tests with 29 passing tests including migration and debounce

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create SkillExecution.ts with core execution logic
  - generateSkillsSystemPrompt() for AI context
  - executeSkill() to load skill instructions
  - handleSkillCommand() for /skill-name invocation
- Create ToolsetSkills class with skills_use tool
- Register skills toolset in ToolsetsManager
- Add SKILLS_SYSTEM_PROMPT to prompts.ts
- Add skills option to injectSystemPrompts()
- 22 tests passing for skill execution

The AI can now see available skills and invoke them to load
detailed instructions for specific tasks.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add prepareScriptExecution() to validate and prepare scripts
- Add getSkillScripts() to list available scripts
- Add skills_run_script tool for preparing script commands
- Add skills_list_scripts tool for listing skill scripts
- Validate interpreter against allowed list (python3, bash, node)
- Escape arguments to prevent command injection
- 35 tests passing for skill execution (13 new tests)

Scripts can be executed via the terminal toolset using the
prepared command and working directory.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create SkillsAPI.ts with query hooks and mutations
- useSkills() - get all discovered skills
- useEnabledSkills() - get only enabled skills
- useAutoSkills() / useManualSkills() - filter by mode
- useSkillState(id) - get state for specific skill
- useEnableSkill() / useDisableSkill() / useToggleSkill()
- useSetSkillInvocationMode() - set auto/manual mode
- useRefreshSkills() - re-discover from disk
- useInitializeSkills() - initialize if needed
- Fix TypeScript error in prepareScriptExecution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create SkillCard component for displaying individual skills with
  enable/disable toggle and invocation mode selector
- Create SkillsSettings component with skill list, empty state,
  and refresh button
- Add Skills tab to Settings panel with Sparkles icon
- Support for project, user, and global skill location badges

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create SkillAutocomplete component with dropdown for skill selection
- Integrate skill autocomplete into ChatInput for both main and quick chat
- Show autocomplete when user types "/" at start of input
- Support keyboard navigation (arrow keys, Enter, Escape, Tab)
- Show skill name, description, and location in suggestions
- Execute skill on selection with toast confirmation
- Filter skills as user types after "/"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create ActiveSkillsStore (zustand) to track active skills per chat
- Create ActiveSkillsIndicator component showing active skill badges
- Add skill to active store when manually invoked via autocomplete
- Show badges with dismiss button and details popover
- Different styling for auto vs manual invocation types
- Integrate indicator into both main chat and quick chat inputs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create chorus-chat skill: Guidelines for multi-model chat usage
- Create code-review skill: Systematic code review checklist
- Create documentation skill: Technical writing best practices

Each skill follows the Agent Skills specification with proper
YAML frontmatter and useful instructions for immediate value.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Make Toolset._status protected so subclasses can set it
- Set skills toolset status to "running" in ensureStart
- Auto-start skills toolset without requiring DB config
- Inject auto-invocation skills into system prompt
- Fix infinite loop in ActiveSkillsStore with stable empty array reference

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Clean up development artifacts:
- Remove .specify/ directory with implementation specs
- Remove templates/ directory
- Remove sample skills from .chorus/skills/

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Explain what skills are and how they work
- Document skill locations and discovery order
- Show how to create a SKILL.md file
- Cover settings, invocation modes, and slash commands
- Include placeholders for screenshots
- Link to agentskills.io specification

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove scripts/ralph-loop.sh
- Remove AGENTS.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@altryne
Copy link
Author

altryne commented Jan 14, 2026

@claude review this please 👀 Check for inconsistencies with upstream, check for possible implementation bugs, check for missing docs etc

@altryne
Copy link
Author

altryne commented Jan 22, 2026

@bcongdon any interest in adding skills support? What would take for this PR to land in Chorus?

- Add .agent/skills to user and project discovery paths
- Follow symlinks when listing skill directories

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants