derailed-dash/dazbo-agent-skills/secrets-with-git-crypt

Claude Code and agent skill by derailed-dash/dazbo-agent-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Manages encryption and decryption of repository secrets (such as .env or *.tfvars) using git-crypt, keeping credentials secure with parallel encrypted files. Use when managing secrets, setting up git-crypt, or encrypting/decrypting environment files.

Install

npx vskill@latest install derailed-dash/dazbo-agent-skills/secrets-with-git-crypt

SKILL.md

The same SKILL.md was published earlier as derailed-dash/dazbo-agent-skills/secrets-with-git-crypt.

Secrets Management with Git-Crypt

This skill provides a secure, structured workflow for managing repository secrets (e.g. .env, *.tfvars, sec.json, settings.json) using git-crypt. It guides the agent to ensure sensitive credentials are never checked in as plaintext, instead maintaining parallel encrypted .enc versions checked into Git.

Table of Contents

Triggers

This skill MUST trigger whenever:

  • The user mentions git-crypt, encryption, decryption, or secrets management.
  • The user requests to store sensitive files (like .env, *.tfvars, settings.json, keyfiles) in the repository.
  • The user attempts to commit or push files that should be encrypted (e.g. .env, *.tfvars, sec.json) to the repository.
  • Cloning an existing repository that contains .enc files (e.g. .env.enc, terraform.tfvars.enc, settings.json.enc), indicating it was previously protected by git-crypt.
  • Initialising a new repository and setting up local/remote secret configurations.
  • Changing or adding secrets credentials that need to be committed securely.

Prerequisites

  • Host Environment: Unix-like operating system (e.g. Linux, WSL, macOS).
  • Git: A Git repository must be initialised in the current project.
  • git-crypt: The git-crypt command-line utility must be installed.
  • If missing, the helper script can attempt installation via sudo apt-get install git-crypt on Debian/Ubuntu systems.
  • Helper Script: Locate the bundled git-crypt-helper.sh script (already executable; run chmod +x if needed):
  • Global Antigravity path: ~/.gemini/config/skills/secrets-with-git-crypt/scripts/git-crypt-helper.sh
  • Project-local path: .agents/skills/secrets-with-git-crypt/scripts/git-crypt-helper.sh (or ./skills/secrets-with-git-crypt/scripts/git-crypt-helper.sh inside dazbo-agent-skills)

Secrets Setup and Sync Workflow

Copy this checklist and track your progress:

text
Secrets Management Progress:
- [ ] Step 1: Verify git-crypt installation and helper path
- [ ] Step 2: Initialise or unlock the repository
- [ ] Step 3: Configure tracking and gitignore rules
- [ ] Step 4: Perform file synchronisation
- [ ] Step 5: Verify environment security

Step 1: Pre-implementation safety & binary verification

Before attempting any encryption, decryption, or secret sync operations:

  1. Verify Git Work Tree:
  • Confirm the working directory is inside a Git repository (git rev-parse --is-inside-work-tree). If not in a Git repository, halt execution and prompt the user to run git init first.
  1. Verify `git-crypt` Binary, Helper Script & Pre-Edit Sync State (MANDATORY BEFORE EDITING):
  • Use the installed helper script (~/.gemini/config/skills/secrets-with-git-crypt/scripts/git-crypt-helper.sh, or .agents/skills/secrets-with-git-crypt/scripts/git-crypt-helper.sh when project-local).
  • CRITICAL PRE-EDIT RULE: Before modifying any local plaintext secret file (e.g. .env, mcp_config.json, *.tfvars), you MUST run status (and sync-from-enc if .enc is newer) first:

``bash bash ~/.gemini/config/skills/secrets-with-git-crypt/scripts/git-crypt-helper.sh status ` *Why this matters:* If <file>.enc was updated upstream (e.g. via git pull) while the local git-ignored <file> is still an older copy, editing the stale <file> first updates its mtime to "now" and causes sync-to-enc to reintroduce deleted lines back into <file>.enc. Always reconcile <file> from <file>.enc (sync-from-enc`) before applying edits.

  • If git-crypt is missing, offer to install it via:

``bash bash ~/.gemini/config/skills/secrets-with-git-crypt/scripts/git-crypt-helper.sh install ``

