How to Automate Software Development Workflows With AI

Updated:

You hand an AI assistant a small feature, and it returns code plus a cheerful claim that everything works. Now you have another job: finding out whether “works” includes the behavior your customers already rely on.

That review can swallow the time you hoped to save, especially when the task was vague or the tests missed an important case.

This guide shows how to turn that uncertainty into a tested catalog change, then make the same workflow produce draft pull requests for approved tasks. You keep the decisions that affect your business, and the agent handles the work you can clearly define and check.

Choose a Task With a Clear Pass Condition

Start with a task you can describe through observable behavior. You should be able to explain what may change, what must stay intact, and how you will check the result.

Small features, reproducible bugs, and missing regression tests are useful starting points. A regression test checks that a known bug stays fixed.

TaskExpected OutputHow to Check ItHuman Decision
Add a small featureCode and tests for agreed behaviorExercise normal, empty, and invalid inputsDoes the behavior meet the need?
Fix a reproducible bugA narrow repair and regression testShow the test failing before the fix and passing afterwardIs the cause understood?
Add missing testsTests for existing requirementsInspect assertions and run them against current codeAre they testing the right behavior?
Draft review findingsPossible defects tied to changed codeReproduce each finding or trace its code pathWhich findings require changes?
Update documentationInstructions matching the implementationRun the documented exampleIs the explanation accurate and useful?
Choose A Task With A Clear Pass Condition: Choose A Verifiable Ai Coding Task; Can You Observe Success?; Can You Bound The Change?; Can You Check The Result?; Start With A Small, Testable Task; Clarify Before Delegating; Checkout, Authentication

For the running example, imagine you sell downloadable crochet patterns. Your shop already has difficulty metadata, category filtering, and a catalog API. You want customers to filter patterns by difficulty. The shop, specifications, and outcomes here are illustrative.

This is a good first task because the expected results are visible. Choosing “Beginner” should change which patterns appear, and clearing it should restore the appropriate results.

Choose A Task With A Clear Pass Condition: Define Success For A Catalog Difficulty Filter; Before Filtering; All Difficulties; Beginner; Only Matching Patterns Appear; Clear The Filter: Restore Results; Observable Behavior Becomes The Pass Condition

I would leave checkout changes, authentication, and destructive database migrations for closer human direction.

Keep routine checks in ordinary scripts and continuous integration, or CI—the checks that run when code changes. AI can interpret requirements, edit code, and investigate failures. Your existing formatter, compiler, and test runner should still do their usual jobs.

Set Up a Controlled Coding Workspace

Choose an Assistant or Agent

Use interactive assistance when you need to understand unfamiliar code or settle a requirement. Delegate execution when the task is clear enough for the tool to inspect files, edit them, run permitted commands, and return a change for review.

The same coding tool can support both styles. You do not need a collection of agents to get started.

I would start with Claude Code because I already use it for my Python content pipeline. That pipeline reduced article production from days to hours. That is a result from content automation, not a measured improvement in software-development productivity.

If your team already works heavily in GitHub, Copilot is another option. It supports repository questions, delegated changes, and pull-request workflows, subject to the applicable plan and organization policies. GitHub describes those repository capabilities here.

Before choosing, compare:

  • Where execution happens: your machine, a runner you manage, or a hosted environment.
  • Which repositories and files the tool can access.
  • How you restrict commands, network connections, and credentials.
  • What you receive for review: a local diff, branch, or pull request.
  • Total costs, including model usage, runner time, and your review effort.

Start with one coding tool, version control, working verification commands, and a human reviewer. Add orchestration when you have a repeated handoff worth automating.

Prepare the Repository and Access Controls

Create a clean branch or a separate worktree, which gives you another working directory for the repository. Record the starting commit so you know exactly what the agent received.

Install dependencies using the project’s documented process, then run the existing checks. Record any failures before editing. Otherwise, an old failure can send the agent on an unrelated repair mission.

Prepare The Repository And Access Controls: Prepare A Repository Before Ai Coding; 1. Create A Clean Branch Or Worktree; 2. Record The Starting Commit; Starting State; 3. Install Documented Dependencies; 4. Run And Record Baseline Checks; Record

