agentleFS
ojspaceojspace/md-anything/.github/copilot-instructions.md

md-anything

Copilot instructions49 starsChanged 2 months agoMITView on GitHub

Use Bun throughout this repository. When debugging optional local tool support, run bun run src/cli.ts doctor. bun run src/cli.ts convert with no input should continue to fail with exit code 1.

The file

We split this copilot-instructions.md into the rules it gives an agent

7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use Bun throughout this repository.

    line 5
  2. Very specific:

    When debugging optional local tool support, run bun run src/cli.ts doctor.

    line 32
  3. Very specific:

    Keep CLI and MCP behavior aligned by changing shared logic in src/core/* or src/providers/*.

    line 54
  4. Distinctive:

    Keep metadata responsibilities split the same way the code does today:

    line 56
  5. Distinctive:

    Do not regress the CLI command shape.

    line 62
  6. Very specific:

    Keep required tests separate from capability-gated or live tests.

    line 71
  7. Distinctive:

    If you touch MCP behavior, preserve the current safety defaults:

    line 78

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Copilot instructions for md-anything

Build, test, and lint commands

Use Bun throughout this repository.

bun install
bun run lint
bun run build

# Full suite
bun test
bun run test

# Contributor-safe required subset
bun run test:required

# Regenerate generated PDF/EPUB fixtures when needed
bun run test:fixtures

# Run a single test file
bun test tests/unit/detect-input.test.ts

# Run one test by name
bun test tests/integration/convert-text.test.ts -t "converts .txt file to markdown"

# Live/network tests
LIVE_TESTS=1 bun test tests/integration/youtube-live.test.ts tests/integration/url-live.test.ts

When debugging optional local tool support, run bun run src/cli.ts doctor.

High-level architecture

  • src/cli.ts and src/mcp.ts are the shipped entry points. They both build a runtime with createRuntimeProviders(DEFAULT_CONFIG) and delegate to shared core logic instead of implementing format-specific behavior themselves.
  • The main conversion path lives in src/core/convert.ts: validate with ConvertRequestSchema, detect the input kind, route with routeInput, normalize quality metadata with finalizeDocument, attach chunk/provenance data, and render Markdown with formatMarkdown.
  • src/providers/* contains one converter per input kind. Providers return a NormalizedDocument; they should not format final Markdown themselves.
  • Runtime capability checks are centralized in src/core/runtime.ts. Optional tools such as tesseract, pdftotext, ebook-convert, unzip, ffmpeg, whisper-cpp, and whisper are detected once and then passed through the runtime so providers can gate behavior consistently.
  • src/core/ingest.ts walks supported files in a folder, converts them through the shared pipeline, and returns counts plus per-document metadata. It does not currently process source manifests or generate graph/index artifacts.
  • src/mcp-support.ts is the MCP policy layer: it restricts local paths to the current workspace root, blocks private URLs by default, and defines structured tool output, resources, and prompts.
  • src/formatters/markdown.ts owns the final output shape. Frontmatter is on by default and is where extraction metadata, support_level, and usefulness_score become part of emitted Markdown.

Key conventions

  • Preserve the repository's "graceful over correct" behavior documented in README.md: weak extraction should still return non-empty Markdown with explicit metadata and notes, not a hard failure or empty document.
  • Keep CLI and MCP behavior aligned by changing shared logic in src/core/* or src/providers/*. If a behavior change only lives in one entry point, it will drift from the other surface.
  • Keep metadata responsibilities split the same way the code does today:
    • providers set extraction-specific metadata such as extraction, extraction_status, and provider details
    • finalizeDocument() adds usefulness scoring and low-confidence notes
    • convertToMarkdown() adds support_level, conversion metadata, and doctor warnings
    • chunk/provenance helpers attach document ids and section-aware chunks after normalization
  • Do not regress the CLI command shape. Both of these are intentionally supported:
bun run src/cli.ts convert <input>
bun run src/cli.ts <input>

bun run src/cli.ts convert with no input should continue to fail with exit code 1.

  • Keep required tests separate from capability-gated or live tests. test:required is the baseline contributor workflow and should stay green without exotic local tooling. Optional-tool coverage belongs in bun test or test:live, not in the required subset.
  • Preserve the fixture strategy:
    • committed source fixtures live in tests/fixtures
    • generated binary fixtures live in tests/generated-fixtures
    • bun run test:fixtures regenerates the generated fixtures
  • If you touch MCP behavior, preserve the current safety defaults:
    • workspace file access stays inside the current workspace root
    • private/localhost URLs stay blocked unless MDA_MCP_ALLOW_PRIVATE_URLS=1
    • structured MCP responses continue to include Markdown plus metadata/provenance/chunks

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.