home / skills / phrazzld / claude-config / fix-bitcoin

fix-bitcoin skill

/skills/fix-bitcoin

This skill audits Bitcoin setup, fixes the highest priority issue, and verifies the result to keep nodes, wallets, and operations healthy.

npx playbooks add skill phrazzld/claude-config --skill fix-bitcoin

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.6 KB
---
name: fix-bitcoin
description: |
  Run /check-bitcoin, then fix the highest priority Bitcoin issue.
  Creates one fix per invocation. Invoke again for next issue.
  Use /log-bitcoin-issues to create issues without fixing.
---

# /fix-bitcoin

Fix the highest priority Bitcoin issue.

## What This Does

1. Invoke `/check-bitcoin` to audit Bitcoin setup
2. Identify highest priority issue
3. Fix that one issue
4. Verify the fix
5. Report what was done

**This is a fixer.** It fixes one issue at a time. Run again for next issue. Use `/bitcoin` for full lifecycle.

## Process

### 1. Run Primitive

Invoke `/check-bitcoin` skill to get prioritized findings.

### 2. Fix Priority Order

Fix in this order:
1. **P0**: Node not synced, wallet not encrypted
2. **P1**: Missing testnet/mainnet separation
3. **P2**: UTXO consolidation needed
4. **P3**: Advanced features

### 3. Execute Fix

**Node not synced (P0):**
Check sync status:
```bash
bitcoin-cli getblockchaininfo
```
If `headers` > `blocks`, wait or restart:
```bash
bitcoin-cli stop
bitcoind -daemon
```

**Wallet not encrypted (P0):**
Encrypt wallet:
```bash
bitcoin-cli encryptwallet "strong-passphrase"
```
Back up:
```bash
bitcoin-cli backupwallet /path/to/backup.dat
```

**Missing testnet/mainnet separation (P1):**
Split configs:
```ini
# bitcoin.conf
mainnet=1

[test]
testnet=1
walletdir=/var/lib/bitcoin/testnet-wallets
```
Use explicit network flags in tooling:
```bash
bitcoin-cli -testnet getblockchaininfo
```

**UTXO consolidation needed (P2):**
List small UTXOs:
```bash
bitcoin-cli listunspent 1 9999999
```
Create consolidation tx:
```bash
bitcoin-cli createrawtransaction '[{"txid":"...","vout":0}]' '{"bc1q...":0.999}'
```
Sign and send:
```bash
bitcoin-cli signrawtransactionwithwallet <hex>
bitcoin-cli sendrawtransaction <hex>
```

### 4. Verify

After fix:
```bash
bitcoin-cli getblockchaininfo
bitcoin-cli getwalletinfo
```

### 5. Report

```
Fixed: [P0] Wallet not encrypted

Updated: bitcoin.conf
- Added wallet encryption requirement
- Added backup path

Verified: bitcoin-cli getwalletinfo → encrypted

Next highest priority: [P0] Node not synced
Run /fix-bitcoin again to continue.
```

## Branching

Before making changes:
```bash
git checkout -b fix/bitcoin-$(date +%Y%m%d)
```

## Single-Issue Focus

Bitcoin ops are high risk. Fix one thing at a time:
- Test each change thoroughly
- Easy to roll back specific fixes
- Clear audit trail for keys and funds

Run `/fix-bitcoin` repeatedly to work through the backlog.

## Related

- `/check-bitcoin` - The primitive (audit only)
- `/log-bitcoin-issues` - Create issues without fixing
- `/bitcoin` - Full Bitcoin lifecycle
- `/bitcoin-health` - Node diagnostics

Overview

This skill runs a Bitcoin audit via /check-bitcoin, then fixes the single highest-priority issue found. It performs one safe, auditable change per invocation, verifies the result, and reports the outcome. Invoke repeatedly to address subsequent issues in priority order.

How this skill works

The skill calls /check-bitcoin to gather prioritized findings, selects the top-priority item, and applies a targeted remediation for that issue only. Remediations include syncing the node, encrypting and backing up wallets, separating testnet/mainnet configurations, or consolidating UTXOs. After applying the change it runs verification commands and returns a concise report of actions and next steps.

When to use it

  • You need an automated, conservative fixer for a single highest-priority Bitcoin operational issue.
  • You want one safe, auditable change per run to limit blast radius on Bitcoin ops.
  • You prefer repeated invocations to work through a backlog rather than applying multiple fixes at once.
  • When you already run /check-bitcoin and want the skill to remediate the top finding.
  • When you need a repeatable workflow for incremental hardening and maintenance.

Best practices

  • Run /check-bitcoin first so fixes are based on current findings.
  • Use strong, unique passphrases when encrypting wallets and securely store backups offline.
  • Create a feature branch before editing configs (git checkout -b fix/bitcoin-YYYYMMDD) to preserve an audit trail.
  • Test each fix on a non-production node or with a testnet instance when possible.
  • Invoke the skill repeatedly to address issues one at a time and verify between runs.

Example use cases

  • Encrypt an unencrypted wallet and back it up after the audit flags wallet encryption missing.
  • Restart a node or wait for synchronization when the node is behind the network.
  • Split testnet and mainnet configuration when audit shows environment mixing or ambiguous flags.
  • Consolidate many small UTXOs into fewer outputs to reduce future fee overhead.
  • Address a single advanced configuration item flagged as lower priority in a controlled manner.

FAQ

What does the skill fix in one run?

It fixes only the highest-priority issue reported by /check-bitcoin, then verifies and reports the change.

How do I continue fixing other issues?

Invoke /fix-bitcoin again; each invocation handles the next highest-priority issue.