pack-implementer-self-check
Skill166 starsChanged 6 days agoApache-2.0View on GitHub
Load before the first review of code that opens files, runs subprocesses, parses input, holds locks or writes output: twelve-class defect checklist, remove-surface rule, revert proof. Not for docs-only changes.
In this repository63 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- templates/copilot-instructions.mdCopilot instructions
- pack-ad-disclosureSkill
- pack-asset-productionSkill
- pack-audience-data-privacySkill
- pack-awsSkill
- pack-clip-deskSkill
- pack-copy-reviewSkill
- pack-cyber-tier-reviewSkill
- pack-delivery-business-mgmtSkill
- pack-digitaloceanSkill
- pack-front-doorSkill
- pack-gha-security-dastSkill
- pack-grc-controlsSkill
- pack-implementer-self-checkSkill
- pack-linux-platformSkill
- pack-local-llm-routingSkill
- pack-marketing-grcSkill
- pack-media-dispatchSkill
- pack-media-kit-claimsSkill
- pack-opentofu-spaceliftSkill
- pack-org-dispatchSkill
- pack-org-operating-modelSkill
- pack-platform-data-termsSkill
- pack-python-untrusted-inputSkill
- pack-review-protocolSkill
- pack-rf-emcommSkill
- pack-safe-liveSkill
- pack-stage-crewSkill
- pack-threat-detectionSkill
- pack-threat-modelSkill
- pack-twingate-dopplerSkill
- pack-web-qualitySkill
- pack-ad-disclosureSkill
- pack-asset-productionSkill
- pack-audience-data-privacySkill
- pack-awsSkill
- pack-clip-deskSkill
- pack-copy-reviewSkill
- pack-cyber-tier-reviewSkill
- pack-delivery-business-mgmtSkill
- pack-digitaloceanSkill
- pack-front-doorSkill
- pack-gha-security-dastSkill
- pack-grc-controlsSkill
- pack-linux-platformSkill
- pack-local-llm-routingSkill
- pack-marketing-grcSkill
- pack-media-dispatchSkill
- pack-media-kit-claimsSkill
- pack-opentofu-spaceliftSkill
- pack-org-dispatchSkill
- pack-org-operating-modelSkill
- pack-platform-data-termsSkill
- pack-python-untrusted-inputSkill
- pack-review-protocolSkill
- pack-rf-emcommSkill
- pack-safe-liveSkill
- pack-stage-crewSkill
- pack-threat-detectionSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Fail closed: Every exception, missing file, unset variable, timeout, empty list and parse error ends in refusal.
- Distinctive: line 19
Prove success by the protected action,: not by the step before it.
- Distinctive: line 46
Run the targeted checks and record the revert proof per new guard.
- Distinctive: line 47
Remove-surface pass (rule 1): list new validation branches and what removing the feature would delete.
- Very specific: line 48
Put one line in the report: self-check: ids passed, ids not applicable, ids with known residuals.
- Distinctive: line 70
Never weaken a check, add a skip or loosen a test to pass.
- Distinctive: line 72
Delete only files you created, by exact path.
- Very specific: line 76
All twelve ids are present once each: grep -cE '^\| (F1|S1|O1|L1|P1|B1|E1|K1|T1|D1|G1|X1) \|' packs/implementer-self-check/PACK.md returns …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- Generated by scripts/generate.py (release 0.4.0) from packs/implementer-self-check/PACK.md, updated 2026-11-25. sha256:977c599fa572d9fbcda72ae43d478217e1a125326af9829e088fd5c601e50e86. Do not edit; run the generator. -->Pack: implementer self-check
Status: pilot pack, written 2026-11-25 (issue #124). Counts below come from 103 review findings over 9 changes (22 rounds), tagged by keyword, so they are coarse and a finding can carry several classes. The claim that a self-check lowers review rounds is a prediction until measured.
The author runs the same sweep the reviewer will run, before the first review, and fixes what it finds, so round one finds the residue. The ids are stable: the round-one prompt in review-protocol names these twelve classes by id. Run targeted checks only; CI is the judge of the full gate.
Rules
- Prefer removing surface over adding guards. Before adding a validation, ask whether the input, option, file format or feature can go. A guard you do not write cannot be bypassed or attacked in the next round. List every new validation branch and say whether removing a feature would delete it. Removal never drops a mandatory check, evidence, documented behavior or security property; if it would, keep it.
- Fail closed. Every exception, missing file, unset variable, timeout, empty list and parse error ends in refusal.
- One reader per input. Parse once into a typed value and pass the value.
- Prove success by the protected action, not by the step before it.
- Revert proof is required. Every fix and every new guard ships with a test that goes red when the fix is reverted. Revert it, run the test, record the red output, restore the exact bytes, run it green, and confirm the tree is as you left it. Without that, the guard is a claim.
- Docs state only what the code does today.
Checklist
Each row: id, class, concrete checks, then the recurring findings that motivated it (class, findings, changes out of 9).
| Id | Class | Checks |
| F1 | Files and paths | Open each path component with no-follow (directory descriptors, openat style) and verify the opened descriptor with fstat, never the path; a resolve-then-open check is racy, so confine on the descriptor; refuse FIFOs, devices and non-regular files; create with an explicit mode (0600 for secrets); mkstemp in a private directory. Recurring: unsafe file open, 20 findings in 7 changes; check-then-use race, 3 in 3. |
| S1 | Subprocess and environment | argv list, never a shell string; resolved binary; allow-list environment, not copy-and-delete; -- before untrusted arguments; bounded timeout and output; stdin closed; read the exit code, not text; explicit working directory. Recurring: subprocess and environment hygiene, 26 in 6. |
| O1 | Fail-closed versus fail-open | Walk every branch: lookup failure, parse error, missing input, exception. The default is deny; a skipped check reports skipped, never pass. Recurring: fail-open or silent success, 21 in 8. |
| L1 | Locks and ordering | Lock before read-modify-write; release on every path; stale-lock recovery only after checking the owner (a recorded pid or lease) is dead, never by age alone; atomic write by temp file and rename on one filesystem; no state recorded before the action it describes succeeded; signal and timer handlers cannot leave half-written state. Recurring: atomic write and ordering, 13 in 6; locking, 9 in 4; signal and timer, 10 in 4. |
| P1 | Parsing and normalization | One parser; normalize before comparing, per identifier kind and per filesystem (case, Unicode, trailing dots and separators are not universal; a folded compare can merge distinct names); duplicate keys, empty and oversized values, NUL bytes, line endings; reject unknown fields; a validator is tested with an input it must reject. Recurring: parsing and normalization, 24 in 9 (the most common class); validator false negatives, 18 in 8. |
| B1 | Bounds and timeouts | Size cap before read; depth and count caps; a timeout on every network and subprocess call; bounded retries and pagination; never replay a non-idempotent call after an ambiguous outcome; check arithmetic at zero, negative and huge values. Recurring: resource bounds and timeouts, 25 in 7; logic and state correctness, 18 in 5. |
| E1 | Output escaping | Escape each sink for its own grammar (shell, Markdown, HTML, workflow commands, a log line, JSON); untrusted text never reaches a command, summary or log un-neutralized; strip control characters and newlines from logged values. Recurring: output escaping, 6 in 3. |
| K1 | Secrets handling | Environment or secret manager, never argv, repository or fixtures; never in errors, logs, reports or artifacts; redact before writing, not after; least-scope tokens. Recurring: confidentiality and secrets, 12 in 5. |
| T1 | Tests that bite | A negative case; loose collection, strict assertion; assert that something was collected; test the failing input, not the already-correct form; never mock the thing under test; revert proof per rule 5. Recurring: weak or vacuous test items, 122 across 8 of 9 changes. |
| D1 | Docs accuracy | Check every claim in the README, help text and comments against current behavior: flags, defaults, exit codes, file modes. Recurring: doc accuracy, 5 in 3. |
| G1 | GitHub automation | Actions pinned by commit; least-privilege permissions:; no untrusted ${{ }} in run:; no pull_request_target checkout of the PR; token scope; branch-protection assumptions (depth in gha-security-dast). Recurring: from the design review, no tagged count. |
| X1 | Trust boundaries | Re-check credentials, approvals and verified bytes after crossing a host, scheme, job, process or branch; every entry point to one action is guarded, including its siblings. Recurring: from the design review, no tagged count; the reviewer's boundary classes found it. |
Procedure
- List the changed files and, per file, the ids that apply. Say N/A with a reason; do not skip silently.
- For each applicable id, answer CLEAR with
file:line, or fix it. - Run the targeted checks and record the revert proof per new guard.
- Remove-surface pass (rule 1): list new validation branches and what removing the feature would delete.
- Put one line in the report:
self-check: ids passed, ids not applicable, ids with known residuals. For exampleself-check: F1 S1 O1 T1 passed; L1 E1 K1 D1 G1 X1 not applicable (no locks, output or secrets touched); P1 B1 known residual (B1: no timeout on the local socket read, issue linked).
An id with a known residual gets its own line with severity and reason, so the reviewer can see it was known, not missed.
Shared helper patterns (reference text)
These are names and contracts only. The shared code is a later task in the maintainer's tooling repository; this pack holds no code. Until it exists, write the behavior inline and keep it small.
safe_open(root, relpath, mode): descriptor-relative traversal from the root descriptor, component by component with no-follow, then fstat the opened descriptor (regular file only, size cap); never a path check followed by an open.atomic_write(path, data, mode=0o600): temp file in the same directory, fsync, rename, clean up on error.locked(path, timeout): advisory lock with a bounded wait, released on all paths, with owner liveness checked before any lock is broken.run_cmd(argv, timeout, max_output, env_allow, cwd): no shell, scrubbed environment, bounded output.bounded_read(stream, limit),load_json_strict,load_yaml_strict: size and depth caps, duplicate keys rejected.normalize_path_componentandnormalize_text: normalization chosen per identifier kind and per filesystem (for example NFKC plus case fold only where the names are case-insensitive), for comparison only.redact(text, patterns): applied at the write boundary.gh_api(...): REST only, timeout, bounded pagination, no redirect credential carry, no replay of a non-idempotent call.fail_closed(fn, default=DENY): for hooks, so an exception denies.- Shell equivalents in a sourced
lib.sh:die,require_cmd,mktemp_private,run_timeout.
Limits
- This is a checklist for the author. It does not replace the independent review, and a clean self-check is not a clean review.
- Never weaken a check, add a skip or loosen a test to pass. If the only route to green is such a change, stop and report it.
- Load the checklist only for code that touches these surfaces; docs-only changes need rule 6 and id D1 alone.
- Delete only files you created, by exact path.
How to verify (commands)
- All twelve ids are present once each:
grep -cE '^\| (F1|S1|O1|L1|P1|B1|E1|K1|T1|D1|G1|X1) \|' packs/implementer-self-check/PACK.mdreturns 12. - The report carries the line:
grep -c '^self-check:' report.mdreturns 1. - Revert proof: revert the fix, run the new test and see it fail, restore, run it green, then
git status --porcelainshows only your intended files. - Shell and subprocess sweep on the diff:
git diff -U0 | grep -nP 'shell=True|os\.system|subprocess\.[a-z_]+\((?!.*timeout)'needs a reason for each hit. - Surface counts: lines and branches added versus removed,
git diff --shortstat.
Deliverable
- The
self-check:line and the ids with known residuals. - Per new guard: the test name, the red output with the fix reverted, the green output restored.
- The remove-surface list: what was removed and what stayed, with the reason.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

