# Wiki Structure Generation

Use this template to plan the wiki structure before generating individual pages.

## Instructions

1. Gather the project profile from Phase 1 (file tree, README, tech stack)
2. Fill in the template variables below
3. Generate the wiki outline as a Markdown numbered list
4. Write the result to `.deepwiki/_outline.md`

## Template

Analyze this project and create a wiki structure for it.

**Project file tree:**

```
{file_tree}
```

**README content:**

{readme}

**Detected tech stack:** {tech_stack}
**Project type:** {project_type}

---

Create a wiki for this project. Determine the most logical structure based on the project's content.

When designing the wiki structure, include pages that would benefit from visual diagrams:
- Architecture overviews
- Data flow descriptions
- Component relationships
- Process workflows
- State machines
- Class hierarchies

### Comprehensive Mode (8-12 pages)

Use this when the user requests full documentation or the project is non-trivial. Organize pages into these sections (skip sections that don't apply to the project):

- **Overview** — general information, purpose, tech stack, getting started
- **System Architecture** — how the system is designed, high-level structure
- **Core Features** — key functionality, main workflows
- **Data Management/Flow** — how data is stored, processed, accessed (database schema, pipelines, state management)
- **Frontend Components** — UI elements, pages, component hierarchy (if applicable)
- **Backend Systems** — server-side components, API layer, services
- **Model/AI Integration** — AI model connections, ML pipelines (if applicable)
- **Deployment/Infrastructure** — how to deploy, CI/CD, Docker, infrastructure
- **Extensibility and Customization** — plugins, theming, custom modules, hooks (if applicable)

### Concise Mode (4-6 pages)

Use this when the user requests a brief overview or the project is small:

- **Overview** — purpose, tech stack, structure
- **Architecture** — high-level design and key components
- **Core Features** — main functionality
- **Configuration and Deployment** — setup and deployment

---

## Output Format

Generate the outline as a numbered Markdown list. Each entry must include:

```markdown
## {Wiki Title}

{One-sentence project description}

### Pages

1. **{Page Title}**
   - Description: {1-2 sentence summary of what this page covers}
   - Key files: `path/to/file1.ts`, `path/to/file2.ts`, `path/to/file3.ts` (3-8 files)
   - Diagrams: {What could be visualized — e.g., "Architecture overview flowchart", "Request lifecycle sequence diagram"}

2. **{Page Title}**
   - Description: ...
   - Key files: ...
   - Diagrams: ...

...
```

## Quality Rules

- Every page must list real files from the project file tree (not guessed paths)
- Each page should focus on a specific, distinct aspect of the codebase
- Avoid overlap between pages — if two pages seem to cover similar ground, merge them
- At least one page should be an architecture/overview page with a high-level diagram
- For comprehensive mode: ensure coverage of both frontend and backend if the project has both
- For concise mode: prioritize the most important aspects, combine related topics
