claude-dev-env 2.28.1 → 2.30.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 (157) hide show
  1. package/.agents/agents/AGENTS.md +0 -31
  2. package/.agents/agents/clean-coder.md +1 -1
  3. package/.agents/agents/pr-description-writer.md +21 -6
  4. package/.agents/agents/reference/README.md +6 -0
  5. package/.agents/agents/reference/pr-description-illustrative-voice.md +45 -0
  6. package/.agents/agents/reference/pr-description-verification.md +19 -0
  7. package/.agents/agents/test_agent_frontmatter.py +3 -1
  8. package/.agents/agents/test_pr_description_writer_style.py +47 -0
  9. package/.agents/skills/AGENTS.md +0 -70
  10. package/.agents/skills/_shared/AGENTS.md +0 -44
  11. package/.agents/skills/_shared/advisor/AGENTS.md +0 -8
  12. package/.agents/skills/_shared/pr-loop/AGENTS.md +0 -57
  13. package/.agents/skills/_shared/pr-loop/prompts/AGENTS.md +0 -8
  14. package/.agents/skills/_shared/pr-loop/scripts/AGENTS.md +0 -34
  15. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/AGENTS.md +0 -23
  16. package/.agents/skills/autoconverge/AGENTS.md +0 -35
  17. package/.agents/skills/autoconverge/reference/AGENTS.md +0 -15
  18. package/.agents/skills/autoconverge/workflow/AGENTS.md +0 -25
  19. package/.agents/skills/autoconverge/workflow/autoconverge_report_constants/AGENTS.md +0 -15
  20. package/.agents/skills/everything-search/AGENTS.md +0 -16
  21. package/.agents/skills/fresh-branch/AGENTS.md +0 -13
  22. package/.agents/skills/grok-spawn/AGENTS.md +0 -27
  23. package/.agents/skills/orchestrator/.claude/CLAUDE.md +1 -0
  24. package/.agents/skills/orchestrator/AGENTS.md +1 -0
  25. package/.agents/skills/orchestrator/SKILL.md +44 -53
  26. package/.agents/skills/orchestrator/reference/.claude/CLAUDE.md +1 -0
  27. package/.agents/skills/orchestrator/reference/AGENTS.md +1 -0
  28. package/.agents/skills/orchestrator/reference/consult-the-orchestrator.md +70 -0
  29. package/.agents/skills/orchestrator/reference/executor-consult-block.md +62 -0
  30. package/.agents/skills/orchestrator/reference/host-detect.md +15 -0
  31. package/.agents/skills/orchestrator/test_orchestrator_skill_contract.py +62 -0
  32. package/.agents/skills/orchestrator-refresh/SKILL.md +16 -34
  33. package/.agents/skills/rebase/AGENTS.md +0 -31
  34. package/.agents/skills/session-log/AGENTS.md +0 -31
  35. package/.agents/skills/session-tidy/AGENTS.md +0 -35
  36. package/.agents/skills/skill-builder/AGENTS.md +0 -48
  37. package/.agents/skills/skill-builder/references/AGENTS.md +0 -24
  38. package/.agents/skills/skill-builder/templates/AGENTS.md +0 -13
  39. package/.agents/skills/skill-builder/workflows/AGENTS.md +0 -18
  40. package/.agents/skills/task-build/AGENTS.md +0 -28
  41. package/.agents/skills/update/AGENTS.md +0 -37
  42. package/.agents/skills-archived/AGENTS.md +0 -44
  43. package/.agents/skills-archived/anthropic-plan/AGENTS.md +0 -33
  44. package/.agents/skills-archived/anthropic-plan/scripts/AGENTS.md +0 -10
  45. package/.agents/skills-archived/anthropic-plan/scripts/anthropic_plan_scripts_constants/AGENTS.md +0 -15
  46. package/.agents/skills-archived/anthropic-plan/templates/AGENTS.md +0 -12
  47. package/.agents/skills-archived/anthropic-plan/workflow/AGENTS.md +0 -13
  48. package/.agents/skills-archived/auditing-claude-config/AGENTS.md +0 -20
  49. package/.agents/skills-archived/bugteam/AGENTS.md +0 -29
  50. package/.agents/skills-archived/bugteam/reference/AGENTS.md +0 -19
  51. package/.agents/skills-archived/bugteam/reference/obstacles/AGENTS.md +0 -23
  52. package/.agents/skills-archived/bugteam/scripts/AGENTS.md +0 -29
  53. package/.agents/skills-archived/bugteam/scripts/bugteam_scripts_constants/AGENTS.md +0 -17
  54. package/.agents/skills-archived/codex-review/AGENTS.md +0 -45
  55. package/.agents/skills-archived/codex-review/reference/AGENTS.md +0 -14
  56. package/.agents/skills-archived/codex-review/scripts/codex_review_scripts_constants/AGENTS.md +0 -17
  57. package/.agents/skills-archived/codex-review/test_skill_scaffold.py +13 -3
  58. package/.agents/skills-archived/copilot-review/AGENTS.md +0 -17
  59. package/.agents/skills-archived/pr-converge/AGENTS.md +0 -31
  60. package/.agents/skills-archived/pr-converge/pr_converge_skill_constants/AGENTS.md +0 -25
  61. package/.agents/skills-archived/pr-converge/reference/AGENTS.md +0 -27
  62. package/.agents/skills-archived/pr-converge/reference/obstacles/AGENTS.md +0 -22
  63. package/.agents/skills-archived/pr-converge/scripts/AGENTS.md +0 -45
  64. package/.agents/skills-archived/pr-converge/scripts/pr_converge_scripts_constants/AGENTS.md +0 -17
  65. package/.agents/skills-archived/pr-converge/workflows/AGENTS.md +0 -15
  66. package/.agents/skills-archived/recall/AGENTS.md +0 -29
  67. package/.agents/skills-archived/remember/AGENTS.md +0 -30
  68. package/AGENTS.md +0 -112
  69. package/_shared/AGENTS.md +0 -16
  70. package/_shared/advisor/AGENTS.md +0 -21
  71. package/_shared/advisor/advisor-protocol.md +4 -1
  72. package/_shared/advisor/reference/consult-format.md +4 -2
  73. package/_shared/pr-loop/AGENTS.md +0 -27
  74. package/_shared/pr-loop/code-rules-gate.md +1 -1
  75. package/_shared/pr-loop/scripts/AGENTS.md +0 -49
  76. package/_shared/pr-loop/scripts/code_rules_gate.py +2 -2
  77. package/_shared/pr-loop/scripts/code_rules_gate_parts/AGENTS.md +0 -41
  78. package/_shared/pr-loop/scripts/code_rules_gate_parts/enforcer_loading.py +8 -8
  79. package/_shared/pr-loop/scripts/code_rules_gate_parts/tests/test_enforcer_loading.py +2 -2
  80. package/_shared/pr-loop/scripts/code_rules_gate_parts/tests/test_gate_running.py +1 -1
  81. package/_shared/pr-loop/scripts/codex_review_scripts_constants/AGENTS.md +0 -17
  82. package/_shared/pr-loop/scripts/pr_converge_scripts_constants/AGENTS.md +0 -17
  83. package/_shared/pr-loop/scripts/pr_converge_skill_constants/AGENTS.md +0 -25
  84. package/_shared/pr-loop/scripts/pr_loop_shared_constants/AGENTS.md +0 -25
  85. package/_shared/pr-loop/scripts/tests/AGENTS.md +0 -43
  86. package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +15 -15
  87. package/_shared/process-tree/AGENTS.md +0 -40
  88. package/audit-rubrics/AGENTS.md +0 -42
  89. package/audit-rubrics/category_rubrics/AGENTS.md +0 -36
  90. package/audit-rubrics/prompts/AGENTS.md +0 -36
  91. package/bin/AGENTS.md +0 -118
  92. package/bin/install.test.mjs +1 -1
  93. package/commands/AGENTS.md +0 -14
  94. package/docs/AGENTS.md +0 -31
  95. package/docs/CODE_RULES.md +10 -0
  96. package/docs/references/AGENTS.md +0 -16
  97. package/hooks/AGENTS.md +0 -27
  98. package/hooks/advisory/AGENTS.md +0 -15
  99. package/hooks/blocking/AGENTS.md +0 -112
  100. package/hooks/blocking/claude_md_orphan_file_blocker_parts/AGENTS.md +0 -27
  101. package/hooks/blocking/code_rules_enforcer.py +433 -313
  102. package/hooks/blocking/config/AGENTS.md +0 -9
  103. package/hooks/blocking/inventory_intent_records/AGENTS.md +0 -25
  104. package/hooks/blocking/package_inventory_stale_blocker_parts/AGENTS.md +0 -25
  105. package/hooks/blocking/pii_prevention_blocker_parts/AGENTS.md +0 -23
  106. package/hooks/blocking/tdd_enforcer_parts/AGENTS.md +0 -29
  107. package/hooks/blocking/test_code_rules_enforcer_banned_noun_word.py +1 -1
  108. package/hooks/blocking/test_code_rules_enforcer_class_docstring_methods.py +1 -1
  109. package/hooks/blocking/test_code_rules_enforcer_dispatch_wiring.py +117 -22
  110. package/hooks/blocking/test_code_rules_enforcer_docstring_args_signature.py +1 -1
  111. package/hooks/blocking/test_code_rules_enforcer_docstring_prose_wall_illustration.py +1 -1
  112. package/hooks/blocking/test_code_rules_enforcer_docstring_runon_sentence.py +1 -1
  113. package/hooks/blocking/test_code_rules_enforcer_docstring_unreferenced_param.py +1 -1
  114. package/hooks/blocking/test_code_rules_enforcer_fstring_scan.py +1 -1
  115. package/hooks/blocking/test_code_rules_enforcer_ignored_must_check_return.py +1 -1
  116. package/hooks/blocking/test_code_rules_enforcer_inline_tuple_string_magic.py +1 -1
  117. package/hooks/blocking/test_code_rules_enforcer_join_separator_magic.py +2 -2
  118. package/hooks/blocking/test_code_rules_enforcer_js_returns_object.py +3 -3
  119. package/hooks/blocking/test_code_rules_enforcer_module_docstring_roster.py +1 -1
  120. package/hooks/blocking/test_code_rules_enforcer_naming_pattern.py +1 -1
  121. package/hooks/blocking/test_code_rules_enforcer_narrow_edit.py +117 -38
  122. package/hooks/blocking/test_code_rules_enforcer_output_snapshot.py +121 -0
  123. package/hooks/blocking/test_code_rules_enforcer_precheck_forecast.py +17 -15
  124. package/hooks/blocking/test_code_rules_enforcer_split_entry_1.py +4 -2
  125. package/hooks/blocking/test_code_rules_enforcer_split_entry_2.py +1 -1
  126. package/hooks/blocking/test_code_rules_enforcer_stage.py +1 -1
  127. package/hooks/blocking/test_code_rules_enforcer_string_magic.py +4 -4
  128. package/hooks/blocking/test_code_rules_enforcer_thin_wrapper_files.py +2 -2
  129. package/hooks/blocking/test_code_rules_enforcer_zero_payload_alias.py +2 -2
  130. package/hooks/blocking/test_code_rules_enforcer_zero_payload_alias_hook_routing.py +2 -2
  131. package/hooks/blocking/test_code_rules_validation_phase.py +281 -0
  132. package/hooks/blocking/test_fable_spawn_gate.py +1 -1
  133. package/hooks/blocking/test_pre_tool_use_dispatcher.py +26 -11
  134. package/hooks/git-hooks/AGENTS.md +0 -31
  135. package/hooks/git-hooks/git_hooks_constants/AGENTS.md +0 -20
  136. package/hooks/hooks_constants/AGENTS.md +0 -99
  137. package/hooks/hooks_constants/code_rules_enforcer_constants.py +8 -0
  138. package/hooks/hooks_constants/test_code_rules_enforcer_constants.py +21 -0
  139. package/hooks/hooks_constants/validation_phase_constants.py +34 -0
  140. package/hooks/lifecycle/AGENTS.md +0 -17
  141. package/hooks/observability/AGENTS.md +0 -19
  142. package/hooks/session/AGENTS.md +0 -37
  143. package/hooks/validation/AGENTS.md +0 -19
  144. package/hooks/validators/AGENTS.md +0 -51
  145. package/hooks/validators/README.md +1 -1
  146. package/hooks/validators/config/hook_timing_harness_constants.py +16 -0
  147. package/hooks/validators/hook_timing_harness.py +287 -0
  148. package/hooks/validators/test_hook_timing_harness.py +251 -0
  149. package/hooks/workflow/AGENTS.md +0 -15
  150. package/output-styles/AGENTS.md +0 -14
  151. package/package.json +1 -1
  152. package/rules/AGENTS.md +0 -55
  153. package/scripts/AGENTS.md +0 -55
  154. package/scripts/dev_env_scripts_constants/AGENTS.md +0 -20
  155. package/scripts/sync_to_cursor/AGENTS.md +0 -22
  156. package/scripts/tests/AGENTS.md +0 -34
  157. package/system-prompts/AGENTS.md +0 -24
@@ -1,16 +1 @@
1
- # hooks/workflow
2
1
 
3
- PostToolUse hooks that run after Claude writes a file. They do not block the write; they run follow-up side effects — reformatting the written file and resetting the investigation tracker.
4
-
5
- ## Key files
6
-
7
- | File | Event | What it does |
8
- |---|---|---|
9
- | `auto_formatter.py` | PostToolUse (Write/Edit) | Runs the project's auto-formatter (ruff, prettier, etc.) on the written file and sends a desktop notification when formatting changes are applied |
10
- | `investigation_tracker_reset.py` | PostToolUse | Resets the investigation tracker state after a tool call |
11
- | `test_auto_formatter.py` | — | Tests for `auto_formatter.py` |
12
-
13
- ## Conventions
14
-
15
- - `auto_formatter.py` exits 0 even on failure — it logs warnings to stderr but does not break Claude's flow.
16
- - Tests run with `python -m pytest workflow/test_<name>.py`.
@@ -1,15 +1 @@
1
- # output-styles
2
1
 
3
- Output-style instruction files installed into `~/.claude/output-styles/` by `bin/install.mjs`. Each file instructs an agent or session to respond in a specific voice or format.
4
-
5
- ## Files
6
-
7
- No output-style instruction files ship in this directory.
8
-
9
- ## Format
10
-
11
- Each file uses YAML frontmatter (`name`, `description`, optional `keep-coding-instructions`) followed by Markdown instructions. The `keep-coding-instructions: true` flag tells Claude Code to keep the session's coding rules even when this style is active.
12
-
13
- ## Adding a style
14
-
15
- Create a `.md` file with frontmatter and behavioral instructions, then run `bin/install.mjs` to copy it to `~/.claude/output-styles/`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-dev-env",
3
- "version": "2.28.1",
3
+ "version": "2.30.0",
4
4
  "description": "Claude Code development standards — rules, hooks, agents, commands, and skills",
