Skip to content

Commit dac119c

Browse files
Bordaclaude
andcommitted
chore(foundry): JS hook test suites, fortify git commit rules
- Add 4 hook test suites: test_task_log_js.py (307L), test_statusline_js.py (152L), test_commit_guard_js.py (143L), test_agent_router_js.py (122L); conftest.py gains run_hook + state_dir fixtures; README.md documents test table and runner - ci-tests.yml: add Node 20 setup; JS hook tests now run in CI alongside Python bin/ tests - Fix task-log.js: replace sliding-window tool counter with fixed 30s window; add pending/ cleanup on PostToolUse(Agent); clear tools/ on UserPromptSubmit - Distill 3 bin/ Python scripts to inline prose rules across plugins: codemap/resolve_target_module.py, develop/codemap_flags.py, oss/parse-review-args.py deleted; corresponding SKILL.md files updated to apply logic directly - rules/git-commit.md: add two rules — no GitHub auto-links, no non-VCS paths in commit messages - agents/shepherd.md: upgrade model sonnet → opusplan; fix cross-ref to /oss:review skill - agents/perf-optimizer.md: correct model opusplan → opus; update py-spy to uv install form - agents/curator.md: reflect shepherd reclassification in model-tier table - agents/challenger.md: extend SKIP condition for codex re-review case - agents/solution-architect.md: note research plugin requirement in description - skills/calibrate: add --local to argument-hint; fix bare /tmp/ paths to ${TMPDIR:-/tmp} - skills/init, setup (foundry), fix (develop): fix bare /tmp/ paths to ${TMPDIR:-/tmp} - skills/judge (research): fix hardcoded <path_to_program.md> and <RUN_DIR> placeholders in J3 scientist spawn prompt --- Co-authored-by: Claude Code <noreply@anthropic.com>
1 parent 38b9182 commit dac119c

41 files changed

Lines changed: 979 additions & 836 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci-tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@ jobs:
2424
with:
2525
python-version: ${{ matrix.python-version }}
2626

27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: "20"
30+
2731
- name: Install pytest
2832
run: pip install -q pytest pytest-cov scipy
2933

30-
- name: Run plugin's bin tests
34+
- name: Run plugin tests (Python bin/ + JS hooks)
3135
env:
3236
RUN_INTEGRATION: "1"
3337
run: pytest -W error::DeprecationWarning

plugins/codemap/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
"license": "MIT",
1818
"name": "codemap",
1919
"repository": "https://github.com/Borda/AI-Rig",
20-
"version": "0.4.1"
20+
"version": "0.4.2"
2121
}

plugins/codemap/bin/resolve_target_module.py

Lines changed: 0 additions & 94 deletions
This file was deleted.

plugins/codemap/skills/integration/SKILL.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,13 @@ fi
280280

281281
For skills where target module derives from `$ARGUMENTS` (refactor, fix with module path, review), also add after `central`**derive `TARGET_MODULE` first**; without it calls run as `scan-query rdeps ""` and return nothing:
282282

283+
Derive `TARGET_MODULE` from `$ARGUMENTS`: strip leading `./`; strip leading `src/`; strip trailing `.py`; replace `/``.`. If result empty, use `Path($ARGUMENTS).stem`. Example: `src/foo/bar.py``foo.bar`.
284+
285+
If `TARGET_MODULE` non-empty, substitute derived value and run:
286+
283287
```bash
284-
# Derive TARGET_MODULE from the file/path argument (e.g. src/foo/bar.py → foo.bar)
285-
TARGET_MODULE=$(python "${CLAUDE_PLUGIN_ROOT:-plugins/codemap}/bin/resolve_target_module.py" "$ARGUMENTS") # timeout: 5000
286-
if [ -z "$TARGET_MODULE" ]; then
287-
echo "⚠ TARGET_MODULE empty — skipping rdeps/deps soft-check"
288-
else
289-
scan-query rdeps "$TARGET_MODULE" 2>/dev/null # timeout: 5000
290-
scan-query deps "$TARGET_MODULE" 2>/dev/null # timeout: 5000
291-
fi
288+
scan-query rdeps "<TARGET_MODULE>" 2>/dev/null # timeout: 5000
289+
scan-query deps "<TARGET_MODULE>" 2>/dev/null # timeout: 5000
292290
```
293291

294292
**For agent `.md` files** — append to last workflow instruction paragraph, before closing section or final notes. Agents have no `$ARGUMENTS` — derive `TARGET_MODULE` from user's input prompt:

plugins/codemap/tests/test_resolve_target_module.py

Lines changed: 0 additions & 147 deletions
This file was deleted.

plugins/develop/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"license": "MIT",
88
"name": "develop",
99
"repository": "https://github.com/Borda/AI-Rig",
10-
"version": "0.7.1"
10+
"version": "0.7.2"
1111
}

plugins/develop/bin/codemap_flags.py

Lines changed: 0 additions & 55 deletions
This file was deleted.

plugins/develop/bin/codemap_scan.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
codemap_scan.py --source=diff [--limit N]
77
88
Sources:
9-
find — enumerate ``.py`` files under ``<path>``, derive module names via codemap's
10-
``resolve_target_module`` rules.
9+
find — enumerate ``.py`` files under ``<path>``, derive module names (strip ``./``,
10+
``src/``, ``.py``; replace ``/`` → ``.``).
1111
diff — derive modules from ``git diff HEAD --name-only``; flat-layout fallback when
1212
``src/`` strip yields nothing.
1313

plugins/develop/skills/feature/SKILL.md

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -284,33 +284,9 @@ Crystallise intended API contract before any implementation. Choose form based o
284284

285285
> **Choosing demo form**: use inline doctest for simple functions/methods with minimal setup; use example script for features requiring external state, multiple steps, or side effects.
286286
287-
**Unit function / simple API** -> inline doctest:
288-
289-
```python
290-
def predict(self, x: Tensor) -> Tensor:
291-
"""
292-
>>> model = Classifier()
293-
>>> model.predict(torch.zeros(1, 3))
294-
tensor([0])
295-
"""
296-
```
297-
298-
**Complex feature** (setup required, side effects, multi-step flow) -> minimal example script:
299-
300-
```bash
301-
mkdir -p examples/
302-
```
303-
304-
```python
305-
# examples/demo_<feature>.py — throwaway script, run manually
306-
from mypackage import Classifier
307-
308-
model = Classifier.from_pretrained("tiny")
309-
result = model.predict_batch(["hello", "world"])
310-
print(result) # expected: [label, label]
311-
```
287+
**Unit function / simple API** -> inline doctest (doctest in method docstring; must fail against current code).
312288

313-
Example script captures what feature should feel like to use. Becomes formal pytest test once implementation complete and API stable (end of Step 3).
289+
**Complex feature** (setup required, side effects, multi-step flow) -> minimal example script `examples/demo_<feature>.py`; shows intended API end-to-end; becomes formal pytest test once implementation complete and API stable (end of Step 3).
314290

315291
Both forms must:
316292

0 commit comments

Comments
 (0)