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.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
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:
type(scope): description--no-verify)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:
HAS_CHANGES: Are there uncommitted changes (staged, unstaged, or untracked)?HAS_UNPUSHED: Are there commits ahead of origin/$DEFAULT_BRANCH?ON_DEFAULT_BRANCH: Is current branch the default branch ($DEFAULT_BRANCH)?HAS_UPSTREAM: Does the branch track a remote?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:
gh pr list --head "$(git branch --show-current)" --json number,url,title
If PR exists:
If no PR:
If on default branch ($DEFAULT_BRANCH):
git add -A
git diff --staged --stat
Generate a conventional commit message based on the changes (see Step 5)
Derive branch name from commit message:
feat(cli): add project list → feat-cli-add-project-listfix: resolve memory leak → fix-resolve-memory-leakCreate and checkout the new branch:
git checkout -b <branch-name>
If already on feature branch:
git add -A
git diff --staged --stat
git diff --staged
Generate a conventional commit message based on:
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:
console.log(...), console.debug(...), console.info(...) statementsdebugger; statementsprint(...) statements (Python)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:
--no-verify)If commit fails due to pre-commit hook:
--no-verifygit rev-parse --abbrev-ref @{upstream} 2>/dev/null
-u:git push -u origin $(git branch --show-current)
git push
If push fails due to conflicts:
git pull --rebase origin $DEFAULT_BRANCH or git merge origin/$DEFAULT_BRANCHgh pr list --head "$(git branch --show-current)" --json number,url,title
If PR exists:
If no PR exists:
gh pr create --title "type(scope): description" --body "$(cat <<'EOF'
## Summary
- Brief description of changes
## Changes
- List of key changes made
## Test Plan
- How to verify these changes work
EOF
)"
Convert commit message to valid branch name:
| Input | Output |
|---|---|
feat(cli): add project list command | feat-cli-add-project-list-command |
fix: resolve memory leak in cache | fix-resolve-memory-leak-in-cache |
refactor(server): simplify auth flow | refactor-server-simplify-auth-flow |
Algorithm:
( and ) with --| Error | Action |
|---|---|
| Pre-commit hook fails | Show output, ask user to fix, do NOT bypass |
| Push rejected (conflicts) | Suggest rebase/merge, do NOT force push |
| PR creation fails | Show error, suggest manual creation |
| Not a git repo | Inform user, exit |
| gh CLI not installed | Inform user how to install |
| Not authenticated to GitHub | Suggest gh auth login |
On success, report:
Committed: feat(cli): add project list command
Branch: feat-cli-add-project-list-command
Pushed to: origin/feat-cli-add-project-list-command
PR: https://github.com/owner/repo/pull/123
아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
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.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
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.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.