cli-skills
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 (frontend/backend) from file paths.
$ npx -y skills add llama-farm/llamafarm --skill code-review --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/code-reviewContext preview
The summary Claude sees to decide when to auto-load this skill.
Comprehensive code review for diffs. Analyzes changed code for security vulnerabilities, anti-patterns, and quality issues. Auto-detects domain (frontend/backend) from file paths.
name: code-review description: Comprehensive code review for diffs. Analyzes changed code for security vulnerabilities, anti-patterns, and quality issues. Auto-detects domain (frontend/backend) from file paths. allowed-tools: Bash, Read, Edit, Write, Grep, Glob, Task
You are performing a comprehensive code review on a diff. Your task is to analyze the changed code for security vulnerabilities, anti-patterns, and quality issues.
This skill expects a **diff** to be provided in context before invocation. The caller is responsible for generating the diff.
**Example invocations:**
If no diff is present in context, ask the user to provide one or offer to generate one (e.g., `git diff`, `git diff main..HEAD`).
---
Auto-detect which checklists to apply based on directory paths in the diff:
| Directory | Domain | Checklist | |-----------|--------|-----------| | `designer/` | Frontend | Read `frontend.md` | | `server/` | Backend | Read `backend.md` | | `rag/` | Backend | Read `backend.md` | | `runtimes/universal/` | Backend | Read `backend.md` | | `cli/` | CLI/Go | Generic checks only | | `config/` | Config | Generic checks only |
If the diff spans multiple domains, load all relevant checklists.
---
Extract from the diff:
Create a review document using the **temp-files pattern**:
SANITIZED_PATH=$(echo "$PWD" | tr '/' '-')
REPORT_DIR="/tmp/claude/${SANITIZED_PATH}/reviews"
mkdir -p "$REPORT_DIR"
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
FILEPATH="${REPORT_DIR}/code-review-${TIMESTAMP}.md"Initialize with this schema:
# Code Review Report
**Date**: {current date}
**Reviewer**: Code Review Agent
**Source**: {e.g., "PR diff", "unstaged changes", "main..HEAD"}
**Files Changed**: {count}
**Domains Detected**: {list}
**Status**: In Progress
## Summary
| Category | Items Checked | Passed | Failed | Findings |
|----------|---------------|--------|--------|----------|
| Security | 0 | 0 | 0 | 0 |
| Code Quality | 0 | 0 | 0 | 0 |
| LLM Code Smells | 0 | 0 | 0 | 0 |
| Impact Analysis | 0 | 0 | 0 | 0 |
| Simplification | 0 | 0 | 0 | 0 |
{domain-specific categories added based on detected domains}
## Detailed Findings
{findings added here as review progresses}For EACH checklist item:
1. **Scope feedback to diff lines only** - Only flag issues in the changed code 2. **Use file context** - Read full file content to understand surrounding code 3. **Apply relevant checks** - Use domain-appropriate checklist items 4. **Document findings** - Record each violation found in changed code
**Key principle**: The diff is what gets reviewed. The rest of the file provides context to make that review accurate.
Check if the diff might affect other parts of the codebase:
Report any unaccounted-for impacts as findings with severity based on risk.
For each issue found, add an entry:
### [{CATEGORY}] {Item Name}
**Status**: FAIL
**Severity**: Critical | High | Medium | Low
**Scope**: Changed code | Impact analysis
#### Violation
- **File**: `path/to/file.ext`
- **Line(s)**: 42-48 (from diff)
- **Code**:// problematic code snippet from diff
- **Issue**: {explanation of what's wrong}
- **Recommendation**: {how to fix it}After completing all checks:
1. Update the summary table with final counts 2. Add an executive summary:
3. Update status to "Complete" 4. Inform the user of the report location
---
These checks apply to ALL changed code regardless of domain.
---
**Check diff for**:
**Pass criteria**: No hardcoded secrets in diff (should use environment variables) **Severity**: Critical
---
**Check diff for**:
**Pass criteria**: No dynamic code execution in changed lines **Severity**: Critical
---
**Check diff for**:
**Pass criteria**: No unvalidated user input in shell commands **Severity**: Critical
---
**Check diff for**:
**Pass criteria**: No debug statements in production code changes **Severity**: Low
---
**Check diff for**:
**Pass criteria**: New TODOs should be tracked in issues **Severity**: Low
---
**Check diff for**:
**Pass criteria**: All error handlers log or rethrow **Severity**: High
---
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.
Commit changes, push to GitHub, and open a PR. Includes quality checks (security, patterns, simplification). Use --quick to skip checks.
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.