Skip to content

Add 'daf skills' command to list and inspect available skills #337

@itdove

Description

@itdove

Problem

Currently, there's no easy way to:

  • Discover which skills are available in the current session
  • See where skills are loaded from (user/workspace/hierarchical/project)
  • Inspect skill details without reading files manually

Users need to manually navigate to ~/.claude/skills/, $DEVAIFLOW_HOME/.claude/skills/, etc. to see what's available.

Solution

Add a new daf skills command with two modes:

Mode 1: List All Skills (default)

daf skills

Output:

Available Skills (sorted by name)

User-level (~/.claude/skills/):
  - daf-active          Show information about the currently active conversation
  - daf-cli             Commands that work inside Claude Code sessions
  - daf-config          View current configuration (read-only)
  - daf-git             Manage GitHub/GitLab issues and sessions
  - daf-help            Show available daf commands and quick reference
  - daf-info            Show detailed information about the current session
  - daf-jira            View JIRA ticket details for current session
  - daf-jira-fields     JIRA field mapping rules and validation
  - daf-list            List all DevAIFlow sessions
  - daf-notes           View all progress notes for the current session
  - daf-status          Show status and progress dashboard
  - daf-workflow        Workflow guidance for development sessions
  - gh-cli              GitHub CLI tool for PRs and API operations
  - git-cli             Git version control commands
  - glab-cli            GitLab CLI tool for MRs and API operations

Hierarchical ($DEVAIFLOW_HOME/.claude/skills/):
  - 01-enterprise       Red Hat Enterprise custom fields and backend configuration
  - 02-organization     Red Hat Organization JIRA templates and acceptance criteria
  - 03-team             Red Hat Team defaults for workstream and components
  - 04-user             Red Hat User personal preferences and workspace configuration

Project-level (<project>/.claude/skills/):
  (none)

Total: 19 skills

Mode 2: Inspect Specific Skill

daf skills <skill-name>

Example:

daf skills daf-cli

Output:

Skill: daf-cli
Location: ~/.claude/skills/daf-cli/
File: ~/.claude/skills/daf-cli/SKILL.md

Frontmatter:
  name: daf-cli
  description: Commands that work inside Claude Code sessions for JIRA integration
  user-invocable: false

Content preview:
----------------------------------------
# DAF CLI - Commands for Claude Code Sessions

**IMPORTANT**: You are currently inside an active Claude Code session. 
This skill documents commands that are ALLOWED to run inside sessions.

## JIRA Commands
...
----------------------------------------

To view full content: cat ~/.claude/skills/daf-cli/SKILL.md

Benefits

  • ✅ Easy skill discovery (no manual file navigation)
  • ✅ See skill loading hierarchy (user > workspace > hierarchical > project)
  • ✅ Quick reference for available skills
  • ✅ Inspect skill details without leaving terminal
  • ✅ Helpful for debugging skill loading issues

Implementation Notes

Skills discovery order (same as devflow/agent/claude_agent.py:_discover_skills_dirs()):

  1. User-level: ~/.claude/skills/ (or $CLAUDE_CONFIG_DIR/skills/)
  2. Workspace-level: <workspace>/.claude/skills/
  3. Hierarchical: $DEVAIFLOW_HOME/.claude/skills/
  4. Project-level: <project>/.claude/skills/

Sorting:

  • Skills should be sorted alphabetically within each level
  • Display levels in discovery order (user → workspace → hierarchical → project)

Skill details:

  • Parse YAML frontmatter (if present)
  • Show first ~20 lines of content as preview
  • Display full file path for easy access

Command Syntax

# List all skills
daf skills

# List with JSON output
daf skills --json

# Inspect specific skill
daf skills <skill-name>

# Inspect with JSON output
daf skills <skill-name> --json

Acceptance Criteria

Core Functionality

  • daf skills lists all available skills sorted by name
  • Skills grouped by level (user/workspace/hierarchical/project)
  • Each skill shows name and description (from frontmatter or first line)
  • Total count displayed at bottom

Skill Details Mode

  • daf skills <name> shows full details for specific skill
  • Displays location, file path, and frontmatter
  • Shows content preview (~20 lines)
  • Includes instruction to view full content

Skills Discovery

  • Uses same discovery logic as _discover_skills_dirs()
  • Detects user-level, workspace-level, hierarchical, and project-level skills
  • Handles CLAUDE_CONFIG_DIR environment variable
  • Works correctly in multi-project sessions

Output Formats

  • --json flag produces machine-readable output
  • JSON includes: name, description, location, level, file_path
  • Text output is well-formatted and easy to read

Error Handling

  • Graceful handling when skill not found
  • Clear error message if skill name is ambiguous (exists in multiple levels)
  • Works when no skills directories exist

Integration

  • Command works inside Claude Code sessions (read-only, safe)
  • Add to daf-help skill quick reference
  • Update daf-cli skill with new command

Files to Modify

  • devflow/cli/commands/skills_command.py - New file for command implementation
  • devflow/cli/main.py - Register new command
  • devflow/cli_skills/daf-cli/SKILL.md - Document new command
  • devflow/cli_skills/daf-help/SKILL.md - Add to quick reference
  • tests/test_skills_command.py - Test coverage

Example JSON Output

{
  "skills": [
    {
      "name": "daf-cli",
      "description": "Commands that work inside Claude Code sessions",
      "level": "user",
      "location": "/Users/username/.claude/skills/daf-cli",
      "file_path": "/Users/username/.claude/skills/daf-cli/SKILL.md",
      "frontmatter": {
        "name": "daf-cli",
        "description": "Commands that work inside Claude Code sessions for JIRA integration",
        "user-invocable": false
      }
    }
  ],
  "total": 19,
  "levels": {
    "user": 15,
    "workspace": 0,
    "hierarchical": 4,
    "project": 0
  }
}

Related

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions