skills/galahad/SKILL.md
How to approach tests, types, lints, and coverage
npx skillsauth add ad-sdl/madsci galahadInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Based on Jonathan Lange's "The Galahad Principle": https://jml.io/galahad-principle/
Core idea: getting to 100% yields disproportionate value—especially simplicity and trust. When checks are truly "all green", any new failure is a strong, unambiguous signal; "absence of evidence becomes evidence of absence".
Before enforcing these rules strictly, understand the context:
tsconfig.json, pyproject.toml, .eslintrc, setup.cfg, mypy.ini for existing standardsany types, don't block progress on fixing all of themWhen working in a codebase that doesn't meet these standards:
TypeScript: Check tsconfig.json for strict, noImplicitAny, strictNullChecks. Match existing settings.
Python: Check for mypy.ini, pyproject.toml [tool.mypy], pyrightconfig.json. Note the strictness level.
General: Look at existing test files for patterns, existing code for style. When in doubt, match what's there.
Treat type errors, test failures, pre-commit hooks, lint errors, and coverage warnings as helpful feedback. Fix root causes.
any, sketchy unknown laundering, unchecked casts, as any, @ts-ignore, disabling strict mode, weakening compiler flags# type: ignore, # pyright: ignore, # mypy: ignore-errors, cast() without justification, Any in public APIs, disabling type checkersnoqa, pragma comments to silence legitimate warnings/* istanbul ignore */, /* c8 ignore */, artificial exclusions in config# pragma: no cover, # coverage: skip, excluding entire modules from coverage configIf the user explicitly asks for a type escape, to skip tests, or similar:
any here—this will need cleanup before the type system can catch errors in this area."The user owns the codebase. Your job is to inform, not obstruct.
Type safety is part of correctness and outranks tests.
When tradeoffs exist, prioritize in this order:
Breaking changes are acceptable when they improve verifiability and simplify the system, but:
Goal: a repo where "all green" is normal, and any new red is a loud, trustworthy signal.
✅ Meaningful tests:
❌ Not meaningful:
The test: "If this test failed, would I learn something useful about a real bug?"
Coverage comes from exercising real behavior, not from exclusion comments.
If a test is genuinely flaky:
If something is hard to test or hard to type, treat it as a design smell.
Refactor towards:
Record<string, any>dict[str, Any]Avoid injecting mocks via monkeypatching or replacing system utilities by default.
Preferred approach:
Examples:
TypeScript:
// ❌ Bad: hard-coded dependency, requires monkeypatching to test
function processOrder(orderId: string) {
const now = new Date();
const order = database.getOrder(orderId);
// ...
}
// ✅ Good: explicit dependencies
function processOrder(
orderId: string,
deps: { getTime: () => Date; getOrder: (id: string) => Order }
) {
const now = deps.getTime();
const order = deps.getOrder(orderId);
// ...
}
Python:
# ❌ Bad: hard-coded dependency, requires monkeypatching to test
def process_order(order_id: str) -> OrderResult:
now = datetime.now()
order = database.get_order(order_id)
# ...
# ✅ Good: explicit dependencies
def process_order(
order_id: str,
*,
get_time: Callable[[], datetime] = datetime.now,
get_order: Callable[[str], Order] = database.get_order,
) -> OrderResult:
now = get_time()
order = get_order(order_id)
# ...
development
Implement code quality ratchets to prevent proliferation of deprecated patterns. Use when (1) migrating away from legacy code patterns, (2) enforcing gradual codebase improvements, (3) preventing copy-paste proliferation of deprecated practices, or (4) setting up pre-commit hooks to count and limit specific code patterns. A ratchet fails if pattern count exceeds OR falls below expected—ensuring patterns never increase and prompting updates when they decrease.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.