Skip to main content

A CLI tool that adds reference and backlink metadata to markdown documentation files

Project description

loomx

A CLI tool that adds reference and backlink metadata to markdown documentation files, helping AI coding agents better understand project context.

What is loomx?

loomx scans your markdown files, extracts links between documents, and adds metadata blocks that clearly show:

  • Which files each document references
  • Which files link back to each document

This creates a web of connections that makes it easier for both humans and AI to navigate and understand your documentation structure.

Installation

pip install loomx

Or install from source:

git clone https://github.com/pawsong/loomx-py.git
cd loomx-py
pip install -e .

Requirements

  • Python 3.9+

Quick Start

  1. Navigate to your project directory:
cd /path/to/your/project
  1. Update all markdown files with reference metadata:
loomx update
  1. Check for broken links:
loomx check

Features

  • Smart Link Detection: Uses AST-based parsing for accurate link extraction
  • Bidirectional Linking: Automatically calculates and maintains backlinks
  • Repository-Aware: All paths are relative to your repository root
  • Git-Friendly: Respects .gitignore patterns
  • Non-Invasive: Metadata blocks are invisible in rendered markdown
  • Fast: Efficiently processes large documentation sets

How it works

loomx adds hidden metadata blocks to your markdown files:

<!-- @loomx
  references:
  - /docs/api-reference.md
  - /docs/getting-started.md
  backlinks:
  - /README.md
-->

# Your Document Title

Your content continues as normal...

These metadata blocks are:

  • Invisible on GitHub and other markdown renderers
  • Automatically maintained - just run loomx update
  • AI-friendly - structured data that coding assistants can parse

Commands

loomx update

Scans all markdown files and updates their reference metadata.

Options:

  • --dry-run - Preview changes without modifying files
  • --verbose - Show detailed progress
  • --path PATH - Specify root directory (default: current directory)

loomx check

Verifies all links between markdown files are valid.

Options:

  • --path PATH - Specify root directory (default: current directory)

Configuration

loomx automatically ignores common directories:

  • .git
  • node_modules
  • __pycache__
  • .venv
  • dist
  • build

You can add custom exclusions in pyproject.toml:

[tool.loomx]
exclude = ["tests/fixtures/**", "docs/drafts/**"]

Documentation

Development

Setup

# Quick setup (recommended)
./setup.sh

# Or manual setup:
uv venv
source .venv/bin/activate
uv sync --all-groups
uv pip install -e .

Testing

# Run tests
poe test

# Run tests with coverage
poe test-cov

Code Quality

# Run linter
poe lint

# Format code
poe format

# Type checking
poe typecheck

# Run all checks (lint, typecheck, test)
poe check

Other Tasks

# Build package
poe build

# Clean build artifacts
poe clean

Examples

See docs/examples.md for detailed usage examples, including:

  • Pre-commit hooks
  • GitHub Actions integration
  • Monorepo support
  • Real-world use cases

Why loomx?

When working with AI coding assistants, providing context about how files relate to each other helps them:

  • Navigate documentation more effectively
  • Understand the full scope of changes
  • Make better suggestions based on related content

loomx makes these relationships explicit and machine-readable.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loomx-0.1.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loomx-0.1.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file loomx-0.1.0.tar.gz.

File metadata

  • Download URL: loomx-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for loomx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bdfc06cd6ad39f5bce8672dc909be0d8fec2645dae6cc294e5987dc24515d99b
MD5 1da39e82e6aaf5bc588aac3537e7dd8d
BLAKE2b-256 f828ce6d74bef27fd7e4f877ebaf05dd1726dac14c09d01b9efbc2e260bd07f4

See more details on using hashes here.

File details

Details for the file loomx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: loomx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for loomx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 567ccacb886843c9e22ddc727b9cd347d18c27a8ff53fedc63d010c8394029b4
MD5 cbb3c8c650e2f91132df887d2b5e3c21
BLAKE2b-256 1487551b05d38ceff5eedef5cb846b3ce7eb9021984286ddb7808d248731a551

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page