agents-md-sync AGENTS.md

Project instructions for a TypeScript command-line tool that builds an AGENTS.md file from Markdown pieces stored in a central Bitbucket repository. It can commit and push the result to target repositories and optionally open or update a pull request, which is a proposed change for review.

In plain words
What is it for?
Building or maintaining the CLI, composing instruction files, syncing them to Bitbucket repositories, and testing the composition logic without network access.
Why use it?
They explain how the tool is structured and how it should handle Bitbucket access, file operations, validation, and tests.

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/trick77/agents-md-sync/agents-md
Clone the repo
git clone --depth 1 https://github.com/trick77/agents-md-sync

Made for: Codex, OpenCode.

Per session 1,028 This file is loaded in full into every session.
When invoked 1,028 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.01028 $0.01028
Opus 5 $0.00514 $0.00514
Sonnet 5 $0.00206 $0.00206
Haiku 4.5 $0.00103 $0.00103

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

Security

Grade A, and why

agents-md-sync 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 · 65 lines

How it starts

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

Agent Instructions — agents-md-sync

Instructions for AI coding agents working on this repository. For what the tool itself does, see README.md.

Project

Node/TypeScript CLI that composes an AGENTS.md from markdown fragments held in a central Bitbucket template repo, commits and pushes the result to a tool-owned branch on each target Bitbucket Data Center repo, and — when --pr is passed — opens or updates a pull request for that branch. Greenfield — currently only README and this file exist.

Stack

  • Language: TypeScript, Node 20+
  • Runner: tsx for dev, tsc for build
  • CLI: commander
  • Validation: zod
  • HTTP: undici (or built-in fetch)
  • Tests: vitest

Coding

  • TypeScript strict mode. No any without a written reason.
  • Prefer small, pure functions. Keep I/O (Bitbucket API, fs) at the edges; keep composition logic pure so it can be unit-tested without network.
  • No comments that restate the code. Only comment non-obvious why.
  • Use Node's built-in fetch unless a specific undici feature is needed.
  • Do NOT introduce a heavy templating engine. Include markers are <!-- include: NAME.md --> and are resolved by simple string replacement.
  • Fragment resolution is profile-aware: profiles/<profile>/NAME.md wins over common/NAME.md. Keep compose.ts pure and test both paths.
  • The default AGENTS.md.tmpl skeleton lives as a DEFAULT_SKELETON constant in src/templateLoader.ts. A profile can opt into a bespoke skeleton by dropping AGENTS.md.tmpl into its directory; absent that file, the default is used.
  • v1 allows exactly ONE profile per target. Multi-profile (polyglot) support is out of scope. Do not add it without a design discussion.

Testing

  • Unit tests go in tests/ and mirror src/ layout.
  • src/compose.ts MUST be covered by unit tests — it is the only pure-logic module and the heart of the tool.
  • Network-touching code (src/bitbucket.ts, src/sync.ts) is tested via mocked fetch or integration tests against a sandbox repo, never against real production Bitbucket repos.
  • Run tests with npm test (vitest). Every PR must pass tests locally before opening.
  • Sample outputs are golden fixtures. examples/sample-output-<profile>.md is re-rendered on every build and test run by composing each profile in examples/template-repo/profiles/ against examples/template-repo/common/. npm run build and npm test both invoke the render step. If a profile fragment changes, the sample file must be updated in the same commit. CI fails if committed samples drift from what compose.ts produces.

Read the full file on GitHub · 65 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 · 65 lines · 1,028 tokens per session scan A 9722adb20ddd

Subscribe to this mod's changes

agents-md-sync AGENTS.md is an instructions file published in the GitHub repository trick77/agents-md-sync (2 stars, last pushed 7d ago), licensed MIT. It adds 1,028 tokens to every session, about $0.0051 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.