agentleFS
giantswarmgiantswarm/pro/AGENTS.md

pro

AGENTS.md1 starsChanged 17 days agoApache-2.0View on GitHub

devctl maintains this block from [its template][devctl-agents-block] and overwrites changes to it. Instructions for this repository go in the section below. Where they differ from this block, they take precedence. [devctl-agents-block]: https://github.com/giantswarm/devctl/blob/main/pkg/gen/input/llm/internal/file/agents_block.md.template - Never put customer names or other customer information in code, commit messages, issues or pull requests. Most Giant Swarm repositories are public, and private ones are kept ready to become public. - Giant Swarm's style guides are in <https://github.com/giantswarm/fmt>, one directory per topic (go, helm, kubernetes, prometheus,…

  • Installs packages
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never put customer names or other customer information in code, commit messages, issues or pull requests.

    line 12
  2. Distinctive:

    Use conventional commits for commit messages and pull request titles.

    line 18
  3. Very specific:

    If .github/workflows/zz_generated.auto_release.yaml exists, GitHub Releases are written from pull request titles: do not edit CHANGELOG.md.

    line 19
  4. Very specific:

    If .pre-commit-config.yaml exists, run pre-commit run --files <changed files> before committing.

    line 23
  5. Distinctive:

    Do not add linters, formatters or other tooling unless asked.

    line 26
  6. Very specific:

    Put documentation in docs/ rather than growing README.md, which gives an overview and links into docs/.

    line 28
  7. Very specific:

    If the skills of the giantswarm/claude-code plugin marketplace are not available to you and the user works at Giant Swarm, tell them once …

    line 31
  8. Very specific:

    No linters or formatters are configured.

    line 69
  9. Very specific:

    Generic field filtering: No hardcoded field names. LLMs read the board's schema resource to discover fields, then pass field name/value …

    line 119

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md 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
AGENTS.md
<!-- BEGIN devctl-managed: edits in this block are overwritten --><!-- markdownlint-disable-file MD041 -->

Giant Swarm conventions

devctl maintains this block from its template and overwrites changes to it. Instructions for this repository go in the section below. Where they differ from this block, they take precedence.

  • Never put customer names or other customer information in code, commit messages, issues or pull requests. Most Giant Swarm repositories are public, and private ones are kept ready to become public.
  • Giant Swarm's style guides are in https://github.com/giantswarm/fmt, one directory per topic (go, helm, kubernetes, prometheus, …). Read the relevant guide before you write or review that kind of code.
  • Use conventional commits for commit messages and pull request titles.
  • If .github/workflows/zz_generated.auto_release.yaml exists, GitHub Releases are written from pull request titles: do not edit CHANGELOG.md. Otherwise, add your change to CHANGELOG.md as described in https://github.com/giantswarm/fmt/blob/main/releases/changelog.md.
  • If .pre-commit-config.yaml exists, run pre-commit run --files <changed files> before committing; not every clone has the hooks installed.
  • Do not add linters, formatters or other tooling unless asked; use what the repository already has.
  • Put documentation in docs/ rather than growing README.md, which gives an overview and links into docs/. When a change affects documented behaviour, update the documentation in the same pull request.
  • If the skills of the giantswarm/claude-code plugin marketplace are not available to you and the user works at Giant Swarm, tell them once that they can install the gs-base, gs-dev and gs-appdev plugins from it.
<!-- END devctl-managed -->

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What This Is

