Creating documentation

Learn how to add documentation to Tessl packages to provide usage information and examples to AI agents.

Documentation in tiles helps AI agents understand how to use your libraries, APIs, and internal systems. This guide shows you how to manually create and add documentation to tiles using the Tessl CLI.

circle-info

Choosing between manual and automated creation

Manual creation gives you full control over content and works for any system or API. If you have source code access (JavaScript, TypeScript, or Python) and want evaluation data, see Autogenerating documentation for the automated approach.

Prerequisites

Before you begin, make sure you have:

Creating a tile with documentation

Step 1: Create a new tile

Use the tessl tile new command to create a new tile structure:

tessl tile new --name myworkspace/util-formatter --path ./my-tile

This creates a tile directory with a tile.json manifest file.

Step 2: Add your documentation

Create a markdown file with your documentation:

Step 3: Update the tile manifest

Edit tile.json to reference your documentation:

Key fields:

  • name: Your workspace and tile name in workspace/tile-name format

  • version: Semantic version (semverarrow-up-right)

  • docs: Path to your documentation file (relative to tile.json)

  • describes: (Optional) Package URL (PURLarrow-up-right) if documenting a specific package

  • private: Set to true for workspace-only access

Step 4: Add a Registry README (optional)

Create README.md in your tile directory to customize how it appears in the Tessl Registry:

Note: The README is shown in the Registry interface but not passed to agents.

Step 5: Validate your tile

Before publishing, validate your tile structure:

This checks:

  • tile.json format and structure

  • Required fields

  • Documentation file paths exist

  • Markdown validity

Step 6: Publish your tile

Publish your tile to the Tessl Registry:

By default, tiles are published as private and only accessible to workspace members.

Documentation structure

You can organize documentation in multiple files:

The docs field in tile.json points to the main entry point (usually index.md).

Writing effective documentation

What to include

  • Package information - Name, language, installation instructions

  • Core imports - Key modules and classes to import

  • Usage examples - Common use cases with code examples

  • API reference - Key functions, methods, parameters

  • Best practices - Patterns and conventions specific to your code

What to avoid

  • Implementation details - Focus on usage, not internals

  • Outdated examples - Keep examples current with your code

  • Overly verbose explanations - Be concise and actionable

Example documentation template

Updating documentation

To update documentation in a published tile:

  1. Edit your documentation files

  2. Update the version number in tile.json (following semantic versioningarrow-up-right)

  3. Validate with tessl tile lint

  4. Publish the new version with tessl tile publish

Users can update to the new version by running:

Sharing your tile

To allow team members to access your tile, add them to your workspace:

The member role gives read-only access to tiles. See Roles for more information.

How documentation is used by agents

When a tile is installed in a project, the documentation becomes available to AI agents through Tessl's MCP (Model Context Protocol) integration. Agents can:

  • Query documentation on-demand when needed

  • Search across all installed tile documentation

  • Reference specific sections when generating code

  • Follow patterns and examples from your docs

Documentation is loaded on-demand rather than always present in context, making it efficient for agents to work with many tiles.

Best practices

  • Use the docs field - Documentation must be referenced in the docs field of tile.json

  • Write clear descriptions - The summary in your tile.json helps agents discover your tile

  • Include code examples - Show real usage patterns with working code

  • Keep it current - Update documentation when your code changes

  • Version semantically - Use semantic versioning when publishing updates

  • Test before publishing - Use tessl tile lint to validate structure

circle-info

Combining approaches

For packages with source code, you can start with automated generation to get baseline documentation, then manually refine it for precision. Add manual tiles for internal services and APIs without source code access. This gives you the speed of automation with control where it matters.

Last updated