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

# Session 11: Templates And Planning Context

**Session ID**: `phase19-session11-templates-and-planning-context` **Packages**: apps/server, apps/web **Status**: Complete **Estimated Tasks**: 22 **Estimated Duration**: 2-4 hours **Completed**: 2026-06-26

***

## Objective

Make templates, Quest Board signals, analysis, and transcript memory usable sources for orchestration work.

***

## Scope

### In Scope (MVP)

* Template details for description, model choice, category, workflow instruction, constraint, default priority, approval requirement, max queue label, context label, prompt preview, read-only badge, and tool-scope badge
* Template suggestions from selected mission, queue, issue, analysis, and scan context
* Queue item creation from templates with preview and idempotency key
* Source links from queue items to suggestions, scan issues, analysis results, project scan items, session follow-ups, auto-improvement candidates, and transcript-mined memory
* Memory category include/exclude controls before plan generation

### Out of Scope

* Custom template storage if no current settings schema owns it
* Raw transcript display inside Orchestration rows

***

## Prerequisites

* [x] Sessions 03 and 04 complete
* [x] Current template, Quest Board, analysis, and memory stores inspected

***

## Deliverables

1. Template workbench with searchable queueable templates
2. Source attribution and memory context badges in queue/campaign details
3. Queue-from-template flow with preview and duplicate protection
4. Tests for template rendering, source links, and memory filters

***

## Source Coverage And Evidence

Source coverage:

* Session Split Plan Session 11: Templates And Planning Context
* Implementation Targets 8, 10, and 11 for spawnable roles, Quest Board and analysis links, auto-improvement, and transcript-mined memory
* Balls-To-The-Wall Track C `TemplateWorkbench` and store slices

Key EXAMPLES links:

* [Agent templates](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/1st-pass-artifacts/agent-templates.json#L1-L127)
* [Templates artifact index](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/1st-pass-artifacts/README_1st-pass-artifacts.md#L45-L53)
* [Idle suggestion engine](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/findings/llm-prompts/idle-suggestion-engine.md#L1-L88)
* [On-demand analysis prompt](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/findings/llm-prompts/on-demand-analysis.md#L1-L90)
* [Auto-improver prompt](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/findings/llm-prompts/auto-improver.md#L1-L99)
* [Transcript miner](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/findings/llm-prompts/transcript-miner.md#L1-L87)

***

## Success Criteria

* [x] A template can create a queue item with a preview and idempotency key
* [x] Queue items show why they exist and which signal or memory informed them
* [x] Failed work can produce auto-improvement proposals in the attention queue
* [x] Memory context is freshness-, confidence-, category-, and source-labeled


---

# 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://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/phases/phase_19/session_11_templates_and_planning_context.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.
