claude-dev-env 2.0.2 → 2.1.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 (88) hide show
  1. package/CLAUDE.md +1 -1
  2. package/hooks/blocking/CLAUDE.md +1 -0
  3. package/hooks/blocking/code_rules_shared.py +126 -47
  4. package/hooks/blocking/config/CLAUDE.md +2 -0
  5. package/hooks/blocking/config/verified_commit_context_constants.py +21 -0
  6. package/hooks/blocking/config/verified_commit_gate_output_constants.py +14 -0
  7. package/hooks/blocking/conftest.py +36 -30
  8. package/hooks/blocking/convergence_gate_blocker.py +76 -8
  9. package/hooks/blocking/plain_language_blocker.py +8 -0
  10. package/hooks/blocking/state_description_blocker.py +4 -1
  11. package/hooks/blocking/test_code_rules_shared.py +120 -20
  12. package/hooks/blocking/test_convergence_gate_blocker.py +146 -0
  13. package/hooks/blocking/test_plain_language_blocker.py +15 -0
  14. package/hooks/blocking/test_state_description_blocker.py +15 -0
  15. package/hooks/blocking/test_verified_commit_config_bootstrap.py +18 -0
  16. package/hooks/blocking/test_verified_commit_gate_additional_context.py +134 -0
  17. package/hooks/blocking/tests/test_verified_commit_gate.py +41 -0
  18. package/hooks/blocking/verified_commit_config_bootstrap.py +22 -10
  19. package/hooks/blocking/verified_commit_gate.py +113 -568
  20. package/hooks/blocking/verified_commit_gate_parts/CLAUDE.md +28 -0
  21. package/hooks/blocking/verified_commit_gate_parts/__init__.py +1 -0
  22. package/hooks/blocking/verified_commit_gate_parts/command_tokenization.py +174 -0
  23. package/hooks/blocking/verified_commit_gate_parts/deny_payload.py +53 -0
  24. package/hooks/blocking/verified_commit_gate_parts/deny_reason.py +80 -0
  25. package/hooks/blocking/verified_commit_gate_parts/directory_resolution.py +170 -0
  26. package/hooks/blocking/verified_commit_gate_parts/gated_invocations.py +205 -0
  27. package/hooks/blocking/verified_commit_gate_parts/tests/conftest.py +10 -0
  28. package/hooks/blocking/verified_commit_gate_parts/tests/test_command_tokenization.py +94 -0
  29. package/hooks/blocking/verified_commit_gate_parts/tests/test_deny_payload.py +17 -0
  30. package/hooks/blocking/verified_commit_gate_parts/tests/test_deny_reason.py +38 -0
  31. package/hooks/blocking/verified_commit_gate_parts/tests/test_directory_resolution.py +71 -0
  32. package/hooks/blocking/verified_commit_gate_parts/tests/test_gated_invocations.py +61 -0
  33. package/hooks/hooks_constants/CLAUDE.md +4 -1
  34. package/hooks/hooks_constants/code_rules_path_utils_constants.py +1 -0
  35. package/hooks/hooks_constants/convergence_gate_blocker_constants.py +36 -0
  36. package/hooks/hooks_constants/harness_scratchpad_constants.py +10 -9
  37. package/hooks/hooks_constants/mypy_integration_constants.py +16 -0
  38. package/hooks/validators/mypy_integration.py +145 -24
  39. package/hooks/validators/python_antipattern_checks.py +16 -0
  40. package/hooks/validators/run_all_validators.py +9 -3
  41. package/hooks/validators/test_mypy_integration.py +154 -0
  42. package/hooks/validators/test_python_antipattern_checks.py +112 -1
  43. package/hooks/validators/test_run_all_validators_pretooluse.py +16 -0
  44. package/package.json +1 -1
  45. package/rules/CLAUDE.md +1 -0
  46. package/rules/verified-commit-gate-skip.md +28 -0
  47. package/skills/auditing-claude-config/CLAUDE.md +2 -1
  48. package/skills/auditing-claude-config/SKILL.md +114 -176
  49. package/skills/auditing-claude-config/reference/probe-hook.md +74 -0
  50. package/skills/autoconverge/CLAUDE.md +1 -0
  51. package/skills/autoconverge/SKILL.md +310 -346
  52. package/skills/autoconverge/reference/CLAUDE.md +1 -0
  53. package/skills/autoconverge/reference/copilot-findings.md +51 -0
  54. package/skills/closeout/SKILL.md +7 -9
  55. package/skills/copilot-finding-triage/SKILL.md +5 -7
  56. package/skills/copilot-review/CLAUDE.md +3 -2
  57. package/skills/copilot-review/SKILL.md +119 -155
  58. package/skills/copilot-review/templates/subagent-prompt.md +49 -0
  59. package/skills/fresh-branch/CLAUDE.md +6 -9
  60. package/skills/fresh-branch/SKILL.md +84 -33
  61. package/skills/fresh-branch/scripts/create_fresh_branch.py +445 -0
  62. package/skills/fresh-branch/scripts/fresh_branch_scripts_constants/__init__.py +1 -0
  63. package/skills/fresh-branch/scripts/fresh_branch_scripts_constants/fresh_branch_cli_constants.py +74 -0
  64. package/skills/fresh-branch/scripts/test_create_fresh_branch.py +670 -0
  65. package/skills/pr-converge/SKILL.md +277 -422
  66. package/skills/pr-converge/reference/CLAUDE.md +1 -0
  67. package/skills/pr-converge/reference/progress-checklist.md +168 -0
  68. package/skills/pr-converge/test_step5_host_branch.py +8 -6
  69. package/skills/pr-loop-cloud-transport/SKILL.md +1 -1
  70. package/skills/privacy-hygiene/SKILL.md +68 -115
  71. package/skills/privacy-hygiene/reference/sweep-procedure.md +62 -0
  72. package/skills/session-log/CLAUDE.md +2 -1
  73. package/skills/session-log/SKILL.md +4 -26
  74. package/skills/session-log/templates/frontmatter.md +40 -0
  75. package/skills/skill-builder/CLAUDE.md +8 -7
  76. package/skills/skill-builder/SKILL.md +26 -11
  77. package/skills/skill-builder/references/CLAUDE.md +3 -1
  78. package/skills/skill-builder/references/delegation-map.md +21 -12
  79. package/skills/skill-builder/references/description-field.md +9 -11
  80. package/skills/skill-builder/references/deterministic-elements.md +218 -0
  81. package/skills/skill-builder/references/self-audit-checklist.md +62 -45
  82. package/skills/skill-builder/references/skill-modularity.md +8 -9
  83. package/skills/skill-builder/templates/CLAUDE.md +2 -2
  84. package/skills/skill-builder/templates/gap-analysis.md +15 -0
  85. package/skills/skill-builder/workflows/CLAUDE.md +5 -5
  86. package/skills/skill-builder/workflows/improve-skill.md +18 -9
  87. package/skills/skill-builder/workflows/new-skill.md +23 -15
  88. package/skills/skill-builder/workflows/polish-skill.md +28 -21
@@ -6,6 +6,7 @@ Reference documents for the `pr-converge` skill. These files define the per-tick
6
6
 
7
7
  | File | Purpose |
8
8
  |---|---|
9
+ | `progress-checklist.md` | The per-tick eleven-step checklist (Step 0 open → Step 11 report), each step pointing to its spoke file |
9
10
  | `per-tick.md` | Step-by-step procedure for one tick (resolve HEAD, run the internal CODE_REVIEW and BUGTEAM phases, then the terminal BUGBOT and COPILOT_WAIT gates, schedule next wakeup) |
10
11
  | `convergence-gates.md` | Six gates that must all pass before the PR is marked ready for review |
11
12
  | `fix-protocol.md` | pr-converge deltas on the `pr-fix-protocol` skill: multi-PR teammate obligations and the same-tick bugbot re-trigger rule |
@@ -0,0 +1,168 @@
1
+ # pr-converge progress checklist
2
+
3
+ The per-tick step sequence for the pr-converge loop. The hub
4
+ ([`../SKILL.md`](../SKILL.md)) points here; run these steps in order, one pass
5
+ per tick.
6
+
7
+ State variables (`phase`, `bugbot_clean_at`, `code_review_clean_at`,
8
+ `bugteam_clean_at`, `copilot_clean_at`, `merge_state_status`, counters) are
9
+ defined in [`state-schema.md`](state-schema.md). Ground rules
10
+ in [`ground-rules.md`](ground-rules.md).
11
+
12
+ Each step references its spoke file for full procedural detail — MCP calls,
13
+ script invocations, decision criteria. Every "return to Step N" means the next
14
+ tick starts fresh from that step.
15
+
16
+ **Hard gate: do not advance from any step while ANY unresolved review
17
+ thread exists on the PR.** Sweep semantics and per-thread handling live in
18
+ the shared fix protocol
19
+ ([`../../../_shared/pr-loop/fix-protocol.md`](../../../_shared/pr-loop/fix-protocol.md)
20
+ step 12; skill deltas in [`fix-protocol.md`](fix-protocol.md)).
21
+
22
+ **Full-PR-diff rule: every CODE-REVIEW round (Step 5) and every BUGTEAM
23
+ round (Step 6) covers the FULL `origin/main...HEAD` diff — every file
24
+ the PR touches.** A round that scopes to a subset — only the last commit,
25
+ only files touched since the prior clean SHA, only bugbot-flagged paths,
26
+ or any other delta cut — does not satisfy the gate, and a "clean" verdict
27
+ against a partial diff is not a valid clean. Re-run the round against the
28
+ full diff before recording `code_review_clean_at` or treating the bugteam
29
+ round as converged. This rule holds every tick, every loop, every PR.
30
+
31
+ - [ ] **Step 0: Open the run**
32
+ Apply the `pr-loop-lifecycle` skill's Open section
33
+ (`../../pr-loop-lifecycle/SKILL.md`): permission grant + worktree preflight.
34
+
35
+ - [ ] **Step 1: Resolve PR scope + PR worktree**
36
+ Apply Step 1.5 scope resolution in
37
+ [`per-tick.md`](per-tick.md). Resolve the **PR
38
+ worktree** — the local checkout every local step this tick targets:
39
+ the `EnterWorktree` checkout when the PR shares the session's repo,
40
+ else a checkout of the PR's repo that the working directory routes
41
+ into via `cd`. Cross-repo routing is automatic, not a fork.
42
+ See: [`per-tick.md` § Step 1](per-tick.md)
43
+ and [§ Step 1.5](per-tick.md)
44
+
45
+ - [ ] **Step 2: Initialize loop state**
46
+ `phase = CODE_REVIEW`; all counters at zero; `run_name` resolved.
47
+
48
+ - [ ] **Step 3: Mergeability check**
49
+ See: [`convergence-gates.md` § (c)](convergence-gates.md)
50
+
51
+ ```
52
+ pull_request_read(method="get") → .mergeable_state, .mergeable
53
+ ```
54
+
55
+ - [ ] mergeable → advance to Step 4
56
+ - [ ] not mergeable → rebase → force-push → return to Step 1
57
+
58
+ - [ ] **Step 4: BUGBOT — terminal Bugbot confirmation gate**
59
+ Step 6 routes here after BUGTEAM converges. Bugbot confirms code the
60
+ internal passes already drove to clean.
61
+ See: [`per-tick.md` § BUGBOT terminal gate + Step 3](per-tick.md);
62
+ availability and trigger via `reviewer-gates`
63
+ (`../../reviewer-gates/SKILL.md` § Gate 1 / Gate 3).
64
+
65
+ - [ ] **disabled / down** → `bugbot_down = true` → Step 7
66
+ - [ ] **dirty on `current_head`** → apply shared fix protocol
67
+ ([`../../../_shared/pr-loop/fix-protocol.md`](../../../_shared/pr-loop/fix-protocol.md);
68
+ skill deltas in [`fix-protocol.md`](fix-protocol.md))
69
+ → push → reset push-invalidated markers → `phase = CODE_REVIEW` → Step 5
70
+ - [ ] **clean on `current_head`** → zero unresolved threads (else fix + resolve first)
71
+ → `bugbot_clean_at = current_head` → Step 7
72
+ - [ ] **no review / commit_id mismatch** → `reviewer-gates` Bugbot flow (Gate 3):
73
+ silent pass → stamp + Step 7; queued/triggered → 360s wakeup → Step 4;
74
+ down → `bugbot_down = true` → Step 7
75
+
76
+ - [ ] **Step 5: CODE-REVIEW — static sweep, review, fix, advance**
77
+ Entry phase every tick; re-entered after any fix push.
78
+ See: [`per-tick.md` § CODE_REVIEW entry](per-tick.md).
79
+ Pre-condition: cwd is the Step 1.5 PR worktree on `current_head`.
80
+ Scope: FULL `origin/main...HEAD` diff every tick (no path args, no delta cut).
81
+ Review always runs at effort high on model opus through
82
+ `invoke_code_review.py`. Mode decision inputs: host profile + session
83
+ model. Call:
84
+ `python "$HOME/.claude/scripts/invoke_code_review.py" --cwd <PR-worktree>
85
+ --session-model <alias>`. Chain mode uses that cwd and empty stdin; the
86
+ chain process never commits and never pushes. JSON stdout carries
87
+ `mode` (`in_session` | `chain`), `served_command`, `returncode`, and
88
+ `dirty_tree`. Config/host errors still emit that JSON with non-zero
89
+ `returncode` (no traceback-only failure).
90
+
91
+ - [ ] **Static sweep fails** → apply shared fix protocol → push → reset markers
92
+ → stay CODE_REVIEW → Step 5
93
+ - [ ] **`mode == in_session`** (Claude host, session model opus) → run
94
+ `/code-review high --fix` in-session (no path args)
95
+ - [ ] **`mode == chain`** (any other host or non-opus session) → helper
96
+ already ran the headless review; read `returncode`,
97
+ `served_command`, and `dirty_tree` from JSON
98
+ - [ ] **failed review** (`returncode != 0`, or chain with null
99
+ `served_command`) → do not set `code_review_clean_at` → stay
100
+ CODE_REVIEW → Step 5
101
+ - [ ] **fixes applied** (`dirty_tree` true / working tree dirty) →
102
+ commit + push via shared fix protocol → reset markers → stay
103
+ CODE_REVIEW → Step 5
104
+ - [ ] **clean** (successful serve: `returncode == 0`, chain
105
+ `served_command` non-null when chain, and `dirty_tree` false) →
106
+ zero unresolved threads (else fix + resolve) →
107
+ `code_review_clean_at = current_head` → `phase = BUGTEAM` → Step 6
108
+
109
+ - [ ] **Step 6: BUGTEAM — run, decide, fix, reply, resolve**
110
+ See: [`per-tick.md` § Step 2 BUGTEAM](per-tick.md);
111
+ [`../../bugteam/SKILL.md`](../../bugteam/SKILL.md).
112
+ Pre-condition: `code_review_clean_at == current_head`.
113
+ Mandatory: `Skill({skill: "bugteam", args: "<PR URL>"})` this tick
114
+ (enforcer-blocked otherwise; `qbug` is not a substitute). Scope: FULL
115
+ `origin/main...HEAD` diff. Re-resolve HEAD after bugteam.
116
+
117
+ - [ ] **bugteam pushed** → verify threads replied + resolved → reset markers
118
+ → `phase = CODE_REVIEW` → 360s wakeup → Step 5
119
+ - [ ] **converged, no push** → zero unresolved threads →
120
+ `bugteam_clean_at = current_head` → `phase = BUGBOT` → Step 4
121
+ - [ ] **findings without committed fixes** → apply shared fix protocol → push →
122
+ reset markers → `phase = CODE_REVIEW` → Step 5
123
+
124
+ - [ ] **Step 7: Convergence gates**
125
+ Full procedure: [`convergence-gates.md`](convergence-gates.md).
126
+
127
+ Pre-condition: Step 6 converged AND (`bugbot_clean_at == current_head` OR
128
+ `bugbot_down`). The terminal Bugbot gate (Step 4) sets that state just
129
+ before these gates run. Count unresolved threads before each gate.
130
+ Every gate records evidence; gate (f) cites evidence from (a)–(e).
131
+
132
+ - [ ] **(a) Copilot findings** — fetch Copilot on `current_head`; dirty → fix + return to Step 5; clean → stamp `copilot_clean_at`; absent → continue; when `copilot_down`, skip
133
+ - [ ] **(b) Claude reviewer** — fetch Claude on `current_head`; dirty → fix + return to Step 5; clean or absent → continue
134
+ - [ ] **(c) Mergeability** — `mergeable_state == "clean"` and `mergeable == true`; dirty → rebase + return to Step 1; blocked/behind/unknown/unstable → hard blocker
135
+ - [ ] **(d) Post-convergence Copilot request** — request Copilot when not pending and not `copilot_down`; enter `COPILOT_WAIT` (Step 7a); when `copilot_down`, skip to (e)
136
+ - [ ] **(e) Thread-resolution** — zero unresolved threads across the PR; else sweep + fix/resolve
137
+ - [ ] **(f) Mark ready** — run `check_convergence.py`; exit 0 → `update_pull_request(draft=false)` → Step 8; exit 1 → fix path; exit 2 → retry/stop
138
+
139
+ - [ ] **Step 7a: COPILOT_WAIT — fetch Copilot, decide**
140
+ See: [`per-tick.md` § Step 2 COPILOT_WAIT](per-tick.md).
141
+ Skipped entirely when `copilot_down` (gate (d) never enters this phase).
142
+
143
+ - [ ] **clean** → `copilot_clean_at = current_head` → Step 7 (re-validate (b), (c), (e), (f))
144
+ - [ ] **dirty** → apply shared fix protocol
145
+ ([`../../../_shared/pr-loop/fix-protocol.md`](../../../_shared/pr-loop/fix-protocol.md);
146
+ skill deltas in [`fix-protocol.md`](fix-protocol.md))
147
+ → push → reset markers → `phase = CODE_REVIEW` → Step 5
148
+ - [ ] **no review yet** → increment `copilot_wait_count` → ≥ 3 hard-blocks;
149
+ else 360s wakeup → Step 7a next tick
150
+
151
+ - [ ] **Step 8: Clean working tree**
152
+ `pr-loop-lifecycle` Close (`../../pr-loop-lifecycle/SKILL.md`).
153
+ See: [`../../pr-loop-lifecycle/reference/teardown-publish-permissions.md` § Clean working tree](../../pr-loop-lifecycle/reference/teardown-publish-permissions.md)
154
+
155
+ - [ ] **Step 9: Rewrite PR description**
156
+ `pr-loop-lifecycle` Close.
157
+ See: [`../../pr-loop-lifecycle/reference/teardown-publish-permissions.md` § Publish the final PR description](../../pr-loop-lifecycle/reference/teardown-publish-permissions.md)
158
+
159
+ - [ ] **Step 10: Revoke project permissions (always)**
160
+ `pr-loop-lifecycle` Close (`../../pr-loop-lifecycle/SKILL.md` § Close).
161
+
162
+ - [ ] **Step 11: Print final report**
163
+ Print this block verbatim — no paraphrase, no extra commentary:
164
+ ```
165
+ /pr-converge exit: converged
166
+ Loops: <N>
167
+ Final commit: <SHA>
168
+ ```
@@ -11,7 +11,7 @@ from pathlib import Path
11
11
 
12
12
 
13
13
  SKILL_ROOT = Path(__file__).resolve().parent
14
- SKILL_MARKDOWN_PATH = SKILL_ROOT / "SKILL.md"
14
+ PROGRESS_CHECKLIST_MARKDOWN_PATH = SKILL_ROOT / "reference" / "progress-checklist.md"
15
15
  PER_TICK_MARKDOWN_PATH = SKILL_ROOT / "reference" / "per-tick.md"
16
16
 
17
17
  HELPER_SCRIPT_NAME = "invoke_code_review.py"
@@ -45,10 +45,10 @@ def _code_review_section(per_tick_text: str) -> str:
45
45
  return per_tick_text[section_start:section_end]
46
46
 
47
47
 
48
- def _step_five_checklist(skill_text: str) -> str:
49
- step_start = skill_text.index("**Step 5: CODE-REVIEW")
50
- step_end = skill_text.index("**Step 6: BUGTEAM", step_start)
51
- return skill_text[step_start:step_end]
48
+ def _step_five_checklist(progress_checklist_text: str) -> str:
49
+ step_start = progress_checklist_text.index("**Step 5: CODE-REVIEW")
50
+ step_end = progress_checklist_text.index("**Step 6: BUGTEAM", step_start)
51
+ return progress_checklist_text[step_start:step_end]
52
52
 
