Skip to content

Task Plan

Author: Team Lead Date: 2026-03-27 Status: Planning

Implement the Claude Context MCP Server as specified in specification.md. The server is a Cloudflare Worker exposing MCP tools that serve skills, agent profiles, and documentation from GitHub repositories. The target repository is Arda-cards/skills-mcp (currently empty).

DocumentPathPurpose
Specificationspecification.mdFull design, API contracts, decisions
Designdesign.mdArchitecture diagrams, test strategy, pipeline design
Requirementsrequirements.md27 functional requirements with unique IDs
Verificationverification.md50 test cases mapped to requirements
Implementation Changesimplementation-changes.mdPer-file implementation instructions with code templates
Team Split Assessmentteam-split-assessment.mdComplexity analysis — single team recommended
#TaskPersonaDepends OnStatusNotes
1Create package.json with dependencies and scriptsdevops-engineerPendingFollow hypothesis-mcp patterns; add Cloudflare-specific deps
2Create tsconfig.json and tsconfig.eslint.jsondevops-engineerPendingUse bundler module resolution (not NodeNext)
3Create .prettierrc, eslint.config.js, vitest.config.tsdevops-engineerPendingIdentical to hypothesis-mcp
4Create wrangler.tomldevops-engineerPendingPer specification §wrangler.toml
5Update .gitignoredevops-engineerPendingAdd src/generated/, .wrangler/, .dev.vars
6Create CHANGELOG.md and .github/clq/changemap.jsondevops-engineerPendingIdentical CLQ config to hypothesis-mcp
7Create scripts/ensure-generated.js (placeholder indexes)devops-engineerPendingCreates empty JSON files in src/generated/
8GATE: Scaffolding complete1-7Pendingnpm ci succeeds, npx tsc --noEmit succeeds with placeholders
9Create src/types.ts (Env, response types, index entry types)back-end-engineer8PendingPer implementation-changes §2.1
10Create src/auth.ts (token decode + PAT format validation)back-end-engineer9PendingURL-safe Base64 decode, prefix check (ghp_, github_pat_, gho_)
11Create src/validation.ts (path traversal checks)back-end-engineer9PendingReject .., leading /, \
12Create src/github.ts (GitHub Contents API client)back-end-engineer9PendingfetchGitHubContent, fetchGitHubContentOrNull, error mapping
13Create src/cache.ts (Cloudflare Cache API wrapper)back-end-engineer9PendinggetCached, setCached, buildCacheKey; 10-min TTL
14Create src/index.ts (McpAgent + 7 tool registrations)back-end-engineer10-13PendingMain entry point; imports bundled indexes
15GATE: Source compiles14Pendingnpx tsc --noEmit passes; wrangler dev starts without errors
16Create scripts/build-skills-agents-index.jsback-end-engineer8Pendingjs-yaml parser, companion file manifest, graceful fallback
17Create scripts/build-docs-index.jsback-end-engineer8Pendingjs-yaml parser, .md + .mdx, hierarchical tree
18GATE: Index generation works16, 17PendingRun scripts against local clones of source repos; verify JSON output
19Create tests/auth.test.tsback-end-engineer10PendingAUTH-T01 through AUTH-T05a
20Create tests/validation.test.tsback-end-engineer11PendingSEC-T01 through SEC-T05
21Create tests/github.test.tsback-end-engineer12PendingMocked fetch; SKILL-T03/T04, AUTH-T06/T07/T08, DOC-T03/T04/T05
22Create tests/cache.test.tsback-end-engineer13PendingMocked Cache API; SKILL-T05/T06, cache key construction
23Create tests/tools.test.tsback-end-engineer14PendingSKILL-T01/T02, AGENT-T01/T02, DOC-T01/T02, SKILL-T07/T08
24GATE: All tests pass19-23Pendingnpm test passes; npm run lint passes; npm run typecheck passes
25Create .github/workflows/publish.ymldevops-engineer24Pending3 triggers, 3 jobs (validate-changelog, build-and-test, generate-and-deploy)
26Create .github/workflows/pull_request_upkeep.ymldevops-engineer8PendingIdentical to hypothesis-mcp
27Create README.md (installation and usage guide)back-end-engineer15PendingPer implementation-changes §6.1; PAT creation, Base64 encoding, client setup
28GATE: CI pipeline green25, 26, 27PendingPush to branch, open PR, verify all checks pass
29Merge to main and verify deploymentdevops-engineer28PendingMerge PR; verify Worker is live; run manual smoke test checklist
30Configure branch protection rulesdevops-engineer29PendingMatch hypothesis-mcp: require PR reviews, require status checks

