From yci
Load, switch, and scaffold yci customer profiles. Use when the user runs /yci:switch, /yci:whoami, or /yci:init — or asks to see/change/create the active customer context. Resolves the active customer via the 4-tier precedence chain ($YCI_CUSTOMER > .yci-customer dotfile > MRU > refuse) and persists state to <data-root>/state.json. All downstream yci skills depend on this one — it is the load-bearing primitive for customer isolation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/yci:customer-profileThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill manages the active customer context for all yci workflows. It is the
references/_template.yamlreferences/error-messages.mdreferences/precedence.mdreferences/schema.mdscripts/init-profile.shscripts/load-profile.shscripts/profile-schema.shscripts/render-whoami.shscripts/resolve-customer.shscripts/state-io.shscripts/switch-profile.shtests/fixtures/acme-example.yamltests/fixtures/commercial-example.yamltests/fixtures/minimal.yamltests/helpers.shtests/run-all.shtests/test_compliance_adapter_resolution.shtests/test_init_profile.shtests/test_load_profile.shtests/test_render_whoami.shThis skill manages the active customer context for all yci workflows. It is the
load-bearing primitive for customer isolation — PRD §11.1 defines the authoritative
4-tier precedence chain ($YCI_CUSTOMER > .yci-customer dotfile > MRU state >
refuse) and PRD §5.2 defines the profile schema. Every downstream yci skill calls
resolve-customer.sh before touching any customer-scoped resource; a refusal from
that resolver propagates upward and aborts the workflow.
The skill takes a MODE as its first positional argument. If MODE is missing or unrecognised, print a one-line usage hint and exit 1.
switch <customer> — resolve, load, and activate the named customer profilewhoami — print the active customer context (who is currently active?)init <customer> — scaffold a new profile from references/_template.yaml<data-root> resolves via yci/skills/_shared/scripts/resolve-data-root.sh:
--data-root <path> flag (highest precedence)$YCI_DATA_ROOT env var~/.config/yci/ (default)Do NOT hardcode the path anywhere — always call the helper. See the shared helper for permission and canonicalization details.
Full spec: references/precedence.md (mirrors PRD §11.1).
Resolution stops at the first tier that yields a non-empty, valid value:
$YCI_CUSTOMER env var (trimmed; set, non-empty, and valid wins).yci-customer dotfile walk-up from $PWD; stops at $HOME or
/, whichever comes first; never ascends past $HOMEstate.json .active field at <data-root>/state.json (MRU)resolver-no-active-customer to stderr, exit 1Valid customer ID format: [a-z0-9][a-z0-9-]* (lowercase, hyphens only, no
leading hyphen, no underscore, no uppercase).
[a-z0-9][a-z0-9-]*. On failure: emit
init-invalid-customer-id (from references/error-messages.md) and exit 1.resolve-data-root.sh.load-profile.sh <data-root> <customer> to load and validate the YAML.
loader-missing-file.loader-malformed-yaml.loader-missing-required-key.loader-invalid-enum-value.state_write_active <data-root> <customer>
(from state-io.sh) to persist the active customer.
state-write-permission-denied.yci: switched to <customer> (<engagement.id>, <compliance.regime>, <safety.default_posture>)resolve-data-root.sh.resolve-customer.sh --data-root <data-root> to determine the active
customer via the 4-tier chain.whoami-no-active-customer from references/error-messages.md and exit 1.load-profile.sh.render-whoami.sh to print the human-readable context summary.[a-z0-9][a-z0-9-]*. On failure: emit
init-invalid-customer-id and exit 1._ (e.g., _internal, _template) unless
--allow-reserved was passed. On rejection: emit init-reserved-id and exit 1.resolve-data-root.sh.<data-root>/profiles/<customer>.yaml already exists. If it does
and --force was not passed: emit init-profile-exists and exit 1.init-profile.sh <data-root> <customer> [--force] to copy the template.references/schema.md for required fields.<TODO: ...> placeholder before running
/yci:switch <customer>.All user-visible errors come from references/error-messages.md. When a script
exits non-zero, surface its stderr verbatim — do NOT reformat or add extra context.
The user must see the same text catalogued in the reference doc.
Exit-code convention (from error-messages.md):
| Exit | Meaning |
|---|---|
| 0 | success |
| 1 | resolver refusal or user-input error (invalid id, overwrite) |
| 2 | schema violation (malformed YAML, missing key, bad enum value) |
| 3 | runtime / environment error (pyyaml missing, permission denied) |
The following scripts are not yet installed (land in B5):
scripts/load-profile.shscripts/render-whoami.shscripts/init-profile.shUntil B5 merges, the switch, whoami, and init workflows cannot complete.
If invoked before B5 lands, inform the user:
"yci:customer-profile requires load-profile.sh, render-whoami.sh, and init-profile.sh (shipping in B5). Run
./scripts/validate.sh --only ycito check installation status."
Then exit 1 without touching any data. The scripts already present
(resolve-customer.sh, state-io.sh, profile-schema.sh) are functional.
references/schema.md — profile schema (PRD §5.2 mirror)references/precedence.md — resolver precedence spec (PRD §11.1 mirror)references/error-messages.md — canonical error copyreferences/_template.yaml — init scaffoldscripts/resolve-customer.sh — tier resolverscripts/state-io.sh — state.json atomic I/Oscripts/profile-schema.sh — schema constants../_shared/scripts/resolve-data-root.sh — data-root helper<data-root>/profiles/<customer>.yaml with
their text editor. This skill does not provide an edit mode./yci:list yet; use ls <data-root>/profiles/./yci:remove yet; users delete the YAML file
manually and prune state.json by switching to another customer (which rewrites
.active and dedupes MRU).credential_ref pointers into the
active vaults subtree.resolve-customer.sh first and aborts on non-zero exit..yci-customer dotfile walk-up never ascends past $HOME, preventing
ambient configuration from a shared or multi-user environment from leaking into
the session.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