OperationsAutomation

Developer workflows and code assistance

Ship refactors, tests, and reviews with repo context, clear tool boundaries, and reviewable diffs—not paste-only answers.

In short

CoWork OS works in your repository folder with file search, exact-match edits, git tools and a real terminal. It can create a branch, add a failing test, fix the code, run the test and show you the diff before it commits. Under the Ask for approval profile, commands stop at a Deny or Allow once card, and /review gives a read-only second look.

What you build

A repeatable engineering loop inside your repository:

  • Scoped changes: one feature branch, one concern per pass, with diffs you can actually review.
  • Test-aware work: run or propose tests before you merge; keep “works on my machine” honest.
  • Review-ready output: summaries for PRs, risk callouts, and rollback notes—not a wall of code with no narrative.

CoWork OS fits when agents use tools (read files, run commands where allowed) instead of guessing from memory.

How it works in CoWork OS

  • Code tools: glob and grep find code, edit_file makes exact find-and-replace edits, and git_diff, git_branch and git_commit handle version control. edit_file rereads the file before writing and returns a conflict rather than overwrite a change you made meanwhile (details).
  • Git worktree isolation: tasks can run in their own git worktree with branch creation, auto-commit, merge, conflict detection and cleanup, so parallel work does not collide in one checkout.
  • Terminal Tabs: a real terminal docked in the app. A Run button on bash code blocks types the command into your tab and sends the exit code and output back to the agent. Dev servers the agent starts appear as read-only tabs you can stop.
  • Access profiles: Ask for approval keeps writes inside the workspace and shows a Deny / Allow once card when a command needs consent. Full access is for trusted local work only.
  • /review: /review all uncommitted fixes or /review PR #123 runs the bundled code-reviewer skill, read-only by default. It needs a real checkout, not a temporary workspace.
  • Codex Security pack: /security-diff-scan reviews a branch diff for security regressions before you merge.
  • /batch: splits a repeatable migration into up to 8 parallel lanes. For code it stops at a branch or worktree plus a validated summary, and opens no PR unless you ask.

Worked example

Your TypeScript billing service has a bug: invoices stamped just before midnight UTC show the next day. In a task opened on the repo, with the Ask for approval profile, you type:

parseInvoiceDate returns the wrong day for times near midnight UTC. Create a branch, write a test that fails on the current behavior, then fix it. Run only the affected test file. Do not upgrade dependencies or touch other modules. Show me the diff before you commit.
  1. The agent uses grep to find parseInvoiceDate and its test file, then git_branch to create fix/invoice-date.
  2. It adds a test case with edit_file and asks to run npx vitest run src/billing/date.test.ts. You click Allow once. The new test fails, which confirms the bug.
  3. It changes the function to parse in UTC, asks again, and the test file passes.
  4. It shows the git_diff output: one test added, four lines changed in date.ts. It stops there, as asked.

You type /review all uncommitted fixes. The code-reviewer skill reads the change without editing anything and flags one more edge case: dates with an explicit offset. You ask for a test for that too and approve the run. Then you say "commit", and the agent calls git_commit on the branch.

You end with one commit that holds the fix and two tests, plus review notes you can paste into the pull request.

Why CoWork OS is a strong fit

  • Local-first keeps proprietary code and keys under your control when paired with BYOK and sensible .gitignore habits.
  • Approvals matter for destructive commands, dependency upgrades, or anything that touches production credentials.
  • Multi-provider routing lets you use faster models for exploration and stronger models for tricky refactors.
  • Skills and project rules (AGENTS.md, skills) keep behavior aligned with your team’s conventions.

How to use

  1. Scope a single outcome: “extract this module,” “add tests for X,” not “fix the whole codebase.”
  2. Point agents at truth: open files, failing tests, or logs—not a vague symptom.
  3. Run in small commits; avoid mega-diffs unless you have strong review bandwidth.
  4. Gate network installs, secret access, and production deploys explicitly.
  5. Ship with human review on anything security- or data-sensitive.

Prerequisites

  • A working dev environment (language toolchain, package manager) agents can invoke.
  • Branch hygiene so experiments do not pollute the default branch (e.g. main).
  • Clear policy on what commands may run unattended.

Steps

  1. Reproduce the issue or define the feature in one paragraph.
  2. Ask for a plan before code: files to touch, tests to add, risks.
  3. Implement in thin slices; run tests after each slice when feasible.
  4. Review diffs; reject churn and style-only noise unless requested.
  5. Document behavior changes in the PR or changelog.

Suggested prompts

  • “List files you need to read before changing behavior; then propose a plan.”
  • “Add tests that fail on the old behavior and pass on the new.”
  • “Summarize risk for a reviewer: blast radius, rollback, and unknowns.”
  • “Do not upgrade dependencies unless I explicitly ask.”

Avoid “rewrite everything” unless you have tests and time.

Launch readiness

  • CI (or local equivalent) passes on the branch.
  • Secrets and tokens are not committed or echoed into logs.
  • Rollback path is obvious (revert commit, feature flag, or config).
  • At least one human has read security-sensitive changes.

Common pitfalls

  • Dependency roulette—agents bump versions without you noticing.
  • Silent behavior change without tests—regressions ship quietly.
  • Over-trusting generated code on auth, crypto, and concurrency.
  • Giant PRs—split work even when the model could do it all at once.

Frequently asked questions

Is it safe to let an AI agent run terminal commands?

It is safer with a sandbox, a working branch and an approval step. In CoWork OS the Ask for approval profile limits writes to the workspace and shows a Deny or Allow once card before commands that need consent. Dangerous-command blocking is on by default, and hard guardrails apply even under Full access. Review the diff before you commit.

Can AI review my pull request locally?

Yes, if the branch is checked out. In CoWork OS, type /review PR #123 or /review all uncommitted fixes in a regular workspace. It runs the bundled code-reviewer skill, which is read-only by default, so it reports problems without editing files. You can add a focus, such as /review focus on security and migration risk.

Can I use a local model as a coding agent?

Yes. CoWork OS works with local models through Ollama, LM Studio, MLX-LM and similar routes, so inference stays on your machine and there is no hosted-model charge. Smaller local models can struggle with long multi-step edits, so try one on a small task first and keep a hosted model for large refactors if you need it.