Cursor and Claude custom commands let you turn repeatable prompts into a reliable engineering workflow.

Instead of rewriting review instructions for every pull request, you define them once as reusable AI coding prompts and run them with a single slash command.

In this guide, we will create a reusable command for Flutter PR review:

/flutter-code-review

The same command design works across any AI coding workflow, including Cursor and Claude Code, so your team can keep one review process regardless of tool preference.

What Are Custom Commands in Cursor and Claude Code?

Custom commands are reusable instructions that developers invoke through slash commands in AI coding tools. Cursor slash commands and Claude Code slash commands help standardize repetitive development tasks, including code reviews, testing, and pull request preparation. Both tools support command-based workflows, although their configuration, argument handling, and related skills features can differ. Step 1.1 explains the setup for each tool.

Why this matters

Manual reviews often drift:

  • One reviewer checks architecture, another checks only formatting,
  • Important security/performance issues are missed,
  • Feedback quality varies from PR to PR.

Custom commands make AI-assisted code review consistent by enforcing:

  • a fixed scope,
  • a fixed checklist,
  • a fixed report format.

What we are building

We will define commands/flutter-code-review.md to support Flutter code review automation through three modes:

  • default mode: review only uncommitted changes,
  • full mode: review all Dart files in lib/,
  • save mode: write a timestamped report to code_review_reports/.

Example usage:

/flutter-code-review

/flutter-code-review full

/flutter-code-review save

/flutter-code-review full save

AI-powered mobile app development and automated Flutter code review for better applications

Building a Flutter Application?

Explore how Mobisoft's mobile engineering team can support application development, code quality, and scalable delivery.

Explore Mobile App Development Services

Step 1: Create a command file

Create this file in your repo:

commands/flutter-code-review.md

This markdown file is your command contract. It should include:

  • command purpose,
  • supported arguments,
  • processing instructions,
  • report template,
  • checklist and rules.

Step 1.1: How to Set Up Custom Commands in Cursor and Claude Code

To make the command discoverable as both Cursor custom commands and Claude Code custom commands, place the command file in:

  • .cursor/commands/ for Cursor (so it appears in the Cursor command prompt window),
  • .claude/commands/ for Claude Code (so the same command works in Claude Code workflows).

If you want a single source file, keep one master command and sync/copy it to both folders.

Step 2: Define arguments clearly

Use $ARGUMENTS so one command can serve multiple needs:

  • full: analyze all lib/**/*.dart files.
  • save: persist report in code_review_reports/.
  • no arguments: review staged, unstaged, and untracked changes only.

This gives fast feedback during development and deeper quality gates before merge/release.

Step 3: Standardize the report structure

Keep report output predictable and scannable:

  • severity buckets: Critical, High, Medium, Low,
  • tabular findings: file, line, category, priority, issue, suggested fix,
  • short "good practices found" section,
  • summary counts for quick triage.

When every report has the same shape, reviewers fix faster, and trends become measurable.

Step 4: Add Flutter-specific review checks

An automated Flutter code review command becomes powerful when checklist items reflect your real architecture:

  • state management and navigation boundaries (e.g., GetX vs GoRouter usage),
  • controller/UI separation,
  • security basics (secrets, secure storage, URL handling),
  • performance checks (build() hygiene, rebuild patterns, disposal),
  • localization correctness (LocaleKeys...tr() usage),
  • API integration and error handling patterns,
  • database migration safety,
  • general Flutter quality and null safety.

This is the key idea: custom commands should encode team standards, not generic advice.

Step 5: Save reports for auditing

With save, each run writes:

code_review_reports/code_review_YYYY-MM-DD_HH-MM.md

This helps with:

  • PR traceability,
  • recurring issue detection,
  • onboarding new reviewers,
  • quality tracking over time.

End-to-end PR workflow

  1. Implement your Flutter changes.
  2. Run /flutter-code-review.
  3. Fix Critical and High findings first.
  4. Re-run until clean.
  5. Before merge or release, run /flutter-code-review full save.
  6. Attach the saved report to your PR process if needed.

