claude-dev-env 1.93.1 → 1.95.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/_shared/advisor/CLAUDE.md +2 -2
- package/_shared/advisor/advisor-protocol.md +35 -27
- package/_shared/advisor/scripts/config/advisor_scripts_constants/model_tier_run_validator_constants.py +3 -2
- package/_shared/advisor/scripts/model_tier_run_validator.py +23 -15
- package/_shared/advisor/scripts/tests/test_model_tier_run_validator.py +81 -17
- package/_shared/pr-loop/CLAUDE.md +1 -0
- package/_shared/pr-loop/audit-contract.md +1 -1
- package/_shared/pr-loop/gh-payloads.md +3 -3
- package/_shared/pr-loop/post-audit-thread-contract.md +51 -0
- package/_shared/pr-loop/scripts/README.md +2 -2
- package/_shared/pr-loop/scripts/fix_hookspath.py +47 -12
- package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +0 -69
- package/_shared/pr-loop/scripts/tests/test_fix_hookspath.py +497 -374
- package/_shared/pr-loop/state-schema.md +3 -22
- package/bin/CLAUDE.md +11 -2
- package/bin/ever-shipped-skills.mjs +70 -0
- package/bin/install.mjs +138 -13
- package/bin/install.prune.test.mjs +457 -0
- package/bin/install.test.mjs +10 -4
- package/docs/CODE_RULES.md +1 -1
- package/hooks/blocking/CLAUDE.md +2 -0
- package/hooks/blocking/code_rules_enforcer.py +4 -0
- package/hooks/blocking/code_rules_shared.py +82 -0
- package/hooks/blocking/code_rules_test_layout.py +9 -3
- package/hooks/blocking/pii_commit_command.py +398 -0
- package/hooks/blocking/pii_payload_scan.py +133 -0
- package/hooks/blocking/pii_prevention_blocker.py +151 -449
- package/hooks/blocking/plain_language_blocker.py +138 -4
- package/hooks/blocking/sensitive_file_protector.py +114 -48
- package/hooks/blocking/tdd_enforcer.py +9 -2
- package/hooks/blocking/test_code_rules_enforcer_scratchpad.py +105 -0
- package/hooks/blocking/test_code_rules_shared.py +181 -0
- package/hooks/blocking/test_pii_prevention_blocker.py +299 -0
- package/hooks/blocking/test_plain_language_blocker_allowlist.py +184 -0
- package/hooks/blocking/test_sensitive_file_protector.py +185 -0
- package/hooks/blocking/test_tdd_enforcer_scratchpad.py +105 -0
- package/hooks/blocking/test_verdict_directory_write_blocker.py +42 -7
- package/hooks/hooks_constants/CLAUDE.md +4 -2
- package/hooks/hooks_constants/code_rules_path_utils_constants.py +0 -2
- package/hooks/hooks_constants/harness_scratchpad_constants.py +17 -0
- package/hooks/hooks_constants/local_identity.py +65 -15
- package/hooks/hooks_constants/pii_prevention_constants.py +16 -0
- package/hooks/hooks_constants/plain_language_blocker_constants.py +5 -0
- package/hooks/hooks_constants/pr_description_enforcer_constants.py +1 -1
- package/hooks/hooks_constants/sensitive_file_protector_constants.py +42 -0
- package/hooks/hooks_constants/test_local_identity.py +68 -0
- package/hooks/pyproject.toml +75 -4
- package/hooks/validators/CLAUDE.md +1 -1
- package/hooks/validators/README.md +2 -0
- package/hooks/validators/python_style_checks.py +114 -136
- package/hooks/validators/python_style_helpers.py +95 -0
- package/hooks/validators/test_python_style_checks.py +0 -164
- package/hooks/validators/test_python_style_checks_decorator_gap.py +119 -0
- package/hooks/validators/test_python_style_fixes.py +251 -0
- package/hooks/validators/test_python_style_helpers.py +125 -0
- package/package.json +1 -1
- package/rules/CLAUDE.md +1 -0
- package/rules/anti-corollary-tests.md +69 -0
- package/rules/bdd.md +1 -3
- package/rules/code-reviews.md +1 -1
- package/rules/gh-paginate.md +1 -1
- package/rules/plain-language.md +2 -0
- package/scripts/CLAUDE.md +10 -1
- package/scripts/Get-SessionAccount.ps1 +210 -0
- package/scripts/tests/CLAUDE.md +15 -1
- package/scripts/tests/Get-SessionAccount.Tests.ps1 +350 -0
- package/skills/CLAUDE.md +6 -27
- package/skills/anthropic-plan/SKILL.md +1 -13
- package/skills/autoconverge/CLAUDE.md +5 -2
- package/skills/autoconverge/SKILL.md +112 -387
- package/skills/autoconverge/reference/CLAUDE.md +4 -1
- package/skills/autoconverge/reference/closing-report.md +9 -2
- package/skills/autoconverge/reference/convergence.md +26 -22
- package/skills/autoconverge/reference/headless-safety.md +44 -0
- package/skills/autoconverge/reference/multi-pr.md +88 -0
- package/skills/autoconverge/reference/self-closing-loop.md +84 -0
- package/skills/autoconverge/reference/stop-conditions.md +21 -13
- package/skills/autoconverge/workflow/converge.clean-audit.test.mjs +87 -27
- package/skills/autoconverge/workflow/converge.contract.test.mjs +40 -10
- package/skills/autoconverge/workflow/converge.copilot-gate.test.mjs +179 -47
- package/skills/autoconverge/workflow/converge.fix-progress.test.mjs +1 -1
- package/skills/autoconverge/workflow/converge.mjs +286 -96
- package/skills/bugteam/CLAUDE.md +1 -1
- package/skills/bugteam/CONSTRAINTS.md +3 -3
- package/skills/bugteam/PROMPTS.md +8 -19
- package/skills/bugteam/SKILL.md +13 -14
- package/skills/bugteam/reference/CLAUDE.md +1 -1
- package/skills/bugteam/reference/README.md +2 -3
- package/skills/bugteam/reference/audit-and-teammates.md +2 -2
- package/skills/bugteam/reference/copilot-gap-analysis.md +2 -0
- package/skills/bugteam/reference/github-pr-reviews.md +56 -38
- package/skills/bugteam/reference/team-setup.md +11 -11
- package/skills/bugteam/scripts/CLAUDE.md +6 -6
- package/skills/bugteam/scripts/README.md +20 -8
- package/skills/bugteam/scripts/bugteam_code_rules_gate.py +13 -1463
- package/skills/bugteam/scripts/bugteam_fix_hookspath.py +23 -358
- package/skills/bugteam/scripts/bugteam_preflight.py +13 -315
- package/skills/bugteam/scripts/bugteam_scripts_constants/CLAUDE.md +2 -3
- package/skills/bugteam/scripts/test_bugteam_code_rules_gate.py +34 -1053
- package/skills/bugteam/scripts/test_bugteam_fix_hookspath.py +30 -347
- package/skills/bugteam/scripts/test_bugteam_preflight.py +30 -305
- package/skills/closeout/SKILL.md +153 -0
- package/skills/closeout/reference/handoff-prompt-template.md +72 -0
- package/skills/closeout/reference/issue-body-templates.md +108 -0
- package/skills/closeout/reference/pii-redaction-checklist.md +36 -0
- package/skills/copilot-finding-triage/SKILL.md +80 -28
- package/skills/copilot-finding-triage/reference/tier-rubric.md +70 -11
- package/skills/copilot-finding-triage/templates/notification.md +8 -3
- package/skills/everything-search/SKILL.md +1 -2
- package/skills/grokify/SKILL.md +58 -0
- package/skills/grokify/templates/handoff-template.md +92 -0
- package/skills/orchestrator/SKILL.md +35 -25
- package/skills/orchestrator-refresh/SKILL.md +15 -11
- package/skills/pr-converge/CLAUDE.md +1 -1
- package/skills/pr-converge/SKILL.md +132 -233
- package/skills/pr-converge/reference/convergence-gates.md +102 -66
- package/skills/pr-converge/reference/examples.md +37 -25
- package/skills/pr-converge/reference/fix-protocol.md +7 -7
- package/skills/pr-converge/reference/multi-pr-orchestration.md +10 -4
- package/skills/pr-converge/reference/per-tick.md +64 -41
- package/skills/pr-converge/reference/state-schema.md +27 -2
- package/skills/pr-converge/scripts/CLAUDE.md +8 -0
- package/skills/pr-converge/scripts/README.md +4 -3
- package/skills/pr-converge/scripts/_pr_converge_path_setup.py +23 -0
- package/skills/pr-converge/scripts/check_convergence.py +189 -645
- package/skills/pr-converge/scripts/check_convergence_gates.py +235 -0
- package/skills/pr-converge/scripts/check_convergence_thread_gates.py +219 -0
- package/skills/pr-converge/scripts/conftest.py +8 -0
- package/skills/pr-converge/scripts/pr_converge_scripts_constants/CLAUDE.md +1 -0
- package/skills/pr-converge/scripts/pr_converge_scripts_constants/convergence_gate_constants.py +36 -0
- package/skills/pr-converge/scripts/test__pr_converge_path_setup.py +26 -0
- package/skills/pr-converge/scripts/test_check_convergence.py +73 -228
- package/skills/pr-converge/scripts/test_check_convergence_contract.py +321 -0
- package/skills/pr-converge/scripts/test_check_convergence_gates.py +68 -0
- package/skills/pr-converge/scripts/test_check_convergence_thread_gates.py +75 -0
- package/skills/pr-fix-protocol/SKILL.md +20 -20
- package/skills/privacy-hygiene/SKILL.md +4 -3
- package/skills/reviewer-gates/SKILL.md +26 -8
- package/skills/session-log/SKILL.md +11 -12
- package/skills/session-tidy/SKILL.md +40 -30
- package/skills/skill-builder/CLAUDE.md +13 -10
- package/skills/skill-builder/SKILL.md +31 -31
- package/skills/skill-builder/references/CLAUDE.md +10 -6
- package/skills/skill-builder/references/delegation-map.md +13 -4
- package/skills/skill-builder/references/description-field.md +113 -0
- package/skills/skill-builder/references/self-audit-checklist.md +21 -4
- package/skills/skill-builder/references/skill-modularity.md +113 -0
- package/skills/skill-builder/references/skill-types.md +4 -0
- package/skills/skill-builder/templates/CLAUDE.md +4 -4
- package/skills/skill-builder/templates/gap-analysis.md +25 -1
- package/skills/skill-builder/workflows/CLAUDE.md +6 -4
- package/skills/skill-builder/workflows/improve-skill.md +17 -16
- package/skills/skill-builder/workflows/new-skill.md +34 -10
- package/skills/skill-builder/workflows/polish-skill.md +59 -43
- package/skills/team-advisor/SKILL.md +15 -11
- package/skills/usage-pause/SKILL.md +10 -14
- package/system-prompts/software-engineer.xml +7 -6
- package/hooks/validators/test_verify_paths.py +0 -32
- package/hooks/validators/verify_paths.py +0 -57
- package/skills/bdd-protocol/CLAUDE.md +0 -26
- package/skills/bdd-protocol/SKILL.md +0 -30
- package/skills/bdd-protocol/references/CLAUDE.md +0 -10
- package/skills/bdd-protocol/references/anti-patterns.md +0 -26
- package/skills/bdd-protocol/references/example-mapping.md +0 -23
- package/skills/bg-agent/CLAUDE.md +0 -17
- package/skills/bg-agent/SKILL.md +0 -69
- package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_code_rules_gate_constants.py +0 -55
- package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_fix_hookspath_constants.py +0 -26
- package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_preflight_constants.py +0 -35
- package/skills/caveman/CLAUDE.md +0 -15
- package/skills/caveman/SKILL.md +0 -38
- package/skills/code/CLAUDE.md +0 -17
- package/skills/code/SKILL.md +0 -178
- package/skills/deep-research/CLAUDE.md +0 -17
- package/skills/deep-research/SKILL.md +0 -80
- package/skills/findbugs/CLAUDE.md +0 -20
- package/skills/findbugs/SKILL.md +0 -241
- package/skills/fixbugs/CLAUDE.md +0 -19
- package/skills/fixbugs/SKILL.md +0 -142
- package/skills/gh-paginate/CLAUDE.md +0 -18
- package/skills/gh-paginate/SKILL.md +0 -84
- package/skills/gotcha/CLAUDE.md +0 -33
- package/skills/gotcha/SKILL.md +0 -73
- package/skills/implement/CLAUDE.md +0 -27
- package/skills/implement/SKILL.md +0 -66
- package/skills/implement/scripts/CLAUDE.md +0 -22
- package/skills/implement/scripts/append_note.py +0 -133
- package/skills/implement/scripts/implement_scripts_constants/CLAUDE.md +0 -22
- package/skills/implement/scripts/implement_scripts_constants/__init__.py +0 -0
- package/skills/implement/scripts/implement_scripts_constants/notes_constants.py +0 -12
- package/skills/implement/scripts/test_append_note.py +0 -191
- package/skills/log-audit/CLAUDE.md +0 -20
- package/skills/log-audit/SKILL.md +0 -66
- package/skills/log-audit/reference/CLAUDE.md +0 -9
- package/skills/log-audit/reference/charter.md +0 -52
- package/skills/log-audit/scripts/CLAUDE.md +0 -27
- package/skills/log-audit/scripts/cluster_recurrences.py +0 -261
- package/skills/log-audit/scripts/collect_log_window.py +0 -199
- package/skills/log-audit/scripts/log_audit_constants/CLAUDE.md +0 -12
- package/skills/log-audit/scripts/log_audit_constants/__init__.py +0 -0
- package/skills/log-audit/scripts/log_audit_constants/cluster_recurrences_constants.py +0 -23
- package/skills/log-audit/scripts/log_audit_constants/collect_log_window_constants.py +0 -24
- package/skills/log-audit/scripts/log_audit_constants/mine_copilot_findings_constants.py +0 -49
- package/skills/log-audit/scripts/mine_copilot_findings.py +0 -302
- package/skills/log-audit/scripts/test_cluster_recurrences.py +0 -160
- package/skills/log-audit/scripts/test_collect_log_window.py +0 -111
- package/skills/log-audit/scripts/test_mine_copilot_findings.py +0 -126
- package/skills/logifix/CLAUDE.md +0 -36
- package/skills/logifix/SKILL.md +0 -69
- package/skills/logifix/scripts/CLAUDE.md +0 -16
- package/skills/logifix/scripts/logifix.ps1 +0 -205
- package/skills/monitor-open-prs/CLAUDE.md +0 -34
- package/skills/monitor-open-prs/SKILL.md +0 -88
- package/skills/monitor-open-prs/scripts/CLAUDE.md +0 -17
- package/skills/monitor-open-prs/scripts/discover_open_prs.py +0 -69
- package/skills/monitor-open-prs/scripts/test_discover_open_prs.py +0 -149
- package/skills/monitor-open-prs/test_skill_contract.py +0 -27
- package/skills/post-audit-findings/SKILL.md +0 -80
- package/skills/pr-consistency-audit/CLAUDE.md +0 -34
- package/skills/pr-consistency-audit/SKILL.md +0 -116
- package/skills/pr-consistency-audit/reference/CLAUDE.md +0 -16
- package/skills/pr-consistency-audit/reference/detection-rules.md +0 -96
- package/skills/pr-consistency-audit/reference/illustrations.md +0 -78
- package/skills/pr-review-responder/CLAUDE.md +0 -35
- package/skills/pr-review-responder/EXAMPLES.md +0 -590
- package/skills/pr-review-responder/PRINCIPLES.md +0 -533
- package/skills/pr-review-responder/README.md +0 -168
- package/skills/pr-review-responder/SKILL.md +0 -203
- package/skills/pr-review-responder/TESTING.md +0 -350
- package/skills/pr-scope-resolve/SKILL.md +0 -45
- package/skills/pre-compact/CLAUDE.md +0 -24
- package/skills/pre-compact/SKILL.md +0 -134
- package/skills/qbug/CLAUDE.md +0 -40
- package/skills/qbug/SKILL.md +0 -387
- package/skills/qbug/test_qbug_skill_audit_schema.py +0 -152
- package/skills/qbug/test_qbug_skill_post_fix_audit.py +0 -103
- package/skills/refine/CLAUDE.md +0 -44
- package/skills/refine/SKILL.md +0 -262
- package/skills/refine/templates/CLAUDE.md +0 -17
- package/skills/refine/templates/implementation-notes-template.html +0 -56
- package/skills/refine/templates/plan-template.md +0 -60
- package/skills/research-mode/CLAUDE.md +0 -35
- package/skills/research-mode/SKILL.md +0 -53
- package/skills/structure-prompt/CLAUDE.md +0 -42
- package/skills/structure-prompt/SKILL.md +0 -44
- package/skills/structure-prompt/reference/CLAUDE.md +0 -28
- package/skills/structure-prompt/reference/adversarial-tuning.md +0 -62
- package/skills/structure-prompt/reference/block-classification.md +0 -27
- package/skills/structure-prompt/reference/canonical-case.md +0 -48
- package/skills/structure-prompt/reference/citation-depth.md +0 -70
- package/skills/structure-prompt/reference/cleanup.md +0 -33
- package/skills/structure-prompt/reference/constraints.md +0 -33
- package/skills/structure-prompt/reference/directives.md +0 -37
- package/skills/structure-prompt/reference/examples.md +0 -72
- package/skills/structure-prompt/reference/instantiation.md +0 -51
- package/skills/structure-prompt/reference/output-contract.md +0 -72
- package/skills/structure-prompt/reference/per-category.md +0 -23
- package/skills/structure-prompt/reference/persona.md +0 -38
- package/skills/structure-prompt/reference/research.md +0 -33
- package/skills/structure-prompt/reference/structure.md +0 -28
- package/skills/verified-build/CLAUDE.md +0 -33
- package/skills/verified-build/SKILL.md +0 -33
package/skills/code/SKILL.md
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: code
|
|
3
|
-
description: >-
|
|
4
|
-
Prepends strict code standards to every implementation session. Enforces
|
|
5
|
-
strong typing, no Any, no casts, no type: ignore, treated-as-immutable
|
|
6
|
-
TypedDicts, 100% test coverage, DRY, no mocks, no stubs, no fallbacks, and
|
|
7
|
-
proper module structure. Triggers: /code, code standards, strict code, enforce
|
|
8
|
-
standards, implement with standards.
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Code Standards Enforcer
|
|
12
|
-
|
|
13
|
-
Prepends these standards to every implementation session. Every criterion is binary — pass or fail. No partial credit.
|
|
14
|
-
|
|
15
|
-
## When this applies
|
|
16
|
-
|
|
17
|
-
Invoke at the start of any implementation task. The standards persist for the entire session.
|
|
18
|
-
|
|
19
|
-
**Refusal cases — first match wins:**
|
|
20
|
-
|
|
21
|
-
- **Not an implementation task.** "This skill applies to code implementation. Ask me to implement something specific."
|
|
22
|
-
- **Exploratory research or planning.** "Code standards are for implementation. Use /anthropic-plan for planning, then invoke /code when implementing."
|
|
23
|
-
|
|
24
|
-
## Gotchas
|
|
25
|
-
|
|
26
|
-
- **`make check` must run from pwsh, not bash.** The Bash tool routes through Git Bash on Windows, where `make` may not be on PATH. Always use `pwsh -NoProfile -Command 'make check 2>&1 | Select-Object -Last 100; exit $LASTEXITCODE'` so the pipeline does not mask a non-zero exit code from make.
|
|
27
|
-
- **`New-Item`, `Get-ChildItem`, `Remove-Item` are pwsh cmdlets.** Don't use them inside Bash tool calls. Use the PowerShell tool or prefix with `pwsh -NoProfile -Command`.
|
|
28
|
-
- **`TypedDict` encode/decode must be manual.** Pydantic and similar frameworks bypass the strict validation pattern. Write `_encode_*` and `_decode_*` functions by hand.
|
|
29
|
-
- **`_test_hooks.py` is per-module, not per-package.** Every module that has dependencies needs its own hooks file. A single `conftest.py` with mocks does not satisfy this rule.
|
|
30
|
-
- **Protocol must match the real API exactly.** If the real class has `async def fetch(self, key: str) -> bytes`, the Protocol must declare the same signature. A mismatch is caught at type-check time by mypy strict mode.
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Completion criteria
|
|
35
|
-
|
|
36
|
-
Every criterion below must be met before the change is complete.
|
|
37
|
-
|
|
38
|
-
### 1. Typing strictness
|
|
39
|
-
|
|
40
|
-
Zero violations across the project's source, test, and script directories (adapt `src/`, `tests/`, `scripts/` to the project's actual layout):
|
|
41
|
-
|
|
42
|
-
- No `Any`, `cast()`, `# type: ignore`, `# noqa`.
|
|
43
|
-
- No `.pyi` files, stubs, or shims.
|
|
44
|
-
- Mypy strict mode exits 0 with no errors.
|
|
45
|
-
- All TypedDicts are treated as immutable after construction and carry explicit `_encode_*` / `_decode_*` functions.
|
|
46
|
-
- All decode functions call `require_*` validation on every field.
|
|
47
|
-
- Internal encoder is typed — no untyped dict intermediaries.
|
|
48
|
-
|
|
49
|
-
### 2. Error handling
|
|
50
|
-
|
|
51
|
-
- No `try`/`except` in core logic that recovers, softens, or best-efforts a failure.
|
|
52
|
-
- Failures propagate. Callers decide whether to handle.
|
|
53
|
-
- APIs signal failure points through naming, docstrings, and test expectations — not by catching.
|
|
54
|
-
|
|
55
|
-
### 3. Test coverage
|
|
56
|
-
|
|
57
|
-
- Test runner exits 0 with full statement and branch coverage (e.g. `pytest -n auto --cov --cov-branch --cov-report=term-missing` with paths adapted to the project layout) (requires pytest-xdist and pytest-cov).
|
|
58
|
-
- Statement coverage: 100%. Branch coverage: 100%.
|
|
59
|
-
- Zero mocks. Every test exercises actual code paths through fakes injected via DI hooks (see criterion 4).
|
|
60
|
-
- Zero weak assertions. Every assert checks a specific, falsifiable property.
|
|
61
|
-
- Zero fake tests (tests that pass without validating behavior).
|
|
62
|
-
|
|
63
|
-
### 4. Dependency injection
|
|
64
|
-
|
|
65
|
-
- Every module that has external dependencies provides a `_test_hooks.py` with internal DI hooks (underscore = private). The hook file lives alongside the module it services.
|
|
66
|
-
- A shared testing utility module exports public test helpers for consumers (adapt the path to the project's conventions, e.g. `Libs/testing.py`).
|
|
67
|
-
- Production code sets hooks to real implementations at startup. Tests set them to fakes.
|
|
68
|
-
- No `if`/`else` branching on test vs. production — call the hook directly.
|
|
69
|
-
|
|
70
|
-
### 5. Codebase standards
|
|
71
|
-
|
|
72
|
-
- DRY: zero duplicate function bodies longer than 3 lines. Zero duplicate constant definitions.
|
|
73
|
-
- No placeholder code, no dead code, no commented-out blocks.
|
|
74
|
-
- No fallback paths, no back-compat shims, no legacy code.
|
|
75
|
-
- No `TypeAlias`, no `TYPE_CHECKING` import guards.
|
|
76
|
-
|
|
77
|
-
### 6. TypedDict protocol
|
|
78
|
-
|
|
79
|
-
- Every TypedDict has a paired `_encode_*` and `_decode_*` function.
|
|
80
|
-
- Every decode calls `require_*` (non-null, type-check, range-check) on every field before returning.
|
|
81
|
-
- Decode functions are the single point where untyped data becomes typed.
|
|
82
|
-
|
|
83
|
-
### 7. Redis boundary
|
|
84
|
-
|
|
85
|
-
- Use module-level helper functions or a Protocol.
|
|
86
|
-
- Never reference `Redis[Any]` in type annotations.
|
|
87
|
-
|
|
88
|
-
### 8. TOML boundary
|
|
89
|
-
|
|
90
|
-
- No `TYPE_CHECKING` guard for TOML types.
|
|
91
|
-
- Parse untyped dicts from TOML, then convert into TypedDict (no dataclasses) before use.
|
|
92
|
-
|
|
93
|
-
### 9. JSON recursive types
|
|
94
|
-
|
|
95
|
-
- Bypass framework validation (e.g., Pydantic).
|
|
96
|
-
- Parse with `json.loads()`, validate immediately with internal `_decode_*` / `_load_json_*` functions before any other use.
|
|
97
|
-
|
|
98
|
-
### 10. ASGI / framework boundaries
|
|
99
|
-
|
|
100
|
-
- Define a Protocol for the minimal interface (e.g., `async def body() -> bytes`).
|
|
101
|
-
- Never use `dict[str, Any]` in ASGI scopes.
|
|
102
|
-
- Parse at the edge, validate immediately, propagate as strict types.
|
|
103
|
-
|
|
104
|
-
### 11. Dynamic import pattern
|
|
105
|
-
|
|
106
|
-
When using `importlib.import_module()` + `getattr()`, the intermediate variables are untyped. Bind the final instance through a typed wrapper so the result carries a concrete type rather than `Any`:
|
|
107
|
-
|
|
108
|
-
```python
|
|
109
|
-
import importlib
|
|
110
|
-
from collections.abc import Callable
|
|
111
|
-
|
|
112
|
-
mod = importlib.import_module("module_name")
|
|
113
|
-
cls = getattr(mod, "ClassName")
|
|
114
|
-
|
|
115
|
-
def _construct(klass: Callable[..., TheProtocol]) -> TheProtocol:
|
|
116
|
-
return klass()
|
|
117
|
-
|
|
118
|
-
instance = _construct(cls)
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### 12. Documentation
|
|
122
|
-
|
|
123
|
-
Google-style docstrings on every public function, method, and class:
|
|
124
|
-
|
|
125
|
-
```python
|
|
126
|
-
def load_config(config_path: str) -> AppConfig:
|
|
127
|
-
"""Load and validate the application configuration from disk.
|
|
128
|
-
|
|
129
|
-
Args:
|
|
130
|
-
config_path: Absolute path to the TOML configuration file.
|
|
131
|
-
|
|
132
|
-
Returns:
|
|
133
|
-
A fully validated AppConfig TypedDict.
|
|
134
|
-
|
|
135
|
-
Raises:
|
|
136
|
-
FileNotFoundError: If config_path does not exist.
|
|
137
|
-
ValidationError: If the parsed config fails require_* checks.
|
|
138
|
-
"""
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
For a public function whose behavior needs a picture, lead the narrative with a diagram: one summary line, then a `::` literal block or a doctest showing a concrete input and its marked outcome, then a couple of short prose lines, then the `Args:` / `Returns:` sections. See `../../rules/plain-illustrative-docstrings.md` for the shape and a worked example.
|
|
142
|
-
|
|
143
|
-
### 13. Build infrastructure
|
|
144
|
-
|
|
145
|
-
The project under development must contain:
|
|
146
|
-
|
|
147
|
-
- `Makefile` with targets: `check`, `lint`, `test`, `coverage`.
|
|
148
|
-
- `pyproject.toml` with `[tool.mypy]` strict mode, `[tool.pytest.ini_options]` with `addopts = -n auto` (requires pytest-xdist).
|
|
149
|
-
- A lint guard script that covers the project's source, test, and script directories.
|
|
150
|
-
|
|
151
|
-
### 14. Lint gates
|
|
152
|
-
|
|
153
|
-
- `make lint` runs mypy (strict), ruff, and the project's guard script.
|
|
154
|
-
- All linters cover the project's source, test, and script directories.
|
|
155
|
-
- `make lint` exits 0 before `make test` is valid.
|
|
156
|
-
|
|
157
|
-
### 15. Protocol signature match
|
|
158
|
-
|
|
159
|
-
- Every Protocol's method signatures match the real API they abstract.
|
|
160
|
-
- If the real API changes, the Protocol fails type-checking — no silent drift.
|
|
161
|
-
|
|
162
|
-
### 16. Auth, credentials, multi-tenancy
|
|
163
|
-
|
|
164
|
-
- Auth and credential handling is explicit, typed, and testable.
|
|
165
|
-
- Multi-tenant DB access uses typed connection factories, not string-formatted queries.
|
|
166
|
-
- MCP-shared resources follow the same strictness as application code.
|
|
167
|
-
|
|
168
|
-
---
|
|
169
|
-
|
|
170
|
-
## Verification
|
|
171
|
-
|
|
172
|
-
Each criterion returns either **at least one finding** OR **exactly one proof-of-absence** with at least 3 adversarial probes specific to that criterion. A criterion returning neither is a protocol gap.
|
|
173
|
-
|
|
174
|
-
## File index
|
|
175
|
-
|
|
176
|
-
| File | Purpose |
|
|
177
|
-
|------|---------|
|
|
178
|
-
| `SKILL.md` | Hub — binary criteria, gotchas, when-to-apply, verification protocol |
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# deep-research
|
|
2
|
-
|
|
3
|
-
Runs an iterative multi-source research pipeline that produces a comprehensive Obsidian report with citations. Triggered by `/deep-research [topic]`.
|
|
4
|
-
|
|
5
|
-
## Purpose
|
|
6
|
-
|
|
7
|
-
The skill operates in two phases. Phase 1 (main thread) turns the raw topic into a precise research brief through a short AskUserQuestion session covering audience, scope, recency, and depth. Phase 2 delegates to the `deep-research` agent with the confirmed brief and an iteration budget (8 / 15 / 25 based on depth preference). The agent handles iteration, state tracking, and Obsidian output.
|
|
8
|
-
|
|
9
|
-
## Key file
|
|
10
|
-
|
|
11
|
-
| File | Purpose |
|
|
12
|
-
|---|---|
|
|
13
|
-
| `SKILL.md` | Phase 1 steps (classify, ask, construct `<research_brief>` XML, set iteration budget) and Phase 2 spawn instructions, including `mode: bypassPermissions` for unrestricted web access. |
|
|
14
|
-
|
|
15
|
-
## Post-run cleanup
|
|
16
|
-
|
|
17
|
-
After the agent returns, the skill summarizes the Obsidian path, source counts, and any gaps, then deletes the `.deep-research-state.md` temp file.
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: deep-research
|
|
3
|
-
description: "Deep Research mode — iterative multi-source research producing comprehensive Obsidian reports with citations. Official-docs-first methodology. Triggers: '/deep-research [topic]'"
|
|
4
|
-
argument-hint: "TOPIC or RESEARCH QUESTION"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Deep Research
|
|
8
|
-
|
|
9
|
-
You orchestrate a two-phase deep research pipeline. Phase 1 happens here (main thread). Phase 2 is delegated to the `deep-research` agent.
|
|
10
|
-
|
|
11
|
-
## Phase 1: Build the Research Prompt (Interactive Q&A)
|
|
12
|
-
|
|
13
|
-
The user's raw topic is: `$ARGUMENTS`
|
|
14
|
-
|
|
15
|
-
Your job is to turn this raw topic into a precise, well-scoped research brief using prompt-generator methodology. Follow these steps:
|
|
16
|
-
|
|
17
|
-
### Step 1: Classify and assess
|
|
18
|
-
|
|
19
|
-
Silently determine:
|
|
20
|
-
- **Complexity**: Is this a narrow factual question or a broad landscape survey?
|
|
21
|
-
- **Ambiguity**: Can you research this as-is, or does it need scoping?
|
|
22
|
-
- **Official docs**: Does this topic have official vendor/creator documentation? If yes, that is the primary source and must be consulted first.
|
|
23
|
-
|
|
24
|
-
### Step 2: Ask clarifying questions
|
|
25
|
-
|
|
26
|
-
Use AskUserQuestion to ask 1-3 questions. Choose from these dimensions based on what's genuinely unclear — skip any that are obvious from context:
|
|
27
|
-
|
|
28
|
-
- **Audience**: "Who is this research for?" (options: technical deep-dive, executive summary, personal learning, decision support)
|
|
29
|
-
- **Scope**: "Should I focus on a specific angle or survey the full landscape?" (options: specific angle with description field, broad survey, compare specific alternatives)
|
|
30
|
-
- **Recency**: "How important is recency?" (options: last 6 months only, last 1-2 years, historical overview, doesn't matter)
|
|
31
|
-
- **Depth**: "How deep should this go?" (options: quick overview 5-10 sources, standard 15-20 sources, exhaustive 25+ sources)
|
|
32
|
-
|
|
33
|
-
Skip clarification entirely only if the topic is already narrow, unambiguous, and the audience is obvious.
|
|
34
|
-
|
|
35
|
-
### Step 3: Construct the research brief
|
|
36
|
-
|
|
37
|
-
From the user's answers, write a structured research brief:
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
<research_brief>
|
|
41
|
-
<topic>The original topic, cleaned up</topic>
|
|
42
|
-
<official_docs>Known official documentation sources, or "none identified" if the topic lacks vendor docs</official_docs>
|
|
43
|
-
<scope>Exactly what to research — boundaries, inclusions, exclusions</scope>
|
|
44
|
-
<audience>Who this is for and what they need</audience>
|
|
45
|
-
<depth>Target source count and iteration budget</depth>
|
|
46
|
-
<output>What the final deliverable looks like</output>
|
|
47
|
-
<key_questions>
|
|
48
|
-
1. Specific question the research must answer
|
|
49
|
-
2. Another specific question
|
|
50
|
-
3. ...
|
|
51
|
-
</key_questions>
|
|
52
|
-
</research_brief>
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Show the brief to the user. Ask: "Does this capture what you need, or should I adjust the scope?"
|
|
56
|
-
|
|
57
|
-
### Step 4: Set iteration budget
|
|
58
|
-
|
|
59
|
-
Map the user's depth preference to iteration count:
|
|
60
|
-
- Quick overview: 8 iterations
|
|
61
|
-
- Standard (default): 15 iterations
|
|
62
|
-
- Exhaustive: 25 iterations
|
|
63
|
-
|
|
64
|
-
## Phase 2: Launch the Research Agent
|
|
65
|
-
|
|
66
|
-
Once the brief is confirmed, spawn the `deep-research` agent using the Agent tool with:
|
|
67
|
-
|
|
68
|
-
- **subagent_type**: `deep-research`
|
|
69
|
-
- **prompt**: The full `<research_brief>` XML block from Step 3, plus the iteration budget
|
|
70
|
-
- **mode**: `bypassPermissions` (research agent needs unrestricted tool access for web searches)
|
|
71
|
-
- **description**: "Deep research: [short topic summary]"
|
|
72
|
-
|
|
73
|
-
The agent handles everything from here: iteration, state tracking, and Obsidian output.
|
|
74
|
-
|
|
75
|
-
When the agent returns, summarize:
|
|
76
|
-
1. Where the report was saved (Obsidian path)
|
|
77
|
-
2. How many sources were consulted (official vs secondary)
|
|
78
|
-
3. Any gaps or limitations noted
|
|
79
|
-
|
|
80
|
-
Then clean up temporary files: `.deep-research-state.md`
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# findbugs
|
|
2
|
-
|
|
3
|
-
Audits the current branch's pull request for bugs by spawning the `code-quality-agent` against the full PR diff in a clean room. Triggered by `/findbugs`, `find bugs in this PR`, `audit the PR`, or `bug audit on the branch`.
|
|
4
|
-
|
|
5
|
-
## Purpose
|
|
6
|
-
|
|
7
|
-
Read-only. The skill resolves PR scope via the `pr-scope-resolve` skill, writes the diff to a scoped temp file, and spawns two `code-quality-agent` instances (primary sonnet + secondary haiku) with a self-contained, context-free prompt covering all A–P audit categories. After both return it merges findings (de-dup, max-wins severity), posts one audit review to the PR via the `post-audit-findings` skill (APPROVE on clean, REQUEST_CHANGES with inline anchored comments on dirty), and reports totals and cleared categories to the user.
|
|
8
|
-
|
|
9
|
-
## Key file
|
|
10
|
-
|
|
11
|
-
| File | Purpose |
|
|
12
|
-
|---|---|
|
|
13
|
-
| `SKILL.md` | Five-step process: resolve scope (`pr-scope-resolve` skill), capture diff to a scoped temp path, spawn agents (clean-room prompt XML), post audit review (`post-audit-findings` skill), surface findings and offer `/fixbugs`. Includes refusals and the output format. |
|
|
14
|
-
|
|
15
|
-
## Constraints
|
|
16
|
-
|
|
17
|
-
- Never edits files, never commits, never pushes.
|
|
18
|
-
- One audit review per invocation is posted back to the PR — required so the unresolved-thread gate sees the audit pass.
|
|
19
|
-
- Disabled by `CLAUDE_REVIEWS_DISABLED=bugteam` (shared token across the audit-skill family).
|
|
20
|
-
- Always ask before running `/fixbugs`; never auto-spawn the fixer.
|
package/skills/findbugs/SKILL.md
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: findbugs
|
|
3
|
-
description: >-
|
|
4
|
-
Audits the current branch's pull request as a whole for bugs by spawning the
|
|
5
|
-
code-quality-agent against the full PR diff with zero conversation context.
|
|
6
|
-
Returns P0/P1/P2 findings with file:line evidence and a verified-clean
|
|
7
|
-
coverage list. Read-only — never modifies code. Triggers: '/findbugs',
|
|
8
|
-
'find bugs in this PR', 'audit the PR', 'bug audit on the branch'.
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Findbugs
|
|
12
|
-
|
|
13
|
-
**Core principle:** A clean-room bug audit on the entire pull request. The audit agent receives the PR diff and nothing else — no chat history, no prior framing, no implicit "we already looked at this." Independence is the point.
|
|
14
|
-
|
|
15
|
-
## Transport check (before any GitHub step)
|
|
16
|
-
|
|
17
|
-
Run `command -v gh`; when it succeeds, run `gh auth status`; once the PR scope is resolved, run `gh api repos/<owner>/<repo> --jq .permissions.push` and take `true` as the pass. When any check fails, run the `pr-loop-cloud-transport` skill first and route every `gh` operation in this skill through its substitution matrix.
|
|
18
|
-
|
|
19
|
-
## When this skill applies
|
|
20
|
-
|
|
21
|
-
User types `/findbugs` or asks for a bug audit on the current branch's PR. Typical moment: PR is up (draft or ready), and the user wants an independent second pair of eyes before merge or before requesting human review.
|
|
22
|
-
|
|
23
|
-
If the current branch has no associated PR and no diff against the default branch, say so and stop. Do not invent scope.
|
|
24
|
-
|
|
25
|
-
## Refusals
|
|
26
|
-
|
|
27
|
-
First match wins; respond with the quoted line exactly and stop:
|
|
28
|
-
|
|
29
|
-
- **Disabled via environment.** When `CLAUDE_REVIEWS_DISABLED` carries the
|
|
30
|
-
token `bugteam`:
|
|
31
|
-
`/findbugs is disabled via CLAUDE_REVIEWS_DISABLED.` Run the check via
|
|
32
|
-
`python "$HOME/.claude/_shared/pr-loop/scripts/reviews_disabled.py" --reviewer bugteam`
|
|
33
|
-
(exit 0 = disabled). `/findbugs` is a PR bug-audit skill in the same family
|
|
34
|
-
as `/bugteam` and `/qbug`, so the shared `bugteam` token disables all three.
|
|
35
|
-
The gate semantics live in the `reviewer-gates` skill (`../reviewer-gates/SKILL.md`).
|
|
36
|
-
|
|
37
|
-
## The Process
|
|
38
|
-
|
|
39
|
-
### Step 1: Resolve PR scope
|
|
40
|
-
|
|
41
|
-
Apply the `pr-scope-resolve` skill (`../pr-scope-resolve/SKILL.md`) with caller `findbugs`. Findbugs consumes the resolved `owner`, `repo`, `number`, `head_ref`, `base_ref`, and `url`; when no PR exists, the ladder's merge-base rung sets the audit scope. When no target exists, respond exactly with the sub-skill's canonical refusal line and stop:
|
|
42
|
-
|
|
43
|
-
`No PR or upstream diff. /findbugs needs a target.`
|
|
44
|
-
|
|
45
|
-
### Step 2: Capture the full PR diff
|
|
46
|
-
|
|
47
|
-
Resolve the temp diff path **once, Claude-side**, before invoking any shell command. Use Python's `tempfile.gettempdir()` which honors `TMPDIR`, `TEMP`, and `TMP` in the platform-correct order and falls back to `C:\Users\<user>\AppData\Local\Temp` on Windows or `/tmp` on Unix. Avoid hand-rolled env var chains. The lookup works on macOS, Linux, Windows cmd.exe, and PowerShell:
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
import tempfile
|
|
51
|
-
diff_temp_path = Path(tempfile.gettempdir()) / f"findbugs-pr-{os.getpid()}.patch"
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
`os.getpid()` supplies the per-invocation suffix that prevents collisions with parallel `/findbugs` runs (a UUID or timestamp is equally acceptable). Capture the resolved absolute path as `<diff_temp_path>` and pass that **literal** path to every shell command that follows. Shell-side parameter expansion (`${TMPDIR:-/tmp}`, `$$`, `%TEMP%`) is forbidden because cmd.exe and PowerShell do not honor it.
|
|
55
|
-
|
|
56
|
-
When a PR exists: call `pull_request_read(method="get_diff", pullNumber=N, owner=O, repo=R)` and save the returned diff content to `"<diff_temp_path>"`.
|
|
57
|
-
|
|
58
|
-
When falling back to merge-base diff: `git diff <merge-base>...HEAD > "<diff_temp_path>"`.
|
|
59
|
-
|
|
60
|
-
The audit's authoritative scope is this single diff file. Do not inject extra files, related history, or "files Claude edited this session" — those introduce anchoring bias.
|
|
61
|
-
|
|
62
|
-
### Step 3: Spawn the code-quality-agent — clean room
|
|
63
|
-
|
|
64
|
-
Call the Agent tool twice in a single message (primary + Haiku secondary per the audit contract's Haiku secondary section):
|
|
65
|
-
|
|
66
|
-
- Primary: `subagent_type: code-quality-agent`, `model: sonnet`, `description: "PR bug audit"`, `run_in_background: false`
|
|
67
|
-
- Secondary: `subagent_type: code-quality-agent`, `model: haiku`, `description: "PR bug audit (secondary)"`, `run_in_background: false`
|
|
68
|
-
|
|
69
|
-
After both return, merge per the contract's Haiku secondary section (de-dup key, max-wins severity, malformed-output fallback) before reporting to the user.
|
|
70
|
-
|
|
71
|
-
**The agent prompt must be self-contained and context-free.** Specifically:
|
|
72
|
-
|
|
73
|
-
- **No references to the orchestrator's conversation.** Forbidden phrases: "as we discussed," "the earlier issue," "given our prior work," "the bug from last turn," "you previously identified."
|
|
74
|
-
- **No hints about expected outcomes.** Do not pre-stage findings, do not suggest where bugs probably are, do not name files as "the suspicious one." The agent forms its own hypotheses.
|
|
75
|
-
- **No instructions to favor or skip particular categories** beyond the standard category list. No "skip the typing stuff" or "focus on the clipboard logic" — those bias the audit.
|
|
76
|
-
- **Minimal background.** Identify the repo, branch, base branch, and PR URL only. Do not summarize what the PR does.
|
|
77
|
-
|
|
78
|
-
The XML prompt skeleton:
|
|
79
|
-
|
|
80
|
-
```xml
|
|
81
|
-
<context>
|
|
82
|
-
<repo>owner/repo</repo>
|
|
83
|
-
<branch>head ref</branch>
|
|
84
|
-
<base_branch>base ref</base_branch>
|
|
85
|
-
<pr_url>url or "none"</pr_url>
|
|
86
|
-
</context>
|
|
87
|
-
|
|
88
|
-
<scope>
|
|
89
|
-
<diff_path><diff_temp_path> (absolute scoped temp path from Step 2)</diff_path>
|
|
90
|
-
<scope_rule>Audit only lines added or modified in the diff. Pre-existing code on untouched lines is out of scope.</scope_rule>
|
|
91
|
-
</scope>
|
|
92
|
-
|
|
93
|
-
<bug_categories>
|
|
94
|
-
Investigate each explicitly:
|
|
95
|
-
A. API contract verification
|
|
96
|
-
B. Selector / query / engine compatibility
|
|
97
|
-
C. Resource cleanup and lifecycle
|
|
98
|
-
D. Variable scoping, ordering, and unbound references
|
|
99
|
-
E. Dead code and unused imports
|
|
100
|
-
F. Silent failures
|
|
101
|
-
G. Off-by-one, bounds, integer overflow
|
|
102
|
-
H. Security boundaries
|
|
103
|
-
I. Concurrency hazards
|
|
104
|
-
J. CODE_RULES.md compliance
|
|
105
|
-
K. Codebase conflicts (incomplete propagation)
|
|
106
|
-
L. Behavior-equivalence for refactors
|
|
107
|
-
M. Producer/consumer cardinality vs collection-type contract
|
|
108
|
-
N. Test-name scenario verifier
|
|
109
|
-
O. Docstring / fixture-prose vs implementation drift
|
|
110
|
-
P. Name / regex / word-list vs behavior-contract precision
|
|
111
|
-
|
|
112
|
-
The category list above is a summary. The binding definition of each
|
|
113
|
-
category is its rubric file under $HOME/.claude/audit-rubrics/category_rubrics/
|
|
114
|
-
(ready-to-send prompt variants under $HOME/.claude/audit-rubrics/prompts/).
|
|
115
|
-
Read the rubric files before auditing.
|
|
116
|
-
</bug_categories>
|
|
117
|
-
|
|
118
|
-
<constraints>
|
|
119
|
-
Read-only. Report findings only. Do not modify code, do not propose
|
|
120
|
-
full diffs, do not commit, do not push. Cite file:line for every claim.
|
|
121
|
-
When the diff alone does not provide enough context to confirm or deny
|
|
122
|
-
a bug, list it under "Open questions" rather than asserting.
|
|
123
|
-
</constraints>
|
|
124
|
-
|
|
125
|
-
<output_format>
|
|
126
|
-
Follow the shared audit contract at $HOME/.claude/_shared/pr-loop/audit-contract.md:
|
|
127
|
-
|
|
128
|
-
- Severity: P0 = will not run / data corruption; P1 = regression or silent
|
|
129
|
-
failure; P2 = dead code, minor smell.
|
|
130
|
-
- Per category, produce either Shape A (structured finding) or Shape B
|
|
131
|
-
(proof-of-absence). Bare "verified clean" labels are REJECTED.
|
|
132
|
-
- Run the contract's adversarial second pass after the primary list.
|
|
133
|
-
|
|
134
|
-
Preamble: `Total: N (P0=N, P1=N, P2=N)`. Emit findings and proof-of-absence
|
|
135
|
-
entries in the JSON shapes defined by the contract. Include an "Open
|
|
136
|
-
questions" section for items the diff alone cannot resolve.
|
|
137
|
-
</output_format>
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
### Step 4: Post the audit review
|
|
141
|
-
|
|
142
|
-
Every `/findbugs` invocation posts one audit review back to the PR. The
|
|
143
|
-
unresolved-thread gate counts review threads, so a findbugs pass that
|
|
144
|
-
returns findings without posting them as inline comments is invisible
|
|
145
|
-
to the gate. Findbugs remains read-only on code — the review post is
|
|
146
|
-
the only side effect.
|
|
147
|
-
|
|
148
|
-
Capture `<head_sha>` once at the start of Step 4 via `git rev-parse
|
|
149
|
-
HEAD` in the worktree the diff was scoped against.
|
|
150
|
-
|
|
151
|
-
After the agent (and Haiku secondary) return and the merge is complete,
|
|
152
|
-
apply the `post-audit-findings` skill (`../post-audit-findings/SKILL.md`)
|
|
153
|
-
with `--skill findbugs`. That skill owns the findings-JSON mapping, the
|
|
154
|
-
anchored-only serialization (unanchored findings surface via Step 5's
|
|
155
|
-
user-facing output), the CLEAN/DIRTY decision, the self-PR reviewer
|
|
156
|
-
toggle, and the exit codes. On exit 0, surface the emitted review
|
|
157
|
-
`html_url` alongside the totals in Step 5. On exit 2, tell the user the
|
|
158
|
-
review post failed and that the unresolved-thread gate will not see this
|
|
159
|
-
audit pass; do not retry silently.
|
|
160
|
-
|
|
161
|
-
### Step 5: Surface findings, then clean up
|
|
162
|
-
|
|
163
|
-
When the agent returns, report concisely:
|
|
164
|
-
|
|
165
|
-
- One-line totals: `N P0 / N P1 / N P2 — K categories cleared`
|
|
166
|
-
- Each finding's `file:line`, category, and one-sentence description
|
|
167
|
-
- The cleared categories so the user can see coverage breadth
|
|
168
|
-
- Any open questions the agent could not resolve from the diff alone
|
|
169
|
-
|
|
170
|
-
Offer the next step without auto-executing it: `Want me to run /fixbugs for the P0/P1 findings?`
|
|
171
|
-
|
|
172
|
-
Delete the scoped temp diff at `<diff_temp_path>` after the audit completes (or moves to a fix flow). Temporary diff files do not belong in the working tree.
|
|
173
|
-
|
|
174
|
-
Do not paste the full agent transcript or the XML prompt unless the user asks.
|
|
175
|
-
|
|
176
|
-
## Output Format
|
|
177
|
-
|
|
178
|
-
```
|
|
179
|
-
N P0 / N P1 / N P2 — K categories cleared
|
|
180
|
-
|
|
181
|
-
P1 — short title
|
|
182
|
-
file/path.py:NN — one-sentence description (category: <name>)
|
|
183
|
-
|
|
184
|
-
P2 — short title
|
|
185
|
-
file/path.py:NN — one-sentence description (category: <name>)
|
|
186
|
-
|
|
187
|
-
Verified clean: <category>, <category>, <category>
|
|
188
|
-
|
|
189
|
-
Open questions:
|
|
190
|
-
<if any>
|
|
191
|
-
|
|
192
|
-
Want me to run /fixbugs for the P0/P1 findings?
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
## Constraints
|
|
196
|
-
|
|
197
|
-
- **Read-only on code.** The skill never edits files, never pushes, never commits. One audit review per invocation gets posted back to the PR (Step 4) — that is the only side effect, and it is required so the unresolved-thread gate sees the audit pass.
|
|
198
|
-
- **Foreground spawn.** The user is waiting for the result on this turn.
|
|
199
|
-
- **PR-scoped, not session-scoped.** The audit covers the entire PR diff regardless of which files were edited in this conversation.
|
|
200
|
-
- **Clean-room prompt.** The agent's prompt is self-contained — no references to chat history, no anchoring hints, no expected outcomes.
|
|
201
|
-
- **No clean-coder auto-spawn.** Always ask before fixing.
|
|
202
|
-
- **Trust the agent's verdict.** Pass through P0/P1/P2 categorizations as the agent assigned them; do not re-rank.
|
|
203
|
-
- **Temp file cleanup.** Delete the scoped `<diff_temp_path>` when the audit ends.
|
|
204
|
-
|
|
205
|
-
## Examples
|
|
206
|
-
|
|
207
|
-
<example>
|
|
208
|
-
User: `/findbugs`
|
|
209
|
-
Claude: [resolves PR #42 from current branch, fetches full diff, spawns code-quality-agent foreground with self-contained prompt, returns]
|
|
210
|
-
|
|
211
|
-
`1 P0 / 2 P1 / 0 P2 — 11 categories cleared`
|
|
212
|
-
|
|
213
|
-
`P0 — race condition on shared cache write`
|
|
214
|
-
` src/cache.py:88 — concurrent writers can both pass the existence check before either writes (category: I — Concurrency hazards)`
|
|
215
|
-
|
|
216
|
-
`P1 — silent paste failure`
|
|
217
|
-
` utils/clipboard.py:33 — validated_paste returns success without verifying the post-paste state (category: F — Silent failures)`
|
|
218
|
-
|
|
219
|
-
`P1 — unbound variable on early-exception path`
|
|
220
|
-
` src/processor.py:283 — scheduling_log referenced after try/finally where it may be unbound (category: D — Variable scoping, ordering, and unbound references)`
|
|
221
|
-
|
|
222
|
-
`Verified clean: API contract, selector compatibility, resource cleanup, dead code, off-by-one, security boundaries, CODE_RULES.md compliance, codebase conflicts, behavior-equivalence, producer/consumer cardinality, Test-name scenario verifier`
|
|
223
|
-
|
|
224
|
-
`Open questions: none`
|
|
225
|
-
|
|
226
|
-
`Want me to run /fixbugs for the P0 + P1s?`
|
|
227
|
-
</example>
|
|
228
|
-
|
|
229
|
-
<example>
|
|
230
|
-
User: `/findbugs`
|
|
231
|
-
Claude: `No PR or upstream diff. /findbugs needs a target.`
|
|
232
|
-
</example>
|
|
233
|
-
|
|
234
|
-
<example>
|
|
235
|
-
User: `/findbugs` (branch with no PR but commits ahead of main)
|
|
236
|
-
Claude: [falls back to `git diff origin/main...HEAD`, runs audit on that diff scope]
|
|
237
|
-
</example>
|
|
238
|
-
|
|
239
|
-
## Why this design
|
|
240
|
-
|
|
241
|
-
Anchoring bias is the failure mode of context-rich audits. An agent that inherits "we just fixed three bugs in clipboard_utils.py" subconsciously scopes its hunt around clipboard_utils.py and pattern-matches on the same bug shapes. A clean-room audit on the full PR diff treats every file equally, considers every category, and surfaces things the orchestrator session never looked at. The diff is the contract; everything else is noise.
|
package/skills/fixbugs/CLAUDE.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# fixbugs
|
|
2
|
-
|
|
3
|
-
Bridges `/findbugs` audit results to `/agent-prompt` for automated fixing. Triggered by `/fixbugs`, `fix all the bugs`, `apply the audit fixes`, or `implement the findbugs results`.
|
|
4
|
-
|
|
5
|
-
## Purpose
|
|
6
|
-
|
|
7
|
-
A thin bridge: recover the prior `/findbugs` findings from the current conversation, apply an optional severity filter (`P0`, `P0+P1`, `P1`, or all), re-resolve PR scope, then hand the filtered finding list to `/agent-prompt` as a structured goal string. `/agent-prompt` authors the XML prompt, shows an Outcome preview, asks for confirmation, and spawns a background sonnet `clean-coder` agent to apply all fixes in one commit.
|
|
8
|
-
|
|
9
|
-
This skill never audits, never edits files, and never spawns agents directly. The `/agent-prompt` confirmation gate is always preserved.
|
|
10
|
-
|
|
11
|
-
## Key file
|
|
12
|
-
|
|
13
|
-
| File | Purpose |
|
|
14
|
-
|---|---|
|
|
15
|
-
| `SKILL.md` | Four-step process: recover findings, apply severity filter, re-resolve PR scope, hand off to `/agent-prompt` with a goal string in the exact expected shape. Includes refusal cases (no findings, zero bugs, empty filter, missing `agent-prompt` skill) and the implementer constraints (one commit, no `--force`, no rebase, explicit `git add` by path). |
|
|
16
|
-
|
|
17
|
-
## Invocation order
|
|
18
|
-
|
|
19
|
-
Run `/findbugs` first, then `/fixbugs`. Running `/fixbugs` with no prior `/findbugs` in the session returns `No findings in this session. Run /findbugs first.`
|