본문으로 건너뛰기
cccskills
무료GitHub에 공개

sops-setup

Set up SOPS + age encryption for sharing .env files securely across machines. Detects existing state, installs tools, generates age keys, creates .sops.yaml, and encrypts .env files as YAML (avoids SOPS dotenv bug #1435). Use when user mentions "sops setup", "encrypt env", "share secrets", "secure env files", "sops age setup", "env encryption", "setup sops", "share env across machines".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(7)

  • SKILL.md6.5 KB
  • EXAMPLES.md3.6 KB
  • references/sops-best-practices.md27.2 KB
  • scripts/detect_sops.py6.3 KB
  • scripts/dotenv_yaml.py6.5 KB
  • TROUBLESHOOTING.md5.1 KB
  • WORKFLOW.md6.4 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

SOPS + age Setup Wizard

Interactive setup for SOPS + age encryption. Detects current state and guides through configuration.

Important: This skill uses YAML format for encrypted files (not dotenv) because SOPS has a known bug (#1435) where the dotenv store corrupts backslash and \n sequences on decrypt. A helper script handles dotenv↔YAML conversion transparently.

Pre-flight

Run the detection script to understand current state:

python3 ${CLAUDE_SKILL_DIR}/scripts/detect_sops.py <project-root>

Two-Phase Workflow

Phase 1: Detect

  1. Run the detector on the project root:

    python3 ${CLAUDE_SKILL_DIR}/scripts/detect_sops.py <project-root>
    
  2. Summarize findings — show a status table:

    ComponentStatusDetail
    sops binaryinstalled/missingversion, path
    age binaryinstalled/missingversion, path
    age keyexists/missingpublic key (truncated)
    .sops.yamlexists/missing# of authorized keys
    .env filesN foundlist of filenames
    encrypted filesN foundlist of *.enc.yaml files
    .gitignoreok/needs updateenv ignored, enc.yaml not ignored

Phase 2: Configure

Walk through each missing component. Skip steps where detection shows everything is already configured.

  1. Install tools (if tools.sops.installed or tools.age.installed is false):

    • Show install commands based on os field:
      • macOS: brew install sops age
      • Linux: Show download URLs for latest binaries from GitHub releases
    • After user confirms installation, re-run detector to verify
  2. Generate age key (if age_key.exists is false):

    • Create directory: mkdir -p ~/.config/sops/age
    • Generate key: age-keygen -o ~/.config/sops/age/keys.txt
    • Set permissions: chmod 600 ~/.config/sops/age/keys.txt
    • Display the public key and tell user to save it somewhere safe (password manager, secure note)
  3. Generate backup key (recommended):

    • Use AskUserQuestion — offer to create an offline backup key for disaster recovery
    • If yes:
      age-keygen 2>&1 | tee /dev/stderr | grep "public key:" | awk '{print $NF}'
      
      Display BOTH the public key AND the full output (which includes the private key). Tell user: Copy the entire output (including the private key line starting with AGE-SECRET-KEY-) to a password manager or secure offline storage. This is your recovery key.
    • The backup public key will be added to .sops.yaml alongside the machine key
  4. Create .sops.yaml (if project.sops_yaml.exists is false):

    • Write .sops.yaml with machine key + backup key (if generated):
      creation_rules:
        - path_regex: (^|/)\.env\.[^/]+\.enc\.yaml$
          age: >-
            <machine-public-key>,
            <backup-public-key>
      
    • If .sops.yaml already exists but is missing this machine's key, offer to add it
  5. Set up .gitattributes for diff-friendly encrypted files:

    • Add to .gitattributes:
      *.enc.yaml diff=sopsdiffer
      
    • Configure git:
      git config diff.sopsdiffer.textconv "sops decrypt"
      
    • This makes git diff show decrypted content for encrypted files
  6. Update .gitignore (if needed):

    • Ensure .env* patterns are ignored (secrets must not be committed in plaintext)
    • Ensure *.enc.yaml is NOT ignored (encrypted files should be committed)
    • Show proposed changes and confirm with user before writing
  7. Encrypt files (if project.env_files is non-empty):

    • Use AskUserQuestion (multiSelect: true) — show detected .env* files
    • For each selected file, convert dotenv→YAML then encrypt:
      python3 ${CLAUDE_SKILL_DIR}/scripts/dotenv_yaml.py to-yaml <file> > <file>.enc.yaml.tmp
      sops --encrypt <file>.enc.yaml.tmp > <file>.enc.yaml
      rm <file>.enc.yaml.tmp
      
      Example: .env.local → .env.local.enc.yaml
    • Verify each encrypted file was created successfully
  8. Confirmation summary — show table of all actions taken:

    | Step | Action | Result |
    |------|--------|--------|
    | Tools | sops 3.9.4, age 1.2.0 | installed |
    | Key | Machine key generated | age1abc...def |
    | Key | Backup key generated | age1xyz...uvw (save offline!) |
    | Permissions | chmod 600 keys.txt | done |
    | Config | .sops.yaml created | 2 keys authorized |
    | Git | .gitattributes updated | sopsdiffer configured |
    | Git | .gitignore updated | .env* ignored |
    | Encrypt | .env.local → .env.local.enc.yaml | done |
    
    ## Next Steps
    - Commit .sops.yaml, .gitattributes, and *.enc.yaml files to git
    - On another machine: clone, install sops+age, place age key, run /devtools:sops-decrypt
    - To add another machine: /devtools:sops-add-key
    - To encrypt after editing .env: /devtools:sops-encrypt
    - To decrypt after pulling: /devtools:sops-decrypt
    

Key Rules

  • Never overwrite existing files without asking. Always offer merge/replace/skip.
  • Detect first — skip steps that are already configured.
  • Use AskUserQuestion for every decision. Do not assume user preferences.
  • YAML format only — never use --input-type dotenv. Use the dotenv_yaml.py helper for conversion.
  • chmod 600 on age key files immediately after creation.
  • Display public keys after generation — user needs them for multi-machine setup.
  • Verify after each step — re-run relevant checks to confirm success.

References

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

adr

무료

Create, review, and manage Architecture Decision Records (ADRs) with auto-numbering, template detection, quality review, and index maintenance. Use when user mentions "ADR", "architecture decision", "document this decision", "create ADR", "review ADR", editing ADR files (docs/adr/, doc/adr/, .adr/), or discussing architectural choices and tradeoffs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

joaquimscosta/arkhe-claude-plugins212026년 10월 16일 업데이트

architect

무료

Analyze system architecture, module structure, API contracts, data models, and code patterns. Use when designing systems, reviewing module boundaries, evaluating API designs, analyzing data models, checking pattern conformance, tracing decisions, or reviewing frontend architecture. Triggers: "architecture", "module design", "API design", "data model", "boundaries", "patterns", "decisions", "frontend architecture".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

joaquimscosta/arkhe-claude-plugins212026년 10월 16일 업데이트

Converts natural-language descriptions or UI spec files into optimized Google Stitch prompts. Use when creating, refining, or validating design directives for Google Stitch. Use when user says "create a Stitch prompt", "optimize this for Stitch", "convert this spec to a Stitch prompt", "write a UI prompt", or mentions Google Stitch prompt authoring. Follows Stitch best practices with short, directive prompts focused on screens, structure, and visual hierarchy.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

joaquimscosta/arkhe-claude-plugins212026년 10월 16일 업데이트

Zero-dependency live-preview server providing an agent↔browser bidirectional companion. Watches a content directory, wraps HTML fragments in a frame template, broadcasts live-reload over WebSocket, and captures browser-side click events to a JSONL file. Use when an agent needs to show HTML to the user in a browser and react to clicks — mockups, design exploration, gallery browsing, multi-select choices, prototype iteration. Triggered by "live preview", "browser companion", "preview server", "browser mockup", "show in browser", "arkhe-preview", or any skill that wants to write HTML fragments and have the user see them reload in real time.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

joaquimscosta/arkhe-claude-plugins212026년 10월 16일 업데이트

Deletes merged git branches (local and remote) and flags stale unmerged branches for manual review. Use when user mentions "cleanup branches", "delete merged branches", "prune old branches", "remove stale branches", "branch cleanup", or runs /cleanup-branches command.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

joaquimscosta/arkhe-claude-plugins212026년 10월 16일 업데이트

Interactive Claude Code environment setup wizard. Detects existing configuration, guides through best-practice setup for Global CLAUDE.md, project scaffolding, MCP servers, hooks, custom agents, keybindings, and settings. Use when user runs /devtools:code-env-setup, mentions "setup claude code", "configure claude", "claude code setup", "environment setup", or "initialize claude code".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

joaquimscosta/arkhe-claude-plugins212026년 10월 16일 업데이트

joaquimscosta의 스킬 모두 보기

이 스킬의 문제 신고