53
53
 
54
54
  def test_per_tick_code_review_names_helper_and_mode_inputs() -> None:
@@ -75,7 +75,9 @@ def test_per_tick_code_review_names_helper_and_mode_inputs() -> None:
75
75
 
76
76
 
77
77
  def test_skill_step_five_checklist_names_helper_and_mode_inputs() -> None:
78
- step_five_checklist = _step_five_checklist(_read_markdown(SKILL_MARKDOWN_PATH))
78
+ step_five_checklist = _step_five_checklist(
79
+ _read_markdown(PROGRESS_CHECKLIST_MARKDOWN_PATH)
80
+ )
79
81
  assert HELPER_SCRIPT_NAME in step_five_checklist
80
82
  assert HOST_PROFILE_PHRASE in step_five_checklist
81
83
  assert SESSION_MODEL_PHRASE in step_five_checklist
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pr-loop-cloud-transport
3
- description: Runs any PR-loop skill in a Claude Code session whose gh CLI cannot act on the PR — the binary is absent, gh auth status fails, or the active login cannot act on the PR's owner. A six-step transport workflow loads the GitHub MCP schemas, fixes origin/HEAD before pushes, keys review rules to the live MCP identity, routes every GitHub operation through the gh-to-MCP substitution matrix, reads Copilot status from what lands on the PR, and self-checks the posts the gh-text hooks cannot gate. Use at run start when pr-converge, autoconverge, bugteam, qbug, findbugs, fixbugs, monitor-open-prs, or copilot-review runs in a cloud session, when `command -v gh` or `gh auth status` fails, or when an MCP tool call fails with InputValidationError.
3
+ description: Runs any PR-loop skill in a Claude Code session whose gh CLI cannot act on the PR. Use at run start when pr-converge, autoconverge, bugteam, qbug, findbugs, fixbugs, monitor-open-prs, or copilot-review runs in a cloud session, when `command -v gh` or `gh auth status` fails, or when an MCP tool call fails with InputValidationError.
4
4
  ---
5
5
 
6
6
  # PR-loop cloud transport
