Implements cc-rules v1.4's 第五律 5.5 project overlay requirement. - CLAUDE.md: declare release_kit: YAML block (version_source, changelog, release_channel, docs_source, resource_lists, new_feature_doc_expectations, bootstrap_quirk_policy) - .github/PULL_REQUEST_TEMPLATE.md: add 5.3 user-visible-change self-check section with reviewer gate instruction - .github/workflows/release.yml (NEW): auto-create GitHub Release from CHANGELOG.md section on v* tag push. Idempotent (checks if release already exists). Closes the gap that caused v3.9.0 / v3.10.0 / v3.11.0 to each miss their GH Release. Governance-only change. No code, no user-visible behavior change (the workflow only fires on future tags). No README update needed. Co-authored-by: Tao Deng <dtzp555@gmail.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
5.4 KiB
OCP Project Session Instructions
WARNING — READ BEFORE WRITING ANY CODE IN THIS REPO
Before touching
server.mjsor any network-facing surface, read./ALIGNMENT.mdin full. The constitution is binding. Non-compliant commits are reverted.
Before starting any task
- Read
./ALIGNMENT.md. Internalize the five Rules and the 2026-04-11 drift lesson. - Run
/dev-start <task description>to get a pre-flight plan that incorporates the iron rules,SKILL_ROUTING.md, this file, andALIGNMENT.md. - If the task touches
server.mjs, locate the correspondingcli.jsreference before drafting any code. No code is written ahead of thegrep cli.jsevidence.
Hard requirements for server.mjs changes
Every PR that modifies server.mjs must satisfy all three of the following. A PR missing any one of them is blocked from merge.
cli.jscitation. The commit message and PR body declare the correspondingcli.jsfunction name and line number range, using the formatcli.js:NNNNorcli.js vE4 <functionName>. Ifcli.jsdoes not perform the operation, the PR must state this explicitly and justify scope underALIGNMENT.mdRule 2 (in practice, this almost always means the PR should be closed).- CI blacklist pass. The
alignment.ymlworkflow must pass. The workflow grepsserver.mjsfor known-hallucinated tokens (includingapi/oauth/usageandapi/usage) and fails the build on any hit. Do not suppress the workflow. Do not add allowlist entries without an amendment PR toALIGNMENT.md. - Independent reviewer (Iron Rule 10). The implementation author may not self-approve. A separate reviewer — human or a subagent spawned with a fresh context — must read the diff, verify the
cli.jscitation by openingcli.jsat the cited lines, and explicitly approve. A review comment that does not confirm thecli.jscitation was checked is not a valid approval.
Iron rules in force
This repo operates under the CC Development Iron Rules (CC 开发铁律) v1.3. Three rules are load-bearing for OCP work:
- Iron Rule 10 (Code Review). Every implementation phase has an independent reviewer. Self-review does not count. See
server.mjshard requirement #3 above. - Iron Rule 11 (Incremental Diff Review). Non-trivial work is split into the minimum reviewable unit — one PR per layer per severity.
ALIGNMENT.md,CLAUDE.md, the PR template, and the CI workflow are therefore shipped as the same constitutional PR (they are one layer: governance), but any subsequentserver.mjsremediation lands as its own PR. - Iron Rule 12 (Pre-Brainstorm Prior-Art Search). Before proposing any new endpoint or header, search GitHub, Anthropic docs, and the
cli.jsbundle. For OCP specifically, thecli.jsgrep is the decisive search: if it does not hit, Rule 2 of the constitution applies.
The full iron rules are at ~/.claude/CC_DEV_IRON_RULES.md (symlinked from the cc-rules repo on Tao's workstations). Load them into session context with /cc-rules when needed.
Skills relevant to this repo
/dev-start— pre-flight planning, always first./cc-rules— load the iron rules into context./agent-dispatch— pick the correct model (opus for design and review, sonnet for straightforward edits, haiku for mechanical chores) before spawning any subagent./cc-mem search <keyword>— look up cross-machine memory for prior decisions, especially prior drift incidents.
Commit message conventions
- Subject line uses Conventional Commits (
fix:,feat:,docs:,refactor:,chore:). - Any assertion of the form "Claude Code uses X" or "cli.js uses X" in the body must be immediately followed by a citation in the form
cli.js:NNNNorcli.js vE4 <functionName>. CI performs a soft check for this pattern on all commits in the PR. - Co-author trailer is required for LLM-assisted commits (
Co-Authored-By: Claude <model> <noreply@anthropic.com>).
Project-level escalation
If a design decision cannot be resolved by reference to cli.js and ALIGNMENT.md, escalate to Tao (老大) via /cc-chat rather than guessing. Silent guessing is what produced the 2026-04-11 drift.
Release kit overlay (CC 开发铁律 第五律 5.5)
This project's overlay per iron rule v1.4's 5.5. Machine-checkable declaration.
release_kit:
version_source: package.json
changelog: CHANGELOG.md
release_channel:
type: github-release
tag_format: v{semver}
auto_create_on_tag_push: true # via .github/workflows/release.yml
docs_source: README.md
resource_lists:
- name: Available Models table
location: README.md § "Available Models"
source_of_truth: models.json
- name: API Endpoints table
location: README.md § "API Endpoints"
- name: Environment Variables table
location: README.md § "Environment Variables"
new_feature_doc_expectations:
- new CLI subcommand → README § "All Commands" + usage example
- new env var → README § "Environment Variables" table
- new auto-sync / hook → dedicated §, must document trigger + manual invocation + opt-out + any bootstrap quirk
- new endpoint → README § "API Endpoints" table + any relevant Config/Troubleshooting §
- new file / SPOT / schema → Architecture or contributor § with link
bootstrap_quirk_policy:
- any one-time migration quirk → README § "Troubleshooting"