A branch separates changes, but it does not limit what a running tool can access. Configure permissions for permitted actions and use isolation to restrict the processes doing the work. Claude Code treats permissions and sandboxing as complementary controls. Its permission documentation explains the distinction.

Check what the boundary covers. Claude Code’s Bash sandbox restricts shell commands and their child processes, but built-in file tools and local integration processes run outside it. Check credential access too: sandboxed commands can read most local files and inherit environment variables by default. Anthropic documents those sandbox boundaries and defaults.

Prepare The Repository And Access Controls: Ai Coding Access Controls Have Different Jobs; Branch Or Worktree: Separates Changes; Does Not Restrict Process Access; Permissions: Permitted Actions; Isolation: Process Boundaries; Claude Code Bash

For the catalog task, the agent needs source code, development fixtures, and approved test commands. Production customer records and deployment credentials have no useful role there.

Before connecting a private repository, also check the provider’s applicable settings for code, logs, retention, and training use.

Write a Specification the Agent Can Verify

Save the task brief in task.md. Include the objective, current behavior, desired behavior, relevant files, acceptance criteria, exclusions, permitted actions, verification commands, and stopping conditions.

You are making decisions that would otherwise get buried inside generated code.

For the shop, the brief should establish that difficulty data already exists. The task is to expose and apply that data through the existing catalog, not design a new product classification system.

Write A Specification The Agent Can Verify: Ai Coding Specification: Catalog Difficulty Filters; Optional Difficulty Parameter; Beginner; Intermediate; Advanced; Category; Difficulty; Both Restrictions Apply; Unpublished Patterns Stay Excluded

A useful excerpt would look like this:

Objective:
Add a difficulty filter to the existing pattern catalog.

API contract:
- Accept an optional difficulty query parameter.
- Supported values: beginner, intermediate, advanced.
- Omitting difficulty preserves existing catalog behavior.
- Unsupported values return HTTP 400.
- Category and difficulty restrictions apply together.
- Unpublished patterns remain excluded.

Boundaries:
Reuse existing category-filter and validation conventions.
Add no dependencies.
Do not change checkout, download access, or the data model.

Then state what someone should observe:

  • Selecting a difficulty shows only matching published patterns.
  • Clearing difficulty removes only that restriction and keeps the selected category.
  • Category and difficulty filters work together.
  • A valid combination with no matches shows the agreed empty state.
  • Unsupported API values return HTTP 400.

For this example, the empty state keeps both filter controls visible and displays “No patterns match these filters.” In your own brief, describe the existing state just as precisely. “Handle errors properly” gives the agent too much room to invent a policy.

Write A Specification The Agent Can Verify: When An Ai Coding Agent Must Stop; Work Inside The Approved Catalog Scope; Conflicting Requirements; Missing Access; Unexpected Data-Model Change; Edit Outside The Agreed Scope; Stop And Return The

Supply focused context: the catalog component, query handler, category-filter implementation, and relevant tests. Ask the agent to inspect the actual code and types before proposing changes. Documentation should match the dependencies installed in the repository.

Keep lasting build commands, conventions, and architectural boundaries in the instruction file your tool loads. Claude Code supports project instructions through CLAUDE.md. Those instructions provide context; permissions and isolation enforce access restrictions. Anthropic explains how project instructions load.

Finally, define when work stops. For this task, that includes conflicting requirements, missing access, an unexpected data-model change, or a proposed edit outside the catalog’s scope. Those decisions should come back to you.

If your next task is still a rough issue description, the AI Coding Task Assistant can turn it into a draft you can review and save as task.md. It also supplies task-specific test cases so you can check more than whether the code runs.

Lead Magnet Cover
FREE AI SKILL

Free AI Coding Task Assistant

Use AI to turn an app idea, a code change, or a bug into instructions you can hand to a builder.
Send My AI Coding Task Assistant ❯
Instantly delivered to your inbox
Customer Avatar 1
Customer Avatar 2
Customer Avatar 3
Customer Avatar 4
Rated highly by 18,000+ users

Run the Implementation and Test Loop

Review the Plan Before Editing

Ask for a plan before authorizing changes:

Read task.md and inspect the existing implementation. List affected files, the smallest proposed change, behavior tests, and unresolved questions. Do not edit yet.

For the catalog filter, I would expect the plan to reuse query validation and category-filter patterns. A proposal to replace the filtering system needs a convincing reason.

Review The Plan Before Editing: Review The Complete Ai Coding Feature Plan; Beginner; Storefront Control; Query And Validation; Correct Catalog Results; Verify The Complete Interaction; An Api Edit Alone Does Not Finish The Feature; Approve Scope

Check whether the plan covers the whole interaction. An API change alone does not finish a feature that also needs a storefront control.

Larger tasks can be split into smaller changes, but retain a final check of the complete behavior. Each piece can pass while the connection between them remains broken.

Once the plan is acceptable, give a short execution prompt:

Implement the approved difficulty-filter specification in task.md. Follow the existing category-filter pattern. Add acceptance tests, run the documented checks, and report changed files, failures, and unresolved decisions.

The detail belongs in the specification. You should not have to reconstruct the task in every prompt.

Implement Against Executable Checks

Have the agent make one coherent change at a time and run focused checks before continuing. Give it commands with observable results so it can investigate a failure rather than guess whether its edit helped.

Anthropic’s guidance recommends giving Claude a way to verify its work, such as tests or expected output. My recommendation is to make those checks part of the task before implementation starts. See its guidance on executable verification.

For the catalog, use development fixtures containing:

  • A published beginner scarf.
  • A published advanced scarf.
  • A published intermediate hat.
  • An unpublished beginner scarf.

Then check exact results:

Input or ActionExpected Result
Select beginner difficulty with no category selectedOnly the published beginner scarf appears
Select scarves and beginnerOnly the published beginner scarf appears
Clear difficulty while keeping scarvesBoth published scarves appear
Select hats and advancedBoth filter controls remain visible, with “No patterns match these filters.” displayed
Request difficulty=expertThe API returns HTTP 400
Omit difficulty with no category selectedAll three published patterns appear; the unpublished scarf stays excluded
Implement Against Executable Checks: Catalog Difficulty Filter: Acceptance Tests; Beginner; No Category; Published Beginner Scarf Only; Scarves + Beginner; Clear Difficulty; Keep Scarves; Both Published Scarves; Hats + Advanced; No Patterns Match

Also test each supported difficulty value directly. Inspect the assertions yourself. A test that checks only for HTTP 200 does not prove that the response contains the right patterns.

I learned a version of this while building my content pipeline. An early change let one stage finish while omitting a field the next stage needed. I initially investigated the next stage because the earlier one had reported success. I added a check at the handoff so that missing output failed where it originated.

Apply that lesson to the catalog: check the returned records, not just whether the request completed.

For a bug fix, confirm that the regression test exposes the original failure before accepting the repair. When debugging stalls, supply reproduction steps, expected behavior, actual behavior, and sanitized error output. Ask for a diagnosis and the smallest relevant fix.

Set execution limits before the run. For a first supervised task, you might allow 20 minutes and two repair attempts, with a spending cap appropriate to your tool. Enforce those limits through tool controls or the runner.

When a runtime, repair-attempt, or spending limit is reached, stop the run and collect the partial diff and failing-check output. Changing requirements, weakening assertions, disabling checks, or adding dependencies needs a fresh human decision.

Produce a Reviewable Handoff

Run the repository’s required broader checks before handing over the change. Focused tests provide quick feedback, but they do not replace the project’s normal verification.

Ask the agent to return:

  • Changed files and the final diff.
  • An acceptance-criteria checklist linked to relevant tests.
  • Commands run and their actual results.
  • Checks that failed or could not run, with reasons.
  • Any configuration or deployment changes and decisions still needing your input.
Produce A Reviewable Handoff: What An Ai Coding Handoff Must Contain; Changed Files And Final Diff; Criteria Linked To Tests; Commands And Actual Results; Not Run Is Not Passed; Configuration, Documentation, Open Decisions; Review The Evidence

Keep the code, tests, relevant documentation, and pull-request description together. For the shop, the documentation should explain the accepted difficulty values and how the filter combines with category selection.

“Not run because the test database was unavailable” is useful information. Calling that check passed is not.

If work continues in another session, record the current commit, completed checks, unresolved failures, and next step. The next run should start from repository state and written decisions rather than a vague memory of progress.

Review and Release the Change

Review the diff against the specification. Pay particular attention to unexpected files, changed interfaces, error handling, dependencies, and authorization boundaries.

