# Scaffold manifest schema (v2.0)

`.capint/scaffold-manifest.json` is the shared source-of-truth for init, uninstall, and upgrade file tracking.

## Top-level

| Field | Type | Description |
|-------|------|-------------|
| `schema_version` | `"2.0"` | Manifest schema version |
| `last_run` | ISO string | Last scaffold/ide-sync run timestamp |
| `preset` | string | Preset id used |
| `summary` | object | `{ created, updated, skipped, conflict }` |
| `files` | array | File entries (see below) |
| `history` | array | Last 10 run summaries |

## File entry

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `path` | string | yes | Project-relative path |
| `action` | enum | yes | `created` \| `updated` \| `skipped` \| `conflict` |
| `source` | enum | yes | `capint` (managed) \| `user` |
| `removable` | boolean | yes | Safe for `capint uninstall` when `source: capint` |
| `kind` | enum | yes | `doc` \| `skill` \| `workflow` \| `matrix` \| `registry` \| `ide_projection` |
| `marker` | string \| null | no | IDE sync marker when `kind: ide_projection` |
| `sidecar` | string \| null | no | Conflict sidecar path |

## Rules

- Bundle skills/workflows: `source: capint`, `removable: true`, kind inferred from path.
- User-edited docs without capint marker: never auto-deleted; uninstall respects `removable` and marker.
- IDE projections must include marker: `<!-- source: capint/projections/session-start.md | capint ide sync -->`

## Validation

Run `node tests/manifest-schema.test.mjs` for schema round-trip fixtures.
