> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kiwifs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Init templates

> Starter templates for new knowledge bases — kb, wiki, memory, tasks, data, cms, runbook, adr, prompt, research, log, and blank.

`kiwifs init` scaffolds a knowledge directory from a built-in template. Each template provides a directory layout, sample files, a `.kiwi/config.toml`, a `SCHEMA.md`, a `playbook.md`, and optional workflows or JSON Schemas.

```bash theme={null}
kiwifs init --template <name> --root <dir>
```

## Available templates

| Template   | Best for                      | Key features                                                          |
| ---------- | ----------------------------- | --------------------------------------------------------------------- |
| `kb`       | Governed knowledge bases      | Article schema, verification workflow, FAQ/guides/reference structure |
| `wiki`     | Team wikis                    | Onboarding, ADRs, processes, page templates                           |
| `memory`   | Agent episodic memory         | Episodes directory, consolidation log, memory report                  |
| `tasks`    | Task tracking                 | JSON Schema validation, Kanban workflow, claims                       |
| `data`     | Structured data collections   | DQL dashboards, charts, import connectors                             |
| `cms`      | Headless CMS                  | Blog, docs, pages, editorial workflow, feeds                          |
| `runbook`  | Ops and incident response     | Severity frontmatter, execution staleness, checklists                 |
| `adr`      | Architecture decision records | MADR format, supersession chains, status workflow                     |
| `prompt`   | Prompt management             | System/task prompts, rubrics, eval metrics                            |
| `research` | Research and literature       | Papers, reading workflow, notes, BibTeX citations                     |
| `log`      | Append-only event log         | Daily partitioning, sequence numbers, immutable writes                |
| `blank`    | Empty starting point          | `.kiwi/config.toml` only                                              |

<Tip>
  In the web UI and cloud dashboard, templates are also available when creating a new workspace or space.
</Tip>

Every template (except `blank`) includes two agent-facing documents:

* **`SCHEMA.md`** — directory layout, frontmatter fields, and naming conventions. Agents read this via `kiwi_context` or `kiwi://schema`.
* **`playbook.md`** — step-by-step MCP tool sequences for standard operations, with a cost table to minimize unnecessary calls.

Export harness-specific rules for your agent tool:

```bash theme={null}
kiwifs rules export --format cursor
kiwifs rules export --format claude
kiwifs rules export --format agents
```

***

## kb

The `kb` (knowledge base) template is designed for governed, high-quality knowledge bases with article verification workflows.

### Directory structure

```
kb/
├── SCHEMA.md
├── index.md
├── faq/
├── getting-started/
├── guides/
├── reference/
├── troubleshooting/
├── playbook.md
└── .kiwi/
    ├── config.toml
    ├── schemas/
    │   └── article.json
    └── workflows/
        └── kb.json          # draft → review → verified → stale → archived
```

<Accordion title="Verification workflow">
  Articles follow a `draft → review → verified → stale → archived` lifecycle. The janitor flags verified articles past their `review_date` as stale. Enable schema enforcement to require `title`, `type`, and `status` on every article.
</Accordion>

## wiki

A structured team wiki with decision records, onboarding guides, and process documentation.

### Directory structure

```
wiki/
├── SCHEMA.md
├── index.md
├── welcome.md
├── architecture.md
├── how-we-work.md
├── decisions/
│   ├── index.md
│   └── adr-001-example.md
├── onboarding/
│   └── index.md
├── processes/
│   ├── index.md
│   ├── deployment.md
│   ├── dev-setup.md
│   └── incident-response.md
├── reference/
│   ├── index.md
│   ├── faq.md
│   └── glossary.md
└── .kiwi/
    ├── config.toml
    ├── playbook.md
    ├── rules.md
    └── templates/
        ├── decision.md
        ├── meeting-notes.md
        ├── onboarding.md
        ├── product-spec.md
        └── sop.md
```

<Accordion title="Page templates">
  The wiki template includes slash-command templates in `.kiwi/templates/` for common page types: architectural decision records, meeting notes, onboarding checklists, product specs, and standard operating procedures. These appear in the web UI's "new page" menu.
</Accordion>

## memory

The `memory` template implements the episodic/semantic memory pattern. Agents write short-lived observations to `episodes/` and periodically consolidate them into durable pages.

### Directory structure

