commit 5b393847ba597ffa6e7770e141fcded6078d88cf Author: Zhongwei Li Date: Sun Nov 30 08:41:11 2025 +0800 Initial commit diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..97c4a5a --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,14 @@ +{ + "name": "justfile", + "description": "Utilities for working with justfiles, including doc comment optimization", + "version": "0.18.0", + "author": { + "name": "Craig Motlin" + }, + "skills": [ + "./skills/justfile-style/SKILL.md" + ], + "commands": [ + "./commands/justfile-recipe-short-doc.md" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..ec4d04a --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# justfile + +Utilities for working with justfiles, including doc comment optimization diff --git a/commands/justfile-recipe-short-doc.md b/commands/justfile-recipe-short-doc.md new file mode 100644 index 0000000..8e53f69 --- /dev/null +++ b/commands/justfile-recipe-short-doc.md @@ -0,0 +1,25 @@ +--- +description: Shorten justfile recipe doc comments for simple recipes +--- + +For very short justfile recipes, change the doc comment string to be the entire command. Before: + +```justfile +# Install dependencies +[group('setup')] +install: + npm install +``` + +After: + +```justfile +# npm install +[group('setup')] +install: + npm install +``` + +- The cutoff for when to perform this refactoring should be approximately a single line of 120 characters. +- If the recipe is a shebang recipe, don't shorten the doc comment +- If the recipe is mutiple lines, or longer than 120 characters, don't shorten the doc comment diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..0636ec7 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,49 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:motlin/claude-code-plugins:plugins/justfile", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "1a5fb7c6217eee77a05b40e7782246bf084e347c", + "treeHash": "11d1c9572886fdef18b741a556874c367a47866f8da1cebc1f67113e33c79653", + "generatedAt": "2025-11-28T10:27:10.523239Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "justfile", + "description": "Utilities for working with justfiles, including doc comment optimization", + "version": "0.18.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "94ccd4fb56c7bcb3cf0509ff8d8a930e38e94b122248928acbea2470b497bc12" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "b5192ca98743b13395493334f0c3a853816da44021f138c93574bee9ee1d2de1" + }, + { + "path": "commands/justfile-recipe-short-doc.md", + "sha256": "60639b386232ad3abdc0962aa19fd5dfb3f7be694f48dff99bb69c9f2b008762" + }, + { + "path": "skills/justfile-style/SKILL.md", + "sha256": "bb7ba91879fd8b0dc1584f114aab8b1dc9cffb537e7073e66a5af388032e6f46" + } + ], + "dirSha256": "11d1c9572886fdef18b741a556874c367a47866f8da1cebc1f67113e33c79653" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/skills/justfile-style/SKILL.md b/skills/justfile-style/SKILL.md new file mode 100644 index 0000000..e13a983 --- /dev/null +++ b/skills/justfile-style/SKILL.md @@ -0,0 +1,84 @@ +--- +name: justfile-style +description: Style guidelines for justfile recipe documentation. Use when writing or editing justfiles to ensure consistent and concise documentation. +--- + +# Justfile Style Guidelines + +This skill provides best practices for writing justfile recipe documentation comments. + +## Doc Comment Simplification + +For very short justfile recipes, change the doc comment string to be the entire command instead of a descriptive phrase. + +### When to Simplify + +- The cutoff for when to perform this refactoring should be approximately a single line of 120 characters +- If the recipe is a shebang recipe, don't shorten the doc comment +- If the recipe is multiple lines, or longer than 120 characters, don't shorten the doc comment + +### Example Transformation + +❌ Before: + +```justfile +# Install dependencies +[group('setup')] +install: + npm install +``` + +✅ After: + +```justfile +# npm install +[group('setup')] +install: + npm install +``` + +### Rationale + +For simple, single-command recipes, the command itself is often more informative than a descriptive phrase. This approach: + +1. **Reduces redundancy**: "Install dependencies" vs "npm install" convey the same information +2. **Shows the actual command**: Users can see exactly what will run +3. **Maintains consistency**: All simple recipes follow the same pattern +4. **Improves scannability**: The actual command is immediately visible + +### When NOT to Simplify + +Keep descriptive doc comments for: + +1. **Multi-line recipes**: + +```justfile +# Set up development environment +[group('setup')] +dev-setup: + npm install + cp .env.example .env + just db-migrate +``` + +2. **Shebang recipes**: + +```justfile +# Generate API documentation +[group('docs')] +gen-docs: + #!/usr/bin/env bash + set -euo pipefail + # ... multiple lines of bash script +``` + +3. **Long single-line commands** (>120 characters): + +```justfile +# Build production bundle with optimizations +[group('build')] +build-prod: + webpack --mode production --config webpack.prod.js --optimization-minimize --output-path dist/ +``` + +In these cases, a descriptive comment provides more value than repeating the complex command.