Teams that automate pull request checks in a CI/CD pipeline can also use our DevOps services to support that setup.

Claude Code: /flutter-code-review custom slash command

Claude Code custom slash command flutter code review for AI coding workflow automation

Cursor: /flutter-code-review custom slash command

Cursor AI custom slash command flutter code review for AI coding workflow automation

Best practices for cross-AI command design

To keep one workflow across Cursor and Claude Code:

  • write instructions in plain, explicit markdown,
  • avoid tool-specific jargon in core checklist items,
  • enforce deterministic output format,
  • separate scope logic (full vs default) from review criteria,
  • maintain one command file as the single source of truth,
  • review command files before adding them to a shared repository,
  • limit access to files, secrets, and external tools,
  • verify AI-generated findings manually before applying them,
  • test the command again after major tool updates.

If you switch assistants later, your workflow still holds.

Quick starter template

Flutter Code Review

Arguments

$ARGUMENTS: full, save

Instructions

  1. Determine scope
  2. Review files against checklist
  3. Output severity-grouped report
  4. Save report if requested

Checklist

  • Security
  • Performance
  • Architecture
  • Localization
  • UI and overflow prevention
  • API integration
  • Error handling
  • Database and migrations
  • Code quality

Start simple, then evolve the checklist from real review pain points.

Final takeaway

Custom commands are one of the highest-leverage improvements you can make to PR quality. They also give teams a practical start with AI workflow automation for developers.

Define once, run everywhere:

  • one review standard,
  • one repeatable workflow,
  • any AI assistant.

For broader AI-assisted development support, explore our AI development services.

Access the full source on GitHub, download commands/flutter-code-review.md, treat it as a starter, and reshape it for your project architecture and team rules before you standardize your PR workflow.

To go further, read about moving Claude AI workflows into production.

Custom AI development solutions for building scalable applications and intelligent software

Frequently Asked Questions

What are custom commands in Cursor and Claude Code?

Custom commands are reusable instructions that help developers perform recurring tasks through AI coding tools. They can standardize activities such as code reviews, testing, and development checks without requiring developers to rewrite the same instructions each time.

How do I create a custom command in Cursor?

Create a Markdown file in your project's .cursor/commands/ folder, write the instructions inside it, and invoke the command with a slash in the Cursor command prompt window. Check the current Cursor documentation for supported configuration options.

Can I use the same custom command in Cursor and Claude Code?

You can often reuse the underlying instructions, but the command file's location, argument handling, and tool-specific features may differ. Test the command in both environments before treating it as fully portable.

What is the difference between Claude Code skills and custom commands?

Custom commands provide reusable instructions for specific tasks. Claude Code skills provide a structured way to package reusable instructions and related capabilities. Consult the current Claude Code documentation to decide which approach suits your workflow.

Can custom commands automate Flutter code reviews?

Custom commands can help developers review Flutter code against consistent architecture, performance, security, and maintainability criteria. However, developers should validate generated findings, and command execution alone does not replace automated testing or human review.

Can custom commands run automatically during pull request reviews?

A manually invoked slash command does not automatically execute for every pull request. Automated execution generally requires an additional supported integration, hook, or CI workflow. The available options depend on the coding tool and development environment.

This content is for informational purposes only and may include AI-assisted research or content generation. While we strive for accuracy, information may evolve over time. Readers are advised to independently verify critical information before making decisions.

Prashant Telangi

Prashant Telangi

Head of Technology, Mobile

Read more expand

Prashant Telangi brings over 15 years of experience in Mobile Technology, He is currently serving as Head of Technology, Mobile at Mobisoft Infotech. With a proven history in IT and services, he is a skilled, passionate developer specializing in Mobile Applications. His strong engineering background underscores his commitment to crafting innovative solutions in the ever-evolving tech landscape.