Skip to content

feat: integration builder prompt + MCP sources fix - #71

Merged
nickhart merged 5 commits into
mainfrom
feat/pluggable-ingest
Aug 3, 2026
Merged

feat: integration builder prompt + MCP sources fix#71
nickhart merged 5 commits into
mainfrom
feat/pluggable-ingest

Conversation

@nickhart

@nickhart nickhart commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • build_integration MCP prompt — generates a ready-to-use prompt for any Claude agent (one with Teams, Outlook, Slack, gcal, etc. access) to fetch tasks and write valid md2do JSONL ingest files; supports source (required) and mode=provider (appends TypeScript SourceProvider skeleton)
  • MCP sources fixformatTask() now includes task.sources in JSON output so Claude can see external IDs (e.g. { teams: "msg-789" }) on ingested tasks
  • New docs pagedocs/integrations/prompts/build-integration.md with the canonical prompt text, field reference table, and worked Microsoft Teams example
  • MCP docs update — "Building Integrations" section, sources note on list_tasks, broadened "Combining with Todoist" → "Combining with External Sources"
  • Sidebar entry — flat item under Integrations linking to the new prompt page

Changes

File Change
docs/integrations/prompts/build-integration.md New — canonical prompt + docs
docs/.vitepress/config.mjs Add sidebar entry
packages/mcp/src/types.ts Add BUILD_INTEGRATION constant
packages/mcp/src/prompts/templates.ts Add getBuildIntegrationPrompt()
packages/mcp/src/tools/list-tasks.ts Add sources to formatTask()
docs/integrations/mcp.md "Building Integrations" section + sources note

Test plan

  • pnpm --filter @md2do/mcp build — clean build
  • pnpm -r run test:run — all 467 tests pass, no regressions
  • Smoke test via MCP inspector: npx @modelcontextprotocol/inspector node packages/mcp/dist/index.js → list prompts → build_integration present; call list_tasks on vault with ingested tasks → sources field appears

🤖 Generated with Claude Code

nickhart and others added 3 commits August 2, 2026 10:27
Generalizes the hardcoded Todoist integration into an open, pluggable
source system. Any external service (Teams, Outlook, Slack, etc.) can
now be ingested via a common JSONL intermediate format.

Key changes:
- Task.todoistId → Task.sources?: Record<string,string> (slug→id map)
- WarningCode 'duplicate-todoist-id' → 'duplicate-source-id'
- New patterns: BRACE_TOKEN, BRACE_TOKEN_NON_RESERVED, TODOIST_ID_LEGACY, RESERVED_SLUGS
- New parser helpers: extractSources(), formatSources()
- New core ingest module: parseJsonl(), ingestRecordToLine(), ingestRecords()
- New types: SourceTask, FetchOptions, SourceProvider, IngestRecord
- New TodoistProvider implementing SourceProvider interface
- New CLI command: md2do ingest <file.jsonl> [--output] [--vault] [--dry-run]
- All downstream packages updated: vscode, config, cli formatters
- 38 new tests (extractSources, ingest engine)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- README: add multi-source ingestion feature bullet; update task format
  table with {slug:ID} pattern; update roadmap; update project structure
- docs/guide/task-format: replace Todoist-only "Todoist Integration"
  section with general "Source Links" section; update parsing rules and
  syntax migration table
- docs/cli/overview: add ingest command entry
- docs/cli/ingest: new full reference page (options, JSONL spec, vault
  convention, examples)
- docs/integrations/ingest: new conceptual guide (JSONL format, vault
  layout, MCP agent workflow, SourceProvider interface)
- docs/integrations/todoist: note {todoist:ID} as instance of {slug:ID};
  add cross-ref to ingest guide
- docs/development/roadmap: update to v0.7.x; add ingest and SourceProvider
  to completed; add MCP agent workflow and native integrations roadmap items
- vitepress config: add ingest to CLI sidebar; add Multi-Source Ingestion
  to Integrations sidebar

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add `build_integration` MCP prompt: generates a ready-to-use prompt
  for any Claude agent to fetch tasks from an external source and write
  valid md2do JSONL ingest files; supports `source` (required) and
  `mode=provider` (appends SourceProvider skeleton) arguments
- Fix `formatTask()` in MCP list-tasks to include `sources` field so
  Claude can see external IDs (e.g. `{teams: "msg-789"}`) on ingested tasks
- Add `docs/integrations/prompts/build-integration.md` as canonical
  prompt reference with fields table and worked Teams example
- Update MCP docs: "Building Integrations" section, sources note on
  list_tasks, build_integration prompt entry, broaden Todoist section
  to cover all external sources
- Add sidebar entry for Integration Builder Prompt

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
md2do Ready Ready Preview Aug 2, 2026 6:58pm

Request Review

Add provider.test.ts with 16 tests covering fetchTasks (priority
mapping, dueDate, tags, options passthrough), completeTask, and
reopenTask using a mock client. Coverage now at 95%+.

Exclude client.ts from coverage (thin network wrapper with no
unit-testable logic) and raise thresholds to 80/80/90/80.

Broaden ESLint test override from **/tests/e2e/** to **/tests/** so
mock-heavy unit tests can use vi.fn() without unsafe-* errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use `tasks[0]!` instead of array destructuring to satisfy
noUncheckedIndexedAccess / strict null checks in tsc.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

Coverage after merging feat/pluggable-ingest into main will be

91.93%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   index.ts0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–33, 4–9
src/filters
   index.ts98.85%94.83%100%99.44%128–130, 186, 196
src/ingest
   index.ts98.34%96.61%100%98.88%130, 29–31
src/migrator
   index.ts99.32%92.31%100%100%110
src/parser
   index.ts96.90%94.19%100%97.35%148, 151, 178–184, 187, 197–203
   patterns.ts100%100%100%100%
src/scanner
   index.ts94.96%77.78%100%97.10%100–101, 101–103, 95, 95–98, 98–99
src/sorting
   index.ts98.83%94.12%100%100%116, 137, 95
src/utils
   dates.ts83.45%92.31%66.67%82.93%24–38, 76–82
   id.ts100%100%100%100%
src/warnings
   filter.ts0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–69, 7, 70–79, 8, 80–89, 9, 90–93
src/writer
   index.ts92.93%86.05%100%93.75%145, 204–205, 211–213, 240–251, 285–287, 330–335

@nickhart
nickhart merged commit 27cacd2 into main Aug 3, 2026
12 checks passed
@nickhart
nickhart deleted the feat/pluggable-ingest branch August 3, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant