Skip to content
AI Knowledge MapSearch / Text directory

Chapter 2 How AI assists programming

Chapter overview

AI can provide substantial help with the core stages of traditional programming.

Following the same five stages as Chapter 1, this chapter explains how AI can help and introduces methods and tools you can use directly.

1. Clarify the problem

A requirements clarification assistant can ask questions to establish your goal, use cases and constraints, then organize the answers into requirements that can guide the programming work.

NameHow it helps clarify requirements
Superpowers: Brainstorming skillAsks questions step by step to understand your goal, current situation and constraints, discusses possible approaches, then develops a design. The complete workflow instructions are publicly available. Project instructions
BMad: Analyst, named MaryA dedicated analyst role with workflows for brainstorming, research, user needs analysis and product briefs. BMad supports integration with several AI tools. Project documentation
GitHub awesome-copilot: PRD skillStarts with an interview about the problem, success criteria and constraints, then defines the scope and organizes a requirements document. Its public instructions can also inform a requirements clarification assistant. Skill instructions

2. Gather information

The runtime environment and language version, package manager, dependency manifest and lockfile, virtual environment, and configuration files from Chapter 1 establish the conditions needed to run a project. An existing environment setup skill can guide an agent to identify and install tools from the project requirements, prepare an isolated environment and dependencies, complete the configuration, then launch the program or run a minimal check. This helps a beginner get an environment ready for programming.

NameHow it helps beginners prepare the environment
Microsoft VS Code: setup-environment skillReads the project's installation instructions, checks required tools and versions, attempts to install missing tools for the operating system, then builds the project and tries to start it. It records newly discovered setup steps. Its goal is to help the user successfully build and run the project; virtual environments and specific configuration details depend on the project instructions. Skill instructions
HermeticOrmus community project: setup-env skillIdentifies runtime requirements from project files, installs the specified runtime and package manager versions, installs dependencies using the lockfile, creates a virtual environment for Python projects, and prepares local configuration. It then validates the environment through builds, checks and an actual launch, recording repeatable setup steps. Skill instructions

These skills need an agent that can access project files and execute commands. Users still need to supply information that cannot be determined from the project, such as accounts, keys and personal settings. Judge whether setup is complete by the actual execution results.

3. Design the approach and program structure

Once the task is clear and the environment is ready, existing agents and skills can help break requirements into processing steps, assign responsibilities to functions and modules, design data processing, and add explanations that make the code easier to understand.

NameRelated techniques from Chapter 1How it helps beginners
Superpowers: Writing Plans skillFunctions, parameters and return values; module boundaries and program interfacesUses the clarified task and project code to plan file responsibilities, function names, parameters and return values, and interfaces between parts, producing a plan that can be implemented step by step. Skill instructions
BMad: Architect (Winston) and bmad-architecture skillModule boundaries and program interfacesGuides you through comparing approaches, defining boundaries between parts, assigning ownership of shared data and agreeing on common design decisions. It saves an architecture description to guide later programming. Useful when several parts need coordination. Project documentation
Jeffallan: Pandas Pro skillData cleaningChecks missing values and data quality in tables, designs processing steps around the task's rules, generates and runs pandas transformation code, then checks the data before and after processing. Suitable for practicing tabular data processing in Python. Skill instructions
Jeffallan: Code Documenter skillCode comments and function documentationAnalyzes existing functions and modules, documents their purpose, parameters, return values and usage examples, and requires the examples to be verified. This helps beginners understand and explain what each part of a program does. Skill instructions
GitHub awesome-copilot: Sensei Junior Mentor agentConditions and loops; functions, parameters and return valuesTeaches beginners through questions, progressively more detailed hints and line-by-line explanations. Use it to practice deciding when a condition is needed, which actions should repeat and which steps belong in a function. It emphasizes that learners should be able to explain their final code; some modes deliberately withhold complete answers. Agent instructions

4. Write and run the program step by step

You can give the plan from Section 3 directly to an agent that can edit files and execute commands. Ask it to create or change the code step by step, run the program and check the results. An additional skill is not always needed. Editors and IDEs let you inspect code, diffs and execution output. An ordinary Run button usually executes existing code; to have AI write code, you need to ask the agent to implement the plan.

You can continue with a coding agent in VS Code, moving from planning to implementation. Alternatively, use Superpowers' Executing Plans skill to make and verify changes one task at a time while recording progress, or BMad's bmad-build skill to take on the task, modify code, run checks and make Git commits.

