一键导入
kb-query
Query the knowledge base with a question. Synthesizes an answer from relevant KB files and optionally files the result back as a new KB article.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Query the knowledge base with a question. Synthesizes an answer from relevant KB files and optionally files the result back as a new KB article.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Open a PR for the current branch, then loop on Codex Code Review until it comes back clean: resolve each finding, reply, and re-request review with a single @codex review once the whole pass is handled. Use when a feature branch is ready to ship and Codex Code Review is enabled on the repository.
Scaffold the repo side of Xcode Cloud for an XcodeGen / Tuist Swift project - generate ci_scripts/ci_post_clone.sh (regen + guarded CI_BUILD_NUMBER stamping), propose a unit-test-only CI scheme, print the exact App Store Connect workflow checklist, and optionally install an opt-in .githooks/pre-push gate. Shows diffs and confirms before writing.
Review Swift 6 strict-concurrency and SwiftUI code for idiom and build-breaking issues - non-Sendable across actor boundaries, @MainActor witness vs nonisolated protocol requirements, Combine/ObservableObject usage, force-unwraps, #Predicate macro limits, the 6.3.x Binding IRGen crash, missing #if os() guards, and unsafe escape hatches. Reports file:line with the fix and the why.
Diagnose a Swift / Xcode Cloud / TestFlight failure from a pasted red build log, an ITMS App Store rejection email, or a bare error code. Maps symptoms to root cause (ITMS-90242/90296/90683, errSec keychain codes, ad-hoc entitlement rejections, missing ci_scripts, signing errors) and prescribes the exact fix.
Audit a Swift / iOS / macOS repo for Xcode Cloud and TestFlight release blockers before upload - pbxproj drift, static build numbers, missing ci_scripts, macOS App Store entitlements/Info.plist, headless-CI keychain tests, ad-hoc signing entitlement rejections, and flaky-UITest release gating. Reports PASS/WARN/FAIL with file:line and fixes.
Run the right local verification gate for a Swift project - detect XcodeGen vs plain .xcodeproj vs SwiftPM vs Tuist, then regenerate (if applicable), swiftformat --lint, swiftlint --strict, and xcodebuild test on the cheapest valid destination (macOS for pure-Swift) or swift build/test for SwiftPM. Reports each stage; --fix lets SwiftFormat rewrite.
| name | kb-query |
| description | Query the knowledge base with a question. Synthesizes an answer from relevant KB files and optionally files the result back as a new KB article. |
| disable-model-invocation | true |
You are a knowledge base query engine. Your job is to answer questions by reading and synthesizing relevant KB files, then optionally filing valuable answers back into the wiki so explorations compound into the knowledge base.
If filing an answer back as a KB page, use this frontmatter:
---
tags: [topic-tag-1, topic-tag-2] # Required: lowercase tags for discovery
related: [[source-kb-file]] # Required: cross-references to KB files used in synthesis
created: YYYY-MM-DD # Required: date created
last-updated: YYYY-MM-DD # Required: date last modified
pinned: false # Optional: default false
scope: "src/api/**" # Optional: glob pattern(s) for auto-matching. String or array.
type: synthesis # Required for filed queries: marks this as a synthesized answer
query: "the original question" # Required for filed queries: the question that prompted this
sources: [[file1], [file2]] # Required for filed queries: KB files consulted for the answer
---
Resolving today's date (cross-platform, CRITICAL): Never guess, infer, or increment prior dates. When this skill writes created / last-updated, resolve today's date once at the start of the write phase, then reuse that single value for every write. Try these commands in order and use the first that returns a YYYY-MM-DD string:
date +%Y-%m-%dGet-Date -Format 'yyyy-MM-dd'powershell -NoProfile -Command "Get-Date -Format 'yyyy-MM-dd'"node -e "console.log(new Date().toISOString().slice(0,10))" or python -c "import datetime; print(datetime.date.today().isoformat())"Only update last-updated when the file's content actually changed. If an edit would leave the file byte-identical, do not rewrite it or bump the date.
When filing an answer with related entries in frontmatter, include a ## Related section at the end of the file body with matching [[wiki-links]]. Keep frontmatter and body section in sync.
Check if the user provided a question after the command (e.g., /kb-query How does the auth flow work?).
docs/kb/ directory: If it doesn't exist, inform the user to run /kb-init first and stop..md files under docs/kb/ (excluding README.md, _index.md, _log.md). If none exist, inform the user: "No KB articles found. Add knowledge first with /kb-learn, /kb-add, or /kb-discover." and stop.Use a multi-signal approach to find the most relevant KB files:
docs/kb/_index.md if it exists — this is the fastest way to understand what's in the KB. Scan the summaries and categories to identify potentially relevant pages._index.md doesn't exist, read the CLAUDE.md Knowledge Base table for the page catalog.related references to files you haven't read yet that seem pertinent, read those too._global-learnings.md if it exists — check for any cross-cutting rules relevant to the question.Compose a comprehensive answer:
[[wiki-links]] (e.g., "According to [[server-tick-architecture]], the tick loop runs at 600ms...")./kb-* commands could fill the gap (e.g., "The KB doesn't cover deployment. You could run /kb-discover src/deploy/ or /kb-harvest to add this knowledge.").Present the synthesized answer to the user.
After presenting the answer, offer to save it as a KB article. Use AskUserQuestion:
When to encourage filing: If the answer required synthesizing 3+ KB files, or if it produced a comparison, architectural overview, or decision rationale that would be valuable to reference later.
When NOT to encourage filing: If the answer was trivial, just quoted a single KB file, or is too specific to this moment to be reusable. In these cases, still offer but don't push.
If the user chooses "Skip", append a log entry (Step 7) and stop.
If the user chose to save:
Suggest a path under docs/kb/. Prefer subfolder organization:
docs/kb/architecture/, docs/kb/conventions/, etc.)docs/kb/architecture/auth-flow-overview.md)Use AskUserQuestion:
Reformat the answer into KB style:
[[wiki-links]]Add frontmatter with:
type: synthesis to mark this as a filed query resultquery: "the original question" for contextsources: [[file1], [file2]] listing all KB files consultedrelated pointing to the most relevant source KB filestags and scopecreated and last-updatedAdd ## Related body section mirroring the related frontmatter.
Add reverse cross-references: Update the related frontmatter and ## Related body sections of the source KB files to point back to this new synthesis article. Update their last-updated to the resolved date (only for files that actually changed).
`scope-glob1`, `scope-glob2` — tag1, tag2. For synthesis articles, use the scope and tags of the source files that contributed most to the answer. For pinned files, use Always (pinned).docs/kb/_index.mdIf _index.md exists, add an entry for the new article in the appropriate category section with a one-line summary.
docs/kb/_log.mdIf _log.md exists, append:
## [YYYY-MM-DD] query | {brief topic}
- Question: "{the original question}"
- Consulted: {list of KB files read}
- Result: {Filed as docs/kb/path/file.md | Not filed}
Display: