claude-dev-env 1.38.1 → 1.40.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 +199 -0
- package/_shared/pr-loop/scripts/config/reviews_disabled_constants.py +8 -0
- package/_shared/pr-loop/scripts/post_audit_thread.py +1242 -0
- package/_shared/pr-loop/scripts/preflight.py +129 -2
- package/_shared/pr-loop/scripts/reviews_disabled.py +59 -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 +1116 -0
- package/_shared/pr-loop/scripts/tests/test_post_audit_thread_constants.py +127 -0
- package/_shared/pr-loop/scripts/tests/test_preflight.py +41 -0
- package/_shared/pr-loop/scripts/tests/test_reviews_disabled.py +36 -0
- package/_shared/pr-loop/state-schema.md +1 -1
- package/agents/clean-coder.md +2 -2
- package/agents/pr-description-writer.md +150 -52
- 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/docs/PR_DESCRIPTION_GUIDE.md +127 -64
- package/hooks/blocking/bot_mention_comment_blocker.py +75 -0
- package/hooks/blocking/code_rules_enforcer.py +1143 -129
- 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/pr_description_enforcer.py +57 -22
- 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_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/blocking/test_pr_description_enforcer.py +69 -8
- 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/pr_description_enforcer_constants.py +14 -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 +132 -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 +111 -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 +328 -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 +309 -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/copilot-review/SKILL.md +16 -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 +96 -2
- package/skills/monitor-open-prs/SKILL.md +14 -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 +229 -23
- package/skills/pr-converge/config/__init__.py +0 -0
- package/skills/pr-converge/config/constants.py +63 -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 +107 -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 +279 -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/scripts/test_check_bugbot_ci.py +312 -0
- package/skills/pr-converge/workflows/schedule-wakeup-loop.md +5 -12
- package/skills/qbug/SKILL.md +157 -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,127 @@
|
|
|
1
|
+
"""Tests for post_audit_thread_constants.py extracted constant set."""
|
|
2
|
+
|
|
3
|
+
import importlib.util
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from types import ModuleType
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def _load_constants_module() -> ModuleType:
|
|
9
|
+
module_path = (
|
|
10
|
+
Path(__file__).parent.parent / "config" / "post_audit_thread_constants.py"
|
|
11
|
+
)
|
|
12
|
+
specification = importlib.util.spec_from_file_location(
|
|
13
|
+
"config.post_audit_thread_constants", module_path
|
|
14
|
+
)
|
|
15
|
+
assert specification is not None
|
|
16
|
+
assert specification.loader is not None
|
|
17
|
+
module = importlib.util.module_from_spec(specification)
|
|
18
|
+
specification.loader.exec_module(module)
|
|
19
|
+
return module
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
constants_module = _load_constants_module()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def test_http_request_content_type_is_application_json() -> None:
|
|
26
|
+
assert constants_module.HTTP_REQUEST_CONTENT_TYPE == "application/json"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def test_http_method_post_constant_is_post() -> None:
|
|
30
|
+
assert constants_module.HTTP_METHOD_POST == "POST"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def test_http_header_authorization_constant_is_authorization() -> None:
|
|
34
|
+
assert constants_module.HTTP_HEADER_AUTHORIZATION == "Authorization"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def test_http_header_accept_constant_is_accept() -> None:
|
|
38
|
+
assert constants_module.HTTP_HEADER_ACCEPT == "Accept"
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def test_http_header_content_type_constant_is_content_type() -> None:
|
|
42
|
+
assert constants_module.HTTP_HEADER_CONTENT_TYPE == "Content-Type"
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def test_http_header_github_api_version_constant_is_x_github_api_version() -> None:
|
|
46
|
+
assert constants_module.HTTP_HEADER_GITHUB_API_VERSION == "X-GitHub-Api-Version"
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def test_http_header_user_agent_constant_is_user_agent() -> None:
|
|
50
|
+
assert constants_module.HTTP_HEADER_USER_AGENT == "User-Agent"
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def test_http_authorization_bearer_prefix_is_bearer_with_trailing_space() -> None:
|
|
54
|
+
prefix = constants_module.HTTP_AUTHORIZATION_BEARER_PREFIX
|
|
55
|
+
assert prefix == "Bearer "
|
|
56
|
+
assert prefix.endswith(" ")
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def test_http_request_timeout_seconds_is_positive_int() -> None:
|
|
60
|
+
timeout_seconds = constants_module.HTTP_REQUEST_TIMEOUT_SECONDS
|
|
61
|
+
assert isinstance(timeout_seconds, int)
|
|
62
|
+
assert timeout_seconds > 0
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def test_error_response_preview_chars_is_positive_int() -> None:
|
|
66
|
+
preview_chars = constants_module.ERROR_RESPONSE_PREVIEW_CHARS
|
|
67
|
+
assert isinstance(preview_chars, int)
|
|
68
|
+
assert preview_chars > 0
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def test_single_review_api_path_template_uses_pr_number_placeholder() -> None:
|
|
72
|
+
template_text = constants_module.SINGLE_REVIEW_API_PATH_TEMPLATE
|
|
73
|
+
assert "{owner}" in template_text
|
|
74
|
+
assert "{repo}" in template_text
|
|
75
|
+
assert "{pr_number}" in template_text
|
|
76
|
+
assert "{review_id}" in template_text
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def test_single_review_comments_api_path_template_uses_pr_number_placeholder() -> None:
|
|
80
|
+
template_text = constants_module.SINGLE_REVIEW_COMMENTS_API_PATH_TEMPLATE
|
|
81
|
+
assert "{owner}" in template_text
|
|
82
|
+
assert "{repo}" in template_text
|
|
83
|
+
assert "{pr_number}" in template_text
|
|
84
|
+
assert "{review_id}" in template_text
|
|
85
|
+
assert template_text.endswith("/comments")
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def test_audit_body_skeleton_marker_tokens_present() -> None:
|
|
89
|
+
open_marker = constants_module.AUDIT_BODY_SKELETON_OPEN_MARKER
|
|
90
|
+
close_marker = constants_module.AUDIT_BODY_SKELETON_CLOSE_MARKER
|
|
91
|
+
assert open_marker.startswith("<!--") and open_marker.endswith("-->")
|
|
92
|
+
assert close_marker.startswith("<!--") and close_marker.endswith("-->")
|
|
93
|
+
assert open_marker != close_marker
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def test_template_path_resolves_to_existing_markdown_file() -> None:
|
|
97
|
+
resolved_path = constants_module.template_path()
|
|
98
|
+
assert resolved_path.is_file(), f"missing: {resolved_path}"
|
|
99
|
+
assert resolved_path.suffix == ".md"
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def test_template_contains_skeleton_markers() -> None:
|
|
103
|
+
resolved_path = constants_module.template_path()
|
|
104
|
+
template_text = resolved_path.read_text(encoding="utf-8")
|
|
105
|
+
assert constants_module.AUDIT_BODY_SKELETON_OPEN_MARKER in template_text
|
|
106
|
+
assert constants_module.AUDIT_BODY_SKELETON_CLOSE_MARKER in template_text
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def test_live_test_fixture_names_are_not_exposed_from_production_config_module() -> None:
|
|
110
|
+
forbidden_attribute_names = [
|
|
111
|
+
"LIVE_TEST_OWNER",
|
|
112
|
+
"LIVE_TEST_REPO",
|
|
113
|
+
"LIVE_TEST_BRANCH_PREFIX",
|
|
114
|
+
"LIVE_TEST_PR_TITLE",
|
|
115
|
+
"LIVE_TEST_PR_BODY",
|
|
116
|
+
"LIVE_TEST_BASE_BRANCH",
|
|
117
|
+
"LIVE_TEST_FIXTURE_FILENAME",
|
|
118
|
+
"LIVE_TEST_FIXTURE_CONTENT",
|
|
119
|
+
"LIVE_TEST_FIXTURE_LINE_FOR_FINDING_ONE",
|
|
120
|
+
"LIVE_TEST_FIXTURE_LINE_FOR_FINDING_TWO",
|
|
121
|
+
"LIVE_TEST_FIXTURE_LINE_FOR_FINDING_THREE",
|
|
122
|
+
]
|
|
123
|
+
for each_attribute_name in forbidden_attribute_names:
|
|
124
|
+
assert not hasattr(constants_module, each_attribute_name), (
|
|
125
|
+
f"production config module exposes test-only fixture "
|
|
126
|
+
f"{each_attribute_name!r}; move it to test_post_audit_thread.py"
|
|
127
|
+
)
|
|
@@ -690,3 +690,44 @@ def test_main_prints_no_related_tests_when_get_changed_files_returns_empty(
|
|
|
690
690
|
assert exit_code == 0
|
|
691
691
|
captured = capsys.readouterr()
|
|
692
692
|
assert "no related tests found" in captured.err
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
def test_main_should_halt_when_env_var_lists_bugteam(
|
|
696
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
697
|
+
capsys: pytest.CaptureFixture[str],
|
|
698
|
+
) -> None:
|
|
699
|
+
"""CLAUDE_REVIEWS_DISABLED=bugteam must halt preflight with the dedicated exit code."""
|
|
700
|
+
monkeypatch.setenv("CLAUDE_REVIEWS_DISABLED", "bugteam")
|
|
701
|
+
monkeypatch.delenv("BUGTEAM_PREFLIGHT_SKIP", raising=False)
|
|
702
|
+
exit_code = preflight.main(["--no-pytest"])
|
|
703
|
+
assert exit_code == preflight.EXIT_CODE_BUGTEAM_DISABLED_VIA_ENV
|
|
704
|
+
captured = capsys.readouterr()
|
|
705
|
+
assert "CLAUDE_REVIEWS_DISABLED" in captured.err
|
|
706
|
+
assert "bugteam" in captured.err
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
def test_main_should_continue_when_env_var_omits_bugteam(
|
|
710
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
711
|
+
tmp_path: Path,
|
|
712
|
+
) -> None:
|
|
713
|
+
"""CLAUDE_REVIEWS_DISABLED without the bugteam token must not halt preflight."""
|
|
714
|
+
monkeypatch.setenv("CLAUDE_REVIEWS_DISABLED", "copilot,bugbot")
|
|
715
|
+
monkeypatch.delenv("BUGTEAM_PREFLIGHT_SKIP", raising=False)
|
|
716
|
+
claude_hooks_path = tmp_path / ".claude" / "hooks" / "git-hooks"
|
|
717
|
+
claude_hooks_path.mkdir(parents=True)
|
|
718
|
+
with patch("subprocess.run") as mock_run:
|
|
719
|
+
mock_run.return_value = _make_completed_process(
|
|
720
|
+
str(claude_hooks_path) + "\n", returncode=0
|
|
721
|
+
)
|
|
722
|
+
exit_code = preflight.main(["--no-pytest"])
|
|
723
|
+
assert exit_code != preflight.EXIT_CODE_BUGTEAM_DISABLED_VIA_ENV
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
def test_main_should_halt_when_env_var_contains_uppercase_or_whitespace_bugteam_token(
|
|
727
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
728
|
+
) -> None:
|
|
729
|
+
"""Token matching must be case-insensitive and whitespace-tolerant."""
|
|
730
|
+
monkeypatch.setenv("CLAUDE_REVIEWS_DISABLED", " BugTeam , copilot ")
|
|
731
|
+
monkeypatch.delenv("BUGTEAM_PREFLIGHT_SKIP", raising=False)
|
|
732
|
+
exit_code = preflight.main(["--no-pytest"])
|
|
733
|
+
assert exit_code == preflight.EXIT_CODE_BUGTEAM_DISABLED_VIA_ENV
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"""Direct unit tests for the shared reviews_disabled helper."""
|
|
2
|
+
|
|
3
|
+
import importlib.util
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from types import ModuleType
|
|
6
|
+
|
|
7
|
+
import pytest
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def _load_reviews_disabled_module() -> ModuleType:
|
|
11
|
+
module_path = Path(__file__).parent.parent / "reviews_disabled.py"
|
|
12
|
+
specification = importlib.util.spec_from_file_location(
|
|
13
|
+
"reviews_disabled", module_path
|
|
14
|
+
)
|
|
15
|
+
assert specification is not None
|
|
16
|
+
assert specification.loader is not None
|
|
17
|
+
module = importlib.util.module_from_spec(specification)
|
|
18
|
+
specification.loader.exec_module(module)
|
|
19
|
+
return module
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
reviews_disabled = _load_reviews_disabled_module()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def test_is_bugteam_disabled_via_env_returns_true_when_env_lists_bugteam(
|
|
26
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
27
|
+
) -> None:
|
|
28
|
+
monkeypatch.setenv("CLAUDE_REVIEWS_DISABLED", "bugteam")
|
|
29
|
+
assert reviews_disabled.is_bugteam_disabled_via_env() is True
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def test_is_bugteam_disabled_via_env_returns_false_when_env_is_empty(
|
|
33
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
34
|
+
) -> None:
|
|
35
|
+
monkeypatch.delenv("CLAUDE_REVIEWS_DISABLED", raising=False)
|
|
36
|
+
assert reviews_disabled.is_bugteam_disabled_via_env() is False
|
|
@@ -11,7 +11,7 @@ State each PR-loop workflow tracks across iterations. Workflows differ on persis
|
|
|
11
11
|
| `last_findings` | object | `{p0, p1, p2, total}` count of findings from most recent AUDIT |
|
|
12
12
|
| `audit_log` | list[str] | Per-iteration one-line summaries for the final report |
|
|
13
13
|
| `starting_sha` | str | `git rev-parse HEAD` at workflow start |
|
|
14
|
-
| `loop_comment_index` | dict | `{finding_id: {finding_comment_id, finding_comment_url,
|
|
14
|
+
| `loop_comment_index` | dict | `{finding_id: {finding_comment_id, finding_comment_url, thread_node_id, fix_status, ...}}` (`thread_node_id` is the PR review thread node id — `PRRT_kwDOxxx` — captured at audit time when calling `get_review_comments`, used by `resolve_thread` at FIX time) |
|
|
15
15
|
|
|
16
16
|
## Workflow-specific extensions
|
|
17
17
|
|
package/agents/clean-coder.md
CHANGED
|
@@ -8,7 +8,7 @@ color: green
|
|
|
8
8
|
|
|
9
9
|
# Clean Coder — Zero-Defect Code Generation
|
|
10
10
|
|
|
11
|
-
You are the definitive code-writing agent. You produce code so clean that reviewers find nothing. Every rule from CODE_RULES.md and every dimension from the readability rubric is internalized into your generation process. The goal: `/check`
|
|
11
|
+
You are the definitive code-writing agent. You produce code so clean that reviewers find nothing. Every rule from CODE_RULES.md and every dimension from the readability rubric is internalized into your generation process. The goal: `/check` returns CLEAN on every file you touch.
|
|
12
12
|
|
|
13
13
|
**Announce at start:** "Using clean-coder agent — CODE_RULES.md internalized, targeting 160/160 readability."
|
|
14
14
|
|
|
@@ -445,7 +445,7 @@ Code clean-coder writes will be audited later against the A–K bug categories f
|
|
|
445
445
|
Every line you write or modify will:
|
|
446
446
|
- Score 160/160 on the 8-dimension readability rubric
|
|
447
447
|
- Satisfy every hook-enforced gate so each write succeeds on the first attempt
|
|
448
|
-
- Return CLEAN from `/check
|
|
448
|
+
- Return CLEAN from `/check` and `/review-code`
|
|
449
449
|
- Use complete type hints on every parameter and return
|
|
450
450
|
- Pass `mypy_validator.py` cleanly — every file is mypy-clean at write time
|
|
451
451
|
- Land in the format the project's `auto_formatter.py` produces — the formatter runs at write time, but generation should already match the canonical Black/Prettier output
|
|
@@ -1,87 +1,185 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pr-description-writer
|
|
3
|
-
description: "MANDATORY agent for writing PR descriptions, commit messages, and
|
|
3
|
+
description: "MANDATORY agent for writing PR descriptions, commit messages, PR comments, and issue comments. Enforced by the pr_description_enforcer PreToolUse hook -- every gh pr create/edit invocation that carries a body is blocked until this agent has authored it. Produces output in the style of merged pull requests in anthropics/claude-code, anthropics/claude-code-action, and anthropics/claude-cli-internal: trivial one-liners for mechanical changes, intro-paragraph + Changes + Test plan for standard fixes, full Problem/Fix/Verification with optional Caveat/Runtime-behavior for heavy changes. Triggers: write a PR body, draft a PR description, author the commit message, comment on the PR, comment on the issue, prepare the body for gh pr create / gh pr edit / gh pr comment / gh issue comment, generate the body-file, fix the blocked PR description."
|
|
4
4
|
tools: Read,Grep,Glob,Bash
|
|
5
5
|
model: haiku
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# PR Description Writer
|
|
9
9
|
|
|
10
|
-
You
|
|
10
|
+
You author PR descriptions, commit messages, and PR/issue comments in the shape that merged pull requests in `anthropics/claude-code`, `anthropics/claude-code-action`, and `anthropics/claude-cli-internal` take. You pick the shape from the diff. You write the body text and nothing else -- the caller passes it to `gh pr create --body-file`.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## TOC
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
- Process (the 4-step checklist)
|
|
15
|
+
- Sizing (Trivial / Standard / Heavy)
|
|
16
|
+
- Shape 1: Trivial (sectionless one-liner)
|
|
17
|
+
- Shape 2: Standard (intro + Changes + Test plan)
|
|
18
|
+
- Shape 3: Heavy (intro + Problem + Fix + Verification + optional)
|
|
19
|
+
- File reference style
|
|
20
|
+
- Cross-references
|
|
21
|
+
- Markers and footers
|
|
22
|
+
- Commit messages
|
|
23
|
+
- Gotchas
|
|
24
|
+
- Refusals
|
|
15
25
|
|
|
16
|
-
|
|
17
|
-
- **Bold the filename** (no path, just the file)
|
|
18
|
-
- Explain the problem in layman terms (what went wrong / what was missing)
|
|
19
|
-
- Explain the fix in layman terms (what the change does)
|
|
20
|
-
- No jargon. No code snippets. No technical implementation details.
|
|
26
|
+
The companion guide (`packages/claude-dev-env/docs/PR_DESCRIPTION_GUIDE.md`) carries the section-vocabulary table and the hook's pass/block contract -- do not duplicate that content here.
|
|
21
27
|
|
|
22
|
-
|
|
23
|
-
> **pullEngine.ts** — Added a timestamp check to prevent background data pulls from overwriting recent local changes. Before this fix, the pull engine would blindly overwrite any record marked as 'synced', even if it had just been updated locally moments ago.
|
|
24
|
-
|
|
25
|
-
### 2. Group test/config changes as bullet points
|
|
28
|
+
## Process
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
Copy this checklist into your response and check items off as you go:
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
> - Disable CSS animations to prevent click instability
|
|
32
|
+
- [ ] Inspect the diff: `git diff <base>...HEAD --stat`, then `git diff <base>...HEAD` for any file whose purpose isn't obvious from the path.
|
|
33
|
+
- [ ] If the branch name or any commit mentions an issue (`fix-1311`, `Fixes #1311`), read it: `gh issue view 1311`.
|
|
34
|
+
- [ ] Pick the shape from the Sizing table.
|
|
35
|
+
- [ ] Write the body in that shape. Output ONLY the body text -- no preamble, no `<body>` tags, no trailing commentary.
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
## Sizing
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
| Signal | Shape |
|
|
40
|
+
|---|---|
|
|
41
|
+
| 1-3 files, mechanical change (pin bump, link fix, typo, single-line config), no behavior change | **Trivial** |
|
|
42
|
+
| Behavior change, bug fix, small feature; under ~15 files | **Standard** |
|
|
43
|
+
| New subsystem, refactor across many files, schema or contract change, anything with a caveat | **Heavy** |
|
|
40
44
|
|
|
41
|
-
|
|
45
|
+
Prefer the smaller shape when borderline. Anthropic authors prefer the smaller shape.
|
|
42
46
|
|
|
43
|
-
|
|
44
|
-
- First line: imperative summary (max 72 chars)
|
|
45
|
-
- Body: one paragraph per production file explaining WHY
|
|
46
|
-
- Skip test details unless the commit is test-only
|
|
47
|
+
## Shape 1: Trivial
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
One declarative sentence. No Markdown headers. Optional `Fixes #N` line.
|
|
49
50
|
|
|
50
51
|
```
|
|
51
|
-
|
|
52
|
+
Pin third-party GitHub Actions references to immutable commit SHAs.
|
|
53
|
+
```
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
```
|
|
56
|
+
Bump pinned Bun from 1.3.6 to 1.3.14.
|
|
54
57
|
|
|
55
|
-
|
|
58
|
+
Fixes #1311.
|
|
59
|
+
```
|
|
56
60
|
|
|
57
|
-
|
|
61
|
+
## Shape 2: Standard
|
|
58
62
|
|
|
59
|
-
|
|
63
|
+
```
|
|
64
|
+
<One short intro paragraph stating the change and why it matters.
|
|
65
|
+
Reference the failure mode or user-visible symptom when there is one.>
|
|
60
66
|
|
|
61
|
-
|
|
62
|
-
- No per-file breakdown
|
|
67
|
+
Fixes #<n>.
|
|
63
68
|
|
|
64
|
-
|
|
69
|
+
## Changes
|
|
65
70
|
|
|
66
|
-
|
|
71
|
+
- `path/to/file.ext`: short clause describing the change
|
|
72
|
+
- `path/to/other.ext`: short clause
|
|
73
|
+
- `tests/foo.test.ts`: 2 new cases for X
|
|
67
74
|
|
|
68
75
|
## Test plan
|
|
69
|
-
|
|
76
|
+
|
|
77
|
+
- `bun test test/foo.test.ts`
|
|
78
|
+
- `bun run typecheck`
|
|
79
|
+
- Manual: reproduce on a branch named `feature/a,b`; confirm no rejection
|
|
70
80
|
```
|
|
71
81
|
|
|
72
|
-
##
|
|
82
|
+
## Shape 3: Heavy
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
<Two- to four-sentence intro: scope, motivation, user-visible effect.
|
|
86
|
+
Link to the prior PR or issue that motivates this one if applicable.>
|
|
87
|
+
|
|
88
|
+
Fixes #<n>.
|
|
89
|
+
|
|
90
|
+
## Problem
|
|
91
|
+
|
|
92
|
+
<Concrete description of the failure mode or gap. Quote the actual
|
|
93
|
+
error text or a reproduction in a fenced code block when it helps.>
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
<error or reproduction>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Fix
|
|
100
|
+
|
|
101
|
+
<What the change does at the level a reviewer needs to evaluate it.
|
|
102
|
+
Reference the file or function by path. Don't restate the diff
|
|
103
|
+
line-by-line.>
|
|
104
|
+
|
|
105
|
+
- `src/path/file.ts`: brief description
|
|
106
|
+
- `src/path/other.ts`: brief description
|
|
107
|
+
|
|
108
|
+
## Verification
|
|
109
|
+
|
|
110
|
+
- Command 1
|
|
111
|
+
- Command 2 (with output count when useful: "666 pass, 0 fail")
|
|
112
|
+
- Manual scenarios walked through
|
|
113
|
+
|
|
114
|
+
## Caveat
|
|
115
|
+
|
|
116
|
+
<Anything a reviewer or downstream user needs to know that isn't in
|
|
117
|
+
the diff. Omit the section when there is no caveat.>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Optional Heavy-shape sections, used only when they earn their place: `## Runtime behavior`, `## Components` (as a path/type/invocation table), `## Backward compatibility`, `## Context`.
|
|
121
|
+
|
|
122
|
+
## File reference style
|
|
123
|
+
|
|
124
|
+
- Backtick file paths: `` `src/github/operations/branch.ts` ``.
|
|
125
|
+
- Use the full path from repo root unless the basename is unambiguous within the PR.
|
|
126
|
+
- Per-file change bullets lead with the backticked path and a colon:
|
|
127
|
+
- `` `src/foo.ts`: whitelists `,` in branch names ``
|
|
128
|
+
- When one file is the centerpiece, bold the backticked filename: `` **`branch.ts`**: ... ``.
|
|
129
|
+
|
|
130
|
+
## Cross-references
|
|
131
|
+
|
|
132
|
+
- Same-repo: `#1311`. Cross-repo: `anthropics/claude-code#40576`.
|
|
133
|
+
- `Fixes #N` and `Closes #N` close the issue on merge -- pick one and use it deliberately.
|
|
134
|
+
- `Linear: CC-1723` on its own line.
|
|
135
|
+
- "Follow-up to #<n>" / "Same change as <repo>#<n>" -- short orientation one-liners are welcome.
|
|
136
|
+
|
|
137
|
+
## Markers and footers
|
|
138
|
+
|
|
139
|
+
- `<!-- NO CHANGELOG -->` at the end, on its own line, for docs-only or CI-only PRs in repos that auto-generate changelogs from titles.
|
|
140
|
+
- No "Generated with Claude Code" footer. Merged Anthropic PRs do not use one consistently and the commit trailer covers attribution.
|
|
141
|
+
|
|
142
|
+
## Commit messages
|
|
143
|
+
|
|
144
|
+
Same shape, compressed:
|
|
145
|
+
|
|
146
|
+
- First line: imperative summary, max 72 chars. Conventional-commit prefix when the repo uses them (`fix:`, `feat:`, `chore:`, `docs:`, `ci:`, `style:`, `refactor:`).
|
|
147
|
+
- Blank line.
|
|
148
|
+
- Body: one short paragraph stating the Why and the Fix together. Reference the issue when relevant.
|
|
149
|
+
- Skip the body entirely for trivial commits whose first line says everything.
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
fix: allow , in branch names
|
|
153
|
+
|
|
154
|
+
git check-ref-format permits commas; the whitelist in
|
|
155
|
+
src/github/operations/branch.ts did not, so PRs whose head
|
|
156
|
+
branch contained a comma failed validation before any git
|
|
157
|
+
operation. Add `,` to the whitelist; same reasoning as
|
|
158
|
+
adding `#` (#1167) and `+` (#1248).
|
|
159
|
+
|
|
160
|
+
Fixes #1300.
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Gotchas
|
|
164
|
+
|
|
165
|
+
Highest-signal content. Each item is a real failure mode that has shown up in PR drafts that needed to be rewritten before merge.
|
|
166
|
+
|
|
167
|
+
- **Don't restate the PR title as the body's first line.** The title is already displayed. Start with the *consequence* the reader cares about.
|
|
168
|
+
- **Don't add `## Why` over a single-paragraph intro.** A header on one paragraph reads as ceremony. The unmarked intro paragraph IS the Why.
|
|
169
|
+
- **Don't add a "Generated with Claude Code" footer.** Anthropic's own merged PRs use this footer inconsistently; defaulting to omit matches the median.
|
|
170
|
+
- **Don't write second-person commentary to the reviewer.** "Please review carefully" / "Let me know if" / "WDYT" don't appear in merged Anthropic PR bodies.
|
|
171
|
+
- **Don't restate the diff in `## Changes`.** Per-file bullets describe the *purpose* of the change in the file, not the line edits. The reviewer reads the diff.
|
|
172
|
+
- **Don't put verification commands in `## Changes`.** They go in `## Test plan` / `## Verification`. Mixing them obscures both.
|
|
173
|
+
- **Don't bold a filename without backticks.** Filenames are code; the canonical form is `` **`branch.ts`**: ... ``, never `**branch.ts**:`.
|
|
174
|
+
- **Don't mix `Fixes #N` and `Closes #N` within one body.** Both close the linked issue on merge -- pick one verb per PR.
|
|
175
|
+
- **Don't add empty section headers.** If `## Caveat` would be empty, drop it. Headers exist to organize content, not to satisfy a template.
|
|
176
|
+
- **Don't hedge.** "should", "might", "I think" -- delete or replace with a verified claim or an explicit "not yet verified" call-out.
|
|
177
|
+
- **Trivial PRs need no sections.** Resist the urge to add `## Summary` over a one-sentence body. The hook does not require headers; the style does not invite them.
|
|
178
|
+
- **The hook permits sectionless bodies.** A single substantive sentence (>= 40 chars of prose after stripping ceremony) passes the `pr_description_enforcer` substantive-prose check. Don't add headers to placate the hook -- the hook isn't asking for them.
|
|
73
179
|
|
|
74
|
-
|
|
75
|
-
2. Categorize files: production vs test vs config
|
|
76
|
-
3. For each production file, understand the change and write the WHY
|
|
77
|
-
4. Summarize test/config changes as bullets
|
|
78
|
-
5. Output the description in the template format
|
|
180
|
+
## Refusals
|
|
79
181
|
|
|
80
|
-
|
|
182
|
+
First match wins. Respond with the quoted line exactly and stop:
|
|
81
183
|
|
|
82
|
-
- No
|
|
83
|
-
-
|
|
84
|
-
- No implementation details (no "added pullStartedAt parameter", say "added a timestamp check")
|
|
85
|
-
- No passive voice ("Fixed X" not "X was fixed")
|
|
86
|
-
- No filler ("This PR..." — just start with the content)
|
|
87
|
-
- No duplicating the diff (the reviewer can read the code)
|
|
184
|
+
- **No diff visible** (e.g., called against an empty branch or before any commits land). Respond: `No diff to describe. Run "git diff <base>...HEAD --stat" first; if the diff is genuinely empty, the PR shouldn't exist.`
|
|
185
|
+
- **Caller asks for prose to be edited into the PR description rather than authored from the diff** (e.g., "add a paragraph saying X to the existing body"). Respond: `Author the body from the diff, not from external prose. Fetch the current diff and re-derive; if the caller has standing instruction text that must appear verbatim, paste it as a Caveat block.`
|
package/bin/install.mjs
CHANGED
|
@@ -16,7 +16,7 @@ const PACKAGE_NAME = 'claude-dev-env';
|
|
|
16
16
|
const PACKAGE_VERSION = JSON.parse(readFileSync(join(PACKAGE_ROOT, 'package.json'), 'utf8')).version;
|
|
17
17
|
const packageRequire = createRequire(import.meta.url);
|
|
18
18
|
|
|
19
|
-
export const CONTENT_DIRECTORIES = ['rules', 'docs', 'commands', 'agents', 'system-prompts', 'scripts', '_shared'];
|
|
19
|
+
export const CONTENT_DIRECTORIES = ['rules', 'docs', 'commands', 'agents', 'system-prompts', 'scripts', '_shared', 'audit-rubrics'];
|
|
20
20
|
|
|
21
21
|
export function collectPackageSourceConflicts(packageDirectory) {
|
|
22
22
|
const gitConflictStatusCodes = new Set(['DD', 'AU', 'UD', 'UA', 'DU', 'AA', 'UU']);
|
|
@@ -147,17 +147,16 @@ const INSTALL_GROUPS = {
|
|
|
147
147
|
core: {
|
|
148
148
|
description: 'Development standards, hooks, agents, commands',
|
|
149
149
|
skills: [
|
|
150
|
-
'anthropic-plan', 'everything-search',
|
|
151
|
-
'
|
|
152
|
-
'recall', 'remember'
|
|
153
|
-
'skill-writer', 'tdd-team'
|
|
150
|
+
'anthropic-plan', 'everything-search',
|
|
151
|
+
'pr-review-responder',
|
|
152
|
+
'recall', 'remember'
|
|
154
153
|
],
|
|
155
|
-
includeDirectories: ['rules', 'docs', 'commands', 'agents'],
|
|
154
|
+
includeDirectories: ['rules', 'docs', 'commands', 'agents', 'audit-rubrics'],
|
|
156
155
|
includeAllHooks: true,
|
|
157
156
|
},
|
|
158
157
|
journal: {
|
|
159
158
|
description: 'Session logging and memory',
|
|
160
|
-
skills: ['
|
|
159
|
+
skills: ['session-log', 'session-tidy'],
|
|
161
160
|
},
|
|
162
161
|
research: {
|
|
163
162
|
description: 'Deep research and citation tools',
|
package/bin/install.test.mjs
CHANGED
|
@@ -135,6 +135,14 @@ test('CONTENT_DIRECTORIES includes _shared so installer copies _shared/pr-loop/
|
|
|
135
135
|
});
|
|
136
136
|
|
|
137
137
|
|
|
138
|
+
test('CONTENT_DIRECTORIES includes audit-rubrics so installer copies category rubrics and prompts to ~/.claude/audit-rubrics/', () => {
|
|
139
|
+
assert.ok(
|
|
140
|
+
CONTENT_DIRECTORIES.includes('audit-rubrics'),
|
|
141
|
+
'audit-rubrics must be in CONTENT_DIRECTORIES so bugteam can resolve $HOME/.claude/audit-rubrics/{category_rubrics,prompts}/',
|
|
142
|
+
);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
|
|
138
146
|
test('collectPackageSourceConflicts surfaces both-added and deleted-by-them entries', () => {
|
|
139
147
|
const repositoryRoot = createTemporaryGitRepository();
|
|
140
148
|
try {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Upload an HTML file as a secret gist and open the htmlpreview URL. Manual escape hatch when the auto-publish hook's marker route doesn't apply.
|
|
3
|
+
allowed-tools: Bash
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Argument: `$ARGUMENTS` is the path to an existing `.html` file.
|
|
7
|
+
|
|
8
|
+
Run the doc-gist skill's transport script directly:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
python3 "${CLAUDE_PLUGIN_ROOT}/skills/doc-gist/scripts/gist_upload.py" --input "$ARGUMENTS"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Quote both URLs (`Gist:` and `Preview:`) from stderr back to the user as clickable markdown links. Surface any `gh gist create failed` error with the suggested `gh auth login` next-step.
|
|
15
|
+
|
|
16
|
+
When the user asks for a writeup or report rather than handing you a file path, design fresh HTML per [`skills/doc-gist/SKILL.md`](../skills/doc-gist/SKILL.md), include the `<!-- @publish-as-gist -->` marker, and write the file — the auto-publish hook will run on Write. Use this command only when the marker route doesn't fit (existing file you want to publish, HTML from a separate tool).
|
package/commands/plan.md
CHANGED
|
@@ -41,8 +41,6 @@ Plan a feature with full validation workflow.
|
|
|
41
41
|
| Design | `plan` skill | Collaborative design with config discovery |
|
|
42
42
|
| Write | `write-plan` skill | TDD plan with CODE_RULES.md compliance |
|
|
43
43
|
| Review Plan | `review-plan` skill | Validate plan against standards |
|
|
44
|
-
| Execute | `plan-executor` agent | Implement with standards enforcement |
|
|
45
|
-
| Review Code | `readability-review` skill | Validate code before commit |
|
|
46
44
|
|
|
47
45
|
## Standards Reference
|
|
48
46
|
|
package/commands/review-plan.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Review the current plan against code standards.
|
|
2
2
|
|
|
3
3
|
1. Identify plan files in `.planning/phases/` or `docs/plans/`
|
|
4
|
-
2.
|
|
4
|
+
2. Review the plan against CODE_RULES.md standards
|
|
5
5
|
3. Report the verdict back to the user
|