claude-in-codex 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. claude_in_codex-0.6.0/.agents/plugins/marketplace.json +20 -0
  2. claude_in_codex-0.6.0/.agents/skills/agent-friendly-github/SKILL.md +102 -0
  3. claude_in_codex-0.6.0/.agents/skills/agent-friendly-github/references/audit-workflow.md +130 -0
  4. claude_in_codex-0.6.0/.agents/skills/agent-friendly-github/references/config-checklist.md +107 -0
  5. claude_in_codex-0.6.0/.agents/skills/agent-friendly-github/references/examples.md +778 -0
  6. claude_in_codex-0.6.0/.agents/skills/agent-friendly-github/references/operating-playbook.md +32 -0
  7. claude_in_codex-0.6.0/.agents/skills/agent-friendly-github/references/setup-workflow.md +214 -0
  8. claude_in_codex-0.6.0/.agents/skills/agent-friendly-github/references/threat-model.md +107 -0
  9. claude_in_codex-0.6.0/.agents/skills/agent-friendly-mcp/SKILL.md +117 -0
  10. claude_in_codex-0.6.0/.agents/skills/agent-friendly-mcp/references/contract-checklist.md +383 -0
  11. claude_in_codex-0.6.0/.agents/skills/agent-friendly-mcp/references/design-workflow.md +166 -0
  12. claude_in_codex-0.6.0/.agents/skills/agent-friendly-mcp/references/examples.md +992 -0
  13. claude_in_codex-0.6.0/.agents/skills/agent-friendly-mcp/references/mcp-vs-cli.md +68 -0
  14. claude_in_codex-0.6.0/.agents/skills/agent-friendly-mcp/references/review-workflow.md +88 -0
  15. claude_in_codex-0.6.0/.codex-plugin/plugin.json +24 -0
  16. claude_in_codex-0.6.0/.gitattributes +4 -0
  17. claude_in_codex-0.6.0/.github/dependabot.yml +11 -0
  18. claude_in_codex-0.6.0/.github/workflows/ci.yml +120 -0
  19. claude_in_codex-0.6.0/.github/workflows/codeql.yml +33 -0
  20. claude_in_codex-0.6.0/.github/workflows/dependency-review.yml +22 -0
  21. claude_in_codex-0.6.0/.github/workflows/publish.yml +177 -0
  22. claude_in_codex-0.6.0/.github/workflows/test.yml +45 -0
  23. claude_in_codex-0.6.0/.gitignore +33 -0
  24. claude_in_codex-0.6.0/.mcp.json +28 -0
  25. claude_in_codex-0.6.0/AGENTS.md +95 -0
  26. claude_in_codex-0.6.0/CHANGELOG.md +141 -0
  27. claude_in_codex-0.6.0/CLAUDE.md +1 -0
  28. claude_in_codex-0.6.0/CODEOWNERS +11 -0
  29. claude_in_codex-0.6.0/COMPATIBILITY.md +118 -0
  30. claude_in_codex-0.6.0/LICENSE +21 -0
  31. claude_in_codex-0.6.0/PKG-INFO +253 -0
  32. claude_in_codex-0.6.0/README.md +224 -0
  33. claude_in_codex-0.6.0/SECURITY.md +30 -0
  34. claude_in_codex-0.6.0/plugins/claude-in-codex/.codex-plugin/plugin.json +24 -0
  35. claude_in_codex-0.6.0/plugins/claude-in-codex/.mcp.json +28 -0
  36. claude_in_codex-0.6.0/plugins/claude-in-codex/skills/collaborating-with-claude/SKILL.md +55 -0
  37. claude_in_codex-0.6.0/prek.toml +69 -0
  38. claude_in_codex-0.6.0/pyproject.toml +100 -0
  39. claude_in_codex-0.6.0/skills/collaborating-with-claude/SKILL.md +55 -0
  40. claude_in_codex-0.6.0/src/claude_in_codex/__init__.py +5 -0
  41. claude_in_codex-0.6.0/src/claude_in_codex/claude.py +381 -0
  42. claude_in_codex-0.6.0/src/claude_in_codex/cli_contract.py +123 -0
  43. claude_in_codex-0.6.0/src/claude_in_codex/config.py +295 -0
  44. claude_in_codex-0.6.0/src/claude_in_codex/context.py +310 -0
  45. claude_in_codex-0.6.0/src/claude_in_codex/jobs.py +603 -0
  46. claude_in_codex-0.6.0/src/claude_in_codex/normalize.py +268 -0
  47. claude_in_codex-0.6.0/src/claude_in_codex/preflight.py +94 -0
  48. claude_in_codex-0.6.0/src/claude_in_codex/py.typed +0 -0
  49. claude_in_codex-0.6.0/src/claude_in_codex/schemas.py +405 -0
  50. claude_in_codex-0.6.0/src/claude_in_codex/server.py +2087 -0
  51. claude_in_codex-0.6.0/tests/conftest.py +75 -0
  52. claude_in_codex-0.6.0/tests/golden/claude_envelope.json +15 -0
  53. claude_in_codex-0.6.0/tests/test_claude.py +529 -0
  54. claude_in_codex-0.6.0/tests/test_cli_contract.py +60 -0
  55. claude_in_codex-0.6.0/tests/test_config.py +184 -0
  56. claude_in_codex-0.6.0/tests/test_context.py +453 -0
  57. claude_in_codex-0.6.0/tests/test_docs_consistency.py +44 -0
  58. claude_in_codex-0.6.0/tests/test_fingerprint.py +65 -0
  59. claude_in_codex-0.6.0/tests/test_golden_envelope.py +36 -0
  60. claude_in_codex-0.6.0/tests/test_integration.py +81 -0
  61. claude_in_codex-0.6.0/tests/test_jobs.py +464 -0
  62. claude_in_codex-0.6.0/tests/test_mcp_config.py +36 -0
  63. claude_in_codex-0.6.0/tests/test_normalize.py +365 -0
  64. claude_in_codex-0.6.0/tests/test_preflight.py +56 -0
  65. claude_in_codex-0.6.0/tests/test_schemas.py +197 -0
  66. claude_in_codex-0.6.0/tests/test_server.py +2318 -0
  67. claude_in_codex-0.6.0/uv.lock +1760 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "claude-in-codex",
