configure-git-repository
关于
This skill configures Git repositories with language-specific .gitignore files, branch strategies, commit conventions, and hooks. It's designed for initial project setup in R, Node.js, or Python environments. Developers should use it when starting version control for new projects or standardizing existing repositories.
快速安装
Claude Code
推荐npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/configure-git-repository在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
配 Git 庫
依項類設 Git 庫之宜配。
用
- 新項初控
- 加
.gitignore於某言/框 - 設支護與例
- 配 commit hook
入
- 必:項目錄
- 必:項類(R 包、Node.js、Python、通)
- 可:遠庫 URL
- 可:支策(trunk-based、Git Flow)
- 可:提交訊息例
行
一:初庫
cd /path/to/project
git init
git branch -M main
得: .git/ 已建。默支名 main。
敗: git init 敗→確 Git 已裝(git --version)。若已有 .git/→庫已初,略步。
二:建 .gitignore
R 包:
# R artifacts
.Rhistory
.RData
.Rproj.user/
*.Rproj
# Environment (sensitive)
.Renviron
# renv library (machine-specific)
renv/library/
renv/staging/
renv/cache/
# Build artifacts
*.tar.gz
src/*.o
src/*.so
src/*.dll
# Documentation build
docs/
inst/doc/
# IDE
.vscode/
.idea/
# OS
.DS_Store
Thumbs.db
Node.js/TypeScript:
node_modules/
dist/
build/
.next/
.env
.env.local
.env.*.local
*.log
npm-debug.log*
.DS_Store
Thumbs.db
.vscode/
.idea/
coverage/
Python:
__pycache__/
*.py[cod]
*.egg-info/
dist/
build/
.eggs/
.venv/
venv/
.env
*.log
.mypy_cache/
.pytest_cache/
htmlcov/
.coverage
.DS_Store
.idea/
.vscode/
得: .gitignore 依項類建。敏檔(.Renviron、.env)與生物排。
敗: 不確入何→以 gitignore.io 或 GitHub 模起並改。
三:建初提交
git add .gitignore
git add . # Review what's being added first with git status
git commit -m "Initial project setup"
得: 首提交含 .gitignore 與初項檔。git log 示一提交。
敗: 「nothing to commit」→確已 git add。身份錯→設 git config user.name 與 user.email。
四:連遠
# Add remote
git remote add origin [email protected]:username/repo.git
# Push
git push -u origin main
得: 遠 origin 已配。git remote -v 示取推 URL。初提交已推。
敗: 「Permission denied (publickey)」→配 SSH(見 setup-wsl-dev-environment)。遠已在→git remote set-url origin <url> 更。
五:設支例
Trunk-based(小組宜):
main:生產就緒- 功能支:
feature/description - 修錯:
fix/description
# Create feature branch
git checkout -b feature/add-authentication
# After work is done, merge or create PR
git checkout main
git merge feature/add-authentication
得: 支名例已立且記。組員知各類工之前綴。
敗: 支名已異→git branch -m old-name new-name 更,更開 PR。
六:配提交例
Conventional Commits 格式:
type(scope): description
feat: add user authentication
fix: correct calculation in weighted_mean
docs: update README installation section
test: add edge case tests for parser
refactor: extract helper function
chore: update dependencies
得: 提交訊息例已記且組同意。後提交守 type: description。
敗: 組員不守→以 commit-msg hook 執(見步七)。
七:設 pre-commit hook(選)
建 .githooks/pre-commit:
#!/bin/bash
# Run linter before commit
# For R packages
if [ -f "DESCRIPTION" ]; then
Rscript -e "lintr::lint_package()" || exit 1
fi
# For Node.js
if [ -f "package.json" ]; then
npm run lint || exit 1
fi
chmod +x .githooks/pre-commit
git config core.hooksPath .githooks
得: hook 於每 git commit 自行。lint 錯阻提交至修。
敗: hook 未行→驗 core.hooksPath 已設(git config core.hooksPath)且 hook 可行(chmod +x)。
八:建 README
# Minimal README
echo "# Project Name" > README.md
echo "" >> README.md
echo "Brief description of the project." >> README.md
git add README.md
git commit -m "Add README"
得: README.md 已提。項於 GitHub 有簡有資之頁。
敗: README.md 已在→更勿覆。R 項用 usethis::use_readme_md() 取含 badge 之模。
驗
-
.gitignore排敏檔與生物 - 無敏數據(token、密)於追檔
- 遠庫已連可達
- 支名例已記
- 初提交淨建
忌
.gitignore前提交:先加.gitignore。已追檔不受後.gitignore影響。- 史中敏數據:秘已提→即後刪仍留於史。
git filter-repo或 BFG 清。 - 大二進檔:勿提大二進。>1MB 用 Git LFS。
- 行末:Win/WSL 設
core.autocrlf=input防 CRLF/LF 問。
參
commit-changes- 暫存與提交流manage-git-branches- 支建與例create-r-package- R 包建中之 Git 設setup-wsl-dev-environment- Git 裝與 SSHcreate-github-release- 從庫建發布security-audit-codebase- 察所提之秘
GitHub 仓库
相关推荐技能
llamaguard
其他LlamaGuard是Meta推出的7-8B参数内容审核模型,专门用于过滤LLM的输入和输出内容。它能检测六大安全风险类别(暴力/仇恨、性内容、武器、违禁品、自残、犯罪计划),准确率达94-95%。开发者可通过HuggingFace、vLLM或Sagemaker快速部署,并能与NeMo Guardrails集成实现自动化安全防护。
cost-optimization
其他这个Claude Skill帮助开发者优化云成本,通过资源调整、标记策略和预留实例来降低AWS、Azure和GCP的开支。它适用于减少云支出、分析基础设施成本或实施成本治理策略的场景。关键功能包括提供成本可视化、资源规模调整指导和定价模型优化建议。
quantizing-models-bitsandbytes
其他这个Skill使用bitsandbytes库量化大语言模型,能在GPU内存有限时通过8位或4位量化减少50-75%内存占用,同时保持精度损失最小。它支持INT8、NF4、FP4等多种量化格式,可与HuggingFace Transformers无缝集成,适用于需要部署更大模型或加速推理的场景。还提供QLoRA训练和8位优化器支持,让开发者能轻松实现高效模型压缩。
dispatching-parallel-agents
其他该Skill用于并行处理3个以上无依赖关系的独立故障,可为每个问题域分派专属Claude代理同时执行调查修复。它通过并发处理多个独立问题显著提升故障排查效率,特别适用于测试文件、子系统等无共享状态的场景。
