mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 19:09:43 +00:00
2.0 KiB
2.0 KiB
Mole AI Agent Notes
Use this file as the single source of truth for how to work on Mole.
Principles
- Safety first: never risk user data or system stability.
- Never run destructive operations that could break the user's machine.
- Do not delete user-important files; cleanup must be conservative and reversible.
- Always use
safe_*helpers (no rawrm -rf). - Keep changes small and confirm uncertain behavior.
- Follow the local code style in the file you are editing (Bash 3.2 compatible).
- Comments must be English, concise, and intent-focused.
- Use comments for safety boundaries, non-obvious logic, or flow context.
- Entry scripts start with ~3 short lines describing purpose/behavior.
- Shell code must use shell-only helpers (no Python).
- Go code must use Go-only helpers (no Python).
- Do not remove installer flags
--prefix/--config(update flow depends on them). - Do not commit or submit code changes unless explicitly requested.
- You may use
ghto access GitHub information when needed.
Architecture
mole: main CLI entrypoint (menu + command routing).mo: CLI alias wrapper.install.sh: manual installer/updater (download/build + install).bin/: command entry points (clean.sh,uninstall.sh,optimize.sh,purge.sh,touchid.sh,analyze.sh,status.sh).lib/: shell logic (core/,clean/,ui/).cmd/: Go apps (analyze/,status/).scripts/: build/test helpers.tests/: BATS integration tests.
Workflow
- Shell work: add logic under
lib/, call frombin/. - Go work: edit
cmd/<app>/*.go. - Prefer dry-run modes while validating cleanup behavior.
Build & Test
./scripts/test.shruns unit/go/integration tests.make buildbuilds Go binaries for local development.go run ./cmd/analyzefor dev runs without building.
Key Behaviors
mole updateusesinstall.shwith--prefix/--config; keep these flags.- Cleanup must go through
safe_*and respect protection lists.