3
+ "interface": {
4
+ "displayName": "Claude Code (for Codex)"
5
+ },
6
+ "plugins": [
7
+ {
8
+ "name": "claude-in-codex",
9
+ "source": {
10
+ "source": "local",
11
+ "path": "./plugins/claude-in-codex"
12
+ },
13
+ "policy": {
14
+ "installation": "AVAILABLE",
15
+ "authentication": "ON_USE"
16
+ },
17
+ "category": "Developer Tools"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,102 @@
1
+ ---
2
+ description: Use when configuring a GitHub repository so AI agents can work it safely — tracking issues, opening and managing pull requests — while humans keep confidence in code quality and security. Covers repo configuration (rulesets, branch protection, CODEOWNERS, Actions permissions, identity) and the operating conventions agents follow (branching, commits, PRs, review). Use to set up or harden a repo, audit an existing one, or guide how an agent operates in it. Applies to public and private, monorepo and traditional repos.
3
+ metadata:
4
+ github-path: agent-friendly-github
5
+ github-ref: refs/heads/main
6
+ github-repo: https://github.com/briandconnelly/skills
7
+ github-tree-sha: 723133a2d6bf2560ec0678acc880392b18c2683e
8
+ name: agent-friendly-github
9
+ ---
10
+ # Agent-Friendly GitHub
11
+
12
+ A GitHub repository is the shared workspace where agents and humans collaborate on code.
13
+ Agents can do real work there — filing issues, opening PRs, and landing commits — but only if the repo is configured to make the happy path obvious and the dangerous path hard.
14
+ The central principle: anything safety-critical is enforced by configuration (rulesets, required checks, CODEOWNERS, Actions permissions), never left to agent goodwill.
15
+ Agents err, and they can be prompt-injected; the repo must stay safe regardless.
16
+
17
+ ## Core Standard
18
+
19
+ - Configuration is the enforced contract and conventions are advisory — safety-critical rules live in rulesets, required status checks, and CODEOWNERS, never in agent instructions that can be overridden or bypassed.
20
+ - Optimize for the agent's first correct contribution — discoverable conventions (`AGENTS.md`, `CONTRIBUTING`), issue and PR templates, a canonical label set, and a fast unambiguous green path are all part of the setup.
21
+ - Every agent action is attributable and auditable — agents use a distinct identity, commits are authored with attribution preserved (signing is strongly recommended but opt-in, not required), issues and PRs are cross-linked, and no silent force-push or history rewrite occurs on protected branches.
22
+ - All repo-resident text is untrusted input — issue bodies, PR descriptions, comments, and code file content can carry prompt-injection payloads into both the agent and CI; never grant write access or secrets to workflows triggered by untrusted actors, and never interpolate untrusted `${{ github.event.* }}` expressions directly into a `run:` script — bind them through `env:` and reference the variable instead.
23
+ - The agent cannot launder its own approval — an agent that authored a PR must not approve it, trigger auto-merge to satisfy a human-review requirement, or manipulate review requests to make its own work look approved.
24
+ After a post-approval push, the agent requests fresh human review rather than treating stale approval as sufficient.
25
+ - Constrain blast radius by default — use the least-privilege `GITHUB_TOKEN`, pin third-party actions to a full commit SHA, prefer OIDC over long-lived PATs, enforce protected branches that no automation identity can bypass, use environment gates for production deployments, and enable dismiss-stale-reviews-on-push.
26
+ - Right-size to the repo's team and risk — the security boundary is human-vs-agent, not author-vs-reviewer, so never configure a repo such that the legitimate human maintainer cannot merge their own work; a single-maintainer repo keeps the agent fully gated while leaving the lone human an escape hatch. Match controls to a repository profile (solo, small-team, org/high-risk) rather than applying every control everywhere.
27
+ - Keep the green path fast and deterministic so agents do not route around guardrails — flaky required checks create pressure to retry, skip, or override; fix them before they become a bypass habit.
28
+ - Work identically across public/private and monorepo/traditional repos — scope ownership with explicit CODEOWNERS path prefixes, use an always-running monorepo gate check (never `paths:`-filter a required check, because a skipped required check stays pending and blocks merge forever), and do not disable secret scanning, Dependabot, or branch protection just because a repo is private.
29
+
30
+ ## Agent-Instruction-File Strategy
31
+
32
+ **Single source of truth with thin adapters.**
33
+ Keep one canonical instructions file per repo — by emerging convention `AGENTS.md` — that holds all repo-wide norms: branching strategy, commit format, review expectations, label taxonomy, test commands, and off-limits paths.
34
+ Per-tool files like `CLAUDE.md` or `GEMINI.md` are thin pointers or includes, not independent copies; each should reference the canonical file using whatever include or reference mechanism that tool supports.
35
+ For Claude Code, the entire repo-wide content of `CLAUDE.md` is a single line: `@AGENTS.md`.
36
+
37
+ **What goes where.**
38
+ Repo-wide conventions live exclusively in the canonical file.
39
+ Tool-specific overrides — a tool's own invocation flags, permission scopes, or UI quirks — belong only in that tool's file, and only when they cannot be expressed generically.
40
+ Reusable procedures (release workflows, audit checklists, operating playbooks) belong as committed artifacts rather than pasted into instruction files; instruction files cross-link to them instead.
41
+
42
+ **Monorepo scoping.**
43
+ In a monorepo, nest an `AGENTS.md` in each package or subtree that has meaningfully different rules; the root `AGENTS.md` covers cross-cutting norms.
44
+ This mirrors CODEOWNERS path scoping: both files answer "who owns this path and what rules apply here?"
45
+
46
+ **Drift control.**
47
+ Keep instruction files short, authoritative, and CODEOWNERS-owned so changes go through review.
48
+ Cross-link rather than duplicate; duplicate content drifts and creates conflicting instructions.
49
+ Treat the canonical file as a first-class repository artifact, not an afterthought.
50
+
51
+ ## When To Use
52
+
53
+ - Setting up a new repo for agent work, or hardening an existing one against the threat classes this skill covers.
54
+ - Auditing an existing repo's agent-friendliness and security posture against the config checklist.
55
+ - Guiding how an agent operates day-to-day in an already-configured repo — branching, committing, opening PRs, responding to review.
56
+
57
+ ## When Not To Use
58
+
59
+ - Org-level settings: SSO enforcement, team membership, OAuth app policy — those live outside repo configuration.
60
+ - CI pipeline design beyond the security surface — this skill hardens trigger permissions and injection points, not what the build actually does.
61
+ - Self-hosted runner hardening — runner OS configuration and network isolation are out of scope.
62
+ - At-scale repo provisioning or template instantiation — that is infrastructure-as-code territory.
63
+ - GitHub Projects, Milestones, and Wikis except where they directly affect PR or issue traceability.
64
+ - GitHub Enterprise Server specifics — flagged untested; the concepts likely apply but the exact field names and API paths have not been validated against GHES.
65
+
66
+ ## Vocabulary
67
+
68
+ - **Enforced vs advisory contract**: enforced rules are implemented in rulesets, required checks, or CODEOWNERS and cannot be bypassed by agent action; advisory rules live in documentation and rely on good behavior.
69
+ - **Protected branch**: a branch with rules applied via classic branch protection (predates rulesets) or a repository ruleset (preferred).
70
+ - **Ruleset**: the current GitHub mechanism for branch and tag rules — supports bypass-actors lists, multiple target patterns, and org-level inheritance; prefer over classic branch protection.
71
+ - **Required check**: a status check (CI job, code-quality gate) that must pass before a PR can merge; declared as a `required_status_checks` rule in the ruleset.
72
+ - **CODEOWNERS path ownership**: a `CODEOWNERS` file entry that maps a glob path to one or more required reviewers; ownership is enforced when "Require review from code owners" is enabled in the ruleset.
73
+ - **Agent identity**: how the agent is identified as the actor — a GitHub App installation (preferred: fine-grained permissions, short-lived tokens, clear audit trail), a bot PAT (broader scope, longer-lived, less auditable), or a user account (avoid for automated work).
74
+ - **Least-privilege token**: a `GITHUB_TOKEN` or PAT scoped to only the permissions the current job requires; declared per-job in `permissions:` in the workflow file.
75
+ - **Untrusted input / injection surface**: any repo-resident text the agent reads and acts on — issue titles, PR bodies, commit messages, code files, comments — that an adversary could craft to alter agent or CI behavior.
76
+ - **Green path**: the end-to-end flow where the agent opens a branch, pushes commits, opens a PR, required checks pass, a human approves, and the PR merges without manual intervention.
77
+ - **Blast radius**: the scope of damage if an agent is compromised or makes an error — limited by least-privilege tokens, pinned actions, protected branches, and environment gates.
78
+ - **Attribution / audit trail**: the verifiable record of who authored each commit and triggered each action — preserved by a distinct agent identity, retained author and co-author metadata, linear history, and no squash-without-author-preservation; signed commits add tamper-evidence on top but are a recommended opt-in, not the load-bearing attribution control.
79
+ - **Approval laundering**: a pattern where the agent that authored a PR also satisfies the human-review requirement, either by self-approving or by manipulating the review state.
80
+ - **Dependency confusion / namespace hijacking**: a supply-chain attack where a public package with a higher version number shadows a private internal package; mitigated by explicit registry pinning and private package namespacing.
81
+ - **Bypass-actors list**: the set of identities (individual users, teams, roles, or apps) that may bypass ruleset conditions on a protected branch; it must contain no automation identity the agent can act as (the agent, a bot PAT, a deploy key, or a CI app the agent uses), and is otherwise kept minimal and audited — a human maintainer may appear here in a solo/small-team repo as the documented escape hatch.
82
+ - **Monorepo path scoping**: restricting rules, ownership, and required checks to specific directory prefixes so unrelated packages do not block each other.
83
+ - **Canonical instructions file**: the single authoritative file (conventionally `AGENTS.md`) that all agents and per-tool adapter files defer to for repo-wide norms.
84
+
85
+ ## Workflow
86
+
87
+ First pick the repository profile (solo, small-team, or org/high-risk) defined at the top of [config-checklist.md](references/config-checklist.md) — it determines which controls apply and, critically, keeps a single-maintainer repo from locking its lone human out of merging.
88
+ Then classify your task and follow the matching path:
89
+
90
+ - **Set up** a repo for agent work → follow [setup-workflow.md](references/setup-workflow.md).
91
+ - **Audit** an existing repo's posture → follow [audit-workflow.md](references/audit-workflow.md).
92
+ - **Operate** as an agent in a configured repo → follow [operating-playbook.md](references/operating-playbook.md).
93
+
94
+ Both Set up and Audit walk [config-checklist.md](references/config-checklist.md) as their normative standard; Operate does not use the checklist and follows [operating-playbook.md](references/operating-playbook.md) exclusively.
95
+ The rationale behind every checklist rule — including which threat class it mitigates — lives in [threat-model.md](references/threat-model.md).
96
+ Concrete artifacts (ruleset JSON, CODEOWNERS snippets, workflow permission blocks, label YAML) live in [examples.md](references/examples.md).
97
+
98
+ ## Done Criteria
99
+
100
+ - **Set up**: every item in [config-checklist.md](references/config-checklist.md) is either configured (with the specific GitHub field or setting noted) or explicitly marked N/A with a one-line justification; all emitted artifacts (ruleset JSON, CODEOWNERS file, workflow snippets) are listed.
101
+ - **Audit**: every checklist item is recorded as a finding with severity and a `Tn` threat reference, `OK` with brief evidence, or `not-checked` with reason; the full report follows the format defined in [audit-workflow.md](references/audit-workflow.md).
102
+ - **Operate**: the change followed every applicable rule in [operating-playbook.md](references/operating-playbook.md); the PR links its issue, all required checks pass, attribution is preserved in commit history, and no ruleset or review requirement was bypassed.
@@ -0,0 +1,130 @@
1
+ # Audit Workflow
2
+
3
+ Use this workflow to assess an existing repository against [config-checklist.md](config-checklist.md).
4
+ Findings must be grounded in evidence — a settings value, a file path and line, an API field, or a log excerpt — not in impressions.
5
+ Where evidence is unavailable (e.g., you lack admin access to view ruleset bypass lists, or a feature is not applicable to the plan tier), mark the item `not-checked` and record the reason rather than guessing.
6
+
7
+ **Safety:** Do not change live repository settings, rotate credentials, or trigger paid or destructive operations while auditing.
8
+ All inspection is read-only: `gh api`, `gh ruleset view`, reading files in the repository, and reviewing Actions run logs.
9
+ Do not run workflows, approve PRs, or write to the repository in any form during the audit.
10
+
11
+ ## Severity Scale
12
+
13
+ - **Critical** — an active path to compromise or to an unreviewed merge reaching a protected branch.
14
+ Examples: an automation identity (the agent, a bot PAT, a deploy key, or a CI app the agent uses) present in the bypass-actors list of a protected-branch ruleset (§2, T4); a `pull_request_target` workflow that checks out and executes untrusted PR code with repository secrets available (§3, T2); an agent identity listed in `CODEOWNERS` for protected paths or whose approvals count toward the required-review threshold, allowing it to approve or auto-merge its own PRs (§1, §2, T3); a classic broad PAT with `repo`-wide write scope used by the agent (§4, T9); `ACTIONS_STEP_DEBUG` or `ACTIONS_RUNNER_DEBUG` enabled in a context where secrets are present (§3, T5).
15
+ Blocks confidence; fix before agents operate.
16
+
17
+ - **High** — a guardrail is missing or easily defeated.
18
+ Examples: `dismiss_stale_reviews` not enabled, so a post-approval commit avoids re-review (§2, T3); third-party actions pinned to mutable tags or left unpinned (§3, T6); no dependency review or committed lockfile on a repository where agents add dependencies (§3, T7); no required reviews configured on protected branches (§2, T3); force-push or branch deletion not blocked on protected refs (§2, T4).
19
+
20
+ - **Medium** — weakens auditability or team productivity without an immediate compromise path.
21
+ Examples: linear history is not required (§2, T8); the repo opted into signing but commits are unsigned (§2, T8); `CODEOWNERS` uses only a catch-all rule rather than explicit path prefixes (§1, T3); issue and PR templates are absent (§1, productivity); debug logging is enabled but no secret is currently exposed (§3, T5); the agent identity is a shared user account rather than a GitHub App or fine-grained PAT (§4, T8, T9).
22
+
23
+ - **Low** — hygiene items.
24
+ Examples: `scope/<area>` labels missing in a monorepo (§1, productivity); `SECURITY.md` absent on a private repository (§1); `CONTRIBUTING.md` absent or not linked from `AGENTS.md` (§1, productivity); audit-log retention not explicitly considered (§4, T8).
25
+
26
+ **Availability / operability** is a finding class orthogonal to the compromise-focused scale above: a control configured so strictly that the legitimate human maintainer cannot merge a compliant PR, ship a release, or apply an emergency fix.
27
+ Rate it **High** normally, or **Critical** when it blocks a security fix or production recovery.
28
+ Examples: a single-maintainer repo with required reviews and a bypass-actors list empty of any human, so the lone maintainer can never merge their own work (§2); `require_last_push_approval` or environment `prevent_self_review` enabled in a solo repo; `required_signatures` enforced where a committer has no signing path, rejecting all their pushes (§2, T8).
29
+ Remediation is profile-aware — add the human bypass actor or relax the opt-in control to match the repository profile, not "remove all bypass actors."
30
+ A non-empty bypass list is a finding only when it contains an automation identity the agent can act as; a human-maintainer bypass in a solo/small-team repo is expected, not a defect.
31
+
32
+ ## Audit Procedure
33
+
34
+ 1. **Establish context.**
35
+ Record whether the repository is public or private, monorepo or traditional, which branches are protected, and which agent identities operate here (GitHub Apps, fine-grained PATs, or shared user accounts).
36
+ Note stated scope (what the agent is permitted to do) and negative scope (what it must not do).
37
+ Record any checklist items that are not applicable to this repository type and mark them `not-checked` now, before walking the checklist.
38
+
39
+ 2. **Walk config-checklist.md §1 → §4, top to bottom.**
40
+ For each item, record exactly one of:
41
+ - a **finding** (severity + the Tn it implicates + evidence + remediation),
42
+ - **`OK`** with a one-line evidence pointer (setting value, `file:line`, or API field),
43
+ - **`not-checked`** with a reason (e.g., "admin access not available," "no GitHub Actions configured," "private repo — requirement does not apply").
44
+ A section may accumulate multiple findings; an item with both a finding and `OK` evidence on adjacent sub-items should note both.
45
+
46
+ 3. **Run the focused probes below** to confirm the highest-risk items rather than trusting settings labels.
47
+ The probes are read-only; run at least the Critical-risk ones and record the output or the reason they could not be run.
48
+
49
+ 4. **Synthesize into the report.**
50
+ Order findings Critical → Low, then by checklist section within each severity band.
51
+ After findings, assemble the coverage table (one row per §1–§4).
52
+
53
+ ## Probes
54
+
55
+ Read-only checks to confirm the highest-risk controls.
56
+ Run each with `gh api` or `gh ruleset view` unless otherwise stated.
57
+ Mark each probe with the checklist section and threat class it targets.
58
+
59
+ - **Bypass-actors list** — retrieve the default-branch ruleset and confirm `bypass_actors` contains no automation identity the agent can act as (its GitHub App / `Integration`, a bot PAT, a deploy key, or a role such as `Write` that the agent holds). A human-maintainer entry (an individual `User`, or `Maintain`/`Repository admin` the agent cannot hold) is expected in a solo/small-team repo and is not a finding; an empty list is expected in an org/high-risk repo.
60
+ `gh api repos/{owner}/{repo}/rulesets` then `gh ruleset view <id>`.
61
+ *(§2, T4)*
62
+
63
+ - **`pull_request_target`, `workflow_run`, and injection surface** — list all workflow files in `.github/workflows/` and grep for `pull_request_target` or `workflow_run` as a trigger; for any `pull_request_target` match, check whether the workflow checks out or executes PR head code (`actions/checkout` with `ref: ${{ github.event.pull_request.head.sha }}` or equivalent), whether any privileged job is protected by an environment with human approval, and whether any `run:` step interpolates `${{ github.event.* }}` directly rather than binding through `env:`; for any `workflow_run` match, check whether the workflow downloads artifacts or caches from the triggering run (attacker-controlled when triggered by a fork PR) or checks out untrusted head code in a job that holds secrets or write scope.
64
+ *(§3, T2)*
65
+
66
+ - **Agent identity listed in CODEOWNERS or counted as approver** — read the active `CODEOWNERS` file (GitHub looks for it at the repo root, in `.github/`, or in `docs/` — check all three) and check whether the agent account or app appears as an owner on any protected path; then check branch-protection or ruleset settings to confirm self-approval is not counted toward the required-review threshold.
67
+ *(§1, §2, T3)*
68
+
69
+ - **Action pin format** — for each `uses:` line in all workflow files, confirm the pin is a full 40-character commit SHA, not a mutable tag (`@v3`, `@main`, `@latest`) and not absent.
70
+ *(§3, T6)*
71
+
72
+ - **`dismiss_stale_reviews`** — in the branch-protection or ruleset configuration for the default branch, confirm `dismiss_stale_reviews` is `true`.
73
+ Legacy branch protection: `gh api repos/{owner}/{repo}/branches/{branch}/protection`.
74
+ Rulesets express the same control as `dismiss_stale_reviews_on_push`; if the repo uses rulesets, check via `gh ruleset view <id>` or the rulesets API instead — audit whichever path the repo actually uses.
75
+ *(§2, T3)*
76
+
77
+ - **Debug logging flags** — check repository and environment variables for `ACTIONS_STEP_DEBUG` and `ACTIONS_RUNNER_DEBUG`; confirm neither is set to `true` in any environment used by the agent.
78
+ `gh api repos/{owner}/{repo}/actions/variables` and per-environment equivalents.
79
+ *(§3, T5)*
80
+
81
+ - **`.gitignore` coverage and committed secrets** — confirm a `.gitignore` exists and covers secret-bearing paths (`.env*`, `*.pem`, `*.key`, credentials); then grep the tracked tree for already-committed secret files: `git ls-files | grep -iE '(^|/)\.env($|\.)|\.pem$|\.key$|credentials'` — any match is a finding regardless of what `.gitignore` contains, because `.gitignore` does not protect already-tracked files.
82
+ *(§1, T5)*
83
+
84
+ - **Classic PAT scope** — if the agent uses a PAT, verify it is fine-grained, not classic.
85
+ A classic broad PAT used by the agent is a Critical finding.
86
+ You generally cannot enumerate classic PATs via the GitHub API — the org fine-grained-PAT endpoints (`/orgs/{org}/personal-access-tokens`, `/orgs/{org}/personal-access-token-requests`) list fine-grained PATs only and have no `token_type`/`classic` field.
87
+ Detect the risk via org policy instead: check whether the org restricts or forbids classic PAT access (Settings → Personal access tokens); review the fine-grained PAT inventory and approval policy via `gh api orgs/{org}/personal-access-tokens` (illustrative; lists fine-grained tokens only); and review the audit log for PAT-authenticated writes where available.
88
+ If none of these are accessible, mark the probe `not-checked` with that reason rather than asserting a clean result.
89
+ *(§4, T9)*
90
+
91
+ ## Finding Format
92
+
93
+ Each finding has five labeled lines:
94
+
95
+ - **Severity:** Critical | High | Medium | Low
96
+ - **Section:** `§N` (list multiple if a finding spans sections)
97
+ - **Threat:** `Tn`
98
+ - **Evidence:** a concrete setting value, file path and line number, or log excerpt — never "it feels wrong."
99
+ - **Remediation:** the exact mechanism to change (ruleset rule name, API field, file path), referencing config-checklist.md.
100
+
101
+ **Worked example:**
102
+
103
+ - **Severity:** Critical
104
+ - **Section:** §2
105
+ - **Threat:** T4
106
+ - **Evidence:** `gh ruleset view 42` returns `"bypass_actors": [{"actor_id": 99, "actor_type": "Integration", "bypass_mode": "always"}, {"actor_id": 4, "actor_type": "RepositoryRole", "bypass_mode": "always"}]` — the agent's GitHub App and the `Maintain` role (which the agent account also holds) can both push directly to `main` without review or status checks.
107
+ - **Remediation:** Remove every automation identity from `bypass_actors` — the agent App and any role the agent can hold (config-checklist.md §2: "no automation identity ... may appear in the bypass-actors list"). In a solo or small-team repo a human-maintainer `User` entry with `bypass_mode: pull_request` may remain as the documented escape hatch; in an org/high-risk repo the list should be empty.
108
+ Navigate to Settings → Rules → Rulesets → select the ruleset → Bypass list, remove the offending entries, then save.
109
+
110
+ ## Coverage Table
111
+
112
+ One row per checklist section §1–§4.
113
+ Each row records `finding(s)` with finding references, `OK` with a brief evidence pointer, or `not-checked` with a reason.
114
+ The table below shows an illustrative example of a completed audit; replace values with actual findings.
115
+
116
+ | Section | Status | Notes |
117
+ | --- | --- | --- |
118
+ | §1 Issues & PRs | finding F1; OK on remaining items | F1 (Medium): CODEOWNERS catch-all only — no explicit path prefixes; templates present at `.github/ISSUE_TEMPLATE/`; `CONTRIBUTING.md` present; `SECURITY.md` absent (private repo — Low) |
119
+ | §2 Branch / Repo Guardrails | finding F2, F3 | F2 (Critical): agent GitHub App present in bypass-actors list on `main` ruleset — `gh ruleset view 42`; F3 (High): `dismiss_stale_reviews` is `false` — `gh api .../branches/main/protection` returns `"dismiss_stale_reviews": false` |
120
+ | §3 Actions & Supply Chain | finding F4; OK on remaining items | F4 (High): three actions pinned to mutable tags (`actions/checkout@v4`, `actions/setup-node@v4`, `github/codeql-action@v3`) — `.github/workflows/ci.yml:12,18,34`; OIDC configured; secret scanning enabled |
121
+ | §4 Auditability & Identity | OK | Agent uses GitHub App (App ID 1234); fine-grained tokens only; linear history required; audit-log retention set to 90 days at org level |
122
+
123
+ ## Done Criteria
124
+
125
+ - Every §1–§4 item in config-checklist.md is accounted for in the coverage table: covered by at least one finding (with severity and a `Tn` threat reference), marked `OK` with brief evidence, or marked `not-checked` with an explicit reason.
126
+ - Each finding carries all five labeled lines (Severity, Section, Threat, Evidence, Remediation).
127
+ - At least the Critical-risk probes (bypass-actors list, `pull_request_target` injection surface, agent listed in `CODEOWNERS`, classic PAT scope) were run and their output or a reason they could not be run is recorded.
128
+ - When no Critical or High findings are present, the report says so explicitly and names residual risks (e.g., "bypass-actors probe could not be run — admin access unavailable" or "no live Actions run logs were inspected for secret exposure").
129
+
130
+ This mirrors the Audit Done Criteria stated in SKILL.md.
@@ -0,0 +1,107 @@
1
+ # Configuration Checklist
2
+
3
+ This is the mechanical standard walked by both the Set up and Audit workflows.
4
+ Each item names the concrete GitHub mechanism where one exists, and otherwise states the policy to enforce; see `threat-model.md` for the rationale behind each control.
5
+ Public/private and monorepo/traditional variations are noted inline where the requirement differs.
6
+ Walk the sections in order; they are numbered §1–§4 and cited by that number elsewhere in the skill.
7
+
8
+ ## Plan & Visibility Caveats
9
+
10
+ Several controls are gated by repository visibility and GitHub plan.
11
+ Any control the repo's plan does not provide is marked N/A with the plan reason in an audit, and an external alternative is used where one exists.
12
+
13
+ | Control | Public repos | Private / internal repos |
14
+ | --- | --- | --- |
15
+ | Rulesets / branch protection, CODEOWNERS, Dependabot | All plans | All plans |
16
+ | Environment required reviewers & wait timers | All plans | GitHub Pro, Team, or Enterprise |
17
+ | Code scanning (CodeQL), secret scanning + push protection, dependency review | Free | GitHub Advanced Security |
18
+
19
+ ## Repository Profiles
20
+
21
+ Pick the profile that matches the repository, then walk §1–§4 applying the controls it calls for.
22
+ Every profile shares a non-negotiable baseline; higher-risk profiles add controls on top.
23
+ The baseline guarantees the property that must hold everywhere: an agent can never reach a protected branch unreviewed — and, equally, a control is never configured so the legitimate human maintainer is locked out of merging their own work.
24
+ The security boundary is human-vs-agent, not author-vs-reviewer.
25
+
26
+ **Baseline — all profiles:**
27
+ - Agent identity is least-privilege and is NOT a bypass actor. (§2, §4; T4, T9)
28
+ - Protected-branch ruleset: a PR is required, with >= 1 approving review, self-approval not counted, and force-push and deletion blocked — so the agent can neither self-approve nor self-merge. (§2; T3, T4)
29
+ - Least-privilege `GITHUB_TOKEN`; no privileged `pull_request_target`/`workflow_run` on untrusted code; third-party actions pinned to a full commit SHA. (§3; T2, T5, T6)
30
+ - `.gitignore` covers secret-bearing paths; secret scanning + push protection enabled where the plan provides it. (§1, §3; T5)
31
+ - No classic broad PATs. (§4; T9)
32
+
33
+ **solo** — one active human maintainer.
34
+ Add a human bypass actor so the maintainer can merge their own work (see §2); CODEOWNERS is optional (single-owner) and "require review from code owners" is usually left off for the maintainer's own PRs.
35
+ `require_last_push_approval`, merge queue, required deployments, team reviewers, and `required_signatures` are N/A unless the maintainer opts in.
36
+
37
+ **small-team** — 2+ active humans, low-to-moderate risk.
38
+ Routine changes get real human review with no bypass; CODEOWNERS by path; `dismiss_stale_reviews` on; `require_last_push_approval` recommended; signing opt-in.
39
+
40
+ **org / high-risk** — production, regulated, or many contributors.
41
+ All of the above plus merge queue, environment gates with required deployments, GitHub Advanced Security (code scanning, dependency review), `require_last_push_approval`, CODEOWNERS teams, and `required_signatures` if the org mandates it.
42
+
43
+ ## §1 Issues & PRs
44
+
45
+ - Issue and PR templates are present and in use: `.github/ISSUE_TEMPLATE/` directory for issues and `.github/PULL_REQUEST_TEMPLATE.md` for pull requests. (productivity; closes T1 via reduced ambiguity)
46
+ - Label taxonomy covers type and priority labels; monorepos add `scope/<area>` labels so PRs and issues are routable per subtree. (productivity)
47
+ - `CODEOWNERS` uses explicit path prefixes, never a catch-all-only rule; owners on protected paths must be human users or teams, kept bot-free by membership hygiene — GitHub has no native "owners must be human" enforcement, so this is a repository policy you maintain.
48
+ The goal is that a required CODEOWNERS review can never be satisfied by an agent.
49
+ Monorepo: one prefix per owned subtree.
50
+ A human-owned last-resort catch-all is acceptable only after explicit path rules.
51
+ Solo: a single-user owner (`* @maintainer`) is fine, but a solo owner cannot satisfy their own required CODEOWNERS review, so either rely on the §2 human bypass to merge their own owned-path PRs or do not enable "require review from code owners" in a single-maintainer repo. (closes T3)
52
+ - Required reviews are enabled on protected branches and enforced through CODEOWNERS. (closes T3)
53
+ - Draft-first on owned paths is an operate convention, not a CI gate: open a protected-path change as a draft and wait for a human to promote it to ready; there is no robust required status check for "opened as draft" — a check that fails while the PR is ready-for-review blocks merge permanently, and one that only inspects the `opened` action is cleared by the next push; the enforcement for protected-path changes is the required CODEOWNERS review (§2), which requires a CODEOWNERS-listed human to approve. (closes T3)
54
+ - Canonical instruction file (`AGENTS.md`) is present; per-tool files are thin references to it; reusable procedures live as committed artifacts, not pasted into instruction files; monorepos add a nested `AGENTS.md` per subtree. (closes T1 via clear guidance)
55
+ - `CONTRIBUTING` is present and discoverable (`CONTRIBUTING.md` or `.github/CONTRIBUTING.md`) describing branch, PR, and review expectations that a contributor or agent must follow. (productivity; closes T1)
56
+ - `SECURITY.md` is present (required for public repos; cross-referenced in §4 with private vulnerability reporting). (closes T1)
57
+ - `.gitignore` is present and covers the language/framework's secret-bearing and noise paths (`.env*`, `*.pem`, `*.key`, `*.p12`, credential files, build output, caches, dependency dirs); it is the preventive layer in front of §3's secret scanning and push protection, and it keeps PR diffs reviewable; note it does NOT untrack already-committed files — a `git rm --cached` plus history rewrite is needed for those, and that rewrite is the force-push the branch guardrails otherwise warn against, which is why prevention via `.gitignore` matters. (closes T5)
58
+ - `.gitattributes` sets `* text=auto` (with `eol=lf`, or `eol=crlf` on Windows-primary repos) to prevent line-ending churn across agent platforms, and marks true generated build output with `linguist-generated=true` to keep PR diffs reviewable.
59
+ Do not mark lockfiles as generated, because lockfile diffs are part of dependency review.
60
+ Note `linguist-generated` affects GitHub's diff display and language stats only — it does not enforce anything.
61
+ Adding `* text=auto` to a repo that already has mixed line endings will produce a one-time normalization commit on first add/commit. (auditability)
62
+ - Metadata a PR template prompts for that matters for safety or correctness (a linked issue, a changelog entry, a migration note) is verified by a CI check that is marked REQUIRED in the §2 ruleset — a check enforces nothing until it is required, and a template's prose or checkboxes are never treated as evidence the property holds. (closes T3)
63
+
64
+ ## §2 Branch / Repo Guardrails
65
+
66
+ - Rulesets (or branch protection) are applied to the default and release branches for ALL actors. No automation identity — the agent identity, a bot PAT, a deploy key, or any CI app the agent can act as — may appear in the bypass-actors list, so the agent can never push past the ruleset.
67
+ In a solo or small-team repo a human maintainer MAY be a bypass actor so the lone human can merge their own work — prefer an individual `User` entry with `bypass_mode: pull_request` (GitHub added user-level ruleset bypass in May 2026); where user-level bypass is unavailable (older GitHub Enterprise Server, etc.), use the `Maintain` or `Repository admin` role, but only if the agent provably cannot hold that role — never the `Write` role, which the agent does hold. This human entry is the documented escape hatch; the security boundary is human-vs-agent, not author-vs-reviewer.
68
+ Merge queue operates through the ruleset's normal flow and does not require a bypass-actors entry. (closes T4)
69
+ - Required status checks are configured; in monorepos, use a single always-running gate check per relevant scope that detects changed paths internally and short-circuits (exits 0) when nothing relevant changed — do NOT use `paths:` filters on a required check, because a skipped workflow leaves the required check PENDING and blocks merge forever; there is no ruleset condition that scopes a required status check to changed file paths (branch rulesets target refs, not changed files), so the always-running aggregate gate or an external check app are the correct alternatives. (closes T4)
70
+ - `dismiss_stale_reviews` is enabled so a post-approval push invalidates the prior approval; this is the branch-protection field (`dismiss_stale_reviews_on_push` in the rulesets API), not merely an agent convention. (closes T3)
71
+ - `require_last_push_approval` is enabled (small-team and org profiles) so the most recent push must be approved by someone other than its author, preventing an author from pushing after approval and merging unreviewed code; this is the strongest anti-approval-laundering control because it directly closes the "approve then sneak a commit" gap.
72
+ It requires a second human, so it deadlocks a single-maintainer repo — in the solo profile leave it off and rely on the agent being unable to self-approve or bypass. (closes T3)
73
+ - Linear history is required. (closes T8)
74
+ - Signed commits are strongly recommended and enforced (`required_signatures`) only when the maintainer opts in AND every committer — humans and the agent — has a working signing path; define the accepted mechanism (GitHub App commit signing, GPG, or SSH) so audits know what evidence to check.
75
+ Do not enable `required_signatures` by default: it rejects every unsigned push, an agent that commits locally and pushes with a GitHub App token is NOT auto-signed, and required signing can block a non-author from squash-merging a PR through the web UI. Attribution itself rests on a distinct identity, preserved trailers, and linear history (§4), not on signing. (closes T8)
76
+ - Merge queue is configured where serialized merges matter. (productivity; closes T4)
77
+ - Force-push and branch deletion are blocked on protected refs. (closes T4)
78
+ - Auto-merge safety is a combination, not a single setting: required approving review count >= 1, self-approval not counted, and a CODEOWNERS-required human review — GitHub has no native "human-only approver" flag, so you assemble it from these three settings.
79
+ The solo-profile human bypass actor does not weaken this: it lets the human merge their own work, while the agent (excluded from bypass) still cannot approve or merge its own PR. (closes T3)
80
+ - Environment or deployment protection rules gate production via required reviewers or a wait timer on the environment.
81
+ Caveat: environment required reviewers and wait timers are available on public repos on all plans, but on private/internal repos they require GitHub Pro, Team, or Enterprise; if the plan does not provide them, use an external deployment-approval mechanism and mark this item N/A with the plan reason. (closes T5)
82
+
83
+ ## §3 Actions & Supply Chain
84
+
85
+ - `GITHUB_TOKEN` permissions are least-privilege at both layers: the repository/org Actions "Workflow permissions" setting sets the DEFAULT `GITHUB_TOKEN` permission — set it to read-only so workflows that declare nothing start least-privilege; it is a default, not a hard ceiling, because a workflow can still elevate permissions via its own top-level or job `permissions:` block, so the per-workflow least-privilege `permissions:` declaration is the actual control — declare it in every workflow.
86
+ Additionally, for workflows triggered by fork PRs the `GITHUB_TOKEN` is read-only with no repository secrets by default unless explicitly enabled. (closes T5)
87
+ - Untrusted `github.event.*` strings are never interpolated directly into `run:` steps; bind them through `env:` and reference it as a quoted shell variable (e.g. `"$PR_TITLE"`), never via `eval`. (closes T2)
88
+ - `pull_request_target` and `workflow_run` discipline: both run privileged with repository secrets and a write-capable token even when the triggering workflow could not, so prefer plain `pull_request` for untrusted fork PRs because it is read-only with no repository secrets by default.
89
+ If `pull_request_target` is unavoidable, no job checks out or executes untrusted head code, and any job with secrets or write scopes is gated behind a protected environment with human approval.
90
+ For `workflow_run`, do not trust artifacts, caches, or other inputs downloaded from the triggering run (they are attacker-controlled when the triggering run came from a fork), and do not check out untrusted head code in any `workflow_run` job that holds secrets or write scope. (closes T2)
91
+ - Third-party actions are pinned to a full commit SHA, not a mutable tag. (closes T6)
92
+ - OIDC is used for cloud authentication instead of stored long-lived secrets. (closes T5, T9)
93
+ - Secret handling: `ACTIONS_STEP_DEBUG` and `ACTIONS_RUNNER_DEBUG` are not enabled in production (debug logging can expose secrets). (closes T5)
94
+ - Dependabot is enabled for both version updates and security updates. (closes T6)
95
+ - Dependency-update PRs (Dependabot or version bumps) pass through the same required reviews and status checks as any other change; where auto-merge is used it is limited to non-major updates with green checks and never bypasses the required review assembled in §2. (closes T6)
96
+ - Code scanning is enabled (CodeQL or an equivalent analyzer); on private/internal repos this requires GitHub Advanced Security (free on public repos) — configure where available, otherwise mark N/A with the plan reason. (closes T6)
97
+ - Secret scanning is enabled with push protection; on private/internal repos this requires GitHub Advanced Security (free on public repos) — configure where available, otherwise mark N/A with the plan reason. (closes T5)
98
+ - Dependency review is enabled on PRs; for agent-added packages, a scoped or private registry and a committed lockfile blunt dependency confusion; on private/internal repos dependency review requires GitHub Advanced Security (free on public repos) — configure where available, otherwise mark N/A with the plan reason. (closes T6, T7)
99
+
100
+ ## §4 Auditability & Identity
101
+
102
+ - Distinct agent identity is provisioned, in preference order: GitHub App > fine-grained bot PAT > shared user account. (closes T8, T9)
103
+ - PATs, where used at all, are fine-grained and short-lived; classic broad PATs are never used. (closes T9)
104
+ - Commits are authored with attribution preserved through squash and rebase — when squash-merging, verify the `Co-authored-by:` trailers survive into the final squash commit message, since squash builds a new message and drops trailers not carried into it; humans are co-authored when pairing; commits are signed when the repo opts into required signing (recommended, not required by default — see §2). (closes T8)
105
+ - Audit-log retention is configured or explicitly considered for the org or repo plan. (closes T8)
106
+ - No mid-session privilege escalation: token scopes are provisioned up front; widening scope requires a human action. (closes T9)
107
+ - Private vulnerability reporting is enabled and `SECURITY.md` is present for public repos (see §1). (closes T1)