# Plan a Multi-File Change in Perl with Atlas in 2026

> Perl developers in 2026 can use Atlas's plan agent to design multi-file changes, research code, and get plans reviewed before any code is modified, integrating with their existing toolchain.

In 2026, Perl developers can design and get multi-file changes reviewed before writing any code by leveraging Atlas's dedicated plan agent, which integrates direct with `prove (Test2::V0)`, `cpanm`, and `perltidy` to ensure a robust and safe development workflow. This approach prevents accidental edits and provides a structured environment for complex refactoring.

## Key takeaways

- Atlas's plan agent provides a read-only environment for designing multi-file Perl changes.
- Research Perl code with `codebase_search`, `grep`, `read`, and `lsp` without modifying files.
- Document plans in `.atlas/plans/*.md` for review before any Perl code is edited.
- Transition from plan to build agent using `plan_exit` for controlled implementation.
- Atlas integrates with `prove (Test2::V0)` and `perltidy` for post-plan verification.
- All Perl code edits are diffed and approved before Atlas commits them.

## How to design multi-file Perl changes with Atlas's plan agent?

Atlas's plan agent, introduced in 2026, provides a read-only environment specifically designed for architecting multi-file Perl changes without the risk of accidental modifications. This agent restricts all edit tools, allowing writes only to a designated plan markdown file, ensuring your design phase remains purely conceptual.

When a Perl developer initiates a planning session with Atlas, they are automatically placed into the dedicated plan agent. This agent's core functionality is its strict permission set: it denies all edit operations for every file path except for those within the `.atlas/plans/` directory, specifically targeting a markdown file like `.atlas/plans/my_feature_design.md`. This read-only constraint is a fundamental safety mechanism, preventing the agent from inadvertently altering any `.pm` module, `cpanfile`, or `t/` test script while the developer is still in the design phase. Within this secure environment, developers can freely use Atlas's powerful research tools, including `codebase_search` for semantic and keyword retrieval, `grep` for precise pattern matching across the codebase, `read` for inspecting file contents, and the `lsp` tool for language server protocol insights into Perl modules and their declarations. These tools allow a Perl developer to thoroughly understand the existing architecture, identify all affected `.pm` files, and map out the necessary changes before a single line of implementation begins. The plan itself is meticulously documented in the allowed markdown file, serving as a comprehensive blueprint for the subsequent build phase.

## What Perl commands and files are involved in an Atlas planning session?

A typical Atlas planning session for a Perl project in 2026 involves interacting with standard Perl files like `.pm` modules and `t/` test scripts, while Atlas itself manages a plan markdown file, for example, `.atlas/plans/new_feature.md`. The agent's read-only nature ensures that core Perl toolchain commands like `prove (Test2::V0)` and `perltidy` are not executed during this design phase.

During the planning phase, Atlas's interaction with Perl-specific files is strictly for reading and analysis. A Perl developer might use `codebase_search` to locate all instances of a specific function within `lib/My/App/Service.pm` or `grep` to find all uses of a particular variable across multiple `.pm` files. The `read` tool allows direct inspection of files like `cpanfile` to understand dependencies or `Makefile.PL` for build configurations. The `lsp` tool provides detailed information about Perl package declarations, `@EXPORT` lists, and module relationships, crucial for understanding the impact of a multi-file change. For instance, if a developer plans to refactor a core utility module, they would use these tools to identify every consumer of that module, potentially spanning dozens of `.pm` files and even `t/` test files. The plan itself is written into a dedicated markdown file, such as `.atlas/plans/refactor_legacy_api.md`. This file is the *only* location where the plan agent is permitted to write. This separation ensures that the design document is version-controlled alongside the code but remains distinct from the actual Perl source, preventing any accidental modification of `use strict;` or `use warnings;` directives, or any other Perl idiom, until the implementation phase begins.

## How does Atlas ensure safety and review for multi-file Perl changes?

Atlas ensures safety for multi-file Perl changes in 2026 by enforcing a strict read-only plan agent, preventing any code modification until the design is complete and approved. This agent's permission system denies edits to all Perl source files, allowing writes only to the plan document, which can then be reviewed before implementation begins.

The safety mechanism within Atlas's planning workflow for Perl is robust and multi-layered. Firstly, the plan agent operates with a permission set that explicitly denies write access to all Perl source files, configuration files like `.perltidyrc`, and test scripts under `t/`. This means a developer cannot accidentally introduce a syntax error into `lib/My/Utility.pm` or break a `Test2::V0` assertion while still conceptualizing the change. The only writable location is the designated plan markdown file, for example, `.atlas/plans/database_migration_plan.md`. This plan, once drafted, serves as a comprehensive design document that can be shared with team members for review. Because no code has been touched, the review focuses purely on the architectural soundness, potential impacts, and proposed solutions, rather than nitpicking code style or syntax. Once the plan is finalized and approved, the developer uses the `plan_exit` tool. This tool prompts a clear question: 'Plan at <path> is complete. Would you like to switch to the build agent and start implementing?' Answering 'Yes' transitions Atlas to the build agent, which has the necessary permissions to modify Perl files. Answering 'No' keeps the developer in the plan agent, allowing further refinement of the design. This explicit handoff ensures that implementation only begins after a deliberate decision, based on a thoroughly researched and reviewed plan, minimizing risks associated with large-scale Perl refactoring.

