claude-dev-env 8.40.0 → 8.41.0

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 (39) hide show
  1. package/.agents/agents/test_agent_frontmatter.py +17 -14
  2. package/.agents/agents-archived/clean-coder.md +4 -4
  3. package/.agents/agents-archived/pr-description-writer.md +1 -1
  4. package/.agents/skills/pr-lifecycle/SKILL.md +470 -0
  5. package/.agents/skills/privacy-hygiene/reference/sweep-procedure.md +1 -1
  6. package/bin/ever-shipped-skills.mjs +1 -0
  7. package/bin/ever-shipped-skills.test.mjs +4 -0
  8. package/bin/install.mjs +6 -2
  9. package/bin/install.shared-settings.test.mjs +44 -1
  10. package/docs/rule-guides/code-standards.md +1 -1
  11. package/docs/rule-guides/destructive-commands.md +1 -1
  12. package/hooks/blocking/pr_lifecycle_skill_gate.py +190 -0
  13. package/hooks/blocking/test_pr_lifecycle_skill_gate.py +163 -0
  14. package/hooks/hooks.json +10 -0
  15. package/hooks/hooks_constants/pr_lifecycle_skill_gate_constants.py +33 -0
  16. package/hooks/hooks_constants/skill_loaded_reminder_constants.py +0 -10
  17. package/hooks/hooks_constants/test_pr_lifecycle_skill_gate_constants.py +12 -0
  18. package/hooks/hooks_constants/test_transcript_skill_scan_constants.py +7 -0
  19. package/hooks/hooks_constants/transcript_skill_scan_constants.py +7 -0
  20. package/hooks/session/skill_loaded_reminder.py +4 -51
  21. package/hooks/session/test_skill_loaded_reminder.py +4 -0
  22. package/hooks/test_transcript_skill_scan.py +58 -0
  23. package/hooks/transcript_skill_scan.py +93 -0
  24. package/package.json +1 -1
  25. package/rules/flag-non-breaking-findings.md +2 -2
  26. package/rules/shell-invocation.md +2 -14
  27. package/rules/skill-pointers.md +3 -0
  28. package/scripts/policy_lint/adapter_configuration.py +5 -0
  29. package/scripts/policy_lint/config/constants.py +1 -0
  30. package/scripts/tests/test_adapter_configuration.py +8 -0
  31. package/scripts/tests/test_banned_prose_words.py +1 -1
  32. package/scripts/tests/test_rule_load_scopes.py +1 -7
  33. package/rules/agent-merges-its-own-green-pull-request.md +0 -55
  34. package/rules/ci-owns-the-gate.md +0 -101
  35. package/rules/durable-post-artifacts.md +0 -76
  36. package/rules/gh-cli-conventions.md +0 -36
  37. package/rules/git-workflow.md +0 -121
  38. package/rules/re-stage-before-commit.md +0 -14
  39. package/rules/review-closure-is-a-check.md +0 -54
@@ -1,121 +0,0 @@
1
- # Git workflow
2
-
3
- User-level rule: applies to **every** git repo that uses GitHub with `gh`. Small or non-primary repos follow the same rule unless the user says otherwise in the session.
4
-
5
- ## Workflow decision tree
6
-
7
- **When to use stacked PRs:** Feature B depends on Feature A's implementation
8
-
9
- **When to extract shared infrastructure first:** Multiple features need same utilities/helpers
10
-
11
- **Extract Shared Infrastructure Pattern:**
12
- 1. Create infrastructure PR with only shared code
13
- 2. Get reviewed and MERGE infrastructure first
14
- 3. Launch parallel feature PRs that use merged infrastructure
15
-
16
- ## Pull request submission rules
17
-
18
- **Open every pull request ready for review.** Pass `--draft` only when the owner asks
19
- for a draft.
20
-
21
- **A release bot's PR body is machine input. Leave it alone.** Release automation reads
22
- back the body of its own merged pull request to decide it owns that merge. Rewriting the
23
- body, or trimming its header or footer, makes the bot treat the merge as somebody else's
24
- work: it cuts no tag, the publish job skips, and it opens one more release pull request on
25
- the next run. The merge stays in the repository. No tag is cut and the package never publishes.
26
-
27
- Spot one by its head branch, which starts `release-please--branches--`, or by a body that
28
- opens with the bot's own marker line. The description rules in this file, the
29
- `pstack:poteto-agent` writing brief, and the house wording style all step aside for it. The
30
- failure signature in the release job log reads
31
- `could not parse pull request body as a release PR`.
32
-
33
- `pstack:poteto-agent` writes a title and body from the diff when you want one.
34
- Publish the title and body file through
35
- `~/.agents/skills/pull-request/scripts/pull_request.py`. That path is under the
36
- agents home, not the repository. A worktree holds no `.agents/` copy.
37
-
38
- Resolve the active managed root (`CLAUDE_CONFIG_DIR` when set, `~/.claude`
39
- otherwise), then run `<managed-root>/scripts/durable_post_lint.py` before any
40
- pull request, issue, or GitHub MCP post. The linter checks the action-specific
41
- title, body, and volatile-path rules before credential lookup or network
42
- access.
43
-
44
- Use `.agents/skills/pull-request/scripts/recover_legacy_author.py
45
- <exact-state-file> --confirm-inactive` only for one explicitly selected legacy
46
- author record. Do not infer a record from age alone. Keep every other record
47
- untouched.
48
-
49
- ## Confirm the required checks fired, and let CI run them
50
-
51
- The gate runs once, and it runs on CI. Push the branch and read its verdict.
52
- [`ci-owns-the-gate.md`](ci-owns-the-gate.md) holds the reasoning and the shape
53
- a local run takes when one is warranted.
54
-
55
- Read the branch ruleset for the required check contexts before you push a
56
- branch, or any level of a stack: `gh api repos/<owner>/<repo>/rules/branches/<trunk>`.
57
- Read it to learn which checks must report. After the push, confirm each of those
58
- contexts appears on that level's head. A required check that never fired is
59
- invisible debt at every level, and it surfaces only after the whole stack is
60
- pushed, when the repair costs a second pass over every branch.
61
-
62
- A red required check blocks the branch, whoever owns the failing line. The
63
- staged policy lint grades a change against the file's prior text, so a finding
64
- that survives is one the change introduced or made worse. Fix that line in the
65
- next push or report the branch blocked. A finding the change did not introduce
66
- is a gate-scoping defect: report it against the lint and leave the file's shape
67
- alone. Restructuring a file to satisfy a mis-scoped check trades one finding for
68
- a set of new ones. Read the gate's own report rather than a narrower substitute. A
69
- single-file mypy call cannot see sibling modules and reports false import
70
- errors, so it neither clears nor convicts a change.
71
-
72
- A checks listing that reports nothing on the branch is a finding, not a neutral
73
- state. Find out whether the workflow's event filters exclude the branch, or whether
74
- the check simply never ran, before you treat that branch as clean.
75
-
76
- ## Each stack level stands on its own
77
-
78
- A symbol belongs at the level that first **uses** it, not the level that first
79
- mentions it. A bottom pull request that declares the imports its descendants will
80
- need fails the linter on unused imports. A test helper that calls a function three
81
- levels above it fails on an undefined name. Both defects stay invisible while you
82
- read the finished tip, and both are obvious the moment you check one level alone.
83
-
84
- Prove each level before you push it: import the modules that level changes, and run
85
- the required linter against that level's own base. To repair a level, rebuild its
86
- import header as the union of what that level references, let the linter's
87
- autofix strip the rest, and move a premature helper up to the level that defines
88
- what it calls.
89
-
90
- ## A force-push that moves content obliges a description refresh
91
-
92
- Force-with-lease protects the ref. It protects nobody's understanding of what the
93
- branch now holds. When a rewrite moves content between levels of a stack, or
94
- otherwise changes what a branch contains, refresh that pull request's description
95
- before you ask anyone to read or merge it.
96
-
97
- ## Never commit working documents or images
98
-
99
- **Keep these files out of the repository:**
100
-
101
- | Pattern | Reason |
102
- |---------|--------|
103
- | `docs/plans/*.md` | Working documents for planning, not repo content |
104
- | `*.plan.md` | Temporary planning files |
105
- | `SESSION_STATE.md` | Local session state |
106
- | `*.png *.jpg *.jpeg *.gif *.webp *.avif *.svg *.ico` | Images go to external storage, not GitHub |
107
-
108
- An image a PR needs as visual evidence is not an exception to that row. Upload it to the repository's durable `artifacts` release with `python3 ~/.claude/scripts/gh_artifact_upload.py <file> <owner/repo>` and embed the permanent URL in the PR comment. The image lives on GitHub without entering the repository tree.
109
-
110
- ## Responding to review feedback
111
-
112
- **When this applies:** GitHub PR review feedback on a branch you are fixing.
113
-
114
- 1. Fetch every reviewer comment before making any fix.
115
- 2. Create a checklist in the session's task tool with one item per comment.
116
- 3. Fix systematically, marking each todo complete.
117
- 4. Reply to each comment inline.
118
-
119
- Repair only the reported findings.
120
-
121
- Every `gh` post in this workflow uses `--body-file` per `gh-cli-conventions.md` and keeps volatile scratch paths out per `durable-post-artifacts.md`. Stage session edits per `re-stage-before-commit.md` before each commit.
@@ -1,14 +0,0 @@
1
- # Re-Stage Session Edits Before Commit
2
-
3
- Stage the files you edited this session right before you commit them. A plain `git commit` records only the staged snapshot; a tracked file this session changed but left unstaged stays behind in the working tree.
4
-
5
- No hook denies a commit that would drop tracked session edits. Run `git status` before you commit, then stage what you changed with `git add <paths>` or commit with `git commit -a`.
6
-
7
- Staging covers tracked files you edited. Do not commit untracked files unless the user explicitly instructs it. An untracked file in the working tree is outside the change until they say otherwise.
8
-
9
- ## Staging shapes
10
-
11
- - **A pathspec.** `git commit -- <paths>` or `git commit <paths>` commits only the named paths on purpose.
12
- - **A preceding `git add` or `git stage`.** `git add <paths> && git commit …` stages the files in its own segment before the commit runs.
13
-
14
- A `--amend` carries the same risk. An amend records the staged snapshot too, so an unstaged session edit is dropped the same way a plain commit drops it.
@@ -1,54 +0,0 @@
1
- # Review Closure Is a Check
2
-
3
- **When this applies:** Any pull request an agent drives, from the first review comment on it to the merge.
4
-
5
- ## Rule
6
-
7
- A review finding on the head is answered before the pull request merges. The agent driving it replies, pushes the fix, or both. The check named `Review closure` reads that state on every push, on every review event, and on every top-level comment, and reports red while a finding waits.
8
-
9
- One command prints the same verdict:
10
-
11
- ```
12
- python packages/claude-dev-env/scripts/review_closure.py <owner>/<name> <number>
13
- ```
14
-
15
- It prints `CLOSED` and exits 0 when every finding on the head is answered. It prints `OPEN`, one line per waiting finding, and exits 1. It exits 2 when the state could not be read.
16
-
17
- ## What closes a finding
18
-
19
- | The thread | Closed by |
20
- |---|---|
21
- | A review comment on code | A push that replaced the code it points at |
22
- | A review comment on code | A reply from the account driving the pull request |
23
- | A review comment on code | Resolution, where the comment carries no red circle |
24
- | A red-circle finding | A reply from the driving account, or a push that replaced the code |
25
- | A thread the driving account opened | Itself |
26
- | A blocking `Claude Approvals` row | A push, which moves the head the check reports on |
27
- | A top-level comment on the pull request | A later top-level comment from the driving account |
28
- | A bot notice: a review-skipped note, a pointer to an updated summary, a Graphite verdict mirror, a Qodo change summary, a Qodo in-progress placeholder, or a Qodo review that found no issues | Itself |
29
-
30
- A review bot rewrites its summary comment on each pass. Its edit leaves an answered summary closed, because each new finding it has arrives as a review thread or a new comment. An edit from a person reopens the comment.
31
-
32
- A red circle marks a finding a review states as blocking, so resolution in silence leaves it open. The reply says what changed or why the finding stands, and the reviewer reads it beside the diff.
33
-
34
- The driving account is the one that opened the pull request. Where the agent comments under a second login, `--driver-login <login>` names it, repeatably.
35
-
36
- A repository whose review bots post notices this package does not know passes each one's marker text with `--notice-marker <text>`, repeatably. A bot comment carrying that text closes itself, like the built-in notices above.
37
-
38
- ## Where the check runs
39
-
40
- `.github/workflows/review-closure.yml` runs it here on a push to a pull request, on a submitted or dismissed review, on a review comment, and on a top-level comment posted or edited on a pull request. Each run reports on the pull request's head commit, so a finding posted after the last push still turns the check red.
41
-
42
- A top-level comment arrives as an `issue_comment` event, and a run on that event belongs to the default branch commit. The comment job reads the pull request's head, runs the same command, and posts the verdict on that head through the Checks API as a `Review closure` check run. The token belongs to the GitHub Actions app, so that check run carries the same name and app as the pull request job's own, and the newest one on the head is the one branch rules read.
43
-
44
- A private repository that installs this package runs the same command from its own workflow, against the revision of this package that its workflow pins.
45
-
46
- A repository that merges through a merge queue also runs the check on `merge_group` and lists `Review closure` as a required check. The queue ref `gh-readonly-queue/<base>/pr-<number>-<sha>` names the pull request number the command takes. A finding posted while an entry waits in the queue then fails the queue build. Without that trigger, the entry merges on the verdict it carried when it joined the queue.
47
-
48
- ## Sibling rules
49
-
50
- | Rule | Role |
51
- |---|---|
52
- | [`agent-merges-its-own-green-pull-request.md`](agent-merges-its-own-green-pull-request.md) | The agent that drives a pull request merges it once its gate passes |
53
- | [`git-workflow.md`](git-workflow.md) | Open ready for review, and confirm each required context fired after the push |
54
- | [`correction-lens.md`](correction-lens.md) | A correction becomes a control at the highest layer that can hold it |