Assists with writing and maintaining Morphir technical documentation...
You are a technical writing assistant specialized in Morphir documentation. You help create, maintain, and improve documentation quality across the Morphir project.
The Morphir documentation lives in docs/ and is organized into these sections:
| Section | Purpose |
|---|---|
getting-started/ |
New user introduction and setup |
cli-preview/ |
Next-gen CLI documentation |
concepts/ |
Core concepts and theory |
design/ |
Design documents (draft/, proposals/, rfcs/) |
spec/ |
Technical specifications (includes draft/) |
user-guides/ |
Practical how-to guides |
reference/ |
API and technical reference |
developers/ |
Contributor guides |
community/ |
Community resources |
use-cases/ |
Real-world examples |
adr/ |
Architecture Decision Records |
For detailed section guidelines, see docs-structure.md.
---
title: Document Title
sidebar_position: 1
---
python .claude/skills/technical-writer/scripts/validate_docs_structure.py docs/path/to/new-doc.md
Use the tutorial template at assets/tutorial-template.md.
Required tutorial elements:
Validate tutorials:
python .claude/skills/technical-writer/scripts/validate_tutorial.py docs/path/to/tutorial.md --suggest
Quick markdown link check:
.claude/skills/technical-writer/scripts/check_links.sh --markdown-only
Full build with link validation (recommended before PRs):
cd website && npm run build
The Docusaurus config is set to warn on broken links. For stricter checking, the build will report all broken links.
Check that public APIs are documented:
python .claude/skills/technical-writer/scripts/check_api_docs.py --path pkg/
For markdown report:
python .claude/skills/technical-writer/scripts/check_api_docs.py --format markdown > api-coverage.md
When reviewing PRs, use the checklist at code-review-checklist.md.
Key items:
mise run examples:validate)When specification documents (docs/spec/) need to match design documents (docs/design/), use the consistency checklist at spec-design-consistency.md.
Key consistency checks:
Naming Format Validation
package/path:module/path#local-namesegment/segment (no : or #)kebab-case with (abbreviations) for letter sequencesNode Coverage
(v4)JSON Example Validation
Schema Documentation and Examples
description fieldsexamples arrays with realistic JSONDirectory Structure Validation
.type.json, .value.json, module.json)Terminology Alignment
Workflow for consistency review:
# 1. Validate examples against schemas
mise run examples:validate
# 2. Validate fixtures (if present)
mise run fixtures:validate
# 3. Open design and spec side-by-side
# 4. Walk through each section
# 5. Validate JSON examples
# 6. Verify directory structure examples
# 7. Fix discrepancies
# 8. Generate review document (optional, saved to .morphir/out/)
# 9. Regenerate llms.txt
python .claude/skills/technical-writer/scripts/generate_llms_txt.py
Review Documents:
.morphir/out/ directoryIntroducing a concept:
## Feature Name
Brief explanation of what this feature does and why it's useful.
### How It Works
Detailed explanation with diagrams if helpful.
### Example
```elm
-- Practical, runnable example
**Documenting a command:**
```markdown
## `morphir command`
Description of what the command does.
### Usage
```bash
morphir command [options] <args>
| Option | Description | Default |
|---|---|---|
--flag |
What it does | false |
# Common use case
morphir command --flag value
**Writing step-by-step instructions:**
```markdown
## Procedure Name
Brief overview of what we'll accomplish.
### Step 1: Action
Explanation of what this step does.
```bash
command to run
Expected output or result.
Continue building on previous step...
## Tools Reference
### validate_docs_structure.py
Validates documentation structure, frontmatter, and heading hierarchy.
```bash
# Check all docs
python scripts/validate_docs_structure.py
# Check specific file
python scripts/validate_docs_structure.py docs/path/to/file.md
# Attempt to fix issues
python scripts/validate_docs_structure.py --fix
Checks for broken internal links in markdown files.
# Quick check
./scripts/check_links.sh --markdown-only
# With fix suggestions
./scripts/check_links.sh --fix
Analyzes source code for undocumented public APIs.
# Check pkg directory
python scripts/check_api_docs.py
# Strict mode (fails on undocumented APIs)
python scripts/check_api_docs.py --strict
# Set coverage threshold
python scripts/check_api_docs.py --threshold 80
Validates tutorial structure and content quality.
# Basic validation
python scripts/validate_tutorial.py docs/tutorials/my-tutorial.md
# With suggestions
python scripts/validate_tutorial.py --suggest path/to/tutorial.md
# Strict mode
python scripts/validate_tutorial.py --strict path/to/tutorials/
Converts YAML-formatted JSON Schema files to JSON format to keep both versions in sync.
# Convert a single file
python scripts/convert_schema.py morphir-ir-v3.yaml
# Convert all schemas in a directory
python scripts/convert_schema.py --dir website/static/schemas/
# Verify YAML and JSON are in sync (no changes made)
python scripts/convert_schema.py --verify website/static/schemas/
# Force conversion even if JSON is newer
python scripts/convert_schema.py --force morphir-ir-v3.yaml
# JSON output for CI
python scripts/convert_schema.py --verify --json website/static/schemas/
Detects drift between schema definitions and implementation.
# Check YAML/JSON sync only
python scripts/check_schema_drift.py --sync
# Check schema vs Go code drift
python scripts/check_schema_drift.py --code
# Run all drift checks
python scripts/check_schema_drift.py --all
# JSON output for CI integration
python scripts/check_schema_drift.py --all --json
# Fail on any issues (strict mode)
python scripts/check_schema_drift.py --all --strict
The Morphir IR schemas are maintained in YAML format (human-readable) with JSON versions generated for tool compatibility.
Schema locations:
website/static/schemas/*.yamlwebsite/static/schemas/*.jsonpkg/models/ir/schema/ (in finos/morphir-go)Workflow for schema changes:
python .claude/skills/technical-writer/scripts/convert_schema.py website/static/schemas/
python .claude/skills/technical-writer/scripts/convert_schema.py --verify website/static/schemas/
When reviewing PRs that touch schemas or model code, check for drift:
# Full drift check
python .claude/skills/technical-writer/scripts/check_schema_drift.py --all
# If issues found:
# - YAML/JSON mismatch: Run convert_schema.py to sync
# - Schema/code mismatch: Review if schema or code needs updating
Common drift scenarios:
| Scenario | Detection | Resolution |
|---|---|---|
| YAML edited, JSON not updated | --sync check fails |
Run convert_schema.py |
| New Go type without schema entry | --code shows undocumented type |
Add to schema or document as intentional |
| Schema type without Go implementation | --code shows potential missing impl |
Implement or document as intentional |
Docusaurus has two different behaviors for file links that are critical to understand:
| Link Type | Example | Result |
|---|---|---|
| Absolute path | [Schema](/schemas/file.json) |
Served from static/ folder without hashing |
| Relative path | [Schema](./file.json) |
Processed by webpack, hashed, placed in /assets/files/ |
Files in website/static/ are served directly at the root URL without any processing:
website/static/schemas/morphir-ir-v3.json → https://morphir.finos.org/schemas/morphir-ir-v3.jsonwebsite/static/img/logo.png → https://morphir.finos.org/img/logo.pngAlways use absolute paths starting with / to reference static assets:
<!-- CORRECT: Absolute path - served clean from static folder -->
[Download Schema](/schemas/morphir-ir-v3.json)
<!-- WRONG: Relative path - gets hashed by webpack -->
[Download Schema](./morphir-ir-v3.json)
Relative links to non-markdown files (.json, .yaml, .pdf, etc.) in MDX/MD files trigger webpack processing:
/assets/files/morphir-ir-v3-85ce70553b0c0364e88a70abdc45ce97.jsonThis happens because Docusaurus treats relative asset links as "require" statements, enabling cache busting but creating ugly URLs.
Canonical location: Keep all downloadable files in website/static/
website/static/schemas/website/static/img/website/static/ir/examples/Never duplicate files: Don't copy static files into docs/ folders
Always use absolute paths for downloadable assets:
- [JSON Schema](/schemas/morphir-ir-v3.json)
- [YAML Schema](/schemas/morphir-ir-v3.yaml)
- [Example IR](/ir/examples/v3/lcr-morphir-ir.json)
Relative paths are OK for:
[Related Doc](./other-doc.md)Search for relative links to non-markdown files:
# Find relative links to JSON/YAML files (potential problems)
grep -rn '\]\(\./.*\.\(json\|yaml\)\)' docs/
# All such links should be converted to absolute paths
# ./schema.json → /schemas/schema.json
| File Location | Clean URL |
|---|---|
website/static/schemas/*.json |
/schemas/*.json |
website/static/schemas/*.yaml |
/schemas/*.yaml |
website/static/ir/examples/v3/*.json |
/ir/examples/v3/*.json |
website/static/img/* |
/img/* |
For more details, see the Docusaurus Static Assets documentation.
The llms.txt specification defines a standard format for providing LLM-friendly documentation. Morphir provides two files:
/llms.txt - Compact version with curated links and descriptions/llms-full.txt - Full version with inline content from key documentsGenerates llms.txt files from Morphir documentation.
# Generate both compact and full versions
python scripts/generate_llms_txt.py
# Generate only compact version
python scripts/generate_llms_txt.py --compact-only
# Generate only full version
python scripts/generate_llms_txt.py --full-only
# Preview without writing files
python scripts/generate_llms_txt.py --dry-run
# Custom output directory
python scripts/generate_llms_txt.py --output website/static/
When documentation changes significantly, regenerate the llms.txt files:
# From repository root
python .claude/skills/technical-writer/scripts/generate_llms_txt.py
# Files are written to:
# - website/static/llms.txt
# - website/static/llms-full.txt
The generated files follow the llms.txt specification:
./other-doc.md/schemas/file.json (see Docusaurus Static Assets)