cli-skills
CLI best practices for LlamaFarm. Covers Cobra, Bubbletea, Lipgloss patterns for Go CLI development.
Commit changes, push to GitHub, and open a PR. Includes quality checks (security, patterns, simplification). Use --quick to skip checks.
$ npx -y skills add llama-farm/llamafarm --skill commit-push-pr --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/commit-push-prContext preview
The summary Claude sees to decide when to auto-load this skill.
Commit changes, push to GitHub, and open a PR. Includes quality checks (security, patterns, simplification). Use --quick to skip checks.
name: commit-push-pr description: Commit changes, push to GitHub, and open a PR. Includes quality checks (security, patterns, simplification). Use --quick to skip checks. allowed-tools: Bash, Read, Write, Edit, Grep, Glob, AskUserQuestion
Automates the git workflow of committing changes, pushing to GitHub, and opening a PR with intelligent handling of edge cases.
Before executing, internalize the git workflow standards: @.claude/rules/git_workflow.md
Key rules:
---
Run these commands to understand the current state:
# Detect the default branch (main, master, etc.)
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
# Fallback if symbolic-ref fails (e.g., shallow clone or missing HEAD)
if [ -z "$DEFAULT_BRANCH" ]; then
DEFAULT_BRANCH=$(git remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}')
fi
# Final fallback to 'main' if detection fails
DEFAULT_BRANCH=${DEFAULT_BRANCH:-main}
# Get current branch
BRANCH=$(git branch --show-current)
# Check for uncommitted changes
git status --porcelain
# Check for unpushed commits (if branch has upstream)
git log origin/$DEFAULT_BRANCH..HEAD --oneline 2>/dev/null || echo "No upstream or no commits ahead"
# Check if branch has upstream tracking
git rev-parse --abbrev-ref @{upstream} 2>/dev/null || echo "No upstream"Determine the state:
If `!HAS_CHANGES && !HAS_UNPUSHED`:
Inform user: "No changes to commit and no unpushed commits. Nothing to do." Exit gracefully.
If `!HAS_CHANGES && HAS_UNPUSHED`:
1. Check if PR already exists:
gh pr list --head "$(git branch --show-current)" --json number,url,title
2. If PR exists:
3. If no PR:
**If on default branch ($DEFAULT_BRANCH):**
1. Inform user that changes need to go on a feature branch 2. Stage changes first to analyze them:
git add -A git diff --staged --stat
3. Generate a conventional commit message based on the changes (see Step 5)
4. Derive branch name from commit message:
5. Create and checkout the new branch:
git checkout -b <branch-name>
**If already on feature branch:**
1. Stage all changes:
git add -A
2. Analyze the staged changes:
git diff --staged --stat git diff --staged
3. Generate a conventional commit message based on:
4. Present the commit message to the user. Example format:
Proposed commit message: feat(cli): add project listing command Adds a new 'lf project list' command that displays all projects in the current workspace with their status. Do you want to use this message, modify it, or provide your own?
**Skip if**: `--quick` flag was passed.
Run quality checks on staged changes before committing.
Search for and remove debug statements:
# Find files with debug statements git diff --staged --name-only | xargs grep -l -E "(console\.(log|debug|info)|debugger|print\()" 2>/dev/null
For each file found:
Report: "Auto-fixed: Removed N debug statements from M files"
Scan staged diff for:
| Issue | Severity | Action | |-------|----------|--------| | Hardcoded secrets (API keys, passwords) | BLOCK | Cannot auto-fix - user must remove | | Command injection (`shell=True`, `os.system`) | BLOCK | Cannot auto-fix - user must refactor | | Empty catch/except blocks | PROPOSE | Suggest adding error logging | | Duplicate code patterns | PROPOSE | Suggest extraction | | Unused imports | PROPOSE | Suggest removal | | TODO/FIXME comments | WARN | Note but allow proceed |
If BLOCK issues found:
For each PROPOSE issue:
For WARN issues:
---
Create the commit with the approved message:
git commit -m "$(cat <<'EOF' type(scope): short description Optional longer description explaining the change. EOF )"
**Important:**
Enterprise AI capabilities on your own hardware. No cloud required. LlamaFarm is an open-source AI platform that runs entirely on your hardware.
Repo: llama-farm/llamafarm
CLI best practices for LlamaFarm. Covers Cobra, Bubbletea, Lipgloss patterns for Go CLI development.
Comprehensive code review for diffs. Analyzes changed code for security vulnerabilities, anti-patterns, and quality issues. Auto-detects domain…
Best practices for the Common utilities package in LlamaFarm. Covers HuggingFace Hub integration, GGUF model management, and shared utilities.
Configuration module patterns for LlamaFarm. Covers Pydantic v2 models, JSONSchema generation, YAML processing, and validation.
Designer subsystem patterns for LlamaFarm. Covers React 18, TanStack Query, TailwindCSS, and Radix UI.
Electron patterns for LlamaFarm Desktop. Covers main/renderer processes, IPC, security, and packaging.