PRO (Portfolio Roadmap Organizer) is an MCP server that exposes Giant Swarm's GitHub Projects V2 boards to AI assistants. It manages two built-in boards:

  • Roadmap Board (#273) — company quarterly goals, team/SIG/WG issues
  • Customer Board (#345) — customer activities from private repos

An installation can add boards with PRO_EXTRA_BOARDS (docs/extra-boards.md).

Commands

# Install dependencies
npm install

# Run tests (Node.js built-in test runner)
npm test

# Run MCP server locally (stdio transport)
node bin/index.js

# Run with HTTP transport (port 8080)
node bin/index.js --transport=streamable-http

# Helm lint
helm lint helm/pro

No linters or formatters are configured. Tests use the Node.js built-in test runner (node --test).

Architecture

Pure JavaScript (ES modules), no TypeScript. Node 20+.

Entry Point & Transport

bin/index.js parses --transport flag and starts either stdio (default, for local AI clients) or streamable HTTP (for K8s/Docker). HTTP transport (src/lib/mcp/http.js) serves /mcp, /healthz, /readyz on port 8080. When OAuth is configured, also serves /authorize, /token, /register, /github/callback, and /.well-known/*.

MCP Layer (src/lib/mcp/)

  • server.js — Creates MCP server, registers handlers for list_tools, call_tool, list_resources, read_resource. call_tool validates every call's arguments against the tool's declared inputSchema (validate.js) before the handler runs
  • icon.js — The server's icon (serverInfo.icons): giantswarm.svg, a byte-identical copy of giantswarm/mcp-toolkit brand/giantswarm.svg, as a base64 SVG data URI
  • validate.js — validateToolArguments: refuses missing required, unknown top-level and mistyped arguments, naming each and listing the accepted arguments (a free-form map is always a declared object property such as list_issues' filters, never the top level); exact string spellings of numbers and booleans are converted, null optionals dropped
  • tools.js — 11 tool definitions and handlers (list_issues, get_issue_details, update_issue_field, create_issue_in_project, add_existing_issue, archive_item, close_issue, reopen_issue, update_issue_labels, list_issue_comments, get_server_version), plus 6 more re-exported from sub-issues.js, 2 from timeline.js, 2 from board.js and 3 from relations.js (24 total)
  • sub-issues.js — Sub-issue tools (list, add, remove, get_parent)
  • board.js — get_board_schema and get_item_by_issue (the board item of an issue of any repository, resolved with resource(url:): first among the issue's own projectItems, which show a new item at once but list only projects of the issue's owner, then by node id among the board items its repository and number narrow to, a search that lags a new item by minutes; never a board scan); findBoardItemByIssue is that lookup, shared with update_issue_field's issueUrl)
  • relations.js — Issue relation tools besides parent/child: list_issue_relations, add_issue_relation, remove_issue_relation for "blocked by" / "blocking" dependencies and "relates to" links between issues of any repository (GraphQL only, by issue node ID; "blocking" is "blocked by" with the issues swapped). get_issue_details also returns the three lists, and list_issues an item's open dependency counts (openBlockedBy / openBlocking); get_issue_details reads the relations in a request of its own (getItemRelations), because the lists are non-null in GitHub's schema and an error on one nulls the whole issue: a failure there is relationsError (Issues only), never a failed call. list_issues reads the open dependency counts the same way, by issue node ID (getDependencyCounts, DEPENDENCY_COUNTS_QUERY): after the list for a bounded read, page by page while the read goes on for a full one, since issueDependenciesSummary is non-null too; a failure there is dependencyCountsError. withPartialData (api.js) is the one place that accepts GraphQL errors next to partial data
  • timeline.js — get_issue_timeline tool: compact activity timeline (labels, assignments, milestones, renames, cross-references, close reasons) for an issue, resolved from a board item; list_status_changes tool: the board Status changes (from, to, board) of one repository's issues, read with GraphQL timelineItems because the REST timeline's project_v2_item_status_changed events carry no Status values
  • resources.js — Per-board schema and overview resources (e.g. roadmap://schema)

Auth Layer (src/lib/auth/)

  • provider.js — GitHub OAuth provider implementing MCP SDK's OAuthServerProvider interface. Handles dynamic client registration, URL client_ids (Client ID Metadata Documents, SEP-991: any HTTPS CIMD URL is fetched, validated and cached; the URL policy in isCimdUrl blocks SSRF targets), GitHub OAuth redirect flow, local PKCE validation, and token verification via GitHub API. All of this state is in memory: a restart drops dynamically registered client_ids, in-flight authorization sessions and unexchanged codes (those logins must be started over); CIMD clients such as muster and Claude Code are unaffected because their client_id is re-resolved from the URL.
  • http.js builds the RFC 8414 metadata itself (createOAuthMetadata + client_id_metadata_document_supported: true) and mounts it before the SDK's mcpAuthRouter, because the SDK offers no option for the flag. Clients only take the CIMD path when it is advertised.

GitHub App layer (src/lib/github-app/)

App mode (docs/app-mode.md): pro reads as the installation's workspace GitHub App for unattended runs. docs/github-lane.md is the contract with devctl serve in the same pod.

  • app-mode.js — AppMode (the App and one lane per installation; appModeConfigFromEnv refuses a person's token next to it) and LaneCredential, what a tool call threads as its token in App mode: api.js and rest-api.js turn it into a fetch for Octokit, so every existing tool goes through the lane of the account it touches (GraphQL: the home account's)
  • lane.js — Lane: one request in flight, priority classes (merge > write > continuing > starting > metrics), REST and GraphQL paced apart below a share of GitHub's secondary limits, the conditional cache (cache.js), refusals (LaneRefusal: saturated, paused after GitHub's rate limit, primary reserve, writes off, credential paths) and nextPollMs from the points one round of active observations costs. clock.js lets tests run it on a fake clock
  • app.js — the App's JWT, installations by account, tokens minted per installation (read-only with writes off)
  • reads.js — list_issues (REST Projects API, the board filter as q) and get_issue_details (by issueUrl) in App mode, structured for runs; claims.js reads claim markers (<!-- pro-claim {...} -->, App-written only, lowest comment ID wins)
  • lane-server.js — the loopback lane endpoint devctl sends its GitHub requests to; callers.js — the OIDC check over HTTP: the calling organization comes only from a verified token for pro's audience (Dex: aud pro's client pro, azp one of the organization's principal clients, mapped to it by configuration, and sub that client's own), and must match PRO_APP_ORGANIZATION
  • Tests run against fake-github.test.js, a fake GitHub with conditional answers; no test uses a person's token or writes to GitHub

Domain Layer (src/lib/)

  • project.js — Board registry (board name → project ID, number, name and owner; the built-in boards plus the ones parseExtraBoards reads from PRO_EXTRA_BOARDS when the module loads), all GraphQL queries and mutations
  • items.js — Issue listing with server-side filtering (fieldTerm turns a filters/exclude entry of any field type into a Projects query term; a full read walks item ids and reads them by id in parallel, readItemsInParallel), issue detail fetching, field updates, and resolveItemIssues — the single batched item→issue resolution helper (issue node ID, owner/repo/number, repo visibility) used by every tool that only needs the issue ref (close/reopen, labels, timeline, comments); and resolveBoardItem, which resolves one item by its project item ID and checks its board before a board write (update_issue_field, archive_item), naming a missing or misplaced item
  • fields.js — Field discovery and fuzzy matching (case-insensitive, emoji/special char normalization)
  • api.js — Authenticated GraphQL client with cursor-based pagination: fetchBounded reads only as many pages as a limit needs (each page sized to what is still missing) and hands back the cursor to continue; fetchPaginated reads them all
  • rest-api.js — Octokit REST client for sub-issues and timeline endpoints (not available via GraphQL)
  • relations.js — Issue relations (listIssueRelations, addIssueRelation, removeIssueRelation), getItemRelations and getDependencyCounts for getItemByID and listItems, and compactRelation (truncated from pageInfo.hasNextPage; hidden counts null nodes plus, on a last page, what totalCount holds beyond the nodes)
  • comments.js — Bulk comment fetching: resolves board items to issues via resolveItemIssues, then REST comment fetching with since/cap bounds
  • logger.js — Structured logging to stderr (avoids polluting MCP stdio)

Key Design Decisions

  • Generic field filtering: No hardcoded field names. LLMs read the board's schema resource to discover fields, then pass field name/value pairs under list_issues' filters map, the only place for them (exclude negates them).
  • GraphQL variable names: @octokit/graphql refuses variables named like its request options (url, query, method, headers, request, baseUrl, mediaType, operationName). The unit tests mock the client, so src/lib/graphql-variables.test.js reads the sources instead: every operation's declared $variables and the object literal passed to every graphQLWithAuth, fetchBounded and fetchPaginated call. Pass variables as an object literal so it can read them.
  • Board registry pattern: resolveBoardId() maps board names ("roadmap", "customer", and the keys of PRO_EXTRA_BOARDS) to GitHub project node IDs. Tool schemas take their board enum from BOARD_NAMES, never a literal list. A short repository name resolves to the board's owner (resolveBoardOwner()), giantswarm on the built-in boards.
  • Dual transport: stdio for local clients, HTTP for remote deployment — same server code.
  • Four auth modes: GITHUB_API_TOKEN env var for stdio/local use; OAuth 2.1 via GitHub for HTTP transport (when GITHUB_OAUTH_CLIENT_ID is set); bearer-only for HTTP transport (OAUTH_BEARER_ONLY=true: GitHub tokens obtained elsewhere are verified and used per request, no authorization server); App mode (PRO_APP_ID: the workspace GitHub App through src/lib/github-app/, the calling organization only from a verified token for pro's audience, never a person's token). Per-request tokens are threaded through the entire call chain. createGitHubTokenVerifier (provider.js) is the shared verifier: scoped tokens must cover repo, project, read:org; GitHub App / fine-grained tokens carry no scopes header and are accepted, GitHub enforcing their permissions per call. With GITHUB_APP_SLUG the verifier accepts only user access tokens of that GitHub App (pro's own giantswarm-pro, pinned in muster), so no write goes through another App's token.
  • Public repo safety: Creating issues in giantswarm/roadmap (public) requires explicit confirmPublicSafe=true. Posting a comment via close_issue/reopen_issue on an issue in any public repository requires the same confirmPublicSafe=true guard; the close/reopen state change itself is ungated.

Environment Variables

  • GITHUB_API_TOKEN (required for stdio, optional fallback for HTTP) — PAT with project:write and repo:write scopes
  • HTTP_PORT (optional, default 8080) — for HTTP transport
  • PRO_EXTRA_BOARDS (optional) — JSON object of board key → { id, number, owner, name }: boards served next to the built-in ones. Read once at start; an invalid value fails the start. See docs/extra-boards.md.
  • PRO_APP_ID, PRO_APP_PRIVATE_KEY_FILE, PRO_APP_OWNER, PRO_APP_ORGANIZATION (App mode), PRO_APP_CALLER_ISSUER / _AUDIENCE / _CLIENTS (App mode over HTTP), GITHUB_API_URL, PRO_REST_POINTS_PER_MINUTE, PRO_GRAPHQL_POINTS_PER_MINUTE, PRO_CACHE_MB, PRO_LANE_ADDRESS, PRO_WRITES — see docs/app-mode.md.
  • GITHUB_OAUTH_CLIENT_ID (optional) — GitHub OAuth App client ID. Enables OAuth 2.1 on HTTP transport.
  • GITHUB_OAUTH_CLIENT_SECRET (required when OAuth enabled) — GitHub OAuth App client secret
  • OAUTH_BEARER_ONLY (optional) — true runs the HTTP transport as a plain resource server: every /mcp request must carry a GitHub token as bearer (verified via the GitHub API, then used for that request's GitHub calls); no /authorize, /token or /register are served, and RFC 9728 protected resource metadata at /.well-known/oauth-protected-resource[/mcp] names https://github.com/login/oauth as the authorization server. For clients that hold the person's GitHub grant themselves (muster's GitHub connector). Ignored when a GitHub OAuth App is configured.
  • GITHUB_APP_SLUG (optional, bearer-only mode) — Accept only user access tokens of this GitHub App (ghu_ tokens whose GET /user/installations lists only that App); anything else is answered 401.
  • OAUTH_ISSUER_URL (optional) — Public URL of this server for OAuth metadata (defaults to http://localhost:{port})
  • OAUTH_TRUSTED_CLIENT_IDS (optional) — Comma-separated CIMD URLs that bypass the outbound URL policy (e.g. a muster on a cluster-internal hostname) and may omit client_id in their document. Public HTTPS CIMD URLs are accepted without an entry here.

CI/CD

  • GitHub Actions: CI validates app loads + helm lint on PRs; auto-release creates semver tags on merge to main
  • CircleCI: Builds Docker image → pushes to gsoci.azurecr.io, publishes Helm chart to giantswarm-catalog (on version tags only)

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.