From 0ee54152b8d8bab30387baf486800c9170ce81ee Mon Sep 17 00:00:00 2001 From: Curtis Gray Date: Tue, 1 Sep 2026 04:29:54 -0400 Subject: [PATCH] fix(skill): defer semantic-extraction backend to detect_backend() (#2513) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The skill hardcoded a Gemini-only key check while graphify/llm.py auto-detects every backend plus registered custom providers (#1084). Step 3 now asks detect_backend() which backend the CLI would use and passes that name to extract_corpus_parallel; image chunks stay on subagents when the detected backend lacks vision support. Only tools/skillgen/fragments/core/core.md is edited by hand — everything else is 'python -m tools.skillgen' + '--bless' output. Claude-Session: https://claude.ai/code/session_0115RXPvhNCHAnc7AFn1ud3H --- graphify/skill-agents.md | 19 ++++++++++++++----- graphify/skill-amp.md | 19 ++++++++++++++----- graphify/skill-claw.md | 19 ++++++++++++++----- graphify/skill-codex.md | 19 ++++++++++++++----- graphify/skill-copilot.md | 19 ++++++++++++++----- graphify/skill-droid.md | 19 ++++++++++++++----- graphify/skill-kilo.md | 19 ++++++++++++++----- graphify/skill-kiro.md | 19 ++++++++++++++----- graphify/skill-opencode.md | 19 ++++++++++++++----- graphify/skill-pi.md | 19 ++++++++++++++----- graphify/skill-trae.md | 19 ++++++++++++++----- graphify/skill-vscode.md | 19 ++++++++++++++----- graphify/skill-windows.md | 19 ++++++++++++++----- graphify/skill.md | 19 ++++++++++++++----- .../expected/graphify__skill-agents.md | 19 ++++++++++++++----- .../skillgen/expected/graphify__skill-amp.md | 19 ++++++++++++++----- .../skillgen/expected/graphify__skill-claw.md | 19 ++++++++++++++----- .../expected/graphify__skill-codex.md | 19 ++++++++++++++----- .../expected/graphify__skill-copilot.md | 19 ++++++++++++++----- .../expected/graphify__skill-droid.md | 19 ++++++++++++++----- .../skillgen/expected/graphify__skill-kilo.md | 19 ++++++++++++++----- .../skillgen/expected/graphify__skill-kiro.md | 19 ++++++++++++++----- .../expected/graphify__skill-opencode.md | 19 ++++++++++++++----- tools/skillgen/expected/graphify__skill-pi.md | 19 ++++++++++++++----- .../skillgen/expected/graphify__skill-trae.md | 19 ++++++++++++++----- .../expected/graphify__skill-vscode.md | 19 ++++++++++++++----- .../expected/graphify__skill-windows.md | 19 ++++++++++++++----- tools/skillgen/expected/graphify__skill.md | 19 ++++++++++++++----- tools/skillgen/fragments/core/core.md | 19 ++++++++++++++----- 29 files changed, 406 insertions(+), 145 deletions(-) diff --git a/graphify/skill-agents.md b/graphify/skill-agents.md index 190827d9ac..101230d534 100644 --- a/graphify/skill-agents.md +++ b/graphify/skill-agents.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/graphify/skill-amp.md b/graphify/skill-amp.md index 190827d9ac..101230d534 100644 --- a/graphify/skill-amp.md +++ b/graphify/skill-amp.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/graphify/skill-claw.md b/graphify/skill-claw.md index abd2811d23..c688c846ae 100644 --- a/graphify/skill-claw.md +++ b/graphify/skill-claw.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/graphify/skill-codex.md b/graphify/skill-codex.md index af3f723c78..0a2985821d 100644 --- a/graphify/skill-codex.md +++ b/graphify/skill-codex.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/graphify/skill-copilot.md b/graphify/skill-copilot.md index abd2811d23..c688c846ae 100644 --- a/graphify/skill-copilot.md +++ b/graphify/skill-copilot.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/graphify/skill-droid.md b/graphify/skill-droid.md index fd148d485d..d61033d6fb 100644 --- a/graphify/skill-droid.md +++ b/graphify/skill-droid.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/graphify/skill-kilo.md b/graphify/skill-kilo.md index 3e70b050a4..697de99588 100644 --- a/graphify/skill-kilo.md +++ b/graphify/skill-kilo.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/graphify/skill-kiro.md b/graphify/skill-kiro.md index abd2811d23..c688c846ae 100644 --- a/graphify/skill-kiro.md +++ b/graphify/skill-kiro.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/graphify/skill-opencode.md b/graphify/skill-opencode.md index 91ced60675..8d29e97159 100644 --- a/graphify/skill-opencode.md +++ b/graphify/skill-opencode.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/graphify/skill-pi.md b/graphify/skill-pi.md index abd2811d23..c688c846ae 100644 --- a/graphify/skill-pi.md +++ b/graphify/skill-pi.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/graphify/skill-trae.md b/graphify/skill-trae.md index 050667bc20..2f6d123d24 100644 --- a/graphify/skill-trae.md +++ b/graphify/skill-trae.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/graphify/skill-vscode.md b/graphify/skill-vscode.md index 20c7c0835c..12285ce316 100644 --- a/graphify/skill-vscode.md +++ b/graphify/skill-vscode.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/graphify/skill-windows.md b/graphify/skill-windows.md index b09ecca3c4..82573b8794 100644 --- a/graphify/skill-windows.md +++ b/graphify/skill-windows.md @@ -181,14 +181,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```powershell +@' +from graphify.llm import detect_backend +print(detect_backend() or '') +'@ | & (Get-Content graphify-out\.graphify_python) - +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/graphify/skill.md b/graphify/skill.md index abd2811d23..c688c846ae 100644 --- a/graphify/skill.md +++ b/graphify/skill.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/tools/skillgen/expected/graphify__skill-agents.md b/tools/skillgen/expected/graphify__skill-agents.md index 190827d9ac..101230d534 100644 --- a/tools/skillgen/expected/graphify__skill-agents.md +++ b/tools/skillgen/expected/graphify__skill-agents.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/tools/skillgen/expected/graphify__skill-amp.md b/tools/skillgen/expected/graphify__skill-amp.md index 190827d9ac..101230d534 100644 --- a/tools/skillgen/expected/graphify__skill-amp.md +++ b/tools/skillgen/expected/graphify__skill-amp.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/tools/skillgen/expected/graphify__skill-claw.md b/tools/skillgen/expected/graphify__skill-claw.md index abd2811d23..c688c846ae 100644 --- a/tools/skillgen/expected/graphify__skill-claw.md +++ b/tools/skillgen/expected/graphify__skill-claw.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/tools/skillgen/expected/graphify__skill-codex.md b/tools/skillgen/expected/graphify__skill-codex.md index af3f723c78..0a2985821d 100644 --- a/tools/skillgen/expected/graphify__skill-codex.md +++ b/tools/skillgen/expected/graphify__skill-codex.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/tools/skillgen/expected/graphify__skill-copilot.md b/tools/skillgen/expected/graphify__skill-copilot.md index abd2811d23..c688c846ae 100644 --- a/tools/skillgen/expected/graphify__skill-copilot.md +++ b/tools/skillgen/expected/graphify__skill-copilot.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/tools/skillgen/expected/graphify__skill-droid.md b/tools/skillgen/expected/graphify__skill-droid.md index fd148d485d..d61033d6fb 100644 --- a/tools/skillgen/expected/graphify__skill-droid.md +++ b/tools/skillgen/expected/graphify__skill-droid.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/tools/skillgen/expected/graphify__skill-kilo.md b/tools/skillgen/expected/graphify__skill-kilo.md index 3e70b050a4..697de99588 100644 --- a/tools/skillgen/expected/graphify__skill-kilo.md +++ b/tools/skillgen/expected/graphify__skill-kilo.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/tools/skillgen/expected/graphify__skill-kiro.md b/tools/skillgen/expected/graphify__skill-kiro.md index abd2811d23..c688c846ae 100644 --- a/tools/skillgen/expected/graphify__skill-kiro.md +++ b/tools/skillgen/expected/graphify__skill-kiro.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/tools/skillgen/expected/graphify__skill-opencode.md b/tools/skillgen/expected/graphify__skill-opencode.md index 91ced60675..8d29e97159 100644 --- a/tools/skillgen/expected/graphify__skill-opencode.md +++ b/tools/skillgen/expected/graphify__skill-opencode.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/tools/skillgen/expected/graphify__skill-pi.md b/tools/skillgen/expected/graphify__skill-pi.md index abd2811d23..c688c846ae 100644 --- a/tools/skillgen/expected/graphify__skill-pi.md +++ b/tools/skillgen/expected/graphify__skill-pi.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/tools/skillgen/expected/graphify__skill-trae.md b/tools/skillgen/expected/graphify__skill-trae.md index 050667bc20..2f6d123d24 100644 --- a/tools/skillgen/expected/graphify__skill-trae.md +++ b/tools/skillgen/expected/graphify__skill-trae.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/tools/skillgen/expected/graphify__skill-vscode.md b/tools/skillgen/expected/graphify__skill-vscode.md index 20c7c0835c..12285ce316 100644 --- a/tools/skillgen/expected/graphify__skill-vscode.md +++ b/tools/skillgen/expected/graphify__skill-vscode.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/tools/skillgen/expected/graphify__skill-windows.md b/tools/skillgen/expected/graphify__skill-windows.md index b09ecca3c4..82573b8794 100644 --- a/tools/skillgen/expected/graphify__skill-windows.md +++ b/tools/skillgen/expected/graphify__skill-windows.md @@ -181,14 +181,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```powershell +@' +from graphify.llm import detect_backend +print(detect_backend() or '') +'@ | & (Get-Content graphify-out\.graphify_python) - +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/tools/skillgen/expected/graphify__skill.md b/tools/skillgen/expected/graphify__skill.md index abd2811d23..c688c846ae 100644 --- a/tools/skillgen/expected/graphify__skill.md +++ b/tools/skillgen/expected/graphify__skill.md @@ -154,14 +154,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.** diff --git a/tools/skillgen/fragments/core/core.md b/tools/skillgen/fragments/core/core.md index c527a12563..8d1a71ce72 100644 --- a/tools/skillgen/fragments/core/core.md +++ b/tools/skillgen/fragments/core/core.md @@ -113,14 +113,23 @@ Skip this step entirely if `detect` returned zero `video` files. When the corpus This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens). -> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. +> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses a CLI backend **only if** one of its keys is already set — the same `graphify.llm.detect_backend()` auto-detection `graphify extract` uses, covering every backend and registered custom provider, not just Gemini (#2513); otherwise the host agent itself is the LLM. graphify reads keys already present in the environment; it never asks for one. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one. -**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user: -> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`). +**Before semantic extraction:** ask the library which backend the CLI would use: -Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it. +```bash +$(cat graphify-out/.graphify_python) -c " +from graphify.llm import detect_backend +print(detect_backend() or '') +" +``` + +If it prints nothing (no key is set), print this one-liner to the user: +> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`) — any other backend key from the README works too. + +Print it once, then continue — do not wait for the user to supply a key. If a backend WAS detected, use `graphify.llm.extract_corpus_parallel(files, backend="NAME")` (substitute the detected name) for semantic extraction instead of dispatching subagents. The backend's default model applies — e.g. gemini → `gemini-3-flash-preview`, a custom provider → its registered `default_model`; the backend's model env var (`GRAPHIFY_GEMINI_MODEL`, `OPENAI_MODEL`, ...) or `--model` in headless CLI flows overrides it. Exception: if the detected backend has no vision support (`graphify.llm.BACKENDS["NAME"].get("vision")` is falsy), still dispatch image chunks to subagents per Part B — routing images through a non-vision backend silently drops the pixel data. -> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill. +> **Keys are detected, never requested.** When `detect_backend()` finds no backend, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a backend key or extract those inline yourself, but in no case prompt for one — that prompt is a misread of this skill. **Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.**