Latex paper collab check

From FOURTEEN1416/academic-agent-toolkit · View interactive version

Latex paper collab check is an AI agent skill from the GitHub repository FOURTEEN1416/academic-agent-toolkit. Verify that the external CLI collaborators are installed, authenticated, and API-reachable before starting a collaboration workflow; missing CLIs only skip that phase.

How to use this skill

Skill file

<!--ACAT-ADAPTED: 资产补齐自 yunshenwuchuxun/latex-paper-skills@d0f106108cb0(check-collaborators + _shared),正文未改。溯源见 references/UPSTREAM.md。2026-09-09 专项治理。2026-10-27 宿主叙事中性化(B′ 批遗留):Claude Code 探测节改写为通用外部协作者 CLI 可用性探测,其余 Claude 专名同步中性化;Gemini 探测链作为既定外部协作者保留。-->

Collaborator CLI Health Check

协作者定位:被检查的 CLI 是外部协作者,不是执行前提;任一缺位仅降级对应协作阶段,当前 Agent 可继续自审运行。

When to use

When not to use

Inputs

Outputs

Workflow

Run each configured collaborator's detection chain in parallel where possible.

For each collaborator, execute steps sequentially and short-circuit on the first failure — skip subsequent steps and mark the failure reason.

Step 0: Detect OS

Determine the platform to choose the correct binary-lookup command:

Detect via uname -s 2>/dev/null (returns nothing or errors on Windows) or check $OSTYPE.


Gemini Detection Chain

1. CLI Exists
# Unix
which gemini
# Windows
where gemini

Pass: command exits 0 and outputs a path.

Fail: command not found — suggest: npm install -g @google/gemini-cli or see https://github.com/google-gemini/gemini-cli

2. Version
timeout 15 bash -c 'GEMINI_CLI_NO_RELAUNCH=true gemini --version'

On Windows (no timeout command), run directly:

GEMINI_CLI_NO_RELAUNCH=true gemini --version

GEMINI_CLI_NO_RELAUNCH=true is required to prevent the CLI from hanging.

Pass: output contains a version string (e.g., 0.32.1).

Fail: timeout or no version output.

3. Auth

Check for any of the following (any one is sufficient):

  1. Environment variable GEMINI_API_KEY is set and non-empty.
  2. Environment variable GOOGLE_API_KEY is set and non-empty.
  3. File ~/.gemini/oauth_creds.json exists.
[[ -n "$GEMINI_API_KEY" ]] || [[ -n "$GOOGLE_API_KEY" ]]
test -f "$HOME/.gemini/oauth_creds.json"

Pass: any one condition is true.

Fail: none found — suggest: export GEMINI_API_KEY=<key> or run gemini interactively to complete OAuth.

4. API Connectivity
timeout 30 gemini --prompt "Reply with exactly: HEALTH_OK"

Pass: stdout contains HEALTH_OK.

Fail: timeout or no HEALTH_OK in output — suggest checking network, API key validity, or quota.

Note: Gemini CLI may emit warnings (e.g., skill conflict notices) in its output. These are benign and do not affect the health check. The pass/fail criterion is solely whether HEALTH_OK appears in stdout.


External Collaborator CLI Detection (Generic Pattern, Optional Enhancement)

The four-step pattern below applies to any collaborator CLI: detect command

existence and authentication state the same way regardless of which product

provides the CLI. Instantiate <collaborator-cli> with the actual command name,

and take install/auth specifics from that CLI's own documentation. The Gemini

chain above is one concrete instantiation of this pattern.

1. CLI Exists
# Unix
which <collaborator-cli>
# Windows
where <collaborator-cli>

Pass: command exits 0 and outputs a path.

Fail: command not found — suggest installing per the collaborator's official documentation (<install-command>).

2. Version
timeout 15 <collaborator-cli> --version

Pass: output contains a version string (e.g., 1.2.3).

Fail: timeout or no version output.

3. Auth

Check for any of the following (any one is sufficient):

  1. A credentials/profile file under the CLI's home directory.
  2. The API-key environment variable documented by that CLI.
  3. An auth/status subcommand reporting a logged-in state (e.g., <collaborator-cli> auth status, if the CLI provides one).

Pass: any one condition is true.

Fail: none found — suggest running <collaborator-cli> interactively to complete its login/OAuth flow.

4. API Connectivity
timeout 30 <collaborator-cli> <minimal-prompt-flag> "Reply with exactly: HEALTH_OK"

Pass: stdout contains HEALTH_OK.

Fail: timeout or no HEALTH_OK — suggest checking network, API key validity, or quota.

Note: if the collaborator CLI supports a spend/limit flag, leave headroom

above the per-call minimum cost floor. Limit values below that floor

(e.g., 0.01, 0.05) can trigger immediate budget-exceeded errors before

inference starts.


Output Format

Present a summary table after all checks:

| Collaborator | CLI | Version | Auth | API | Status    |
|--------------|-----|---------|------|-----|-----------|
| Gemini       | ✓/✗ | x.y.z   | ✓/✗  | ✓/✗ | Available / Failed |
| <collaborator-cli> | ✓/✗ | x.y.z | ✓/✗ | ✓/✗ | Available / Failed |

For any failed step, append actionable remediation advice below the table:

### Issues Found

**Gemini — Auth failed**
No API key or OAuth credentials detected.
→ Set `GEMINI_API_KEY` environment variable, or run `gemini` to complete OAuth login.

**<collaborator-cli> — CLI not found**
The collaborator CLI is not installed.
→ Install: `<install-command>` (per the collaborator's official docs)
→ Docs: the collaborator CLI's official documentation site

If all configured collaborators pass all checks:

All collaborator CLIs are available and ready for collaboration workflows.

Verification

Safety and guardrails

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.