Skip to content

Add Cursor commands and rules for agent-driven development workflows #63

Closed

Description

@gerchowl

Description

Add new Cursor commands (.cursor/commands/) and rules (.cursor/rules/) to improve coding agent effectiveness across the full development lifecycle — from brainstorming and issue creation through implementation, testing, review, and CI debugging.

Follows up on #61 which added issue templates and changelog guidance. This issue covers the remaining agent workflow gaps.

Problem Statement

Currently, coding agents lack structured guidance for several common workflows:

  • Brainstorming before implementation — agents jump straight into coding without exploring requirements, alternatives, or validating design decisions with the user
  • Starting work on an issue — the branch-naming.mdc rule provides passive guidance but there is no invokable command to run the full gh issue develop workflow
  • Creating issues — no command to auto-detect template type, populate fields, and use correct labels
  • Test-driven development — no enforcement of write-test-first discipline; agents default to code-first
  • Self-review before PR — no structured review step between committing and submitting a PR
  • Verification before claiming done — agents claim "done" without running tests or checking evidence
  • CI diagnosis — no workflow for fetching failed CI logs and tracing root cause
  • Systematic debugging — agents tend to guess-and-fix instead of following root cause analysis
  • Plan-based execution — no structured way to break large features into tasks with checkpoints

Proposed Commands and Rules

Tier 1 — High impact, daily use

Command/Rule Type Purpose
brainstorm.md Command Brainstorm before implementation: explore project context, ask critical questions one at a time, propose 2-3 approaches with trade-offs, present design in sections for validation, save design doc. Prevents agents from jumping straight into code. Inspired by superpowers:brainstorming.
start-issue.md Command Start work on an issue: read issue, gh issue develop, checkout branch, restore context
create-issue.md Command Create a GitHub issue: detect template type, populate fields, use correct labels
tdd.md + tdd.mdc Command + Rule Test-driven development: RED-GREEN-REFACTOR cycle using existing just test-* recipes. Inspired by superpowers:test-driven-development.
review.md Command Self-review: diff against base, check acceptance criteria, changelog, commit messages; structured severity report. Inspired by superpowers:requesting-code-review.
verify.md Command Verification before completion: run tests, check evidence, no "should pass" claims. Inspired by superpowers:verification-before-completion.

Tier 2 — CI/GitHub integration

Command Type Purpose
check-ci.md Command Check CI status: gh pr checks / gh run list, show pass/fail per workflow
fix-ci.md Command Diagnose failing CI: gh run view --log-failed, trace root cause, propose fix. Inspired by superpowers:systematic-debugging (CI-scoped).

Tier 3 — Planning and debugging

Command Type Purpose
plan.md Command Write implementation plan: break issue into bite-sized tasks with file paths and verification steps. Inspired by superpowers:writing-plans.
execute-plan.md Command Execute plan in batches with human checkpoints, sequential subagent dispatch. Inspired by superpowers:executing-plans.
debug.md Command Systematic debugging: 4-phase root cause process (investigate, analyze, hypothesize, implement). Inspired by superpowers:systematic-debugging.

Future — Workflow redesign

Item Type Purpose
Worktree-based development Workflow change git worktree support for parallel subagent execution; requires updating start-issue, submit-pr, after-pr-merge. Inspired by superpowers:using-git-worktrees.

Brainstorm command details

The brainstorm.md command enforces a design-before-code discipline:

  1. Explore project context — read files, docs, recent commits to understand current state
  2. Ask clarifying questions — one at a time, prefer multiple choice; understand purpose, constraints, success criteria
  3. Propose 2-3 approaches — with trade-offs and a recommended option
  4. Present design in sections — scaled to complexity, get user approval after each section
  5. Save design doc — write to docs/plans/YYYY-MM-DD-<name>-design.md
  6. Transition to planning — hand off to plan.md for implementation breakdown

