conventions
星标0
分支0
更新时间2026年6月10日 08:10
Discover project conventions and configure .pk.json by analyzing the codebase
安装
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
SKILL.md
readonly菜单
Discover project conventions and configure .pk.json by analyzing the codebase
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | conventions |
| description | Discover project conventions and configure .pk.json by analyzing the codebase |
| disable-model-invocation | true |
| pk_sha256 | c7066f9f38f16a07738fc397473e9eef27e0b3d1f8f4003998fc5a27b6e0dff2 |
Analyze this project and generate or refresh the Project Conventions section in CLAUDE.md.
Run this after pk setup to add project-specific conventions, or re-run anytime as the project evolves.
# CLAUDE.md
IMPORTANT: Follow these rules at all times.
## Critical Rules
- NEVER take shortcuts without asking. STOP, ASK, WAIT for approval.
- NEVER force push. Make a new commit to fix mistakes.
- NEVER commit secrets to version control.
- Only do what was asked. No scope creep.
- Understand existing code before changing it.
- If you don't know, say so. Never guess.
- Test before and after every change.
- Surface errors clearly. No silent fallbacks.
## Project Conventions section already exists, read it carefully — this is a refresh, not a blank slate. Preserve conventions that are still accurate, update what has changed, and add anything new..github/workflows/) — whether GitHub Actions are pinned to commit SHAs or use mutable tags, and whether Dependabot is configured for GitHub Actions updatesmain, develop)main, production)main).pk.json based on step 4 answers. If the user specified no protected branches, no release branch, and no custom changelog types, skip this step — do not create an empty .pk.json. Otherwise include only the opted-in keys: {"guard": {"branches": [...]}}, {"release": {"branch": "..."}}, {"changelog": {"types": [...]}}. If .pk.json already exists, merge the keys — do not overwrite existing config. Field-merge the guard object: pk setup writes guard.mode and guard.push (and preserve.mode) into .pk.json, so when you add guard.branches merge it into the existing guard object and keep those mode fields — never replace the whole object. Sort top-level keys alphabetically.## Project Conventions section with the discovered conventions. Each convention should be a concise bullet point. Group technical conventions and business/domain rules under separate subheadings. Only include a "never commit directly to X" convention if the user specified protected branches in step 4.git tag --list 'v*' --sort=-v:refname. If the output is empty or nothing parses as semver, tell the user: "No version tags found. To anchor pk changelog, run pk setup --baseline --push. Use --at <ref> to fold prior commits into the first changelog entry." This is advisory — do not run the command from the skill. Remote state changes belong in explicit user-invoked commands.## Project Conventions section already exists, replace it with the updated version — do not duplicate it.<!-- pk:sha256:... -->, remove it. Once customized, the file is user-owned and the marker is stale..pk.json with configured commit types, include them in the conventions.pk release to trunk flow.guard.branches, release branch configures release.branch, custom changelog types configures changelog.types. Default commit types: build, chore, ci, deprecate, docs, feat, fix, perf, plan (hidden), refactor, revert, security, style, test.@v4), report this to the user as a security finding — mutable tags are vulnerable to supply chain attacks. If .github/dependabot.yml is missing or does not cover GitHub Actions, mention it as a way to keep pinned SHAs current. Include relevant conventions in the draft if the project has workflow files.