5
5
  "type": "module",
6
6
  "bin": {
package/rules/AGENTS.md CHANGED
@@ -1,56 +1 @@
1
- ---
2
- paths:
3
- - "**/rules/**"
4
- ---
5
1
 
6
- # rules
7
-
8
- Rule files installed into `~/.claude/rules/` by `bin/install.mjs`. A rule without `paths:` frontmatter loads at the start of every session; a rule with `paths:` frontmatter loads only when the session works with a file its globs match. The `InstructionsLoaded` log records that match as a `path_glob_match` event. The `asd-ste100-language.md` file owns general user-facing language. Each other `.md` file covers one named behavior contract; hook-enforced rules are also backed by a Python hook in `hooks/`.
9
-
10
- ## Files
11
-
12
- | File | Rule |
13
- |---|---|
14
- | `asd-ste100-language.md` | Sole general user-facing language authority; concise conversational adaptation of ASD-STE100 Issue 9 |
15
- | `agent-spawn-protocol.md` | Check context sufficiency before a spawn and ask subagents for file-and-line answers; `/prompt-generator` is recommended for a complex or user-facing spawn |
16
- | `anti-corollary-tests.md` | Tests must carry information: no corollary matrices over canonical reductions, no suite that only matches a dead-implementation default, stated mutation in the audit lane |
17
- | `ask-user-question-required.md` | Every user-directed question goes through the `AskUserQuestion` tool — no plain-text questions |
18
- | `bdd.md` | BDD discovery-driven development workflow and Example Mapping reference |
19
- | `claims-as-quotes.md` | On agent reports, hand-offs, review verdicts, and PR or commit prose, a design-gating claim travels with its quoted lines and `path:line` reference; chat keeps research-mode compact citations; a claim without its quote is a lead to check |
20
- | `cleanup-temp-files.md` | Remove temporary files created during a task when the task is complete |
21
- | `code-standards.md` | Pointer to `CODE_RULES.md` as the single source of truth, including §8 (TDD) and §7 (right-sizing); BDD is the outer process and TDD the inner loop |
22
- | `confirm-implementation-forks.md` | Stop and ask when two or more workable implementation paths change the deliverable |
23
- | `destructive-commands.md` | Allowed removal forms and the ephemeral namespace the `destructive_command_blocker` auto-allows; keep destructive literals out of a Bash command string even as data |
24
- | `doc-inventory-integrity.md` | Three inventory shapes stay in step with the code: a per-directory `CLAUDE.md` file list, a package `README`/`SKILL.md` inventory, and an env-var summary table |
25
- | `docstring-prose-matches-implementation.md` | Prose enumerations in docstrings cover every behavior the body applies |
26
- | `durable-post-artifacts.md` | GitHub post bodies never reference volatile scratch paths; text embeds inline and binary artifacts upload to the `artifacts` release with the permanent URL linked |
27
- | `explore-thoroughly.md` | Read relevant files and map existing patterns before proposing a change |
28
- | `failure-blast-radius.md` | Name what a raise stops — `RunFatal` for the whole run, `ItemBlocked` for one batch member — and keep the batch reaching a deliverable with parked members reported |
29
- | `falsify-before-green.md` | A check's green counts as evidence only after that same check ran red on a named break, with a passing control beside it |
30
- | `file-global-constants.md` | File-global constants need at least two same-file references; otherwise move value to `config/` |
31
- | `filesystem-search.md` | Every filesystem search names a scope; `es.exe`, `Glob`, `Grep`, and `Read` are equally sanctioned, and the `unscoped_search_blocker` denies a walk from a root |
32
- | `gh-cli-conventions.md` | `--body-file` for every `gh` body; `--paginate --slurp` piped to external `jq` for every paginated list read |
33
- | `git-workflow.md` | PR workflow: always create as draft, one commit per review stage, never commit working docs or images; carries the review-response protocol |
34
- | `hedging-claims.md` | State the evidence or name the claim unverified; a hedge word stands in for evidence not gathered, prose discipline with no hook |
35
- | `long-horizon-autonomy.md` | Autonomous-run behaviors: act on what you have, do not end on a promise, delegate and keep working |
36
- | `measurement-denominators.md` | Every reported count names what it scanned and carries its denominator; a rate needs two runs; the consumer cross-checks the count against the scope its denominator names |
37
- | `nas-ssh-invocation.md` | Reach the NAS through the paramiko-backed `nas_ssh_key.py` runner, which signs in-process; every ssh-family client reads the key through file permissions, refuses it, and stalls an unattended run on a password prompt |
38
- | `no-cross-skill-duplicate-helpers.md` | Within one skill a duplicated helper is blocked; across two skill folders a small self-contained copy is a sanctioned isolation tradeoff that draws a non-blocking advisory naming the source skill |
39
- | `orphan-css-class.md` | Every `class="..."` attribute in Python-generated markup has a matching selector in the `<style>` block |
40
- | `paired-test-coverage.md` | A public function omitted by a module's established paired test suite must get a behavioral test |
41
- | `plain-illustrative-docstrings.md` | Public docstring narrative reads plainly and shows behavior with a diagram block (a `::` example or a doctest), painting a concrete scene a general developer follows on first read; a run-on backstop hook, a prose-wall backstop hook, and Category O9 audit enforce it |
42
- | `prompt-workflow-context-controls.md` | Keep prompt-workflow instruction layers small and stable; load heavy skills on demand |
43
- | `re-stage-before-commit.md` | Stage the files edited this session before `git commit`; the session edit stage gate denies a commit that leaves a tracked session edit unstaged, with `-a`, a pathspec, a preceding `git add`, and `# partial-commit` as escapes |
44
- | `research-mode.md` | Three anti-hallucination constraints: say "I don't know", verify with citations, quote for factual grounding |
45
- | `shell-invocation.md` | Windows shell commands run through `pwsh`; no `$(...)`, backtick, or process substitution in a Bash tool command |
46
- | `testing.md` | Test quality and infrastructure standards |
47
- | `vault-context.md` | Search Obsidian vault for prior sessions and decisions before substantive project work |
48
- | `verify-before-asking.md` | Answer questions by inspecting files or running tools before asking; recalled facts expire until re-checked this session |
49
- | `verify-runtime-state.md` | A "component is fine / not at fault" verdict rests on a live probe this session, never code reading or prior-session memory |
50
- | `windows-filesystem-safe.md` | Use safe `rmtree` patterns on Windows; `mkdirSync` with `recursive: true` on possibly-existing paths |
51
- | `workers-done-before-complete.md` | A task reaches `completed` only when every spawned worker has finished and its results are merged into run state |
52
- | `workflow-substitution-slots.md` | Per-iteration values in `.workflow.js` templates use angle-bracket slots |
53
-
54
- ## Hook enforcement
55
-
56
- Rules marked with ⚡ in `~/.claude/docs/CODE_RULES.md` are backed by a blocking hook in `hooks/blocking/`. Rules without a hook are judgment-based and enforced via audit rubrics (`audit-rubrics/`).
package/scripts/AGENTS.md CHANGED
@@ -1,56 +1 @@
1
- # scripts
2
1
 
3
- Utility scripts installed into `~/.claude/scripts/` by `bin/install.mjs`. Each script is a standalone tool a user or hook can invoke directly.
4
-
5
- ## Scripts
6
-
7
- | File | Purpose |
8
- |---|---|
9
- | `claude_chain_runner.py` | Runs a `claude` invocation through a fallback chain (`~/.claude/claude-chain.json`) with `--routing-mode usage_ranked` (default: probe weekly remaining once via `claude_chain_usage` / the usage-pause OAuth probe, highest remaining first) or `ordered_account` (config list order; non-usage failures stop as `advisor_blocked`); falls over only on a usage-limit failure; returns `terminal_status` / optional `session_id` on the outcome; usable as an imported module (`run_claude`) or a CLI. Copy `claude-chain.example.json` to `~/.claude/claude-chain.json` and list your account binaries. Optional per-entry `credentials_path` names that account's OAuth credentials file for the usage probe |
10
- | `claude_chain_usage.py` | Reports remaining weekly usage for every account in `~/.claude/claude-chain.json` via the usage-pause OAuth probe; prints JSON (`accounts` with `weekly_remaining_percent` or null plus `error`); importable `report_chain_weekly_usage` and `rank_accounts_by_weekly_remaining` (highest remaining first, ties keep config order, unmeasurable last). The chain runner consumes this ranking for try order |
11
- | `gh_artifact_upload.py` | Uploads a file to a repo's durable `artifacts` prerelease under a timestamped asset name and prints the permanent download URL a GitHub post can link |
12
- | `grok_headless_runner.py` | Runs one worker as headless `grok`: builds argv with no turn cap (the timeout is the only bound), mints a unique leader socket, captures streams, refuses a timeout that is missing, below `MIN_WORKER_TIMEOUT_SECONDS`, or above the `MAXIMUM_WORKER_TIMEOUT_SECONDS` (5400) ceiling, kills the whole process tree on timeout with grace and retries the kill-and-drain round once, classifies ok/usage_limit/auth_failure/timeout/kill_failed/error; exports `require_timeout_within_bounds` so a dispatcher can apply the same bounds without launching; imported by `spawn_grok_batch.py` and `resolve_worker_spawn.py` |
13
- | `grok_worker_preflight.py` | Soft gate for the headless grok tier: binary on PATH, `grok models` auth, install manifest + role agents, opt-in cached live ping; non-zero exit is fallthrough, not failure |
14
- | `setup_project_paths.py` | One-time bootstrap: discovers git repos via `es.exe` (Everything) and writes `~/.claude/project-paths.json`; never hardcodes scan roots |
15
- | `spawn_grok_batch.py` | Launches a fleet of headless grok workers from a JSON batch spec: gates once through the preflight, refuses a spec whose `timeout_seconds` exceeds `MAXIMUM_WORKER_TIMEOUT_SECONDS` (5400) rather than clamping it, assembles each prompt from part files, optionally binds a unique worker advisor per role via the lead-supplied `advisor.launcher` (placeholder default in constants), injects `advisor_session_id`, requires the same session ENDORSE or bounded CORRECTION/PLAN then ENDORSE, classifies bind/verdict/timeout/missing-launcher failures as `advisor_blocked`, staggers starts, runs each through `grok_headless_runner.py`, and emits one batch summary JSON |
16
- | `sweep_empty_dirs.py` | Deletes empty directories older than a configurable age under a given root; runs once (`--once`) or in continuous-watch mode |
17
- | `sync_to_cursor.py` | Entry point for syncing Claude rules to Cursor `.mdc` files; delegates to the `sync_to_cursor/` package |
18
- | `resolve_worker_spawn.py` | Dispatches a worker role through grok then claude fallback tiers (preflight, headless grok, `claude_agent_required` handoff, optional claude headless); applies `require_timeout_within_bounds` before the preflight, so an out-of-bounds `--timeout-seconds` prints a `timeout_out_of_bounds` outcome and exits 3 on every tier; protocol: [`../_shared/pr-loop/worker-spawn.md`](../_shared/pr-loop/worker-spawn.md) |
19
- | `active_capability_references.py` | Inventories committed skill, agent, and command names and scans package markdown for active slash or backticked capability references; fails ban-listed names outside inert historical/example fences |
20
- | `verify_installable_package.py` | Verifies the published package: runs real `npm pack`, checks every surface in `installable-surfaces.manifest.json` appears in the tarball, requires each `hooks.json` `.py` command to be git-tracked, and smoke-compiles those scripts (`node --check` on `bin/install.mjs`) |
21
-
22
- ## PowerShell scripts
23
-
24
- | File | Purpose |
25
- |---|---|
26
- | `Audit-ShellPolicy.ps1` | Audits Bash tool calls in session transcripts against the `pwsh`-only shell policy |
27
- | `Migrate-ShellPolicy.ps1` | Applies automated fixes for common shell-policy violations found by the audit script |
28
- | `Install-SweepEmptyDirs.ps1` | Registers `sweep_empty_dirs.py` as a scheduled task on Windows |
29
- | `Sync-RepoMain.ps1` | Fast-forwards a main-tracking mirror (`-RepoPath`, required) to its remote main using `merge --ff-only`; refuses a different checkout or a diverged branch, logs each run to `-LogPath`, and exits non-zero so a scheduled-task history row surfaces the problem. `-StashDirty` stashes tracked changes right before the fast-forward under a dated `pre-sync stash` message and leaves the stash in the list |
30
- | `check.ps1` | Runs the full code-quality check suite |
31
- | `Get-SessionAccount.ps1` | Reports which Claude account the current session is actually logged into by comparing `~/.claude.json`'s CLI login against a `CLAUDE_USER_DATA_DIR` desktop profile's `lastKnownAccountUuid`, recovering the desktop account's email from profile storage when the two accounts differ |
32
- | `Capture-PoolHealth.ps1` | Captures Windows memory pool counters, high-handle processes, and kernel pool tags (via `NtQuerySystemInformation` class 22), prints a threshold verdict with a remediation map, and exits non-zero when any alert threshold fires |
33
- | `Show-Asset.ps1` | Opens files on screen, sizing each image window to the image's pixel dimensions and falling back to the registered default application for non-image files |
34
-
35
- ## Subdirectories
36
-
37
- | Entry | Description |
38
- |---|---|
39
- | `ci/` | CI-only adapters; `windows-installer-lifecycle.ps1` runs the Node installer 16-check driver under isolated HOME/USERPROFILE/GIT_CONFIG_GLOBAL and writes bounded evidence |
40
- | `dev_env_scripts_constants/` | Named constants (`timing.py`, `grok_worker_constants.py`, …) for scripts in this directory, including worker-advisor placeholder launcher/model/effort, four verdict signals, correction cap, and advisor timeout |
41
- | `sync_to_cursor/` | Package that builds Cursor `.mdc` files from Claude rules and docs |
42
- | `tests/` | pytest suite for the Python scripts and Pester (`*.Tests.ps1`) suite for the PowerShell scripts in this directory |
43
-
44
- ## Running tests
45
-
46
- Python scripts (pytest):
47
-
48
- ```bash
49
- python -m pytest packages/claude-dev-env/scripts/tests/
50
- ```
51
-
52
- PowerShell scripts (Pester 5+, `*.Tests.ps1`):
53
-
54
- ```powershell
55
- Invoke-Pester -Path packages/claude-dev-env/scripts/tests/
56
- ```
@@ -1,21 +1 @@
1
- # dev_env_scripts_constants
2
1
 
3
- Named constants for scripts in `scripts/`. Follows the project convention that timeouts, delays, and retries live in `timing.py`.
4
-
5
- ## Modules
6
-
7
- | File | Constants for |
8
- |---|---|
9
- | `timing.py` | `sweep_empty_dirs.py` - `DEFAULT_AGE_SECONDS` (smallest age before an empty directory is eligible for removal) and `DEFAULT_POLL_INTERVAL` (seconds between sweep passes in continuous-watch mode); `spawn_grok_batch.py` - `WORKER_STAGGER_SECONDS` (seconds between staggered headless grok worker starts); `invoke_code_review.py` - `DEFAULT_CODE_REVIEW_TIMEOUT_SECONDS` (timeout for one headless `/code-review` chain run) |
10
- | `gh_artifact_upload_constants.py` | `gh_artifact_upload.py` - the `artifacts` release tag, title, and notes body, the GitHub CLI binary name, the asset-name timestamp format and template, the asset download URL template, the notes-file suffix, and the text encoding |
11
- | `claude_chain_constants.py` | `claude_chain_runner.py` - the chain config filename and home subdirectory, the usage-limit signature text, the per-binary status labels, routing-mode tokens (`usage_ranked` / `ordered_account`), outcome `terminal_status` values (`served` / `advisor_blocked` / `chain_exhausted` / `timeout`), the default timeout, CLI flag and separator tokens, config JSON keys (including optional `credentials_path`), invalid-shape reason text, config-error and exhausted-chain message templates, and CLI exit codes (including advisor-blocked); `invoke_code_review.py` and `resolve_worker_spawn.py` - the text-codec keyword names and the `collect_forwarded_text_codec` helper that forwards them to the subprocess runner for text-mode capture |
12
- | `claude_chain_usage_constants.py` | `claude_chain_usage.py` - full weekly percent scale, usage-pause skill path segments, CLI config-path flag, JSON report keys, and probe error message templates |
13
- | `grok_worker_constants.py` | `grok_worker_preflight.py`, `grok_headless_runner.py`, `spawn_grok_batch.py`, and `resolve_worker_spawn.py` - the `grok` binary name and CLI flags, model and subcommand tokens, leader-socket and scratch-file name parts, auth and usage-limit signature lists, outcome classifications, fallthrough reasons, tool-profile names and prompt headers, worker timeouts (default, plus the floor and the `MAXIMUM_WORKER_TIMEOUT_SECONDS` ceiling that the batch spec parse, the headless runner, and the spawn dispatcher all enforce, each bound carrying one rejection template shared by those sites, plus launch-failure return code and post-kill grace), the process-tree kill attempt limit and kill-failed classification, the preflight ping's single-turn cap, ping-cache keys and TTL, batch-spec and summary JSON keys, worker-advisor placeholder launcher/model/effort tokens, four verdict signals, MAXIMUM_WORKER_ADVISOR_CORRECTIONS, advisor_blocked classification, and advisor_session_id report keys, the prompt-part and report-stream join separators, and the CLI launch-error stderr prefix |
14
- | `code_review_constants.py` | `invoke_code_review.py` - the `/code-review ultra --fix` prompt, opus model alias, permission-mode flag and value, result mode and JSON keys, session-model CLI flag, git dirty-check tokens, and in-session return markers; finding severity tokens (`blocker` / `high` / `medium` / `low` / `nit`), verification verdict tokens, loop terminal tokens (`clean` / `nits_fixed` / `advisor_blocked`), and pure helpers for retained-finding checks, head recording, terminal resolution, and terminal encoding |
15
- | `active_capability_constants.py` | `active_capability_references.py` - package skills/agents/commands directory names, skill manifest filename, ban-listed capability names, inert fence languages, slash and backtick extract patterns, fence open/close patterns, banned-reason prefix, UTF-8 encoding, and newline join separator |
16
- | `verify_installable_package_constants.py` | `verify_installable_package.py` - manifest filename and keys, npm pack / tarball / plugin-root tokens, git and node smoke argv pieces, surface classification labels, exit codes, and CLI status headers |
17
- | `__init__.py` | Empty package marker |
18
-
19
- ## Convention
20
-
21
- Every constant is `UPPER_SNAKE_CASE` with an explicit type annotation and a docstring. Scripts import from here rather than embedding literal values in their bodies. `code_review_constants.py` also exports pure helpers that resolve review-loop terminals from those tokens.
@@ -1,23 +1 @@
1
- # sync_to_cursor
2
1
 
3
- Python package that syncs Claude rules and docs to Cursor `.mdc` files. Entry point is `packages/claude-dev-env/scripts/sync_to_cursor.py`; this package holds the implementation modules.
4
-
5
- ## Modules
6
-
7
- | File | Purpose |
8
- |---|---|
9
- | `engine.py` | Main sync logic: loads the manifest, builds rule mappings, hashes sources, writes `.mdc` files, and updates the manifest; `--claude-root` and `--cursor-root` select explicit layouts |
10
- | `rules.py` | Builds `RuleMapping` objects from Claude rule markdown files; applies transforms to fit Cursor's `.mdc` format; maps remaining `rules/*.md` files to `<stem>.mdc` |
11
- | `canonical_docs.py` | Checks and syncs canonical documentation files (`CODE_RULES.md`, `TEST_QUALITY.md`) to the Cursor rules directory |
12
- | `paths.py` | Resolves the Claude and Cursor layout paths; respects the `LLM_SETTINGS_ROOT` env var for non-home layouts |
13
- | `hashing.py` | SHA-256 helpers that detect whether source files changed since the last sync run |
14
- | `config/` | Package-level constants: `GENERATOR_VERSION`, `ALL_CANONICAL_DOC_FILES`, `MAX_RULE_BODY_LINES`, skipped inventory filenames, markdown suffix |
15
- | `__init__.py` | Empty package marker |
16
-
17
- ## Layout resolution
18
-
19
- `paths.py` reads `LLM_SETTINGS_ROOT` from the environment. When set, it uses that path as the base for both `.claude/` and `.cursor/`. When unset, it falls back to `Path.home()`.
20
-
21
- ## Tests
22
-
23
- Tests live in `packages/claude-dev-env/scripts/tests/test_sync_to_cursor.py`.
@@ -1,35 +1 @@
1
- # scripts/tests
2
1
 
3
- pytest suite for the Python scripts and Pester suite for the PowerShell scripts in `scripts/`.
4
-
5
- ## Test files
6
-
7
- | File | Covers |
8
- |---|---|
9
- | `test_setup_project_paths.py` | `setup_project_paths.py` — discovery, filtering, and `project-paths.json` writing |
10
- | `test_setup_project_paths_config.py` | Configuration constants used by `setup_project_paths.py` |
11
- | `test_sweep_empty_dirs.py` | `sweep_empty_dirs.py` — age check, one-shot mode, and continuous-watch behavior |
12
- | `test_sync_to_cursor.py` | `sync_to_cursor/` package — mapping, hashing, manifest, and path resolution |
13
- | `test_rules.py` | Discovered Claude `rules/*.md` mappings to stem-named Cursor `.mdc` files |
14
- | `test_engine.py` | `sync_to_cursor` engine `--claude-root` / `--cursor-root` layout flags |
15
- | `test_grok_worker_constants.py` | `grok_worker_constants.py` — the accepted batch worker-key set stays in step with the worker key constants, and the unknown-key message names both its placeholders |
16
-
17
- ## PowerShell test files
18
-
19
- | File | Covers |
20
- |---|---|
21
- | `Get-SessionAccount.Tests.ps1` | `Get-SessionAccount.ps1` — noise filtering, profile-storage email recovery, CLI-vs-desktop account resolution, and output formatting |
22
-
23
- ## Running
24
-
25
- Python scripts (pytest):
26
-
27
- ```bash
28
- python -m pytest packages/claude-dev-env/scripts/tests/
29
- ```
30
-
31
- PowerShell scripts (Pester 5+, `*.Tests.ps1`):
32
-
33
- ```powershell
34
- Invoke-Pester -Path packages/claude-dev-env/scripts/tests/
35
- ```
@@ -1,25 +1 @@
1
- # system-prompts
2
1
 
3
- System-prompt reference files installed into `~/.claude/system-prompts/` by `bin/install.mjs`. Rules and skills pull a file (or one of its sections) into context on demand by citing its installed path.
4
-
5
- Use `~/.claude/rules/asd-ste100-language.md` for user-facing word choice,
6
- sentence style, tone, punctuation, and prose form. Each prompt keeps its
7
- role-specific behavior contract.
8
-
9
- ELI5 owns the global beginner presentation envelope: large visuals, minimal
10
- text, one stable self-contained HTML artifact, update-in-place continuity, and
11
- sharing.
12
-
13
- ## Files
14
-
15
- | File | Purpose |
16
- |---|---|
17
- | `software-engineer.xml` | Software-engineering reference: defines the engineering role, task-scope rules, output style, and the BDD `<behavior_protocol>` that `rules/bdd.md` cites on demand |
18
-
19
- ## Format
20
-
21
- Files use XML with named sections (`<role>`, `<task_scope>`, `<output_style>`, `<behavior_protocol>`, etc.). A rule or skill cites a file, or one of its sections, to pull it into context when the task needs it.
22
-
23
- ## Adding a prompt
24
-
25
- Create a new `.xml` file and run `bin/install.mjs` to copy it to `~/.claude/system-prompts/`. Reference the new file in the relevant rule or skill by its installed path.