For the catalog filter, ask whether unpublished patterns remain excluded on every affected query path. Also check that clearing difficulty preserves the category selection. These are easy details to lose while the main feature looks correct.

AI review can help identify possible defects, but verify its findings. A confident review comment can be wrong too.

Confirm that the repository’s required functional, type, build, dependency, secret, and security checks evaluated the commit you are accepting. If you edit the code afterward, rerun the affected checks.

Review And Release The Change: Review And Release Ai-Written Code; Inspect Scope And Behavior; Verify The Commit You Will Accept; After Edits, Rerun Affected Checks; Exercise The App And Api; Passing Checks + Human Acceptance; Deploy, Smoke-Test

Then exercise the running shop with development or staging data. Select each difficulty, combine it with a category, clear it, and try a combination with no results. Check the API directly as well as the storefront.

Require passing checks and human acceptance before merging. On GitHub, protected branches can enforce status checks and approving reviews. Availability depends on repository visibility and plan, and bypass permissions need attention when configuring the rules. GitHub documents those branch-protection requirements.

Release through your existing deployment process. Keep production deployment credentials outside the implementation agent’s access.

After deployment, smoke-test the changed behavior—a short check that the released feature works—and retain your usual rollback method. For this shop, that means confirming the filter works on the deployed catalog and knowing how to restore the previous release.

Connect the Workflow to a Repeatable Trigger

Turn an Approved Task Into a Draft Pull Request

Connect a trigger after the supervised loop produces changes you can accept. I would start with a manual trigger that selects an approved issue. Event-driven automation can follow once authorization and routing are clear.

The runner is the script or service that coordinates the job. Its sequence should be explicit:

  1. Load the approved specification and starting commit.
  2. Create an isolated checkout and prepare dependencies.
  3. Invoke the coding agent with the configured permissions.
  4. Have the runner execute the agreed checks and save their exit codes and output.
  5. If the checks pass, publish the task branch and open a draft pull request. Otherwise, return the logs and partial diff for a human decision.
  6. Attach the verification results to the draft pull request and request human review.

For the shop, the inputs are the approved difficulty-filter brief and starting commit. The output is a proposed change with tests, documentation, and verification results.

In a configured Claude Code environment, scripted execution can look like this:

claude -p "Implement the approved task in task.md and report verification results" --output-format json
Turn An Approved Task Into A Draft Pull Request: Approved Ai Coding Task To Draft Pull Request; Load Approved Task And Starting Commit; Prepare An Isolated Checkout; Run The Bounded Coding Task; Runner Executes Checks And Saves Evidence; Checks

Configure authentication and permissions beforehand. The -p option runs non-interactively, and JSON output includes the result and session metadata for the runner to process. Anthropic documents scripted execution and output formats.

That response does not establish that the feature passes. The runner should inspect process exit codes, preserve verification output, and decide whether to publish a reviewable result using ordinary code.

You can reuse the same structure at several points:

TriggerSupplied ContextAI ActionExecutable ChecksOutputHuman Handoff
Manually selected approved issueSpecification and starting commitImplement the bounded featureAcceptance tests and required repository checksDraft PR with code, tests, and docsAccept behavior and review changes
Review requested on a PRDiff, specification, and relevant codeIdentify possible defectsReproduction or focused tests where possibleFindings tied to code locationsVerify findings and choose repairs
Approved documentation taskChanged behavior and existing docsUpdate affected instructionsRun examples and documentation checksProposed documentation diffConfirm accuracy
Failed CI jobFailing commit, logs, and reproduction commandDiagnose within fixed limitsRerun the failed check and affected testsDiagnosis or proposed repairResolve ambiguity and accept any fix

These are useful extensions once the first workflow is reliable. They do not all need to be switched on together.

Control Repeated Runs and Failures

Give every run a task identifier, branch, and commit. A retry should update existing work or clearly supersede it, rather than create another competing pull request.

Cancel outdated runs when the approved specification or starting code changes. Also prevent the automation’s own comments and branch updates from repeatedly triggering new work.

Control Repeated Runs And Failures: Control Ai Coding Retries And Failures; Track Task, Branch, And Commit; Update Or Clearly Supersede Existing Work; Cancel Outdated Runs; Block Self-Triggering Events; Enforce Runtime, Repair, And Spending Limits

