planday-bridge AGENTS.md

Repository instructions that give AI coding agents the project’s purpose, design, domain details, and safety rules for the Planday workforce-management integration.

In plain words
What is it for?
Understanding the Planday API bridge, its timesheet-report pipeline, its MCP server, its generated files, and its write-safety constraints.
Why use it?
They prevent agents from repeating costly discoveries or making unsafe changes, such as hand-writing code that should be generated from API specifications.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/mvpr-ext-projects/planday-bridge/agents-md
Clone the repo
git clone --depth 1 https://github.com/MVPR-Ext-Projects/planday-bridge

Made for: Codex, OpenCode.

Per session 2,170 This file is loaded in full into every session.
When invoked 2,170 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02170 $0.02170
Opus 5 $0.01085 $0.01085
Sonnet 5 $0.00434 $0.00434
Haiku 4.5 $0.00217 $0.00217

Measured 2d ago against content hash 7834e50aaf01, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

planday-bridge AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 152 lines

How it starts

The opening of the file, as written. The whole thing — 152 lines — stays where its author put it; the contents beside it link to each section on GitHub.

planday-bridge — context for AI coding agents

If you are an AI agent working in this repo, read this first. It carries the domain knowledge and the non-obvious traps, most of which cost real time to rediscover.

Humans: README.md for the developer tour, SETUP.md to just get it running.

What this is

Two things over the Planday workforce-management API:

  1. A translator producing Planday's Timesheet Report — worked hours and staff cost per shift — which has no single endpoint and must be assembled from three.
  2. An MCP server exposing all 125 Planday operations.

Architecture

Everything derives from the vendored OpenAPI specs. Do not hand-write endpoint wrappers — regenerate instead, or coverage silently rots.

specs/*.json          vendored from openapi.planday.com/{area}/swagger/v1.0/swagger.json
scripts/generate.ts   specs -> src/generated/operations.json   (pnpm gen)
src/generated/        125 operations, 294 schemas. COMMITTED - do not gitignore.
src/planday/          auth, http (+ offset loop), validation, invoke (the dispatcher)
src/timesheet/        columns -> transform (pure) -> build -> summarise -> csv
src/bridge/           handler + setup page, shared by both HTTP entrypoints
src/fixtures/         seeded sample portal + schema-driven synthesiser
src/source.ts         LiveSource | DummySource behind one interface
apps/mcp/             the MCP server (19 tools, 3 layers)
apps/bridge/          standalone HTTP server (local + Docker)
api/index.ts          serverless entrypoint; vercel.json rewrites everything here
powerquery/           Timesheet.pq (GENERATED), Timesheet-direct.pq (hand-written)

Every call goes through src/planday/invoke.ts. Both HTTP entrypoints delegate to src/bridge/handler.ts — never add a route to one without the other, or the hosted and local builds diverge.

Traps

Each of these was found the hard way.

  • The spec URLs are undocumented. https://openapi.planday.com/{area}/swagger/v1.0/swagger.json for area in absence hr pay payroll portal punchclock reports revenue scheduling. Nothing on Planday's docs site links to them, and the docs site itself is a JS app that fetches them at runtime.
  • openapi.planday.com/api/{area} is a documentation page, not an endpoint. Aiming Power Query or an HTTP client at one is the most common Planday integration mistake.
  • Every request needs two headers, Authorization: Bearer and X-ClientId. Omitting the second gives a 401 that reads like a bad token. The spec mentions neither it nor a base URL — there is no servers block. Both are injected by src/planday/http.ts.
  • limit is hard-capped at 50 on list endpoints (maximum: 50); raising it is silently ignored. Walk offset against paging.total. The paging envelope is { data, paging: { offset, limit, total } } and is identical across all nine areas. The three report endpoints are not paged — they are bulk date-range calls.
  • 113 of 125 operations have no operationId. Ids are synthesised in scripts/generate.ts as {area}.{method}.{pathSlug}, purely from method + path so they stay stable across regeneration. Never make an id depend on ordering or a counter.
  • Planday's date-time is a .NET DateTime. Its own documented example for the punch-clock parameters is 2025-01-01T00:00 - no seconds, no offset - which strict RFC 3339 rejects. Left on the ajv-formats default, our validator refused requests that Planday accepts, across 24 parameters in 6 operations. Overridden in validation.ts.
  • format: time is a .NET TimeOnly, not RFC 3339. ajv-formats demands a timezone offset in both fast and full mode, which would reject every legitimate shift time — Planday pairs a local wall-clock time with a separate timeZone field. src/planday/validation.ts overrides time and date-span for this reason. Use createAjv() from there — never construct a bare Ajv, or tests will validate under looser rules than the dispatcher enforces.
  • Two POSTs are reads. reports.post.schedulingHistory and absence.post.accounts.balance.employees are queries whose filters are too big for a query string. They are in READ_ONLY_POSTS in the generator; tiering by HTTP verb alone would put the entire Timesheet Report behind the write gate.
  • firstApproved is a snapshot, not a timestamp. Planday exposes no approval time at all. The column is first_approved_hours; comparing it to approved is what surfaces edited_after_approval.
  • shiftId is nullable for punch-clock entries never matched to a shift. The row key is shiftId ?? "pc-<punchclockId>". Power BI needs a real primary key, and this is the case a hand-rolled Power Query merge gets wrong.
  • Salaried staff never appear in shiftsPayroll — only in salariedPayroll. Their shifts legitimately carry hours with no cost. Do not "fix" this.
  • Never read a file relative to import.meta.url. It is undefined once the code is bundled into a serverless function, and the lambda dies at cold start while every local test stays green. This bit once — the operation catalogue was loaded that way. It is now import catalogue from "./operations.json" with { type: "json" } so bundlers inline it. test/deploy.test.ts is the only test that would catch a repeat.
  • Planday gates each area by its own authorization policy. A perfectly valid token can be refused on payroll alone. Anything touching cost must degrade — payroll, then time-and-cost, then hours with no cost — never throw. pnpm whoami probes each area.

Read the full file on GitHub · 152 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 152 lines · 2,170 tokens per session scan A 7834e50aaf01

Subscribe to this mod's changes

planday-bridge AGENTS.md is an instructions file published in the GitHub repository MVPR-Ext-Projects/planday-bridge (0 stars, last pushed 7d ago), licensed MIT. It adds 2,170 tokens to every session, about $0.0109 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

mcp-server-excel llm-testing-philosophy.instructions.md

Instructions for sbroenne/mcp-server-excel, covering llm testing philosophy, what are llm tests?, the golden rule, what never belongs in a test and ❌ xfail or skip markers.

sbroenne/mcp-server-excel · 3,451 tokens

mcp-server-excel readme-management.instructions.md

Instructions for sbroenne/mcp-server-excel, covering readme management - quick reference, core entry documents, feature documentation, critical rules and tool & action counts must match.

sbroenne/mcp-server-excel · 2,648 tokens

mcp-server-excel development-workflow.instructions.md

Instructions for sbroenne/mcp-server-excel, covering development workflow, branch protection, development process, pr review comment workflow and retrieve inline code review comments using github cli.

sbroenne/mcp-server-excel · 1,518 tokens

mcp-server-excel extension-development.instructions.md

Instructions for sbroenne/mcp-server-excel, covering vs code extension development instructions, extension overview, changelog and changesets (critical), version management and automatic version management (unified release workflow).

sbroenne/mcp-server-excel · 1,427 tokens

mcp-server-excel copilot-instructions.md

Instructions for sbroenne/mcp-server-excel, covering github copilot instructions - excelmcp, repository map, environment, working rules and build and validation.

sbroenne/mcp-server-excel · 1,206 tokens

mcp-server-excel excel-connection-types-guide.instructions.md

Instructions for sbroenne/mcp-server-excel, covering excel connection types - llm quick reference, critical: loadto operation limitations, connection action compatibility, decision tree: connection vs power query and recommended workflows.

sbroenne/mcp-server-excel · 1,113 tokens