Single directory — no worktrees needed. This is a greenfield project in its own repository (Arda-cards/skills-mcp) with a single implementing agent writing files sequentially.

The plan is largely sequential due to the nature of the work (each phase builds on the previous). Within phases, some tasks are independent:

  • Parallel group 1 (Phase 1): Tasks 1-7 are independent scaffolding files. Can be written in any order.
  • Parallel group 2 (Phase 2): Tasks 10, 11, 12, 13 are independent modules (all depend on types.ts from Task 9). Task 14 depends on all four.
  • Parallel group 3 (Phase 3): Tasks 16, 17 are independent build scripts.
  • Parallel group 4 (Phase 4): Tasks 19-23 can be written in parallel once their corresponding source modules exist.
  • Sequential chain: Tasks 8 → 15 → 18 → 24 → 28 → 29 → 30 (gates must pass in order).

With a single agent, the effective execution is sequential. The parallelization groups indicate which tasks within a phase have no internal ordering constraints.

Not applicable — single agent execution.

PersonaTasks AssignedWorktreeSpawn Order
devops-engineer1-8, 25, 26, 29, 30N/A (main repo)Primary for Phase 1 and Phase 5-6
back-end-engineer9-14, 16-17, 19-24, 27N/A (main repo)Primary for Phases 2-4

With single-agent execution, one agent assumes both roles sequentially.

#QuestionOptionsRecommendationDecision
1McpAgent API for auth header access(a) Override lifecycle method, (b) this.request, (c) Forward as query paramInvestigate during Task 14; keep auth.ts as pure function regardlessOpen
2Durable Objects config in wrangler.toml(a) Explicit bindings, (b) Auto-configured by McpAgent.mount()Check agents package docs during Task 4Open
3Test approach for Worker-specific code(a) Vitest + miniflare, (b) Pure logic only(b) for v1 — test pure functions, verify Worker via manual smoke testDecided: (b)
  • All 7 MCP tools implemented and returning correct responses (list_skills, get_skill, get_skill_file, list_agents, get_agent, list_docs, get_doc)
  • list_* tools serve bundled indexes with zero runtime GitHub API calls
  • get_* tools fetch from GitHub with 10-minute cache and skipCache bypass
  • Path traversal validation rejects .., absolute paths, and backslashes
  • PAT format validation rejects decoded tokens without recognized prefix
  • Build scripts generate correct indexes from source repo frontmatter (js-yaml)
  • Graceful fallback: missing frontmatter produces name=filename, description=null
  • get_doc resolves index.md first, falls back to *.md
  • get_skill_file returns Base64-encoded content as-is from GitHub
  • CI pipeline runs on push to main, Saturday cron, and workflow_dispatch
  • All unit tests pass (npm test)
  • Linting and type-checking pass (npm run lint, npm run typecheck)
  • CHANGELOG validates with clq
  • README includes PAT creation, Base64 encoding, and MCP client setup instructions
  • Worker deploys successfully to Cloudflare Workers
  • Branch protection rules configured on main
  • Manual smoke test passes (all 7 tools, error cases, cache behavior)
Risk / BlockerImpactMitigation
McpAgent API differs from assumptionsTask 14 (index.ts) may need significant reworkImplement and test all pure modules (auth, validation, github, cache) first. Defer McpAgent integration to last. The agents package API surface is small — worst case is adjusting the lifecycle method for auth header access.
Cloudflare agents package requires Durable Objects config not covered in specwrangler.toml may need [durable_objects] and [[migrations]] sectionsTest with wrangler dev early (after Task 4). Adjust wrangler.toml before proceeding to Phase 2.
Source repo structure changes before first deployGenerated indexes may not match expectationsBuild scripts have graceful fallback. Test against actual repo clones during Task 18 gate.
GitHub Actions secrets not yet configuredCI deploy step will failNon-blocking for development. Configure secrets before the merge-to-main step (Task 29).
FileDescription
changelog.mdSummary of changes made during implementation
learnings.mdInsights about Cloudflare Workers, McpAgent API, or MCP protocol discovered during implementation
suggestions.mdImprovement ideas, tech debt, or follow-up work identified

The agent’s TodoWrite list is the single source of truth for task status. At each gate:

  1. Verify all preceding tasks are marked completed
  2. Run the gate verification (npm test, tsc —noEmit, etc.)
  3. Only proceed to the next phase if the gate passes
DateEventNotes
2026-03-27Plan created