claude-dev-env 8.15.0 → 8.15.1
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/.agents/agents/test_agent_frontmatter.py +0 -72
- package/.agents/agents-archived/code-quality-agent.md +16 -16
- package/.agents/skills/_shared/end-of-run-gotcha-recommendations.md +5 -21
- package/.agents/skills/e-code-review/SKILL.md +1 -3
- package/.agents/skills/e-simplify/SKILL.md +6 -6
- package/.agents/skills/eli5/SKILL.md +4 -14
- package/.agents/skills/eli5/reference/task-seeds.md +3 -4
- package/.agents/skills/everything-search/SKILL.md +2 -2
- package/.agents/skills/fresh-branch/SKILL.md +2 -3
- package/.agents/skills/grok-spawn/SKILL.md +3 -8
- package/.agents/skills/issue-tracker/SKILL.md +4 -6
- package/.agents/skills/orchestrator-refresh/SKILL.md +7 -7
- package/.agents/skills/plugin-eval-standalone-skill/SKILL.md +3 -3
- package/.agents/skills/privacy-hygiene/SKILL.md +6 -10
- package/.agents/skills/privacy-hygiene/reference/sweep-procedure.md +1 -1
- package/.agents/skills/pull-request/SKILL.md +11 -14
- package/.agents/skills/pull-request/reference/publication-tasks.md +2 -4
- package/.agents/skills/recovering-codex-startup/SKILL.md +3 -6
- package/.agents/skills/recovering-codex-startup/reference/task-seeds.md +1 -1
- package/.agents/skills/repairing-hook-boundaries/SKILL.md +4 -7
- package/.agents/skills/repairing-hook-boundaries/reference/task-seeds.md +1 -2
- package/.agents/skills/syncing-submodules/SKILL.md +7 -17
- package/.agents/skills/syncing-submodules/reference/run-tasks.md +1 -1
- package/.agents/skills/task-build/SKILL.md +1 -1
- package/.agents/skills/task-build/reference/tool-routing.md +1 -1
- package/.agents/skills/team-advisor/SKILL.md +2 -4
- package/.agents/skills/usage-pause/SKILL.md +1 -1
- package/.agents/skills/windows-scheduled-task/SKILL.md +1 -1
- package/AGENTS.md +1 -1
- package/_shared/advisor/advisor-protocol.md +4 -4
- package/_shared/advisor/reference/consult-format.md +1 -1
- package/_shared/advisor/reference/identity.md +2 -2
- package/_shared/advisor/reference/warm-up.md +1 -1
- package/audit-rubrics/category_rubrics/category-o-docstring-vs-impl-drift.md +1 -1
- package/audit-rubrics/prompts/category-o-docstring-vs-impl-drift.md +2 -16
- package/bin/install.mjs +1 -0
- package/bin/install.prompt-context.test.mjs +7 -3
- package/bin/install.test.mjs +3 -2
- package/commands/sr-loop.md +2 -2
- package/docs/CODE_RULES.md +2 -2
- package/docs/DJANGO_PATTERNS.md +3 -3
- package/docs/REACT_PATTERNS.md +6 -6
- package/docs/TEST_QUALITY.md +10 -16
- package/docs/agent-spawn-protocol.md +4 -4
- package/docs/codex-compatibility.md +4 -33
- package/docs/references/team-advisor-skill.md +0 -1
- package/docs/worker-completion-gate.md +0 -1
- package/hooks/advisory/migration_safety_advisor.py +3 -2
- package/hooks/advisory/refactor_guard.py +3 -3
- package/hooks/hooks.json +1 -1
- package/hooks/hooks_constants/issue_tracker_session_starter_constants.py +1 -2
- package/hooks/hooks_constants/orchestrator_auto_starter_constants.py +1 -2
- package/package.json +1 -1
- package/rules/explore-thoroughly.md +0 -1
- package/rules/filesystem-search.md +1 -1
- package/rules/git-workflow.md +5 -5
- package/rules/long-horizon-autonomy.md +1 -5
- package/rules/re-stage-before-commit.md +0 -2
- package/rules/shell-invocation.md +1 -1
- package/scripts/dev_env_scripts_constants/grok_worker_constants.py +8 -2
- package/scripts/policy_lint/config/constants.py +1 -0
- package/scripts/policy_lint/engine.py +5 -2
- package/scripts/repository_checks/config/constants.py +1 -1
- package/scripts/spawn_grok_batch.py +12 -1
- package/scripts/test_spawn_grok_batch.py +22 -0
- package/scripts/tests/test_banned_prose_words.py +1 -1
- package/scripts/tests/test_policy_lint_rules_archive.py +16 -0
- package/scripts/tests/test_policy_lint_rules_engine.py +2 -2
- package/scripts/tests/test_rules.py +9 -9
- package/system-prompts/software-engineer.xml +15 -30
- package/audit-rubrics/audit-categories.json +0 -700
- package/audit-rubrics/category_rubrics/category-a-api-contracts.md +0 -90
- package/audit-rubrics/category_rubrics/category-b-selector-engine-compat.md +0 -36
- package/audit-rubrics/category_rubrics/category-c-resource-cleanup.md +0 -35
- package/audit-rubrics/category_rubrics/category-d-scoping-and-ordering.md +0 -35
- package/audit-rubrics/category_rubrics/category-e-dead-code.md +0 -40
- package/audit-rubrics/category_rubrics/category-f-silent-failures.md +0 -41
- package/audit-rubrics/category_rubrics/category-g-bounds-and-overflow.md +0 -38
- package/audit-rubrics/category_rubrics/category-h-security-boundaries.md +0 -40
- package/audit-rubrics/category_rubrics/category-i-concurrency.md +0 -38
- package/audit-rubrics/category_rubrics/category-j-code-rules-compliance.md +0 -59
- package/audit-rubrics/category_rubrics/category-k-codebase-conflicts.md +0 -66
- package/audit-rubrics/category_rubrics/category-l-behavior-equivalence.md +0 -48
- package/audit-rubrics/category_rubrics/category-m-producer-consumer-cardinality.md +0 -44
- package/audit-rubrics/category_rubrics/category-n-test-name-scenario-verifier.md +0 -54
- package/audit-rubrics/category_rubrics/category-p-name-vs-behavior-contract.md +0 -59
- package/audit-rubrics/category_rubrics/category-q-cross-surface-claims.md +0 -46
- package/audit-rubrics/prompts/category-a-api-contracts.md +0 -407
- package/audit-rubrics/prompts/category-b-selector-engine-compat.md +0 -401
- package/audit-rubrics/prompts/category-c-resource-cleanup.md +0 -420
- package/audit-rubrics/prompts/category-d-scoping-and-ordering.md +0 -414
- package/audit-rubrics/prompts/category-e-dead-code.md +0 -434
- package/audit-rubrics/prompts/category-f-silent-failures.md +0 -432
- package/audit-rubrics/prompts/category-g-bounds-and-overflow.md +0 -383
- package/audit-rubrics/prompts/category-h-security-boundaries.md +0 -423
- package/audit-rubrics/prompts/category-i-concurrency.md +0 -429
- package/audit-rubrics/prompts/category-j-code-rules-compliance.md +0 -458
- package/audit-rubrics/prompts/category-k-codebase-conflicts.md +0 -338
- package/audit-rubrics/prompts/category-l-behavior-equivalence.md +0 -131
- package/audit-rubrics/prompts/category-m-producer-consumer-cardinality.md +0 -129
- package/audit-rubrics/prompts/category-n-test-name-scenario-verifier.md +0 -139
- package/audit-rubrics/prompts/category-p-name-vs-behavior-contract.md +0 -89
- package/audit-rubrics/prompts/category-q-cross-surface-claims.md +0 -51
- package/hooks/hooks_constants/style_reminder_prompt_constants.py +0 -9
- package/hooks/session/style_reminder_prompt.py +0 -55
- package/hooks/session/test_style_reminder_prompt.py +0 -86
|
@@ -36,39 +36,10 @@ The default `.claude` target uses `CODEX_HOME`. A named profile or another
|
|
|
36
36
|
target uses `<managed-root>/.codex`, so launch that profile with the same
|
|
37
37
|
`CODEX_HOME` value.
|
|
38
38
|
|
|
39
|
-
##
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
works for both, as is.
|
|
44
|
-
|
|
45
|
-
The install already points `$CODEX_HOME/hooks` at the shared hooks folder.
|
|
46
|
-
Once installed, the script sits at
|
|
47
|
-
`$CODEX_HOME/hooks/session/style_reminder_prompt.py`.
|
|
48
|
-
|
|
49
|
-
Add this by hand to `$CODEX_HOME/hooks.json` (merge it into an existing file):
|
|
50
|
-
|
|
51
|
-
```json
|
|
52
|
-
{
|
|
53
|
-
"hooks": {
|
|
54
|
-
"UserPromptSubmit": [
|
|
55
|
-
{
|
|
56
|
-
"command": "python3 $CODEX_HOME/hooks/session/style_reminder_prompt.py"
|
|
57
|
-
}
|
|
58
|
-
]
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
The package installer does not register this optional context hook. Add it by
|
|
64
|
-
hand when the host should receive that context.
|
|
65
|
-
|
|
66
|
-
## Luna fast-mode guard
|
|
67
|
-
|
|
68
|
-
Commit `0f21faf8` retired `luna_fast_mode_gate.py` with the other blocking
|
|
69
|
-
policy hooks. The package ships no replacement, so a Codex `hooks.json` needs
|
|
70
|
-
no entry for it, and the spawn tier a Luna spawn asks for is the caller's to
|
|
71
|
-
hold.
|
|
39
|
+
## Luna spawn tier
|
|
40
|
+
|
|
41
|
+
No hook gates the tier a Luna spawn asks for, so a Codex `hooks.json` needs no
|
|
42
|
+
entry for it, and the caller holds that tier.
|
|
72
43
|
|
|
73
44
|
## Roots and safety
|
|
74
45
|
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
| `.agents/skills/team-advisor/SKILL.md` | Sole-consumer bind wiring and constraints |
|
|
10
10
|
| `advisor-tool.md` | Consult timing, hard rule, how to treat advice |
|
|
11
11
|
| `~/.claude/_shared/advisor/advisor-protocol.md` | Session identity, host bind, floor, lifecycle |
|
|
12
|
-
| `agents/session-advisor.md` | ENDORSE / CORRECTION / PLAN / STOP |
|
|
13
12
|
|
|
14
13
|
## When to use
|
|
15
14
|
|
|
@@ -30,4 +30,3 @@ Mark `completed` only when every row passes.
|
|
|
30
30
|
## Relationship to other rules
|
|
31
31
|
|
|
32
32
|
- `long-horizon-autonomy` covers acting on what you have and not ending a turn on a promise. This gate names the specific completion condition: workers finished and their results merged.
|
|
33
|
-
- `skills/pr-converge/reference/state-schema.md` defines the run-state records a worker's result lands in before the task closes.
|
|
@@ -52,8 +52,9 @@ def main() -> None:
|
|
|
52
52
|
operations = ", ".join(found_unsafe)
|
|
53
53
|
advisory_message = (
|
|
54
54
|
f"MIGRATION SAFETY: Contains {operations}. "
|
|
55
|
-
"
|
|
56
|
-
"
|
|
55
|
+
"After launch, model changes stay backwards-compatible, because running "
|
|
56
|
+
"instances keep reading the old schema until the deployment finishes. "
|
|
57
|
+
"Check that this migration keeps those instances working."
|
|
57
58
|
)
|
|
58
59
|
advisory_payload = {
|
|
59
60
|
"systemMessage": advisory_message,
|
|
@@ -264,9 +264,9 @@ def build_refactor_advisory_context(refactor_description: str, file_path: str) -
|
|
|
264
264
|
"""Build guidance that names the Edit stage and changed-surface rule."""
|
|
265
265
|
return (
|
|
266
266
|
f"[HOOK ADVISORY] Refactor guard — {refactor_description} in {file_path}. "
|
|
267
|
-
"Edit-stage guidance:
|
|
268
|
-
"
|
|
269
|
-
"
|
|
267
|
+
"Edit-stage guidance: This edit went through, and it changes lines outside the "
|
|
268
|
+
"current git diff. Keep further edits to lines the task already changes, and ask "
|
|
269
|
+
"the user before refactoring code outside them."
|
|
270
270
|
)
|
|
271
271
|
|
|
272
272
|
|
package/hooks/hooks.json
CHANGED
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"hooks": [
|
|
70
70
|
{
|
|
71
71
|
"type": "command",
|
|
72
|
-
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/session/
|
|
72
|
+
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/session/skill_loaded_reminder.py",
|
|
73
73
|
"timeout": 10
|
|
74
74
|
}
|
|
75
75
|
]
|
|
@@ -18,6 +18,5 @@ ISSUE_TRACKER_STARTER_TIMEOUT_MILLISECONDS: int = 50
|
|
|
18
18
|
ISSUE_TRACKER_SESSION_START_DIRECTIVE: str = (
|
|
19
19
|
"SessionStart issue-tracker opt-in is active for this registered repository. "
|
|
20
20
|
"Load the issue-tracker skill when the session needs one GitHub issue action "
|
|
21
|
-
"(open epic, file sub-issue, update status, refresh checklist, close sub-issue).
|
|
22
|
-
"Manual issue-tracker agent spawn remains available unchanged."
|
|
21
|
+
"(open epic, file sub-issue, update status, refresh checklist, close sub-issue)."
|
|
23
22
|
)
|
|
@@ -18,6 +18,5 @@ ORCHESTRATOR_STARTER_TIMEOUT_MILLISECONDS: int = 50
|
|
|
18
18
|
ORCHESTRATOR_SESSION_START_DIRECTIVE: str = (
|
|
19
19
|
"SessionStart orchestrator opt-in is active. Load the orchestrator skill "
|
|
20
20
|
"and run in executor-advisor mode for this session's multi-step work. "
|
|
21
|
-
"Do not invent a second orchestrator path; follow the skill.
|
|
22
|
-
"/orchestrator remains available unchanged."
|
|
21
|
+
"Do not invent a second orchestrator path; follow the skill."
|
|
23
22
|
)
|
package/package.json
CHANGED
|
@@ -9,7 +9,6 @@ Note: This deliberately chooses exploration depth over the "commit and execute q
|
|
|
9
9
|
- Read the relevant files. Understand what exists before proposing what to change.
|
|
10
10
|
- Map the existing patterns: naming conventions, file organization, architectural decisions.
|
|
11
11
|
- Identify constraints that could invalidate an approach before investing effort in it.
|
|
12
|
-
- For unfamiliar codebases or high-stakes changes, invest more time exploring than feels necessary.
|
|
13
12
|
|
|
14
13
|
## Exploration scales with risk
|
|
15
14
|
|
|
@@ -47,5 +47,5 @@ Issue one shell search at a time when the walk is large. Parallel full-tree sear
|
|
|
47
47
|
|
|
48
48
|
## Search controls
|
|
49
49
|
|
|
50
|
-
- No hook denies a walk from an unscoped root.
|
|
50
|
+
- No hook denies a walk from an unscoped root. The scope invariant above is guidance a reader follows.
|
|
51
51
|
- For Everything searches that use a project name, run `python "${CLAUDE_SKILL_DIR}/scripts/everything_search.py" <project-name> <search arguments>`. An exact project name becomes its path from `~/.claude/project-paths.json`. The command then starts `es.exe` without a shell. `scripts/setup_project_paths.py` writes the registry.
|
package/rules/git-workflow.md
CHANGED
|
@@ -15,7 +15,7 @@ User-level rule: applies to **every** git repo that uses GitHub with `gh`. Small
|
|
|
15
15
|
|
|
16
16
|
## Pull request submission rules
|
|
17
17
|
|
|
18
|
-
**
|
|
18
|
+
**Create every pull request as a draft.** Use `gh pr create --draft`.
|
|
19
19
|
|
|
20
20
|
**A release bot's PR body is machine input. Leave it alone.** Release automation reads
|
|
21
21
|
back the body of its own merged pull request to decide it owns that merge. Rewriting the
|
|
@@ -47,7 +47,7 @@ untouched.
|
|
|
47
47
|
|
|
48
48
|
## Git golden rules
|
|
49
49
|
|
|
50
|
-
1. **
|
|
50
|
+
1. **Draft before push.** Put a pull request in draft state before you push to it.
|
|
51
51
|
- Before push: `gh pr ready --undo`
|
|
52
52
|
- After review approved: `gh pr ready`
|
|
53
53
|
|
|
@@ -101,7 +101,7 @@ before you ask anyone to read or merge it.
|
|
|
101
101
|
|
|
102
102
|
## Never commit working documents or images
|
|
103
103
|
|
|
104
|
-
**
|
|
104
|
+
**Keep these files out of the repository:**
|
|
105
105
|
|
|
106
106
|
| Pattern | Reason |
|
|
107
107
|
|---------|--------|
|
|
@@ -117,10 +117,10 @@ An image a PR needs as visual evidence is not an exception to that row. Upload i
|
|
|
117
117
|
**When this applies:** GitHub PR review feedback on a branch you are fixing.
|
|
118
118
|
|
|
119
119
|
1. Fetch every reviewer comment before making any fix.
|
|
120
|
-
2. Create a
|
|
120
|
+
2. Create a checklist in the session's task tool with one item per comment.
|
|
121
121
|
3. Fix systematically, marking each todo complete.
|
|
122
122
|
4. Reply to each comment inline.
|
|
123
123
|
|
|
124
|
-
Repair only reported findings
|
|
124
|
+
Repair only the reported findings.
|
|
125
125
|
|
|
126
126
|
Every `gh` post in this workflow uses `--body-file` per `gh-cli-conventions.md` and keeps volatile scratch paths out per `durable-post-artifacts.md`. Stage session edits per `re-stage-before-commit.md` before each commit.
|
|
@@ -35,11 +35,7 @@ Authority the task already granted stays granted. A later preference about tone,
|
|
|
35
35
|
|
|
36
36
|
## Delegate and keep working
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
## Verify your work at intervals
|
|
41
|
-
|
|
42
|
-
On a long build, set a checkpoint cadence and hold to it. At each interval, check the work so far against the task's stated goals with a fresh-context verifier subagent. A separate verifier in a clean context catches what self-review misses.
|
|
38
|
+
Delegate a large, independent track to a subagent, and keep working while it runs in the background. Do work you can finish in a few tool calls yourself: a few reads, a handful of edits, or a simple check. Reuse a long-lived subagent across related subtasks so its context carries forward and saves repeated reads. Step in when a subagent drifts off track or is missing context.
|
|
43
39
|
|
|
44
40
|
## Ground every progress claim
|
|
45
41
|
|
|
@@ -12,5 +12,3 @@ Staging covers tracked files you edited. Do not commit untracked files unless th
|
|
|
12
12
|
- **A preceding `git add` or `git stage`.** `git add <paths> && git commit …` stages the files in its own segment before the commit runs.
|
|
13
13
|
|
|
14
14
|
A `--amend` carries the same risk. An amend records the staged snapshot too, so an unstaged session edit is dropped the same way a plain commit drops it.
|
|
15
|
-
|
|
16
|
-
`session_file_edit_tracker` (PostToolUse) still records each Write/Edit/MultiEdit path, and `session_edit_tracker_cleanup` (SessionStart, SessionEnd) still clears the session's tracker. No gate reads that record today, so it serves as history rather than a precondition.
|
|
@@ -18,7 +18,7 @@ When a script file's literal body needs `$(...)`, author it with the Write tool,
|
|
|
18
18
|
|
|
19
19
|
## Enforcement
|
|
20
20
|
|
|
21
|
-
No PreToolUse hook denies a Bash command.
|
|
21
|
+
No PreToolUse hook denies a Bash command. The substitution constraint above is guidance a reader follows, and a permission prompt on a wrapped command is the signal that one slipped through.
|
|
22
22
|
|
|
23
23
|
One PreToolUse hook does run on a Bash command, and it only rewrites. `blocking/msys_rev_path_rewriter.py` (PreToolUse on Bash, hosted by `bash_pre_tool_use_dispatcher`) reads a git command before it runs and keeps Git Bash from converting a `<rev>:<path>` argument. That roster holds this one hook, and a test asserts its whole content, so a blocking hook added beside it fails the suite.
|
|
24
24
|
|
|
@@ -616,9 +616,15 @@ ADVISOR_CLI_RESUME_FLAG: str = "--resume"
|
|
|
616
616
|
ADVISOR_BIND_PROMPT_TEMPLATE: str = (
|
|
617
617
|
"You are the unique worker advisor for role {role_name}. "
|
|
618
618
|
"Answer only. Open with exactly one of: ENDORSE | CORRECTION | PLAN | STOP. "
|
|
619
|
-
"Pre-dispatch:
|
|
619
|
+
"Pre-dispatch consult: the full worker assignment follows. "
|
|
620
|
+
"Hunt for missing requirements, wrong assumptions, unsafe actions, and unclear "
|
|
621
|
+
"completion criteria. ENDORSE when the worker can start as written; "
|
|
622
|
+
"otherwise open with CORRECTION, PLAN, or STOP and name the fix.\n"
|
|
623
|
+
"(Advisor: please keep your guidance under 80 words, I need a focused "
|
|
624
|
+
"starting point.)\n\n"
|
|
625
|
+
"Worker assignment:\n{assignment_text}"
|
|
620
626
|
)
|
|
621
|
-
"""Prompt body
|
|
627
|
+
"""Prompt body for the pre-dispatch advisor consult; carries the assembled worker prompt."""
|
|
622
628
|
|
|
623
629
|
ADVISOR_VERDICT_PROMPT_TEMPLATE: str = (
|
|
624
630
|
"You are the unique worker advisor for role {role_name}, session {session_id}. "
|
|
@@ -7,6 +7,7 @@ UTF8_ENCODING = "utf-8"
|
|
|
7
7
|
PATH_SEPARATOR = "/"
|
|
8
8
|
ARCHIVED_SKILLS_DIRECTORY_NAME = "skill-archive"
|
|
9
9
|
ARCHIVED_HOOKS_DIRECTORY_NAME = "hooks-archived"
|
|
10
|
+
ARCHIVED_AUDIT_RUBRICS_DIRECTORY_NAME = "audit-rubrics-archived"
|
|
10
11
|
NUL_BYTE = b"\0"
|
|
11
12
|
ALL_GIT_ROOT_ARGUMENTS = ("rev-parse", "--show-toplevel")
|
|
12
13
|
ALL_GIT_HEAD_ARGUMENTS = ("rev-parse", "--verify", "HEAD")
|
|
@@ -4,6 +4,7 @@ from collections.abc import Iterable, Sequence
|
|
|
4
4
|
from pathlib import Path, PurePosixPath
|
|
5
5
|
|
|
6
6
|
from .config.constants import (
|
|
7
|
+
ARCHIVED_AUDIT_RUBRICS_DIRECTORY_NAME,
|
|
7
8
|
ARCHIVED_HOOKS_DIRECTORY_NAME,
|
|
8
9
|
ARCHIVED_SKILLS_DIRECTORY_NAME,
|
|
9
10
|
)
|
|
@@ -30,7 +31,8 @@ def lint(
|
|
|
30
31
|
"""Run the selected rules on one source selection.
|
|
31
32
|
|
|
32
33
|
Repository and diff selections check active code. File and editor
|
|
33
|
-
selections include archived skills and archived
|
|
34
|
+
selections include archived skills, archived hooks, and archived
|
|
35
|
+
audit rubrics.
|
|
34
36
|
|
|
35
37
|
Args:
|
|
36
38
|
request: Repository root, source, and rule sets.
|
|
@@ -61,6 +63,7 @@ def _is_runtime_path(path: PurePosixPath) -> bool:
|
|
|
61
63
|
return (
|
|
62
64
|
path.parts[0] != ARCHIVED_SKILLS_DIRECTORY_NAME
|
|
63
65
|
and ARCHIVED_HOOKS_DIRECTORY_NAME not in path.parts
|
|
66
|
+
and ARCHIVED_AUDIT_RUBRICS_DIRECTORY_NAME not in path.parts
|
|
64
67
|
)
|
|
65
68
|
|
|
66
69
|
|
|
@@ -252,7 +255,7 @@ def _scoped_diagnostics(
|
|
|
252
255
|
all_diagnostics: Iterable[Diagnostic],
|
|
253
256
|
document: Document,
|
|
254
257
|
) -> tuple[Diagnostic, ...]:
|
|
255
|
-
if document.changed_lines is None
|
|
258
|
+
if document.changed_lines is None:
|
|
256
259
|
return tuple(all_diagnostics)
|
|
257
260
|
return tuple(
|
|
258
261
|
each_diagnostic
|
|
@@ -118,7 +118,7 @@ ALL_TRACKED_SECRET_EXACT_EXEMPTIONS: frozenset[tuple[str, str, str]] = frozenset
|
|
|
118
118
|
"f9e409c5c16ecfdd5883da4f3ad045b4af5677740c9e703ad2d47ba231718350",
|
|
119
119
|
),
|
|
120
120
|
(
|
|
121
|
-
"packages/claude-dev-env/audit-rubrics/prompts/category-n-test-name-scenario-verifier.md",
|
|
121
|
+
"packages/claude-dev-env/audit-rubrics-archived/prompts/category-n-test-name-scenario-verifier.md",
|
|
122
122
|
"home-path",
|
|
123
123
|
"6b98ff7f0398f06452f19c4a93f3d69186401dab40aaa7077b394ef59b3e730e",
|
|
124
124
|
),
|
|
@@ -290,6 +290,7 @@ def bind_unique_worker_advisor(
|
|
|
290
290
|
*,
|
|
291
291
|
advisor_spec: AdvisorSpec,
|
|
292
292
|
role_name: str,
|
|
293
|
+
assignment_text: str,
|
|
293
294
|
all_used_session_ids: set[str],
|
|
294
295
|
) -> tuple[str, str]:
|
|
295
296
|
"""Bind one unique advisor session for a worker; refuse duplicates and sentinels.
|
|
@@ -303,6 +304,7 @@ def bind_unique_worker_advisor(
|
|
|
303
304
|
Args:
|
|
304
305
|
advisor_spec: Lead-supplied launcher/model/effort.
|
|
305
306
|
role_name: Worker role used in the bind prompt.
|
|
307
|
+
assignment_text: Assembled worker prompt the advisor reviews before dispatch.
|
|
306
308
|
all_used_session_ids: Sessions already issued in this batch.
|
|
307
309
|
|
|
308
310
|
Returns:
|
|
@@ -317,7 +319,9 @@ def bind_unique_worker_advisor(
|
|
|
317
319
|
)
|
|
318
320
|
if advisor_spec.launcher == PENDING_BIND_SENTINEL:
|
|
319
321
|
raise ValueError(f"advisor.launcher is {PENDING_BIND_SENTINEL}")
|
|
320
|
-
prompt_text = ADVISOR_BIND_PROMPT_TEMPLATE.format(
|
|
322
|
+
prompt_text = ADVISOR_BIND_PROMPT_TEMPLATE.format(
|
|
323
|
+
role_name=role_name, assignment_text=assignment_text
|
|
324
|
+
)
|
|
321
325
|
session_id, advisor_body_text, returncode = batch_invoke_advisor(
|
|
322
326
|
launcher=advisor_spec.launcher,
|
|
323
327
|
model=advisor_spec.model,
|
|
@@ -898,6 +902,7 @@ def _bind_worker_advisor_session(
|
|
|
898
902
|
*,
|
|
899
903
|
advisor_spec: AdvisorSpec,
|
|
900
904
|
role_name: str,
|
|
905
|
+
assignment_text: str,
|
|
901
906
|
all_used_session_ids: set[str],
|
|
902
907
|
session_id_lock: object | None,
|
|
903
908
|
) -> tuple[str, str]:
|
|
@@ -906,11 +911,13 @@ def _bind_worker_advisor_session(
|
|
|
906
911
|
return bind_unique_worker_advisor(
|
|
907
912
|
advisor_spec=advisor_spec,
|
|
908
913
|
role_name=role_name,
|
|
914
|
+
assignment_text=assignment_text,
|
|
909
915
|
all_used_session_ids=all_used_session_ids,
|
|
910
916
|
)
|
|
911
917
|
return bind_unique_worker_advisor(
|
|
912
918
|
advisor_spec=advisor_spec,
|
|
913
919
|
role_name=role_name,
|
|
920
|
+
assignment_text=assignment_text,
|
|
914
921
|
all_used_session_ids=all_used_session_ids,
|
|
915
922
|
)
|
|
916
923
|
|
|
@@ -990,6 +997,10 @@ def _maybe_bind_advisor_for_worker(
|
|
|
990
997
|
advisor_session_id, pre_signal = _bind_worker_advisor_session(
|
|
991
998
|
advisor_spec=advisor_spec,
|
|
992
999
|
role_name=worker_spec.role_name,
|
|
1000
|
+
assignment_text=assemble_worker_prompt(
|
|
1001
|
+
all_prompt_part_paths=worker_spec.all_prompt_part_paths,
|
|
1002
|
+
tool_profile=worker_spec.tool_profile,
|
|
1003
|
+
),
|
|
993
1004
|
all_used_session_ids=used_ids,
|
|
994
1005
|
session_id_lock=session_id_lock,
|
|
995
1006
|
)
|
|
@@ -1514,6 +1514,7 @@ def test_bind_unique_worker_advisor_rejects_placeholder(
|
|
|
1514
1514
|
batch.bind_unique_worker_advisor(
|
|
1515
1515
|
advisor_spec=batch.AdvisorSpec(launcher=batch.DEFAULT_ADVISOR_LAUNCHER_PLACEHOLDER),
|
|
1516
1516
|
role_name="lens",
|
|
1517
|
+
assignment_text="assignment",
|
|
1517
1518
|
all_used_session_ids=set(),
|
|
1518
1519
|
)
|
|
1519
1520
|
|
|
@@ -1528,12 +1529,33 @@ def test_bind_unique_worker_advisor_returns_session(
|
|
|
1528
1529
|
session_id, signal = batch.bind_unique_worker_advisor(
|
|
1529
1530
|
advisor_spec=batch.AdvisorSpec(launcher="fixture-advisor-launcher"),
|
|
1530
1531
|
role_name="lens",
|
|
1532
|
+
assignment_text="assignment",
|
|
1531
1533
|
all_used_session_ids=set(),
|
|
1532
1534
|
)
|
|
1533
1535
|
assert session_id == "sess-unique-1"
|
|
1534
1536
|
assert signal == "ENDORSE"
|
|
1535
1537
|
|
|
1536
1538
|
|
|
1539
|
+
def test_bind_unique_worker_advisor_prompt_carries_assignment_text(
|
|
1540
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
1541
|
+
) -> None:
|
|
1542
|
+
all_captured_prompts: list[object] = []
|
|
1543
|
+
|
|
1544
|
+
def fake(**kwargs: object) -> tuple[str | None, str, int]:
|
|
1545
|
+
all_captured_prompts.append(kwargs["prompt_text"])
|
|
1546
|
+
return "sess-assignment-1", "ENDORSE\nok", 0
|
|
1547
|
+
|
|
1548
|
+
monkeypatch.setattr(batch, "batch_invoke_advisor", fake)
|
|
1549
|
+
batch.bind_unique_worker_advisor(
|
|
1550
|
+
advisor_spec=batch.AdvisorSpec(launcher="fixture-advisor-launcher"),
|
|
1551
|
+
role_name="lens",
|
|
1552
|
+
assignment_text="Audit module alpha for unused imports.",
|
|
1553
|
+
all_used_session_ids=set(),
|
|
1554
|
+
)
|
|
1555
|
+
assert len(all_captured_prompts) == 1
|
|
1556
|
+
assert "Audit module alpha for unused imports." in str(all_captured_prompts[0])
|
|
1557
|
+
|
|
1558
|
+
|
|
1537
1559
|
def test_obtain_advisor_completion_verdict_endorses(
|
|
1538
1560
|
monkeypatch: pytest.MonkeyPatch,
|
|
1539
1561
|
) -> None:
|
|
@@ -86,7 +86,7 @@ def test_governed_paths_lists_the_shipped_surfaces(tmp_path: Path) -> None:
|
|
|
86
86
|
def test_governed_paths_cover_instruction_surfaces_and_skip_archives() -> None:
|
|
87
87
|
assert governs_path("rules/git-workflow.md")
|
|
88
88
|
assert governs_path(".agents/skills/eli5/SKILL.md")
|
|
89
|
-
assert governs_path("audit-rubrics/prompts/category-
|
|
89
|
+
assert governs_path("audit-rubrics/prompts/category-o-docstring-vs-impl-drift.md")
|
|
90
90
|
assert governs_path("system-prompts/software-engineer.xml")
|
|
91
91
|
assert not governs_path("rules-archived/manifest.md")
|
|
92
92
|
assert not governs_path("scripts/banned_prose_words.py")
|
|
@@ -134,3 +134,19 @@ def test_archived_hook_moves_leave_the_automatic_checks(tmp_path: Path) -> None:
|
|
|
134
134
|
assert runtime_set.documents == ()
|
|
135
135
|
assert runtime_set.deleted_paths == (live_hook_path,)
|
|
136
136
|
assert runtime_set.renamed_paths == ()
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def test_archived_audit_rubric_moves_leave_the_automatic_checks(tmp_path: Path) -> None:
|
|
140
|
+
live_rubric_path = PurePosixPath("packages/tool/audit-rubrics/prompts/category-k.md")
|
|
141
|
+
archived_rubric_path = PurePosixPath("packages/tool/audit-rubrics-archived/prompts/category-k.md")
|
|
142
|
+
document_set = DocumentSet(
|
|
143
|
+
(Document.from_text(archived_rubric_path, "archived"),),
|
|
144
|
+
SelectionKind.BASE,
|
|
145
|
+
tmp_path,
|
|
146
|
+
(),
|
|
147
|
+
((live_rubric_path, archived_rubric_path),),
|
|
148
|
+
)
|
|
149
|
+
runtime_set = _runtime_document_set(document_set)
|
|
150
|
+
assert runtime_set.documents == ()
|
|
151
|
+
assert runtime_set.deleted_paths == (live_rubric_path,)
|
|
152
|
+
assert runtime_set.renamed_paths == ()
|
|
@@ -209,7 +209,7 @@ def test_changed_line_filter_drops_other_located_line(tmp_path: Path) -> None:
|
|
|
209
209
|
assert lint_report.diagnostics == ()
|
|
210
210
|
|
|
211
211
|
|
|
212
|
-
def
|
|
212
|
+
def test_lint_drops_located_findings_when_a_change_only_deletes_lines(
|
|
213
213
|
tmp_path: Path,
|
|
214
214
|
) -> None:
|
|
215
215
|
repository_root = tmp_path.resolve()
|
|
@@ -233,7 +233,7 @@ def test_lint_keeps_located_findings_when_changed_lines_are_empty(
|
|
|
233
233
|
(document,),
|
|
234
234
|
(_changed_document_rule("probe", collect_diagnostics),),
|
|
235
235
|
)
|
|
236
|
-
assert
|
|
236
|
+
assert lint_report.diagnostics == ()
|
|
237
237
|
|
|
238
238
|
|
|
239
239
|
def test_code_rule_diagnostics_includes_comment_policy_without_prior_text(
|
|
@@ -25,10 +25,10 @@ def _comment_policy_surfaces(package_root: Path) -> tuple[Path, ...]:
|
|
|
25
25
|
package_root / "system-prompts" / "software-engineer.xml",
|
|
26
26
|
package_root / ".agents" / "agents-archived" / "clean-coder.md",
|
|
27
27
|
package_root / ".agents" / "agents-archived" / "code-quality-agent.md",
|
|
28
|
-
package_root / "audit-rubrics" / "category_rubrics" / "category-j-code-rules-compliance.md",
|
|
29
|
-
package_root / "audit-rubrics" / "prompts" / "category-j-code-rules-compliance.md",
|
|
30
|
-
package_root / "audit-rubrics" / "category_rubrics" / "category-l-behavior-equivalence.md",
|
|
31
|
-
package_root / "audit-rubrics" / "prompts" / "category-l-behavior-equivalence.md",
|
|
28
|
+
package_root / "audit-rubrics-archived" / "category_rubrics" / "category-j-code-rules-compliance.md",
|
|
29
|
+
package_root / "audit-rubrics-archived" / "prompts" / "category-j-code-rules-compliance.md",
|
|
30
|
+
package_root / "audit-rubrics-archived" / "category_rubrics" / "category-l-behavior-equivalence.md",
|
|
31
|
+
package_root / "audit-rubrics-archived" / "prompts" / "category-l-behavior-equivalence.md",
|
|
32
32
|
package_root / ".agents" / "skills" / "grok-spawn" / "reference" / "worker-briefs.md",
|
|
33
33
|
package_root.parent.parent / ".github" / "copilot-instructions.md",
|
|
34
34
|
)
|
|
@@ -96,17 +96,17 @@ def test_comment_guidance_reaches_installed_instruction_surfaces() -> None:
|
|
|
96
96
|
def _category_l_policy_texts() -> tuple[str, str, str]:
|
|
97
97
|
category_l_rubric = (
|
|
98
98
|
_PACKAGE_ROOT
|
|
99
|
-
/ "audit-rubrics"
|
|
99
|
+
/ "audit-rubrics-archived"
|
|
100
100
|
/ "category_rubrics"
|
|
101
101
|
/ "category-l-behavior-equivalence.md"
|
|
102
102
|
)
|
|
103
103
|
category_l_prompt = (
|
|
104
104
|
_PACKAGE_ROOT
|
|
105
|
-
/ "audit-rubrics"
|
|
105
|
+
/ "audit-rubrics-archived"
|
|
106
106
|
/ "prompts"
|
|
107
107
|
/ "category-l-behavior-equivalence.md"
|
|
108
108
|
)
|
|
109
|
-
audit_categories = _PACKAGE_ROOT / "audit-rubrics" / "audit-categories.json"
|
|
109
|
+
audit_categories = _PACKAGE_ROOT / "audit-rubrics-archived" / "audit-categories.json"
|
|
110
110
|
return tuple(
|
|
111
111
|
each_path.read_text(encoding="utf-8").lower()
|
|
112
112
|
for each_path in (category_l_rubric, category_l_prompt, audit_categories)
|
|
@@ -117,7 +117,7 @@ def _comment_policy_summary_texts() -> tuple[str, str, str]:
|
|
|
117
117
|
clean_coder = _PACKAGE_ROOT / ".agents" / "agents-archived" / "clean-coder.md"
|
|
118
118
|
category_j = (
|
|
119
119
|
_PACKAGE_ROOT
|
|
120
|
-
/ "audit-rubrics"
|
|
120
|
+
/ "audit-rubrics-archived"
|
|
121
121
|
/ "category_rubrics"
|
|
122
122
|
/ "category-j-code-rules-compliance.md"
|
|
123
123
|
)
|
|
@@ -145,7 +145,7 @@ def test_comment_policy_removes_directive_justification_guidance() -> None:
|
|
|
145
145
|
).read_text(encoding="utf-8").lower()
|
|
146
146
|
category_e_prompt = (
|
|
147
147
|
_PACKAGE_ROOT
|
|
148
|
-
/ "audit-rubrics"
|
|
148
|
+
/ "audit-rubrics-archived"
|
|
149
149
|
/ "prompts"
|
|
150
150
|
/ "category-e-dead-code.md"
|
|
151
151
|
).read_text(encoding="utf-8").lower()
|
|
@@ -67,17 +67,7 @@
|
|
|
67
67
|
Reserve user questions for preferences, missing context the user holds, judgment calls, and
|
|
68
68
|
scope decisions.
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
— "I lack data on this" — when a credible source for a claim is absent; guessing and
|
|
72
|
-
inferring are replaced by honest acknowledgment. Second, every recommendation, claim, or piece of advice cites a
|
|
73
|
-
specific source: a file in the current project, an external URL found via web search, a
|
|
74
|
-
named expert or paper, or official documentation. Third, when working from documents, extract
|
|
75
|
-
the text first before analyzing — ground responses in direct quotes, and reference
|
|
76
|
-
the quote when making a point.
|
|
77
|
-
|
|
78
|
-
Creative thinking, brainstorming, and novel ideas are exempt from citation requirements;
|
|
79
|
-
synthesizing across sources to reach new conclusions is encouraged provided the inputs are
|
|
80
|
-
grounded.
|
|
70
|
+
Source every claim as rules/research-mode.md describes.
|
|
81
71
|
</investigation>
|
|
82
72
|
|
|
83
73
|
<problem_solving>
|
|
@@ -145,8 +135,8 @@
|
|
|
145
135
|
</code_quality>
|
|
146
136
|
|
|
147
137
|
<behavior_protocol>
|
|
148
|
-
Apply an outside-in BDD reasoning protocol before writing any code.
|
|
149
|
-
|
|
138
|
+
Apply an outside-in BDD reasoning protocol before writing any code. BDD is the outer
|
|
139
|
+
process, and red-green-refactor is the inner loop for each formulated behavior. The
|
|
150
140
|
full anti-pattern catalog, Example Mapping algorithm, and solo-developer guidance live in
|
|
151
141
|
the long-form BDD references (`~/.claude/docs/BDD_DISCOVERY_PROTOCOL.md`,
|
|
152
142
|
`~/.claude/docs/BDD_SCENARIO_QUALITY.md`); this section carries the core four-phase sequence.
|
|
@@ -178,9 +168,9 @@
|
|
|
178
168
|
where untrusted data enters the system. Trust internal code and framework guarantees within
|
|
179
169
|
those boundaries; internal call sites operate on data already validated at the entry point.
|
|
180
170
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
171
|
+
Add an abstraction at the commit that introduces its second concrete implementation, the
|
|
172
|
+
house setting in rules/code-standards.md. Implement precisely what the task requires at its
|
|
173
|
+
current scale and
|
|
184
174
|
complete it fully.
|
|
185
175
|
|
|
186
176
|
Apply backwards compatibility conventions — underscore-prefixed variable renaming, type
|
|
@@ -216,11 +206,6 @@
|
|
|
216
206
|
success looks like; and that the task is unambiguous enough to delegate. When any of those
|
|
217
207
|
is unknown, investigate first using Read, Glob, or Grep for code search — or ask the user.
|
|
218
208
|
|
|
219
|
-
After confirming context, use the /prompt-generator skill to produce a structured prompt.
|
|
220
|
-
Feed it the task description and goal, target files and directories, constraints and
|
|
221
|
-
boundaries, expected output format, and acceptance criteria. Pass the skill's output as the
|
|
222
|
-
agent's prompt parameter.
|
|
223
|
-
|
|
224
209
|
When multiple tool calls are mutually independent, make all calls in a single response.
|
|
225
210
|
Sequence calls only when a later call requires an earlier call's result. Reading three files:
|
|
226
211
|
call all three Read operations at once. Running independent searches: launch all Grep
|
|
@@ -234,7 +219,7 @@
|
|
|
234
219
|
Fetch all reviewer comments before making any fixes. Obtain the full comment set from the
|
|
235
220
|
PR using `gh pr view --comments`.
|
|
236
221
|
|
|
237
|
-
Create a
|
|
222
|
+
Create a checklist in the session's task tool with one item per comment.
|
|
238
223
|
|
|
239
224
|
Fix comments systematically, marking each todo complete as it is resolved.
|
|
240
225
|
|
|
@@ -262,8 +247,9 @@
|
|
|
262
247
|
</documentation>
|
|
263
248
|
|
|
264
249
|
<context7>
|
|
265
|
-
|
|
266
|
-
|
|
250
|
+
When the Context7 MCP server is connected, fetch current documentation before you write code
|
|
251
|
+
against a library, framework, SDK, or API whose interface you have not checked this session.
|
|
252
|
+
Training data may be stale; fetched docs are
|
|
267
253
|
authoritative. Apply this to setup questions, API references, version migration,
|
|
268
254
|
library-specific debugging, and CLI tool usage — including well-known libraries such as
|
|
269
255
|
React, Next.js, Prisma, Express, Django, and Spring Boot.
|
|
@@ -277,8 +263,9 @@
|
|
|
277
263
|
</context7>
|
|
278
264
|
|
|
279
265
|
<obsidian_vault>
|
|
280
|
-
|
|
281
|
-
research documents typically live there across projects).
|
|
266
|
+
When an Obsidian MCP server is connected, use the vault path configured for your workspace
|
|
267
|
+
(session reports, decisions, and research documents typically live there across projects).
|
|
268
|
+
Search it before starting substantive project work.
|
|
282
269
|
|
|
283
270
|
Available MCP tools:
|
|
284
271
|
- mcp__obsidian__search_notes — search by content or frontmatter (searchFrontmatter: true)
|
|
@@ -356,7 +343,7 @@
|
|
|
356
343
|
|
|
357
344
|
Reserve Bash for system commands and terminal operations that require shell execution.
|
|
358
345
|
|
|
359
|
-
Track work with
|
|
346
|
+
Track work with the session's task tool and mark each task complete as soon as it is finished.
|
|
360
347
|
</tool_usage>
|
|
361
348
|
|
|
362
349
|
<cleanup>
|
|
@@ -375,9 +362,7 @@
|
|
|
375
362
|
<communication_contract>
|
|
376
363
|
Visible output is concise by default. The first progress update is one sentence.
|
|
377
364
|
Later updates mark only important discoveries or direction changes. The final
|
|
378
|
-
response begins with the outcome.
|
|
379
|
-
natural-language sentence before a tool call that needs context, state when no
|
|
380
|
-
fitting tool exists, and never emit internal-system XML in visible output.
|
|
365
|
+
response begins with the outcome.
|
|
381
366
|
Language policy: rules/asd-ste100-language.md. This section owns visible progress,
|
|
382
367
|
tool narration, and outcome-first final structure.
|
|
383
368
|
</communication_contract>
|