Agent Skill
2/7/2026autofix-skill
Comprehensive build error repair tool for C++, Rust, and Java projects using Soong, GN, Make, or CMake. Automatically fixes 30+ types of errors including headers, linking, APIs, and config.
H
hyz0906
0GitHub Stars
1Views
npx skills add hyz0906/autofix_skills
SKILL.md
| Name | autofix-skill |
| Description | Comprehensive build error repair tool for C++, Rust, and Java projects using Soong, GN, Make, or CMake. Automatically fixes 30+ types of errors including headers, linking, APIs, and config. |
name: autofix-skill description: Comprehensive build error repair tool for C++, Rust, and Java projects using Soong, GN, Make, or CMake. Automatically fixes 30+ types of errors including headers, linking, APIs, and config.
AutoFix-Skill
This skill integrates the AutoFix engine to intelligently repair build failures in AOSP, OpenHarmony, and Linux Kernel environments.
capabilities
The skill operates by parsing build logs (or error strings), identifying the specific error type via regex/heuristics, and applying targeted fixes to the source code or build configuration files.
1. Symbol & Header Issues
- Missing Header: Adds
#include <...>for standard and project headers. - Undeclared Identifier: Import/include missing symbols.
- Namespace Errors: Fixes missing
std::or namespace scopes. - Forward Declaration: Inserts forward decls to resolve circular deps.
2. Linkage & Dependencies
- Undefined Reference: Adds libraries to
shared_libs/depsinAndroid.bp/BUILD.gn. - Rust Crates: Adds missing
rustlibsimplies. - Visibility: Resolves visibility restrictions between modules.
- Multiple Definitions: Removes duplicate sources or link dependencies.
- Vtable Issues: Identifies missing virtual function implementations.
3. API & Type Safety
- Signature Mismatch: Fixes function call arguments (too few/many).
- Type Conversion: Suggests
static_cast,c_str(), etc. - Const Correctness: Fixes
constqualifier mismatches. - Deprecated API: Updates legacy API calls to modern equivalents.
- Missing Override: Adds
overridekeyword to virtual destructors/methods.
4. Build Configuration
- Syntax Errors: Fixes typos in
Android.bp/BUILD.gn. - Compiler Flags: Removes unsupported/illegal flags.
- Permissions: Fixes
chmod +xfor build scripts. - Ninja Cache: Cleans dirty ninja build states.
Usage
Fix from Log File (Recommended)
cd /absolute/path/to/autofix_skill
PYTHONPATH=. python3 -m src.cli fix --log /path/to/build.log --root /path/to/project_root
Fix Single Error
cd /absolute/path/to/autofix_skill
PYTHONPATH=. python3 -m src.cli fix --error "fatal error: 'vector' file not found"
Scan for Patterns
cd /absolute/path/to/autofix_skill
PYTHONPATH=. python3 -m src.cli scan
Build Systems
- Android:
Android.bp(Soong) - OpenHarmony:
BUILD.gn(GN) - Linux Kernel:
Kbuild/Makefile - General C++:
CMakeLists.txt
Skills Info
Original Name:autofix-skillAuthor:hyz0906
Download