madskills — tools for madskilling
CLI tool for validating and managing Agent Skills repositories.
Features
- Spec validation: Validates skills against the AgentSkills specification
- Markdown linting: Validates markdown style and formatting (powered by rumdl)
- Smart skill discovery: Automatically detects skills using environment variables, AGENTS.md, or well-known directories
- Frontmatter normalization: Formats YAML frontmatter consistently
- Markdown formatting: Auto-fixes markdown style issues
- Multiple output formats: Human-readable text or machine-readable JSON
- CI-friendly: Clear exit codes and strict mode for CI pipelines
Installation
Homebrew (macOS and Linux)
Pre-built Binaries
Download the latest release for your platform from the releases page.
From Source
Or build from source:
Commands
madskills lint - Validate skills
Validates skills against the AgentSkills specification and runs markdown linting.
# Lint all skills in current directory
# Lint specific directory
# Strict mode (warnings become errors)
# JSON output for CI
# Only spec validation (skip markdown linting)
# Only markdown linting (skip spec validation)
Exit codes:
0: No issues found2: Errors found (or warnings in--strictmode)3: Internal failure
madskills list - List discovered skills
Show all skills found in the repository.
# Simple list (name + path)
# Include all metadata
# JSON output
madskills init - Scaffold a new skill
Create a new skill directory with template files. Auto-detects the appropriate location (see Skill Discovery below).
# Create skill (auto-detects location)
# Custom description
# Override auto-detection with explicit location
madskills fmt - Format skill files
Formats both YAML frontmatter and markdown content.
# Format all skills (frontmatter + markdown)
# Check mode (don't write, exit 2 if changes needed)
# Only frontmatter normalization (skip markdown)
# Only markdown formatting (skip frontmatter)
# Custom markdown linting config
Global Options
-C, --chdir <DIR> Run as if started in DIR
-q, --quiet Only print errors
-v, --verbose More detail (repeatable: -vv)
--color <WHEN> Colorize output: auto|always|never
Skill Discovery
madskills automatically detects where skills are located using a priority-based algorithm:
AGENT_SKILLS_DIRenvironment variable - If set and exists, uses this directory- AGENTS.md file - Searches for
/skillspattern in AGENTS.md (e.g.,.claude/skills/,~/agent-skills/) - Well-known directories (first found):
.github/skills/.claude/skills/.codex/skills/
- Fallback logic:
- If
.github/exists →.github/skills/ - Otherwise →
./skills/
- If
Override detection:
# Set environment variable for all commands
# Use --dir flag for init command
Note: Home directory (~) expansion is supported in AGENTS.md and AGENT_SKILLS_DIR.
AgentSkills Specification Checks
The lint command validates:
Required Fields
- name: 1-64 chars, lowercase alphanumeric + hyphens only
- No consecutive hyphens (
--) - Cannot start or end with hyphen
- Must match parent directory name
- No consecutive hyphens (
- description: 1-1024 chars, describes what the skill does
Optional Fields
- license: License name or file reference
- compatibility: Max 500 chars, environment requirements
- allowed-tools: Space-delimited list of pre-approved tools
- metadata: Arbitrary key-value pairs
Cross-Skill Validation
- Skill names must be unique across the detected skills directory
Examples
CI Integration
# .github/workflows/skills.yml
name: Validate Skills
on:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo install madskills
- run: madskills lint --strict --format json
Pre-commit Hook
#!/bin/bash
# .git/hooks/pre-commit
Find Skills with Missing Metadata
|
Development
Building
# Check compilation
# Run tests
# Run all checks (fmt, clippy, test, doc-test)
# Coverage report
Project Structure
madskills/
├── crates/
│ ├── madskills/ # CLI binary
│ └── madskills-core/ # Core library (discovery, parsing, validation, markdown, best practices)
├── PLAN.md # Implementation specification
└── README.md
Contributing
Contributions welcome! Please see AGENTS.md for development conventions.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.