Skip to content

Commit 0ceb1d5

Browse files
committed
Update readmes
1 parent f4ff3aa commit 0ceb1d5

File tree

2 files changed

+67
-22
lines changed

2 files changed

+67
-22
lines changed

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Coming soon.
112112

113113
Coming soon.
114114

115-
## Getting Started
115+
## Getting started
116116

117117
Each example includes its own README with setup instructions. Generally:
118118

@@ -123,3 +123,48 @@ Each example includes its own README with setup instructions. Generally:
123123

124124
See individual example READMEs for detailed instructions.
125125

126+
## MCP manifest architecture
127+
128+
This repository serves as the **single source of truth** for PostHog integration resources accessed via the [PostHog MCP server](https://github.com/PostHog/posthog/tree/main/products/mcp).
129+
130+
### How it works
131+
132+
1. **Build process** (`npm run build:docs`):
133+
- Converts example projects to markdown
134+
- Discovers workflow guides from `llm-prompts/`
135+
- Discovers MCP prompts from `mcp-commands/`
136+
- Generates `manifest.json` with all URIs and metadata
137+
- Packages everything into `examples-mcp-resources.zip`
138+
139+
2. **MCP server** (runtime):
140+
- Fetches the ZIP from GitHub releases
141+
- Loads `manifest.json`
142+
- **Purely reflects** the manifest - no hardcoded URIs or logic
143+
144+
### Manifest structure
145+
146+
The manifest defines:
147+
- **Workflows**: Step-by-step guides with automatic next-step linking
148+
- **Docs**: PostHog documentation URLs
149+
- **Prompts**: MCP command prompts with template variable substitution
150+
- **Templates**: Resource templates for parameterized access (e.g., `posthog://examples/{framework}`)
151+
152+
### Adding new resources
153+
154+
**Workflows**: Add markdown files to `llm-prompts/[category]/` following the naming convention `[order].[step]-[name].md`
155+
156+
**Examples**: Add new example projects to `basics/` and configure in `scripts/build-examples-mcp-resources.js`
157+
158+
**Prompts**: Add JSON files to `mcp-commands/`
159+
160+
The build script automatically discovers, orders, and generates URIs for all resources.
161+
162+
### Why this architecture?
163+
164+
- **Single source of truth**: All URIs defined in examples repo
165+
- **Zero hardcoding**: MCP server has no URIs or business logic
166+
- **Easy to extend**: Add resources by creating properly named files
167+
- **Version controlled**: Resources evolve with the examples
168+
169+
See `llm-prompts/README.md` for detailed workflow conventions.
170+

llm-prompts/README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
# LLM Prompts
1+
# LLM prompts
22

3-
This directory contains LLM workflow prompts that guide AI agents through various PostHog integration tasks.
3+
This directory contains LLM workflow prompts that guide AI agents through PostHog integration tasks.
44

55
Feel free to try these out directly, or summon them from the PostHog MCP server. You can also use them as a starting point for your own deep integrations. We've tested these extensively.
66

77
## Structure
88

99
- **basic-integration/**: Step-by-step workflow guides for adding PostHog event tracking to a project
10-
- `1.0-event-setup-begin.md`: Initial project analysis and event planning
11-
- `1.1-event-setup-edit.md`: Implementation guidance for adding PostHog tracking
12-
- `1.2-event-setup-revise.md`: Error checking and correction
10+
- `1.0-begin.md`: Initial project analysis and event planning
11+
- `1.1-edit.md`: Implementation guidance for adding PostHog tracking
12+
- `1.2-revise.md`: Error checking and correction
1313

14-
## Manifest-Driven Architecture
14+
## Manifest-driven architecture
1515

1616
These prompts and their URIs are defined in `manifest.json`, which is generated during the build process. The manifest is the **source of truth** for all resource URIs and metadata.
1717

18-
### How It Works
18+
### How it works
1919

2020
1. **Build time**: `scripts/build-examples-mcp-resources.js` generates:
2121
- `manifest.json` with all resource definitions and URIs
@@ -26,29 +26,29 @@ These prompts and their URIs are defined in `manifest.json`, which is generated
2626
- Loads `manifest.json`
2727
- **Purely reflects** the manifest - no URI generation, just registration
2828

29-
### Manifest Structure
29+
### Manifest structure
3030

3131
The manifest includes:
3232
- **Workflows**: Ordered sequence with `nextStepUri` for automatic linking
33-
- **Examples**: Pre-expanded list of framework-specific examples
34-
- **URIs**: Fully generated at build time (e.g., `posthog://workflows/basic-integration-begin`)
33+
- **Templates**: Resource templates for parameterized access (e.g., `posthog://examples/{framework}`)
34+
- **URIs**: Fully generated at build time (e.g., `posthog://workflows/basic-integration/begin`)
3535

36-
### File Conventions
36+
### File conventions
3737

3838
**Naming:** `[order].[step]-[name].md`
3939

4040
Examples:
41-
- `1.0-event-setup-begin.md` → Order 1.0, step 0, ID: `basic-integration-event-setup-begin`
42-
- `1.1-event-setup-edit.md` → Order 1.1, step 1, ID: `basic-integration-event-setup-edit`
41+
- `1.0-begin.md` → Order 1.0, step 0, ID: `basic-integration-begin`
42+
- `1.1-edit.md` → Order 1.1, step 1, ID: `basic-integration-edit`
4343
- `2.0-analytics-setup.md` → Order 2.0, step 0, ID: `category-analytics-setup`
4444

45-
**Required Frontmatter:**
45+
**Required frontmatter:**
4646

4747
Every workflow file MUST include YAML frontmatter with `title` and `description`:
4848

4949
```markdown
5050
---
51-
title: Event Setup - Begin
51+
title: PostHog setup - Begin
5252
description: Start the event tracking setup process by analyzing the project
5353
---
5454

@@ -59,21 +59,21 @@ The build will fail if frontmatter is missing or incomplete.
5959

6060
**Automatic features:**
6161
- **Next step**: Automatically linked to the next file in numerical order
62-
- **URI generation**: `posthog://workflows/[category]-[name]`
62+
- **URI generation**: `posthog://workflows/[category]/[name]`
6363

64-
### Adding New Workflows
64+
### Adding new workflows
6565

6666
1. Create a new category directory: `llm-prompts/[category]/`
6767
2. Add markdown files following the naming convention
6868
3. Files are automatically:
6969
- Discovered and ordered
7070
- Linked to next steps
71-
- Given URIs (e.g., `posthog://workflows/[category]-[name]`)
71+
- Given URIs (e.g., `posthog://workflows/[category]/[name]`)
7272
- Added to the manifest
7373

7474
**No configuration needed!** Just add properly named files.
7575

76-
## Build Process
76+
## Build process
7777

7878
These prompts are packaged into the release artifact `examples-mcp-resources.zip`.
7979

@@ -85,9 +85,9 @@ npm run build:docs
8585

8686
The MCP server fetches these prompts from the latest GitHub release and serves them as resources to AI agents and the PostHog wizard during integration tasks.
8787

88-
## Architecture Benefits
88+
## Architecture benefits
8989

9090
- **Single source of truth**: Examples repo controls all URIs
9191
- **No hardcoded URIs in MCP**: MCP purely reflects manifest
92-
- **Easy to extend**: Add resources by updating manifest config
92+
- **Easy to extend**: Add resources by creating properly named files
9393
- **Version controlled**: URIs and metadata evolve with the examples

0 commit comments

Comments
 (0)