<!-- SPDX-License-Identifier: MIT -->
<!-- SPDX-FileCopyrightText: 2025-2026 Marcus Quinn -->

# t1364.4: Design Bundle Preset Schema and Default Bundles

## Origin

- **Created:** 2026-02-28
- **Session:** claude-code:headless
- **Created by:** ai-interactive
- **Parent task:** t1364
- **Conversation context:** Decomposition of issue #2558 item 4 (bundle-based project presets). This subtask defines the schema and creates default bundles.

## What

The JSON schema for bundle definitions and 6 default bundle files for common project types.

Produces:
1. `.agents/bundles/schema.json` — JSON Schema for bundle validation
2. `.agents/bundles/web-app.json` — React/Next.js/Vue full-stack
3. `.agents/bundles/cli-tool.json` — CLI tools and shell scripts
4. `.agents/bundles/infrastructure.json` — IaC, Docker, CI/CD
5. `.agents/bundles/content-site.json` — WordPress, static sites
6. `.agents/bundles/library.json` — npm/pip packages
7. `.agents/bundles/agent.json` — aidevops agent/MCP development
8. Documentation of repos.json extension with `bundle` field

## Why

Without standardized bundles, every project gets identical treatment — ShellCheck runs on content sites (waste), haiku is used for complex web-app architecture (under-provisioned). Bundles right-size the tooling per project type.

## How (Approach)

- Design schema covering: model_defaults (per task type), quality_gates (list of gates to run), skip_gates (gates to skip), agent_routing (domain-to-agent mapping), dispatch (concurrency, timeout)
- Create each bundle by analyzing what tools/gates are relevant for that project type
- Use JSON Schema for validation (compatible with existing .aidevops.json pattern)
- Document repos.json extension — add optional `bundle` field alongside existing `slug`, `pulse`, `priority`
- Bundles are composable — a project can declare multiple bundles, and the resolution merges them

## Acceptance Criteria

- [ ] Bundle schema exists at `.agents/bundles/schema.json`
  ```yaml
  verify:
    method: bash
    run: "test -f .agents/bundles/schema.json"
  ```
- [ ] At least 6 default bundle files exist
  ```yaml
  verify:
    method: bash
    run: "test $(ls .agents/bundles/*.json 2>/dev/null | grep -v schema | wc -l) -ge 6"
  ```
- [ ] Each bundle includes model_defaults, quality_gates, and agent_routing fields
  ```yaml
  verify:
    method: bash
    run: "for f in .agents/bundles/*.json; do [ \"$f\" = '.agents/bundles/schema.json' ] && continue; jq -e '.model_defaults and .quality_gates and .agent_routing' \"$f\" > /dev/null || exit 1; done"
  ```
- [ ] repos.json extension documented

## Context & Decisions

- Bundles are JSON (not YAML or TOML) to match existing aidevops config patterns (.aidevops.json, repos.json)
- Composition uses union for quality_gates and most-restrictive for model_defaults
- The `agent` bundle is meta — it configures aidevops to develop itself (shellcheck, markdown-lint, agent-review)
- Bundle names are lowercase kebab-case to match file naming conventions

## Relevant Files

- `~/.config/aidevops/repos.json` — repo configuration to extend
- `.agents/scripts/linters-local.sh` — quality gates that bundles configure
- `.agents/tools/context/model-routing.md` — model tiers that bundles reference

## Dependencies

- **Blocked by:** none
- **Blocks:** t1364.5, t1364.6

## Estimate Breakdown

| Phase | Time | Notes |
|-------|------|-------|
| Research/read | 1h | Review quality gates, model routing |
| Schema design | 1h | JSON Schema + composition rules |
| Default bundles | 1h | 6 bundle files |
| **Total** | **~3h** | |
