Work Packages: Agent Skills Pack
Inputs: Design documents from kitty-specs/055-agent-skills-pack/ Prerequisites: plan.md (required), spec.md (user stories), research.md, data-model.md, quickstart.md PRD Source: prd-spec-kitty-agent-skills-pack-v1.md Target: Spec Kitty 2.0.11+ (2.x line only)
Tests: Included — 90%+ coverage required per constitution.
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/ generated by /spec-kitty.tasks.
Work Package WP01: Canonical Skill Source Layout & Registry (Priority: P0)
Goal: Create the canonical skill source directory under src/doctrine/skills/ and the skill registry that discovers packaged skills from either local dev checkout or installed package. Independent Test: Registry discovers skills from a test directory and returns correct CanonicalSkill objects. Prompt: tasks/WP01-skill-source-layout-and-registry.md Requirement Refs: FR-001, C-004
Included Subtasks
- ✅ T001 Create
src/doctrine/skills/directory with placeholder structure - ✅ T002 Create
src/specify_cli/skills/package with__init__.py - ✅ T003 Implement
src/specify_cli/skills/registry.py— discover canonical skills - ✅ T004 [P] Unit tests for registry in
tests/specify_cli/skills/test_registry.py
Implementation Notes
- Registry must support both local dev path (
get_local_repo_root()→src/doctrine/skills/) and installed package path (get_package_asset_root()→doctrine/skills/) - Each discovered skill directory must contain a
SKILL.mdfile to be considered valid - Return
CanonicalSkilldataclass instances with name, paths to all installable files
Parallel Opportunities
- T004 (tests) can be written in parallel with T003 (implementation)
Dependencies
- None (foundational package)
Risks & Mitigations
- Package path discovery may differ between editable install and wheel install → test both via
get_package_asset_root()with mocked paths
Work Package WP02: AGENT_SKILL_CONFIG Capability Matrix (Priority: P0)
Goal: Add the framework capability matrix as a configuration constant alongside the existing AGENT_COMMAND_CONFIG. Independent Test: Import AGENT_SKILL_CONFIG and verify all 13 agents have correct installation classes and skill roots. Prompt: tasks/WP02-agent-skill-config.md Requirement Refs: FR-003, C-001
Included Subtasks
- ✅ T005 Add installation class constants to
src/specify_cli/core/config.py - ✅ T006 Add
AGENT_SKILL_CONFIGdict tosrc/specify_cli/core/config.py - ✅ T007 Export new symbols from
src/specify_cli/core/__init__.py - ✅ T008 [P] Unit tests for config entries in
tests/specify_cli/core/test_skill_config.py
Implementation Notes
- Must match PRD section 6 capability matrix exactly
- Three installation classes:
shared-root-capable,native-root-required,wrapper-only - Every agent in
AI_CHOICESmust have a corresponding entry inAGENT_SKILL_CONFIG - Include
antigravityagent (added in 2.x but not in PRD matrix — default to shared-root-capable)
Parallel Opportunities
- T008 (tests) can proceed in parallel with T005-T007
Dependencies
- None (independent constants)
Risks & Mitigations
- Agent list may diverge from
AI_CHOICES→ test validates 1:1 correspondence
Work Package WP03: ManagedSkillManifest Dataclass & Persistence (Priority: P0)
Goal: Create the dedicated managed-file manifest with dataclasses and JSON persistence for tracking installed skill files. Independent Test: Create, save, load, and query a manifest with test entries; verify round-trip fidelity. Prompt: tasks/WP03-managed-skill-manifest.md Requirement Refs: FR-004, FR-005, C-005
Included Subtasks
- ✅ T009 Create
ManagedFileEntryandManagedSkillManifestdataclasses insrc/specify_cli/skills/manifest.py - ✅ T010 Implement JSON persistence (save/load/clear) to
.kittify/skills-manifest.json - ✅ T011 Implement helper methods (add_entry, remove_entries_for_agent, find_by_skill)
- ✅ T012 Implement content hash computation utility (SHA-256)
- ✅ T013 [P] Unit tests for manifest in
tests/specify_cli/skills/test_manifest.py
Implementation Notes
- Manifest schema version starts at 1
- Use
dataclasseswithasdict/from_dictfor serialization - All timestamps in ISO 8601 UTC
- Content hash format:
sha256:<hex_digest> - Use
specify_cli.core.atomic.atomic_writefor safe persistence
Parallel Opportunities
- T013 (tests) can proceed alongside implementation
Dependencies
- None (independent data layer)
Risks & Mitigations
- Concurrent writes during parallel agent runs → use atomic_write for file safety
- Schema evolution → version field enables future migrations
Work Package WP04: Skill Installer (Priority: P1)
Goal: Implement the installer that copies canonical skills to agent-specific skill roots based on the capability matrix and builds manifest entries. Independent Test: Install skills for test agents into a temp directory; verify correct files in correct roots with correct manifest entries. Prompt: tasks/WP04-skill-installer.md Requirement Refs: FR-002, FR-003, FR-004, FR-008
Included Subtasks
- ✅ T014 Implement
install_skills_for_agent()insrc/specify_cli/skills/installer.py - ✅ T015 Implement
install_all_skills()orchestration across agents - ✅ T016 Handle shared-root deduplication (install once to
.agents/skills/) - ✅ T017 Build manifest entries during installation and return them
- ✅ T018 [P] Unit tests for installer in
tests/specify_cli/skills/test_installer.py
Implementation Notes
- For shared-root-capable agents, install to
.agents/skills/only (first root in config) - For native-root-required agents, install to vendor-specific root
- For wrapper-only agents, skip skill installation entirely
- Preserve existing files not managed by the manifest (don't wipe skill root)
- Copy entire skill directory tree (SKILL.md + references/ + scripts/ + assets/)
Parallel Opportunities
- T018 (tests) can proceed alongside implementation
Dependencies
- Depends on WP01 (registry to discover skills), WP02 (config for routing), WP03 (manifest for entries)
Risks & Mitigations
- Shared root installed multiple times for multiple agents → track "already installed to shared root" flag
- File permission issues on Windows → use shutil.copy2 for metadata preservation
Work Package WP05: Init Integration (Priority: P1)
Goal: Add skill installation as a step in spec-kitty init, after wrapper generation and before git initialization. Independent Test: Run init in a temp project; verify skills appear in correct roots and manifest exists. Prompt: tasks/WP05-init-integration.md Requirement Refs: FR-002, FR-008, FR-011, NFR-001
Included Subtasks
- ✅ T019 Add skill installation step to init.py after
generate_agent_assets()call - ✅ T020 Add StepTracker entries for skill install progress display
- ✅ T021 Write manifest to
.kittify/skills-manifest.jsonat end of init - ✅ T022 Handle template_mode (local vs package) for skill source discovery
- ✅ T023 [P] Integration test for init with skills in
tests/specify_cli/skills/test_init_integration.py
Implementation Notes
- Insert skill installation inside the per-agent loop at ~line 775 of init.py
- Use registry to discover skills from local or package source
- Use installer to copy skills for each agent
- Accumulate manifest entries across all agents, write once at end
- Add tracker steps:
{agent_key}-skills→ "install skill pack" - Must NOT break existing wrapper generation (C-003)
Parallel Opportunities
- T023 (integration test) can proceed after T019-T022 are complete
Dependencies
- Depends on WP04 (installer module)
Risks & Mitigations
- Init.py is large (1140 lines) — surgical insertion required
- Existing tests may break if init behavior changes → run existing test suite first
- Template mode handling must match existing local/package/remote patterns
Work Package WP06: Skill Verifier (Priority: P1)
Goal: Implement verification and repair for managed skill files by comparing installed state against the manifest and canonical source. Independent Test: Install skills, corrupt one, verify detects drift, repair restores it. Prompt: tasks/WP06-skill-verifier.md Requirement Refs: FR-006, FR-007
Included Subtasks
- ✅ T024 Implement
verify_installed_skills()insrc/specify_cli/skills/verifier.py - ✅ T025 Implement
VerifyResultdataclass with missing/drifted/unmanaged lists - ✅ T026 Implement
repair_skills()— restore from canonical source - ✅ T027 [P] Unit tests for verifier in
tests/specify_cli/skills/test_verifier.py
Implementation Notes
verify_installed_skills()reads manifest, checks each entry:- File exists? → if not, add to
missing - Content hash matches? → if not, add to
driftedwith actual hash - Scan skill roots for unmanaged files → add to
unmanaged repair_skills()uses registry to find canonical source, copies to installed path, updates manifest hash- Both functions take
project_path: Pathas primary argument
Parallel Opportunities
- T027 (tests) can proceed alongside implementation
Dependencies
- Depends on WP03 (manifest for reading installed state)
Risks & Mitigations
- Canonical source may not be available during repair (corrupted install) → raise clear error with reinstall instructions
- Partial repair failure → use atomic operations per file, report partial results
Work Package WP07: Verify Integration (Priority: P2)
Goal: Wire skill verification into the existing spec-kitty verify command output. Independent Test: Run spec-kitty verify on a project with skills; see skill status in output. Prompt: tasks/WP07-verify-integration.md Requirement Refs: FR-006, FR-012
Included Subtasks
- ✅ T028 Add managed skill checks to
src/specify_cli/verify_enhanced.py - ✅ T029 Display skill verification results with Rich formatting
- ✅ T030 Detect duplicate skill names across roots
- ✅ T031 [P] Integration test for verify with skills in
tests/specify_cli/skills/test_verify_integration.py
Implementation Notes
- Read the existing verify_enhanced.py to understand its output pattern
- Add a new section "Managed Skills" to the verify output
- Show: total installed, missing, drifted, unmanaged counts
- If drift detected, show per-file details
- Duplicate detection: scan all skill roots for duplicate SKILL.md
name:values
Parallel Opportunities
- T031 (integration test) can proceed after T028-T030
Dependencies
- Depends on WP06 (verifier module)
Risks & Mitigations
- verify_enhanced.py may have a specific output contract → match existing formatting patterns
Work Package WP08: Author spec-kitty-setup-doctor Skill (Priority: P1)
Goal: Write the first canonical shipped skill with proper SKILL.md, references, and scripts per PRD section 8. Independent Test: Read SKILL.md; confirm it has valid frontmatter, positive triggers, negative scope, and actionable workflow steps. Prompt: tasks/WP08-setup-doctor-skill.md Requirement Refs: FR-009, FR-010, C-006, C-007
Included Subtasks
- ✅ T032 Write
src/doctrine/skills/spec-kitty-setup-doctor/SKILL.mdwith frontmatter and workflow - ✅ T033 Create
src/doctrine/skills/spec-kitty-setup-doctor/references/agent-path-matrix.md - ✅ T034 Create
src/doctrine/skills/spec-kitty-setup-doctor/references/common-failure-signatures.md - ✅ T035 [P] Validate skill content against PRD section 8 and design principles
Implementation Notes
- Frontmatter:
nameanddescriptiononly (PRD principle 9) - Description must include positive triggers: "set up Spec Kitty", "skills missing", "next is blocked", "runtime is broken"
- Description must include negative scope: "generic coding questions with no Spec Kitty context"
- Body: detect agent surface, verify roots/manifest/wrappers, diagnose failures, direct to next command
- References: agent path matrix (all 13 agents with roots), common failure signatures
- No repo-specific absolute paths in any content
Parallel Opportunities
- T035 (validation) can proceed after T032-T034
Dependencies
- Depends on WP01 (skill directory structure must exist)
Risks & Mitigations
- Skill content quality directly affects trigger precision → review against PRD section 7 trigger table
Work Package WP09: End-to-End Integration Tests (Priority: P2)
Goal: Comprehensive integration tests covering the full init → verify → repair lifecycle with multiple agent types. Independent Test: All integration tests pass with pytest. Prompt: tasks/WP09-integration-tests.md Requirement Refs: NFR-003, NFR-005
Included Subtasks
- ✅ T036 Test full init → verify → repair cycle in
tests/specify_cli/skills/test_e2e.py - ✅ T037 Test per-installation-class distribution (shared, native, wrapper-only)
- ✅ T038 Test manifest persistence across sessions (save, reload, query)
- ✅ T039 Test drift detection and repair (delete, modify, verify, repair)
- ✅ T040 Test with multiple agents of different installation classes simultaneously
Implementation Notes
- Use
tmp_pathfixture for all filesystem tests - Mock
get_local_repo_root()andget_package_asset_root()to point to test fixtures - Create minimal skill fixtures (single SKILL.md with frontmatter)
- Test all three installation classes in same test to verify shared-root deduplication
- Verify manifest JSON structure matches schema
Parallel Opportunities
- Individual test functions are independent
Dependencies
- Depends on WP05 (init integration), WP07 (verify integration), WP08 (skill content)
Risks & Mitigations
- Tests may be slow if they invoke full init → use focused integration tests that call installer/verifier directly
- Flaky tests from filesystem timing → use synchronous operations only
Work Package WP10: Packaging Completeness (Priority: P1)
Goal: Resolved: packages = ["src/specify_cli"] in hatch config auto-includes all subpackages including skills/. The also_copy entry was added to [tool.mutmut] for mutation testing environment consistency, not for wheel packaging. Independent Test: Verify the skills module would be included in a wheel build. Prompt: tasks/WP10-packaging-completeness.md Requirement Refs: NFR-005
Included Subtasks
- ✅ T041 Add
src/specify_cli/skills/toalso_copyinpyproject.toml - ✅ T042 [P] Add packaging verification test confirming skills module is discoverable
Dependencies
- Depends on WP01-WP09 (first slice complete)
Work Package WP11: Author spec-kitty-runtime-next Skill (Priority: P1)
Goal: Author the second canonical shipped skill that teaches agents the spec-kitty next --agent <name> control loop (PRD section 8). Independent Test: Install via registry, verify correct frontmatter, triggers, workflow steps, and that it installs alongside setup-doctor without conflicts. Prompt: tasks/WP11-runtime-next-skill.md Requirement Refs: FR-009, FR-010, C-006, C-007
Included Subtasks
- ✅ T043 Write
src/doctrine/skills/spec-kitty-runtime-next/SKILL.mdwith frontmatter and workflow - ✅ T044 Create
src/doctrine/skills/spec-kitty-runtime-next/references/runtime-result-taxonomy.md - ✅ T045 Create
src/doctrine/skills/spec-kitty-runtime-next/references/blocked-state-recovery.md - ✅ T046 [P] Test registry discovers both skills and installer handles multi-skill pack
Dependencies
- Depends on WP10 (packaging complete)
Work Package WP12: Author spec-kitty-orchestrator-api-operator Skill (Priority: P2)
Goal: Author the canonical orchestrator-api skill teaching external systems how to use the orchestrator-api contract correctly (PRD section 8). Independent Test: Registry discovers the skill; content references only real orchestrator-api commands. Prompt: tasks/WP12-orchestrator-api-operator-skill.md Requirement Refs: FR-009, FR-010, C-006, C-007
Included Subtasks
- ✅ T047 Write
src/doctrine/skills/spec-kitty-orchestrator-api-operator/SKILL.md - ✅ T048 Create
references/orchestrator-api-contract.md - ✅ T049 Create
references/host-boundary-rules.md
Dependencies
- Depends on WP01 (skill directory structure)
Scope Decision: spec-kitty-specify-plan and spec-kitty-mission-orchestrator
Decision: Do NOT author these two skills per architectural boundary review.
spec-kitty-specify-planteaches _how to do product work_ (discovery, spec writing, planning), not _how to use Spec Kitty_. The specify/plan behavior is owned by the mission state machine andspec-kitty next. A skill here would duplicate mission composition logic.spec-kitty-mission-orchestratoris mission composition — deciding when to delegate to setup, doctrine, runtime, or review. That sequencing belongs in the mission state machine and future doctrine mission compiler (Issue #327), not in a hand-authored skill.
Both were called out in the PRD section 7 but the architectural boundary review (PR #305 / Issue #327 context) correctly identifies them as mission-authoring territory, not product-operation territory.
6 skills shipped. 2 skills deferred to doctrine mission compiler.
Dependency & Execution Summary
Phase 0 (parallel, no dependencies):
WP01 (registry) ──┐
WP02 (config) ──┼──> WP04 (installer) ──> WP05 (init integration)
WP03 (manifest) ──┤ │
└──> WP06 (verifier) ──> WP07 (verify integration) ──┐
│ ├──> WP09 (e2e tests)
WP01 ──────────────└──> WP08 (setup-doctor skill) ─────────────────────┘
Parallel waves:
- Wave 1: WP01, WP02, WP03 (all independent)
- Wave 2: WP04, WP06, WP08 (WP04 needs Wave 1; WP06 needs WP03; WP08 needs WP01)
- Wave 3: WP05, WP07 (WP05 needs WP04; WP07 needs WP06)
- Wave 4: WP09 (needs WP05, WP07, WP08)
MVP Scope: WP01-WP05 + WP08 deliver a working init with skills. WP06-WP07 add verify. WP09 adds confidence.
Requirements Coverage Summary
| Requirement ID | Covered By Work Package(s) |
|---|---|
| FR-001 | WP01 |
| FR-002 | WP04, WP05 |
| FR-003 | WP02, WP04 |
| FR-004 | WP03, WP04 |
| FR-005 | WP03 |
| FR-006 | WP06, WP07 |
| FR-007 | WP06 |
| FR-008 | WP04, WP05 |
| FR-009 | WP08 |
| FR-011 | WP05 |
| FR-010 | WP08 |
| FR-012 | WP07 |
| NFR-001 | WP05 |
| NFR-003 | WP09 |
| NFR-005 | WP09 |
| C-001 | WP02 |
| C-004 | WP01 |
| C-005 | WP03 |
| C-006 | WP08 |
| C-007 | WP08 |
Subtask Index (Reference)
| Subtask ID | Summary | Work Package | Priority | Parallel? |
|---|---|---|---|---|
| T001 | Create doctrine/skills/ directory | WP01 | P0 | No |
| T002 | Create specify_cli/skills/ package | WP01 | P0 | No |
| T003 | Implement registry.py | WP01 | P0 | No |
| T004 | Unit tests for registry | WP01 | P0 | Yes |
| T005 | Add installation class constants | WP02 | P0 | No |
| T006 | Add AGENT_SKILL_CONFIG dict | WP02 | P0 | No |
| T007 | Export new symbols | WP02 | P0 | No |
| T008 | Unit tests for config | WP02 | P0 | Yes |
| T009 | Create manifest dataclasses | WP03 | P0 | No |
| T010 | Implement JSON persistence | WP03 | P0 | No |
| T011 | Implement helper methods | WP03 | P0 | No |
| T012 | Content hash utility | WP03 | P0 | No |
| T013 | Unit tests for manifest | WP03 | P0 | Yes |
| T014 | Implement install_skills_for_agent | WP04 | P1 | No |
| T015 | Implement install_all_skills | WP04 | P1 | No |
| T016 | Shared-root deduplication | WP04 | P1 | No |
| T017 | Build manifest entries | WP04 | P1 | No |
| T018 | Unit tests for installer | WP04 | P1 | Yes |
| T019 | Add skill install to init.py | WP05 | P1 | No |
| T020 | Add StepTracker entries | WP05 | P1 | No |
| T021 | Write manifest at end of init | WP05 | P1 | No |
| T022 | Handle template_mode for skills | WP05 | P1 | No |
| T023 | Integration test for init | WP05 | P1 | Yes |
| T024 | Implement verify_installed_skills | WP06 | P1 | No |
| T025 | Implement VerifyResult dataclass | WP06 | P1 | No |
| T026 | Implement repair_skills | WP06 | P1 | No |
| T027 | Unit tests for verifier | WP06 | P1 | Yes |
| T028 | Add skill checks to verify_enhanced | WP07 | P2 | No |
| T029 | Display results with Rich | WP07 | P2 | No |
| T030 | Detect duplicate skill names | WP07 | P2 | No |
| T031 | Integration test for verify | WP07 | P2 | Yes |
| T032 | Write SKILL.md for setup-doctor | WP08 | P1 | No |
| T033 | Create agent-path-matrix reference | WP08 | P1 | No |
| T034 | Create failure-signatures reference | WP08 | P1 | No |
| T035 | Validate skill content | WP08 | P1 | Yes |
| T036 | Test full init→verify→repair cycle | WP09 | P2 | No |
| T037 | Test per-class distribution | WP09 | P2 | Yes |
| T038 | Test manifest persistence | WP09 | P2 | Yes |
| T039 | Test drift detection and repair | WP09 | P2 | Yes |
| T040 | Test multiple agents simultaneously | WP09 | P2 | Yes |