Documentation

Tenant OwnerReviewerOperator

Product knowledge base, playbooks, and embedded guidance for every persona.

Refactoring with CoffeeBreak

CoffeeBreak can automatically refactor code to improve clarity, maintainability, and consistency across your repositories.
This page explains how refactoring works and how your team can use it effectively.


đź”§ What CoffeeBreak Can Refactor

CoffeeBreak can assist with many kinds of refactoring, including:

  • Code cleanup and formatting
  • Removing dead or unused code
  • Simplifying conditionals
  • Extracting methods and reducing duplication
  • Improving naming and structure
  • Updating outdated APIs
  • Modernizing syntax
  • Adding documentation or comments
  • Reorganizing files or modules (within limits)

đź§  How Refactoring Requests Work

You can:

âś“ Create a task requesting a refactor

Example: “Refactor the user service for clarity.”

âś“ Ask CoffeeBreak to improve existing code

Example: “Clean up this file and make it more readable.”

âś“ Apply refactors during broader tasks

CoffeeBreak may refactor related code when implementing a feature or fixing a bug.


📥 What You See in Pull Requests

Refactor results appear as standard pull requests:

  • A summary comment describing what changed
  • Inline explanations where needed
  • AI Reviewer comments (if enabled)
  • Clean, organized code changes aligned with your team's style

You review them like any PR.


👤 Human Review Is Always Supported

Your review decisions help CoffeeBreak improve future refactor outputs.

If you:

  • Approve → CoffeeBreak learns your preferred patterns
  • Request changes → CoffeeBreak refines the code
  • Comment → CoffeeBreak uses your feedback to improve style alignment

⚙️ Workspace Influence

CoffeeBreak adapts based on:

  • Repository coding conventions
  • Your team’s acceptance patterns
  • Recurring patterns in PR approvals/rejections

Nothing about rule engines, internal scoring, or algorithmic behavior is visible.


đźš« What CoffeeBreak Will Not Do

CoffeeBreak does not:

  • Apply large-scale architectural rewrites on its own
  • Refactor unrelated files without context
  • Make breaking changes without user approval
  • Push code directly to protected branches
  • Modify critical or sensitive paths without review

đź§© Marketplace Developers

If you're building a custom agent:

  • You can expose custom “refactor” capabilities
  • CoffeeBreak will route appropriate tasks to your agent
  • The system will track how well the agent performs
  • No access to internal rule tracking systems is provided

See:

  • external/CreateACustomAgent.md
  • external/AgentMetadataSpec.md