290 lines
12 KiB
Plaintext
290 lines
12 KiB
Plaintext
================================================================================
|
|
CLJ-KONDO SKILL - COMPLETE
|
|
================================================================================
|
|
|
|
Created: 2025-11-10
|
|
Version: 1.0.0
|
|
Language: Clojure
|
|
Library: clj-kondo/clj-kondo 2024.11.14
|
|
|
|
================================================================================
|
|
FILE STRUCTURE
|
|
================================================================================
|
|
|
|
📄 INDEX.md 347 lines Master index and navigation guide
|
|
📄 SKILL.md 906 lines Comprehensive documentation + hooks
|
|
📄 README.md 278 lines Getting started guide
|
|
📄 QUICK_REFERENCE.md 272 lines Quick lookup cheatsheet
|
|
📝 examples.clj 261 lines 8 runnable hook examples (executable)
|
|
📊 metadata.edn 114 lines Structured skill metadata
|
|
📋 SUMMARY.txt This file
|
|
|
|
TOTAL: 2,178 lines of documentation and examples
|
|
|
|
================================================================================
|
|
CONTENT OVERVIEW
|
|
================================================================================
|
|
|
|
SKILL.md - Main Documentation (906 lines)
|
|
├── Introduction and Overview
|
|
├── Installation (Homebrew, manual, Clojure CLI)
|
|
├── Getting Started (basic usage, output formats)
|
|
├── Configuration
|
|
│ ├── File locations and structure
|
|
│ ├── Linter levels (off, info, warning, error)
|
|
│ ├── Global and local configuration
|
|
│ ├── Inline suppressions
|
|
│ └── Configuration merging
|
|
├── Built-in Linters (comprehensive reference)
|
|
│ ├── Namespace and require linters (3+)
|
|
│ ├── Binding and symbol linters (3+)
|
|
│ ├── Function and arity linters (2+)
|
|
│ ├── Collection and syntax linters (3+)
|
|
│ └── Type and spec linters (2+)
|
|
├── Custom Hooks (extensive coverage)
|
|
│ ├── What hooks are and when to use them
|
|
│ ├── Hook architecture
|
|
│ ├── Creating your first hook
|
|
│ ├── Hook types (:analyze-call, :macroexpand)
|
|
│ ├── Hook API reference (complete)
|
|
│ ├── 5 practical hook examples
|
|
│ ├── Testing hooks (manual and unit tests)
|
|
│ ├── Distributing hooks with libraries
|
|
│ └── Hook best practices
|
|
├── IDE Integration (VS Code, Emacs, IntelliJ, Vim)
|
|
├── CI/CD Integration (GitHub Actions, GitLab CI, pre-commit)
|
|
├── Best Practices (adoption, team config, hooks)
|
|
└── Troubleshooting (false positives, performance, debugging)
|
|
|
|
examples.clj - Runnable Hook Examples (261 lines)
|
|
├── Example 1: Deprecation warning hook
|
|
├── Example 2: Argument validation hook
|
|
├── Example 3: DSL expansion (macroexpand) hook
|
|
├── Example 4: Thread-safety check hook
|
|
├── Example 5: Required keys validation hook
|
|
├── Example 6: Arity checking hook
|
|
├── Example 7: Namespace alias enforcement hook
|
|
└── Example 8: Function return type hint hook
|
|
|
|
QUICK_REFERENCE.md - Cheat Sheet (272 lines)
|
|
├── Installation
|
|
├── Basic Usage (lint commands, output formats)
|
|
├── Configuration Quick Reference
|
|
│ ├── Linter levels
|
|
│ ├── Common linter configurations
|
|
│ ├── Output customization
|
|
│ └── Inline suppressions
|
|
├── Built-in Linters Cheat Sheet (13+ linters)
|
|
├── Hook Quick Reference
|
|
│ ├── Hook types
|
|
│ ├── Hook registration patterns
|
|
│ ├── Node API functions
|
|
│ ├── Node constructors
|
|
│ └── Node predicates
|
|
├── Hook Templates (analyze-call, macroexpand)
|
|
├── Common Patterns (5 examples)
|
|
├── Testing Hooks
|
|
├── IDE Setup (4 editors)
|
|
├── CI/CD Setup (GitHub Actions, GitLab)
|
|
└── Troubleshooting Tips
|
|
|
|
README.md - Getting Started (278 lines)
|
|
├── What is clj-kondo?
|
|
├── Installation
|
|
├── Basic Usage
|
|
├── Configuration
|
|
├── Creating Your First Hook (step-by-step)
|
|
├── What This Skill Covers
|
|
├── Key Features Covered
|
|
├── Common Use Cases (4 examples)
|
|
├── Hook Examples Preview (3 snippets)
|
|
├── Learning Path (10 steps)
|
|
├── Why Use This Skill?
|
|
└── Additional Resources
|
|
|
|
INDEX.md - Navigation Guide (347 lines)
|
|
├── Documentation Files Overview
|
|
├── Quick Start Guide
|
|
├── Learning Paths
|
|
│ ├── Beginner Path (basic usage)
|
|
│ ├── Intermediate Path (configuration)
|
|
│ ├── Advanced Path (custom hooks)
|
|
│ └── Expert Path (hook distribution)
|
|
├── Navigation by Topic
|
|
│ ├── Installation and Setup
|
|
│ ├── Basic Usage
|
|
│ ├── Configuration
|
|
│ ├── Built-in Linters
|
|
│ ├── Custom Hooks
|
|
│ ├── Integration
|
|
│ └── Troubleshooting
|
|
├── Navigation by Use Case (8 scenarios)
|
|
├── Hook Development Guide
|
|
├── Complete API Coverage Map
|
|
└── External Resources
|
|
|
|
metadata.edn - Structured Metadata (114 lines)
|
|
├── Skill identification and versioning
|
|
├── Library information
|
|
├── Tags and use cases (8 use cases)
|
|
├── Features list (9 features)
|
|
├── File references
|
|
├── Related skills (eastwood, kibit, splint)
|
|
├── Prerequisites
|
|
├── Learning path (6 steps)
|
|
├── Platform support (Linux, macOS, Windows)
|
|
├── API coverage breakdown
|
|
├── Examples and recipes count
|
|
└── External resources
|
|
|
|
================================================================================
|
|
FEATURE COVERAGE
|
|
================================================================================
|
|
|
|
✅ Installation (3 methods covered)
|
|
✅ Basic Usage (Command-line, output formats)
|
|
✅ Configuration (Global, local, inline)
|
|
✅ Built-in Linters (13+ linters documented)
|
|
✅ Custom Hooks (Comprehensive coverage)
|
|
✅ Hook Types (:analyze-call, :macroexpand)
|
|
✅ Hook API (Complete reference)
|
|
✅ Hook Examples (8 practical examples)
|
|
✅ Testing Hooks (Manual and unit tests)
|
|
✅ IDE Integration (4 major editors)
|
|
✅ CI/CD Integration (GitHub, GitLab, pre-commit)
|
|
✅ Troubleshooting (Common issues and solutions)
|
|
|
|
Coverage: Complete clj-kondo usage + extensive hook development guide
|
|
|
|
================================================================================
|
|
LEARNING RESOURCES
|
|
================================================================================
|
|
|
|
For Beginners (Basic Linting):
|
|
1. Start with README.md (10-15 min read)
|
|
2. Install clj-kondo
|
|
3. Run basic linting on your code
|
|
4. Review QUICK_REFERENCE.md for common linters
|
|
|
|
For Intermediate Users (Configuration):
|
|
1. Read SKILL.md "Configuration" section
|
|
2. Study built-in linters
|
|
3. Customize config.edn for your project
|
|
4. Set up IDE integration
|
|
|
|
For Advanced Users (Custom Hooks):
|
|
1. Read SKILL.md "Custom Hooks" section
|
|
2. Study hook API reference
|
|
3. Run examples.clj to see hooks in action
|
|
4. Write your first hook
|
|
5. Learn hook testing strategies
|
|
|
|
For Hook Experts (Distribution):
|
|
1. Study hook best practices
|
|
2. Learn hook distribution patterns
|
|
3. Implement comprehensive test coverage
|
|
4. Distribute hooks with your library
|
|
|
|
Quick Lookup:
|
|
- QUICK_REFERENCE.md for configuration and API
|
|
- INDEX.md for navigation by topic
|
|
- examples.clj for working hook code
|
|
|
|
================================================================================
|
|
HOOK EXAMPLES INCLUDED
|
|
================================================================================
|
|
|
|
Complete working hook examples for:
|
|
1. Deprecation Warnings (warn about old APIs)
|
|
2. Argument Validation (enforce arg types and counts)
|
|
3. DSL Expansion (macroexpand for better analysis)
|
|
4. Thread-Safety Checks (concurrent usage warnings)
|
|
5. Required Keys Validation (enforce map structure)
|
|
6. Arity Checking (validate function call arities)
|
|
7. Namespace Alias Enforcement (consistent aliases)
|
|
8. Return Type Hints (check function return types)
|
|
|
|
Each example includes:
|
|
- Hook implementation
|
|
- Configuration registration
|
|
- Test cases
|
|
- Usage scenarios
|
|
|
|
================================================================================
|
|
USAGE EXAMPLES
|
|
================================================================================
|
|
|
|
From Command Line:
|
|
$ clj-kondo --lint src # Lint a directory
|
|
$ clj-kondo --lint src test # Lint multiple paths
|
|
$ clj-kondo --lint . --config '{:output {:format :json}}'
|
|
|
|
With Hooks:
|
|
1. Write hook in .clj-kondo/hooks/my_hooks.clj
|
|
2. Register in .clj-kondo/config.edn
|
|
3. Run: clj-kondo --lint src
|
|
|
|
Cache Dependencies:
|
|
$ clj-kondo --lint "$(clojure -Spath)" --dependencies --parallel --copy-configs
|
|
|
|
In CI/CD:
|
|
# GitHub Actions
|
|
- run: clj-kondo --lint src test
|
|
|
|
================================================================================
|
|
SKILL FEATURES
|
|
================================================================================
|
|
|
|
✨ Comprehensive: Complete clj-kondo coverage + hook development
|
|
✨ Practical: 8 runnable hook examples + real-world patterns
|
|
✨ Accessible: Multiple entry points for different skill levels
|
|
✨ Well-organized: Clear structure with navigation aids
|
|
✨ Hook-focused: Extensive custom hook development guide
|
|
✨ Production-ready: Testing, distribution, best practices
|
|
✨ Searchable: Quick reference for fast lookups
|
|
✨ Complete: From basics to advanced hook patterns
|
|
|
|
================================================================================
|
|
SUCCESS METRICS
|
|
================================================================================
|
|
|
|
Documentation: 2,178 lines across 6 files
|
|
Linters covered: 13+ built-in linters
|
|
Hook examples: 8 comprehensive examples
|
|
Hook patterns: 5+ common patterns
|
|
Learning paths: 4 progressive paths
|
|
Quick reference: Complete cheatsheet
|
|
Estimated time:
|
|
- Quick start: 15 minutes
|
|
- Basic usage: 2-3 hours
|
|
- Hook development: 8-12 hours
|
|
|
|
================================================================================
|
|
NEXT STEPS
|
|
================================================================================
|
|
|
|
1. Start with INDEX.md to choose your learning path
|
|
2. Read README.md for quick overview
|
|
3. Install clj-kondo and run on your code
|
|
4. Use SKILL.md as your comprehensive reference
|
|
5. When ready for hooks, read "Custom Hooks" section
|
|
6. Run examples.clj to see hooks in action
|
|
7. Write your first hook!
|
|
8. Keep QUICK_REFERENCE.md handy for fast lookups
|
|
|
|
================================================================================
|
|
EXTERNAL LINKS
|
|
================================================================================
|
|
|
|
Official: https://github.com/clj-kondo/clj-kondo
|
|
Config Docs: https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md
|
|
Hooks Docs: https://github.com/clj-kondo/clj-kondo/blob/master/doc/hooks.md
|
|
Linters Ref: https://github.com/clj-kondo/clj-kondo/blob/master/doc/linters.md
|
|
Examples: https://github.com/clj-kondo/clj-kondo/tree/master/examples
|
|
|
|
================================================================================
|
|
SKILL COMPLETE ✅
|
|
================================================================================
|
|
|
|
This skill is ready to use! Start with INDEX.md for navigation guidance.
|