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 ensure continued operation.

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.7 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.
effort: high
---

# /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 automates fixing the highest priority Bitcoin operational issue found by a prior audit. It runs a diagnostic, applies one safe fix per invocation, verifies the change, and reports the result so you can run it again for the next item. Use it when you want incremental, auditable remediation rather than sweeping automated changes.

How this skill works

The skill invokes a diagnostic primitive to collect prioritized findings, selects the top-priority issue, executes a single targeted fix, and runs verification commands to confirm the outcome. It updates configuration or wallet state as needed, commits the remediation context (branch guidance), and returns a concise report of actions and the next priority. Repeat the skill to progress through the backlog one issue at a time.

When to use it

  • You have a fresh /check-bitcoin audit and want the top issue fixed immediately.
  • You need conservative, single-change remediation to minimize risk around keys and funds.
  • You want stepwise fixes with verification and clear reporting for audits.
  • You manage multiple Bitcoin environments and need an auditable fix trail.
  • You prefer one atomic change per run to simplify rollback and review.

Best practices

  • Run /check-bitcoin first to obtain prioritized findings before invoking the fixer.
  • Apply one invocation per issue—do not batch fixes; this reduces risk and simplifies rollbacks.
  • Use strong, unique passphrases when encrypting wallets and store backups off-host.
  • Create a feature branch for each fix (git checkout -b fix/bitcoin-YYYYMMDD) to keep change history clean.
  • Verify changes with bitcoin-cli getblockchaininfo and getwalletinfo after each fix.

Example use cases

  • Node not synced: restart or wait and confirm sync status with getblockchaininfo (P0).
  • Wallet not encrypted: run encryptwallet, back up the wallet file, and verify encryption (P0).
  • Missing testnet/mainnet separation: split configs and use explicit -testnet flags for tooling (P1).
  • UTXO consolidation: create, sign, and broadcast a consolidation transaction for many small outputs (P2).
  • Progressively work through backlog by invoking the skill repeatedly until no prioritized issues remain.

FAQ

Will this skill fix multiple issues at once?

No. It deliberately fixes exactly one highest-priority issue per run to limit risk and make changes auditable.

How do I continue after a fix is applied?

Run the skill again; it will re-run the audit and address the next highest-priority issue.