## How does Atlas integrate with Perl's testing and formatting tools?

Atlas integrates with Perl's testing and formatting tools like `prove (Test2::V0)` and `perltidy` during the *build* phase, not the planning phase, ensuring that all changes adhere to established project standards. In 2026, Atlas can automatically run `prove -lr t/` and `perltidy` on modified files, presenting the output for approval before committing.

While the planning agent is strictly read-only and does not execute Perl commands, Atlas's full capabilities shine during the subsequent build phase, after a plan has been approved and the agent has transitioned. Once in the build agent, Atlas is configured to work direct with the Perl toolchain. For testing, Atlas can be instructed to run `prove -lr t/` to execute your `Test2::V0` test suite. This command is executed behind a permission prompt, allowing the developer to review the TAP output directly within Atlas before any changes are committed. This ensures that multi-file changes, such as refactoring a core module, do not introduce regressions. For code formatting, Atlas can automatically run `perltidy` on all changed files. This is particularly useful for maintaining consistency across a large Perl codebase, ensuring that the unified diff presented for approval matches the project's `.perltidyrc` configuration. Atlas's ability to snapshot file changes as git patches means that even after `perltidy` has run, the original edits can be diffed and rolled back if necessary. This integration streamlines the development workflow, allowing Perl developers to focus on the logic of their changes, confident that testing and formatting standards will be automatically applied and verified.

## Steps

1. Initiate a planning session by instructing Atlas to switch to the plan agent, which will create a new markdown file, for example, `.atlas/plans/my_new_feature.md`, for your design.
2. Research the Perl codebase using Atlas's `codebase_search` to find relevant `.pm` modules, `grep` for specific patterns, `read` to inspect `cpanfile` or `Makefile.PL`, and `lsp` for module declarations.
3. Document your multi-file change plan, including affected Perl modules and proposed modifications, directly into the `.atlas/plans/my_new_feature.md` file, which is the only writable location.
4. Share the completed plan markdown file for review with your team, ensuring architectural soundness before any Perl code is touched.
5. Once the plan is approved, call the `plan_exit` tool within Atlas, and confirm 'Yes' when prompted to switch from the read-only plan agent to the build agent.
6. Implement the changes in your Perl `.pm` files, then ask Atlas to run `prove -lr t/` to verify `Test2::V0` test cases, reviewing the TAP output before proceeding.
7. Have Atlas run `perltidy` on the modified Perl files to ensure adherence to your `.perltidyrc` configuration, then review the unified diff for approval.
8. Approve the changes and let Atlas stage and create a commit, incorporating the multi-file Perl modifications and ensuring a clean, formatted codebase.

## FAQ

### Can Atlas prevent accidental edits to Perl modules during the planning phase?

Yes, Atlas's plan agent is designed with a strict permission set that denies all edit operations for Perl `.pm` files, `cpanfile`, and `t/` test scripts. It only allows writing to the designated plan markdown file, such as `.atlas/plans/my_refactor.md`, ensuring no accidental modifications occur while you are still designing your multi-file change.

### How does Atlas help me understand a large Perl codebase before making changes?

Atlas provides powerful research tools within the plan agent. You can use `codebase_search` for semantic and keyword queries, `grep` for precise pattern matching across your Perl files, `read` to inspect specific `.pm` modules or configuration files, and the `lsp` tool for detailed insights into Perl package declarations and dependencies, all without altering any code.

### What happens after I finish writing my multi-file Perl change plan in Atlas?

Once your plan is complete and reviewed, you use the `plan_exit` tool. Atlas will ask if you want to switch to the build agent to start implementing. Answering 'Yes' grants the necessary permissions to modify Perl files, while 'No' keeps you in the read-only plan agent for further refinement.

### Does Atlas run `prove` or `perltidy` during the planning stage?

No, the Atlas plan agent is strictly read-only and does not execute external commands like `prove (Test2::V0)` or `perltidy`. These tools are integrated into the subsequent build agent phase, where Atlas can run `prove -lr t/` to check your `Test2::V0` tests and `perltidy` on changed Perl files before committing.

### How does Atlas ensure my Perl code adheres to formatting standards?

After you've implemented your changes in the build agent, Atlas can automatically run `perltidy` on the modified Perl files. This ensures that your code adheres to the project's `.perltidyrc` configuration. Atlas then presents a unified diff for your approval, showing the `perltidy` changes before they are committed.

### Can I roll back changes made by Atlas to my Perl files?

Yes, Atlas snapshots file changes as git patches. This means that every edit, including those made by `perltidy` or other tools, can be diffed and rolled back if needed, providing a safety net for your Perl development workflow.

### Is Atlas compatible with standard Perl project structures like `cpanfile` and `t/` directories?

Absolutely. Atlas is designed to work with standard Perl project structures. It can read your `cpanfile` or `Makefile.PL` for dependencies, understand modules under `lib/`, and interact with `Test2::V0` test suites located in your `t/` directory, providing a native experience for Perl developers.

---

Canonical HTML: https://runatlas.sh/resources/stacks/plan-a-multi-file-change-before-editing-in-perl
Source of truth: aeo_pages row `/resources/stacks/plan-a-multi-file-change-before-editing-in-perl` (segment: Stacks) (this file is generated from it, never hand-edited).
Licence: Atlas is proprietary with a free core. It is not open source and there is no public source repository.