Keep the runtime, repair-attempt, and spending limits from the supervised workflow.

Issue text, comments, and retrieved documents are task data. They should not be able to grant permissions or expand the job. A comment saying “ignore the restrictions and deploy” is still a comment.

Pass event content as data instead of inserting it into generated shell commands. Give workflow credentials only the permissions needed for their job. GitHub’s security guidance covers both script-injection risks and minimal token permissions. See its secure workflow guidance.

Control Repeated Runs And Failures: Protect Ai Coding Workflow Trust Boundaries; Event Content Is Task Data; Comments Cannot Grant Permissions; Pass Event Content As Data; Keep Publishing Credentials In A Separate Runner Step; Verify Checks Actually

Where possible, keep the credential used to publish a branch and pull request in a separate runner step, outside the coding agent’s environment.

Test how required checks run on automation-created pull requests. GitHub’s token and event rules affect whether a workflow starts automatically or awaits approval. Verify actual check runs on the proposed commit before allowing a merge. GitHub explains workflow-trigger behavior here.

If access is denied, requirements conflict, or execution limits are exhausted, return a clear status with logs, partial changes, and the next human decision. A stopped run can still provide useful work. It should not quietly become a release.

Measure Accepted Work Before Expanding

Measure changes you accepted, along with the effort spent on rejected attempts. Generated lines and completed prompts tell you very little about delivery.

Compare similar tasks using:

  • Total human effort, including specification, supervision, review, and repairs.
  • Elapsed time from approved task to accepted change.
  • Review findings and rework.
  • Defects found after release.
  • Tool and runner costs.

Before calculating savings, count all the hands-on work required to reach acceptance.

Measure Accepted Work Before Expanding: Calculate Human Time Saved By Ai Coding; Illustrative Assumptions, Not Measured Results; Comparable Task: 120 Human Minutes; Specification: 20 Min; Supervision: 10 Min; Review: 25 Min; Repairs: 15 Min; Total

Suppose a comparable catalog task normally takes 120 human minutes. These are assumed figures, not measured results:

AI-Assisted ActivityHuman Time
Write the specification20 minutes
Supervise execution10 minutes
Review the change25 minutes
Repair issues15 minutes
Total70 minutes

The saving is 120 minus 70, or 50 human minutes before allocated setup costs.

Track setup effort separately, then spread it across completed runs when judging ongoing value. Include the costs of failed attempts in the overall workflow assessment.

Measure Accepted Work Before Expanding: Measure Ai Coding Value Before Expanding; Count Effort Across All Attempts; Specification, Supervision, Review, Repairs; Track Elapsed Delivery Time Separately; Track Findings, Rework, And Released Defects

Measure elapsed delivery time separately too. Less hands-on work does not automatically mean an earlier release if the change spends a day waiting for review.

I would expand one recurring task at a time. If the catalog workflow repeatedly produces acceptable changes with less total effort, try another similarly bounded task.

When the same correction keeps appearing, put it into the specification, repository instructions, or an executable check. Fixing the workflow gives the next run a better chance of succeeding.

What Next?

Pick one small repository task and write its acceptance criteria in task.md. Choose something you can verify quickly, then run it under supervision before adding a trigger.

Use the social buttons to share this guide when your team needs a common process for reviewing AI-written changes.

Which recurring development task would you automate first, and what result would make you trust it? Share your answer or any other questions in the comments.

Share this post with your friends & followers:
Abhishek is a data scientist by day & an online entrepreneur by night. He is known for his ability to simplify complex concepts and make them accessible to a wider audience. He started Passive Book to share his insights and experiences on how to effectively build an online business, which has quickly become a go-to resource for anyone looking to bootstrap an online business from scratch.

Leave a Comment

Build an Online Business 
Without Quitting Your Job

Join 10,000+ solopreneurs building six-figure online businesses from scratch with limited time & tight budgets using smart systems & AI automations.
Optin Form - Main

Free Bonus: Get access to our AI workflows & cheat sheets
Person sitting with laptop in home office environment with launching rocket, coffee mug, sleeping dog, bookshelf, and house plant illustrating work-from-home online business lifestyle. Decorative image.
Thank you for sharing

Follow Us On: