> For the complete documentation index, see [llms.txt](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/phases/phase_30/session_02_extension_shell_and_routes.md).

# Session 02: Extension Shell And Routes

**Session ID**: `phase30-session02-extension-shell-and-routes` **Status**: Not Started **Estimated Tasks**: \~12-25 **Estimated Duration**: 2-4 hours

***

## Objective

Add the disabled-first `ai-rogue` extension shell with the expected React/TanStack host surfaces and honest capability declarations.

***

## Scope

### In Scope (MVP)

* Add compile-time extension registration, the primary `/extensions/ai-rogue/play` route, and secondary Play, Ledger, Loadout, and Settings surfaces.
* Gate the extension through `VITE_CLAUDE_OS_ENABLED_EXTENSIONS` and match existing extension empty, disabled, and missing-data states.
* Declare only initial `readGeneratedData` and `localStorage` capabilities with accurate reasons.
* Keep PixiJS, renderer code, and browser-only APIs out of the registry and app shell chunks.
* Add route and registry coverage for registration, disabled behavior, default-view redirect, and capability declarations.

### Out of Scope

* PixiJS runtime mounting and game loop (Session 03).
* Economy transform, persistence, and simulation logic.

***

## Prerequisites

* [ ] Session 01 baseline decisions locked.

***

## Deliverables

1. `src/extensions/ai-rogue/` shell with client entry, capabilities, view modules, and route integration.
2. Tests proving the extension registers and routes to Play without loading game runtime code.
3. Initial accessible surrounding UI structure for Play, Ledger, Loadout, and Settings.

***

## Locked Visual Assets (`visual-assets.md`)

The "E2E Space Baseline" section of `docs/extensions/ai-rogue/visual-assets.md` constrains the Play route layout:

* The Play view should **skip a promotional hero** and reserve the first screen for the game.
* Measured shell costs to design around: top app bar 56px, desktop left nav \~256px, desktop main padding 24px/side, mobile padding 16px/side, extension view nav \~99px vertical.
* These yield \~30x16 usable 32px tiles at 1280x720 down to portrait/mobile slots -- size the Play surface so the canvas and view nav coexist without overlap (full table in the doc).

## Success Criteria

* [ ] Extension routes work when enabled and fail gracefully when disabled or when live data is absent.
* [ ] Static registry imports remain lightweight and do not import PixiJS or game runtime modules.
* [ ] Capability declarations match only the APIs actually used by the shell.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/phases/phase_30/session_02_extension_shell_and_routes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
