一键导入
code-quality
Use when formatting, linting, type checking, or reviewing code quality in the GAC project. Covers ruff, mypy, Makefile targets, and coding standards.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when formatting, linting, type checking, or reviewing code quality in the GAC project. Covers ruff, mypy, Makefile targets, and coding standards.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when adding a new AI provider to the GAC project (e.g. a new OpenAI-compatible inference service, Anthropic-compatible endpoint, or OAuth-based provider). Lists every file that must be created or edited and the exact registration steps required for the provider to appear in the registry, the `uvx gac init` flow, the README, and the test suite.
Use when debugging test failures, runtime errors, or unexpected behavior in the GAC project. Covers pytest debugging, logging, and common patterns.
Use when navigating the GAC codebase, finding where code lives, or understanding the project structure. 106 source files, 151 test files.
Use when running, writing, or debugging tests in the GAC project. Covers test structure, pytest commands, provider testing patterns, and integration vs unit test practices.
| name | code-quality |
| description | Use when formatting, linting, type checking, or reviewing code quality in the GAC project. Covers ruff, mypy, Makefile targets, and coding standards. |
| tags | ["linting","formatting","type-checking","code-standards"] |
make lint and make format run four tools, not just ruff:
make format # ruff check --fix + ruff format + prettier --write + markdownlint --fix
make lint # ruff check + ruff format --check + prettier --check + markdownlint --check
make type-check # mypy
make test # uv run -- pytest
Running uv run ruff check . alone does NOT equal make lint. CI runs all four.
uv run ruff check src/ # Lint
uv run ruff format src/ # Format
uv run mypy src/ # Type check
def parse_response(response: dict[str, Any]) -> str | None:
"""Parse API response and extract content."""
message = response.get("message", {})
return message.get("content")
snake_caseCapWordsUPPER_SNAKE_CASEdef generate(model: str, messages: list[dict]) -> tuple[str, int, int, int, int]:
"""Generate text using the AI provider.
Args:
model: Model name to use.
messages: List of message dictionaries.
Returns:
Tuple of (content, input_tokens, output_tokens, input_cost, output_cost).
"""
Split when exceeded — but don't split purely for line count if it hurts cohesion.
# 1. Make changes
# 2. Format + lint
make format
make lint
# 3. Type check
make type-check
# 4. Test
make test
# 5. Commit with gac (scope + yes)
gac -sy
Note: -s is --scope (infers commit scope), -y is --yes (skips confirmation). Not "short mode".
[ ] make format run?
[ ] make lint passes? (all 4 tools)
[ ] make type-check passes?
[ ] make test passes?
[ ] File length under 600 lines?
[ ] Type annotations on all functions?
[ ] Docstrings on public functions?