Step 2: Unlock with an existing shared key (preferred) or initialise a new key

  • CRITICAL KEY REUSE RULE: Always check whether the user already has a shared git-crypt symmetric key (e.g. ~/localdev/git-crypt-key, ../git-crypt-key, or $GIT_CRYPT_KEY_PATH) before ever running init, even on a brand-new repository!
  • git-crypt unlock <key_path> works on both cloned repositories and brand-new repositories (once .gitattributes is committed on a clean working tree) to bind the repository to your existing shared key without generating a new key.
  • If a shared key exists (or if unlock is run without arguments when ../git-crypt-key or ~/localdev/git-crypt-key is present), run:

``bash bash ~/.gemini/config/skills/secrets-with-git-crypt/scripts/git-crypt-helper.sh unlock ~/localdev/git-crypt-key ``

  • Only if no shared key exists AND the user explicitly wants to mint a brand-new key:

Decide where the secure key will be stored outside of the repository (e.g. ~/secure-keys/my-project.key) and run: ``bash bash ~/.gemini/config/skills/secrets-with-git-crypt/scripts/git-crypt-helper.sh init ~/secure-keys/my-project.key ` *(Note: init will refuse to generate a new key if an existing shared key is detected at ../git-crypt-key or ~/localdev/git-crypt-key unless --force` is passed.) Ensure the key is NEVER committed to Git.*

Step 3: Configure tracking and gitignore rules

Verify that .gitattributes in the root of the project contains the filter declaration:

text
*.enc filter=git-crypt diff=git-crypt

All unencrypted files (e.g. .env, settings.json, variables.tfvars) MUST be explicitly added to .gitignore. Running the helper script sync commands automatically appends them, but you must double-check that they are not tracked as plaintext in Git.

Step 4: Perform file synchronisation

  • Sync to encrypted versions (before committing changes):

Copy unencrypted local files to their parallel .enc versions:

  • For a specific file:

``bash bash ~/.gemini/config/skills/secrets-with-git-crypt/scripts/git-crypt-helper.sh sync-to-enc .env ``

  • For all known .enc files in the repository:

``bash bash ~/.gemini/config/skills/secrets-with-git-crypt/scripts/git-crypt-helper.sh sync-to-enc ``

  • Sync from encrypted versions (after unlocking a cloned repository):

Restore all unencrypted plaintext files from the unlocked .enc versions: ``bash bash ~/.gemini/config/skills/secrets-with-git-crypt/scripts/git-crypt-helper.sh sync-from-enc ``

Step 5: Verify environment security

Perform the steps in the Verification Loop before concluding your turn to make sure no plaintext secrets have been staged or committed.


Command Reference

The helper script supports the following commands:

CommandArgumentsDescription
installNoneInstalls git-crypt on Debian/Ubuntu/WSL platforms.
init[--force] <key_path>Runs git-crypt init, sets up .gitattributes, and exports key (blocks if a shared key already exists unless --force).
unlock[key_path]Unlocks the repository (new or cloned) using the specified key file or auto-detected shared key (../git-crypt-key / ~/localdev/git-crypt-key).
sync-to-enc[--force] [file]Syncs unencrypted file(s) to their .enc copies (refuses if .enc is newer unless --force); prints git diff --stat HEAD and ensures .gitignore inclusion.
sync-from-enc[--force] [file]Syncs/restores .enc copies back to unencrypted files (refuses if plaintext is newer unless --force).
statusNoneEvaluates installation, git-crypt initialisation, and file sync states.

Verification Loop

Before concluding the secrets setup or modifications, the agent MUST execute the following verification steps:

1. Execute Status Check

Run the helper status command:

bash
bash ~/.gemini/config/skills/secrets-with-git-crypt/scripts/git-crypt-helper.sh status

Ensure all parallel secret files report [OK]. If any say DO NOT MATCH, run the appropriate sync-to-enc or sync-from-enc command.

2. Verify gitignore Integrity

Confirm the unencrypted plain files are NOT tracked by Git. Run:

bash
git ls-files --error-unmatch .env 2>/dev/null
  • If the command returns output (file is tracked): IMMEDIATELY run git rm --cached <file> to remove it from staging while keeping it locally on disk.
3. Verify .gitattributes Structure

Verify that .gitattributes has:

text
*.enc filter=git-crypt diff=git-crypt

This ensures git-crypt transparently manages all .enc files under Git.

4. Git Crypt Status Check

Verify that git-crypt matches the filter correctly on staged/committed .enc files:

bash
git-crypt status

The output must show that the .enc files are encrypted.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/derailed-dash/dazbo-agent-skills/secrets-with-git-crypt/badge)](https://verified-skill.com/skills/derailed-dash/dazbo-agent-skills/secrets-with-git-crypt)

Something wrong with this skill or its page? Tell us.