paracap
v0.1.1
Published
Build and verify Capacitor Android apps from the command line: preflight doctor, one-engine builds, independent APK signature and package verification, and managed JDK/Android SDK installs.
Maintainers
Readme
Agent-First Mobile Build System (AFMBS)
Working name: AgentForge Mobile
Status: Prototype roadmap, not a claim of novelty or production readiness.
A local-first, agent-governed workflow for building and verifying mobile applications with reusable tooling. The first milestone targets Android production APKs from Capacitor web apps. Expo / React Native support is a separate adapter and must not be treated as interchangeable with Capacitor.
Product vision
Let an AI coding agent create or modify an app, then invoke a predictable local build workflow that validates inputs, builds the app, and verifies the artifact. Keep the agent's freedom in product code while constraining expensive, error-prone release steps.
MVP promise
On a supported clean machine, a developer can:
- install/unpack a documented toolchain bundle;
- run preflight checks;
- build a known Capacitor sample from the command line;
- verify that an APK exists, has the expected package ID, and passes signature/package checks;
- get clear logs and actionable failures.
Do not promise “works on every machine,” “zero errors,” “no limits,” or “production-ready in two minutes” until measured evidence supports those claims.
Start here
Read these in order:
docs/01_PRODUCT_SCOPE.mddocs/02_ROADMAP.mddocs/03_ARCHITECTURE.mddocs/04_ANDROID_TOOLCHAIN.mddocs/05_AGENT_SKILL.mddocs/06_SECURITY_AND_SIGNING.mddocs/07_TEST_PLAN.mddocs/08_DECISIONS_AND_RISKS.mddocs/PRODUCTION_READINESS_PLAN.md
Key principles
- Local-first: use local builds by default; cloud build is optional, not required for Android MVP.
- Reproducible: pin versions, record toolchain manifest, and verify checksums.
- Agent-safe: instructions help, scripts enforce. Never rely on
SKILL.mdalone for safety. - Observable: logs, exit codes, machine-readable result summary, and artifact hashes.
- Framework adapters: separate Capacitor-web and Expo/React Native workflows.
- Honest scope: an APK build is not the same as store acceptance, runtime correctness, or security approval.
Command line
The studio and the CLI drive one build engine, so a project that builds in the browser builds the same
way from a terminal. Install it globally (npm install -g paracap), or use npm link in a checkout, or
npm run cli -- for the working tree version.
paracap doctor --project ./my-app # readiness of this machine plus one codebase
paracap toolchain status # managed JDK, Android SDK, Rust, package managers
paracap env inspect --project ./my-app # manifests, setup plan, missing tools (Node, Python, ...)
paracap build --git https://github.com/acme/shop.git --app-id com.acme.shop --allow-scripts
paracap android doctor --project ./my-app # Java, Gradle wrapper, SDK platforms, build-tools, licenses
paracap verify apk --project ./my-app --apk android/app/build/outputs/apk/debug/app-debug.apk --application-id com.acme.shopConventions:
- Sources are mutually exclusive:
--gitURL, live--urlweb page, workspace--reponame, or an existing--projectdirectory.--branchis validated before Git runs. - Consent is explicit: running a project's own build scripts needs
--allow-scripts, and toolchain downloads need--allow-install. Both stop the command with exit code 3 until re-run with the flag. - Exit codes:
0success,1failure,2usage,3consent required,4prerequisites missing. - Machine-readable output:
--jsonprints exactly one result object on stdout and sends the transcript to stderr. Each command also writes a schema-version 1 result JSON and a bounded log; existing files are never overwritten unless--forceis passed, and both are created owner-only. - Credentials: a Git token is read only from
PARACAP_GIT_TOKEN, is used in memory for that one Git operation, and is never written to a result, log, or remote URL. - Android SDK licenses are always operator-managed; no command accepts or writes a license.
- Platforms:
--platform androidis the default and the only platform this tool can compile.--platform android,iosadditionally runsnpx cap add ios, which generates a real Xcode project inios/on any host; compiling that project still requires macOS, Xcode, CocoaPods and an Apple identity. - Toolchain location:
paracap toolchain installputs the JDK, Android SDK and Rust intoworkspace/.toolchainnext to a checkout, or~/.paracap/workspace/.toolchainwhen run elsewhere, so a global install never writes into the directory you happen to be standing in. Override withPARACAP_TOOLCHAIN_DIRorPARACAP_WORKSPACE_DIR; an operator-providedJAVA_HOME/ANDROID_HOMEalways wins. - Python projects package an exported static frontend only. A server-only Python app reports
web_bundle_missingwith recovery guidance instead of producing a partial APK.
Development setup
- Install Node.js 24.15 or newer (enforced by
package.json; required by the verified toolchain dependency tree). - Run
npm cito install dependencies. - Run
npm run devto start the local prototype onhttp://localhost:3000. The Vite middleware can execute commands and access workspace files; its API is restricted to loopback and same-origin requests, but it must still never be exposed to a network or shared machine. - Run
npm run rules:checkandnpm run test:rulesto verify generated Firestore rules against the Firebase Emulator Suite; Java 21 is required for the emulator. - Run
npm testfor the application tests andnpm run buildfor the production web studio. - Run
npm startto serve the built studio locally.
See docs/WEB_DEPLOYMENT.md for self-hosted deployment.
The production web studio includes a public product landing page, a dedicated /auth route for both sign-in and account creation, Firebase Google/email authentication, private Firestore user profiles, an interactive product tour, English/Amharic localization, light/dark themes, a user workspace, and a separately secured landing-page admin dashboard. The landing page maps the prototype's detected stack categories, studio modules, Android debug-APK path, iOS Xcode-project ZIP path, and hosted-release limitations. The admin dashboard can edit 92 bilingual landing, sign-in, tour, stack, capability, and availability copy fields. The initial verified content administrator is configured in firestore.rules and src/utils/adminAccess.js. Deploy the rules and configure Firebase Authentication providers/domains before inviting users. Optional Analytics requires visitor consent. The hosted web release does not expose prototype APIs or build or verify native artifacts.
Proposed repository layout
agentforge-mobile/
├── README.md
├── LICENSE
├── docs/
│ ├── 01_PRODUCT_SCOPE.md
│ ├── 02_ROADMAP.md
│ ├── 03_ARCHITECTURE.md
│ ├── 04_ANDROID_TOOLCHAIN.md
│ ├── 05_AGENT_SKILL.md
│ ├── 06_SECURITY_AND_SIGNING.md
│ ├── 07_TEST_PLAN.md
│ └── 08_DECISIONS_AND_RISKS.md
├── skills/
│ └── mobile-build/SKILL.md
├── config/
│ └── toolchain.example.yaml
├── scripts/
│ ├── doctor
│ ├── build-android
│ └── verify-apk
├── adapters/
│ ├── capacitor-android/
│ └── expo-react-native/
├── tests/
└── artifacts/ # generated locally; do not commit release secretsFirst implementation milestone
Make the tool work for one sample Capacitor app on one declared host OS before adding Expo, iOS, multi-agent support, or a GUI.
