SKILL.md file to convert large Python and Common Lisp projects to single file scripts in ~/bin
I have a few large projects written in Common Lisp and Python that I wanted to convert to executable single file applications.
I offer my skill file below without additional comments, except that I have tested it with:
- Laguna-XS-2.1-6bit (run locally with oMLX and pool)
- deepseek-v4p1-flash with Deepseek Harness
My SKILL.md file is:
---
name: command-line-prog-creator
description: Creates command line programs in ~/bin for Python and Common Lisp
---
# Skill: Command Line Program Creator
This skill creates executable command-line programs in `~/bin` from files in the current directory.
## Supported Languages
1. **Python** - Creates executable Python scripts using `uv` with inline dependencies
2. **Common Lisp** - Creates executable SBCL scripts
## How It Works
1. Reads all source files from the current working directory
2. **Asks the user for the filename** before creating anything
3. Creates a single new executable file in `~/bin` with the user-provided name
4. The new file combines or uses the content from the current directory files
5. For Common Lisp, the file starts with `#!/usr/bin/env sbcl --script`
6. For Python, the file starts with `#!/usr/bin/env -S uv run --quiet`
7. Makes the created file executable
## Python Scripts
For Python programs, the skill will:
- Look for `.py` files in the current directory
- Ask the user for the desired filename in `~/bin`
- Create an executable script with shebang `#!/usr/bin/env -S uv run --quiet`
- Extract imports and include inline dependencies using `uv pip install` if needed
- Preserve the Python code and add necessary execution permissions
Example output structure:
```python
#!/usr/bin/env -S uv run --quiet
# dependencies: requests, PyYAML
import requests
import yaml
# Your Python code here...
```
## Common Lisp Scripts
For Common Lisp programs, the skill will:
- Look for `.lisp` or `.lsp` files in the current directory
- Ask the user for the desired filename in `~/bin`
- Create an executable script in `~/bin` with the shebang `#!/usr/bin/env sbcl --script`
- Preserve the Lisp code structure
Example output structure:
```lisp
#!/usr/bin/env sbcl --script
;; get-proper-names.lisp
;;;
;;; A tool to extract proper names from text using the gemini API
;;; from Mark Watson's Common Lisp book.
#-quicklisp
(load "~/.sbclrc")
;; Rest of your Lisp code...
```
## Usage
When asked to create a command-line program:
1. The skill examines the current directory for source files
2. **Asks the user for the desired filename** for the new program in `~/bin`
3. Creates the file with the user-specified name
4. For Common Lisp, ensures the script is properly formatted with the SBCL shebang
5. For Python, uses `uv` with inline dependency management
6. Makes the file executable with `chmod +x`
## Example
If the current directory contains `my-script.lisp`:
```
#!/usr/bin/env sbcl --script
;; my-script.lisp
;;; Description of your program
(defun main ()
"Main entry point"
(format t "Hello from command line!~%"))
(main)
```
The skill will ask: "What would you like to name the executable file in `~/bin`?"
After you provide a name (e.g., `my-cmd`), it creates `~/bin/my-cmd` and makes it executable.
Comments
Post a Comment