Guidelines and instructions for AI models and automated agents operating in the Magisk repository.
- Git Control: NEVER commit changes or amend an existing git commit without the user's explicit request or approval. Refer to the
magisk-gitskill for commit policies and formatting rules. - Environment & Tool Invocations:
./build.pyconfigures the build environment internally. Standalone tool executions (such as./gradlew,cargo,rustc,ndk-build, etc.) MUST be prefixed withscripts/env.py(e.g.,scripts/env.py ./gradlew assembleDebug). - Subproject Contexts: Activate and follow subproject skills when working on specific codebases:
native/: Refer to themagisk-nativeskill for architecture, FFI bindings, Rust conventions, and native workflows.app/: Refer to themagisk-appskill for app architecture, Compose/Kotlin conventions, and Gradle workflows.
- Verification Loop: After making changes, verify compilation and run linting/checks for affected modules before concluding tasks.
app/: Android application multi-module Gradle project.native/: C, C++, and Rust native binaries and libraries (magisk,magiskinit,magiskboot,magiskpolicy,resetprop).build.py: Primary build orchestrator managing toolchains, native builds, and app packaging.tools/&scripts/: Helper utilities (e.g.,elf-cleaner) and environment setup (scripts/env.py).
- Build Complete Project:
./build.py all - Clean All Artifacts:
./build.py clean - NDK Toolchain Setup:
./build.py ndk