# SDK Development Plan

## Goal

Create a lightweight SDK that lets developers build V3 apps as CLI-addressable
MCP capabilities.

## Phase 1: Contract And Examples

- Publish `SDK_CONTRACT.md`.
- Provide example manifests for:
  - `miniapp-builder`
  - `project`
  - `workflow`
  - `keybox`
  - `fs-walk`
  - `fs-actions`
- Provide sample event payloads.
- Provide sample final report formats.

## Phase 2: SDK Helpers

Build helpers for:

- Manifest validation.
- Tool schema validation.
- Event writing.
- Approval metadata.
- SQLite schema/migration setup.
- Report generation.
- Bootstrap/doctor checks.

## Phase 3: CLI Integration

SDK apps must work through:

```powershell
99p apps list
99p apps manifest
99p apps tools <app>
99p apps call <app> <tool> [json]
```

High-frequency apps may get first-level shortcuts such as:

```powershell
99p miniapp tools
99p project tools
99p workflow tools
```

## Phase 4: Portal Projection

app.99pages.uk should read:

- app manifest
- run events
- approvals
- reports
- optional `open_url`

The portal should not need app-specific logic unless a customer-funded UI is
required.

## Phase 5: Certification

An SDK app is V3-ready when:

- `99p doctor` passes.
- `99p apps tools <app>` works.
- Safe calls run without approval.
- Risky calls create approval events.
- A final report is emitted.
- Data contract and migration path are documented.