@@ -1,115 +1,68 @@
1
- ---
2
- name: privacy-hygiene
3
- description: Full-repo sweep for personal data and secrets before commit or durable GitHub post. Use when preparing a PR, cleaning a leak, or when `pii_prevention_blocker` denies a write, post, or commit. Triggers on "privacy hygiene", "personal data", "secret sweep", "sanitize repository", "/privacy-hygiene".
4
- ---
5
-
6
- # privacy-hygiene
7
-
8
- ## Overview
9
-
10
- Find and remove personal data and high-confidence secrets before they land in git history or a durable GitHub post. The `pii_prevention_blocker` hook blocks the common cases at write, post, and commit time. This skill is the full sweep when you need a broader pass or a remediation plan.
11
-
12
- **Announce at start:** "Running privacy-hygiene sweep."
13
-
14
- ## When to run a full sweep
15
-
16
- - Before the first push of a branch that touched logs, screenshots, config samples, or machine-local paths
17
- - After a hook block on email, home path, LAN address, or secret material
18
- - Before opening a PR to a repository that is public (or will be made public)
19
- - After pasting support tickets, env dumps, or terminal transcripts into the tree
20
-
21
- ## What the automated gate blocks
22
-
23
- | Category | Blocked examples | Allowed residual |
24
- |---|---|---|
25
- | Email | `user@example.com` | `user@example.com`, `user@example.org`, `user@example.net` |
26
- | Home path | `C:/Users/example/...`, `/Users/example/...`, `/home/example/...` | `C:/Users/example/...`, `C:/Users/<you>/...`, `/Users/alice/...` |
27
- | LAN address | Unlisted `10.x` / `172.16–31.x` / `192.168.x` | Public addresses; your NAS host from `CLAUDE_NAS_HOST` or `~/.claude/local-identity.json`; entries in `ALL_ALLOWLISTED_PRIVATE_IP_ADDRESSES` |
28
- | Secret | `ghp_…`, `github_pat_…`, `AKIA…`, PEM private-key headers | Public keys, redacted `***`, env var names without values |
29
-
30
- Surfaces:
31
-
32
- 1. **Write / Edit / MultiEdit** — payload text about to land on disk (via PreToolUse dispatcher)
33
- 2. **Durable posts** — `gh pr/issue create|comment|edit|review` bodies and GitHub MCP body/comment fields (Bash and PowerShell)
34
- 3. **git commit** — staged blob text (non-exempt paths) on Bash and PowerShell, including `git.exe` and flag forms (`--no-verify`, `-c`, `-C`). Commit message bodies (`-m` / `-F`) are out of scope for the automated gate
35
-
36
- ## Sweep procedure
37
-
38
- ### 1. Scope the tree
39
-
40
- ```
41
- git status -sb
42
- git diff --stat
43
- git diff --cached --stat
44
- ```
45
-
46
- Prefer the branch diff vs `origin/main` for PR prep:
47
-
48
- ```
49
- git fetch origin main
50
- git diff --name-only origin/main...HEAD
51
- ```
52
-
53
- ### 2. Search for high-confidence patterns
54
-
55
- Run from the repo root (PowerShell-friendly example):
56
-
57
- ```
58
- rg -n --hidden -g '!node_modules' -g '!.git' -e '@[A-Za-z0-9.-]+\.[A-Za-z]{2,}' -e 'Users[/\\][^/\\]+' -e '[/]home/[^/]+' -e '\b(10\.\d+\.\d+\.\d+|192\.168\.\d+\.\d+|172\.(1[6-9]|2\d|3[0-1])\.\d+\.\d+)\b' -e '\b(ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9_]{20,}\b' -e '\bgithub_pat_[A-Za-z0-9_]{20,}\b' -e '\bAKIA[0-9A-Z]{16}\b' -e '-----BEGIN [A-Z ]*PRIVATE KEY-----'
59
- ```
60
-
61
- Review each hit. Ignore:
62
-
63
- - Test fixtures under `test_*.py` / `*_test.py` / `/tests/` (synthetic only)
64
- - `LICENSE` / copyright notice identity that is intentional and public
65
- - This package's own `pii_scanner` / `pii_prevention_constants` modules
66
- - Documented placeholders (`user@example.com`, `C:/Users/<you>/`)
67
-
68
- ### 3. Remediate
69
-
70
- | Hit | Fix |
71
- |---|---|
72
- | Real email | Replace with `user@example.com` or remove |
73
- | Home path | Use `Path.home()`, `~`, or `C:/Users/<you>/` |
74
- | LAN address | Remove, use a hostname, or — for your own NAS — set the host in `CLAUDE_NAS_HOST` or `~/.claude/local-identity.json`, both of which stay out of git |
75
- | Credential material | Remove from the tree; rotate the credential; load from env/secret store |
76
- | Already committed | Rewrite is not enough if already pushed — rotate secrets; scrub history only with explicit user approval |
77
-
78
- ### 4. Re-check before commit / post
79
-
80
- - Stage only clean files
81
- - Prefer `--body-file` for `gh` posts (also required by the gh-body-file rule)
82
- - Let `pii_prevention_blocker` re-run on the next Write / commit / post
83
-
84
- ## Accepted residual (do not over-scrub)
85
-
86
- - LICENSE copyright lines naming a legal person or org that owns the work
87
- - Intentional public maintainer identity published on purpose
88
- - Example domains reserved for documentation (`example.com` and siblings)
89
- - Placeholder home users (`example`, `user`, `alice`, `<you>`, `YOUR_USER`)
90
- - The NAS host you configure locally (allowlisted at scan time, never committed)
91
- - Public addresses and docs that name private ranges without a live host (still prefer hostnames)
92
-
93
- ## Enable on any machine / public repository
94
-
95
- Install or reinstall the package so hooks and this skill land under `~/.claude/`:
96
-
97
- ```
98
- cd packages/claude-dev-env
99
- node bin/install.mjs
100
- ```
101
-
102
- Hooks register via `hooks/hooks.json` into `~/.claude/settings.json`. Once installed, the same gates apply in every repository the agent touches — private or public.
103
-
104
- ## Open knobs
105
-
106
- - **NAS / LAN allowlist:** Unlisted private IPs are blocked. The scanner resolves your NAS host from `CLAUDE_NAS_HOST`, then `~/.claude/local-identity.json` (`nas.host`), and allowlists it when it is a private address, so the committed tree holds no real host. `ALL_ALLOWLISTED_PRIVATE_IP_ADDRESSES` in `hooks_constants` holds the static allowlist for any host every machine must share.
107
- - **Commit-scan exempt repositories:** named owner/repo slugs skip the staged-commit PII scan only. Set `CLAUDE_PII_EXEMPT_REPOS` (comma-separated `owner/repo` values) or list them under `pii_exempt_repositories` in `~/.claude/local-identity.json`. Matching uses the repository's `remote.origin.url` and accepts only the exact host `github.com` (https, ssh scheme, or scp-style). A repository with no readable origin is never exempt (fail-closed to scanning). Write / Edit / MultiEdit and durable post bodies still scan in every repository.
108
- - **Public maintainer identity:** when a real email or name is intentional product surface, keep it and note that in the PR body so reviewers do not treat it as a leak.
109
-
110
- ## What this skill does not do
111
-
112
- - Does not rewrite git history without explicit user approval
113
- - Does not rotate credentials for you
114
- - Does not replace the write-time hook — it complements it
115
- - Does not scan commit-message text (`-m` / `-F`); keep messages free of secrets yourself
1
+ ---
2
+ name: privacy-hygiene
3
+ description: Full-repo sweep for personal data and secrets before commit or durable GitHub post. Use when preparing a PR, cleaning a leak, or when `pii_prevention_blocker` denies a write, post, or commit. Triggers on "privacy hygiene", "personal data", "secret sweep", "sanitize repository", "/privacy-hygiene".
4
+ ---
5
+
6
+ # privacy-hygiene
7
+
8
+ ## Overview
9
+
10
+ Find and remove personal data and high-confidence secrets before they land in git history or a durable GitHub post. The `pii_prevention_blocker` hook blocks the common cases at write, post, and commit time. This skill is the full sweep when you need a broader pass or a remediation plan.
11
+
12
+ **Announce at start:** "Running privacy-hygiene sweep."
13
+
14
+ ## When to run a full sweep
15
+
16
+ - Before the first push of a branch that touched logs, screenshots, config samples, or machine-local paths
17
+ - After a hook block on email, home path, LAN address, or secret material
18
+ - Before opening a PR to a repository that is public (or will be made public)
19
+ - After pasting support tickets, env dumps, or terminal transcripts into the tree
20
+
21
+ ## What the automated gate blocks
22
+
23
+ | Category | Blocked examples | Allowed residual |
24
+ |---|---|---|
25
+ | Email | `user@example.com` | `user@example.com`, `user@example.org`, `user@example.net` |
26
+ | Home path | `C:/Users/example/...`, `/Users/example/...`, `/home/example/...` | `C:/Users/example/...`, `C:/Users/<you>/...`, `/Users/alice/...` |
27
+ | LAN address | Unlisted `10.x` / `172.16–31.x` / `192.168.x` | Public addresses; your NAS host from `CLAUDE_NAS_HOST` or `~/.claude/local-identity.json`; entries in `ALL_ALLOWLISTED_PRIVATE_IP_ADDRESSES` |
28
+ | Secret | `ghp_…`, `github_pat_…`, `AKIA…`, PEM private-key headers | Public keys, redacted `***`, env var names without values |
29
+
30
+ Surfaces:
31
+
32
+ 1. **Write / Edit / MultiEdit** — payload text about to land on disk (via PreToolUse dispatcher)
33
+ 2. **Durable posts** — `gh pr/issue create|comment|edit|review` bodies and GitHub MCP body/comment fields (Bash and PowerShell)
34
+ 3. **git commit** — staged blob text (non-exempt paths) on Bash and PowerShell, including `git.exe` and flag forms (`--no-verify`, `-c`, `-C`). Commit message bodies (`-m` / `-F`) are out of scope for the automated gate
35
+
36
+ ## Sweep procedure
37
+
38
+ Run the full-tree sweep in
39
+ [`reference/sweep-procedure.md`](reference/sweep-procedure.md): scope the tree,
40
+ run the ripgrep pass for the four high-confidence pattern families (email, home
41
+ path, LAN address, secret), review each hit against the ignore list, and
42
+ remediate. It also lists the accepted residual — what to leave in place rather
43
+ than over-scrub. The ripgrep command is the only full-tree pass; the write-time
44
+ `pii_prevention_blocker` scans one payload at a time.
45
+
46
+ ## Enable on any machine / public repository
47
+
48
+ Install or reinstall the package so hooks and this skill land under `~/.claude/`:
49
+
50
+ ```
51
+ cd packages/claude-dev-env
52
+ node bin/install.mjs
53
+ ```
54
+
55
+ Hooks register via `hooks/hooks.json` into `~/.claude/settings.json`. Once installed, the same gates apply in every repository the agent touches — private or public.
56
+
57
+ ## Open knobs
58
+
59
+ - **NAS / LAN allowlist:** Unlisted private IPs are blocked. The scanner resolves your NAS host from `CLAUDE_NAS_HOST`, then `~/.claude/local-identity.json` (`nas.host`), and allowlists it when it is a private address, so the committed tree holds no real host. `ALL_ALLOWLISTED_PRIVATE_IP_ADDRESSES` in `hooks_constants` holds the static allowlist for any host every machine must share.
60
+ - **Commit-scan exempt repositories:** named owner/repo slugs skip the staged-commit PII scan only. Set `CLAUDE_PII_EXEMPT_REPOS` (comma-separated `owner/repo` values) or list them under `pii_exempt_repositories` in `~/.claude/local-identity.json`. Matching uses the repository's `remote.origin.url` and accepts only the exact host `github.com` (https, ssh scheme, or scp-style). A repository with no readable origin is never exempt (fail-closed to scanning). Write / Edit / MultiEdit and durable post bodies still scan in every repository.
61
+ - **Public maintainer identity:** when a real email or name is intentional product surface, keep it and note that in the PR body so reviewers do not treat it as a leak.
62
+
63
+ ## What this skill does not do
64
+
65
+ - Does not rewrite git history without explicit user approval
66
+ - Does not rotate credentials for you
67
+ - Does not replace the write-time hook — it complements it
68
+ - Does not scan commit-message text (`-m` / `-F`); keep messages free of secrets yourself
@@ -0,0 +1,62 @@
1
+ # Full-tree PII sweep procedure
2
+
3
+ The on-demand full-repository sweep for the `privacy-hygiene` skill — the
4
+ complement to the write-time `pii_prevention_blocker`, which scans one payload at
5
+ a time. The canonical per-payload patterns live in the hooks' `pii_scanner` and
6
+ `pii_prevention_constants` modules; the ripgrep command below is the only
7
+ full-tree pass. The hub ([`../SKILL.md`](../SKILL.md)) points here.
8
+
9
+ ## 1. Scope the tree
10
+
11
+ ```
12
+ git status -sb
13
+ git diff --stat
14
+ git diff --cached --stat
15
+ ```
16
+
17
+ Prefer the branch diff vs `origin/main` for PR prep:
18
+
19
+ ```
20
+ git fetch origin main
21
+ git diff --name-only origin/main...HEAD
22
+ ```
23
+
24
+ ## 2. Search for high-confidence patterns
25
+
26
+ Run from the repo root (PowerShell-friendly example):
27
+
28
+ ```
29
+ rg -n --hidden -g '!node_modules' -g '!.git' -e '@[A-Za-z0-9.-]+\.[A-Za-z]{2,}' -e 'Users[/\\][^/\\]+' -e '[/]home/[^/]+' -e '\b(10\.\d+\.\d+\.\d+|192\.168\.\d+\.\d+|172\.(1[6-9]|2\d|3[0-1])\.\d+\.\d+)\b' -e '\b(ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9_]{20,}\b' -e '\bgithub_pat_[A-Za-z0-9_]{20,}\b' -e '\bAKIA[0-9A-Z]{16}\b' -e '-----BEGIN [A-Z ]*PRIVATE KEY-----'
30
+ ```
31
+
32
+ Review each hit. Ignore:
33
+
34
+ - Test fixtures under `test_*.py` / `*_test.py` / `/tests/` (synthetic only)
35
+ - `LICENSE` / copyright notice identity that is intentional and public
36
+ - This package's own `pii_scanner` / `pii_prevention_constants` modules
37
+ - Documented placeholders (`user@example.com`, `C:/Users/<you>/`)
38
+
39
+ ## 3. Remediate
40
+
41
+ | Hit | Fix |
42
+ |---|---|
43
+ | Real email | Replace with `user@example.com` or remove |
44
+ | Home path | Use `Path.home()`, `~`, or `C:/Users/<you>/` |
45
+ | LAN address | Remove, use a hostname, or — for your own NAS — set the host in `CLAUDE_NAS_HOST` or `~/.claude/local-identity.json`, both of which stay out of git |
46
+ | Credential material | Remove from the tree; rotate the credential; load from env/secret store |
47
+ | Already committed | Rewrite is not enough if already pushed — rotate secrets; scrub history only with explicit user approval |
48
+
49
+ ## 4. Re-check before commit / post
50
+
51
+ - Stage only clean files
52
+ - Prefer `--body-file` for `gh` posts (also required by the gh-body-file rule)
53
+ - Let `pii_prevention_blocker` re-run on the next Write / commit / post
54
+
55
+ ## Accepted residual (do not over-scrub)
56
+
57
+ - LICENSE copyright lines naming a legal person or org that owns the work
58
+ - Intentional public maintainer identity published on purpose
59
+ - Example domains reserved for documentation (`example.com` and siblings)
60
+ - Placeholder home users (`example`, `user`, `alice`, `<you>`, `YOUR_USER`)
61
+ - The NAS host you configure locally (allowlisted at scan time, never committed)
62
+ - Public addresses and docs that name private ranges without a live host (still prefer hostnames)
@@ -12,7 +12,8 @@ Produces a self-contained HTML session report shaped to the session's character
12
12
 
