hashgraph-online/awesome-codex-plugins / plugins/aklofas/kicad-happy/skills/kicad
kicad
VerifiedAnalyze KiCad projects and PDF schematics: schematics, PCB layouts, Gerbers, footprints, symbols, netlists, and design rules. Reviews designs for bugs, traces nets, cross-references schematic to PCB, extracts BOM data, checks DRC/ERC, DFM, power trees, and regulator circuits. Every finding carries a confidence label and evidence source with trust_summary rollup. Analyzes PDF schematics from dev boards, reference designs, eval kits, and datasheets. Supports KiCad 5–10. Use whenever the user mentions .kicad_sch, .kicad_pcb, .kicad_pro, PCB design review, schematic analysis, PDF schematics, reference designs, Gerber files, DRC/ERC, netlist issues, BOM extraction, signal tracing, power budget, DFM, or wants to understand, debug, compare, or review any hardware design. Also for "check my board", "review before fab", "what's wrong with my schematic", "is this ready to order", "check my power supply", "verify this circuit", OSHWA certification readiness, or any electronics/PCB design question.
scripts/kicad_core/token_cache.py
View on GitHub"""Private per-user cache for short-lived API access tokens.
A token is trusted only when its file is a regular file this user owns that
nobody else can read, so another local user cannot plant or read a token.
"""
import json
import os
import stat
import sys
import tempfile
import time
def cache_dir():
"""Per-user cache folder, created with mode 0700 when missing."""
if sys.platform == "win32":
base = os.environ.get("LOCALAPPDATA") or os.path.join(
os.path.expanduser("~"), "AppData", "Local")
else:
base = os.environ.get("XDG_CACHE_HOME") or os.path.join(
os.path.expanduser("~"), ".cache")
path = os.path.join(base, "kicad-happy")
os.makedirs(path, mode=0o700, exist_ok=True)
return path
def load_token(name, client_id):
"""Cached token for `client_id`, or None. Never raises."""
try:
path = os.path.join(cache_dir(), name + ".json")
st = os.lstat(path)
if not stat.S_ISREG(st.st_mode):
return None
if sys.platform != "win32" and (
st.st_uid != os.getuid() or stat.S_IMODE(st.st_mode) & 0o077):
return None
with open(path, encoding="utf-8") as f:
data = json.load(f)
token = data.get("token")
if (data.get("client_id") == client_id and isinstance(token, str) and token
and data.get("expires_at", 0) > time.time()):
return token
except (OSError, ValueError, AttributeError, TypeError, RecursionError):
pass
return None
def store_token(name, client_id, token, ttl_s):
"""Write the token with mode 0600 from creation. Best effort."""
tmp = None
try:
folder = cache_dir()
fd, tmp = tempfile.mkstemp(dir=folder, prefix=f".{name}.", suffix=".tmp")
with os.fdopen(fd, "w", encoding="utf-8", newline="\n") as f:
os.chmod(tmp, 0o600)
json.dump({"client_id": client_id, "token": token,
"expires_at": time.time() + ttl_s}, f)
os.replace(tmp, os.path.join(folder, name + ".json"))
tmp = None
except OSError:
if tmp:
try:
os.unlink(tmp)
except OSError:
pass
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |