P6Agent — Autonomous AI Coding Assistant for DroidScript
P6Agent is an advanced, autonomous AI coding pair-programmer built specifically for DroidScript on Android. Powered by local Ollama instances or leading cloud providers (OpenAI, DeepSeek, Google Gemini, Groq, Cerebras, OpenRouter, Mistral, and xAI),P6Agent can explore your project, write code, run background Node.js scripts, diagnose crashes, launch apps, and package .spk archives—all directly from your mobile device.
Key Highlights
- Autonomous Agentic Workflow: Reads and edits project files surgically, runs diagnostic checks, inspects documentation, and fixes bugs autonomously.
- Plan Before You Act: Includes a dedicated Plan Mode (
/plan) that blocks mutations while the agent explores the codebase and drafts an interactive checklist card for your review. - Auto-Syntax Self-Healing: Every file modification automatically verifies
.js, .mjs, and .json syntax; syntax errors are caught and corrected by the agent on the fly. - Instant Checkpoint & Rollback: Turn-by-turn pre-mutation snapshots allow you to revert any file changes with a single tap (
/undo). - Floating Multitasking Bubble: An interactive Android overlay (
app.CreateOverlay) stays on screen while you edit in DroidScript IDE or test child apps, with single-tap foreground recall. - One-Click App Runner & Packaging: Scans
cfg.* flags and _AddOptions to launch your app inside DroidScript (app.StartApp),captures live crash broadcasts (ShowError),and compiles .spk packages with /spk. - Dual Interface (Mobile & Experimental Remote Web): Sleek Framework7 mobile UI on your phone, plus an optional built-in Remote Web UI (Svelte 5 + Tailwind) accessible from your desktop browser over your local Wi-Fi network (currently in active development / experimental mode, enabled via Settings).
| Tool | Category | What it does |
|---|
read_file & write_file | Code | Reads lines and creates/overwrites project files |
edit_file | Code | Performs surgical string replacements with auto-syntax validation |
list_files & search_files | Code | Browses directory trees and regex-searches codebases |
repo_map | Code | Extracts class structures, functions, and exports across .js files |
run_project | Runtime | Launches active project via app.StartApp() with scanned flags |
run_node_script | Runtime | Executes Node.js scripts in the background service |
get_logs | Diagnostics | Reads runtime logs, debug.txt, and live crash broadcasts |
get_docs | Reference | Searches official offline DroidScript API documentation |
web_search & fetch_url | Network | Searches DuckDuckGo / Brave and fetches online documentation |
package_spk | Release | Packages the active project into an installable .spk archive |
update_plan | Planning | Renders dynamic step-by-step checklists in chat |
ask_question | Interactive | Presents interactive multiple-choice questions to guide design decisions |
Safety & Permissions First
- Workspace Confinement: All code mutations are strictly restricted to your active project folder.
- Visual Diff Approvals: Before any file is modified, P6Agent shows a clean line-by-line diff bottom sheet for your approval (single change or batched multi-file changes).
- External Path Shield: Accessing files outside the project directory requires explicit user authorization with a security warning.
- Full Privacy: API keys, conversations, and project files remain stored locally on your device.
Helpful Slash Commands
| Command | Action |
|---|
/plan | Toggle Plan Mode (read-only research & checklist generation) |
/undo | Roll back the last set of assistant file changes |
/run | Launch the active project via app.StartApp |
/spk | Package the active project into a .spk file |
/status | View context token usage, active model, and generation parameters |
/compact | Condense older chat context into a structured summary |
/shortcut | Add a standalone Android home-screen shortcut for your active app |
/feedback | Submit suggestions or bug reports with optional diagnostics |
/web | Toggle the local Remote Web UI server for PC browser access (experimental mode) |
Getting Started
- Install P6Agent in DroidScript (via DroidStore or
.spk). - Add an AI Provider:
- Local: Use Ollama running on your phone, Termux, or LAN (
http://127.0.0.1:11434). - Cloud: Connect your OpenAI, DeepSeek, Gemini, Groq, OpenRouter, or Cerebras API key in Servers.
- Select your Project: Pick any existing DroidScript project or create a new one.
- Prompt the Agent: Ask P6Agent to build a new feature, diagnose a bug, write tests, or refactor your UI!