本文へ移動
cccskills
無料GitHub で公開

sops-add-key

Add a new machine's age public key to .sops.yaml and re-encrypt all files. Use for multi-machine setups. Use when user mentions "add key", "add machine", "sops add key", "new machine", "authorize machine", "share key", "add public key", "multi machine sops".

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

SOPS Add Key

Add a new machine's age public key to the project and re-encrypt all files so the new machine can decrypt them.

Workflow

  1. Detect current state:

    python3 ${CLAUDE_SKILL_DIR}/../sops-setup/scripts/detect_sops.py <project-root>
    
  2. Verify prerequisites:

    • project.sops_yaml.exists must be true — if not, tell user to run /devtools:sops-setup first
    • project.encrypted_files should be non-empty — warn if there are no .enc.yaml files to re-encrypt
    • If project.tmp_files is non-empty, warn about stale temporary files (leftover from a failed decrypt/re-encrypt) and suggest the user delete them
  3. Audit key propagation (if encrypted files exist): For each encrypted file, read its YAML and check the sops.age recipients list against project.sops_yaml.authorized_keys. If any authorized key is missing from any file's recipients:

    WARNING: Key age1xxx...yyy is in .sops.yaml but NOT a recipient in:
      - apps/web/.env.local.enc.yaml
      - apps/api/.env.local.enc.yaml
    These files need re-encryption before the corresponding machine can decrypt them.
    

    Offer to run sops updatekeys -y <file> for each affected file before proceeding with the new key addition.

  4. Show current authorized keys from project.sops_yaml.authorized_keys:

    Currently authorized keys (N):
    1. age1abc...def (truncated)
    2. age1ghi...jkl (truncated)
    
  5. Use AskUserQuestion — ask user to paste the new machine's age public key. Validate it starts with age1.

  6. Read .sops.yaml and add the new key to the age: field in creation_rules. Use the Edit tool to append the key to the comma-separated list or multi-line block.

  7. Re-encrypt all files using sops updatekeys:

    sops updatekeys -y <file>.enc.yaml
    

    For each encrypted file. The -y flag auto-confirms. This re-wraps only the data encryption key for the new recipient list — values and MAC are unchanged, producing a minimal diff.

    If sops updatekeys is not available (older sops version), fall back to decrypt + re-encrypt:

    sops --decrypt <file>.enc.yaml > <file>.tmp.yaml
    sops --encrypt <file>.tmp.yaml > <file>.enc.yaml
    rm <file>.tmp.yaml
    

    Verify: After re-encrypting, read each file's sops.age recipients block and confirm all keys from .sops.yaml (including the newly added key) appear as recipients. If any key is missing, warn the user that re-encryption may have failed.

  8. Summary:

    | Action | Detail |
    |--------|--------|
    | Key added | age1xyz... (new machine) |
    | .sops.yaml | Updated (now N+1 authorized keys) |
    | Re-encrypted | .env.local.enc.yaml |
    | Re-encrypted | .env.production.enc.yaml |
    

    Remind user to commit both .sops.yaml and the updated .enc.yaml files.

Key Rotation vs Key Addition

  • Adding a key (sops updatekeys): Re-wraps the DEK for the new recipient list. Safe, minimal diff. Use for onboarding machines.
  • Rotating keys (sops rotate -i): Generates a new DEK and re-encrypts every value. Use when a key is compromised or for periodic security hygiene.
  • If the user mentions a compromised key, recommend sops rotate -i after removing the compromised key from .sops.yaml.

Key Rules

  • Validate the public key format (must start with age1) before modifying .sops.yaml
  • Always show the current keys before adding a new one
  • Re-encrypt ALL .enc.yaml files — missing any would lock out the new machine for those files
  • Use sops updatekeys (not full decrypt/re-encrypt) for routine key additions
  • After re-encryption, the new machine can clone and decrypt immediately

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

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年8月14日 更新

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年8月14日 更新

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年8月14日 更新

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年8月14日 更新

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年8月14日 更新

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年8月14日 更新

joaquimscosta のスキルをすべて見る

このスキルの問題を報告する