From yci
Ad-hoc cross-customer isolation check. Runs the customer-isolation detection library against a single path or text blob and reports allow/deny with the same catalogued errors as the PreToolUse hook. Useful for validating pastes and test fixtures before running a tool that would otherwise trigger the guard.
How this skill is triggered — by the user, by Claude, or both
Slash command
/yci:customer-guardThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Ad-hoc cross-customer isolation checker. Runs the same detection library the
Ad-hoc cross-customer isolation checker. Runs the same detection library the PreToolUse hook uses, against a single path or text blob supplied by the user, and reports the allow/deny decision with the same catalogued error IDs.
Read $ARGUMENTS. Strip --dry-run and --data-root <path> flags and note
their values if present. The remaining text is the input to check.
Detect the input type:
/, ~/, ./, or ../.Run:
bash "${CLAUDE_PLUGIN_ROOT}/skills/customer-profile/scripts/resolve-customer.sh"
If the script exits non-zero, print its stderr verbatim and abort — do NOT proceed without a resolved customer.
Capture the customer ID from stdout as ACTIVE_CUSTOMER.
Run:
bash "${CLAUDE_PLUGIN_ROOT}/skills/_shared/scripts/resolve-data-root.sh"
If --data-root <path> was present in $ARGUMENTS, pass --data-root <path>
to the script instead. Capture the result as DATA_ROOT.
Build a JSON object to feed the detection library:
Path input:
{ "tool_name": "Read", "tool_input": { "file_path": "<path>" }, "cwd": "<current-working-dir>" }
Use bash -c 'pwd' to obtain <current-working-dir>.
Text blob input:
{ "tool_name": "Write", "tool_input": { "content": "<text>" } }
Escape the text as a valid JSON string value.
Source yci/skills/_shared/customer-isolation/detect.sh in a subshell, with
the resolved environment variables set:
bash -c '
export YCI_ACTIVE_CUSTOMER="<ACTIVE_CUSTOMER>"
export YCI_DATA_ROOT_RESOLVED="<DATA_ROOT>"
source "${CLAUDE_PLUGIN_ROOT}/skills/_shared/customer-isolation/detect.sh"
echo "<synthetic-payload>" | isolation_check_payload
'
Capture the full stdout as DECISION_JSON.
Print DECISION_JSON verbatim.
If the decision is deny (the JSON contains "decision": "deny"), also print
a human-readable summary. The emitted JSON shape is:
{
"decision": "deny",
"collision": {
"active": "<active-customer>",
"foreign": "<foreign-customer>",
"kind": "path" | "token",
"evidence": "<offending-path-or-token>",
"resolved": "<realpath>", // path kind only
"category": "<fingerprint-category>" // token kind only
}
}
collision.kind from the JSON.kind == "path":
guard-path-collisioncollision.active, collision.foreign, collision.evidence,
collision.resolved from the JSON.yci/hooks/customer-guard/references/error-messages.md for
guard-path-collision, substituting the extracted values.kind == "token":
guard-fingerprint-collisioncollision.active, collision.foreign, collision.category,
collision.evidence from the JSON.yci/hooks/customer-guard/references/error-messages.md for
guard-fingerprint-collision, substituting the extracted values.If --dry-run was present in $ARGUMENTS, append the following note after the
decision output:
note: --dry-run active — this check is advisory only and did not consult the
actual hook runner. No tool call was blocked.
All user-visible errors use the catalog in
yci/hooks/customer-guard/references/error-messages.md. Surface script stderr
verbatim — do NOT reformat or add extra context.
yci/skills/_shared/customer-isolation/detect.sh — detection libraryyci/skills/customer-profile/scripts/resolve-customer.sh — tier resolveryci/skills/_shared/scripts/resolve-data-root.sh — data-root helperyci/hooks/customer-guard/references/error-messages.md — canonical error copyThis skill is a CHECKER — it does not mutate files, write profiles, or activate
customers. Its allowed-tools list intentionally excludes Write, Edit,
MultiEdit, and NotebookEdit.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub yandy-r/claude-infra-plugins --plugin yci