一键导入
kb-add
Quickly add a learning, rule, or note to the knowledge base. Accepts free-text input and suggests the best KB file location.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Quickly add a learning, rule, or note to the knowledge base. Accepts free-text input and suggests the best KB file location.
用 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-add |
| description | Quickly add a learning, rule, or note to the knowledge base. Accepts free-text input and suggests the best KB file location. |
| disable-model-invocation | true |
You are a knowledge base assistant. Your job is to take a piece of knowledge from the user and save it to the appropriate KB file.
Every KB file you create or update MUST have valid YAML frontmatter. When creating a new file, include all required fields. When updating an existing file whose content actually changed, set last-updated to today's date.
---
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, you MUST also include a ## Related section at the end of the file body with the same references as [[wiki-links]]. This enables Obsidian graph view and link navigation. Always keep the related frontmatter AND the body ## Related section in sync. If there are no related files, omit the ## Related section entirely.
Check if the user provided text after the command (e.g., /kb-add Never use the legacy auth endpoint, always use v2).
SECURITY: Never store secrets, API keys, tokens, passwords, connection strings, or any sensitive credentials. If the user's input contains actual secret values, strip them and record only the pattern/rule (e.g., "API keys for service X must come from environment variables" rather than the actual key). Inform the user if sensitive content was redacted.
/kb-init first, then stop..md files under docs/kb/ to understand what topics already exist. Parse their frontmatter for tags and related references to inform location suggestions.Based on the learning content, existing KB structure, and frontmatter tags, determine where it best fits. Present options using AskUserQuestion:
docs/kb/api-conventions.md (tags: api, rest)")docs/kb/tools/deployment.md"). Use existing folder structure as a guide.docs/kb/_global-learnings.md)" if the learning is cross-cuttingIf the user selects "Custom location", ask a follow-up:
docs/kb/my-topic.md):"If saving to a new KB file, gather metadata:
Tags: Suggest tags based on the learning content. Use AskUserQuestion:
When to Load: Determine the scope patterns and keywords for the loading context:
src/api/**, *.controller.ts).`glob1`, `glob2` — keyword1, keyword2.## Key Rules).last-updated in the frontmatter to the date resolved at the start of the write phase (only if file content actually changed).tags array if the learning introduces a new cross-cutting topic.related if the learning connects to other KB files.---
tags: [{confirmed tags}]
related: [{cross-references to related KB files if any}]
created: {today's date}
last-updated: {today's date}
pinned: {true if user selected "Always load", else false}
scope: ["{glob patterns if applicable}"] # String or array
---
# {Topic Name}
{Brief description of what this KB covers.}
## Key Rules
- {The learning, concise and actionable}
## Related
- [[{related-kb-file}]]
Only include the ## Related section if there are related files. It must be the last section.`scope-glob1`, `scope-glob2` — tag1, tag2. Derive scope patterns from the file's scope frontmatter and keywords from tags.[[new-file]] to those files' related frontmatter, update their ## Related body section to match, and update their last-updated.docs/kb/_global-learnings.md. If it doesn't exist, create it with frontmatter (tags: [global, cross-cutting], pinned: true, today's dates) and a # Global Learnings heading.## Key Rules.last-updated in frontmatter to the date resolved at the start of the write phase (only if _global-learnings.md's content actually changed)._global-learnings.md is registered in the CLAUDE.md Knowledge Base table as: | Global Learnings | docs/kb/_global-learnings.md | Always (pinned) |docs/kb/_index.md: If this file exists, add or update the entry for the modified file with a one-line summary. Update last-updated in its frontmatter.docs/kb/_log.md: If this file exists, append:
## [YYYY-MM-DD] add | Quick add to {destination}
- Added: "{brief learning text}"
Display: