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 in src/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() in tests/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.json from feature_dir
  • Extract mission field (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 --mission flag parsing in .kittify/scripts/bash/create-new-feature.sh
  • □ T007 Validate mission exists before writing (exit with error if invalid)
  • □ T008 Write mission field 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.ps1 if 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 --mission flag
  • □ 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.sh to read mission from feature's meta.json
  • □ T019 [P] Update check-prerequisites.sh to 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 switch subcommand from src/specify_cli/cli/commands/mission.py
  • □ T026 Add helpful error message when switch is attempted
  • □ T027 Update spec-kitty mission list to show source indicators (project/built-in)
  • □ T028 Remove --mission flag from spec-kitty init if present
  • □ T029 Remove set_active_mission() function from src/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 upgrade to 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 IDSummaryWork PackagePriorityParallel?
T001Add get_mission_for_feature()WP01P0No
T002Add discover_missions()WP01P0No
T003Add meta.json helperWP01P0No
T004Unit tests for get_mission_for_featureWP01P0Yes
T005Unit tests for backward compatWP01P0Yes
T006Add --mission flag to bash scriptWP02P0No
T007Validate mission existsWP02P0No
T008Write mission to meta.jsonWP02P0No
T009Update script help textWP02P0No
T010Update PowerShell variantWP02P0Yes
T011Add mission inference to specify.mdWP03P1No
T012Add available missions listWP03P1No
T013Add mission confirmationWP03P1No
T014Update script invocationWP03P1No
T015Handle explicit --mission overrideWP03P1No
T016Update research mission specify.mdWP03P1Yes
T017Identify get_active_mission callersWP04P1No
T018Update setup-plan.shWP04P1No
T019Update check-prerequisites.shWP04P1Yes
T020Update plan.md promptWP04P1Yes
T021Update tasks.md promptWP04P1Yes
T022Update implement.md promptWP04P1Yes
T023Update review.md promptWP04P1Yes
T024Update Python mission codeWP04P1No
T025Remove switch subcommandWP05P2No
T026Add helpful error messageWP05P2No
T027Update list with source indicatorsWP05P2Yes
T028Remove --mission from initWP05P2Yes
T029Remove set_active_mission()WP05P2Yes
T030Update CLI help textWP05P2Yes
T031Add upgrade migrationWP06P2No
T032Document in CHANGELOGWP06P2Yes
T033Version bump to 0.8.0WP06P2Yes
T034Update READMEWP06P2Yes
T035Update other docsWP06P2Yes
T036Final validationWP06P2No

<!-- status-model:start -->

Canonical Status (Generated)

<!-- status-model:end -->

  • WP01: done
  • WP02: done
  • WP03: done
  • WP04: done
  • WP05: done
  • WP06: done