Command Palette

Search for a command to run...

Back to skills
skill № 43674

qa-scripts

The qa.py state tool, copied out by the install command in qa-setup. Never read or retype it.

FreeNo executable scripts
brokepby brokep★ 48 GitHub stars

Install qa-scripts in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

qa-scripts

Part of the Startup QA Bot agent preset.

qa-scripts

The qa.py state tool. The install command in qa-setup copies it out by its marker, so never read or retype it. Commands: init, status, set, password, browser (start, open, errors, stop my own Chrome), walk, surface, surfaces, check, find, decide, fixed, sent, rundown, shot, export. Each prints one JSON line.

#!/usr/bin/env python3
# STARTUP_QA_TOOLS_V1: Startup QA Bot state. The surface map, daily walks, findings, rundowns, and the test
# account. Every command prints one JSON line.
import csv
import datetime
import json
import os
import re
import secrets
import shutil
import signal
import string
import subprocess
import sys
import time

# Everything lives beside this file, so a second Startup QA Bot on a shared computer can use its own folder.
HOME = os.environ.get("QA_HOME") or os.path.dirname(os.path.abspath(__file__))
RUNS = os.environ.get("QA_RUNS") or os.path.join(HOME, "runs")
STATE = os.path.join(HOME, "state.json")
PASSWORD = os.path.join(HOME, "password")
# The bot's own Chrome profile. The browser tools share cookies and saved logins with the user's other bots.
PROFILE = os.path.join(HOME, "browser")
# A computer update restores /workspace but not /tmp, so the regenerable disk cache stays out of the synced folder.
CACHE = os.path.join("/tmp", "startup-qa-cache-" + re.sub(r"[^a-z0-9]+", "-", HOME.lower()).strip("-"))
PLATFORM_PROFILE = os.environ.get("QA_PLATFORM_PROFILE", "/home/box/chrome-profile")
BROWSERS = ("google-chrome", "google-chrome-stable", "chromium", "chromium-browser")
BROWSER_PATHS = ("/opt/google/chrome/chrome", "/usr/lib/chromium/chromium", "/usr/lib/chromium-browser/chromium-browser")
BROWSER_WAIT = float(os.environ.get("QA_BROWSER_WAIT", "6"))
X11_DIR = os.environ.get("QA_X11_DIR", "/tmp/.X11-unix")
CONSOLE_RE = re.compile(r'INFO:CONSOLE[^\]]*\] "(.*)", source: (\S*)')
ERROR_RE = re.compile(r"(?i)uncaught|error|exception|failed|refused|denied|status of [45]\d\d")
DAYS = ("weekdays", "daily", "weekly", "manual")
CHANGES = ("github", "linear", "changelog", "none")
KINDS = ("shipped", "unshipped", "broke", "decision")
INBOXES = ("agentmail", "other")
DEFAULTS = {
    "product": "",
    "product_url": "",
    "email": "",
    "inbox": "",
    "account": "",
    "changes": [],
    "changelog": "",
    "triage": "",
    "days": "weekdays",
    "routine": False,
    "setup": False,
}


def now():
    return datetime.datetime.now(datetime.timezone.utc).replace(microsecond=0).isoformat()


def today():
    return datetime.date.today().isoformat()


def stamp():
    return datetime.date.today().strftime("%Y%m%d")


def emit(**data):
    print(json.dumps(data, ensure_ascii=False))


def die(message):
    emit(error=message)
    sys.exit(1)


def opts_of(args):
    opts, i = {}, 0
    while i < len(args):
        if args[i].startswith("--"):
            key = args[i][2:]
            if i + 1 < len(args) and not args[i + 1].startswith("--"):
                opts[key] = args[i + 1]
                i += 1
            else:
                opts[key] = True
        i += 1
    return opts


def load():
    if not os.path.exists(STATE):
        die("no state yet, run: qa.py init")
    with open(STATE, encoding="utf-8") as f:
        s = json.load(f)
    for k, v in DEFAULTS.items():
        s["settings"].setdefault(k, v)
    for k, v in (("surfaces", {}), ("findings", {}), ("runs", []), ("walk", None), ("next_id", 0)):
        s.setdefault(k, v)
    return s


def save(s):
    tmp = STATE + ".tmp"
    with open(tmp, "w", encoding="utf-8") as f:
        json.dump(s, f, indent=1, ensure_ascii=False)
    os.replace(tmp, STATE)


def slug(text):
    s = re.sub(r"[^a-z0-9]+", "-", (text or "").lower()).strip("-")
    return s[:40].strip("-") or "item"


def cmd_init(a):
    os.makedirs(HOME, exist_ok=True)
    new = not os.path.exists(STATE)
    if new:
        save({"version": 3, "settings": dict(DEFAULTS), "surfaces": {}, "findings": {}, "runs": [], "walk": None, "next_id": 0})
    emit(ok=True, new=new, home=HOME)


def cmd_status(a):
    s = load()
    st = s["settings"]
    open_f = [f for f in s["findings"].values() if f["status"] in ("open", "sent")]
    emit(
        setup=st["setup"],
        routine=st["routine"],
        settings={k: v for k, v in st.items() if k not in ("setup", "routine")},
        password_saved=os.path.exists(PASSWORD),
        surfaces=len(s["surfaces"]),
        open_bugs=sum(f["kind"] == "broke" for f in open_f),
        open_decisions=sum(f["kind"] == "decision" for f in open_f),
        walk_open=bool(s["walk"]),
        last_walk=s["runs"][-1]["date"] if s["runs"] else "",
    )


def cmd_set(a):
    if len(a) < 2:
        die("usage: qa.py set <key> <value>")
    s = load()
    key, val = a[0], " ".join(a[1:]).strip()
    st = s["settings"]
    if key in ("routine", "setup"):
        st[key] = val.lower() in ("on", "yes", "true", "done")
    elif key in ("product_url", "changelog") a
Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the qa-scripts skill do?

The qa.py state tool, copied out by the install command in qa-setup. Never read or retype it.

How do I install the qa-scripts skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the qa-scripts skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare qa-scripts with