Zurück zu Fähigkeiten

configure-git-repository

pjt222
Aktualisiert 2 days ago
3 Ansichten
17
2
17
Auf GitHub ansehen
Anderegeneral

Über

Diese Fähigkeit konfiguriert ein Git-Repository mit sprachspezifischen .gitignore-Dateien, Branch-Strategien, Commit-Konventionen und Pre-Commit-Hooks. Sie bietet Initial-Setup und gängige Muster für R-, Node.js- und Python-Projekte. Verwenden Sie sie bei der Initialisierung der Versionskontrolle für ein neues Projekt oder zur Standardisierung eines bestehenden Repositorys.

Schnellinstallation

Claude Code

Empfohlen
Primär
npx skills add pjt222/agent-almanac -a claude-code
Plugin-BefehlAlternativ
/plugin add https://github.com/pjt222/agent-almanac
Git CloneAlternativ
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/configure-git-repository

Kopieren Sie diesen Befehl und fügen Sie ihn in Claude Code ein, um diese Fähigkeit zu installieren

Dokumentation

Configure Git Repository

Set up a Git repository with appropriate configuration for the project type.

When to Use

  • Initializing version control for a new project
  • Adding .gitignore for a specific language/framework
  • Setting up branch protection and conventions
  • Configuring commit hooks

Inputs

  • Required: Project directory
  • Required: Project type (R package, Node.js, Python, general)
  • Optional: Remote repository URL
  • Optional: Branch strategy (trunk-based, Git Flow)
  • Optional: Commit message convention

Procedure

Step 1: Initialize Repository

cd /path/to/project
git init
git branch -M main

Got: .git/ directory created. Default branch is named main.

If fail: If git init fails, ensure Git is installed (git --version). If the directory already has a .git/, the repository is already initialized — skip this step.

Step 2: Create .gitignore

R Package:

# 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/

Got: .gitignore file created with entries appropriate for the project type. Sensitive files (.Renviron, .env) and generated artifacts are excluded.

If fail: If unsure which entries to include, use gitignore.io or GitHub's .gitignore templates as a starting point and customize for the project.

Step 3: Create Initial Commit

git add .gitignore
git add .  # Review what's being added first with git status
git commit -m "Initial project setup"

Got: First commit created containing .gitignore and initial project files. git log shows one commit.

If fail: If git commit fails with "nothing to commit," ensure files were staged with git add. If it fails with an author identity error, set git config user.name and git config user.email.

Step 4: Connect Remote

# Add remote
git remote add origin [email protected]:username/repo.git

# Push
git push -u origin main

Got: Remote origin is configured. git remote -v shows fetch and push URLs. Initial commit is pushed to the remote.

If fail: If push fails with "Permission denied (publickey)," configure SSH keys (see setup-wsl-dev-environment). If the remote already exists, update it with git remote set-url origin <url>.

Step 5: Set Up Branch Conventions

Trunk-based (recommended for small teams):

  • main: production-ready code
  • Feature branches: feature/description
  • Bug fixes: 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

Got: Branch naming convention is established and documented. Team members know which prefix to use for each type of work.

If fail: If branches are already named inconsistently, rename them with git branch -m old-name new-name and update any open PRs.

Step 6: Configure Commit Conventions

Conventional Commits format:

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

Got: Commit message convention is documented and agreed upon by the team. Future commits follow the type: description format.

If fail: If team members are not following the convention, enforce it with a commit-msg hook that validates the format (see Step 7).

Step 7: Set Up Pre-Commit Hooks (Optional)

Create .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

Got: Pre-commit hook runs automatically on each git commit. Linting errors block the commit until fixed.

If fail: If the hook does not run, verify core.hooksPath is set (git config core.hooksPath) and the hook file is executable (chmod +x).

Step 8: Create 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"

Got: README.md committed to the repository. The project has a minimal but informative landing page on GitHub.

If fail: If README.md already exists, update it rather than overwriting. Use usethis::use_readme_md() in R projects for a template with badges.

Validation

  • .gitignore excludes sensitive and generated files
  • No sensitive data (tokens, passwords) in tracked files
  • Remote repository connected and accessible
  • Branch naming conventions documented
  • Initial commit created cleanly

Pitfalls

  • Committing before .gitignore: Add .gitignore first. Files already tracked aren't affected by later .gitignore entries.
  • Sensitive data in history: If secrets are committed, they remain in history even after deletion. Use git filter-repo or BFG to clean.
  • Large binary files: Don't commit large binaries. Use Git LFS for files > 1MB.
  • Line endings: Set core.autocrlf=input on Windows/WSL to prevent CRLF/LF issues.

Related Skills

  • commit-changes - staging and committing workflow
  • manage-git-branches - branch creation and conventions
  • create-r-package - Git setup as part of R package creation
  • setup-wsl-dev-environment - Git installation and SSH keys
  • create-github-release - creating releases from the repository
  • security-audit-codebase - check for committed secrets

GitHub Repository

pjt222/agent-almanac
Pfad: i18n/caveman-lite/skills/configure-git-repository
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

Verwandte Skills

llamaguard

Andere

LlamaGuard ist Metas 7-8B-Parameter-Modell zur Moderation von LLM-Eingaben und -Ausgaben in sechs Sicherheitskategorien wie Gewalt und Hassrede. Es bietet eine Genauigkeit von 94-95 % und kann mit vLLM, Hugging Face oder Amazon SageMaker eingesetzt werden. Nutzen Sie diese Skill, um Inhaltsfilterung und Sicherheitsguardrails einfach in Ihre KI-Anwendungen zu integrieren.

Skill ansehen

cost-optimization

Andere

Diese Claude Skill unterstützt Entwickler bei der Optimierung von Cloud-Kosten durch Ressourcen-Dimensionierung, Tagging-Strategien und Ausgabenanalysen. Sie bietet einen Rahmen zur Senkung von Cloud-Ausgaben und zur Implementierung von Kosten-Governance für AWS, Azure und GCP. Nutzen Sie sie, wenn Sie Infrastrukturkosten analysieren, Ressourcen richtig dimensionieren oder Budgetvorgaben einhalten müssen.

Skill ansehen

quantizing-models-bitsandbytes

Andere

Diese Fähigkeit quantisiert LLMs auf 8-Bit- oder 4-Bit-Präzision mittels bitsandbytes und erreicht dabei eine Speicherreduzierung von 50–75 % bei minimalem Genauigkeitsverlust. Sie ist ideal für den Betrieb größerer Modelle mit begrenztem GPU-Speicher oder zur Beschleunigung von Inferenzvorgängen und unterstützt Formate wie INT8, NF4 und FP4. Die Fähigkeit integriert sich in HuggingFace Transformers und ermöglicht QLoRA-Training sowie 8-Bit-Optimierer.

Skill ansehen

dispatching-parallel-agents

Andere

Diese Claude-Fähigkeit verteilt mehrere Agenten, um drei oder mehr unabhängige Probleme gleichzeitig zu untersuchen und zu beheben. Sie ist für Szenarien konzipiert, die unabhängige Fehler umfassen, die ohne gemeinsamen Zustand oder Abhängigkeiten gelöst werden können. Die Kernfähigkeit ist die parallele Problemlösung, bei der pro unabhängigem Problembereich ein Agent zugewiesen wird, um die Effizienz zu maximieren.

Skill ansehen