Work Packages: Per-Feature Mission Selection
Inputs: Design documents from kitty-specs/006-per-feature-mission/ Prerequisites: plan.md (required), spec.md (user stories), research.md, data-model.md, quickstart.md
Tests: Include unit tests for new mission resolution logic per spec requirements.
Organization: Fine-grained subtasks (Txxx) roll up into work packages (WPxx). Each work package is independently deliverable and testable.
Prompt Files: Each work package references a matching prompt file in tasks/planned/ generated by /spec-kitty.tasks.
Subtask Format: [Txxx] [P?] Description
- [P] indicates the subtask can proceed in parallel (different files/components).
- Include precise file paths or modules.
Work Package WP01: Core Mission Discovery (Priority: P0)
Goal: Add get_mission_for_feature() function and update mission discovery to support per-feature resolution. Independent Test: Unit tests pass for new mission resolution functions; can load mission from a feature's meta.json. Prompt: tasks/WP01-core-mission-discovery.md
Included Subtasks
- □ T001 Add
get_mission_for_feature()function insrc/specify_cli/mission.py - □ T002 Add
discover_missions()function returning missions with source indicators - □ T003 Add helper to read mission field from meta.json with software-dev default
- □ T004 Add unit tests for
get_mission_for_feature()intests/unit/test_mission.py - □ T005 Add unit tests for backward compatibility (missing mission field defaults to software-dev)
Implementation Notes
1. Read existing src/specify_cli/mission.py to understand current get_active_mission() pattern 2. get_mission_for_feature(feature_dir) should:
3. discover_missions() should scan .kittify/missions/ and return dict with source info
- Load
meta.jsonfrom feature_dir - Extract
missionfield (default: "software-dev") - Call existing
get_mission_by_name()to load the mission - If mission not found, warn and return software-dev
Parallel Opportunities
- T004, T005 can be written in parallel once T001-T003 are complete
Dependencies
- None (starting package)
Risks & Mitigations
- Breaking existing
get_active_mission()callers → Keep function, update internals later in WP04
Work Package WP02: Script Mission Parameter (Priority: P0)
Goal: Update create-new-feature.sh to accept --mission <key> parameter and write mission to meta.json. Independent Test: Run script with --mission research and verify meta.json contains "mission": "research". Prompt: tasks/WP02-script-mission-parameter.md
Included Subtasks
- □ T006 Add
--missionflag parsing in.kittify/scripts/bash/create-new-feature.sh - □ T007 Validate mission exists before writing (exit with error if invalid)
- □ T008 Write
missionfield to meta.json alongside existing fields - □ T009 Update script help text to document new parameter
- □ T010 [P] Update PowerShell variant
.kittify/scripts/powershell/create-new-feature.ps1if present
Implementation Notes
1. Add case handling in the while loop for --mission and --mission=* 2. Store mission value in MISSION variable 3. Validation: Check if .kittify/missions/$MISSION/mission.yaml exists 4. In JSON output section, add "mission":"$MISSION" to meta.json cat command
Parallel Opportunities
- T010 (PowerShell) can be done in parallel with bash work
Dependencies
- Depends on WP01 (discovery functions needed for validation)
Risks & Mitigations
- Script already complex → Minimize changes, follow existing patterns
Work Package WP03: Specify Command Integration (Priority: P1) - MVP
Goal: Update /spec-kitty.specify prompt to include mission inference and pass --mission flag to script. Independent Test: Run /spec-kitty.specify with software description, verify LLM suggests software-dev mission and stores it in meta.json. Prompt: tasks/WP03-specify-command-integration.md
Included Subtasks
- □ T011 Add mission inference section to
.kittify/missions/software-dev/command-templates/specify.md - □ T012 Add list of available missions with descriptions for LLM context
- □ T013 Add mission confirmation question to discovery flow
- □ T014 Update script invocation to include
--mission <selected>parameter - □ T015 Handle explicit mission override when user provides
--missionflag - □ T016 [P] Update research mission's specify.md if different from software-dev
Implementation Notes
1. After discovery summary confirmation, add new section: ``` ## Mission Selection Based on your feature description, analyze which mission type fits best:
- software-dev: Building software features, APIs, CLI tools
- research: Literature reviews, investigations, analysis
Confirm with user: "This seems like a [mission] project. Should I use the [mission] mission?" `` 2. Update script call to include --mission "$SELECTED_MISSION"` 3. If user explicitly says "use research mission" in description, skip confirmation
Parallel Opportunities
- T016 can proceed in parallel after T011-T015 are defined
Dependencies
- Depends on WP02 (script must accept --mission flag)
Risks & Mitigations
- LLM inference accuracy → Always confirm with user before proceeding
Work Package WP04: Downstream Command Updates (Priority: P1)
Goal: Update all downstream commands to read mission from feature's meta.json instead of project-level active-mission. Independent Test: Run /spec-kitty.plan on a feature with "mission": "research" and verify research templates are used. Prompt: tasks/WP04-downstream-command-updates.md
Included Subtasks
- □ T017 Identify all files calling
get_active_mission() - □ T018 Update
setup-plan.shto read mission from feature's meta.json - □ T019 [P] Update
check-prerequisites.shto support per-feature mission - □ T020 [P] Update plan.md prompt template to use feature mission
- □ T021 [P] Update tasks.md prompt template to use feature mission
- □ T022 [P] Update implement.md prompt template to use feature mission
- □ T023 [P] Update review.md prompt template to use feature mission
- □ T024 Update Python code that reads active mission to use
get_mission_for_feature()
Implementation Notes
1. Grep for get_active_mission and active-mission across codebase 2. Scripts reading mission should now check feature's meta.json first 3. Fall back to software-dev if mission field missing (backward compatibility) 4. Each prompt template may need to load feature context differently
Parallel Opportunities
- T019-T023 can all proceed in parallel once T017-T018 establish the pattern
Dependencies
- Depends on WP01 (get_mission_for_feature function)
- Depends on WP03 (features will have mission in meta.json)
Risks & Mitigations
- Many files to update → Use grep to ensure complete coverage
- Breaking existing features → Keep backward compatibility default
Work Package WP05: Deprecation and Cleanup (Priority: P2)
Goal: Remove deprecated mission switch command and clean up init command. Independent Test: Running spec-kitty mission switch returns helpful error; spec-kitty init works without mission prompt. Prompt: tasks/WP05-deprecation-and-cleanup.md
Included Subtasks
- □ T025 Remove
switchsubcommand fromsrc/specify_cli/cli/commands/mission.py - □ T026 Add helpful error message when switch is attempted
- □ T027 Update
spec-kitty mission listto show source indicators (project/built-in) - □ T028 Remove
--missionflag fromspec-kitty initif present - □ T029 Remove
set_active_mission()function fromsrc/specify_cli/mission.py - □ T030 Update CLI help text to reflect new per-feature model
Implementation Notes
1. In mission.py CLI, replace switch command with error function 2. Error message: "The 'mission switch' command was removed in v0.8.0. Missions are now selected per-feature during /spec-kitty.specify." 3. Update list command output format to show source column 4. Search for --mission in init.py and remove
Parallel Opportunities
- T025-T026 (switch removal) can proceed in parallel with T027 (list update) and T028-T29 (init cleanup)
Dependencies
- Depends on WP04 (downstream commands must work with per-feature model first)
Risks & Mitigations
- Breaking user workflows → Clear error messages explaining new approach
Work Package WP06: Migration and Release (Priority: P2)
Goal: Add migration to upgrade command and prepare v0.8.0 release. Independent Test: Running spec-kitty upgrade on project with .kittify/active-mission removes the file; version shows 0.8.0. Prompt: tasks/WP06-migration-and-release.md
Included Subtasks
- □ T031 Add migration step to
spec-kitty upgradeto remove.kittify/active-mission - □ T032 Document breaking changes in CHANGELOG.md
- □ T033 Update version to 0.8.0 in pyproject.toml
- □ T034 Update README.md with new per-feature mission workflow
- □ T035 [P] Update any documentation files referencing old mission model
- □ T036 Final validation: run full workflow on test project
Implementation Notes
1. In upgrade command, add step: ``python active_mission = kittify_dir / "active-mission" if active_mission.exists() or active_mission.is_symlink(): active_mission.unlink() console.print("[yellow]Removed deprecated .kittify/active-mission[/yellow]") ` 2. CHANGELOG entry should list all breaking changes from spec 3. README should show new /spec-kitty.specify` workflow with mission selection
Parallel Opportunities
- T032-T35 (documentation) can proceed in parallel after T031 (migration code)
Dependencies
- Depends on WP05 (all deprecated code removed)
Risks & Mitigations
- Users unaware of breaking changes → Prominent CHANGELOG and README updates
Dependency & Execution Summary
WP01 (Core Discovery) ─┬─► WP02 (Script Parameter) ─► WP03 (Specify Integration) ─┐
│ │
└──────────────────────────────────────────────────────────►├─► WP04 (Downstream)
│
└─► WP05 (Deprecation) ─► WP06 (Migration)
- Sequence: WP01 → WP02 → WP03 → WP04 → WP05 → WP06
- Parallelization: Within each WP, subtasks marked [P] can run in parallel
- MVP Scope: WP01 + WP02 + WP03 constitute the minimal viable release (mission selection works)
Subtask Index (Reference)
| Subtask ID | Summary | Work Package | Priority | Parallel? |
|---|---|---|---|---|
| T001 | Add get_mission_for_feature() | WP01 | P0 | No |
| T002 | Add discover_missions() | WP01 | P0 | No |
| T003 | Add meta.json helper | WP01 | P0 | No |
| T004 | Unit tests for get_mission_for_feature | WP01 | P0 | Yes |
| T005 | Unit tests for backward compat | WP01 | P0 | Yes |
| T006 | Add --mission flag to bash script | WP02 | P0 | No |
| T007 | Validate mission exists | WP02 | P0 | No |
| T008 | Write mission to meta.json | WP02 | P0 | No |
| T009 | Update script help text | WP02 | P0 | No |
| T010 | Update PowerShell variant | WP02 | P0 | Yes |
| T011 | Add mission inference to specify.md | WP03 | P1 | No |
| T012 | Add available missions list | WP03 | P1 | No |
| T013 | Add mission confirmation | WP03 | P1 | No |
| T014 | Update script invocation | WP03 | P1 | No |
| T015 | Handle explicit --mission override | WP03 | P1 | No |
| T016 | Update research mission specify.md | WP03 | P1 | Yes |
| T017 | Identify get_active_mission callers | WP04 | P1 | No |
| T018 | Update setup-plan.sh | WP04 | P1 | No |
| T019 | Update check-prerequisites.sh | WP04 | P1 | Yes |
| T020 | Update plan.md prompt | WP04 | P1 | Yes |
| T021 | Update tasks.md prompt | WP04 | P1 | Yes |
| T022 | Update implement.md prompt | WP04 | P1 | Yes |
| T023 | Update review.md prompt | WP04 | P1 | Yes |
| T024 | Update Python mission code | WP04 | P1 | No |
| T025 | Remove switch subcommand | WP05 | P2 | No |
| T026 | Add helpful error message | WP05 | P2 | No |
| T027 | Update list with source indicators | WP05 | P2 | Yes |
| T028 | Remove --mission from init | WP05 | P2 | Yes |
| T029 | Remove set_active_mission() | WP05 | P2 | Yes |
| T030 | Update CLI help text | WP05 | P2 | Yes |
| T031 | Add upgrade migration | WP06 | P2 | No |
| T032 | Document in CHANGELOG | WP06 | P2 | Yes |
| T033 | Version bump to 0.8.0 | WP06 | P2 | Yes |
| T034 | Update README | WP06 | P2 | Yes |
| T035 | Update other docs | WP06 | P2 | Yes |
| T036 | Final validation | WP06 | P2 | No |
<!-- status-model:start -->
Canonical Status (Generated)
<!-- status-model:end -->
- WP01: done
- WP02: done
- WP03: done
- WP04: done
- WP05: done
- WP06: done