en un clic
ln-005-environment-scanner
Probes CLI agents (Codex, Gemini) and writes docs/environment_state.json — agent availability config for Phase 0
Menu
Probes CLI agents (Codex, Gemini) and writes docs/environment_state.json — agent availability config for Phase 0
| name | ln-005-environment-scanner |
| description | Probes CLI agents (Codex, Gemini) and writes docs/environment_state.json — agent availability config for Phase 0 |
| license | MIT |
Paths: File paths (
shared/,references/,../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.
Type: Standalone Utility Category: 0XX Shared
Probes CLI agents (Codex, Gemini) and writes docs/environment_state.json. Skills read this file to check disabled flags before live-probing agents.
docs/environment_state.json yet)ln-004-agent-config-sync (sync may change agent availability)docs/environment_state.json — validated against references/environment_state_schema.json.
{
"$schema": "environment_state_v1",
"scanned_at": "2026-03-08T14:30:00Z",
"agents": {
"codex": { "available": true, "version": "0.1.2503" },
"gemini": { "available": false, "detail": "Command not found in PATH" }
}
}
Users can add "disabled": true to any agent entry to opt out without losing detection state:
"codex": { "available": true, "disabled": true, "version": "0.1.2503" }
Scanner preserves disabled field on rescan — it overwrites available, detail, version but never touches disabled.
How skills use this: Before running --health-check, skills read this file. If disabled: true → agent is skipped immediately (no probe). If disabled: false or absent → live health-check runs.
Probe Agents → Write JSON → Summary
Single call to agent_runner.py --health-check probes all registered agents:
python shared/agents/agent_runner.py --health-check
Path resolution: shared/agents/agent_runner.py is relative to skills repo root. Locate via this SKILL.md directory → parent.
Parse output (JSON with per-agent status):
| Agent | Registry Key | State Fields |
|---|---|---|
| Codex | codex (checks codex --version) | available, version (first line of version output) |
| Gemini | gemini (checks gemini --version) | available, version (first line of version output) |
If agent_runner.py not found or errors: Set both agents to available: false, detail: "agent_runner.py not available".
docs/environment_state.json exists):
disabled fields from existing entries$schema: "environment_state_v1"scanned_at: current ISO 8601 timestampagents: merge probe results (new available/detail/version) with preserved disabled flagsdocs/ directory exists (create if missing)docs/environment_state.json with 2-space indentationreferences/environment_state_schema.json structure (key presence check)Display results as a table:
Environment Scan Complete:
| Agent | Status | Detail |
|--------|-------------|---------------------------|
| Codex | available | 0.1.2503 |
| Gemini | unavailable | Command not found in PATH |
State written to: docs/environment_state.json
If any agent has disabled: true, show status as disabled (not available/unavailable).
disabled. Never overwrite user's disabled: true flags. Detection state updates, user preference stays.docs/environment_state.json. No other files modified.available: false entry, scan continues.| DON'T | DO |
|---|---|
| Skip probes for "known" agents | Always probe all agents — this is a full scan |
Delete disabled flags on rescan | Merge: overwrite detection fields, preserve disabled |
| Retry failed probes | One attempt per agent. Failure = available: false |
| Probe MCP tools or platform | Only probe CLI agents (Codex, Gemini). MCP tools configured elsewhere |
| Add TTL or cache expiry logic | State is manual-refresh only |
| # | Criterion |
|---|---|
| 1 | Both agents probed (Codex, Gemini) |
| 2 | docs/environment_state.json written with valid structure |
| 3 | Existing disabled flags preserved across rescan |
| 4 | Summary table displayed to user |
Version: 2.0.0 Last Updated: 2026-03-08
Research best practices via MCP Ref/Context7/WebSearch and create documentation (guide/manual/ADR/research). Single research, multiple output types.
Commit and push ALL changes (staged + unstaged + untracked) to the remote repository
Sync skills (symlinks) and MCP settings from Claude to Gemini CLI and Codex CLI
Top orchestrator for complete doc system. Delegates to ln-110 coordinator (project docs) + ln-120-150 workers. Phase 3: global cleanup. Idempotent.
Meta-orchestrator: reads kanban board, lets user pick ONE Story, drives it through pipeline 300->310->400->500 via TeamCreate. Creates worktree isolation; coordinates workers + reports.
Coordinates project documentation creation. Gathers context once, detects project type, delegates to specialized workers (ln-111-115).