From fable5-methodology
Enforces concrete coding conventions for naming, function/file size, error handling, input validation, types, comments, tests, and secrets to apply while writing or editing code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/fable5-methodology:implementation-standardsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Precedence when rules conflict: explicit user instruction > existing codebase convention >
Precedence when rules conflict: explicit user instruction > existing codebase convention > this skill. Before writing anything in an existing project, read 2–3 neighboring files and copy their naming, error style, import order, and test idiom — even where you'd personally choose differently.
overdueInvoices, not invoiceList2. No new
abbreviations the codebase doesn't already use.fetchUser); booleans are predicates (is_expired, hasAccess);
collections are plural.except: pass
and .catch(() => {}) are forbidden."failed to load config {path}: {err} — run 'app init' to create one".defer, finally, RAII) —
never duplicated manual cleanup on both branches.any, as unknown as, bare interface{}, unsafe) without a comment
naming the forcing constraint.# increment counter).// TODO(shaun): remove after v2 migration.# shortcut: global lock — per-account locks if throughput matters.toBeDefined() / not.toThrow() as
the only assertion is not a test.test_expired_token_returns_401, not test_auth_2.MAX_RETRIES = 3); don't
name obvious arithmetic.The diff contains the requested change and nothing else. No drive-by refactors, renames, or reformatting of untouched lines — note improvement opportunities in your report instead of doing them. Debug prints are removed before delivery.
Task: read a JSON config and return the port.
Weak:
def get_port(f):
try:
return json.load(open(f))["port"]
except:
return 8080
(Leaked file handle; bare except hides typos AND missing file identically; silent default
masks misconfiguration; f says nothing.)
Standard:
DEFAULT_PORT = 8080
def load_port(config_path: Path) -> int:
try:
with config_path.open() as fh:
config = json.load(fh)
except FileNotFoundError:
return DEFAULT_PORT # absent config is expected; malformed config is not
except json.JSONDecodeError as err:
raise ConfigError(f"invalid JSON in {config_path}: {err}") from err
port = config.get("port", DEFAULT_PORT)
if not isinstance(port, int) or not (0 < port < 65536):
raise ConfigError(f"port must be 1-65535, got {port!r} in {config_path}")
return port
The code follows the file's local conventions; every fallible call has an explicit failure story; boundaries validate and interiors trust; each new behavior has a concrete-assertion test; no escape hatches, secrets, dead code, debug prints, or drive-by changes remain in the diff. Then move to verification.
npx claudepluginhub unpaidattention/fable5-methodology --plugin fable5-methodologyApplies Clean Code principles (naming, functions, comments, error handling, tests) when writing, reviewing, or refactoring code for maintainability and readability.
Enforces pragmatic clean coding standards: concise, direct, no over-engineering, no unnecessary comments. Guides code structure, naming, and anti-patterns.
Define and enforce coding standards that reduce cognitive load, prevent bugs, and make code maintainable. Use when establishing style guides or linting rules.