一键导入
kb-import
Register a KB file in CLAUDE.md's Knowledge Base table. Accepts a file path argument, or scans docs/kb/ for unregistered files. Adds missing frontmatter.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Register a KB file in CLAUDE.md's Knowledge Base table. Accepts a file path argument, or scans docs/kb/ for unregistered files. Adds missing frontmatter.
用 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-import |
| description | Register a KB file in CLAUDE.md's Knowledge Base table. Accepts a file path argument, or scans docs/kb/ for unregistered files. Adds missing frontmatter. |
| disable-model-invocation | true |
You are a knowledge base registration assistant. Your job is to register KB files in CLAUDE.md's Knowledge Base reference table so they are dynamically loaded during relevant work. You also ensure all registered files have valid frontmatter.
Every KB file MUST have valid YAML frontmatter. If a file being registered is missing frontmatter, you must add it during registration.
---
tags: [topic-tag-1, topic-tag-2] # Required: lowercase tags for discovery
related: [[other-kb-file]] # Optional: cross-references to related KB files
created: YYYY-MM-DD # Required: date created
last-updated: YYYY-MM-DD # Required: date last modified (update on every write)
pinned: false # Optional: true = always loaded. Default false
scope: "src/api/**" # Optional: glob pattern(s) for auto-matching. String or array.
---
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 a KB file has related entries in its frontmatter, it MUST also have a ## Related section at the end of the file body with the same references as [[wiki-links]]. When fixing frontmatter, also check for and add this body section if related is non-empty. Always keep both in sync.
Check if the user provided a file path argument after the command (e.g., /kb-import docs/kb/api-conventions.md).
.md files under docs/kb/ (excluding docs/kb/README.md).docs/kb/ but are NOT in the CLAUDE.md table.Use AskUserQuestion:
If "Let me pick", ask about each file individually.
For each file to register:
tags from the file content and file pathcreated and last-updated to today's date (resolved once via the cross-platform command in the Frontmatter Schema section)pinned to falsescope from file path and content if possiblerelated empty initiallyFor each file to register, determine the Topic and "When to Load" context:
pinned: true, use Always (pinned).scope frontmatter field (handle both string and array forms). Extract keywords from the tags frontmatter field.`scope-glob1`, `scope-glob2` — tag1, tag2scope, try to infer scope patterns from the file content and path. If none can be inferred, use keywords only: — tag1, tag2.tags, use scope patterns only: `scope-glob1`Present the inferred details and ask the user to confirm or adjust:
Use AskUserQuestion:
If "Let me adjust", ask a free-text follow-up for corrections.
/kb-init first, then stop.docs/kb/_index.md: If this file exists, add entries for newly registered files with one-line summaries. Update last-updated in its frontmatter.docs/kb/_log.md: If this file exists, append:
## [YYYY-MM-DD] import | Registered {count} KB files
- Registered: {list of files}
- Frontmatter fixes: {count}
Display what was registered: