claude-dev-env 1.92.0 → 1.93.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 +5 -39
- package/_shared/CLAUDE.md +2 -1
- package/_shared/advisor/CLAUDE.md +21 -0
- package/_shared/advisor/advisor-protocol.md +142 -0
- package/_shared/advisor/scripts/config/advisor_scripts_constants/__init__.py +1 -0
- package/_shared/advisor/scripts/config/advisor_scripts_constants/model_tier_run_validator_constants.py +86 -0
- package/_shared/advisor/scripts/model_tier_run_validator.py +246 -0
- package/_shared/advisor/scripts/pyproject.toml +3 -0
- package/_shared/advisor/scripts/tests/test_model_tier_run_validator.py +302 -0
- package/_shared/advisor/scripts/tests/test_tier_model_ids.py +180 -0
- package/_shared/advisor/scripts/tier_model_ids.py +164 -0
- package/_shared/pr-loop/CLAUDE.md +1 -0
- package/_shared/pr-loop/precatch-rubric.md +65 -0
- package/_shared/pr-loop/scripts/CLAUDE.md +1 -1
- package/_shared/pr-loop/scripts/code_rules_gate.py +137 -5
- package/_shared/pr-loop/scripts/post_audit_thread.py +1 -1
- package/_shared/pr-loop/scripts/pr_loop_shared_constants/CLAUDE.md +1 -1
- package/_shared/pr-loop/scripts/pr_loop_shared_constants/code_rules_gate_constants.py +16 -0
- package/_shared/pr-loop/scripts/pr_loop_shared_constants/reviews_disabled_constants.py +2 -1
- package/_shared/pr-loop/scripts/reviewer_availability.py +42 -12
- package/_shared/pr-loop/scripts/reviews_disabled.py +65 -21
- package/_shared/pr-loop/scripts/terminology_sweep.py +69 -21
- package/_shared/pr-loop/scripts/tests/CLAUDE.md +1 -1
- package/_shared/pr-loop/scripts/tests/fixtures/{copilot_internal_user_jonecho.json → copilot_internal_user_example.json} +1 -1
- package/_shared/pr-loop/scripts/tests/test_agent_config_carveout.py +1 -1
- package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +146 -2
- package/_shared/pr-loop/scripts/tests/test_copilot_quota.py +8 -8
- package/_shared/pr-loop/scripts/tests/test_reviewer_availability.py +18 -5
- package/_shared/pr-loop/scripts/tests/test_reviews_disabled.py +56 -5
- package/_shared/pr-loop/scripts/tests/test_terminology_sweep.py +104 -17
- package/agents/CLAUDE.md +3 -2
- package/agents/clasp-deployment-orchestrator.md +2 -2
- package/agents/code-advisor.md +7 -5
- package/agents/code-verifier.md +6 -2
- package/agents/session-advisor.md +27 -0
- package/audit-rubrics/category_rubrics/category-j-code-rules-compliance.md +1 -1
- package/audit-rubrics/category_rubrics/category-k-codebase-conflicts.md +1 -1
- package/audit-rubrics/prompts/category-a-api-contracts.md +2 -2
- package/audit-rubrics/prompts/category-b-selector-engine-compat.md +2 -2
- package/audit-rubrics/prompts/category-c-resource-cleanup.md +2 -2
- package/audit-rubrics/prompts/category-d-scoping-and-ordering.md +2 -2
- package/audit-rubrics/prompts/category-e-dead-code.md +2 -2
- package/audit-rubrics/prompts/category-f-silent-failures.md +2 -2
- package/audit-rubrics/prompts/category-g-bounds-and-overflow.md +2 -2
- package/audit-rubrics/prompts/category-h-security-boundaries.md +2 -2
- package/audit-rubrics/prompts/category-i-concurrency.md +2 -2
- package/audit-rubrics/prompts/category-j-code-rules-compliance.md +2 -2
- package/audit-rubrics/prompts/category-k-codebase-conflicts.md +2 -2
- package/audit-rubrics/prompts/category-l-behavior-equivalence.md +2 -2
- package/audit-rubrics/prompts/category-m-producer-consumer-cardinality.md +2 -2
- package/audit-rubrics/prompts/category-n-test-name-scenario-verifier.md +2 -2
- package/audit-rubrics/prompts/category-o-docstring-vs-impl-drift.md +2 -2
- package/audit-rubrics/prompts/category-p-name-vs-behavior-contract.md +2 -2
- package/bin/CLAUDE.md +1 -0
- package/bin/expand_home_directory_tokens.mjs +75 -0
- package/bin/install.mjs +21 -7
- package/bin/install.test.mjs +220 -10
- package/hooks/CLAUDE.md +1 -1
- package/hooks/blocking/CLAUDE.md +4 -1
- package/hooks/blocking/_path_setup.py +13 -0
- package/hooks/blocking/bash_pre_tool_use_dispatcher.py +281 -0
- package/hooks/blocking/code_rules_dead_module_constant.py +88 -16
- package/hooks/blocking/code_rules_enforcer.py +6 -0
- package/hooks/blocking/code_rules_imports_logging.py +34 -1
- package/hooks/blocking/code_rules_paths_syspath.py +1 -1
- package/hooks/blocking/code_rules_test_layout.py +272 -0
- package/hooks/blocking/nas_ssh_binary_enforcer.py +22 -12
- package/hooks/blocking/pii_prevention_blocker.py +781 -0
- package/hooks/blocking/pii_scanner.py +340 -0
- package/hooks/blocking/pre_tool_use_dispatcher.py +3 -3
- package/hooks/blocking/stop_dispatcher.py +84 -0
- package/hooks/blocking/test__path_setup.py +39 -0
- package/hooks/blocking/test_bash_dispatcher_interpreter_starts.py +61 -0
- package/hooks/blocking/test_bash_pre_tool_use_dispatcher.py +294 -0
- package/hooks/blocking/test_code_rules_enforcer_cross_skill_duplicate.py +1 -1
- package/hooks/blocking/test_code_rules_enforcer_dead_module_constant.py +51 -0
- package/hooks/blocking/test_code_rules_enforcer_dead_module_constant_read_cap.py +103 -0
- package/hooks/blocking/test_code_rules_enforcer_dot_test_pattern.py +1 -1
- package/hooks/blocking/test_code_rules_enforcer_file_global_constants.py +1 -1
- package/hooks/blocking/test_code_rules_enforcer_hardcoded_user_path.py +11 -11
- package/hooks/blocking/test_code_rules_enforcer_naive_datetime.py +1 -1
- package/hooks/blocking/test_code_rules_enforcer_same_file_inline_duplicate.py +1 -1
- package/hooks/blocking/test_code_rules_enforcer_test_layout.py +111 -0
- package/hooks/blocking/test_code_rules_enforcer_type_checking_scope.py +76 -0
- package/hooks/blocking/test_destructive_command_blocker.py +29 -9
- package/hooks/blocking/test_gh_body_arg_blocker.py +3 -3
- package/hooks/blocking/test_nas_ssh_binary_enforcer.py +96 -39
- package/hooks/blocking/test_pii_prevention_blocker.py +905 -0
- package/hooks/blocking/test_pii_prevention_windows_git_path.py +41 -0
- package/hooks/blocking/test_pii_scanner.py +165 -0
- package/hooks/blocking/test_pr_description_enforcer_pr_number.py +1 -1
- package/hooks/blocking/test_pre_tool_use_dispatcher.py +14 -13
- package/hooks/blocking/test_stop_dispatcher.py +187 -0
- package/hooks/blocking/test_verdict_directory_write_blocker.py +1 -1
- package/hooks/blocking/test_volatile_path_in_post_blocker.py +3 -3
- package/hooks/blocking/volatile_path_in_post_blocker.py +54 -5
- package/hooks/diagnostic/migrations/README.md +25 -26
- package/hooks/diagnostic/test_hook_log_extractor.py +10 -10
- package/hooks/hooks.json +10 -120
- package/hooks/hooks_constants/CLAUDE.md +12 -3
- package/hooks/hooks_constants/bash_pre_tool_use_dispatcher_constants.py +78 -0
- package/hooks/hooks_constants/dead_module_constant_constants.py +1 -0
- package/hooks/hooks_constants/hosted_hook_runner.py +73 -0
- package/hooks/hooks_constants/local_identity.py +182 -0
- package/hooks/hooks_constants/nas_ssh_binary_enforcer_constants.py +4 -37
- package/hooks/hooks_constants/pii_prevention_constants.py +299 -0
- package/hooks/hooks_constants/pre_tool_use_dispatcher_constants.py +4 -0
- package/hooks/hooks_constants/python_style_checks_constants.py +15 -0
- package/hooks/hooks_constants/stop_dispatcher_constants.py +26 -0
- package/hooks/hooks_constants/test_bash_pre_tool_use_dispatcher_constants.py +87 -0
- package/hooks/hooks_constants/test_hardcoded_user_path_constants.py +2 -2
- package/hooks/hooks_constants/test_hosted_hook_runner.py +101 -0
- package/hooks/hooks_constants/test_layout_constants.py +28 -0
- package/hooks/hooks_constants/test_local_identity.py +88 -0
- package/hooks/hooks_constants/test_session_env_cleanup_constants.py +1 -1
- package/hooks/hooks_constants/test_stop_dispatcher_constants.py +32 -0
- package/hooks/validators/README.md +5 -6
- package/hooks/validators/__init__.py +2 -2
- package/hooks/validators/python_style_checks.py +298 -243
- package/hooks/validators/run_all_validators.py +6 -0
- package/hooks/validators/test_python_style_checks.py +278 -163
- package/package.json +2 -2
- package/rules/CLAUDE.md +7 -1
- package/rules/bdd.md +1 -1
- package/rules/nas-ssh-invocation.md +6 -4
- package/rules/no-justification-noise.md +61 -0
- package/rules/testing.md +0 -2
- package/scripts/test_setup_project_paths.py +1 -1
- package/skills/CLAUDE.md +6 -3
- package/skills/_shared/pr-loop/scripts/_path_resolver.py +2 -2
- package/skills/_shared/pr-loop/scripts/build_audit_prompt.py +1 -1
- package/skills/_shared/pr-loop/scripts/build_fix_prompt.py +1 -1
- package/skills/_shared/pr-loop/scripts/test__path_resolver.py +42 -3
- package/skills/_shared/pr-loop/scripts/test_build_audit_prompt.py +11 -11
- package/skills/_shared/pr-loop/scripts/test_build_fix_prompt.py +26 -3
- package/skills/_shared/pr-loop/scripts/test_preflight_worktree.py +49 -25
- package/skills/autoconverge/CLAUDE.md +3 -3
- package/skills/autoconverge/SKILL.md +113 -35
- package/skills/autoconverge/reference/CLAUDE.md +2 -2
- package/skills/autoconverge/reference/convergence.md +44 -22
- package/skills/autoconverge/reference/gotchas.md +11 -0
- package/skills/autoconverge/reference/stop-conditions.md +23 -13
- package/skills/autoconverge/workflow/CLAUDE.md +2 -1
- package/skills/autoconverge/workflow/converge.clean-audit.test.mjs +15 -19
- package/skills/autoconverge/workflow/converge.contract.test.mjs +43 -42
- package/skills/autoconverge/workflow/converge.copilot-gate.test.mjs +141 -16
- package/skills/autoconverge/workflow/converge.fix-recovery.test.mjs +2 -2
- package/skills/autoconverge/workflow/converge.mjs +329 -68
- package/skills/autoconverge/workflow/converge.path-aware.test.mjs +1 -1
- package/skills/autoconverge/workflow/converge.precatch.test.mjs +152 -0
- package/skills/autoconverge/workflow/converge.run-input.test.mjs +3 -3
- package/skills/autoconverge/workflow/converge_multi.run-input.test.mjs +15 -15
- package/skills/autoconverge/workflow/test_convergence_summary.py +6 -6
- package/skills/bdd-protocol/SKILL.md +4 -5
- package/skills/bdd-protocol/references/anti-patterns.md +1 -1
- package/skills/bugteam/SKILL.md +8 -0
- package/skills/bugteam/reference/copilot-gap-analysis.md +20 -20
- package/skills/bugteam/reference/obstacles/audit-walk-categories.md +1 -1
- package/skills/bugteam/reference/team-setup.md +7 -5
- package/skills/bugteam/scripts/reflow_skill_md.py +1 -1
- package/skills/copilot-finding-triage/SKILL.md +124 -0
- package/skills/copilot-finding-triage/reference/tier-rubric.md +49 -0
- package/skills/copilot-finding-triage/scripts/conftest.py +8 -0
- package/skills/copilot-finding-triage/scripts/copilot_finding_triage_constants/__init__.py +0 -0
- package/skills/copilot-finding-triage/scripts/copilot_finding_triage_constants/config/__init__.py +0 -0
- package/skills/copilot-finding-triage/scripts/copilot_finding_triage_constants/config/notify_ntfy_constants.py +32 -0
- package/skills/copilot-finding-triage/scripts/notify_ntfy.py +192 -0
- package/skills/copilot-finding-triage/scripts/test_notify_ntfy.py +141 -0
- package/skills/copilot-finding-triage/templates/notification.md +34 -0
- package/skills/copilot-review/SKILL.md +8 -6
- package/skills/findbugs/SKILL.md +4 -0
- package/skills/fixbugs/SKILL.md +8 -7
- package/skills/gotcha/CLAUDE.md +2 -2
- package/skills/gotcha/SKILL.md +4 -4
- package/skills/log-audit/SKILL.md +4 -6
- package/skills/monitor-open-prs/CLAUDE.md +1 -1
- package/skills/monitor-open-prs/SKILL.md +6 -1
- package/skills/orchestrator/SKILL.md +184 -0
- package/skills/orchestrator-refresh/SKILL.md +37 -0
- package/skills/post-audit-findings/SKILL.md +5 -9
- package/skills/pr-consistency-audit/SKILL.md +5 -1
- package/skills/pr-converge/CLAUDE.md +1 -1
- package/skills/pr-converge/SKILL.md +86 -47
- package/skills/pr-converge/reference/CLAUDE.md +1 -1
- package/skills/pr-converge/reference/convergence-gates.md +20 -17
- package/skills/pr-converge/reference/examples.md +63 -47
- package/skills/pr-converge/reference/fix-protocol.md +15 -15
- package/skills/pr-converge/reference/ground-rules.md +11 -7
- package/skills/pr-converge/reference/multi-pr-orchestration.md +6 -5
- package/skills/pr-converge/reference/per-tick.md +129 -107
- package/skills/pr-converge/reference/state-schema.md +15 -10
- package/skills/pr-converge/scripts/check_convergence.py +5 -4
- package/skills/pr-converge/scripts/test_check_convergence.py +6 -4
- package/skills/pr-fix-protocol/SKILL.md +3 -8
- package/skills/pr-loop-cloud-transport/SKILL.md +102 -0
- package/skills/pr-loop-cloud-transport/reference/identity-and-hooks.md +40 -0
- package/skills/pr-loop-cloud-transport/reference/substitution-matrix.md +48 -0
- package/skills/pr-loop-lifecycle/SKILL.md +5 -9
- package/skills/pr-scope-resolve/SKILL.md +3 -6
- package/skills/privacy-hygiene/SKILL.md +114 -0
- package/skills/qbug/SKILL.md +8 -8
- package/skills/rebase/SKILL.md +5 -1
- package/skills/refine/SKILL.md +4 -5
- package/skills/reviewer-gates/SKILL.md +7 -11
- package/skills/session-log/SKILL.md +4 -1
- package/skills/skill-builder/SKILL.md +3 -6
- package/skills/structure-prompt/SKILL.md +4 -5
- package/skills/team-advisor/SKILL.md +32 -164
- package/skills/test_markdown_link_integrity.py +10 -6
- package/skills/update/SKILL.md +5 -1
- package/skills/usage-pause/SKILL.md +14 -5
- package/skills/usage-pause/scripts/resolve_usage_window.py +83 -5
- package/skills/usage-pause/scripts/test_resolve_usage_window.py +185 -17
- package/skills/usage-pause/scripts/usage_pause_constants/resolve_usage_window_constants.py +4 -3
- package/skills/verified-build/SKILL.md +4 -9
- package/skills/team-advisor-refresh/SKILL.md +0 -25
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pr-loop-lifecycle
|
|
3
3
|
description: >-
|
|
4
|
-
Opens and closes a PR-loop run: the .claude/** permission grant
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
revoke, and the caller-parameterized final report. Invoked by PR-loop
|
|
10
|
-
orchestrators (bugteam, pr-converge, autoconverge, qbug) at run start and
|
|
11
|
-
run end, including error exits; not for general git cleanup or permission
|
|
12
|
-
management outside a PR loop.
|
|
4
|
+
Opens and closes a PR-loop run: the .claude/** permission grant, worktree
|
|
5
|
+
preflight, and cwd routing at the start; teardown, permission revoke, and
|
|
6
|
+
final report at the end. Invoked by PR-loop orchestrators (bugteam,
|
|
7
|
+
pr-converge, autoconverge, qbug); not for general git cleanup outside a PR
|
|
8
|
+
loop.
|
|
13
9
|
---
|
|
14
10
|
|
|
15
11
|
# PR Loop Lifecycle
|
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
name: pr-scope-resolve
|
|
3
3
|
description: >-
|
|
4
4
|
Resolves the audit/fix target for a PR-loop skill: owner, repo, PR number,
|
|
5
|
-
head
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
when no target exists. Invoked by PR-loop orchestrators (pr-converge,
|
|
9
|
-
bugteam, qbug, findbugs, fixbugs) as their first step; not for general git
|
|
10
|
-
questions or branch management.
|
|
5
|
+
head and base refs, PR URL, and head SHA, with a canonical refusal when no
|
|
6
|
+
target exists. Invoked by PR-loop orchestrators (pr-converge, bugteam, qbug,
|
|
7
|
+
findbugs, fixbugs) first; not for general git questions.
|
|
11
8
|
---
|
|
12
9
|
|
|
13
10
|
# PR Scope Resolve
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: privacy-hygiene
|
|
3
|
+
description: Full-repo sweep for personal data and secrets before commit or durable GitHub post. Use when preparing a PR, cleaning a leak, or when `pii_prevention_blocker` denies a write, post, or commit. Triggers on "privacy hygiene", "personal data", "secret sweep", "sanitize repository", "/privacy-hygiene".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# privacy-hygiene
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Find and remove personal data and high-confidence secrets before they land in git history or a durable GitHub post. The `pii_prevention_blocker` hook blocks the common cases at write, post, and commit time. This skill is the full sweep when you need a broader pass or a remediation plan.
|
|
11
|
+
|
|
12
|
+
**Announce at start:** "Running privacy-hygiene sweep."
|
|
13
|
+
|
|
14
|
+
## When to run a full sweep
|
|
15
|
+
|
|
16
|
+
- Before the first push of a branch that touched logs, screenshots, config samples, or machine-local paths
|
|
17
|
+
- After a hook block on email, home path, LAN address, or secret material
|
|
18
|
+
- Before opening a PR to a repository that is public (or will be made public)
|
|
19
|
+
- After pasting support tickets, env dumps, or terminal transcripts into the tree
|
|
20
|
+
|
|
21
|
+
## What the automated gate blocks
|
|
22
|
+
|
|
23
|
+
| Category | Blocked examples | Allowed residual |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| Email | `person@company.io` | `user@example.com`, `user@example.org`, `user@example.net` |
|
|
26
|
+
| Home path | `C:/Users/realname/...`, `/Users/realname/...`, `/home/realname/...` | `C:/Users/example/...`, `C:/Users/<you>/...`, `/Users/alice/...` |
|
|
27
|
+
| LAN address | Unlisted `10.x` / `172.16–31.x` / `192.168.x` | Public addresses; product NAS `192.168.1.100`; other entries in `ALL_ALLOWLISTED_PRIVATE_IP_ADDRESSES` |
|
|
28
|
+
| Secret | `ghp_…`, `github_pat_…`, `AKIA…`, PEM private-key headers | Public keys, redacted `***`, env var names without values |
|
|
29
|
+
|
|
30
|
+
Surfaces:
|
|
31
|
+
|
|
32
|
+
1. **Write / Edit / MultiEdit** — payload text about to land on disk (via PreToolUse dispatcher)
|
|
33
|
+
2. **Durable posts** — `gh pr/issue create|comment|edit|review` bodies and GitHub MCP body/comment fields (Bash and PowerShell)
|
|
34
|
+
3. **git commit** — staged blob text (non-exempt paths) on Bash and PowerShell, including `git.exe` and flag forms (`--no-verify`, `-c`, `-C`). Commit message bodies (`-m` / `-F`) are out of scope for the automated gate
|
|
35
|
+
|
|
36
|
+
## Sweep procedure
|
|
37
|
+
|
|
38
|
+
### 1. Scope the tree
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
git status -sb
|
|
42
|
+
git diff --stat
|
|
43
|
+
git diff --cached --stat
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Prefer the branch diff vs `origin/main` for PR prep:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
git fetch origin main
|
|
50
|
+
git diff --name-only origin/main...HEAD
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 2. Search for high-confidence patterns
|
|
54
|
+
|
|
55
|
+
Run from the repo root (PowerShell-friendly example):
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
rg -n --hidden -g '!node_modules' -g '!.git' -e '@[A-Za-z0-9.-]+\.[A-Za-z]{2,}' -e 'Users[/\\][^/\\]+' -e '/home/[^/]+' -e '\b(10\.\d+\.\d+\.\d+|192\.168\.\d+\.\d+|172\.(1[6-9]|2\d|3[0-1])\.\d+\.\d+)\b' -e '\b(ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9_]{20,}\b' -e '\bgithub_pat_[A-Za-z0-9_]{20,}\b' -e '\bAKIA[0-9A-Z]{16}\b' -e '-----BEGIN [A-Z ]*PRIVATE KEY-----'
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Review each hit. Ignore:
|
|
62
|
+
|
|
63
|
+
- Test fixtures under `test_*.py` / `*_test.py` / `/tests/` (synthetic only)
|
|
64
|
+
- `LICENSE` / copyright notice identity that is intentional and public
|
|
65
|
+
- This package's own `pii_scanner` / `pii_prevention_constants` modules
|
|
66
|
+
- Documented placeholders (`user@example.com`, `C:/Users/<you>/`)
|
|
67
|
+
|
|
68
|
+
### 3. Remediate
|
|
69
|
+
|
|
70
|
+
| Hit | Fix |
|
|
71
|
+
|---|---|
|
|
72
|
+
| Real email | Replace with `user@example.com` or remove |
|
|
73
|
+
| Home path | Use `Path.home()`, `~`, or `C:/Users/<you>/` |
|
|
74
|
+
| LAN address | Remove, use a hostname, or add to `ALL_ALLOWLISTED_PRIVATE_IP_ADDRESSES` only when tooling requires it |
|
|
75
|
+
| Credential material | Remove from the tree; rotate the credential; load from env/secret store |
|
|
76
|
+
| Already committed | Rewrite is not enough if already pushed — rotate secrets; scrub history only with explicit user approval |
|
|
77
|
+
|
|
78
|
+
### 4. Re-check before commit / post
|
|
79
|
+
|
|
80
|
+
- Stage only clean files
|
|
81
|
+
- Prefer `--body-file` for `gh` posts (also required by the gh-body-file rule)
|
|
82
|
+
- Let `pii_prevention_blocker` re-run on the next Write / commit / post
|
|
83
|
+
|
|
84
|
+
## Accepted residual (do not over-scrub)
|
|
85
|
+
|
|
86
|
+
- LICENSE copyright lines naming a legal person or org that owns the work
|
|
87
|
+
- Intentional public maintainer identity published on purpose
|
|
88
|
+
- Example domains reserved for documentation (`example.com` and siblings)
|
|
89
|
+
- Placeholder home users (`example`, `user`, `alice`, `<you>`, `YOUR_USER`)
|
|
90
|
+
- Product NAS host `192.168.1.100` (allowlisted for the NAS SSH rule/hook)
|
|
91
|
+
- Public addresses and docs that name private ranges without a live host (still prefer hostnames)
|
|
92
|
+
|
|
93
|
+
## Enable on any machine / public repository
|
|
94
|
+
|
|
95
|
+
Install or reinstall the package so hooks and this skill land under `~/.claude/`:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
cd packages/claude-dev-env
|
|
99
|
+
node bin/install.mjs
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Hooks register via `hooks/hooks.json` into `~/.claude/settings.json`. Once installed, the same gates apply in every repository the agent touches — private or public.
|
|
103
|
+
|
|
104
|
+
## Open knobs
|
|
105
|
+
|
|
106
|
+
- **NAS / LAN allowlist:** Unlisted private IPs are blocked. `192.168.1.100` is allowlisted for the NAS SSH enforcer. Add further hosts to `ALL_ALLOWLISTED_PRIVATE_IP_ADDRESSES` only when tooling requires them.
|
|
107
|
+
- **Public maintainer identity:** when a real email or name is intentional product surface, keep it and note that in the PR body so reviewers do not treat it as a leak.
|
|
108
|
+
|
|
109
|
+
## What this skill does not do
|
|
110
|
+
|
|
111
|
+
- Does not rewrite git history without explicit user approval
|
|
112
|
+
- Does not rotate credentials for you
|
|
113
|
+
- Does not replace the write-time hook — it complements it
|
|
114
|
+
- Does not scan commit-message text (`-m` / `-F`); keep messages free of secrets yourself
|
package/skills/qbug/SKILL.md
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: qbug
|
|
3
3
|
description: >-
|
|
4
|
-
Required baseline review for every new PR
|
|
5
|
-
commit
|
|
6
|
-
until convergence or stuck.
|
|
7
|
-
|
|
8
|
-
teammates, per-loop clean-room, or a loop cap. Invoke /bugteam instead for
|
|
9
|
-
larger PRs that need per-loop bias isolation or a hard loop cap. Triggers:
|
|
10
|
-
'/qbug', 'quick bug audit', 'solo bug audit', 'baseline PR review',
|
|
11
|
-
'bugteam without a team'.
|
|
4
|
+
Required baseline review for every new PR: runs the /bugteam audit, fix,
|
|
5
|
+
commit, and push cycle through one clean-coder subagent (not a full team),
|
|
6
|
+
looping until convergence or stuck. Triggers: '/qbug', 'quick bug audit',
|
|
7
|
+
'solo bug audit', 'baseline PR review', 'bugteam without a team'.
|
|
12
8
|
---
|
|
13
9
|
|
|
14
10
|
# qbug
|
|
@@ -25,6 +21,10 @@ Shared artifacts with /bugteam are referenced below by path, using the `${CLAUDE
|
|
|
25
21
|
- **Audit contract** (finding schema, proof-of-absence, adversarial pass, Haiku secondary, post-fix self-audit, diagnostics JSON): [`_shared/pr-loop/audit-contract.md`](../../_shared/pr-loop/audit-contract.md)
|
|
26
22
|
- PR comment lifecycle shape: [`bugteam/SKILL.md`](../bugteam/SKILL.md#audit-posting)
|
|
27
23
|
|
|
24
|
+
## Transport check (before any GitHub step)
|
|
25
|
+
|
|
26
|
+
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.
|
|
27
|
+
|
|
28
28
|
## When this skill applies
|
|
29
29
|
|
|
30
30
|
`/qbug` once authorizes the full cycle (no loop cap — runs until `converged` or `stuck`; user can interrupt at any time).
|
package/skills/rebase/SKILL.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: rebase
|
|
3
|
-
description:
|
|
3
|
+
description: >-
|
|
4
|
+
Rebases a branch onto its base ref with the verification gates that catch
|
|
5
|
+
logically broken results before pushing. Use when the user invokes `/rebase`,
|
|
6
|
+
says 'rebase this branch', 'PR has merge conflicts', or 'rebase onto main', or
|
|
7
|
+
asks for a force-push to update a remote branch's history.
|
|
4
8
|
---
|
|
5
9
|
|
|
6
10
|
# /rebase
|
package/skills/refine/SKILL.md
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: refine
|
|
3
3
|
description: >-
|
|
4
|
-
Interview-driven plan refiner
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
this out", "make a spec for this", "let's plan this out", or any vague idea to mature
|
|
4
|
+
Interview-driven plan refiner: fans out research agents, interviews through
|
|
5
|
+
AskUserQuestion, writes to the Obsidian vault, then loops audit and fix.
|
|
6
|
+
Triggers: /refine, 'refine this', 'turn this into a plan', 'flesh this out',
|
|
7
|
+
'make a spec for this', 'let's plan this out', or any vague idea to mature
|
|
9
8
|
into a plan.
|
|
10
9
|
---
|
|
11
10
|
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: reviewer-gates
|
|
3
3
|
description: >-
|
|
4
|
-
Runs the availability gates a PR-loop orchestrator checks before
|
|
5
|
-
external reviewer: the CLAUDE_REVIEWS_DISABLED opt-out
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
semantics), and the Cursor Bugbot trigger/acknowledge/CI-detect flow
|
|
9
|
-
(check_bugbot_ci.py with the literal `bugbot run` comment). Invoked by
|
|
10
|
-
PR-loop orchestrators — pr-converge, autoconverge, bugteam, qbug, findbugs,
|
|
11
|
-
copilot-review, monitor-open-prs — at run start and at each reviewer
|
|
12
|
-
engagement point. Not a general code-review skill; it decides whether a
|
|
13
|
-
reviewer runs, never what the reviewer finds.
|
|
4
|
+
Runs the availability gates a PR-loop orchestrator checks before it starts an
|
|
5
|
+
external reviewer: the CLAUDE_REVIEWS_DISABLED opt-out, the once-per-run
|
|
6
|
+
Copilot quota pre-check, and the Cursor Bugbot trigger, acknowledge, and
|
|
7
|
+
CI-detect flow. Decides whether a reviewer runs, never what it finds.
|
|
14
8
|
---
|
|
15
9
|
|
|
16
10
|
# Reviewer Gates
|
|
@@ -34,13 +28,15 @@ The `CLAUDE_REVIEWS_DISABLED` environment variable is a comma-separated token li
|
|
|
34
28
|
| `bugbot` | Cursor Bugbot triggering and polling |
|
|
35
29
|
| `copilot` | GitHub Copilot review requests and polling |
|
|
36
30
|
|
|
31
|
+
Cursor Bugbot is off by default: it runs only when `CLAUDE_REVIEWS_ENABLED` lists `bugbot`, and a `bugbot` token in `CLAUDE_REVIEWS_DISABLED` keeps it off even when the opt-in lists it.
|
|
32
|
+
|
|
37
33
|
Run the shared parser — never an inline shell parse:
|
|
38
34
|
|
|
39
35
|
```bash
|
|
40
36
|
python "$HOME/.claude/_shared/pr-loop/scripts/reviews_disabled.py" --reviewer <bugbot|bugteam|copilot>
|
|
41
37
|
```
|
|
42
38
|
|
|
43
|
-
- **Exit 0** — the named reviewer is opted out. A skill whose whole run depends on that reviewer responds with its refusal line and stops.
|
|
39
|
+
- **Exit 0** — the named reviewer is disabled for this run (opted out, or, for Bugbot, off by default without the `CLAUDE_REVIEWS_ENABLED` opt-in). A skill whose whole run depends on that reviewer responds with its refusal line and stops. A copilot- or bugteam-dependent caller names the opt-out: `/<caller> is disabled via CLAUDE_REVIEWS_DISABLED.` A Bugbot-dependent caller off by default names the opt-in the run needs: `/<caller> is disabled: Cursor Bugbot needs a bugbot token in CLAUDE_REVIEWS_ENABLED.` A loop that merely includes the reviewer as one gate marks the reviewer down (`bugbot_down = true`, `copilot_down = true`) and continues on its remaining signals.
|
|
44
40
|
- **Exit 1** — the reviewer is available; continue.
|
|
45
41
|
|
|
46
42
|
## Gate 2: Copilot quota pre-check (once per run)
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: session-log
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
4
|
+
Logs a session report as an HTML page, tracks vault context, extracts
|
|
5
|
+
decisions, and outputs a /rename command. Use for /session-log, 'journal this
|
|
6
|
+
session', 'log this work', 'session report', 'summarize/log/record this
|
|
7
|
+
session', 'save session', 'capture session', or 'document what we did'.
|
|
5
8
|
---
|
|
6
9
|
|
|
7
10
|
# Session Log
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: skill-builder
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
iterative refinement from real usage observations. Use when creating new
|
|
8
|
-
skills, improving existing skills, or optimizing skill descriptions.
|
|
9
|
-
Triggers: 'build a skill', 'new skill workflow', 'improve this skill',
|
|
4
|
+
Runs the skill-building lifecycle: type classification, scaffolding, writing
|
|
5
|
+
through skill-writer, self-audit against a checklist, and refinement from real
|
|
6
|
+
usage. Triggers: 'build a skill', 'new skill workflow', 'improve this skill',
|
|
10
7
|
'optimize skill description', 'skill development lifecycle'.
|
|
11
8
|
---
|
|
12
9
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: structure-prompt
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
5
|
-
constraints,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
this prompt", "minimally invasive edit" to a prompt artifact, "tighten this prompt".
|
|
4
|
+
Restructures a user-provided prompt: orders blocks, swaps persona framing for
|
|
5
|
+
task constraints, expands placeholder tokens, and adds file:line citations.
|
|
6
|
+
Triggers: /structure-prompt, 'optimize this prompt', 'minimally invasive edit'
|
|
7
|
+
to a prompt artifact, or 'tighten this prompt'.
|
|
9
8
|
---
|
|
10
9
|
|
|
11
10
|
# structure-prompt
|
|
@@ -1,188 +1,56 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: team-advisor
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Executors do the code editing, verification, script driving, PR
|
|
9
|
-
descriptions, and searches; the advisor answers blockers with one of three
|
|
10
|
-
brief signals — a plan, a correction, or a stop. The advisor never edits
|
|
11
|
-
code or runs tests itself. Caps consultations per task (default 5), reuses
|
|
12
|
-
warm workflow agents before spawning new ones, and re-asserts the
|
|
13
|
-
discipline every 20 minutes through the /team-advisor-refresh loop. Adapts
|
|
14
|
-
Anthropic's coordinator pattern (plan big, execute small) to Claude Code.
|
|
15
|
-
Triggers: '/team-advisor', 'team advisor strategy', 'run with a team
|
|
16
|
-
advisor', 'executor-advisor mode', 'team advisor enforcement', 'agent
|
|
17
|
-
routing', 'orchestrate'.
|
|
4
|
+
Spawn one warm session-advisor at the strongest reachable tier and consult
|
|
5
|
+
it before big decisions, completion, commits, or when stuck. Triggers:
|
|
6
|
+
'team-advisor', 'team advisor', 'second opinion', 'advisor', 'consult',
|
|
7
|
+
'verify', 'validate', 'commit', 'push'.
|
|
18
8
|
---
|
|
19
9
|
|
|
20
|
-
# Team Advisor
|
|
10
|
+
# Team Advisor
|
|
21
11
|
|
|
22
12
|
## Principle
|
|
23
13
|
|
|
24
|
-
|
|
25
|
-
token-heavy reading and doing — Anthropic's coordinator pattern, source:
|
|
26
|
-
https://github.com/anthropics/claude-cookbooks/blob/main/managed_agents/CMA_plan_big_execute_small.ipynb
|
|
27
|
-
("Coordinator pattern: big models for planning, small models for
|
|
28
|
-
execution"). On the cookbook's own measured run, a coordinator
|
|
29
|
-
delegating to Sonnet-5 workers came out cheaper and faster
|
|
30
|
-
than a solo frontier agent held to the same verification rigor, with
|
|
31
|
-
84-98% of the team's input tokens billed at the worker rate.
|
|
14
|
+
One warm, addressable advisor available at the strongest model tier the session can reach. The session sends concise briefs when a decision benefits from a second opinion: before acting on a plan, at completion, before commits, when stuck, when reconsidering the approach, or when an agent deems it necessary and beneficial to the user's goals.
|
|
32
15
|
|
|
33
|
-
|
|
34
|
-
`create_agent`/`send_to_agent` primitives; this skill reaches the same
|
|
35
|
-
shape with the tools Claude Code already has. Under this skill the session
|
|
36
|
-
is the advisor-orchestrator. In Claude Code the user always talks to the session and never to a
|
|
37
|
-
subagent, so the session is the user's sole interface: all user-facing
|
|
38
|
-
communication flows through it. It spawns and resumes executor subagents
|
|
39
|
-
— `clean-coder` and the like — and those executors do every bit of the
|
|
40
|
-
execution: the code edits, the build runs, the test runs. The advisor
|
|
41
|
-
drives the plan and answers the executors when they get stuck.
|
|
16
|
+
## Follow the shared protocol
|
|
42
17
|
|
|
43
|
-
|
|
18
|
+
**Detect the host profile first** (Host profiles in
|
|
19
|
+
[`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md)
|
|
20
|
+
— e.g. `ADVISOR_HOST_PROFILE` or `GROK_BUILD`). Do not start a model-floor
|
|
21
|
+
walk until the host is known.
|
|
44
22
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
is already running before you schedule one (see the invocation guard in
|
|
48
|
-
Process step 1).
|
|
49
|
-
- **The advisor never executes.** The moment it edits a file or runs the tests
|
|
50
|
-
itself, the pairing breaks and the executor's warm context is wasted. Hand
|
|
51
|
-
every code edit and every build or test run to an executor; keep the
|
|
52
|
-
advisor's own tool use to orchestration and light verification reads.
|
|
53
|
-
- **Flat ad hoc spawns bypass routing.** Every execution task goes through a
|
|
54
|
-
workflow-backed spawn or workflow resume so the required agent type, model,
|
|
55
|
-
prompt packet, and sidecar metadata stay attached to the work.
|
|
56
|
-
- **Wrong agent or model is an enforcement failure.** If a task category maps
|
|
57
|
-
to `clean-coder` on `opus`, a `general-purpose` Sonnet spawn is not a cost
|
|
58
|
-
optimization; it is the wrong executor for the contract.
|
|
59
|
-
- **Resuming an unnamed background agent needs its agentId.** A background
|
|
60
|
-
spawn returns an `agentId` (format `a...-...`); keep it so `SendMessage` can
|
|
61
|
-
reach that agent later. A named agent is reachable by name.
|
|
62
|
-
- **Consultations past the cap signal a scoping problem.** When five
|
|
63
|
-
consultations do not clear the blocker, the task needs re-scoping or a
|
|
64
|
-
hand-off to the user — not a sixth round of advice.
|
|
23
|
+
This session is the shared advisor's sole consumer, so its model floor is
|
|
24
|
+
simply this session's own tier — no routing table to take a max against.
|
|
65
25
|
|
|
26
|
+
**Claude host:** follow the shared protocol for the model-floor walk, the
|
|
27
|
+
warm-up spawn and charter, the consult format and cadence, drift-respawn, and
|
|
28
|
+
the CLI fallback — using `team-advisor-agent` as the name and this session as
|
|
29
|
+
the only consumer (skip the "who you are and your assignment" opener in each
|
|
30
|
+
consult; a single-consumer session doesn't need it).
|
|
66
31
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
second loop.
|
|
72
|
-
|
|
73
|
-
2. **Register the discipline reminder.** By default, schedule it with
|
|
74
|
-
`ScheduleWakeup` at `delaySeconds: 1200`, prompt `/team-advisor-refresh`,
|
|
75
|
-
where each refresh re-schedules the next one — a 1200-second wakeup costs
|
|
76
|
-
one prompt-cache miss per firing and nothing more (see Gotchas). The loop
|
|
77
|
-
mechanism (`/loop 20m /team-advisor-refresh`) is the escape hatch when
|
|
78
|
-
`ScheduleWakeup` is not available. Either way the reminder is the
|
|
79
|
-
enforcement surface: each firing re-asserts the discipline while the run is
|
|
80
|
-
in flight.
|
|
81
|
-
|
|
82
|
-
3. **Orchestrate the task.** Hold the plan and the user conversation. Execute
|
|
83
|
-
workflow-backed spawns or resumes using the routing table below, and keep
|
|
84
|
-
driving while they work. Your own tool use stays orchestration and light
|
|
85
|
-
verification reads. Keep your task list updated religiously.
|
|
86
|
-
|
|
87
|
-
## Workflow Agent Routing
|
|
88
|
-
|
|
89
|
-
Every delegated task runs through a workflow-backed agent invocation. Do not
|
|
90
|
-
spawn a flat subagent directly when a workflow invocation or workflow resume is
|
|
91
|
-
available.
|
|
92
|
-
|
|
93
|
-
| Work | Agent type | Model |
|
|
94
|
-
|---|---|---|
|
|
95
|
-
| Feature, bug, and refactor coding | `clean-coder` | `opus` |
|
|
96
|
-
| Verification passes | `code-verifier` | `opus` |
|
|
97
|
-
| Script runs, GitHub posting, and backfill driving | `general-purpose` runner | `sonnet` |
|
|
98
|
-
| PR descriptions | `pr-description-writer` | `sonnet`, with file-list grounding check |
|
|
99
|
-
| Fan-out searches and checklist verification reads | `Explore` | `haiku`; use `sonnet` when judgment-heavy |
|
|
100
|
-
| Escalated blockers needing a second opinion beyond the orchestrator's own judgment | `code-advisor` | Fable preferred (matches the orchestrating session); opus if Fable is unavailable. |
|
|
101
|
-
|
|
102
|
-
Routing rules:
|
|
103
|
-
|
|
104
|
-
- Use a workflow invocation or resume for each row above. The workflow prompt
|
|
105
|
-
must name the selected agent type, model, work category, task scope, and
|
|
106
|
-
expected output.
|
|
107
|
-
- Resume a warm workflow agent before creating a new workflow run when the warm
|
|
108
|
-
agent holds the relevant context.
|
|
109
|
-
- `clean-coder` owns code edits. `code-verifier` owns verification. The same
|
|
110
|
-
workflow agent never grades work it wrote.
|
|
111
|
-
- PR-description workflows include the actual changed-file list in the prompt
|
|
112
|
-
and verify the final body against that file list before posting or returning
|
|
113
|
-
it.
|
|
114
|
-
- Exploration workflows return file paths, line numbers, and direct evidence;
|
|
115
|
-
they do not write code or mutate repo state.
|
|
116
|
-
|
|
117
|
-
4. **Executors consult at a hard decision.** Each executor's spawn prompt tells
|
|
118
|
-
it to stop and message you — with the task, what it tried, and the exact
|
|
119
|
-
blocker (plus any short code excerpt that helps) — when one of these holds:
|
|
120
|
-
- It has tried the same problem twice or more and it still fails.
|
|
121
|
-
- A decision changes the deliverable's scope or a contract that is hard to
|
|
122
|
-
reverse.
|
|
123
|
-
- Two constraints conflict and it cannot satisfy both.
|
|
124
|
-
- It is unsure whether to stop or keep going.
|
|
125
|
-
|
|
126
|
-
5. **Answer with one signal.** On a consultation, reply with exactly one
|
|
127
|
-
signal, brief (about 400 to 700 tokens):
|
|
128
|
-
- **PLAN** — a different approach, as concrete ordered steps the executor
|
|
129
|
-
can run. When a warm agent fits the plan, name which one to resume.
|
|
130
|
-
- **CORRECTION** — the executor's approach is right, one thing is wrong;
|
|
131
|
-
name the wrong step and the fix.
|
|
132
|
-
- **STOP** — no path satisfies the task as assigned; say why so it can be
|
|
133
|
-
reported upward.
|
|
134
|
-
The executor resumes the moment your reply lands.
|
|
135
|
-
|
|
136
|
-
A worked consultation:
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
Executor → advisor
|
|
140
|
-
Task: add a retry to the upload client.
|
|
141
|
-
Tried: wrapped upload() in a three-attempt loop; the second attempt
|
|
142
|
-
double-posts.
|
|
143
|
-
Blocker: the server takes no idempotency key, so a retry after a timeout
|
|
144
|
-
creates a duplicate record.
|
|
145
|
-
|
|
146
|
-
Advisor → executor
|
|
147
|
-
CORRECTION — the retry loop is right; the missing piece is a stable request
|
|
148
|
-
id. Generate one client-side on the first attempt and send the same id on
|
|
149
|
-
every retry, so the server treats the retries as one request.
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
For a decision the advisor itself cannot settle, it may use a workflow
|
|
153
|
-
escalation to the tool-less `code-advisor` agent for a second opinion — an
|
|
154
|
-
optional escalation, not a required step.
|
|
155
|
-
|
|
156
|
-
## Agent reuse (non-negotiable)
|
|
157
|
-
|
|
158
|
-
- **Resume before you spawn, always.** A warm agent carries its context and
|
|
159
|
-
cached tokens; a fresh spawn starts cold and pays to rebuild both.
|
|
160
|
-
Resume the existing workflow agent by name or `agentId` when it holds
|
|
161
|
-
relevant context. Prefer that path every time an existing workflow agent
|
|
162
|
-
matches the routing table.
|
|
163
|
-
- **Spawn a fresh agent only when** no existing agent holds relevant context,
|
|
164
|
-
or a genuine task switch needs a clean context.
|
|
165
|
-
- **Name the agent to resume.** When you answer with a PLAN and a warm agent
|
|
166
|
-
fits, say which agent to resume and where.
|
|
32
|
+
**Grok host:** use the self-as-advisor path in the shared protocol: this
|
|
33
|
+
session answers ENDORSE / CORRECTION / PLAN / STOP itself. Do not spawn a
|
|
34
|
+
Claude `session-advisor` subagent and do not walk the Claude multi-tier
|
|
35
|
+
ladder.
|
|
167
36
|
|
|
168
37
|
## Constraints
|
|
169
38
|
|
|
170
|
-
- One
|
|
171
|
-
|
|
172
|
-
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
- Reuse a warm agent over a cold spawn whenever one holds relevant context.
|
|
39
|
+
- One `team-advisor-agent` per session, owned by this session for its whole
|
|
40
|
+
lifecycle (spawn, drift-respawn, shutdown) — see
|
|
41
|
+
[`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md).
|
|
42
|
+
- Never spawn the warm agent, or its CLI fallback, at a tier below this
|
|
43
|
+
session's own tier.
|
|
44
|
+
- The warm agent (or its CLI equivalent) only answers. It never edits a
|
|
45
|
+
file, never runs a build or test, and never posts anything on the
|
|
46
|
+
session's behalf.
|
|
179
47
|
|
|
180
48
|
## File Index
|
|
181
49
|
|
|
182
50
|
| File | Purpose |
|
|
183
51
|
|---|---|
|
|
184
|
-
| `SKILL.md` |
|
|
52
|
+
| `SKILL.md` | Pointer to the shared advisor protocol; this session's consumer-specific wiring and constraints. |
|
|
185
53
|
|
|
186
54
|
## Folder Map
|
|
187
55
|
|
|
188
|
-
- `SKILL.md` — complete advisor workflow instructions.
|
|
56
|
+
- `SKILL.md` — complete team-advisor workflow instructions.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
"""Link-integrity check for the skills tree and
|
|
1
|
+
"""Link-integrity check for the skills tree and shared protocol docs.
|
|
2
2
|
|
|
3
|
-
Walks every markdown file under ``skills
|
|
4
|
-
resolves each relative markdown link target against
|
|
5
|
-
directory. A link whose target file or directory does not
|
|
6
|
-
reported with its source file and line number, and the test
|
|
3
|
+
Walks every markdown file under ``skills/``, ``_shared/pr-loop/``, and
|
|
4
|
+
``_shared/advisor/`` and resolves each relative markdown link target against
|
|
5
|
+
the linking file's directory. A link whose target file or directory does not
|
|
6
|
+
exist on disk is reported with its source file and line number, and the test
|
|
7
|
+
fails.
|
|
7
8
|
"""
|
|
8
9
|
|
|
9
10
|
from __future__ import annotations
|
|
@@ -14,6 +15,7 @@ from pathlib import Path
|
|
|
14
15
|
|
|
15
16
|
SKILLS_ROOT = Path(__file__).parent
|
|
16
17
|
SHARED_PR_LOOP_ROOT = SKILLS_ROOT.parent / "_shared" / "pr-loop"
|
|
18
|
+
SHARED_ADVISOR_ROOT = SKILLS_ROOT.parent / "_shared" / "advisor"
|
|
17
19
|
|
|
18
20
|
MARKDOWN_LINK_PATTERN = re.compile(r"\]\(([^)\s]+)\)")
|
|
19
21
|
FENCE_MARKER = "```"
|
|
@@ -34,10 +36,12 @@ def _iter_markdown_files() -> list[Path]:
|
|
|
34
36
|
"""List every markdown file the integrity check covers.
|
|
35
37
|
|
|
36
38
|
Returns:
|
|
37
|
-
All ``.md`` files under the skills tree
|
|
39
|
+
All ``.md`` files under the skills tree, the shared pr-loop tree, and
|
|
40
|
+
the shared advisor tree.
|
|
38
41
|
"""
|
|
39
42
|
all_markdown_files = sorted(SKILLS_ROOT.rglob("*.md"))
|
|
40
43
|
all_markdown_files.extend(sorted(SHARED_PR_LOOP_ROOT.rglob("*.md")))
|
|
44
|
+
all_markdown_files.extend(sorted(SHARED_ADVISOR_ROOT.rglob("*.md")))
|
|
41
45
|
return all_markdown_files
|
|
42
46
|
|
|
43
47
|
|
package/skills/update/SKILL.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: update
|
|
3
|
-
description:
|
|
3
|
+
description: >-
|
|
4
|
+
Fast-forwards a local repository's main branch to a remote's main after
|
|
5
|
+
confirming the repo path and source remote through AskUserQuestion. Use when
|
|
6
|
+
the user says '/update', 'update main', 'fast-forward main', 'sync main from
|
|
7
|
+
origin', 'pull latest main into <path>', or 'bring main up to date'.
|
|
4
8
|
---
|
|
5
9
|
|
|
6
10
|
# update
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: usage-pause
|
|
3
|
-
description:
|
|
3
|
+
description: >-
|
|
4
|
+
Waits out the account's 5-hour usage window in ScheduleWakeup stages that keep
|
|
5
|
+
every agent context warm. Accepts a manual override like '/usage-pause
|
|
6
|
+
10:20pm' or '/usage-pause 74m'. Triggers: '/usage-pause', 'pause until the
|
|
7
|
+
usage window resets', 'wait out the usage limit', 'usage limit pause'.
|
|
4
8
|
argument-hint: "[reset time like 10:20pm | duration like 74m]"
|
|
5
9
|
---
|
|
6
10
|
|
|
@@ -39,16 +43,21 @@ On exit 2 the script prints `{"error": ...}`. Ask the user for a manual reset ti
|
|
|
39
43
|
|
|
40
44
|
### Probe mechanism
|
|
41
45
|
|
|
42
|
-
The resolver
|
|
46
|
+
The resolver gets a bearer token from one of two sources and sends `GET https://api.anthropic.com/api/oauth/usage` with `Authorization: Bearer <token>` and `anthropic-beta: oauth-2025-04-20`. This is the same endpoint the interactive `/usage` panel reads. The response carries a `five_hour` bucket and a `seven_day` bucket, each with `utilization` (percent spent) and `resets_at`.
|
|
43
47
|
|
|
44
|
-
|
|
48
|
+
Token sources, in order:
|
|
49
|
+
|
|
50
|
+
- The Claude Code CLI's OAuth access token in `~/.claude/.credentials.json` (`claudeAiOauth.accessToken`, honored only while its `expiresAt` sits in the future).
|
|
51
|
+
- The session ingress token in the file named by the `CLAUDE_SESSION_INGRESS_TOKEN_FILE` environment variable, read when the credential file token is unavailable. Claude Code cloud sessions set this variable and omit the credential file.
|
|
52
|
+
|
|
53
|
+
Fallbacks, in order: no usable token from either source, a failed request, or a response with no readable `five_hour` reset time all end in exit 2 — the manual-override ask above. The manual path works with no probe at all, so the skill functions even when both token sources are stale.
|
|
45
54
|
|
|
46
55
|
Why this probe and not the others:
|
|
47
56
|
|
|
48
57
|
- The interactive `/usage` panel shows the same data but has no scriptable output.
|
|
49
58
|
- `claude -p --output-format json` spends usage to answer and its metadata reports per-call token counts, not the account window clock.
|
|
50
59
|
- `anthropic-ratelimit-*` response headers cover API-key Messages traffic, not the subscription session window, and reading them also costs a request.
|
|
51
|
-
- Refreshing the OAuth token from a script is out of scope: token rotation would desync the refresh token the CLI has on disk and log the CLI out. The resolver only ever reads
|
|
60
|
+
- Refreshing the OAuth token from a script is out of scope: token rotation would desync the refresh token the CLI has on disk and log the CLI out. The resolver only ever reads its token sources.
|
|
52
61
|
|
|
53
62
|
## Weekly limit guard
|
|
54
63
|
|
|
@@ -101,7 +110,7 @@ Fill each `<slot>` at schedule time: `<remaining_stage_durations>` is the tail o
|
|
|
101
110
|
| `SKILL.md` | This flow: resolve, weekly guard, stage chain, templates |
|
|
102
111
|
| `scripts/resolve_usage_window.py` | The window resolver and stage planner CLI |
|
|
103
112
|
| `scripts/test_resolve_usage_window.py` | Behavioral tests for parsing, staging, token reading, extraction, CLI |
|
|
104
|
-
| `scripts/usage_pause_constants/resolve_usage_window_constants.py` | Endpoint, credential keys, stage sizing, thresholds, result keys |
|
|
113
|
+
| `scripts/usage_pause_constants/resolve_usage_window_constants.py` | Endpoint, credential keys, the session ingress token env var, stage sizing, thresholds, result keys |
|
|
105
114
|
|
|
106
115
|
## Gotchas
|
|
107
116
|
|