Key principles:

  • One question at a time (don't overwhelm)
  • YAGNI ruthlessly — remove unnecessary features
  • No code until design is approved
  • Be ready to revise when something doesn't make sense

Inspiration

  • obra/superpowers — agentic skills framework with brainstorming, TDD, systematic debugging, verification-before-completion, subagent-driven development, and code review skills
  • Existing repo commands (commit-msg.md, submit-pr.md, after-pr-merge.md) establish the pattern

Acceptance Criteria

  • Tier 1 commands and rules created and functional (including brainstorm.md)
  • Tier 2 commands created and functional
  • Tier 3 commands created and functional
  • Existing commands (submit-pr.md) updated to reference review.md as prerequisite
  • CHANGELOG.md updated under ## Unreleased / ### Added

Implementation Notes

  • Each command should follow the style of existing commands (see commit-msg.md, submit-pr.md)
  • Rules (.mdc) should use alwaysApply: true for behavioral rules like TDD
  • Commands that invoke gh CLI should handle common error cases (auth, permissions, rate limits)
  • The worktree workflow is intentionally deferred — it requires updating multiple existing commands and rules
  • Consider splitting this into sub-issues per tier if the scope is too large for one branch
  • The brainstorm.md command should be the natural entry point before plan.md and execute-plan.md

Activity

  1. added
    feature
    on Feb 17, 2026
  2. gerchowl commented on Feb 18, 2026

    @gerchowl
    ContributorAuthor

    Design: Issue-Comment-Based Agent Plans

    Date: 2026-02-18
    Context: PR #68 discussion — gerchowl + c-vigo agreed to move plan/design storage from local files and issue bodies to GitHub issue comments.

    Core Principle

    The GitHub issue comment is the single source of truth for both implementation plans (from /plan) and designs (from /brainstorm). No local plan files. The agent always reads from and writes to GitHub via gh api. A sync-issues workflow trigger (fire-and-forget) provides eventual local availability.


    Changes to /plan

    Precondition — unchanged (must be on an issue branch).

    New workflow:

    1. Read the issue — same as today (gh issue view).
    2. Break into tasks — same as today.
    3. Present for user approval — same as today.
    4. Publish as issue comment — after approval, post the full detailed plan (file paths, verification commands) as a comment on the issue via gh api. Comment starts with ## (H2) to avoid header-level bumping in synced files.
    5. Trigger sync-issues — fire-and-forget gh workflow run sync-issues.yml -f target-branch=<branch>.
    6. No local plan files — drop docs/plans/<issue_number>-plan.md entirely.

    Comment format:

    ## Implementation Plan
    
    Issue: #<issue_number>
    Branch: <branch_name>
    
    ### Tasks
    
    - [ ] Task 1: description — `files` — verify: `command`
    - [ ] Task 2: description — `files` — verify: `command`
    ...

    Changes to /execute-plan

    Precondition — unchanged (must be on an issue branch).

    New workflow:

    1. Load plan from GitHub — read issue comments via gh api repos/{owner}/{repo}/issues/{number}/comments. Find the comment containing ## Implementation Plan. Parse the task list.
    2. Execute in batches — unchanged (2–3 tasks per batch, TDD, verification).
    3. Update progress by editing the comment — after each batch, edit the plan comment via gh api to check off completed tasks (- [ ] → - [x]).
    4. Checkpoint — unchanged (stop, show user, wait for "continue").
    5. Handle failures — unchanged.
    6. Wrap up — unchanged.

    Changes to /brainstorm

    Current: saves design to docs/plans/YYYY-MM-DD-<name>-design.md and commits it.

    New workflow:

    1. Steps 1–4 unchanged (explore, ask questions, propose approaches, present design).
    2. Publish design as issue comment — after user approval, post the design as a comment on the issue (starts with ##). Replaces local file + commit.
    3. Trigger sync-issues — fire-and-forget.
    4. Transition to /plan — unchanged.

    API Calls

    Action Command
    Post comment gh api repos/{owner}/{repo}/issues/{number}/comments -f body="..."
    Read comments gh api repos/{owner}/{repo}/issues/{number}/comments --jq '...'
    Edit comment gh api repos/{owner}/{repo}/issues/comments/{comment_id} -X PATCH -f body="..."
    Trigger sync gh workflow run sync-issues.yml -f target-branch=<branch>

    Edge Cases

    • Finding the right comment: search for ## Implementation Plan (plans) or ## Design (brainstorm). If multiple exist, use the most recent.
    • Rate limits: ~2–3 comment edits per issue execution — well within limits.
    • Concurrent edits: low risk (one agent per issue). Last-write-wins if conflict occurs.
    • Network required: by design — the agent already requires network for all operations.

    What Gets Removed

    • docs/plans/*-plan.md pattern and its .gitignore entry
    • Local plan file creation/reading logic from /plan and /execute-plan
    • Design file creation + commit from /brainstorm
  3. added
    priority:medium
    area:workflow
    effort:large
    semver:minor
    on Feb 18, 2026
  4. added this to the 0.3 milestone on Feb 18, 2026
  5. self-assigned this
    on Feb 18, 2026
  6. added a commit that references this issue on Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:workfloweffort:largefeaturepriority:mediumsemver:minor

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions