Help us improve
Share bugs, ideas, or general feedback.
npx claudepluginhub innerjoint/granada --plugin zakuHow this skill is triggered — by the user, by Claude, or both
Slash command
/zaku:aosp-plan <AOSP investigation query><AOSP investigation query>opusThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Investigation-first AOSP consensus planning. Decomposes queries into facets, spawns parallel `aosp-investigator` subagents, synthesizes findings, then runs a zaku-native Planner -> Architect -> Critic consensus loop. Final plans are saved to `.granada/plans/` with `**Status:** pending approval`.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Structures git workflow practices for committing, branching, resolving conflicts, and organizing work across parallel streams. Use when making any code change.
Share bugs, ideas, or general feedback.
Investigation-first AOSP consensus planning. Decomposes queries into facets, spawns parallel aosp-investigator subagents, synthesizes findings, then runs a zaku-native Planner -> Architect -> Critic consensus loop. Final plans are saved to .granada/plans/ with **Status:** pending approval.
/zaku:aosp-plan "query about AOSP code"
/zaku:aosp-plan --agents 5 "query"
--agents N: Number of parallel investigator subagents (default: 3, max: 5)--deliberate: Force deliberate mode for high-risk AOSP changes. Adds pre-mortem and expanded test planning. Auto-enables for SELinux policy, Binder/AIDL/HIDL interfaces, CTS/VTS tests, public/@SystemApi changes, init/boot sequence, Treble boundaries, kernel/DT changes, or multi-partition modifications.--interactive: Enable user prompts at synthesis review and final approval. Without this flag, save the final pending-approval plan and stop.This skill may inspect context, query AOSP source, and write pending-approval plan artifacts. Before explicit execution approval, it MUST NOT edit source code, commit, push, open PRs, or invoke execution skills. Consensus approval means the plan is suitable to present; it is not runtime execution authorization.
Call mcp__plugin_zaku_sourcepilot__list_projects() once at startup to verify the MCP server is reachable.
If the call fails, abort immediately with:
AOSP MCP server unreachable. Check SOURCEPILOT_URL and SOURCEPILOT_KEY environment variables.
After health check passes, read .granada/aosp-config.json to display the active AOSP project:
**AOSP Project: <project_name>** prominently**AOSP Project: not configured** — Searches will not be project-scoped. Run /zaku:aosp-project to configure one.Given the user query, decompose into 2-N independent investigation facets. Each facet targets a different aspect of the AOSP codebase.
Use this AOSP-oriented facet taxonomy by default, then prune facets that are clearly irrelevant and merge facets when the query is narrow:
Rules:
--agents 5, and include all relevant high-risk facets in --deliberate mode.Show the decomposition to the user:
## AOSP Investigation Decomposition
**Query:** <original query>
**Facet strategy:** <normal/deliberate/pruned>
### Facet 1: <facet-name>
- **Taxonomy:** Entrypoints and call flow / Owning service / Boundary crossings / Configuration / Tests / Compatibility
- **Search focus:** What to search for in AOSP
- **Expected areas:** Framework, HAL, kernel, tests, sepolicy, build, etc.
- **Why included:** Why this facet matters for the query
### Facet 2: <facet-name>
- **Taxonomy:** ...
- **Search focus:** ...
- **Expected areas:** ...
- **Why included:** ...
### Pruned facets
- **<facet-name>:** <why it is not relevant or was merged>
Fire N aosp-investigator subagents in parallel, one per facet. N comes from --agents (default 3, max 5):
Agent(
subagent_type="zaku:aosp-investigator",
model="sonnet",
prompt="Investigate AOSP facet: <facet description>. Use the sourcepilot tools. Report structured findings with file paths, code snippets, and architectural observations."
)
Cap at 5 agents regardless of --agents value.
Merge all investigation results:
After synthesis, build and save an Evidence Artifact containing the full investigation context plus a compact Evidence Index. Each cited AOSP fact that may influence planning gets a stable ID.
Derive the final artifact slug once before saving evidence, then reuse that exact slug in Step 6 for the final plan:
-, strip characters outside a-z, 0-9, and -, collapse repeated -, and trim leading/trailing -.plan..granada/plans/aosp-<slug>.md or .granada/plans/aosp-<slug>-evidence.md already exists, append -2, -3, etc. until both paths are free.Save the artifact before consensus to:
.granada/plans/aosp-<resolved-slug>-evidence.md
The evidence artifact MUST use this structure:
# AOSP Evidence: <query>
## Original Query and Flags
## Active AOSP Project
## Deliberate Mode
## Investigation Decomposition
## Investigator Outputs
## Synthesis
### Findings
### Conflicts
### Gaps
### Confidence Notes
## Evidence Index
[E1] <repo>/<path/to/File.java> — type: source|test|config|log|assumption — strength: direct|indirect|weak — facet: entrypoint|owner|boundary|config|tests|risk — <symbol or area> — <one-sentence finding>
[E2] <repo>/<path/to/File.bp> — type: source|test|config|log|assumption — strength: direct|indirect|weak — facet: entrypoint|owner|boundary|config|tests|risk — <build/test relevance> — <one-sentence finding>
## Interactive Feedback
Rules:
type, strength, and facet metadata.type describes the evidence surface: source, test, config, log, or assumption.strength describes how directly the evidence supports the planning claim: direct, indirect, or weak.facet maps the evidence to the investigation taxonomy: entrypoint, owner, boundary, config, tests, or risk.E# IDs in plan steps, risk analysis, and review findings instead of repeating long snippets.type: source and strength: direct.test or config evidence can support verification/build/config work, but MUST NOT be the only evidence for source-code modification steps.weak evidence can only support exploratory, verification, or follow-up steps unless paired with direct source evidence.assumption entries MUST be routed to ## Open Questions or non-executing follow-ups; they MUST NOT support executor instructions or code-modifying steps.## Sources section must expand each cited E# to the full repo/path, metadata, and relevant snippet summary.If running with --interactive, use AskUserQuestion to present synthesis results with these options:
If not running with --interactive, automatically proceed to Step 5.
After synthesis, always run a sequential zaku-native consensus phase before saving the final plan. This phase runs automatically in both interactive and non-interactive modes; it is not an execution approval gate.
Build a compact AOSP consensus packet and pass it to every consensus agent. The packet MUST include:
.granada/plans/aosp-<slug>-evidence.mdE# IDs, source mappings, and type/strength/facet metadataARCHITECT_REVIEW, if anyThe full investigator outputs MUST live in the evidence artifact, not be repeated inline in every consensus prompt. Previous fields are empty on iteration 1.
Consensus evidence scope:
Call Planner first:
Agent(
subagent_type="zaku:aosp-planner",
model="opus",
prompt="<AOSP consensus packet with evidence artifact path + current iteration feedback>"
)
Planner MUST create or revise the draft AOSP plan with this structure:
# AOSP Plan: <query>
**Status:** pending approval
## Investigation Summary
[Key findings from all investigators, grouped by facet]
## AOSP-DR: Decision Rationale
### Principles (3-5)
### Decision Drivers (top 3)
### Viable Options (>=2, or explicit invalidation rationale)
### Selected Option: [A/B]
### Invalidated Alternatives (if < 2 viable options)
## Evidence-Based Plan
### Step 1: <action>
- **Repo:** `<repo path, e.g. frameworks/base>`
- **Change type:** source|test|config|build|sepolicy|docs|verification
- **Dependencies:** [Step IDs or repo paths that must land first; `none` if independent]
- **Evidence:** [Evidence Index IDs, e.g. E1, E3; code-modifying steps require at least one `type: source`, `strength: direct` ID]
- **AOSP files:** [repo-relative or AOSP-root-relative files; must be specific enough for aosp-autopilot to group by repo]
- **Executor instructions:** [concrete modification guidance for the executor; no assumptions or unresolved questions]
- **Acceptance criteria:** [how to verify this step is complete]
- **Verification:** [specific build/test/runtime command or observable outcome, e.g. CTS, VTS, m, adb, dumpsys, logcat]
## Risks and Mitigations
## Open Questions
## Sources
## Architecture Decision Record
- **Decision:** [What was decided]
- **Drivers:** [Top 3 drivers from AOSP-DR]
- **Alternatives considered:** [All evaluated options]
- **Why chosen:** [Reasoning referencing principles and drivers]
- **Consequences:** [Positive outcomes + accepted tradeoffs + acknowledged risks]
- **Follow-ups:** [Post-implementation verification actions]
## Consensus Review Changelog
- **Iteration:** [number]
- **Architect summary:** [blocking/advisory summary]
- **Critic verdict:** [APPROVE/ITERATE/REJECT or malformed-output note]
- **Required revisions applied:** [changes made]
- **Unresolved blockers:** [remaining blockers, if any]
In deliberate mode, additionally include:
## Pre-Mortem (Deliberate Mode)
1. [AOSP-specific failure scenario]
2. [AOSP-specific failure scenario]
3. [AOSP-specific failure scenario]
## Expanded Test Plan (Deliberate Mode)
| Layer | Tests |
|-------|-------|
| Unit | [Framework JUnit / native gtest] |
| Integration | [CTS module / instrumentation tests] |
| E2E | [Full device boot / VTS for HAL] |
| Observability | [Logcat / dumpsys / perfetto] |
Call Architect only after Planner returns the draft plan:
Agent(
subagent_type="zaku:aosp-architect",
model="opus",
prompt="<draft AOSP plan markdown + AOSP consensus packet>"
)
Architect MUST return a structured ARCHITECT_REVIEW containing:
Malformed or incomplete Architect output is a blocking concern and forces Critic non-approval unless corrected in a later iteration.
Call Critic only after Architect returns:
Agent(
subagent_type="zaku:aosp-critic",
model="opus",
prompt="<draft AOSP plan markdown + AOSP consensus packet + ARCHITECT_REVIEW>"
)
Critic MUST include exactly one closed verdict line:
VERDICT: APPROVE
or
VERDICT: ITERATE
or
VERDICT: REJECT
No verdict, multiple verdicts, synonyms, conditional verdicts, or ambiguous wording MUST be treated as VERDICT: ITERATE. Malformed Critic output must be recorded in the Consensus Review Changelog as non-compliant/malformed.
The consensus loop is capped at 5 iterations:
ARCHITECT_REVIEW.VERDICT.VERDICT: APPROVE exits the loop.VERDICT: ITERATE, VERDICT: REJECT, missing verdict, malformed verdict, or ambiguous verdict means Planner MUST revise the plan using Architect and Critic feedback, add a Consensus Review Changelog entry, then rerun Architect and Critic.**Status:** pending approval.VERDICT: REJECT is non-terminal inside the Step 5 consensus loop. Step 7 user rejection remains terminal.
Critic MUST reject or iterate on:
Repo, Change type, Dependencies, Evidence, AOSP files, Executor instructions, Acceptance criteria, or Verificationtype: source and strength: directtest, config, log, weak, or assumption evidenceassumption Evidence Index entryBefore saving, assert the plan contains exactly one **Status:** pending approval, and it is the first body line after the title. All saved plans MUST remain pending approval.
Use the resolved slug from Step 4. Do not recompute, shorten, or renumber it during save. Save to:
.granada/plans/aosp-<resolved-slug>.md
Before writing, verify that the plan path still does not exist. If it now exists because of a concurrent run, return to Step 4 slug collision handling, choose the next available numeric suffix, rename/rewrite the evidence artifact to match, and update the consensus packet/final summary paths.
Confirm the save path to the user after writing.
If not running with --interactive, print a compact final summary before stopping:
## AOSP Plan Complete
- **Plan:** `.granada/plans/aosp-<slug>.md`
- **Evidence:** `.granada/plans/aosp-<slug>-evidence.md`
- **Consensus verdict:** APPROVE | best available after 5 iterations | unresolved blockers present
- **Selected option:** <option from AOSP-DR>
- **Top risks:** <1-3 highest-impact risks or `none identified`>
- **Next step:** Review the pending-approval plan, then run `/zaku:aosp-autopilot .granada/plans/aosp-<slug>.md` only if you approve execution.
If not running with --interactive, the skill stops here after printing the summary and never invokes execution skills.
Use AskUserQuestion to present the saved plan with these options:
On approval: invoke Skill("zaku:aosp-autopilot") with the plan path.
AOSP-DR uses short mode by default. Switch to deliberate mode with --deliberate or when the query involves any high-risk areas:
aosp-investigator agents"aosp plan" or "aosp_plan"Agent(subagent_type="zaku:aosp-investigator", model="sonnet", ...) for parallel investigation.Agent(subagent_type="zaku:aosp-planner", model="opus", ...) for Planner draft/revision.Agent(subagent_type="zaku:aosp-architect", model="opus", ...) for Architect review.Agent(subagent_type="zaku:aosp-critic", model="opus", ...) for Critic evaluation.VERDICT: APPROVE, VERDICT: ITERATE, or VERDICT: REJECT.VERDICT: ITERATE and recorded in the Consensus Review Changelog.