bmad-project-context
What it does
This skill has an AI agent write and check the instructions file that tells AI agents how to work in a repository. It is for developers who want agents to follow their project's rules.
When to use it
- βWhen you start using AI agents in a repository and need an AGENTS.md file.
- βWhen your project rules change and the agent instructions need updating.
- βWhen an agent makes the same mistake again and you want to record it as a pitfall.
Skill link
https://github.com/bmad-code-org/BMAD-METHOD/blob/main/skills/bmad-project-context/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βSet up the AGENTS.md file for my repo so the AI follows our security and coding rules.β
5 new skills a week. 1 minute to read.
How it works
The agent reads your repository, checks the commands and rules it finds, and proposes a small verified block for the instructions file. You approve each change before it is written.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Overview
A conversation that produces a repository's agent instructions: a small verified block inside AGENTS.md. The user brings rules they want followed β governance, security, standards β and the repository supplies the rest, verified.
Conversational always; the user approves every write.
Args: intent (setup | adopt | refresh | record | audit); a target repo or path; extra source paths or URLs.
Resolution rules
- Bare paths and
{skill-root}(e.g.references/best-practices.md) resolve from this skill's installed directory. {project-root}β the project working directory.- Target β the repository being described, defaulting to
{project-root}. If it resolves to more than one working tree, or to one the user cannot commit in, ask before writing.
On Activation
Resolve customization:
uv run {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --project-root {project-root} --key workflow.- Script not found: BMad is not set up here. Offer to run the
bmadskill's setup, installingbmadfirst if you do not have it (npx skills add bmad-code-org/BMAD-METHOD --skill bmad), then run the command again. - Any other failure: read
{skill-root}/customize.tomldirectly and use defaults.
Execute
{workflow.activation_steps_prepend}; treat{workflow.persistent_facts}entries as standing context (file:= paths/globs to load, others verbatim).- Script not found: BMad is not set up here. Offer to run the
Config: if
{project-root}/_bmadexists,uv run {project-root}/_bmad/scripts/resolve_config.py --project-root {project-root}and read{output_folder}. Standalone: skip.Load
references/best-practices.mdandreferences/template.mdbefore anything else. Every decision below is made against them.Detect intent and greet the user: setup (no instruction file in the target carries meaningful content β scaffolding alone, empty headings, a comment, a lone import line, is not meaningful; when unsure, adopt, since adopting a near-empty file costs one small ledger while setting up a meaningful one loses instructions), adopt (an instruction file has content but no managed block, whatever its state and whoever wrote it β the migration form of refresh; that file is the baseline and every instruction in it enters the ledger of step 1), refresh (a managed block exists), record (the user reports a mistake agents made), audit (re-verify and prune). A supplied intent that contradicts what detection finds β e.g.
setupagainst a file with content β is surfaced and confirmed, never silently obeyed. Fold{workflow.external_sources}into the source list. Execute{workflow.activation_steps_append}.
Setup, Adoption, and Refresh Steps
No writes until step 5!
1. Assess and report
Read AGENTS.md, harness or agent specific rule files, docs folders, and any notes carrying lessons. Report what exists and how it measures up, per best-practices.md.
Existing instructions are the baseline being improved, never raw material to discard. Open a ledger: one entry per existing section and per independently meaningful instruction, opened at retain or rewrite, carrying what an agent would get wrong without it. Entries settle as evidence arrives in steps 2β4 β retain | rewrite | relocate | automate | delete, each with its reason, its evidence, the risk if it goes, a destination for a relocation, and an approval flag. Deletion needs one of the four grounds in best-practices.md, and a relocation destination must itself be loaded or sit behind an observable trigger β a move into a file nothing reads is a deletion and needs its ground. Setup has nothing to map and opens no ledger; refresh opens entries for the lines it proposes to change or remove, the block's own included. A lesson found outside the instruction files β a warning in a README, a notes file β is an ordinary candidate, not a ledger entry.
If the target contains separable units β a workspace manifest listing members, or directories carrying their own build manifest β name them and ask whether this run covers the root only, all of them, or which. Absent that evidence, do not ask. Sibling repositories are not children; each is its own target, offered in turn.
2. Ask what they bring
Rules to follow regardless of what the repo does: governance, security and compliance, coding standards, style guides, frozen areas. Ask for outside documents too β handbooks, wikis, architecture docs, MCP knowledgebases. Note the
FAQ
Does it write changes without asking?
No. The skill says you approve every write.
What is a pitfall in this context?
A pitfall is a recorded agent mistake, so the instructions warn against it next time.
Can it audit existing instructions?
Yes. It has an audit mode that checks the current instructions.
Details
Original description by the author
Set up, adopt, refresh, or audit a repository''s agent instructions (the AGENTS.md block) so AI agents work well in that repo. Also records observed agent mistakes as pitfalls. Use when invoked by name
Popularity
- GitHub stars
- 55k
- Ranking position
- #3358
- License
- β
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
bmad-advanced-elicitation
55kHelps your agent improve a draft by pushing it through critique methods and proposing one revision, which you can accept or reject.
bmad-agent-analyst
55kLets your agent act as Mary, a business analyst who handles market research, competitive analysis, and turns vague needs into clear requirements.
bmad-agent-architect
55kLets your agent act as Winston, a system architect who turns requirements into practical technical designs and explains the trade-offs.
bmad-agent-dev
55kLets your agent act as Amelia, a senior software engineer who builds approved user stories with test-first steps and checks each acceptance criterion.
Similar skills
writing-skills
311kTeaches your agent to write new skills and test each one first, checking that the skill actually changes how the agent behaves.
writing-for-agents
310kExplains how to write clear instructions for AI agents, including skills, AGENTS.md, and CLAUDE.md files, so the agent behaves predictably.
bengali-nlp
280kHas your agent process Bengali text. It helps understand and work with the language, normalizing text and handling its unique characteristics.