resolve-rust-targets
Resolve Rust package names and verification scope from cargo metadata. Never guess package IDs.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Resolve Rust package names and verification scope from cargo metadata. Never guess package IDs.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
ICN development companion for the InterCooperative Network Rust monorepo. Use when working on ICN code, docs, deployment, or protocol design. Provides crate-aware routing to specialist agents (icn-architect, icn-economist, icn-ops), enforces project conventions, and understands the current sprint state, cluster topology, and demo flow status. Triggers on: any ICN crate names, "cooperative contract", "mutual credit", "governance", "gossip", "K3s", "icn-dev", "ops/mcp", "Sprint", "demo flow", "CCL", "federation", "DID", "ledger", "trust graph", "icnd", "icnctl".
Full sprint-batch or stacked-PR integration pipeline. Owns merge order, rebases, local gates, and main sync.
Full sprint-batch or stacked-PR integration pipeline. Owns merge order, rebases, local gates, and main sync.
Show full ICN development status dashboard — active sessions, sprint tasks, worktree freshness, CI state, and cluster health
ICN session preflight. This skill should be used when the user explicitly invokes "/icn-agent-pack:preflight", or asks to "run preflight", "orient me on ICN", or "check the ICN session environment". Loads canonical docs and the latest handoff, then verifies branch, gh auth, ports, toolchain, and a light cargo check. Read-only; reports, never fixes.
ICN repo navigator / knowledge graph. This skill should be used when the user explicitly invokes "/icn-agent-pack:navigator", or asks to "map the repo", "build/refresh the knowledge graph", "trace this concept to its source", or "show the conceptual map / impact map". Begins the living repository knowledge-graph and conceptual-map workflow, grounded in the icn-ops MCP tools and (future) generated graph artifacts.
| name | resolve-rust-targets |
| description | Resolve Rust package names and verification scope from cargo metadata. Never guess package IDs. |
| argument-hint | [file-path | package-name | --touched] |
| user-invocable | true |
| allowed-tools | Bash |
| truth_contract | {"canonical_sources":["ops/state/config/repo-map.json"],"live_load_required":["cargo metadata --no-deps --format-version 1","git diff --name-only $(git merge-base HEAD origin/main)..HEAD"],"examples_only":[],"never_hardcode":["package names (always resolve via cargo metadata — human labels ≠ cargo IDs)","changed file list (always live-query from git)"]} |
Use cargo metadata as the authoritative source for package names, manifests, and verification scope.
Run before clippy, test, or build commands when the target package is even slightly uncertain.
The transcript hit ledger → icn-ledger-app → icn-ledger-actor before landing on the right package.
That cost two dead-end compile attempts. cargo metadata answers this in one call.
$ARGUMENTS is --touched or empty)# Get files changed on this branch
git diff --name-only $(git merge-base HEAD origin/main)..HEAD
# Get all workspace package names and their root dirs
cargo metadata --no-deps --format-version 1 \
| python3 -c "
import sys, json
md = json.load(sys.stdin)
for p in md['packages']:
root = p['manifest_path'].replace('/Cargo.toml','')
print(f\"{p['name']:40s} {root}\")
" | sort
Then for each changed file, find its containing package by matching path prefix to manifest root.
$ARGUMENTS is a name like "ledger")cargo metadata --no-deps --format-version 1 \
| python3 -c "
import sys, json, difflib
name = '$ARGUMENTS'
md = json.load(sys.stdin)
packages = [(p['name'], p['manifest_path']) for p in md['packages']]
# Exact match first
exact = [p for p in packages if p[0] == name]
if exact:
print('EXACT:', exact[0][0])
else:
# Near-match suggestions
names = [p[0] for p in packages]
close = difflib.get_close_matches(name, names, n=5, cutoff=0.4)
for c in close:
m = next(p for p in packages if p[0] == c)
print(f'NEAR: {m[0]:40s} {m[1]}')
"
Given a list of resolved package names, produce the minimal cargo command set:
# For scoped verification (preferred — faster):
cargo clippy -p <pkg1> -p <pkg2> --all-targets -- -D warnings
cargo test -p <pkg1> -p <pkg2>
# For cross-cutting changes (bins, icnd, core):
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace
| Location | Pattern | Example |
|---|---|---|
icn/crates/<name>/ | icn-<name> | icn-ledger, icn-obs, icn-security |
icn/apps/<name>/ | icn-<name>-actor or icn-<name>-app | icn-ledger-actor, icn-governance-actor |
icn/bins/<name>/ | <name> | icnd, icnctl, icn-console |
Common confusions from the transcript:
"ledger" → icn-ledger (crate) or icn-ledger-actor (app) — both exist"ledger app" → icn-ledger-actor"icn-ledger-app" → does not exist; nearest is icn-ledger-actor"obs" → icn-obs"security" → icn-security"compute" → icn-computeChanged files → packages:
icn/crates/icn-obs/src/attestation.rs icn-obs
icn/crates/icn-core/src/config/obs.rs icn-core
Suggested scoped command:
cargo clippy -p icn-obs -p icn-core --all-targets -- -D warnings
cargo test -p icn-obs -p icn-core
cargo clippy --workspace when scoped commands are sufficient.icnd) depend on everything; touching icnd/src/main.rs requires workspace-wide verify.