claude-dev-env 1.38.0 → 1.39.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.
- package/CLAUDE.md +10 -36
- package/_shared/pr-loop/audit-reply-template.md +147 -0
- package/_shared/pr-loop/fix-protocol.md +25 -4
- package/_shared/pr-loop/gh-payloads.md +37 -50
- package/_shared/pr-loop/scripts/code_rules_gate.py +0 -60
- package/_shared/pr-loop/scripts/config/post_audit_thread_constants.py +189 -0
- package/_shared/pr-loop/scripts/post_audit_thread.py +947 -0
- package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +0 -19
- package/_shared/pr-loop/scripts/tests/test_post_audit_thread.py +923 -0
- package/_shared/pr-loop/scripts/tests/test_post_audit_thread_constants.py +127 -0
- package/_shared/pr-loop/state-schema.md +1 -1
- package/agents/clean-coder.md +2 -2
- package/bin/install.mjs +6 -7
- package/bin/install.test.mjs +8 -0
- package/commands/doc-gist.md +16 -0
- package/commands/plan.md +0 -2
- package/commands/review-plan.md +1 -1
- package/docs/CODE_RULES.md +122 -2
- package/hooks/blocking/bot_mention_comment_blocker.py +75 -0
- package/hooks/blocking/code_rules_enforcer.py +1236 -161
- package/hooks/blocking/convergence_gate_blocker.py +130 -0
- package/hooks/blocking/destructive_command_blocker.py +74 -0
- package/hooks/blocking/gh_body_arg_blocker.py +30 -0
- package/hooks/blocking/md_to_html_blocker.py +119 -0
- package/hooks/blocking/test_bot_mention_comment_blocker.py +131 -0
- package/hooks/blocking/test_code_rules_enforcer.py +21 -0
- package/hooks/blocking/test_code_rules_enforcer_any_exempt_files.py +70 -0
- package/hooks/blocking/test_code_rules_enforcer_any_imports_and_cast.py +92 -0
- package/hooks/blocking/test_code_rules_enforcer_banned_import_alias.py +143 -0
- package/hooks/blocking/test_code_rules_enforcer_banned_prefixes.py +152 -0
- package/hooks/blocking/test_code_rules_enforcer_bare_except.py +120 -0
- package/hooks/blocking/test_code_rules_enforcer_boundary_types.py +175 -0
- package/hooks/blocking/test_code_rules_enforcer_cap_meta.py +0 -1
- package/hooks/blocking/test_code_rules_enforcer_collection_prefix.py +50 -0
- package/hooks/blocking/test_code_rules_enforcer_docstring_format.py +255 -0
- package/hooks/blocking/test_code_rules_enforcer_inline_tuple_string_magic.py +130 -0
- package/hooks/blocking/test_code_rules_enforcer_stub_implementations.py +141 -0
- package/hooks/blocking/test_code_rules_enforcer_test_branching.py +143 -0
- package/hooks/blocking/test_code_rules_enforcer_thin_wrapper_files.py +169 -0
- package/hooks/blocking/test_code_rules_enforcer_todo_markers.py +99 -0
- package/hooks/blocking/test_code_rules_enforcer_typed_dict_pairs.py +141 -0
- package/hooks/blocking/test_code_rules_enforcer_unused_imports.py +158 -0
- package/hooks/blocking/test_convergence_gate_blocker.py +63 -0
- package/hooks/blocking/test_destructive_command_blocker.py +146 -0
- package/hooks/blocking/test_destructive_command_blocker_no_verify.py +102 -0
- package/hooks/blocking/test_gh_body_arg_blocker.py +45 -0
- package/hooks/blocking/test_md_to_html_blocker.py +317 -0
- package/hooks/config/any_type_config.py +7 -0
- package/hooks/config/banned_identifiers_constants.py +11 -0
- package/hooks/config/blocking_check_limits.py +38 -0
- package/hooks/config/bot_mention_comment_blocker_constants.py +20 -0
- package/hooks/config/code_rules_enforcer_constants.py +53 -0
- package/hooks/config/convergence_branch_constants.py +9 -0
- package/hooks/config/doc_gist_auto_publish_constants.py +18 -0
- package/hooks/config/html_companion_constants.py +20 -0
- package/hooks/config/inline_tuple_string_magic_constants.py +22 -0
- package/hooks/config/test_banned_identifiers_constants.py +17 -0
- package/hooks/hooks.json +28 -20
- package/hooks/pyproject.toml +69 -0
- package/hooks/validators/mypy_integration.py +47 -1
- package/hooks/validators/run_all_validators.py +3 -3
- package/hooks/validators/test_mypy_integration.py +50 -1
- package/hooks/workflow/doc_gist_auto_publish.py +144 -0
- package/hooks/workflow/md_to_html_companion.py +365 -0
- package/hooks/workflow/test_doc_gist_auto_publish.py +117 -0
- package/hooks/workflow/test_md_to_html_companion.py +452 -0
- package/package.json +1 -1
- package/rules/gh-body-file.md +2 -0
- package/scripts/Install-SweepEmptyDirs.ps1 +111 -0
- package/scripts/check.ps1 +106 -0
- package/scripts/config/timing.py +11 -0
- package/scripts/sweep_empty_dirs.py +138 -0
- package/scripts/sync_to_cursor/rules.py +1 -1
- package/scripts/test_sweep_empty_dirs.py +183 -0
- package/skills/_shared/pr-loop/prompts/pr-consistency-audit.xml +323 -0
- package/skills/_shared/pr-loop/scripts/_cli_utils.py +22 -0
- package/skills/_shared/pr-loop/scripts/_path_resolver.py +165 -0
- package/skills/_shared/pr-loop/scripts/_xml_utils.py +20 -0
- package/skills/_shared/pr-loop/scripts/build_audit_prompt.py +182 -0
- package/skills/_shared/pr-loop/scripts/build_fix_prompt.py +185 -0
- package/skills/_shared/pr-loop/scripts/config/__init__.py +0 -0
- package/skills/_shared/pr-loop/scripts/config/path_resolver_constants.py +78 -0
- package/skills/_shared/pr-loop/scripts/init_loop_state.py +135 -0
- package/skills/_shared/pr-loop/scripts/teardown_worktrees.py +175 -0
- package/skills/_shared/pr-loop/scripts/write_audit_outcomes.py +182 -0
- package/skills/_shared/pr-loop/scripts/write_fix_outcomes.py +206 -0
- package/skills/bugteam/CONSTRAINTS.md +21 -22
- package/skills/bugteam/EXAMPLES.md +3 -3
- package/skills/bugteam/PROMPTS.md +227 -67
- package/skills/bugteam/SKILL.md +114 -455
- package/skills/bugteam/reference/README.md +1 -1
- package/skills/bugteam/reference/audit-and-teammates.md +112 -39
- package/skills/bugteam/reference/audit-contract.md +4 -22
- package/skills/bugteam/reference/copilot-gap-analysis.md +8 -5
- package/skills/bugteam/reference/design-rationale.md +2 -2
- package/skills/bugteam/reference/github-pr-reviews.md +50 -57
- package/skills/bugteam/reference/obstacles/audit-assign-ids.md +13 -0
- package/skills/bugteam/reference/obstacles/audit-capture-excerpts.md +13 -0
- package/skills/bugteam/reference/obstacles/audit-walk-categories.md +13 -0
- package/skills/bugteam/reference/obstacles/audit-write-xml.md +13 -0
- package/skills/bugteam/reference/obstacles/fix-append-summary.md +13 -0
- package/skills/bugteam/reference/obstacles/fix-apply-fixes.md +13 -0
- package/skills/bugteam/reference/obstacles/fix-git-add-commit.md +13 -0
- package/skills/bugteam/reference/obstacles/fix-git-push.md +13 -0
- package/skills/bugteam/reference/obstacles/fix-post-reply.md +13 -0
- package/skills/bugteam/reference/obstacles/fix-publish-summary.md +13 -0
- package/skills/bugteam/reference/obstacles/fix-py-compile.md +13 -0
- package/skills/bugteam/reference/obstacles/fix-read-files.md +13 -0
- package/skills/bugteam/reference/obstacles/fix-resolve-thread.md +13 -0
- package/skills/bugteam/reference/obstacles/fix-test-suite.md +13 -0
- package/skills/bugteam/reference/obstacles/fix-violation-count.md +13 -0
- package/skills/bugteam/reference/obstacles/fix-write-xml.md +13 -0
- package/skills/bugteam/reference/team-setup.md +106 -9
- package/skills/bugteam/reference/teardown-publish-permissions.md +39 -8
- package/skills/bugteam/scripts/README.md +60 -0
- package/skills/bugteam/scripts/_claude_permissions_common.py +358 -0
- package/skills/bugteam/scripts/bugteam_code_rules_gate.py +976 -0
- package/skills/bugteam/scripts/bugteam_fix_hookspath.py +375 -0
- package/skills/bugteam/scripts/bugteam_preflight.py +294 -0
- package/skills/bugteam/scripts/config/bugteam_code_rules_gate_constants.py +25 -0
- package/skills/bugteam/scripts/config/bugteam_fix_hookspath_constants.py +26 -0
- package/skills/bugteam/scripts/config/bugteam_preflight_constants.py +35 -0
- package/skills/bugteam/scripts/config/claude_permissions_common_constants.py +20 -0
- package/skills/bugteam/scripts/config/probe_code_rules_enforcer_check_constants.py +12 -0
- package/skills/bugteam/scripts/config/windows_safe_rmtree_constants.py +7 -0
- package/skills/bugteam/scripts/grant_project_claude_permissions.py +175 -0
- package/skills/bugteam/scripts/probe_code_rules_enforcer_check.py +107 -0
- package/skills/bugteam/scripts/revoke_project_claude_permissions.py +220 -0
- package/skills/bugteam/scripts/test__claude_permissions_common.py +112 -0
- package/skills/bugteam/scripts/test_bugteam_code_rules_gate.py +400 -0
- package/skills/bugteam/scripts/test_bugteam_fix_hookspath.py +384 -0
- package/skills/bugteam/scripts/test_bugteam_preflight.py +268 -0
- package/skills/bugteam/scripts/test_claude_permissions_common.py +195 -0
- package/skills/bugteam/scripts/test_grant_project_claude_permissions.py +55 -0
- package/skills/bugteam/scripts/test_probe_code_rules_enforcer_check.py +76 -0
- package/skills/bugteam/scripts/test_revoke_project_claude_permissions.py +55 -0
- package/skills/bugteam/scripts/test_windows_safe_rmtree.py +108 -0
- package/skills/bugteam/scripts/windows_safe_rmtree.py +100 -0
- package/skills/bugteam/test_skill_additions.py +1 -11
- package/skills/code/SKILL.md +176 -0
- package/skills/doc-gist/SKILL.md +99 -0
- package/skills/doc-gist/references/examples/01-exploration-code-approaches.html +453 -0
- package/skills/doc-gist/references/examples/02-exploration-visual-designs.html +515 -0
- package/skills/doc-gist/references/examples/03-code-review-pr.html +638 -0
- package/skills/doc-gist/references/examples/04-code-understanding.html +491 -0
- package/skills/doc-gist/references/examples/05-design-system.html +629 -0
- package/skills/doc-gist/references/examples/06-component-variants.html +605 -0
- package/skills/doc-gist/references/examples/07-prototype-animation.html +455 -0
- package/skills/doc-gist/references/examples/08-prototype-interaction.html +396 -0
- package/skills/doc-gist/references/examples/09-slide-deck.html +592 -0
- package/skills/doc-gist/references/examples/10-svg-illustrations.html +492 -0
- package/skills/doc-gist/references/examples/11-status-report.html +528 -0
- package/skills/doc-gist/references/examples/12-incident-report.html +596 -0
- package/skills/doc-gist/references/examples/13-flowchart-diagram.html +395 -0
- package/skills/doc-gist/references/examples/14-research-feature-explainer.html +381 -0
- package/skills/doc-gist/references/examples/15-research-concept-explainer.html +368 -0
- package/skills/doc-gist/references/examples/16-implementation-plan.html +702 -0
- package/skills/doc-gist/references/examples/17-pr-writeup.html +595 -0
- package/skills/doc-gist/references/examples/18-editor-triage-board.html +573 -0
- package/skills/doc-gist/references/examples/19-editor-feature-flags.html +663 -0
- package/skills/doc-gist/references/examples/20-editor-prompt-tuner.html +722 -0
- package/skills/doc-gist/references/examples/README.md +5 -0
- package/skills/doc-gist/scripts/config/__init__.py +0 -0
- package/skills/doc-gist/scripts/config/gist_upload_constants.py +16 -0
- package/skills/doc-gist/scripts/gist_upload.py +177 -0
- package/skills/doc-gist/scripts/test_gist_upload.py +51 -0
- package/skills/findbugs/SKILL.md +68 -2
- package/skills/monitor-open-prs/SKILL.md +13 -32
- package/skills/monitor-open-prs/test_skill_contract.py +0 -11
- package/skills/pr-consistency-audit/SKILL.md +112 -0
- package/skills/pr-consistency-audit/reference/detection-rules.md +96 -0
- package/skills/pr-consistency-audit/reference/illustrations.md +78 -0
- package/skills/pr-converge/SKILL.md +227 -23
- package/skills/pr-converge/config/__init__.py +0 -0
- package/skills/pr-converge/config/constants.py +62 -0
- package/skills/pr-converge/reference/convergence-gates.md +138 -44
- package/skills/pr-converge/reference/examples.md +43 -11
- package/skills/pr-converge/reference/fix-protocol.md +6 -5
- package/skills/pr-converge/reference/ground-rules.md +5 -3
- package/skills/pr-converge/reference/multi-pr-orchestration.md +44 -19
- package/skills/pr-converge/reference/obstacles/fix-post-replies.md +13 -0
- package/skills/pr-converge/reference/obstacles/fix-publish-summary.md +13 -0
- package/skills/pr-converge/reference/obstacles/fix-push.md +13 -0
- package/skills/pr-converge/reference/obstacles/fix-read-filelines.md +13 -0
- package/skills/pr-converge/reference/obstacles/fix-reset-state.md +13 -0
- package/skills/pr-converge/reference/obstacles/fix-resolve-threads.md +13 -0
- package/skills/pr-converge/reference/obstacles/fix-spawn-clean-coder.md +13 -0
- package/skills/pr-converge/reference/obstacles/fix-stage-commit.md +13 -0
- package/skills/pr-converge/reference/obstacles/fix-trigger-bugbot.md +13 -0
- package/skills/pr-converge/reference/obstacles/fix-write-test.md +13 -0
- package/skills/pr-converge/reference/per-tick.md +90 -31
- package/skills/pr-converge/reference/state-schema.md +22 -1
- package/skills/pr-converge/reference/stop-conditions.md +9 -7
- package/skills/pr-converge/scripts/README.md +34 -46
- package/skills/pr-converge/scripts/check_bugbot_ci.py +174 -0
- package/skills/pr-converge/scripts/check_convergence.py +497 -0
- package/skills/pr-converge/scripts/check_pending_reviews.py +154 -0
- package/skills/pr-converge/scripts/config/pr_converge_constants.py +118 -0
- package/skills/pr-converge/scripts/fetch_copilot_reviews.py +134 -0
- package/skills/pr-converge/scripts/post_fix_reply.py +168 -0
- package/skills/pr-converge/workflows/schedule-wakeup-loop.md +5 -12
- package/skills/qbug/SKILL.md +132 -27
- package/skills/session-log/SKILL.md +216 -114
- package/skills/session-tidy/SKILL.md +1 -1
- package/skills/skill-builder/SKILL.md +138 -56
- package/skills/skill-builder/references/delegation-map.md +72 -113
- package/skills/skill-builder/references/progressive-disclosure.md +122 -0
- package/skills/skill-builder/references/self-audit-checklist.md +92 -0
- package/skills/skill-builder/references/skill-types.md +228 -0
- package/skills/skill-builder/references/thariq-x-post-skills.json +33 -0
- package/skills/skill-builder/templates/gap-analysis.md +15 -8
- package/skills/skill-builder/workflows/improve-skill.md +86 -57
- package/skills/skill-builder/workflows/new-skill.md +80 -168
- package/skills/skill-builder/workflows/polish-skill.md +78 -54
- package/skills/structure-prompt/SKILL.md +50 -0
- package/skills/structure-prompt/reference/adversarial-tuning.md +62 -0
- package/skills/structure-prompt/reference/block-classification.md +27 -0
- package/skills/structure-prompt/reference/canonical-case.md +48 -0
- package/skills/structure-prompt/reference/citation-depth.md +70 -0
- package/skills/structure-prompt/reference/cleanup.md +33 -0
- package/skills/structure-prompt/reference/constraints.md +33 -0
- package/skills/structure-prompt/reference/directives.md +37 -0
- package/skills/structure-prompt/reference/examples.md +72 -0
- package/skills/structure-prompt/reference/instantiation.md +51 -0
- package/skills/structure-prompt/reference/output-contract.md +72 -0
- package/skills/structure-prompt/reference/per-category.md +23 -0
- package/skills/structure-prompt/reference/persona.md +38 -0
- package/skills/structure-prompt/reference/research.md +33 -0
- package/skills/structure-prompt/reference/structure.md +28 -0
- package/agents/code-standards-agent.md +0 -93
- package/agents/groq-coder.md +0 -113
- package/agents/plan-executor.md +0 -226
- package/agents/project-docs-analyzer.md +0 -53
- package/agents/project-structure-organizer-agent.md +0 -72
- package/agents/skill-to-agent-converter.md +0 -370
- package/agents/skill-writer-agent.md +0 -470
- package/agents/user-docs-writer.md +0 -67
- package/agents/workflow-visual-documenter.md +0 -82
- package/commands/readability-review.md +0 -20
- package/hooks/mypy.ini +0 -2
- package/hooks/notification/attention_needed_notify.py +0 -71
- package/hooks/notification/claude_notification_handler.py +0 -67
- package/hooks/notification/notification_utils.py +0 -267
- package/hooks/notification/subagent_complete_notify.py +0 -381
- package/hooks/notification/test_attention_needed_notify.py +0 -47
- package/hooks/notification/test_claude_notification_handler.py +0 -54
- package/hooks/notification/test_notification_utils.py +0 -91
- package/hooks/notification/test_subagent_complete_notify.py +0 -79
- package/scripts/config/groq_bugteam_config.py +0 -230
- package/scripts/config/test_groq_bugteam_config.py +0 -83
- package/scripts/config/test_spec_implementer_prompt.py +0 -32
- package/scripts/groq_bugteam.README.md +0 -131
- package/scripts/groq_bugteam.py +0 -647
- package/scripts/groq_bugteam_dotenv.py +0 -40
- package/scripts/groq_bugteam_spec.py +0 -226
- package/scripts/test_groq_bugteam.py +0 -529
- package/scripts/test_groq_bugteam_apply_fix_from_spec.py +0 -426
- package/scripts/test_groq_bugteam_dotenv.py +0 -66
- package/scripts/test_groq_bugteam_spec.py +0 -338
- package/skills/bugteam/SKILL_EVALS.md +0 -309
- package/skills/dream/SKILL.md +0 -118
- package/skills/ingest/SKILL.md +0 -40
- package/skills/npm-creator/SKILL.md +0 -187
- package/skills/readability-review/SKILL.md +0 -127
- package/skills/resume-review/SKILL.md +0 -261
- package/skills/rule-audit/SKILL.md +0 -307
- package/skills/rule-creator/SKILL.md +0 -150
- package/skills/searching-obsidian-vault/SKILL.md +0 -131
- package/skills/skill-writer/REFERENCE.md +0 -284
- package/skills/skill-writer/SKILL.md +0 -222
- package/skills/tdd-team/SKILL.md +0 -128
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# py_compile
|
|
2
|
+
|
|
3
|
+
Run py_compile or language-equivalent on every modified file
|
|
4
|
+
|
|
5
|
+
## Self-population
|
|
6
|
+
|
|
7
|
+
Hit a wall on this step? Spawn a background agent to record it. Keep working.
|
|
8
|
+
|
|
9
|
+
1. Spawn — brief it: check for an open PR touching this file, add a commit to it, or create a fresh branch + worktree + draft PR.
|
|
10
|
+
2. Tell the agent your obstacle and what fixed it. It writes the entry below.
|
|
11
|
+
|
|
12
|
+
## Obstacles
|
|
13
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Read files
|
|
2
|
+
|
|
3
|
+
Read each referenced file before editing
|
|
4
|
+
|
|
5
|
+
## Self-population
|
|
6
|
+
|
|
7
|
+
Hit a wall on this step? Spawn a background agent to record it. Keep working.
|
|
8
|
+
|
|
9
|
+
1. Spawn — brief it: check for an open PR touching this file, add a commit to it, or create a fresh branch + worktree + draft PR.
|
|
10
|
+
2. Tell the agent your obstacle and what fixed it. It writes the entry below.
|
|
11
|
+
|
|
12
|
+
## Obstacles
|
|
13
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Resolve threads
|
|
2
|
+
|
|
3
|
+
Resolve each thread via pull_request_review_write resolve_thread using thread_node_id
|
|
4
|
+
|
|
5
|
+
## Self-population
|
|
6
|
+
|
|
7
|
+
Hit a wall on this step? Spawn a background agent to record it. Keep working.
|
|
8
|
+
|
|
9
|
+
1. Spawn — brief it: check for an open PR touching this file, add a commit to it, or create a fresh branch + worktree + draft PR.
|
|
10
|
+
2. Tell the agent your obstacle and what fixed it. It writes the entry below.
|
|
11
|
+
|
|
12
|
+
## Obstacles
|
|
13
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Test suite
|
|
2
|
+
|
|
3
|
+
Run test suite, diagnose and fix regressions before committing
|
|
4
|
+
|
|
5
|
+
## Self-population
|
|
6
|
+
|
|
7
|
+
Hit a wall on this step? Spawn a background agent to record it. Keep working.
|
|
8
|
+
|
|
9
|
+
1. Spawn — brief it: check for an open PR touching this file, add a commit to it, or create a fresh branch + worktree + draft PR.
|
|
10
|
+
2. Tell the agent your obstacle and what fixed it. It writes the entry below.
|
|
11
|
+
|
|
12
|
+
## Obstacles
|
|
13
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Violation count
|
|
2
|
+
|
|
3
|
+
Post-fix violation count must not exceed previous loop total
|
|
4
|
+
|
|
5
|
+
## Self-population
|
|
6
|
+
|
|
7
|
+
Hit a wall on this step? Spawn a background agent to record it. Keep working.
|
|
8
|
+
|
|
9
|
+
1. Spawn — brief it: check for an open PR touching this file, add a commit to it, or create a fresh branch + worktree + draft PR.
|
|
10
|
+
2. Tell the agent your obstacle and what fixed it. It writes the entry below.
|
|
11
|
+
|
|
12
|
+
## Obstacles
|
|
13
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Write fix outcomes
|
|
2
|
+
|
|
3
|
+
Write fix outcomes XML to worktree path with reply IDs, resolution status
|
|
4
|
+
|
|
5
|
+
## Self-population
|
|
6
|
+
|
|
7
|
+
Hit a wall on this step? Spawn a background agent to record it. Keep working.
|
|
8
|
+
|
|
9
|
+
1. Spawn — brief it: check for an open PR touching this file, add a commit to it, or create a fresh branch + worktree + draft PR.
|
|
10
|
+
2. Tell the agent your obstacle and what fixed it. It writes the entry below.
|
|
11
|
+
|
|
12
|
+
## Obstacles
|
|
13
|
+
|
|
@@ -1,8 +1,48 @@
|
|
|
1
1
|
# Run setup and loop state
|
|
2
2
|
|
|
3
|
+
## Pre-flight (before Step 0)
|
|
4
|
+
|
|
5
|
+
### Utility scripts
|
|
6
|
+
|
|
7
|
+
Bugteam-specific utilities (preflight, fix_hookspath, grant, revoke) live in
|
|
8
|
+
the skill-local [`scripts/`](../scripts/) directory. Shared utilities remain in
|
|
9
|
+
[`_shared/pr-loop/scripts/`](../../_shared/pr-loop/scripts/) (run, do not paste
|
|
10
|
+
into context). Utility scripts are **executed**, not loaded as primary context
|
|
11
|
+
([`sources.md`](sources.md) § Progressive disclosure and utility scripts).
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
python "${CLAUDE_SKILL_DIR}/scripts/bugteam_preflight.py"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Non-zero → fix before grant. `BUGTEAM_PREFLIGHT_SKIP=1` emergency only.
|
|
18
|
+
`--pre-commit` if `.pre-commit-config.yaml` exists.
|
|
19
|
+
|
|
20
|
+
**Auto-remediation for `core.hooksPath`:** when preflight fails with stderr
|
|
21
|
+
containing `core.hooksPath` (the message starts with `bugteam_preflight:
|
|
22
|
+
core.hooksPath is`, or `Git-side CODE_RULES enforcement is not active`), Claude
|
|
23
|
+
must auto-invoke the fix script — do not fall through to `AskUserQuestion`, do
|
|
24
|
+
not punt to the user, do not ask for confirmation:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
python "${CLAUDE_SKILL_DIR}/scripts/bugteam_fix_hookspath.py"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The fix script removes any non-canonical local-scope override on the active
|
|
31
|
+
repository, sets the global `core.hooksPath` to `~/.claude/hooks/git-hooks` if
|
|
32
|
+
missing or wrong, and re-runs `bugteam_preflight.py`. Its exit code becomes the
|
|
33
|
+
preflight outcome. Exit 0 → continue to Step 0. Non-zero only when the
|
|
34
|
+
canonical hooks directory is missing (run `npx claude-dev-env .` first) or
|
|
35
|
+
`git config --global` writes are blocked. Other preflight failures (pytest,
|
|
36
|
+
pre-commit) still require manual fixes —
|
|
37
|
+
the auto-remediation only applies to the `core.hooksPath` failure mode.
|
|
38
|
+
|
|
3
39
|
## Step 0 — Grant project permissions (detail)
|
|
4
40
|
|
|
5
|
-
Before spawning any subagents, grant the session write access to the project
|
|
41
|
+
Before spawning any subagents, grant the session write access to the project's `.claude/**` tree:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
python "${CLAUDE_SKILL_DIR}/scripts/grant_project_claude_permissions.py"
|
|
45
|
+
```
|
|
6
46
|
|
|
7
47
|
`${CLAUDE_SKILL_DIR}` is a Claude Code host-managed token, pre-substituted by the runtime before any shell sees it. Unlike `${TMPDIR}` and similar shell parameter expansions, it does not depend on the shell’s expansion semantics, so it behaves the same on Unix and Windows shells.
|
|
8
48
|
|
|
@@ -14,21 +54,45 @@ This is the **first** action of every `/bugteam` invocation, before any subagent
|
|
|
14
54
|
|
|
15
55
|
Same resolution path as `/findbugs`:
|
|
16
56
|
|
|
17
|
-
1. `pull_request_read(method="get", pullNumber=N, owner=O, repo=R)`
|
|
57
|
+
1. Call `pull_request_read(method="get", pullNumber=N, owner=O, repo=R)` to fetch PR metadata; capture `number`, `headRefName`, `baseRefName`, and `url` from the response. Falls back to the merge-base diff path when no PR exists.
|
|
18
58
|
2. Fall back to `git merge-base HEAD origin/<default>` then `git diff <merge-base>...HEAD`.
|
|
19
59
|
3. Neither → refuse per refusal cases in `SKILL.md`.
|
|
20
60
|
|
|
21
61
|
Capture `<owner>/<repo>`, head branch, base branch, PR number, PR URL. This scope persists across every loop — `/bugteam` runs to completion from the single up-front confirmation.
|
|
22
62
|
|
|
23
|
-
|
|
63
|
+
For multi-PR invocations, capture `all_prs = [{number, owner, repo, baseRef, headRef, url}, ...]`. A single-PR invocation produces a one-element list and follows the same downstream rules.
|
|
24
64
|
|
|
25
|
-
###
|
|
65
|
+
### Per-PR workspace
|
|
26
66
|
|
|
27
|
-
|
|
67
|
+
For each PR in `all_prs`:
|
|
28
68
|
|
|
29
|
-
|
|
69
|
+
Canonical path functions live in
|
|
70
|
+
[`_shared/pr-loop/scripts/_path_resolver.py`](../../_shared/pr-loop/scripts/_path_resolver.py):
|
|
71
|
+
`per_pr_workspace(run_temp_dir, owner, repo, pr_number)` returns dict with keys
|
|
72
|
+
`worktree`, `diff_patch_template`, `outcome_xml_template`, `fix_outcome_xml_template`.
|
|
30
73
|
|
|
31
|
-
|
|
74
|
+
1. Create `<run_temp_dir>/pr-<N>/`.
|
|
75
|
+
2. Run `git worktree add "<run_temp_dir>/pr-<N>/worktree" origin/<headRef>`.
|
|
76
|
+
3. Record the absolute worktree path alongside the PR's other fields.
|
|
77
|
+
|
|
78
|
+
Background subagents for a PR operate inside that PR's worktree. Step 4 teardown
|
|
79
|
+
runs [`teardown_worktrees.py`](../../_shared/pr-loop/scripts/teardown_worktrees.py)
|
|
80
|
+
for each PR before the shared `rmtree`.
|
|
81
|
+
|
|
82
|
+
## Step 2 — Run name and temp directory (detail)
|
|
83
|
+
|
|
84
|
+
Canonical path resolution lives in
|
|
85
|
+
[`_shared/pr-loop/scripts/_path_resolver.py`](../../_shared/pr-loop/scripts/_path_resolver.py).
|
|
86
|
+
The functions below are its public API; the implementation is the single source of
|
|
87
|
+
truth.
|
|
88
|
+
|
|
89
|
+
- **Run name:** `build_run_name(pr_number, head_branch, *, is_multi_pr)` — returns
|
|
90
|
+
`bugteam-pr-<number>` for single-PR, `bugteam-<sanitized-head-branch>` for multi-PR.
|
|
91
|
+
- **Branch-name sanitization:** `sanitize_branch_name(head_branch)` — maps every
|
|
92
|
+
character outside `[A-Za-z0-9._-]` to `-`.
|
|
93
|
+
- **Per-run temp directory:** `resolve_run_temp_dir(run_name)` — returns
|
|
94
|
+
`Path(tempfile.gettempdir()) / run_name`. Capture the resolved absolute path as
|
|
95
|
+
`<run_temp_dir>` and pass that literal path to every shell command that follows.
|
|
32
96
|
|
|
33
97
|
- **Subagent roles (spawned per loop, not at invocation start):**
|
|
34
98
|
- `bugfind` — `code-quality-agent`, model opus (Opus 4.7 at default xhigh effort)
|
|
@@ -36,8 +100,41 @@ Capture `<owner>/<repo>`, head branch, base branch, PR number, PR URL. This scop
|
|
|
36
100
|
|
|
37
101
|
### Loop state block
|
|
38
102
|
|
|
39
|
-
|
|
103
|
+
Loop state (lead; not a single script; per-PR): the variables below are tracked
|
|
104
|
+
independently for each PR in `all_prs`. Each PR has its own cycle, state, and
|
|
105
|
+
exit reason.
|
|
106
|
+
|
|
107
|
+
Create the initial state file with
|
|
108
|
+
[`init_loop_state.py`](../../_shared/pr-loop/scripts/init_loop_state.py):
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
python scripts/init_loop_state.py --pr-number <N> --head-ref <ref> --starting-sha <SHA> [--is-multi-pr]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Outputs the path to `<run_temp_dir>/pr-<N>/loop-state.json` with keys
|
|
115
|
+
`loop_count`, `last_action`, `last_findings`, `starting_sha`, `loop_comment_index`.
|
|
40
116
|
|
|
41
117
|
**`loop_comment_index` scope (per-loop, not cross-loop):** Reset at the start of every AUDIT action, populated as finding comments are posted during AUDIT, consumed by the matching FIX action when it posts fix replies, and discarded after FIX completes. It does not persist across loops; each loop starts with an empty index and its own fresh set of comment URLs.
|
|
42
118
|
|
|
43
|
-
Each
|
|
119
|
+
Shape: dict keyed by `finding_id`. Each value: `{finding_comment_id, finding_comment_url, thread_node_id, fix_status}` where `thread_node_id` is the PR review thread node id (`PRRT_kwDOxxx`) captured at audit time when calling `get_review_comments`, used by the FIX step's `resolve_thread` call. The loop number is implicit (the index resets at every AUDIT) so it does not repeat in each value. AUDIT populates `finding_comment_id`, `finding_comment_url`, and `thread_node_id` when it posts the per-loop review; FIX sets `fix_status` when its commit lands.
|
|
120
|
+
|
|
121
|
+
#### Multi-PR sub-team tracking
|
|
122
|
+
|
|
123
|
+
When `/bugteam` runs against multiple PRs across repos, each PR operates as a
|
|
124
|
+
logical sub-team within the master `bugteam` team. The PR identity token is
|
|
125
|
+
`{owner}/{repo}#{N}` (e.g. `jl-cmd/claude-code-config#422`). The slugified form
|
|
126
|
+
comes from `slugify_pr_identity(owner, repo, pr_number)` in
|
|
127
|
+
[`_path_resolver.py`](../../_shared/pr-loop/scripts/_path_resolver.py).
|
|
128
|
+
|
|
129
|
+
- **Teammate name:** `bugfind-{owner}-{repo}-pr{N}-loop{L}-{letter}`
|
|
130
|
+
- **Task subject:** `{owner}/{repo}#{N} audit {letter}`
|
|
131
|
+
- **Outcome XML:** `diff_patch_path(run_temp_dir, owner, repo, pr_number, loop_number)` from `_path_resolver.py`
|
|
132
|
+
|
|
133
|
+
The lead filters by the slugified prefix to group tasks and teammates by PR.
|
|
134
|
+
Self-claiming by task subject prefix keeps each teammate on its assigned PR.
|
|
135
|
+
|
|
136
|
+
### --bugbot-retrigger flag
|
|
137
|
+
|
|
138
|
+
**`--bugbot-retrigger` flag:** when present, the FIX subagent posts a `bugbot
|
|
139
|
+
run` issue comment via the Step 2.5 issue-comments fallback endpoint after
|
|
140
|
+
every successful FIX push, to re-trigger Cursor's bugbot on the new commit.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Utility scripts (progressive disclosure)
|
|
4
4
|
|
|
5
|
-
Fragile or repeatable shell sequences belong in `_shared/pr-loop/scripts/`. Anthropic: [Progressive disclosure patterns](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices#progressive-disclosure-patterns) — utility scripts are **executed**, not loaded into context as primary reading.
|
|
5
|
+
Fragile or repeatable shell sequences belong in `_shared/pr-loop/scripts/`. Bugteam-specific scripts (e.g. revoke, see Step 5) live in the skill-local [`scripts/`](../scripts/) directory. Anthropic: [Progressive disclosure patterns](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices#progressive-disclosure-patterns) — utility scripts are **executed**, not loaded into context as primary reading. Shared-script inventory: [`../../../_shared/pr-loop/scripts/README.md`](../../../_shared/pr-loop/scripts/README.md). Bugteam-script inventory: [`../scripts/README.md`](../scripts/README.md). Gate-only merge-base / diff semantics: [`../../../_shared/pr-loop/code-rules-gate.md`](../../../_shared/pr-loop/code-rules-gate.md).
|
|
6
6
|
|
|
7
7
|
### Pre-flight (recommended before Step 0)
|
|
8
8
|
|
|
@@ -12,7 +12,21 @@ From the repository root, run the command in `SKILL.md`. If the exit code is non
|
|
|
12
12
|
|
|
13
13
|
When the cycle exits (any reason), run these steps in order from **this** session (the lead).
|
|
14
14
|
|
|
15
|
-
1. **Delete the
|
|
15
|
+
1. **Delete the team:** `TeamDelete` removes `~/.claude/teams/bugteam/` and `~/.claude/tasks/bugteam/`. Only at convergence/cap/stuck — not between loops.
|
|
16
|
+
|
|
17
|
+
2. Run [`teardown_worktrees.py`](../../_shared/pr-loop/scripts/teardown_worktrees.py)
|
|
18
|
+
to remove each PR's worktree (`git worktree remove`) and the run temp
|
|
19
|
+
directory (Windows-safe `shutil.rmtree`):
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
python "${CLAUDE_SKILL_DIR}/../../_shared/pr-loop/scripts/teardown_worktrees.py" \
|
|
23
|
+
--run-temp-dir "<run_temp_dir>" \
|
|
24
|
+
--all-pr-jsons '<json array of {number, owner, repo}>'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Tolerates already-removed worktrees and missing directories. Uses an
|
|
28
|
+
`onexc`/`onerror` handler for Windows ReadOnly attribute safety
|
|
29
|
+
(see `~/.claude/rules/windows-filesystem-safe.md`).
|
|
16
30
|
|
|
17
31
|
## Step 4.5 — Finalize the PR description (mandatory)
|
|
18
32
|
|
|
@@ -25,6 +39,7 @@ The lead delegates body text to the `pr-description-writer` agent so the global
|
|
|
25
39
|
```
|
|
26
40
|
Agent(
|
|
27
41
|
subagent_type="pr-description-writer",
|
|
42
|
+
mode="bypassPermissions",
|
|
28
43
|
description="Rewrite PR <number> body from cumulative diff",
|
|
29
44
|
prompt="<brief from steps below>"
|
|
30
45
|
)
|
|
@@ -34,25 +49,41 @@ If that subagent is missing, fall back to `general-purpose` with the same brief
|
|
|
34
49
|
|
|
35
50
|
**Steps:**
|
|
36
51
|
|
|
37
|
-
1. Capture cumulative diff: `pull_request_read(method="get_diff", pullNumber=N, owner=O, repo=R)` → write
|
|
38
|
-
2. Capture original body: `pull_request_read(method="get", pullNumber=N, owner=O, repo=R)` → extract `.body` from response, write to `.bugteam-original-body.md`
|
|
52
|
+
1. Capture cumulative diff: `pull_request_read(method="get_diff", pullNumber=N, owner=O, repo=R)` → write the response text to `.bugteam-final.diff` using the `Write` tool.
|
|
53
|
+
2. Capture original body: `pull_request_read(method="get", pullNumber=N, owner=O, repo=R)` → extract `.body` from the response, write it to `.bugteam-original-body.md` using the `Write` tool.
|
|
39
54
|
3. Agent brief:
|
|
40
55
|
- **Inputs:** diff path, original body path, head branch, base branch.
|
|
41
56
|
- **Constraint:** describe what the PR delivers from the cumulative diff — behavior, user-visible effect, merge rationale. Process metadata (loops, fix counts, findings) stays in review comments.
|
|
42
|
-
- **Preservation rule:** if the original body has manually curated sections (linked issues, screenshots, test plan,
|
|
57
|
+
- **Preservation rule:** if the original body has manually curated sections (linked issues, screenshots, test plan, “Risk Assessment”, etc.), preserve them verbatim and only rewrite narrative around them.
|
|
43
58
|
- **Output:** new body markdown.
|
|
44
59
|
4. Write `.bugteam-final-body.md`.
|
|
45
|
-
5. `update_pull_request(pullNumber=N, owner=O, repo=R, body=<
|
|
60
|
+
5. Publish the new body: `update_pull_request(pullNumber=N, owner=O, repo=R, body=<contents of .bugteam-final-body.md>)`.
|
|
46
61
|
6. Delete `.bugteam-final.diff`, `.bugteam-original-body.md`, `.bugteam-final-body.md`.
|
|
47
62
|
|
|
48
63
|
If Step 4.5 fails (agent error, hook block, network), report in the final report and continue to Step 5. The original PR body remains; commits and comments are unaffected.
|
|
49
64
|
|
|
50
65
|
## Step 5 — Revoke project permissions (mandatory, always)
|
|
51
66
|
|
|
52
|
-
After team cleanup — including on error, cap-reached, or stuck exits — run
|
|
67
|
+
After team cleanup — including on error, cap-reached, or stuck exits — run:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
python "${CLAUDE_SKILL_DIR}/scripts/revoke_project_claude_permissions.py"
|
|
71
|
+
```
|
|
53
72
|
|
|
54
73
|
This removes allow rules and `additionalDirectories` added in Step 0. Revoke is non-negotiable: leaving the grant in place would let future sessions inherit elevated `.claude/**` access without an explicit opt-in. Run revoke even if Step 4 partially failed; log cleanup errors separately.
|
|
55
74
|
|
|
56
75
|
## Step 6 — Final report
|
|
57
76
|
|
|
58
|
-
|
|
77
|
+
```
|
|
78
|
+
/bugteam exit: <converged | cap reached | stuck | error>
|
|
79
|
+
Loops: <loop_count>
|
|
80
|
+
Starting commit: <starting_sha7>
|
|
81
|
+
Final commit: <current_HEAD_sha7>
|
|
82
|
+
Net change: <total_files> files, +<total_add>/-<total_del>
|
|
83
|
+
|
|
84
|
+
Loop log:
|
|
85
|
+
1 audit: 3P0 2P1 0P2
|
|
86
|
+
...
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
If exit = `cap reached`, name remaining bug count and suggest `/findbugs` for human triage. If `stuck`, name which findings the fix agent could not resolve. If `error`, surface the error and loop number.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Bugteam utility scripts
|
|
2
|
+
|
|
3
|
+
Scripts in this directory are **executed** by the lead or teammates. They are not loaded into context as instructions (see Anthropic [Skill authoring best practices — Progressive disclosure](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices#progressive-disclosure-patterns)).
|
|
4
|
+
|
|
5
|
+
| Script | Purpose |
|
|
6
|
+
|--------|---------|
|
|
7
|
+
| `bugteam_preflight.py` | Run pytest (when configured) and optional `pre-commit` before `/bugteam`. |
|
|
8
|
+
| `bugteam_fix_hookspath.py` | Auto-remediate a stale local `core.hooksPath` override, set canonical global value, re-run `bugteam_preflight.py`. Invoked by Claude when preflight reports a `core.hooksPath` failure. |
|
|
9
|
+
| `bugteam_code_rules_gate.py` | Run `validate_content` from `code-rules-enforcer.py` on PR-scoped files (`git diff` vs merge-base). Exit `1` if any mandatory rule fails. Invoked **before each audit**; the fixer clears it before the auditor runs. |
|
|
10
|
+
| `grant_project_claude_permissions.py` | Idempotent grant of Edit/Write/Read on `cwd/.claude/**` into `~/.claude/settings.json`. |
|
|
11
|
+
| `revoke_project_claude_permissions.py` | Removes the matching grant entries from `~/.claude/settings.json`. |
|
|
12
|
+
| `test_claude_permissions_common.py` | Pytest module for path normalization and glob-metacharacter guards in `_claude_permissions_common.py`. |
|
|
13
|
+
| `_claude_permissions_common.py` | Shared helpers for the grant/revoke scripts (atomic JSON writes, settings sections). |
|
|
14
|
+
| `windows_safe_rmtree.py` | Recursively remove a directory tree on Windows by stripping ReadOnly attributes and retrying the failing syscall. Invoked from SKILL.md Step 4 to delete `<run_temp_dir>` after teardown. |
|
|
15
|
+
| `probe_code_rules_enforcer_check.py` | Dynamically load `~/.claude/hooks/blocking/code_rules_enforcer.py` and invoke a named check function against a fixture file. Used by the historical Copilot gap-analysis investigation as a verification shape (see `reference/copilot-gap-analysis.md`). |
|
|
16
|
+
|
|
17
|
+
## `bugteam_preflight.py`
|
|
18
|
+
|
|
19
|
+
From the repository root:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
python "${CLAUDE_SKILL_DIR}/scripts/bugteam_preflight.py"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- Skips pytest when `BUGTEAM_PREFLIGHT_SKIP=1`.
|
|
26
|
+
- Skips pytest when `pytest.ini` / `pyproject.toml` exists but no `test_*.py` / `*_test.py` files are found under the repo root.
|
|
27
|
+
- Pytest exit code `5` (no tests collected) is treated as success.
|
|
28
|
+
- Add `--pre-commit` to run `pre-commit run --all-files` when `.pre-commit-config.yaml` exists.
|
|
29
|
+
|
|
30
|
+
## `bugteam_fix_hookspath.py`
|
|
31
|
+
|
|
32
|
+
From the repository root:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
python "${CLAUDE_SKILL_DIR}/scripts/bugteam_fix_hookspath.py"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- Removes any local-scope `core.hooksPath` value that does not end in `hooks/git-hooks`.
|
|
39
|
+
- Sets `git config --global core.hooksPath ~/.claude/hooks/git-hooks` when the global value is unset or non-canonical.
|
|
40
|
+
- Refuses to run (exit non-zero) when `~/.claude/hooks/git-hooks` does not exist on disk — install via `npx claude-dev-env .` first.
|
|
41
|
+
- Idempotent: a second invocation is a clean no-op.
|
|
42
|
+
- Re-runs `bugteam_preflight.py --no-pytest` and propagates its exit code.
|
|
43
|
+
|
|
44
|
+
The bugteam SKILL invokes this automatically when preflight stderr indicates a `core.hooksPath` failure, so Claude does not surface the error to the user.
|
|
45
|
+
|
|
46
|
+
## `bugteam_code_rules_gate.py`
|
|
47
|
+
|
|
48
|
+
From the repository root (same merge-base rules as the PR head vs base — default `--base origin/main`):
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
python "${CLAUDE_SKILL_DIR}/scripts/bugteam_code_rules_gate.py"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Optional explicit files instead of `git diff`:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
python "${CLAUDE_SKILL_DIR}/scripts/bugteam_code_rules_gate.py" path/to/a.py path/to/b.ts
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
This loads `validate_content` from `hooks/blocking/code-rules-enforcer.py` inside `claude-dev-env` (same logic as the PreToolUse hook). Exit `0` = mandatory checks pass on scanned files; exit `1` = violations printed to stderr.
|