```
memory/
├── SCHEMA.md
├── index.md
├── log.md                     # Append-only change log
├── pages/                     # Durable semantic pages
├── episodes/                  # Short-lived episodic notes
├── playbook.md
└── .kiwi/
    └── config.toml
```

<Accordion title="Memory lifecycle">
  Episodes use `memory_kind: episodic` frontmatter with optional `expires`, `scope`, and `validity` fields. Use `kiwi_memory_report` to find episodes ready for consolidation, then merge them into durable pages with `merged-from` provenance tracking. See [Episodic memory](/concepts/episodic-memory).
</Accordion>

## tasks

Task tracking template with a pre-configured workflow, JSON Schema validation, and Kanban-ready frontmatter.

### Directory structure

```
tasks/
├── SCHEMA.md
├── WORKFLOW.md
├── index.md
├── tasks/
│   ├── example-task.md
│   └── blocked-example.md
├── playbook.md
└── .kiwi/
    ├── config.toml
    └── schemas/
        └── task.json
```

<AccordionGroup>
  <Accordion title="Task frontmatter">
    Each task file uses structured frontmatter validated by `.kiwi/schemas/task.json`:

    ```yaml theme={null}
    ---
    title: "Implement auth flow"
    status: "in_progress"
    assignee: "agent:eng-bot"
    priority: "high"
    workflow: "default"
    state: "in_progress"
    ---
    ```

    The `status` field drives Kanban board grouping. The `workflow` and `state` fields enable state-machine transitions via [Workflows](/concepts/workflows).
  </Accordion>

  <Accordion title="JSON Schema validation">
    The `task.json` schema in `.kiwi/schemas/` validates that required fields (`title`, `status`) are present and that `status` is one of the allowed values. Enable enforcement with:

    ```toml .kiwi/config.toml theme={null}
    [schema]
    enforce = true
    ```

    See [Schemas](/concepts/schemas).
  </Accordion>

  <Accordion title="Kanban visualization">
    With the workflow configured, the web UI renders tasks as a Kanban board grouped by state. Use the API to advance tasks programmatically:

    ```bash theme={null}
    curl -X POST 'http://localhost:3333/api/kiwi/workflow/advance' \
      -H 'Content-Type: application/json' \
      -d '{"path":"tasks/example-task.md","target_state":"done","actor":"agent:bot"}'
    ```
  </Accordion>
</AccordionGroup>

## data

Structured data collections with DQL dashboards and import connectors.

### Directory structure

```
data/
├── SCHEMA.md
├── index.md
├── collections/               # One directory per data collection
├── dashboards/                # DQL-powered summary views
├── imports/                   # Import connection configs
├── playbook.md
└── .kiwi/
    ├── config.toml
    └── schemas/
        └── record.json
```

<Accordion title="DQL dashboards">
  Dashboard pages use `kiwi-view: true` and `kiwi-query` frontmatter to auto-generate tables and charts from collection data. Pair with `kiwi-chart` fenced blocks for visual summaries. See [DQL](/concepts/dql).
</Accordion>

## cms

Git-native headless CMS with an editorial workflow, Atom/JSON feeds, and a published reader at `/p/*`.

### Directory structure

```
cms/
├── SCHEMA.md
├── index.md
├── blog/                      # Blog posts with slug, author, published_at
├── docs/                      # Documentation pages
├── pages/                     # Static pages
├── authors/                   # Author profiles
├── playbook.md
└── .kiwi/
    ├── config.toml
    ├── schemas/
    │   └── blog-post.json
    └── workflows/
        └── editorial.json     # Editorial publishing states
```

<Accordion title="Publishing and feeds">
  Publish pages to the reader at `/p/{path}` and subscribe via `GET /api/kiwi/feed.xml` (Atom) or `GET /api/kiwi/feed.json` (JSON Feed). The editorial workflow manages content through review stages before publication. See [Publishing](/concepts/publishing).
</Accordion>

## runbook

Operations-focused template with incident response procedures and execution staleness tracking.

### Directory structure

```
runbook/
├── SCHEMA.md
├── index.md
├── example-high-cpu.md        # Sample runbook with severity + services
├── playbook.md
└── .kiwi/
    ├── config.toml
    └── schemas/
        └── runbook.json
```

<Accordion title="Execution staleness">
  Each runbook uses `severity` (P1-P4), `services`, `trigger`, and `last_executed` frontmatter. The janitor flags runbooks that have not been executed within a configurable staleness window. Schema validation ensures required fields are present.
</Accordion>

## adr

Architecture Decision Records using the MADR format with supersession chains and contradiction detection.

### Directory structure

```
adr/
├── SCHEMA.md
├── index.md
├── decisions/
│   └── ADR-001-example.md
├── playbook.md
└── .kiwi/
    ├── config.toml
    ├── schemas/
    │   └── adr.json
    └── workflows/
        └── adr.json           # proposed → accepted → deprecated → superseded
```

<Accordion title="Supersession and contradiction">
  ADRs track `supersedes` and `contradicts` typed links in frontmatter. The graph view highlights contradiction edges. The workflow enforces valid status transitions. Use `adr_number` for sequential numbering with auto-increment via `[sequences]` config.
</Accordion>

## prompt

Versioned prompt management with rubrics and evaluation metrics.

### Directory structure

```
prompt/
├── SCHEMA.md
├── index.md
├── system-prompts/            # System-level prompts
├── task-prompts/              # Task-specific prompts
├── evaluation/                # Rubrics and eval results
├── playbook.md
└── .kiwi/
    ├── config.toml
    └── schemas/
        ├── prompt.json
        └── rubric.json
```

<Accordion title="Prompt versioning">
  Each prompt file includes `version`, `model`, and `temperature` frontmatter. Rubric files define scoring criteria. Use `kiwi_eval` to benchmark search quality against rubrics. Git versioning provides a full history of prompt iterations.
</Accordion>

## research

Research template with structured note-taking, reading workflows, and citation tracking.

### Directory structure

```
research/
├── SCHEMA.md
├── index.md
├── papers/                    # Literature entries with BibTeX metadata
├── notes/                     # Synthesis notes
├── reviews/                   # Paper reviews
├── playbook.md
└── .kiwi/
    ├── config.toml
    ├── schemas/
    │   └── paper.json
    └── workflows/
        └── reading.json       # Reading pipeline states
```

<Accordion title="Reading workflow">
  Paper files track `authors`, `year`, `doi`, `bibtex`, and reading status via the `reading` workflow. Use `kiwi_cite` to generate citations. The graph view visualizes citation networks between papers.
</Accordion>

## log

Append-only event log with daily partitioning and sequence number validation.

### Directory structure

```
log/
├── SCHEMA.md
├── index.md
├── events/                    # Daily event files
├── playbook.md
└── .kiwi/
    ├── config.toml
    └── schemas/
        └── event.json         # type: daily-log, append_only, entry_count, date
```

<Accordion title="Append-only guarantees">
  The log template configures `validate_write` guards to enforce append-only semantics. Sequence numbers (`<!-- seq:N -->` markers) are validated by the `kiwifs check` CLI to detect gaps or reordering. Daily files partition events by date with `FLATTEN` support in DQL queries.
</Accordion>

## blank

Minimal template — creates only `.kiwi/config.toml`. Use this when you want to start from scratch or bring your own directory structure.

## Listing templates via API

```bash theme={null}
# Self-hosted
curl http://localhost:3333/api/init-templates

# Cloud
curl https://api.kiwifs.com/api/workspaces/init-templates \
  -H "Authorization: Bearer $KIWI_API_KEY"
```

Returns an array of template objects with `id`, `name`, and `description`.

## Related

<CardGroup cols={2}>
  <Card title="Agent playbook" icon="book-open" href="/concepts/agent-playbook">
    How agents onboard using SCHEMA.md and playbook.md.
  </Card>

  <Card title="Workflows" icon="bars-progress" href="/concepts/workflows">
    State machines that drive Kanban boards and editorial pipelines.
  </Card>

  <Card title="Schemas" icon="shield-check" href="/concepts/schemas">
    JSON Schema validation on writes.
  </Card>

  <Card title="Configuration" icon="gear" href="/configuration">
    Full .kiwi/config.toml reference.
  </Card>

  <Card title="Episodic memory" icon="brain" href="/concepts/episodic-memory">
    The episode/consolidation pattern used by the memory template.
  </Card>

  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Install and run KiwiFS in 60 seconds.
  </Card>
</CardGroup>
