From 8609335a10d80fc370fe259452fcb7860be4ebe4 Mon Sep 17 00:00:00 2001 From: yunyaozhou Date: Tue, 14 Jul 2026 09:53:55 +0800 Subject: [PATCH] docs: add installation validation workflow --- SKILL.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/SKILL.md b/SKILL.md index f543b0a..67efcb5 100644 --- a/SKILL.md +++ b/SKILL.md @@ -11,7 +11,7 @@ Use this helper when image generation or editing should reach server6 directly i - Do not print, copy, commit, or summarize API keys. - Read only `OPENAI_API_KEY` from `~/.codex/auth.json`; do not read plaintext `.env` files or unrelated secrets. -- Keep the durable source at `ai-infra/skills/sources/shujkimagegen-api/`. +- Keep the durable source in the Gitea repo `shujakuin/skill-shujkimagegen-api`; treat `ai-infra/skills/sources/shujkimagegen-api/` and HOME runtime copies as managed mirrors. - Do not place this skill under the infra repo's `.agents/skills/` or manage it through cc-switch WebDAV. - Treat this as a thin wrapper around the system `imagegen` CLI; do not copy or patch the system script. - The current management state is repo source only. Do not create a HOME runtime placement unless the user explicitly requests it. @@ -54,6 +54,31 @@ The `/v1` suffix is required because `/models` is an application page while `/v1 After an explicit HOME runtime placement, use the equivalent path under `~/.agents/skills/shujkimagegen-api/`. +## Installation Validation + +After placing the skill in `~/.agents/skills/shujkimagegen-api/`, validate the installed copy before reporting success: + +1. Confirm `SKILL.md`, `agents/openai.yaml`, and `scripts/shujk_imagegen.py` exist. +2. Check whether the selected Python environment can import `openai`. Do not add it to an unrelated project's dependencies just for validation. If it is absent and `uv` is available, use an ephemeral environment: + + ```bash + uv run --with openai python ~/.agents/skills/shujkimagegen-api/scripts/shujk_imagegen.py \ + --print-config-redacted + ``` + +3. Run a no-cost command-path test: + + ```bash + uv run --with openai python ~/.agents/skills/shujkimagegen-api/scripts/shujk_imagegen.py \ + generate --prompt "installation validation" --out /tmp/shujkimagegen-dry-run.png \ + --dry-run --no-augment + ``` + +4. When the user authorizes a real API test, generate one low-cost image with `gpt-image-2`, `quality=low`, and a simple prompt. Confirm the command exits successfully and inspect the resulting file as a real, non-empty image. +5. Remove test artifacts that are not intended deliverables. + +If validation requires a compatibility fix, edit the standalone Gitea checkout first, rerun validation, commit and push it, then resync the infra mirror and selected runtime placement. Never leave the only fix in `~/.agents/skills/`. + ## Failure Handling - If `OPENAI_API_KEY` is absent, report that auth is unavailable without revealing file contents.