Base Cursor “implements” repo for agentic coding workflows.
Chinese docs: README.zh-CN.md.
Kit version: see VERSION / CHANGELOG.md. Agent entrypoint: AGENTS.md.
# copy into target project (creates target dir if missing)
scripts/copy-cursor.sh /path/to/target-project
# overwrite target .cursor/
scripts/copy-cursor.sh /path/to/target-project --force
# merge into existing .cursor/ (overwrite overlapping files)
scripts/copy-cursor.sh /path/to/target-project --merge
# skip Go fmt pre-commit hook (non-Go projects)
scripts/copy-cursor.sh /path/to/target-project --force --skip-go-fmt
# preview only
scripts/copy-cursor.sh /path/to/target-project --dry-runAlso copies AGENTS.md, VERSION, CHANGELOG.md, and templates/ when present.
This repo ships role rules under .cursor/rules/ to standardize plan → implement → verify.
workflow-bootstrap(alwaysApply): short pointer toAGENTS.mdand the mainline.orchestrator: role chaining / copy-paste prompt library (planner→implement→verify→PR).planner: turn requirements into an executableIMPLEMENTATION_PLAN.md(steps, acceptance criteria, risks, rollback, test plan). No code changes beforeACT.implementer: convertIMPLEMENTATION_PLAN.mdinto high-quality code afterACT, with minimal changes, tests, and objective acceptance checks.verifier: validate implementation against plan and evidence; outputs Pass/Fail/Blocked with gaps and next actions.debugger: evidence-driven root-cause analysis and minimal fix strategy with reproducible verification.test-runner: run the smallest sufficient test set, summarize results, and map failures back to changes.security-auditor: lightweight security audit (auth, input validation, secrets, dependency risk) with actionable fixes.code-reviewer: high-signal review focused on correctness, contracts, security, performance, maintainability, and plan alignment.
pr-author: produce high-quality PR title/body (summary, test plan, risks, rollback, screenshots/demos).release-manager: rollout/migration/flags/monitoring/rollback guidance to ship safely.
refactorer: behavior-preserving refactors with guardrail tests, small steps, and rollback points.
frontend-engineer: frontend delivery focusing on a11y, performance, consistency, and verifiable UI acceptance.backend-engineer: backend delivery focusing on API contracts, auth, idempotency, reliability, and observability.api-designer: stable, evolvable API specs with examples, compatibility and migration strategy.ux-reviewer: usability and interaction review with actionable improvements and validation steps.qa: manual test cases + regression checklist covering risks, edges, and reproducible expectations.
See AGENTS.md for a short RACI between overlapping roles.
- Use
plannerto produceIMPLEMENTATION_PLAN.md(template:templates/IMPLEMENTATION_PLAN.md). - Say
ACTto allowimplementerto start coding. - As needed, use
api-designer/frontend-engineer/backend-engineerduring implementation to keep contracts and UX consistent. - Use
test-runner,qa,code-reviewer,security-auditor, andverifierto validate before shipping. - Use
release-managerfor rollout/migrations/flags/monitoring andpr-authorto finalize PR content.
Project skills live under .cursor/skills/ and travel with scripts/copy-cursor.sh.
| Skill | Path | When to use |
|---|---|---|
git-commit |
.cursor/skills/git-commit/ |
Conventional commits: analyze diff, stage intelligently, write the message. Triggered by “commit these changes” / “commit code” / “提交代码” (also via Commit Skill Injector hook). |
create-pr |
.cursor/skills/create-pr/ |
Open a GitHub PR with gh (push if needed, pr-author-style body). |
shitcode-scan |
.cursor/skills/shitcode-scan/ |
Quantify tech debt / code smells (8 dimensions + worst files/functions with path:line). |
# Example: scan a repo for tech debt (run from the skill directory, or pass the script path)
python3 .cursor/skills/shitcode-scan/scripts/shitcode_scorer.py /path/to/repo --top 15This repo includes project-level hooks in .cursor/hooks.json to make the workflow more “pipeline-like”.
- Plan Gate (
preToolUseonWrite|StrReplace|Delete): if there is noIMPLEMENTATION_PLAN.md, edits to non-doc/non-cursor files will ask for confirmation (nudges planner-first). Markdown/docs//templates/are allowlisted. - Step Checkpoint (
postToolUse/afterFileEdit): when a plan exists, reminds to capture acceptance evidence + rollback notes + run minimal tests. - Shell Safety (
beforeShellExecutionon risky commands): asks confirmation for destructive/state-changing commands (e.g.rm -rf,git reset --hard, force push, dependency installs) with severity hints. - Go Fmt Pre-Commit (
beforeShellExecutionongit commit, optional): if staged*.gofiles are notgofmt-clean, runsgofmt -w, re-stages them, then allows the commit; denies ifgofmtis missing or fails. Skip withcopy-cursor.sh --skip-go-fmt. - Secrets Pre-Commit (
beforeShellExecutionongit commit): denies commit if staged files look like.env/ keys / credential JSON. - Session Start (
sessionStart): prints a short workflow quickstart. - Commit Skill Injector (
beforeSubmitPrompt): when the user asks to commit code (including Chinese “提交代码”), injects guidance to follow.cursor/skills/git-commit/SKILL.md. - ACT Plan Detector (
beforeSubmitPrompt): if the user saysACTwithout a plan, injects planner guidance. - Verifier Stop Nudge (
stop): when a plan exists, reminds to runverifierbefore finishing.
Notes:
- Hooks are designed to be lightweight and mostly non-blocking (ask-to-proceed), except quality gates (Go fmt / secrets) that may deny.
- Hook scripts live in
.cursor/hooks/*.py. - Go fmt hook requires
gofmtonPATH(Go toolchain); omit for non-Go projects via--skip-go-fmt.
Treat IMPLEMENTATION_PLAN.md as the single “work order”. Most roles either produce it, execute it, or verify against it. Prefer the orchestrator rule for ready-made prompt templates.
planner→ produceIMPLEMENTATION_PLAN.md(steps/acceptance/risks/rollback/test plan)- You say
ACT implementer→ implement step-by-step (each step is verifiable + rollbackable)test-runner→ run minimal sufficient tests; map failures back to changescode-reviewer→ correctness/contracts/risk reviewsecurity-auditor→ auth/input/secrets/dependency risk checksverifier→ acceptance verdict: Pass / Fail / Blocked (with evidence)pr-author→ PR title/body (summary, test plan, risks, rollback, screenshots/demos)release-manager→ rollout/migration/flags/monitoring/rollback notes (when shipping)
- API-sensitive changes:
api-designer→ (update plan if needed) →backend-engineer/frontend-engineer - UX-sensitive changes:
ux-reviewercan run before implementation (pre-check) and after (post-check) - More manual coverage:
qaturns acceptance + risks into a regression checklist (pairs well withtest-runner)
debugger (repro → evidence → root cause → minimal fix → verification) → back to test-runner → verifier.
refactorer (guardrails first → small refactor steps → continuous verification) → test-runner / code-reviewer / verifier.
- “Use
plannerto produceIMPLEMENTATION_PLAN.md, then wait for me to sayACT.” - “ACT: follow the plan from Step 1; after each step, provide acceptance evidence and rollback notes.”
- “Run
test-runner, map failures to specific changes, and propose the smallest fix.” - “Use
verifierto verdict Pass/Fail/Blocked against acceptance criteria, with evidence.” - “Use
pr-authorto draft the PR title/body; if shipping, userelease-managerfor rollout/rollback.” - “Commit these changes” → follow
git-commitskill. - “Open a PR for this branch” → follow
create-prskill. - “Scan this repo for tech debt / which files should we refactor first?” → follow
shitcode-scanskill.
python3 -m unittest discover -s tests -v
bash scripts/copy-cursor.sh /tmp/demo --dry-runGitHub Actions: pylint on .cursor/hooks/, plus kit smoke (hooks tests + copy script).