Quick Start
AI Translation Notice
This document was translated using AI. Please refer to the Chinese documentation for the definitive version.
Quick Start
This guide describes the complete development workflow, from forking the repository to submitting a PR. Before you begin, it is recommended that you familiarize yourself with the basic concepts of MaaFramework: tasks, pipeline nodes, recognition, actions, transitions, and resource directories.
Tips
For more information, see MaaFramework Terminology.
1. Fork and Clone the Repository
- Sign in to GitHub and open this project's repository.
- Click Fork in the upper-right corner to copy the repository to your own account.
- Clone your fork. You must include the submodules when cloning; otherwise,
assets/MaaCommonAssetswill not be downloaded.
git clone --recurse-submodules https://github.com/<your-username>/MaaAssistantKedrgame.git
cd MaaAssistantKedrgamegit clone --recurse-submodules git@github.com:<your-username>/MaaAssistantKedrgame.git
cd MaaAssistantKedrgameBefore using SSH, you need to configure an SSH key on GitHub. If you do not know how to configure one, you can use HTTPS for now.
gh repo fork Hollow-YK/MaaAssistantKedrgame --clone=false
gh repo clone <your-username>/MaaAssistantKedrgame -- --recurse-submodules
cd MaaAssistantKedrgameBefore using GitHub CLI, install gh and sign in by running gh auth login.
If you have already cloned the repository with a regular git clone, fetch the submodules from the repository root:
git submodule update --init --recursive- Add the upstream repository so that you can synchronize updates from the main repository. Choose an address that matches the cloning method you used:
git remote add upstream https://github.com/Hollow-YK/MaaAssistantKedrgame.git
git fetch upstreamgit remote add upstream git@github.com:Hollow-YK/MaaAssistantKedrgame.git
git fetch upstreamgh repo set-default Hollow-YK/MaaAssistantKedrgame
git remote add upstream https://github.com/Hollow-YK/MaaAssistantKedrgame.git
git fetch upstreamGitHub CLI handles sign-in and subsequent GitHub operations, but git fetch upstream still requires a Git remote URL. HTTPS is retained here. If you have already configured SSH, you can replace the URL with git@github.com:Hollow-YK/MaaAssistantKedrgame.git.
- Configure your Git identity before your first commit:
git config user.name "your GitHub username"
git config user.email "your GitHub email address"If you only want these settings to apply to the current repository, do not add --global. If you want all repositories to use this identity in the future, use git config --global ... instead.
- Create a new branch before development:
git switch -c feat/<short-feature-name>Do not develop directly on the main branch. Each branch should do only one thing, such as adding one task, fixing one recognition point, or completing one set of documentation.
2. Prepare the Development Environment
This project primarily requires the following tools:
- Git: manage code and submit PRs.
- Python: run the Agent, utility scripts, and basic checks.
- Node.js and pnpm: build the documentation site.
- Maa Pipeline Support or MaaFramework debugging tools: take screenshots, capture ROIs, and debug pipelines.
This project uses the assets/MaaCommonAssets submodule to provide shared MaaFramework resources. Confirm that the submodule has been initialized:
git submodule statusIf the output begins with -, the submodule has not been initialized. Run:
git submodule update --init --recursiveCommon directories:
assets/interface.json: task entries, resource groups, and Agent configuration for the common UI.assets/resource/tasks/: task definitions for the common UI.assets/resource/pipeline/: recognition, action, and workflow nodes.assets/resource/image/: template images.agent/: custom Actions and Recognitions.tools/: installation, validation, and CI helper scripts.docs/: documentation site source.
Install the Python dependencies:
python -m pip install -r requirements.txtThe OCR models are located in assets/resource/model/ocr/. When debugging OCR locally, ensure that the following files exist in that directory:
assets/resource/model/ocr/
├── det.onnx
├── keys.txt
└── rec.onnxIf these files are missing, download ppocr_v6-small.zip and extract it to that directory. Do not commit locally downloaded model files to the repository; the release workflow configures the OCR resources automatically.
Install the documentation site dependencies:
cd docs
pnpm install3. Read the Development Documentation
If this is your first time contributing to the project, read the documentation in this order:
- Beginner Guide: understand the learning path.
- Pipeline Basics: understand nodes, recognition, actions, and transitions.
- Adding a Feature: learn which files usually need to change when adding a task.
- Common Nodes and Universal Transitions: reuse existing nodes first.
- Project Conventions: confirm required practices and prohibited practices.
- PR Conventions: check the PR description and validation details before submitting.
If you are already familiar with MaaFramework, you can start directly with Project Conventions and Tasks and Nodes.
4. Make and Validate Changes
After modifying pipelines or resources, you can run schema validation:
python -m pip install jsonschema==4.26.0 referencing==0.37.0
python tools/validate_schema.py --schema-dir deps/tools --resource-dirs assets/resource --exclude-dirs assets/resource/announcement --interface-files assets/interface.jsonIf you changed the Python Agent or utility scripts:
python -m compileall agent toolsIf you changed the documentation:
cd docs
pnpm docs:buildIn addition to command-based checks, you must perform an actual runtime validation: open the tool, select the relevant task, confirm that it can start from the expected scene, complete the target action, and provide an acceptable fallback in exceptional scenarios.
5. Build Locally
To inspect an installation directory, run the script for the UI you want to test:
# MXU
python tools/ci/install_mxu.py v0.0.1
# MFAA
python tools/ci/install_mfaa.py v0.0.1 win x86_64Before running either script, make sure MaaFramework has been extracted to deps/. MFAA also requires MFAAvalonia to be extracted to MFAA/, with exactly one MFAAvalonia.exe entry point under that directory.
install_mxu.pyassemblesinstall-mxu/and places the MaaFramework runtime undermaafw/as required by MXU.install_mfaa.pycopies the MFAAvalonia runtime to the root ofinstall-mfaa/, renames its entry point toMAK.exe, and assemblesruntimes/,plugins/, andlibs/as required by MFAA.- Both scripts copy the project resources,
interface.json,README.md,LICENSE,requirements.txt, andagent/, but they do not prepare embedded Python.
To test MXU, also place the MXU executable in install-mxu/ and name it MAK.exe. For official releases, GitHub Actions prepares embedded Python, assembles MFAA and MXU archives, and generates a separate NSIS installer for each UI. Regular PRs do not need to upload build artifacts manually. Do not commit install/, install-mfaa/, install-mxu/, MFAA/, MXU/, cache directories, or local debugging screenshots.
6. Submit a PR
Before submitting, synchronize with upstream and confirm that the branch is clean:
git fetch upstream
git rebase upstream/main
git statusCommit your changes and push the current branch:
git add .
git commit -m "feat: add reward-claiming task"
git push origin HEAD -uConventional Commits are recommended for commit messages:
feat: add reward-claiming task
fix(pipeline): fix login detection in Start Game
docs: rewrite development documentationAfter pushing the branch, open a PR to the main repository on GitHub. The PR description must clearly explain what changed, why it changed, and how it was validated. For detailed requirements, see PR Conventions.