This stage focuses on practicing Git version control. You can let your existing agent handle Git operations and inspect the results in a visual interface, or use a coding assistant with built-in Git integration.

NameRelated techniques from Chapter 1How it helps beginners
GitHub awesome-copilot: git-commit skillGit version controlInspects changes, selects relevant files, writes a commit message, creates a Git commit and checks the result. Useful for adding a version-saving workflow to an existing agent; its main job is committing changes. Skill instructions
Aider: Git integrationWorking with code editors and IDEs; Git version controlBy default, commits AI changes automatically when modifying project files. Use /diff to inspect the current changes and /undo to undo the most recent change. It works alongside your editor and also supports running programs and configuring automatic checks after edits. Git features, Running and checking code
VS Code: built-in source controlCode editors and IDEs; Git version controlShows before-and-after diffs in the editor and lets you select and commit the changes you want to save, without memorizing Git commands. Used alongside an agent, it makes the agent's actual edits and saved changes visible. Official tutorial
GitHub DesktopGit version controlA separate graphical interface for managing local Git projects and viewing commit history. Right-click a commit to revert its changes; reverting creates a new commit and preserves the existing history. Add a local project, Revert a commit

Beginners can practice three actions:

  1. Inspect changes: Ask the agent to explain its changes, and compare the before-and-after code in the interface.
  2. Save a version: After completing a small task and checking it by running the program, save a Git commit with a description.
  3. Restore changes: Choose the changes to undo, then ask the agent to explain the impact before carrying it out, or use a graphical interface.

If you already use a coding agent, you can combine it with the git-commit skill and your editor's Git interface. Saving a file keeps its current contents; a Git commit records history that you can compare and restore. Commits can stay on your own computer without being uploaded to GitHub immediately. An automatic commit does not mean the program works correctly: you still need to check what actually happens.

5. Verify results, locate errors and improve the program

After writing a program, run it and check existing features again. Use logs and error symptoms to locate causes, then restructure code or measure performance where needed. You can also ask a review agent to compare the code with the requirements and the design from Section 3, checking code logic, module responsibilities and interfaces.

The table keeps tools for verification, debugging, code and structure review, refactoring, and performance analysis. Choose performance tools for your particular situation, such as a website, JavaScript or Python; you do not need to install them all.

NameRelated techniques from Chapter 1How it helps beginners
Superpowers: Verification Before Completion skillRegression testingRequires the current checks to be executed and their output read before completion is reported. After a fix, recheck the original problem and existing features.
Superpowers: Systematic Debugging skillDebug output and logs; regression testing; Git version controlReproduces the problem, reads errors and logs, examines recent changes, collects evidence and tests a hypothesis about the cause, then makes a minimal change and checks again.
Superpowers: Requesting Code Review skillConditions and loops; functions, parameters and return values; module boundaries and program interfaces; Git version controlGives the reviewer the requirements, plan and Git change range to check code logic, responsibilities and integration with surrounding code. The review returns problem locations, impacts and suggestions.
Anthropic: Code Simplifier agentRefactoringTidies recent code, reducing duplication, complex nesting and unnecessary abstractions while requiring existing behavior to be preserved. The original includes JavaScript, TypeScript and React conventions. Run checks after simplifying.
Chrome DevTools: chrome-devtools and memory-leak-debugging skillsDebug output and logs; performance profilingWith the accompanying MCP tools connected, operates a browser, reads runtime information and analyzes performance. The memory skill helps compare snapshots and trace memory usage in the relevant JavaScript and Node.js contexts.
wshobson: Python Performance Optimization skillPerformance profilingGives an agent methods for measuring Python execution time and memory use, guiding it to measure bottlenecks before optimizing. Primarily provides methods and reference material.

Reviewing the overall structure requires reading the main modules, interfaces, dependencies and related calling code, then comparing them with the design from Section 3. A review should identify the problem's location, triggering conditions or structural evidence, actual impact and suggested improvements. Important conclusions still need to be verified by running checks. After refactoring, check that behavior has been preserved; after performance optimization, compare actual measurements from before and after the change.

For practical accounts, see CyberAgent's browser inspection and repair case, Google Chat's memory investigation case, and Superpowers project user feedback. These accounts cover different scopes and do not mean that every individual skill in the table has received the same effectiveness evaluation.