13
13
  | File | Purpose |
14
14
  |---|---|
15
- | `SKILL.md` | Hub — six steps, gotchas, backend detection, frontmatter contract, run-and-report checklist. Single-file skill; no companion files. |
15
+ | `SKILL.md` | Hub — six steps, gotchas, backend detection, run-and-report checklist. |
16
+ | `templates/frontmatter.md` | The session-page frontmatter contract and the Step 3 notes block. |
16
17
 
17
18
  ## Six steps
18
19
 
@@ -60,21 +60,7 @@ Resolve the metadata used by the frontmatter and the vault path:
60
60
  - **Date:** today's date
61
61
  - **Title:** a 2–5 word summary of the session's primary outcome. Examples: "Amazon Auth Migration", "Source Loading Fix", "PR 475 Convergence". Avoid generic titles like "Bug Fixes".
62
62
 
63
- The frontmatter contract every session report carries (inside an HTML comment, as the first child of `<body>`):
64
-
65
- ```html
66
- <!--
67
- type: session-report
68
- project: [name]
69
- session: [N]
70
- session_id: [uuid]
71
- date: [YYYY-MM-DD]
72
- status: completed|in-progress|blocked
73
- blocked: true|false
74
- vault_context_retrieved: true|false
75
- tags: [session, [project-tag], [topic-tags]]
76
- -->
77
- ```
63
+ The frontmatter contract every session report carries (inside an HTML comment, as the first child of `<body>`) is the metadata block in [`templates/frontmatter.md`](templates/frontmatter.md).
78
64
 
79
65
  Every session report carries this metadata block verbatim so vault search and the tidy step in step 5 work. **Initial values for Step 2's Write:** substitute concrete values for every placeholder — for `session_id`, write the value read from `CLAUDE_CODE_SESSION_ID` in step 1 (or `unknown` when the variable is unset); for `vault_context_retrieved`, write the literal value `false` (the safe default before Step 3's vault-MCP-tool scan completes). Step 3 then Edits `vault_context_retrieved` to `true` if any of the three vault MCP tools fired this session.
80
66
 
@@ -113,16 +99,7 @@ Review the conversation history for any use of these vault MCP tools (look only
113
99
  Edit the vault HTML via two Edit calls:
114
100
 
115
101
  1. Set the frontmatter `vault_context_retrieved` field to `true` when any of the three tools fired this session, `false` otherwise.
116
- 2. Append one fact — vault-context status — into whatever section the report designer placed for notes / metadata / references. If the report has no such section, append a fresh `<h2>Notes</h2>` block at the end of the content:
117
-
118
- ```html
119
- <h2>Notes</h2>
120
- <ul>
121
- <!-- Pick exactly one of the two forms based on whether vault MCP tools fired this session: -->
122
- <li><strong>Vault context:</strong> Retrieved ([list of note paths])</li>
123
- <li><strong>Vault context:</strong> Not retrieved</li>
124
- </ul>
125
- ```
102
+ 2. Append one fact — vault-context status — into whatever section the report designer placed for notes / metadata / references. If the report has no such section, append a fresh `<h2>Notes</h2>` block (in [`templates/frontmatter.md`](templates/frontmatter.md)) at the end of the content.
126
103
 
127
104
  If the report already has a notes / references section, use Edit to insert one matching child element at the end of that section. The element shape mirrors whatever the section already uses: an extra `<li>` before the closing `</ul>` for a list, an extra `<dt>Vault context</dt><dd>…</dd>` pair before the closing `</dl>` for a description list, an extra `<p><strong>Vault context:</strong> …</p>` before the section's closing tag for a paragraph-based section. Pick the form that matches the surrounding markup.
128
105
 
@@ -189,4 +166,5 @@ The primary outcome comes from the session title resolved in step 1.
189
166
 
190
167
  ## Folder map
191
168
 
192
- - `SKILL.md` — this hub. Single-file skill; no companions.
169
+ - `SKILL.md` — this hub.
170
+ - `templates/frontmatter.md` — the report frontmatter contract and the Step 3 notes block.
@@ -0,0 +1,40 @@
1
+ # Session-log template blocks
2
+
3
+ The two verbatim HTML blocks the `session-log` skill drops into every session
4
+ page. The hub ([`../SKILL.md`](../SKILL.md)) points here from Step 1 / Step 2
5
+ (frontmatter) and Step 3 (notes).
6
+
7
+ ## Frontmatter contract
8
+
9
+ The first child of `<body>`, inside an HTML comment. Substitute a concrete value
10
+ for every placeholder; `vault_context_retrieved` starts `false` and Step 3 sets
11
+ it.
12
+
13
+ ```html
14
+ <!--
15
+ type: session-report
16
+ project: [name]
17
+ session: [N]
18
+ session_id: [uuid]
19
+ date: [YYYY-MM-DD]
20
+ status: completed|in-progress|blocked
21
+ blocked: true|false
22
+ vault_context_retrieved: true|false
23
+ tags: [session, [project-tag], [topic-tags]]
24
+ -->
25
+ ```
26
+
27
+ ## Notes block (Step 3)
28
+
29
+ Append one vault-context line. When the page already carries a notes /
30
+ references section, add a matching child element to that section; use the block
31
+ below only when the page has no such section.
32
+
33
+ ```html
34
+ <h2>Notes</h2>
35
+ <ul>
36
+ <!-- Pick exactly one of the two forms based on whether vault MCP tools fired this session: -->
37
+ <li><strong>Vault context:</strong> Retrieved ([list of note paths])</li>
38
+ <li><strong>Vault context:</strong> Not retrieved</li>
39
+ </ul>
40
+ ```
@@ -1,12 +1,12 @@
1
1
  # skill-builder
2
2
 
3
- Orchestrates the skill-building lifecycle: classify type, scaffold folders, write via `skill-writer`, enforce modularity (sub-skills / composition), write description as a trigger catalog, self-audit, and refine from real usage.
3
+ Orchestrates the skill-building lifecycle: classify type, scaffold folders, write via `skill-writer`, enforce modularity (sub-skills / composition), write description as a trigger catalog, require deterministic steps as code, self-audit, and refine from real usage.
4
4
 
5
- **Trigger:** build a skill, new skill workflow, improve this skill, optimize skill description, skill development lifecycle, skill modularity, description trigger catalog.
5
+ **Trigger:** build a skill, new skill workflow, improve this skill, optimize skill description, skill development lifecycle, skill modularity, description trigger catalog, deterministic skill scripts.
6
6
 
7
7
  ## Purpose
8
8
 
9
- Enforces craft standards for new and existing skills. For quick one-off SKILL.md edits, use `/skill-writer` directly. This skill classifies, scaffolds, gathers context (including composition plan and description triggers), delegates writing, and self-audits.
9
+ Enforces craft standards for new and existing skills. For quick one-off SKILL.md edits, use `/skill-writer` directly. This skill classifies, scaffolds, gathers context (composition plan, description triggers, deterministic inventory), delegates writing, and self-audits.
10
10
 
11
11
  ## Key files
12
12
 
@@ -17,13 +17,14 @@ Enforces craft standards for new and existing skills. For quick one-off SKILL.md
17
17
  | `references/progressive-disclosure.md` | Hub pattern, folder conventions, hard rules |
18
18
  | `references/skill-modularity.md` | Cross-skill modularity, sub-skills, composition plan |
19
19
  | `references/description-field.md` | Description as trigger catalog (not story prose) |
20
- | `references/self-audit-checklist.md` | Mandatory post-build audit |
20
+ | `references/deterministic-elements.md` | Deterministic steps as code/task seeds; no markdown checkbox boards |
21
+ | `references/self-audit-checklist.md` | Post-build audit task seeds (TaskCreate / TodoWrite) |
21
22
  | `references/delegation-map.md` | Subagent handoff patterns and transcript guidance |
22
23
  | `references/thariq-x-post-skills.json` | Source reference — lessons from building Claude Code skills |
23
24
  | `workflows/new-skill.md` | Full lifecycle for new skills (6 steps) |
24
25
  | `workflows/improve-skill.md` | Observation-first flow for existing skills (6 steps) |
25
26
  | `workflows/polish-skill.md` | Description trigger-catalog audit and final validation (5 steps) |
26
- | `templates/gap-analysis.md` | Gaps, composition plan, description triggers |
27
+ | `templates/gap-analysis.md` | Gaps, composition plan, description triggers, deterministic inventory |
27
28
 
28
29
  ## Subdirectories
29
30
 
@@ -43,6 +44,6 @@ Enforces craft standards for new and existing skills. For quick one-off SKILL.md
43
44
  ## Conventions
44
45
 
45
46
  - Every build ends with the self-audit at `references/self-audit-checklist.md`; fix failures before delivery.
46
- - Modularity items and description trigger-catalog items are mandatory on every delivery.
47
- - `skill-builder` orchestrates; `skill-writer` authors. Handoff packet must include type, gap analysis, composition plan, description trigger catalog, degree-of-freedom assessment, and constraints.
47
+ - Modularity items, description trigger-catalog items, and deterministic-element classification are mandatory on every delivery.
48
+ - `skill-builder` orchestrates; `skill-writer` authors. Handoff packet must include type, gap analysis, composition plan, description trigger catalog, deterministic inventory, degree-of-freedom assessment, and constraints.
48
49
  - Claude A / Claude B: Claude A (this session) designs; Claude B (subagents) tests the built skill on real tasks.