Repository navigation
Expand file tree
/
Copy pathJustfile
More file actions
823 lines (745 loc) · 39.2 KB
/
Copy pathJustfile
File metadata and controls
823 lines (745 loc) · 39.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# The default task
default: help
# Show available tasks
help:
@just --list
# Install required dev tools (using cargo-binstall for speed if available, otherwise fallback)
setup:
@echo "Installing cargo-binstall..."
cargo install cargo-binstall
@echo "Installing dev tools..."
cargo binstall cargo-nextest cargo-deny bacon typos-cli lefthook mlc -y
@echo "Installing PyYAML (skills-release-wiring check)..."
python3 -m pip install --user pyyaml
@echo "Installing git hooks..."
lefthook install
# Format all Rust code
fmt:
cargo fmt --all
# Lint all Rust code with Clippy
lint:
cargo clippy --workspace --all-targets --all-features -- -D warnings
# Run all tests using nextest (faster than cargo test)
test:
cargo nextest run --workspace
# Run tests in the background (using bacon)
watch-test:
bacon nextest
# Check dependencies for vulnerabilities, licenses, and bans
deny:
cargo deny check
# Check for spelling mistakes
spellcheck:
typos
# Check local markdown links for breakage.
# Offline (no web requests: fast and hermetic for a push hook) and limited to
# our own docs. Vendored trees are listed explicitly because mlc's --gitignore
# does not filter them on Windows (mlc 1.2.2); extend the list when a new
# node_modules/ or build-output dir appears. docs/site is the page template: its
# links to api/index.html and USER_GUIDE.pdf resolve only in the staged tree,
# which scripts/stage-site.sh checks.
links:
mlc --offline --ignore-path "./node_modules,./opencode/plugins/re-ghidra-mcp-opencode/node_modules,./opencode/plugins/opencode-ctl-mcp-opencode/node_modules,./opencode/plugins/repo-tasks-mcp-opencode/node_modules,./opencode/plugins/rtk-mcp-opencode/node_modules,./opencode/plugins/todov2-opencode/node_modules,./target,./docs/site,./.clavity"
# Verify plugin configs point at binaries this workspace actually builds.
# Nothing else checks those strings: rename a [[bin]] and every test still
# passes while the installed plugin silently does nothing.
wiring:
bash scripts/check-plugin-wiring.sh
# Verify the root marketplace manifest still matches the plugins it publishes.
# Every field in it is a copy of something owned elsewhere, and a stale copy
# installs happily while advertising — or fetching — the wrong thing.
marketplace:
bash scripts/check-marketplace.sh
# Verify the Qwen marketplace manifest still matches the extensions it publishes.
qwen-marketplace:
bash scripts/check-qwen-marketplace.sh
# Verify the Antigravity marketplace manifest still matches the plugins it publishes.
agy-marketplace:
bash scripts/check-agy-marketplace.sh
# Regenerate the host marketplace manifests from the plugin manifests.
# CI runs --check: committed copies must match, so a stale copy fails
# the same way a stale footprint does.
gen-marketplaces:
bash scripts/gen-marketplaces.sh
# Verify opencode/plugins/ plugin configs, ids, and skill copies.
opencode-wiring:
bash scripts/check-opencode-wiring.sh
# Move the @opencode/plugin pin in every OpenCode plugin and its README/INSTALL claims at once.
# Dependabot cannot do this (it only edits package.json); see scripts/bump-opencode-plugin.sh.
bump-opencode-plugin VERSION:
bash scripts/bump-opencode-plugin.sh {{VERSION}}
# Self-test of the bump script against throwaway fixture trees.
bump-opencode-plugin-test:
bash scripts/bump-opencode-plugin.sh --selftest
# Self-test of the CI runner-failure re-run decision against a stubbed gh.
rerun-runner-failures-test:
bash scripts/rerun-runner-failures.sh --selftest
# Check that every repository path the contributor documents name exists.
# `links` (mlc) checks Markdown links only, not paths written in backticks.
doc-paths:
bash scripts/check-doc-paths.sh
# Self-test of that check: seeded defects run through the real script against a throwaway repository.
doc-paths-test:
bash scripts/check-doc-paths.sh --selftest
# Check that every scripts/check-*.sh gate is run by a recipe `just check` reaches
# and in CI. A gate nothing runs fails nothing, and dropping one leaves the rest green.
gate-wiring:
bash scripts/check-gate-wiring.sh
# Self-test of that check: seeded wiring defects in a throwaway tree.
gate-wiring-test:
bash scripts/check-gate-wiring.sh --selftest
# Check that the release pins in the install documents (OpenCode INSTALL.md, Antigravity and Qwen
# README.md) equal the plugin manifests. `bash scripts/check-install-pins.sh --write` fixes a stale
# pin; the release branch runs that itself (.github/workflows/release-refresh.yml).
install-pins:
bash scripts/check-install-pins.sh
# Self-test of that check: seeded defects in throwaway trees.
install-pins-test:
bash scripts/check-install-pins.sh --selftest
# Check that the root README's install section has a row and a URL for every OpenCode plugin.
readme-coverage:
bash scripts/check-readme-coverage.sh
# Self-test of that check: seeded defects in throwaway trees.
readme-coverage-test:
bash scripts/check-readme-coverage.sh --selftest
# Verify antigravity/plugins/ plugin configs, ids, binary resolution, and skill copies.
agy-wiring:
bash scripts/check-agy-wiring.sh
# Run Antigravity's own validator over every antigravity/plugins/* front (skipped when `agy` is absent).
# Not --strict: strict also fails on "command isn't on this machine's PATH" warnings, which describe the
# machine (the bin/ is not installed), not the repo; errors, such as an agent the loader would skip, still fail.
agy-validate:
#!/usr/bin/env bash
set -euo pipefail
if command -v agy >/dev/null 2>&1; then
for manifest in antigravity/plugins/*/plugin.json; do
agy plugin validate "$(dirname "$manifest")"
done
else
echo "agy-validate: skipped (agy not on PATH)"
fi
# Assemble every OpenCode plugin zip locally and check its contents (PR-time
# smoke; tag-time bundling and published-zip verification stay in
# opencode-bundles.yml, skills-only zips in check-skills-bundles.sh).
smoke-opencode-bundle:
bash scripts/smoke-opencode-bundle.sh
# Run the opencode TypeScript unit tests.
test-opencode:
#!/usr/bin/env bash
set -euo pipefail
for dir in opencode/plugins/*/; do
# skills-only plugins have no plugin.ts; check-opencode-wiring.sh check 1 is what fails loudly for a real plugin that lost its plugin.ts
[ -f "$dir/plugin.ts" ] || continue
(cd "$dir" && bun install && bun test)
done
# Regenerate the committed footprint document for every published plugin, and
# maintain the thresholds alongside them.
# Requires the plugin binaries: `just build-rtk-mcp-cc build-re-ghidra-mcp-cc`.
footprint-regen:
#!/usr/bin/env bash
set -euo pipefail
for plugin in $(bash scripts/registry-plugins.sh claude-code | tr -d '\r'); do
cargo run -q -p plugin-footprint --bin plugin-footprint -- measure "claude-code/plugins/$plugin" \
--out "docs/footprints/$plugin.json"
cargo run -q -p plugin-footprint --bin plugin-footprint -- ratchet \
--measured "docs/footprints/$plugin.json" \
--budgets docs/footprints/budgets.json
echo "regenerated docs/footprints/$plugin.json"
done
for plugin in $(bash scripts/registry-plugins.sh opencode | tr -d '\r'); do
dir="opencode/plugins/$plugin"
cargo run -q -p plugin-footprint --bin plugin-footprint -- measure "$dir" \
--out "docs/footprints/$plugin.json"
cargo run -q -p plugin-footprint --bin plugin-footprint -- ratchet \
--measured "docs/footprints/$plugin.json" \
--budgets docs/footprints/budgets.json
echo "regenerated docs/footprints/$plugin.json"
done
for plugin in $(bash scripts/registry-plugins.sh antigravity | tr -d '\r'); do
cargo run -q -p plugin-footprint --bin plugin-footprint -- measure "antigravity/plugins/$plugin" \
--out "docs/footprints/$plugin.json"
cargo run -q -p plugin-footprint --bin plugin-footprint -- ratchet \
--measured "docs/footprints/$plugin.json" \
--budgets docs/footprints/budgets.json
echo "regenerated docs/footprints/$plugin.json"
done
# The published figure (spec §7), rewritten from ALL documents at once —
# never per-plugin, which would rewrite the root comparison table with a
# single row and silently delete every other plugin's.
cargo run -q -p plugin-footprint --bin plugin-footprint -- publish
# Verify each published plugin's committed footprint against a fresh measurement,
# then against the thresholds. Requires the plugin binaries; see `footprint-regen`.
# OVERRIDE PROCEDURE (correction PRs that trip the delta cap on stale-base
# cleanup, never for new growth): a maintainer reviews the measured delta,
# confirms it is a measurement correction (zero new source bytes vs base,
# shown by `git diff <base>...HEAD -- <plugin dir>`), then admin-merges with
# `footprint-override: <reason>` in the merge message. New growth that trips
# the cap is never overridden — shrink the change or earn the budget first.
footprint:
#!/usr/bin/env bash
set -euo pipefail
# Freshness (spec §6). Regenerating and requiring no diff is what makes the
# committed document a claim about the world rather than a file that agrees
# with itself. `check-qwen-marketplace.sh` keeps its generated manifest
# honest exactly this way, on the stated reasoning that nothing fails when a
# copy goes stale — it just advertises the wrong thing.
# TWO checks, because neither alone is right, and each was wrong in a
# different direction. Both failures were MEASURED, one after the other.
#
# `git diff --quiet` alone is blind to an UNTRACKED file: a new plugin's
# document, regenerated but never `git add`ed, was invisible here AND in CI —
# regenerated on the runner, ignored by the diff, read off disk by the gate,
# and merged with no committed document at all, leaving the NEXT change with
# no baseline.
#
# `git status --porcelain` alone FALSE-POSITIVES on Windows. These files
# carry `text eol=lf` (.gitattributes), and git then reports a byte-identical
# file as modified: measured with the working file and the index blob both
# ending `6}}\n`, `git diff --quiet` exiting 0, and status still printing
# ` M docs/footprints/budgets.json`. That fails `just check` for a developer
# who has changed nothing.
#
# So: `diff` for tracked content, which normalises and does not lie; and
# `ls-files --others` for the untracked case it cannot see.
# The READMEs are checked DIFFERENTLY from the documents, and the difference
# is not fussiness. `docs/footprints/*.json` is wholly generated, so git is
# the right oracle for it. A README is mostly hand-written prose with one
# generated region inside it, so asking git the same question would fail
# `just check` for any developer with an uncommitted paragraph — and fail it
# with the words "footprint documents are stale", which is not what happened.
#
# What actually indicates staleness is that REGENERATION CHANGED the file.
# Unrelated prose edits are present before and after, so they cancel.
readmes="README.md $(ls -d claude-code/plugins/*/README.md opencode/plugins/*/README.md antigravity/plugins/*/README.md 2>/dev/null || true)"
before=$(md5sum $readmes)
just footprint-regen
if [ "$before" != "$(md5sum $readmes)" ]; then
echo "ERROR: a published footprint region was stale." >&2
echo "Regenerating changed a README, so what it advertises was wrong:" >&2
git --no-pager diff --stat -- $readmes >&2
echo "The region is generated; commit the regenerated README." >&2
exit 1
fi
untracked=$(git ls-files --others --exclude-standard -- docs/footprints/)
if ! git diff --quiet -- docs/footprints/ || [ -n "$untracked" ]; then
echo "ERROR: the committed footprint documents are stale or incomplete." >&2
echo "A fresh measurement disagrees with what is committed:" >&2
git --no-pager diff --stat -- docs/footprints/ >&2
[ -n "$untracked" ] && echo "not committed at all: $untracked" >&2
echo "Run 'just footprint-regen' and 'git add docs/footprints/', then commit." >&2
exit 1
fi
# NOT `HEAD`. Against HEAD the baseline is the developer's own last commit,
# so once they have run `footprint-regen` and committed it to satisfy the
# freshness check above, the measured delta is zero BY CONSTRUCTION and the
# delta cap can never fire locally. `just check` would report green on
# exactly the change the cap exists to catch, and CI would be the first to
# say otherwise.
#
# `origin/main` FIRST, then a local `main`. Two different developers break on
# the two different orders: one who cloned and ran `git switch -c feat` has
# no local `main` at all, and one who cloned months ago and has worked on
# branches since has a local `main` that resolves perfectly and points
# somewhere long superseded. Only `origin/main` moves on every fetch, and it
# is what CI's `origin/<base_ref>` actually means.
#
# HEAD remains the last resort, for a checkout with no remote. The cap is
# vacuous there, which is why CI runs the same check against the base branch
# with `fetch-depth: 0` — this recipe is a convenience, never the authority.
base=origin/main
git rev-parse --verify --quiet "$base" >/dev/null 2>&1 || base=main
git rev-parse --verify --quiet "$base" >/dev/null 2>&1 || base=HEAD
echo "footprint: comparing against $base"
cargo run -q -p plugin-footprint --bin footprint-gate -- "$base"
# Drive every branch of the dispatcher shipped as bin/<name> in a plugin bundle.
# Any one machine exercises exactly one branch of it, so the platform is faked;
# the Git Bash branch shipped broken in 0.6.0 for want of this.
dispatch:
bash scripts/check-bundle-dispatch.sh
# Assemble a host-only bundle for each Claude Code plugin and start its entry
# points both ways Claude Code does — spawned directly, and through a shell.
# Those two routes resolve bin/<name> differently on Windows, and only running
# the assembled thing covers both.
smoke:
#!/usr/bin/env bash
set -euo pipefail
for plugin in $(bash scripts/registry-plugins.sh claude-code --exclude-skills-only | tr -d '\r'); do
bash scripts/smoke-bundle.sh "$plugin"
done
# Assemble a host-only bundle for each Antigravity plugin and test entry points.
smoke-agy:
bash scripts/smoke-agy-bundle.sh
# Copy the canonical aiplugins-devtools skills into each agent's plugin folder
# (one block per agent; scripts/check-devtools-skills.sh fails on drift)
emit-devtools-skills:
#!/usr/bin/env bash
set -euo pipefail
src=shared/devtools/skills
# claude-code
rm -rf claude-code/plugins/aiplugins-devtools-cc/skills
mkdir -p claude-code/plugins/aiplugins-devtools-cc/skills
cp -r "$src"/. claude-code/plugins/aiplugins-devtools-cc/skills/
# qwen
rm -rf qwen/plugins/aiplugins-devtools-qwen/skills
mkdir -p qwen/plugins/aiplugins-devtools-qwen/skills
cp -r "$src"/. qwen/plugins/aiplugins-devtools-qwen/skills/
# antigravity
rm -rf antigravity/plugins/aiplugins-devtools-agy/skills
mkdir -p antigravity/plugins/aiplugins-devtools-agy/skills
cp -r "$src"/. antigravity/plugins/aiplugins-devtools-agy/skills/
# opencode: skills are keyed by folder name, so the folder is prefixed and the
# one frontmatter `name:` line is rewritten to match (nothing else changes)
oc=opencode/plugins/aiplugins-devtools-opencode/skills
rm -rf "$oc"
mkdir -p "$oc"
for skill_dir in "$src"/*/; do
skill=$(basename "$skill_dir")
cp -r "$src/$skill" "$oc/aiplugins-devtools-$skill"
# Only the frontmatter line changes: a `name: <skill>` line in the body
# (an example, say) must stay as written. (temp file plus mv, not
# `sed -i`: GNU and BSD sed disagree on its argument)
skill_md="$oc/aiplugins-devtools-$skill/SKILL.md"
awk -v skill="$skill" '
NR == 1 { fm = 1; print; next }
fm && $0 == "---" { fm = 0 }
fm && $0 == "name: " skill { print "name: aiplugins-devtools-" skill; next }
{ print }
' "$skill_md" > "$skill_md.tmp"
mv "$skill_md.tmp" "$skill_md"
done
# opencode alone lists skills nowhere in its `/` menu, so each slash command
# is a command file (shared/devtools/commands/<name>.md), copied unchanged
occ=opencode/plugins/aiplugins-devtools-opencode/commands
rm -rf "$occ"
mkdir -p "$occ"
cp "shared/devtools/commands"/*.md "$occ"/
# Check that every key in docs/footprints/budgets.json names a live plugin
footprint-budgets:
bash scripts/check-footprint-budgets.sh
# Check the canonical aiplugins-devtools skill source (content, attribution)
devtools-skills:
bash scripts/check-devtools-skills.sh
bash scripts/check-devtools-skills.sh --mutation-test
# Check the rust-toolchain-scaffold skill source (structure, pins), then prove the gate
# fails on each seeded defect
rust-scaffold:
bash scripts/check-rust-scaffold.sh
bash scripts/check-rust-scaffold.sh --mutation-test
# End to end: apply the Rust scaffold to throwaway repositories, run its own gates, then
# weaken each gate once and require its test to fail. Slow. Needs just, lefthook, gitleaks,
# cargo-nextest, cargo-deny and typos; pass --quick for the apply.sh checks alone.
test-rust-scaffold *args:
bash scripts/test-rust-scaffold.sh {{args}}
# Build every skills-only plugin bundle and check zip names, manifests and skills
skills-bundles:
bash scripts/check-skills-bundles.sh
# Check the release plumbing for crate-less skills-only plugin tags
skills-release-wiring:
bash scripts/check-skills-release-wiring.sh
# Check the GitHub Pages catalog: generate it from the repo inputs, verify the
# the catalog invariants, then prove the checker rejects each seeded defect
site-check:
bash scripts/gen-marketplaces.sh --check
bash scripts/gen-site.sh target/site-check/catalog.json
bash scripts/check-site.sh target/site-check/catalog.json
bash scripts/check-site.sh --selftest
# Stage the site and serve it under /aiplugins/ exactly as Pages does. A
# preview aid, not a gate. Use `python` where `python3` is absent. The page is
# then at http://localhost:8000/aiplugins/
site-preview:
bash scripts/stage-site.sh
rm -rf target/preview
mkdir -p target/preview
cp -R target/site target/preview/aiplugins
@echo 'Preview: http://localhost:8000/aiplugins/ (Ctrl-C stops the server)'
@echo 'Check: 1) 320 px and desktop widths; 2) light, dark and the theme toggle; 3) a sparse card (todov2 has three greyed tabs); 4) a Qwen card shows Not measured; 5) an OpenCode card shows the setup bar and resident 0 B; 6) every copy button, and the page with JavaScript disabled'
python3 -m http.server --bind 127.0.0.1 --directory target/preview 8000
# Check that Cargo.lock agrees with every crate's Cargo.toml. It runs first in `check`: any
# later cargo command would quietly rewrite a stale lock file and hide the problem.
# `cargo update --workspace` fixes it and changes no dependency.
lock:
cargo metadata --locked --format-version 1 > /dev/null
# Run all pre-flight checks (what CI and lefthook run; see ci.yml — `links`
# is hook-only and `gen-* --check` + opencode suites run in CI but not here)
check: lock fmt lint test deny spellcheck links versions wiring marketplace qwen-marketplace agy-marketplace dispatch smoke footprint opencode-wiring bump-opencode-plugin-test rerun-runner-failures-test doc-paths-test doc-paths gate-wiring-test gate-wiring install-pins-test install-pins readme-coverage-test readme-coverage agy-wiring agy-validate footprint-budgets devtools-skills rust-scaffold skills-bundles skills-release-wiring site-check
# Build the example Claude Code plugin's binaries into its bin/ directory.
# Windows developers run this locally; CI produces the other platforms.
build-claude-example:
cargo build -p claude-example --release --bin claude-example-mcp --bin claude-example-hook
mkdir -p claude-code/plugins/example/bin
for b in claude-example-mcp claude-example-hook; do \
if [ -f "target/release/$b.exe" ]; then \
cp "target/release/$b.exe" claude-code/plugins/example/bin/; \
else \
cp "target/release/$b" claude-code/plugins/example/bin/; \
fi; \
done
@echo "Plugin binaries staged in claude-code/plugins/example/bin/"
# Build the example Antigravity plugin's binaries into its bin/ directory.
build-agy-example:
cargo build -p agy-example --release --bin agy-example-mcp --bin agy-example-hook
mkdir -p antigravity/plugins/example/bin
for b in agy-example-mcp agy-example-hook; do \
if [ -f "target/release/$b.exe" ]; then \
cp "target/release/$b.exe" antigravity/plugins/example/bin/; \
else \
cp "target/release/$b" antigravity/plugins/example/bin/; \
fi; \
done
@echo "Plugin binaries staged in antigravity/plugins/example/bin/"
# Build the rtk-mcp-cc Claude Code plugin's binaries into its bin/ directory.
# Windows developers run this locally; CI produces the other platforms.
build-rtk-mcp-cc:
cargo build -p rtk-mcp-cc --release --bin rtk-cc-hook --bin rtk-cc-mcp
mkdir -p claude-code/plugins/rtk-mcp-cc/bin
for b in rtk-cc-hook rtk-cc-mcp; do \
if [ -f "target/release/$b.exe" ]; then \
cp "target/release/$b.exe" claude-code/plugins/rtk-mcp-cc/bin/; \
else \
cp "target/release/$b" claude-code/plugins/rtk-mcp-cc/bin/; \
fi; \
done
@echo "Plugin binaries staged in claude-code/plugins/rtk-mcp-cc/bin/"
# Build the re-ghidra-mcp-cc Claude Code plugin's binaries into its bin/ directory.
# Windows developers run this locally; CI produces the other platforms.
build-re-ghidra-mcp-cc:
cargo build -p re-ghidra-mcp-cc --release --bin re-ghidra-cc-mcp --bin re-ghidra-cc-hook
mkdir -p claude-code/plugins/re-ghidra-mcp-cc/bin
for b in re-ghidra-cc-mcp re-ghidra-cc-hook; do \
if [ -f "target/release/$b.exe" ]; then \
cp "target/release/$b.exe" claude-code/plugins/re-ghidra-mcp-cc/bin/; \
else \
cp "target/release/$b" claude-code/plugins/re-ghidra-mcp-cc/bin/; \
fi; \
done
@echo "Plugin binaries staged in claude-code/plugins/re-ghidra-mcp-cc/bin/"
# Build the opencode-ctl-mcp-cc Claude Code plugin's binary into its bin/ directory.
# Windows developers run this locally; CI produces the other platforms.
build-opencode-ctl-mcp-cc:
cargo build -p opencode-ctl-mcp-cc --release --bin opencode-ctl-cc-mcp
mkdir -p claude-code/plugins/opencode-ctl-mcp-cc/bin
for b in opencode-ctl-cc-mcp; do \
if [ -f "target/release/$b.exe" ]; then \
cp "target/release/$b.exe" claude-code/plugins/opencode-ctl-mcp-cc/bin/; \
else \
cp "target/release/$b" claude-code/plugins/opencode-ctl-mcp-cc/bin/; \
fi; \
done
@echo "Plugin binaries staged in claude-code/plugins/opencode-ctl-mcp-cc/bin/"
# Build the repo-tasks-mcp-cc Claude Code plugin's binary into its bin/ directory.
# Windows developers run this locally; CI produces the other platforms.
build-repo-tasks-mcp-cc:
cargo build -p repo-tasks-mcp-cc --release --bin repo-tasks-cc-mcp
mkdir -p claude-code/plugins/repo-tasks-mcp-cc/bin
for b in repo-tasks-cc-mcp; do \
if [ -f "target/release/$b.exe" ]; then \
cp "target/release/$b.exe" claude-code/plugins/repo-tasks-mcp-cc/bin/; \
else \
cp "target/release/$b" claude-code/plugins/repo-tasks-mcp-cc/bin/; \
fi; \
done
@echo "Plugin binaries staged in claude-code/plugins/repo-tasks-mcp-cc/bin/"
# Build the opencode-ctl-mcp-qwen Qwen Code extension's binary into its bin/ directory.
# Windows developers run this locally; CI produces the other platforms.
build-opencode-ctl-mcp-qwen:
cargo build -p opencode-ctl-mcp-qwen --release --bin opencode-ctl-qwen-mcp
mkdir -p qwen/plugins/opencode-ctl-mcp-qwen/bin
for b in opencode-ctl-qwen-mcp; do \
if [ -f "target/release/$b.exe" ]; then \
cp "target/release/$b.exe" qwen/plugins/opencode-ctl-mcp-qwen/bin/; \
else \
cp "target/release/$b" qwen/plugins/opencode-ctl-mcp-qwen/bin/; \
fi; \
done
@echo "Plugin binaries staged in qwen/plugins/opencode-ctl-mcp-qwen/bin/"
# Stage opencode-ctl-mcp-opencode's MCP binary (the cc front's) into its bin/ directory.
build-opencode-ctl-mcp-opencode:
cargo build -p opencode-ctl-mcp-cc --release --bin opencode-ctl-cc-mcp
mkdir -p opencode/plugins/opencode-ctl-mcp-opencode/bin
if [ -f "target/release/opencode-ctl-cc-mcp.exe" ]; then \
cp "target/release/opencode-ctl-cc-mcp.exe" opencode/plugins/opencode-ctl-mcp-opencode/bin/; \
else \
cp "target/release/opencode-ctl-cc-mcp" opencode/plugins/opencode-ctl-mcp-opencode/bin/; \
fi
@echo "Plugin binary staged in opencode/plugins/opencode-ctl-mcp-opencode/bin/"
# Build the repo-tasks-mcp-qwen Qwen Code extension's binary into its bin/ directory.
# Windows developers run this locally; CI produces the other platforms.
build-repo-tasks-mcp-qwen:
cargo build -p repo-tasks-mcp-qwen --release --bin repo-tasks-qwen-mcp
mkdir -p qwen/plugins/repo-tasks-mcp-qwen/bin
for b in repo-tasks-qwen-mcp; do \
if [ -f "target/release/$b.exe" ]; then \
cp "target/release/$b.exe" qwen/plugins/repo-tasks-mcp-qwen/bin/; \
else \
cp "target/release/$b" qwen/plugins/repo-tasks-mcp-qwen/bin/; \
fi; \
done
@echo "Plugin binaries staged in qwen/plugins/repo-tasks-mcp-qwen/bin/"
# Stage repo-tasks-mcp-opencode's MCP binary (the cc front's) into its bin/ directory.
build-repo-tasks-mcp-opencode:
cargo build -p repo-tasks-mcp-cc --release --bin repo-tasks-cc-mcp
mkdir -p opencode/plugins/repo-tasks-mcp-opencode/bin
if [ -f "target/release/repo-tasks-cc-mcp.exe" ]; then \
cp "target/release/repo-tasks-cc-mcp.exe" opencode/plugins/repo-tasks-mcp-opencode/bin/; \
else \
cp "target/release/repo-tasks-cc-mcp" opencode/plugins/repo-tasks-mcp-opencode/bin/; \
fi
@echo "Plugin binary staged in opencode/plugins/repo-tasks-mcp-opencode/bin/"
# Stage rtk-mcp-opencode's MCP binary into its bin/ directory.
build-rtk-mcp-opencode:
cargo build -p rtk-mcp-cc --release --bin rtk-cc-mcp
mkdir -p opencode/plugins/rtk-mcp-opencode/bin
if [ -f "target/release/rtk-cc-mcp.exe" ]; then \
cp "target/release/rtk-cc-mcp.exe" opencode/plugins/rtk-mcp-opencode/bin/; \
else \
cp "target/release/rtk-cc-mcp" opencode/plugins/rtk-mcp-opencode/bin/; \
fi
@echo "Plugin binary staged in opencode/plugins/rtk-mcp-opencode/bin/"
# Stage re-ghidra-mcp-opencode's MCP binary into its bin/ directory.
build-re-ghidra-mcp-opencode:
cargo build -p re-ghidra-mcp-cc --release --bin re-ghidra-cc-mcp
mkdir -p opencode/plugins/re-ghidra-mcp-opencode/bin
if [ -f "target/release/re-ghidra-cc-mcp.exe" ]; then \
cp "target/release/re-ghidra-cc-mcp.exe" opencode/plugins/re-ghidra-mcp-opencode/bin/; \
else \
cp "target/release/re-ghidra-cc-mcp" opencode/plugins/re-ghidra-mcp-opencode/bin/; \
fi
@echo "Plugin binary staged in opencode/plugins/re-ghidra-mcp-opencode/bin/"
# Build the rtk-mcp-agy plugin's binaries into its bin/ directory.
build-rtk-mcp-agy:
cargo build -p rtk-mcp-agy --release --bin rtk-mcp --bin rtk-hook-preinvocation
mkdir -p antigravity/plugins/rtk-mcp-agy/bin
for b in rtk-mcp rtk-hook-preinvocation; do \
if [ -f "target/release/$b.exe" ]; then \
cp "target/release/$b.exe" antigravity/plugins/rtk-mcp-agy/bin/; \
else \
cp "target/release/$b" antigravity/plugins/rtk-mcp-agy/bin/; \
fi; \
done
@echo "Plugin binaries staged in antigravity/plugins/rtk-mcp-agy/bin/"
# Build the opencode-ctl-mcp-agy plugin's binary into its bin/ directory.
build-opencode-ctl-mcp-agy:
cargo build -p opencode-ctl-mcp-agy --release --bin opencode-ctl-agy-mcp
mkdir -p antigravity/plugins/opencode-ctl-mcp-agy/bin
for b in opencode-ctl-agy-mcp; do \
if [ -f "target/release/$b.exe" ]; then \
cp "target/release/$b.exe" antigravity/plugins/opencode-ctl-mcp-agy/bin/; \
else \
cp "target/release/$b" antigravity/plugins/opencode-ctl-mcp-agy/bin/; \
fi; \
done
@echo "Plugin binaries staged in antigravity/plugins/opencode-ctl-mcp-agy/bin/"
# Build the repo-tasks-mcp-agy plugin's binary into its bin/ directory.
build-repo-tasks-mcp-agy:
cargo build -p repo-tasks-mcp-agy --release --bin repo-tasks-agy-mcp
mkdir -p antigravity/plugins/repo-tasks-mcp-agy/bin
for b in repo-tasks-agy-mcp; do \
if [ -f "target/release/$b.exe" ]; then \
cp "target/release/$b.exe" antigravity/plugins/repo-tasks-mcp-agy/bin/; \
else \
cp "target/release/$b" antigravity/plugins/repo-tasks-mcp-agy/bin/; \
fi; \
done
@echo "Plugin binaries staged in antigravity/plugins/repo-tasks-mcp-agy/bin/"
# Build the re-ghidra-mcp-agy plugin's binaries into its bin/ directory.
build-re-ghidra-mcp-agy:
cargo build -p re-ghidra-mcp-agy --release --bin re-ghidra-agy-mcp --bin re-ghidra-agy-hook
mkdir -p antigravity/plugins/re-ghidra-mcp-agy/bin
for b in re-ghidra-agy-mcp re-ghidra-agy-hook; do \
if [ -f "target/release/$b.exe" ]; then \
cp "target/release/$b.exe" antigravity/plugins/re-ghidra-mcp-agy/bin/; \
else \
cp "target/release/$b" antigravity/plugins/re-ghidra-mcp-agy/bin/; \
fi; \
done
@echo "Plugin binaries staged in antigravity/plugins/re-ghidra-mcp-agy/bin/"
# Assemble the installable plugin zips for a published release, the same way
# .github/workflows/plugin-bundles.yml does — for testing a change to the
# bundling before tagging, or for rebuilding an asset by hand.
#
# Unix only: the bundles carry exec bits that a Windows zip cannot record, and
# MSYS resolves `bin/foo` to `bin/foo.exe` and would overwrite the binary with
# the dispatcher. On a Windows machine run this from WSL.
bundle-plugins tag:
#!/usr/bin/env bash
set -euo pipefail
names=$(bash scripts/registry-plugins.sh claude-code --exclude-skills-only | tr -d '\r')
rm -rf target/plugin-assets target/plugin-bundles
mkdir -p target/plugin-assets
for name in $names; do
gh release download "{{ tag }}" -D target/plugin-assets \
-p "$name-*.tar.xz" -p "$name-*.zip" --clobber
done
for name in $names; do
bash scripts/bundle-plugin.sh "$name" target/plugin-assets target/plugin-bundles
done
# Assemble the installable Qwen extension zips for a published release, the same
# way .github/workflows/qwen-extension-bundles.yml does.
#
# Unix only: the bundles carry exec bits that a Windows zip cannot record, and
# MSYS resolves `bin/foo` to `bin/foo.exe` and would overwrite the binary with
# the dispatcher. On a Windows machine run this from WSL.
bundle-qwen tag:
#!/usr/bin/env bash
set -euo pipefail
names=$(bash scripts/registry-plugins.sh qwen --exclude-skills-only | tr -d '\r')
rm -rf target/qwen-assets target/qwen-bundles
mkdir -p target/qwen-assets
for name in $names; do
gh release download "{{ tag }}" -D target/qwen-assets \
-p "$name-*.tar.xz" -p "$name-*.zip" --clobber
done
for name in $names; do
bash scripts/bundle-qwen-extension.sh "$name" target/qwen-assets target/qwen-bundles
done
# Assemble the installable OpenCode plugin zips from a working tree — the
# local pre-tag counterpart of opencode-bundles.yml (no releases involved:
# bundle-opencode-plugin.sh stages versioned source only).
bundle-opencode:
#!/usr/bin/env bash
set -euo pipefail
names=$(bash scripts/registry-plugins.sh opencode --exclude-skills-only | tr -d '\r')
rm -rf target/opencode-bundles
mkdir -p target/opencode-bundles
for name in $names; do
bash scripts/bundle-opencode-plugin.sh "opencode/plugins/$name" target/opencode-bundles
done
# Assemble the installable Antigravity plugin zips for a published release.
#
# Unix only: the bundles carry exec bits that a Windows zip cannot record, and
# MSYS resolves `bin/foo` to `bin/foo.exe` and would overwrite the binary with
# the dispatcher. On a Windows machine run this from WSL.
bundle-agy tag:
#!/usr/bin/env bash
set -euo pipefail
names=$(bash scripts/registry-plugins.sh antigravity --exclude-skills-only | tr -d '\r')
rm -rf target/agy-assets target/agy-bundles
mkdir -p target/agy-assets
for name in $names; do
gh release download "{{ tag }}" -D target/agy-assets \
-p "$name-*.tar.xz" -p "$name-*.zip" --clobber
done
for name in $names; do
bash scripts/bundle-agy-plugin.sh "$name" target/agy-assets target/agy-bundles
done
# Regenerate EVERY plugin's committed copy of the ghidra-re-driver skill from
# the binary that embeds it.
#
# The canonical skill lives at shared/ghidra-mcp/skill/SKILL.md and is compiled
# into every agent plugin's binary. Editing a plugin's copy directly is a
# mistake the emit test catches; this is how you propagate a canonical edit.
#
# Every copy, not just the Claude Code one. This recipe used to regenerate that
# single front, so a canonical edit left the qwen copy stale — green locally
# under `-p re-ghidra-mcp-cc`, and caught only by the workspace run in CI, as
# re-ghidra-mcp-qwen::skill_emit.
emit-ghidra-skill: build-re-ghidra-mcp-cc
cargo build -p re-ghidra-mcp-qwen --release --bin re-ghidra-qwen-mcp
mkdir -p antigravity/plugins/re-ghidra-mcp-agy/skills/ghidra-re-driver
./claude-code/plugins/re-ghidra-mcp-cc/bin/re-ghidra-cc-mcp emit-skill \
> claude-code/plugins/re-ghidra-mcp-cc/skills/ghidra-re-driver/SKILL.md
./target/release/re-ghidra-qwen-mcp emit-skill \
> qwen/plugins/re-ghidra-mcp-qwen/skills/ghidra-re-driver/SKILL.md
./claude-code/plugins/re-ghidra-mcp-cc/bin/re-ghidra-cc-mcp emit-skill \
> opencode/plugins/re-ghidra-mcp-opencode/skills/ghidra-re-driver/SKILL.md
./claude-code/plugins/re-ghidra-mcp-cc/bin/re-ghidra-cc-mcp emit-skill \
> antigravity/plugins/re-ghidra-mcp-agy/skills/ghidra-re-driver/SKILL.md
@echo "Regenerated the committed ghidra-re-driver skill copies (claude-code, qwen, opencode, antigravity)"
# Regenerate the committed opencode-ctl-driver / opencode-ctl-doctor skill copies
# for all four hosts (eight files) from the one engine binary.
emit-opencode-ctl-skills: build-opencode-ctl-mcp-cc
#!/usr/bin/env bash
set -euo pipefail
bin=./claude-code/plugins/opencode-ctl-mcp-cc/bin/opencode-ctl-cc-mcp
for pair in cc:claude-code/plugins/opencode-ctl-mcp-cc qwen:qwen/plugins/opencode-ctl-mcp-qwen agy:antigravity/plugins/opencode-ctl-mcp-agy opencode:opencode/plugins/opencode-ctl-mcp-opencode; do
host=${pair%%:*}; dir=${pair#*:}
for name in opencode-ctl-driver opencode-ctl-doctor; do
mkdir -p "$dir/skills/$name"
"$bin" emit-skill "$name" --host "$host" > "$dir/skills/$name/SKILL.md"
done
done
echo "Regenerated the committed opencode-ctl skill copies (cc, qwen, agy, opencode)"
# Run the live Ghidra suite. Needs a real Ghidra 12.1.2 + JDK 21 and an analyzed
# fixture project; see shared/ghidra-mcp/tests/fixtures/README.md to build one.
#
# These ~60 tests are gated at RUNTIME on GHIDRA_MCP_E2E, not with #[ignore]:
# without the variable they early-return and pass, which is what keeps the
# 3-OS CI matrix green on runners that have no Ghidra.
#
# -j1 is not a performance choice. One Ghidra project supports ONE live worker;
# parallel test binaries collide on Ghidra's project.lock.
test-live-ghidra:
GHIDRA_MCP_E2E=1 cargo nextest run -p ghidra-mcp -j1
# Remove ORPHANED executables that cargo leaves behind, without discarding the
# whole build cache.
#
# Cargo never deletes an executable whose [[bin]] target was renamed or removed:
# it only ever writes. The orphan keeps sitting in target/{debug,release}, and
# anything that resolves a binary BY NAME — CARGO_BIN_EXE_*, a staged plugin
# bin/, a PATH lookup — will happily keep finding the old one. That failure is
# silent and looks like a logic bug, not a build-system one.
#
# Two real instances of this, both from renaming a bin target:
# * two workspace packages each declared a fixture named `mock-rtk`, so they
# shared one output path and the last build won; the losing package's tests
# then drove the WRONG binary.
# * after renaming that fixture, the abandoned `mock-rtk` executable stayed on
# disk, and the package that still legitimately owns the name saw its own
# target as fresh and never re-linked over it.
#
# `cargo clean -p <pkg>` cannot fix the second case in general: an orphan from a
# renamed target is no longer associated with any package. So enumerate the bin
# targets that currently EXIST and delete every top-level executable that is not
# one of them.
clean-stale:
#!/usr/bin/env bash
set -euo pipefail
known=$(cargo metadata --no-deps --format-version 1 \
| jq -r '.packages[].targets[] | select(.kind[] == "bin") | .name' | sort -u)
removed=0
for profile in debug release; do
dir="target/$profile"
[ -d "$dir" ] || continue
for path in "$dir"/*; do
[ -f "$path" ] || continue
name=$(basename "$path")
# Only consider built executables; skip .d/.pdb/.rlib and friends.
case "$name" in
*.exe) name="${name%.exe}" ;;
*.*) continue ;;
esac
if ! printf '%s\n' "$known" | grep -qxF "$name"; then
echo " stale: $path"
rm -f "$path"
removed=$((removed + 1))
fi
done
done
# Staged plugin binaries are copies, so they go stale the same way.
for staged in claude-code/plugins/*/bin/* opencode/plugins/*/bin/* qwen/plugins/*/bin/* antigravity/plugins/*/bin/*; do
[ -f "$staged" ] || continue
name=$(basename "$staged"); name="${name%.exe}"
if ! printf '%s\n' "$known" | grep -qxF "$name"; then
echo " stale: $staged"
rm -f "$staged"
removed=$((removed + 1))
fi
done
echo "Removed $removed stale artifact(s)."
# Remove every build artifact: the cargo cache and the staged plugin binaries.
# Reach for `clean-stale` first — it fixes the usual problem without costing a
# full rebuild.
clean:
cargo clean
rm -rf claude-code/plugins/example/bin claude-code/plugins/rtk-mcp-cc/bin claude-code/plugins/re-ghidra-mcp-cc/bin claude-code/plugins/opencode-ctl-mcp-cc/bin opencode/plugins/opencode-ctl-mcp-opencode/bin opencode/plugins/rtk-mcp-opencode/bin opencode/plugins/re-ghidra-mcp-opencode/bin qwen/plugins/*/bin antigravity/plugins/*/bin
@echo "Removed target/ and staged plugin binaries."
versions:
bash scripts/check-package-versions.sh
bash scripts/check-release-manifest.sh
# Report working-copy files checked out as CRLF against an `eol=lf` pin.
# A stale Windows checkout fails byte-identity gates (wiring `cmp`, footprint
# freshness) on files whose blobs are already correct; renormalize instead of
# editing content: `git rm --cached` is NOT needed, `rm <file> && git checkout
# -- <file>` restores the pinned endings.
doctor:
@git ls-files --eol | grep "w/crlf" | grep "eol=lf" || echo "Working copy matches all eol pins."