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.
In this repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- md-anythingSkill
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
- Distinctive: line 5
Use Bun throughout this repository.
- Very specific: line 32
When debugging optional local tool support, run bun run src/cli.ts doctor.
- Very specific: line 54
Keep CLI and MCP behavior aligned by changing shared logic in src/core/* or src/providers/*.
- Distinctive: line 56
Keep metadata responsibilities split the same way the code does today:
- Distinctive: line 62
Do not regress the CLI command shape.
- Very specific: line 71
Keep required tests separate from capability-gated or live tests.
- Distinctive: line 78
If you touch MCP behavior, preserve the current safety defaults:
≈ “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.
Files
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.tsWhen debugging optional local tool support, run bun run src/cli.ts doctor.
High-level architecture
src/cli.tsandsrc/mcp.tsare the shipped entry points. They both build a runtime withcreateRuntimeProviders(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 withConvertRequestSchema, detect the input kind, route withrouteInput, normalize quality metadata withfinalizeDocument, attach chunk/provenance data, and render Markdown withformatMarkdown. src/providers/*contains one converter per input kind. Providers return aNormalizedDocument; they should not format final Markdown themselves.- Runtime capability checks are centralized in
src/core/runtime.ts. Optional tools such astesseract,pdftotext,ebook-convert,unzip,ffmpeg,whisper-cpp, andwhisperare detected once and then passed through the runtime so providers can gate behavior consistently. src/core/ingest.tswalks 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.tsis 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.tsowns the final output shape. Frontmatter is on by default and is where extraction metadata,support_level, andusefulness_scorebecome 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/*orsrc/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 notesconvertToMarkdown()addssupport_level, conversion metadata, and doctor warnings- chunk/provenance helpers attach document ids and section-aware chunks after normalization
- providers set extraction-specific metadata such as
- 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:requiredis the baseline contributor workflow and should stay green without exotic local tooling. Optional-tool coverage belongs inbun testortest: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:fixturesregenerates the generated fixtures
- committed source fixtures live in
- 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
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
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.

