Skip to content

CowboyLogic/ai-dev / skills/client-config-claudecode

client-config-claudecode

Flagged

Manage and maintain Claude Code configuration files and settings. Use this skill whenever the user wants to view, edit, add, remove, or understand any Claude Code settings — permissions, hooks, MCP servers, environment variables, model settings, sandbox, auto mode, or any other configuration field. Trigger on: "add permission", "allow tool", "deny tool", "configure hook", "add MCP server", "change model", "update settings", "show my settings", "what settings do I have", or "set default mode".

FileKindSize
CHANGELOG.mdmarkdown18.3 KB
README.mdmarkdown3.2 KB
SKILL.mdskill md8.5 KB
assets/sources.jsonconfig3.2 KB
evals/evals.jsonconfig10.2 KB
references/hooks.mdmarkdown28.0 KB
references/mcp.mdmarkdown16.1 KB
references/permissions.mdmarkdown21.6 KB
references/settings-schema.mdmarkdown39.2 KB
scripts/show-settings.pyscript8.6 KB
scripts/update-references.pyscript5.4 KB
scripts/validate-settings.pyscript35.9 KB

scripts/update-references.py

View on GitHub
#!/usr/bin/env python3
"""
update-references.py — Fetch latest Claude Code docs and save raw content
for Claude to use when refreshing the skill's reference files.

Usage:
    python update-references.py [--ref references/permissions.md] [--all]

This script fetches the upstream docs and saves them to a _fetched/ staging
directory. Claude then reads the fetched content and rewrites the reference
files to reflect any changes in the official documentation.

Workflow (for Claude):
    1. Run this script to fetch raw docs → saved to _fetched/
    2. For each fetched file, compare against the current reference file
    3. Update reference files to reflect new fields, removed fields, or changed behavior
    4. Sync scripts/validate-settings.py key lists, then run it on a sample file
    5. Remove _fetched/ directory when done
"""
import json
import sys
import urllib.request
import urllib.error
from pathlib import Path

SKILL_ROOT = Path(__file__).parent.parent
SOURCES_FILE = SKILL_ROOT / "assets" / "sources.json"
FETCHED_DIR = SKILL_ROOT / "_fetched"

HEADERS = {
    "User-Agent": "Mozilla/5.0 (compatible; claude-skill-updater/1.0)",
    "Accept": "text/html,text/markdown,text/plain,*/*",
}

def fetch_url(url: str) -> str:
    req = urllib.request.Request(url, headers=HEADERS)
    try:
        with urllib.request.urlopen(req, timeout=30) as resp:
            content = resp.read()
            charset = "utf-8"
            ct = resp.headers.get("Content-Type", "")
            if "charset=" in ct:
                charset = ct.split("charset=")[-1].split(";")[0].strip()
            return content.decode(charset, errors="replace")
    except urllib.error.HTTPError as e:
        raise RuntimeError(f"HTTP {e.code} fetching {url}: {e.reason}")
    except urllib.error.URLError as e:
        raise RuntimeError(f"Network error fetching {url}: {e.reason}")

def fetched_name(ref_path: str, url: str, primary: bool) -> str:
    # Primary:    "references/hooks.md" -> "hooks.md"
    # Additional: "references/permissions.md" + ".../permission-modes.md" -> "permissions--permission-modes.md"
    name = Path(ref_path).name
    if primary:
        return name
    return f"{Path(ref_path).stem}--{url.rstrip('/').rsplit('/', 1)[-1]}"

def save_fetched(ref_path: str, content: str, url: str, primary: bool = True) -> Path:
    out_path = FETCHED_DIR / fetched_name(ref_path, url, primary)
    FETCHED_DIR.mkdir(exist_ok=True)
    with open(out_path, "w", encoding="utf-8") as f:
        f.write(f"<!-- SOURCE: {url} -->\n")
        f.write(f"<!-- FETCHED: {__import__('datetime').datetime.now(__import__('datetime').timezone.utc).isoformat()} -->\n\n")
        f.write(content)
    return out_path

def main():
    if not SOURCES_FILE.exists():
        print(f"ERROR: assets/sources.json not found at {SOURCES_FILE}")
        return 1

    with open(SOURCES_FILE) as f:
        sources = json.load(f)

    refs = sources.get("references", {})

    args = sys.argv[1:]
    target = None
    if "--ref" in args:
        idx = args.index("--ref")
        if idx + 1 >= len(args):
            print("ERROR: --ref requires a reference path")
            return 2
        target = args[idx + 1]
        del args[idx:idx + 2]
    if any(arg != "--all" for arg in args):
        print("ERROR: usage: python scripts/update-references.py [--ref references/file.md] [--all]")
        return 2
    if target and target not in refs:
        print(f"ERROR: unknown reference: {target}")
        return 2

    results = []
    for ref_path, meta in refs.items():
        if target and ref_path != target:
            continue

        covers = meta.get("covers", "")
        print(f"\nFetching: {ref_path}")
        print(f"  Covers: {covers[:80]}...")

        urls = [(meta["url"], True)] + [(u, False) for u in meta.get("additional_urls", [])]
        for url, primary in urls:
            print(f"  URL: {url}")
            try:
                content = fetch_url(url)
                out_path = save_fetched(ref_path, content, url, primary)
                size = len(content)
                print(f"    Saved {size:,} chars -> {out_path.relative_to(SKILL_ROOT)}")
                results.append({"ref": ref_path, "fetched": str(out_path), "url": url, "ok": True})
            except RuntimeError as e:
                print(f"    FAILED: {e}")
                stale_path = FETCHED_DIR / fetched_name(ref_path, url, primary)
                if stale_path.exists():
                    stale_path.unlink()
                results.append({"ref": ref_path, "url": url, "ok": False, "error": str(e)})

    success = sum(1 for r in results if r["ok"])
    failed = len(results) - success

    print(f"\n{'='*50}")
    print(f"Fetched {success}/{len(results)} source URLs")
    if failed:
        print(f"  {failed} failed — check network/URL changes")
    if success and not failed:
        print(f"\nNext steps for Claude:")
        print(f"  1. Read each file in _fetched/")
        print(f"  2. Read the corresponding file in references/")
        print(f"  3. Update references/ to reflect documentation changes")
        print(f"  4. Sync scripts/validate-settings.py known keys/events, then run it on a sample file")
        print(f"  5. Remove _fetched/ when complete")
        print(f"\nFetched files:")
        for r in results:
            if r["ok"]:
                print(f"  {r['fetched']}")
    return 1 if failed else 0

if __name__ == "__main__":
    sys.exit(main())
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 321kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 321kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 321kUpdated Claude CodeCodexVerifiedInstall