-
Notifications
You must be signed in to change notification settings - Fork 940
llm: Add plan-android-work command and planning skills #6597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+506
β9
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
dc863fe
Add plan-android-work command and planning skills
SaintPatrck b94c298
Add architecture pattern checks to planning skills
SaintPatrck 5de07e2
Address code review feedback on planning skills
SaintPatrck 1cd8f9d
Remove meta files
SaintPatrck f491cfd
Address review feedback: remove duplicate execution bridge, add MCP fβ¦
SaintPatrck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| --- | ||
| description: Guided requirements refinement and implementation planning for Bitwarden Android | ||
| argument-hint: <Jira ticket (PM-12345), Confluence URL, or free-text description> | ||
| --- | ||
|
|
||
| # Android Planning Workflow | ||
|
|
||
| You are guiding the developer through requirements refinement and implementation planning for the Bitwarden Android project. The input to plan from is: | ||
|
|
||
| **Input**: $ARGUMENTS | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - **Jira/Confluence access**: Fetching tickets and wiki pages requires the `bitwarden-atlassian-tools@bitwarden-marketplace` MCP plugin. If the plugin is not installed, Jira ticket IDs and Confluence URLs cannot be fetched automatically. | ||
|
|
||
| ## Workflow Phases | ||
|
|
||
| Work through each phase sequentially. **Confirm with the user before advancing to the next phase.** The user may skip phases that are not applicable. If starting from a partially completed plan, skip to the appropriate phase. | ||
|
|
||
| ### Phase 1: Ingest Requirements | ||
|
|
||
| Parse the input to detect and fetch all available sources: | ||
|
|
||
| **Source Detection Rules:** | ||
| - **Jira tickets** (patterns like `PM-\d+`, `BWA-\d+`, `EC-\d+`): Fetch via `get_issue` and `get_issue_comments`. Also fetch linked issue summaries (parent epic, sub-tasks, blockers) for context. | ||
| - **Confluence URLs** (containing `atlassian.net/wiki` or confluence page IDs): Extract page ID and fetch via `get_confluence_page`. If the page is a parent page, fetch child pages via `get_child_pages` and ask the user which are relevant. | ||
| - **Free text**: Treat as direct requirements β no fetching needed. | ||
| - **Multiple inputs**: All are first-class sources. Fetch each independently and consolidate. | ||
| - **Tool unavailable**: If `get_issue`, `get_confluence_page`, or other Atlassian tools are not available, inform the user that the `bitwarden-atlassian-tools@bitwarden-marketplace` MCP plugin is required and prompt them to install and configure it. In the meantime, ask the user to paste the relevant content directly. Treat pasted content as free-text input. | ||
|
|
||
| **Present a structured summary:** | ||
| 1. Sources identified and fetched (with links) | ||
| 2. Raw requirements extracted from each source | ||
| 3. Initial scope assessment (small / medium / large) | ||
|
|
||
| **Edge cases:** | ||
| - Jira ticket with no description β flag as critical gap that Phase 2 must address | ||
| - Multiple tickets β fetch all, consolidate, flag any contradictions | ||
| - Ticket + free text β both treated as first-class; free text supplements ticket | ||
|
|
||
| **Gate**: User confirms the summary is complete and may add additional sources or context before proceeding. | ||
|
|
||
| ### Phase 2: Refine Requirements | ||
|
|
||
| Invoke the `refining-android-requirements` skill and use it to perform gap analysis on the raw requirements from Phase 1. | ||
|
|
||
| The skill will: | ||
| 1. Consolidate all sources into a working document | ||
| 2. Evaluate requirements against a structured rubric (functional, technical, security, UX, cross-cutting) | ||
| 3. Present categorized gaps as blocking or non-blocking questions | ||
| 4. After user answers, produce a structured specification with numbered IDs | ||
|
|
||
| **Gate**: User approves the refined specification. They may request changes or provide additional answers. | ||
|
|
||
| ### Phase 3: Plan Implementation | ||
|
|
||
| Invoke the `planning-android-implementation` skill and use it to design the implementation approach based on the refined spec from Phase 2. | ||
|
|
||
| The skill will: | ||
| 1. Classify the change type | ||
| 2. Explore the codebase for reference implementations and integration points | ||
| 3. Design the architecture with component relationships | ||
| 4. Produce a file inventory and phased implementation plan | ||
| 5. Assess risks and define verification criteria | ||
|
|
||
| **Gate**: User reviews the implementation plan and may request changes to architecture, phasing, or scope. | ||
|
|
||
| ### Phase 4: Finalize & Save | ||
|
|
||
| Merge the outputs from Phase 2 (specification) and Phase 3 (implementation plan) into a single design document using this template: | ||
|
|
||
| ```markdown | ||
| # [Feature Name] β Design Document | ||
|
|
||
| **Feature**: [concise description] | ||
| **Date**: [current date] | ||
| **Status**: Ready for Implementation | ||
| **Jira**: [ticket ID if available] | ||
| **Sources**: [list of all input sources with links] | ||
|
|
||
| --- | ||
|
|
||
| ## Requirements Specification | ||
|
|
||
| [Full output from Phase 2 β the refined specification with numbered IDs] | ||
|
|
||
| --- | ||
|
|
||
| ## Implementation Plan | ||
|
|
||
| [Full output from Phase 3 β architecture, file inventory, phases, risks] | ||
|
|
||
| --- | ||
|
|
||
| ## Executing This Plan | ||
|
|
||
| To implement this plan, run: | ||
|
|
||
| /work-on-android [ticket or feature reference] | ||
|
|
||
| Reference this design document during implementation for architecture decisions, | ||
| file locations, and phase ordering. | ||
| ``` | ||
|
|
||
| **Save the document:** | ||
| - With ticket: `.claude/outputs/plans/PM-XXXXX-FEATURE-NAME-PLAN.md` | ||
SaintPatrck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - Without ticket: `.claude/outputs/plans/FEATURE-NAME-PLAN.md` | ||
| - Feature name should be uppercase with hyphens (e.g., `BIOMETRIC-TIMEOUT-CONFIG-PLAN.md`) | ||
| - Create the output directory if it does not exist | ||
|
|
||
| **On completion**: Present the saved file path and remind the user they can execute the plan with `/work-on-android`. | ||
|
|
||
| ## Guidelines | ||
|
|
||
| - Be explicit about which phase you are in at all times. | ||
| - If the user wants to skip a phase, acknowledge and move to the next applicable phase. | ||
| - When fetching from Jira/Confluence, summarize what was found rather than dumping raw content. | ||
| - Questions in Phase 2 should be specific and actionable, not generic. | ||
| - The implementation plan in Phase 3 should reference concrete files in the codebase, not abstract descriptions. | ||
191 changes: 191 additions & 0 deletions
191
.claude/skills/planning-android-implementation/SKILL.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,191 @@ | ||
| --- | ||
| name: planning-android-implementation | ||
| version: 0.1.0 | ||
| description: Architecture design and phased implementation planning for Bitwarden Android. Use when planning implementation, designing architecture, creating file inventories, or breaking features into phases. Triggered by "plan implementation", "architecture design", "implementation plan", "break this into phases", "what files do I need", "design the architecture". | ||
| --- | ||
|
|
||
| # Implementation Planning | ||
|
|
||
| This skill takes a refined specification (ideally from the `refining-android-requirements` skill) and produces a phased implementation plan with architecture design, file inventory, and risk assessment. | ||
|
|
||
| **Prerequisite**: A clear set of requirements. If requirements are vague or incomplete, invoke the `refining-android-requirements` skill first. | ||
|
|
||
| --- | ||
|
|
||
| ## Step 1: Classify Change | ||
|
|
||
| Determine the change type to guide scope and planning depth: | ||
|
|
||
| | Type | Description | Typical Scope | | ||
| |------|-------------|---------------| | ||
| | **New Feature** | Entirely new functionality, screens, or flows | New files + modifications, multi-phase | | ||
| | **Enhancement** | Extending existing feature with new capabilities | Mostly modifications, 1-2 phases | | ||
| | **Bug Fix** | Correcting incorrect behavior | Targeted modifications, single phase | | ||
| | **Refactoring** | Restructuring without behavior change | Modifications only, migration-aware | | ||
| | **Infrastructure** | Build, CI, tooling, or dependency changes | Config files, minimal code changes | | ||
|
|
||
| State the classification and rationale before proceeding. | ||
|
|
||
| --- | ||
|
|
||
| ## Step 2: Codebase Exploration | ||
|
|
||
| Search the codebase to find reference implementations and integration points. Use the discovery commands from the `build-test-verify` skill as needed. | ||
|
|
||
| ### Find Pattern Anchors | ||
|
|
||
| Identify 2-3 existing files that serve as templates for the planned work: | ||
|
|
||
| ``` | ||
| **Pattern Anchors:** | ||
| 1. [file path] β [why this is a good reference] | ||
| 2. [file path] β [why this is a good reference] | ||
| 3. [file path] β [why this is a good reference] | ||
| ``` | ||
|
|
||
| ### Map Integration Points | ||
|
|
||
| Identify files that must be modified to integrate the new work: | ||
|
|
||
| - **Navigation**: Nav graph registrations, route definitions | ||
| - **Dependency Injection**: Hilt modules, `@Provides` / `@Binds` functions | ||
| - **Data Layer**: Repository interfaces, data source interfaces, Room DAOs | ||
| - **API Layer**: Retrofit service interfaces, request/response models | ||
| - **Feature Flags**: Feature flag definitions and checks | ||
| - **Managers**: Single-responsibility data layer classes (see `docs/ARCHITECTURE.md` Managers section) | ||
| - **Test Fixtures**: Shared test utilities in `src/testFixtures/` directories | ||
| - **Product Flavor Source Sets**: Code in `src/standard/` vs `src/main/` for Play Services dependencies | ||
|
|
||
| ### Document Existing Patterns | ||
|
|
||
| Note the specific patterns used by the pattern anchors: | ||
| - State class structure (sealed class, data class fields) | ||
| - Action/Event naming conventions | ||
| - Repository method signatures and return types | ||
| - Test structure and assertion patterns | ||
|
|
||
| --- | ||
|
|
||
| ## Step 3: Architecture Design | ||
|
|
||
| Produce an ASCII diagram showing component relationships for the planned work: | ||
|
|
||
| ``` | ||
| βββββββββββββββββββ | ||
| β Screen β β Compose UI | ||
| β (Composable) β | ||
| ββββββββββ¬βββββββββ | ||
| β State / Action / Event | ||
| ββββββββββΌβββββββββ | ||
| β ViewModel β β Business logic orchestration | ||
| ββββββββββ¬βββββββββ | ||
| β Repository calls | ||
| ββββββββββΌβββββββββ | ||
| β Repository β β Data coordination (sealed class results) | ||
| βββββ¬βββββ¬βββββ¬ββββ | ||
| β β β | ||
| βββββΌββββ β βββΌβββββββ | ||
| βManagerβ β βManager β β Single-responsibility (optional) | ||
| βββββ¬ββββ β βββ¬βββββββ | ||
| β β β | ||
| βββββΌββββββΌββββΌβββββ | ||
| β Data Sources β β Raw data (Result<T>, never throw) | ||
| βββ¬βββββ¬βββββ¬βββββββ | ||
| β β β | ||
| Room Retrofit SDK | ||
| ``` | ||
|
|
||
| Adapt the diagram to show the actual components planned. _Consult `docs/ARCHITECTURE.md` for full data layer patterns and conventions._ | ||
|
|
||
| ### Design Decisions | ||
|
|
||
| Document key architectural decisions in a table: | ||
|
|
||
| | Decision | Resolution | Rationale | | ||
| |----------|-----------|-----------| | ||
| | [What needed deciding] | [What was chosen] | [Why] | | ||
|
|
||
| --- | ||
|
|
||
| ## Step 4: File Inventory | ||
|
|
||
| ### Files to Create | ||
|
|
||
| | File Path | Type | Pattern Reference | | ||
| |-----------|------|-------------------| | ||
| | [full path] | [ViewModel / Screen / Repository / etc.] | [pattern anchor file] | | ||
|
|
||
| **Include in file inventory:** | ||
| - `...Navigation.kt` files for new screens | ||
| - `...Module.kt` Hilt module files for new DI bindings | ||
| - Paired test files (`...Test.kt`) for each new class | ||
|
|
||
| ### Files to Modify | ||
|
|
||
| | File Path | Change Description | Risk Level | | ||
| |-----------|-------------------|------------| | ||
| | [full path] | [what changes] | Low / Medium / High | | ||
|
|
||
| **Risk levels:** | ||
| - **Low**: Additive changes (new entries in nav graph, new bindings in Hilt module) | ||
| - **Medium**: Modifying existing logic (adding parameters, new branches) | ||
| - **High**: Changing interfaces, data models, or shared utilities | ||
|
|
||
| --- | ||
|
|
||
| ## Step 5: Implementation Phases | ||
|
|
||
| Break the work into sequential phases. Each phase should be independently testable and committable. | ||
|
|
||
| **Phase ordering principle**: Foundation β SDK/Data β Network β UI (tests accompany each phase) | ||
|
|
||
| For each phase: | ||
|
|
||
| ```markdown | ||
| ### Phase N: [Name] | ||
|
|
||
| **Goal**: [What this phase accomplishes] | ||
|
|
||
| **Files**: | ||
| - Create: [list] | ||
| - Modify: [list] | ||
|
|
||
| **Tasks**: | ||
| 1. [Specific implementation task] | ||
| 2. [Specific implementation task] | ||
| 3. ... | ||
|
|
||
| **Verification**: | ||
| - [Test command or manual verification step] | ||
|
|
||
| **Skills**: [Which workflow skills apply β e.g., `implementing-android-code`, `testing-android-code`] | ||
| ``` | ||
|
|
||
| ### Phase Guidelines | ||
|
|
||
| - Each phase should be small enough to be independently testable and committable | ||
| - Tests are written within the same phase as the code they verify (not deferred to a "testing phase") | ||
| - UI phases come after their data dependencies are in place | ||
| - If a phase has more than 5 tasks, consider splitting it | ||
SaintPatrck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| --- | ||
|
|
||
| ## Step 6: Risk & Verification | ||
|
|
||
| ### Risk Assessment | ||
|
|
||
| | Risk | Likelihood | Impact | Mitigation | | ||
| |------|-----------|--------|------------| | ||
| | [What could go wrong] | Low/Med/High | Low/Med/High | [How to prevent or handle] | | ||
|
|
||
| ### Verification Plan | ||
|
|
||
| **Automated Verification:** | ||
| - Unit test commands (from `build-test-verify` skill) | ||
| - Lint/detekt commands | ||
| - Build verification | ||
|
|
||
| **Manual Verification:** | ||
| - [Specific manual test scenarios] | ||
| - [Edge cases to manually verify] | ||
| - Verify ViewModel state survives process death (test via `SavedStateHandle` persistence and `Don't keep activities` developer option) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.