Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

ghmock

БесплатноБез исполняемых скриптовНе проверен

Use when reproducing GitHub CLI behavior with synthetic API, Git or configuration fixtures, comparing CLI builds, testing prompts, or exporting ghmock…

cliот cli★ 47 389 звёзд на GitHub

Об этом скилле

Reproduce gh behavior with ghmock

Run real gh executables against controlled test data. Establish what happened from their output, exit statuses, requests and retained state, not from a plausible fixture or a successful helper invocation.

Establish the boundary

ghmock routes API and Git traffic but is not a sandbox. gh, Git, extensions and aliases can start other programs or bypass proxy settings. Require an externally enforced network/filesystem sandbox before running issue-supplied commands. Do not treat the command allowlist as that boundary.

Use synthetic accounts, tokens, repositories and files. Never copy the operator's configuration, credentials or Git checkout into a fixture. Configuration fixtures do not isolate an OS keyring.

Use example.invalid as the owner of synthetic GitHub repositories, including their API response URLs. GitHub account names cannot contain periods, so this namespace cannot refer to a real account. The triage publisher recognizes it as test data without rewriting captured output or looking up a real repository. Keep github.com as the host. If the reported repository name matters to the behavior, preserve it; real GitHub references still require visibility checks.

Use a task-owned GHMOCK_DIR; the default temporary state directory may be shared with another investigation. ghmock reset deletes all responses, logs, saved runs and retained Git/configuration state there.

Use the supplied helper and approved gh builds. If setup is needed, prepare them outside the sandbox with the repository's declared Go toolchain:

work=$(mktemp -d)
go -C script/ghmock build -o "$work/ghmock" .
export PATH="$work:$PATH"
export GHMOCK_DIR="$work/state"

These are host-shell preparation commands, not commands to force through a restricted agent shell. Provide cached schemas through GHMOCK_GRAPHQL_SCHEMA and GHMOCK_REST_SCHEMA when the sandbox cannot download them. Do not disable checks to hide missing schemas.

Run ghmock --help and read the complete output before using the helper. In the issue-triage environment, read /opt/ghmock/builds.txt for the executable paths and versions already verified by preparation. Use that inventory instead of running version probes; builds absent from it are unavailable for the run. source is the selected checkout, not necessarily the default branch. Record the actual versions and revisions; do not assume a reported build is available.

Build the smallest useful API fixture

  1. State the reported command, required initial conditions and expected observation. Separate the reporter's explanation from the hypothesis being tested. Set a finite iteration budget and command timeout.
  2. Run the command with an approved executable and inspect its report. ghmock run exits nonzero for helper failures; the tested gh exit status is inside the report. Helper success does not mean gh succeeded.
  3. Use ghmock log --full or --json to read the actual requests. ghmock scaffold --missing adds missing responses and requested GraphQL fields for the latest completed run.
  4. Change only values relevant to the hypothesis with ghmock set. Check fields with ghmock schema. Run the command again after changing the data.
  5. Continue until the reported behavior itself is observed, or explain the unsupported dependency. An early missing-response error is not a reproduction of a later crash.

For example, set GH_BUILD to an approved executable, then exercise a known GraphQL operation:

ghmock run --gh "$GH_BUILD" -- api graphql \
  -f 'query=query Example { viewer { login } }'
ghmock scaffold --missing
ghmock schema User.login
ghmock set 'graphql Example' --at data.viewer.login --json '"monalisa"'
ghmock run --gh "$GH_BUILD" -- api graphql \
  -f 'query=query Example { viewer { login } }'
ghmock log --full

Use request names from the log. REST names are METHOD /path on the API host; other hosts remain in the name. GraphQL names use the selected operation, such as graphql Example. Fixtures are not conditional matches on arbitrary headers, query parameters or variable values. Use --append for successive responses, or --index N to edit one; each build starts from the first response and repeats the last when it exhausts the sequence.

Scaffolding supplies placeholders, not observed GitHub data. Lists generally contain one item and pagination stops by default. Configure additional pages when the behavior needs them. A not-found GraphQL lookup may need both a null data field and an errors entry.

Normal GraphQL responses are trimmed to selected fields. Use --off-schema only when deliberately testing a response outside the schema; state why it is necessary. Read request and response diagnostics even when gh exits zero: the helper can serve a stored response to a query GitHub would reject.

Compare builds

Repeat --gh to run equivalent conditions through separate executables:

`

Полный SKILL.md на GitHub

Установить ghmock в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл ghmock?

Use when reproducing GitHub CLI behavior with synthetic API, Git or configuration fixtures, comparing CLI builds, testing prompts, or exporting ghmock evidence. Not for live GitHub operations or terminal recordings.

Как установить скилл ghmock?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ghmock запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить ghmock с