Share format specification
The complete SHARE.md format specification with field constraints, validation rules, and section-writing guidance.
File structure
A share lives in a directory named after its slug inside the shares/ folder:
shares/
fix-nextjs-hydration-mismatch/
SHARE.md
prisma-connection-pooling/
SHARE.mdEach SHARE.md file has two parts: YAML frontmatter and a markdown body with four required sections.
Required frontmatter fields
The frontmatter contains structured metadata in YAML format, enclosed by --- delimiters.
title
| Constraint | Value |
|---|---|
| Type | string |
| Max length | 128 characters |
| Required | Yes |
Start with a verb that matches the solution_type:
| solution_type | Verb convention | Example |
|---|---|---|
fix | "Fix ..." | "Fix Prisma N+1 query problem with includes and joins" |
workaround | "Workaround for ..." | "Workaround for Next.js 14 middleware redirect loop" |
pattern | "Use ...", "Implement ..." | "Use TypeScript satisfies operator for type-safe config objects" |
reference | "Guide to ...", "Reference for ..." | "Guide to PostgreSQL JSONB query operators" |
config | "Configure ..." | "Configure ESLint flat config for TypeScript monorepos" |
Good titles:
title: "Fix Docker build cache invalidation for node_modules"
title: "Use TypeScript satisfies operator for type-safe config objects"Bad titles:
title: "Fix bug" # Too vague, no technology or symptom
title: "fix prisma" # No capitalization, no specificsslug
A kebab-case identifier that doubles as the directory name and URL path.
| Constraint | Value |
|---|---|
| Type | string |
| Max length | 64 characters |
| Pattern | /^[a-z0-9-]+$/ |
| Required | Yes |
Must match the parent directory name exactly. The CLI generates slugs from titles automatically:
- Convert to lowercase
- Strip characters that are not
a-z,0-9, spaces, or hyphens - Replace spaces with hyphens
- Collapse consecutive hyphens into one
- Trim leading and trailing hyphens
- Truncate to 64 characters
"Fix Prisma N+1 queries" → fix-prisma-n1-queries
"Fix Docker build cache (v2)" → fix-docker-build-cache-v2
"Fix Next.js hydration error" → fix-nextjs-hydration-errorGood slugs:
slug: fix-prisma-n-plus-one-queries
slug: fix-docker-node-modules-layer-cacheBad slugs:
slug: Fix-Prisma # Uppercase not allowed
slug: fix_prisma_queries # Underscores not allowed; use hyphenstags
| Constraint | Value |
|---|---|
| Type | string[] |
| Min items | 1 |
| Max items | 10 |
| Each max length | 32 characters |
| Case | Lowercase only |
| Required | Yes |
Cover three categories:
- Primary technology -- the main language, framework, or tool (
prisma,nextjs,docker) - Problem domain -- the area of concern (
performance,hydration,cache) - Descriptors -- 1-2 additional terms for discoverability (
ssr,database,type-safety)
Good tags:
tags: [prisma, database, performance, n-plus-one]
tags: [nextjs, react, hydration, ssr]Bad tags:
tags: [] # At least 1 tag required
tags: [Prisma] # Must be lowercaseproblem
| Constraint | Value |
|---|---|
| Type | string |
| Max length | 256 characters |
| Required | Yes |
One sentence describing the problem. Include the error message or symptom -- this field powers search.
Good problem fields:
problem: "Prisma makes hundreds of individual queries when loading related data in a loop"
problem: "Docker rebuilds node_modules from scratch on every code change, making builds slow"Bad problem fields:
problem: "Something is broken" # No specifics, no error message
problem: "It doesn't work" # Completely unhelpfulsolution_type
| Constraint | Value |
|---|---|
| Type | enum |
| Values | fix, workaround, pattern, reference, config |
| Required | Yes |
| Value | Description | When to use |
|---|---|---|
fix | A direct fix for a bug or error | The solution permanently resolves the root cause |
workaround | A temporary workaround for a known issue | The root cause is upstream or unfixable; this bypasses it |
pattern | A reusable coding pattern or architecture | The solution generalizes beyond a single error |
reference | A lookup guide or cheat sheet | The content is informational, not fixing a specific error |
config | A configuration change resolving a setup issue | The fix is entirely in config files, not application code |
Most shares are fix. When in doubt between fix and pattern, choose fix.
created
| Constraint | Value |
|---|---|
| Type | string |
| Format | YYYY-MM-DD |
| Required | Yes |
Use today's date. Quote the value in YAML:
created: "2026-02-08"Optional frontmatter fields
These fields add context but are not required for validation.
environment
Technical context for the solution. Recommended.
environment:
language: typescript
framework: nextjs
version: "14+"All three sub-fields (language, framework, version) are optional. Quote version if it starts with a number.
ai_provider
Which AI assistant helped create or verify the solution. Set only if an AI was meaningfully involved. Values: "claude", "gpt", "gemini".
related
An array of slugs linking to related shares:
related:
- fix-prisma-migration-drift
- fix-postgres-connection-pooling-serverlessverified
Whether the share has been verified. Set automatically from outcome reports -- do not set manually.
updated
ISO date (YYYY-MM-DD) for when the share was last updated.
Complete frontmatter example
---
title: "Fix Prisma N+1 query problem with includes and joins"
slug: fix-prisma-n-plus-one-queries
tags: [prisma, database, performance, n-plus-one]
problem: "Prisma makes hundreds of individual queries when loading related data in a loop"
solution_type: fix
created: "2026-02-08"
environment:
language: typescript
framework: prisma
ai_provider: "claude"
related:
- fix-postgres-connection-pooling-serverless
---Body sections
The markdown body must contain exactly four sections in this order. Total body must be under 300 lines. Aim for 60-150 lines.
Problem
Show the broken state so readers can confirm they have the same issue.
Must include:
- Broken code -- minimal reproduction
- Error message or symptom -- exact text
- Impact -- quantify when possible ("101 queries instead of 2")
Template:
## Problem
[1-2 sentences describing when this problem occurs.]
\`\`\`[language]
// Code that demonstrates the broken behavior
\`\`\`
[Error message, incorrect output, or quantified impact.]Avoid: Missing code or error message. Entire application instead of minimal reproduction. Explaining the solution here.
Solution
Provide working code that readers can copy and apply.
Must include:
- Complete, runnable code blocks with language labels
- Multiple options when applicable, labeled "Option 1", "Option 2"
- "(recommended)" on the best default
- Inline comments on non-obvious lines
Template for multiple options:
## Solution
**Option 1: [approach name] (recommended)**
\`\`\`[language]
// Working code with inline comments
\`\`\`
**Option 2: [alternative approach] ([when to prefer this])**
\`\`\`[language]
// Alternative working code
\`\`\`Template for single option:
## Solution
\`\`\`[language]
// Working code with inline comments
\`\`\`Avoid: Missing language labels. Incomplete snippets. No "(recommended)" when showing multiple options. Placeholder code.
Why It Works
Explain the root cause, not just the fix. Answer "why was it broken?" and "why does the fix resolve it?"
Must include:
- Root cause explanation
- Why the change resolves it
- 1-3 paragraphs of prose (primarily text, not code)
Template:
## Why It Works
[First paragraph: explain the default behavior that causes the problem.]
[Second paragraph: explain why the fix changes that behavior.]
[Optional third paragraph: tradeoffs or how different options compare.]Avoid: Restating the solution ("It works because we added include"). Linking to external docs instead of explaining. Too short ("This fixes the bug."). Code-heavy content.
Context
Help readers determine if the solution applies to their environment.
Must include:
- Version requirements (list first)
- Gotchas, limitations, or edge cases
- Related tools or alternatives
Template:
## Context
- [Framework/tool] [version]+ required for [feature used in solution]
- [Gotcha or limitation]
- [Related tool, alternative approach, or debugging tip]Avoid: No version info. Paragraph form instead of bullets. Repeating the solution explanation. More than 6 bullets.
Section length guidelines
| Section | Target lines | Maximum lines |
|---|---|---|
| Problem | 5-20 | 40 |
| Solution | 15-60 | 120 |
| Why It Works | 5-15 | 30 |
| Context | 3-8 | 15 |
| Total body | 60-150 | 300 |
Validation
npx shareful-ai check validates every shares/*/SHARE.md file:
| Field | Rule |
|---|---|
title | Required, max 128 characters |
slug | Required, max 64 characters, /^[a-z0-9-]+$/, must match directory name |
tags | 1-10 tags, each lowercase, max 32 characters |
problem | Required, max 256 characters |
solution_type | One of: fix, workaround, pattern, reference, config |
created | Required, YYYY-MM-DD |
| Body | Max 300 lines, all four sections present in order |
Next steps
- Creating shares -- writing tips and quality standards
- Examples -- annotated good and bad shares
- CLI reference