Development Guide
About 880 wordsAbout 3 min
Tips
This page mainly describes the PR workflow and MAA's file formatting requirements. If you want to learn specifically how to make changes to MAA's operational logic, please refer to the Protocol Documentation
Tips
You can Ask DeepWiki to learn about the overall architecture of the MAA project.
I don't know programming but just want to modify some JSON files/documents, how can I do it?
Welcome to the Web-based PR Tutorial that anyone can understand (purely web-based on Github.com)
I want to make simple modifications to a few lines of code, but configuring the environment is too tedious and pure web editing is difficult to use. What should I do?
Use the GitHub Codespaces online development environment and try it out!
We've preset several different development environments for you to choose from:
Blank environment with a bare Linux container (default)
Lightweight environment, suitable for documentation site frontend development
Full environment, suitable for MAA Core related development (not recommended, suggest local development with full environment setup. See next section)
Complete Environment Setup (Windows)
If you forked the repository long ago, first delete it via your repository's
Settingsat the bottom.Visit the MAA main repository, click
Fork, thenCreate fork.Clone the dev branch of your repository with submodules:
git clone --recurse-submodules <your repository link> -b devWarning
If using Git GUI clients like Visual Studio without
--recurse-submodulessupport, rungit submodule update --initafter cloning to initialize submodules.Download prebuilt third-party libraries
Python environment required - search for Python installation tutorials if needed
(tools/maadeps-download.py is located in the project root)python tools/maadeps-download.pyConfigure development environment
- Download and install 
Visual Studio 2022 Community, selectingDesktop development with C++and.NET Desktop Developmentduring installation. 
- Download and install 
 Double-click
MAA.slnto open the project in Visual Studio.Configure Visual Studio settings
- Select 
RelWithDebInfoandx64in the top configuration bar (Skip for Release builds or ARM platforms) - Right-click 
MaaWpfGui→ Properties → Debug → Enable native debugging (This enables breakpoints in C++ Core) 
- Select 
 Now you're ready to happily
mess aroundstart developing!Commit regularly with meaningful messages during development
If you're not familiar with git usage, you might want to create a new branch for changes instead of committing directly todev:git branch your_own_branch git checkout your_own_branchThis keeps your changes isolated from upstream
devupdates.After development, push your local branch (e.g.
dev) to your remote repository:git push origin devSubmit a Pull Request at the MAA main repository. Ensure your changes are based on the
devbranch, notmaster.To sync upstream changes:
Add upstream repository:
git remote add upstream https://github.com/MaaAssistantArknights/MaaAssistantArknights.gitFetch updates:
git fetch upstreamRebase (recommended) or merge:
git rebase upstream/dev # rebaseor
git merge # mergeRepeat steps 7, 8, 9, 10.
Tips
After opening Visual Studio, Git operations can be performed using VS's built-in "Git Changes" instead of command-line tools.
MAA File Formatting Requirements
MAA uses a series of formatting tools to ensure that the code and resource files in the repository are visually unified for easy maintenance and reading.
Please ensure that it has been formatted before submission, or enable Pre-commit Hooks for automatic formatting.
The currently enabled formatting tools are as follows:
| File Type | Format Tool | 
|---|---|
| C++ | clang-format | 
| Json/Yaml | Prettier | 
| Markdown | markdownlint | 
Use Pre-commit Hooks to Automatically Format Code
Ensure that you have Python and Node environments on your computer.
Execute the following command in the root directory of the project:
pip install pre-commit pre-commit install
If pre-commit still cannot be used after pip install, please check if the pip installation path has been added to the PATH.
The formatting tool will automatically run every time you submit to ensure that your code format conforms to the style guide.
Enable clang-format in Visual Studio
Install clang-format version 20.1.0 or higher.
python -m pip install clang-formatUse tools like 'Everything' to locate the installation location of clang-format.exe. As a reference, if you are using Anaconda, clang-format.exe will be installed in YourAnacondaPath/Scripts/clang-format.exe.
In Visual Studio, search for 'clang-format' in Tools-Options.
Click
Enable ClangFormat supportand selectUse custom clang-format.exe fileand choose theclang-format.exelocated in Step 2.

You are all set with the clang-format integrated in Visual Studio supporting c++20 features!
You can also format with tools\ClangFormatter\clang-formatter.py directly, by executing in the root folder of the project:
python tools\ClangFormatter\clang-formatter.py --clang-format=PATH\TO\YOUR\clang-format.exe --input=src\MaaCore
