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.1.tar.gz (9.7 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.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for loomx-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0cf0d4988c4d91c4e9debb210e5bd16f8675e7b7181de1d91edc4c7509019870
MD5 1f2224e711268ec0f6ce14ce4c45cf94
BLAKE2b-256 5a2c6872e1377be943f9cb984e4b0d99b1a1a3ba63faa7929f32b0991319106f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for loomx-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a448d3335e3bb6263f30f6b9efe939cbf7c5ce6316a015f26ca6e3af2624787a
MD5 6a363ba8fc22e29190b124b66306e5d6
BLAKE2b-256 2d44b7f88566626bc53bacbdf64d010c56c2d2b46f4d60a13321230e27d48360

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