AI coding standards

AI coding guidelines template for engineering teams

A useful AI coding policy should make everyday engineering decisions easier. It should tell people and agents which work is appropriate, which context is authoritative, how output is verified, and when a human must take over. This template gives a small team a practical starting point without pretending one file can replace security, privacy, or legal review.

Publisher
Skills Board
Published
Updated

Core principle

Keep universal rules short. Put detailed procedures in focused, testable playbooks.

Quick answer

Effective AI coding guidelines separate short, universal boundaries from repository context and task-specific playbooks. Define permitted work, authoritative context, verification, human handoffs, and ownership. Then test the guidance on real work; one policy file cannot replace security or review.

The problem behind the query

Teams often jump from individual experimentation to one large policy document. The document mixes security boundaries, coding style, tool setup, prompts, and review advice until nobody knows which rule applies to the task in front of them. A layered model works better: stable boundaries for every workflow, repository or path instructions for local context, and focused playbooks for repeated tasks.

01 / Decision

Separate guidance from enforcement

An instruction can shape behavior, but it does not guarantee compliance. Put conventions in readable guidance, encode objective invariants in automated checks, and use real permissions or sandboxing when an action must be impossible.

LayerUse it forWhat it cannot do alone
Markdown instructionsPurpose, conventions, trusted context, commands, examples, and task-specific guidance.Prevent a forbidden tool call, data transfer, or destructive action with certainty.
Automated checksTests, linters, type checks, policy checks, and other objective repository invariants.Judge requirements, intent, or risks that the team has not encoded into the check.
Access controlsTool permissions, protected branches, sandbox boundaries, secrets, and production access.Teach the agent how to complete an allowed workflow well or verify its output quality.

02 / Workflow

Build the guidelines in six passes

Start from a real workflow and the failures you need to prevent. The first version should be short enough to test this week and explicit enough that a teammate can tell when to stop.

  1. 01

    Set the non-negotiable boundaries

    List prohibited data, destinations, credentials, production actions, and legal or security decisions. Name the approved escalation path. Do not hide these boundaries inside a general style guide.

    Output: A short boundary section reviewed by the people who own security, privacy, and production access.

  2. 02

    Separate guidance by scope

    Keep rules that apply everywhere at the organization or repository level. Put directory-specific architecture notes near the relevant code, and move detailed task procedures into focused playbooks or skills.

    Output: A small map showing which instruction source owns each kind of decision.

  3. 03

    Define the task contract

    For each repeated workflow, state the trigger, required inputs, expected output, allowed tools, and definition of done. A task contract is more actionable than a collection of prompt tips.

    Output: One repeatable task with observable inputs, outputs, and stop conditions.

  4. 04

    Name authoritative context

    Point to the current architecture notes, conventions, examples, commands, and source files the agent should trust. Prefer links and scoped references over copying large documents into every instruction file.

    Output: A minimal context pack with a canonical source and owner.

  5. 05

    Make verification and handoff explicit

    List the checks the agent can run, the evidence it must report, and the decisions a human still owns. Require a stop when permissions, requirements, sensitive data, or destructive effects are unclear.

    Output: A verification checklist plus an unambiguous human handoff rule.

  6. 06

    Test, publish, and assign an owner

    Run the same representative fixture with the intended tools and a teammate who did not write the guidelines. Fix ambiguous instructions, publish the working version, and define the events that trigger review.

    Output: A reproducible result, named owner, review date, and change trigger.

Make the recommendation findable

Skills Board keeps the source, install path, notes, and team recommendation in one searchable library.

It does not pin or control upstream files or silently synchronize every agent. Your team sees the source, chooses the path that fits each setup, and re-reviews upstream changes.

03 / Record

A copyable AI coding guidelines template

Replace the brackets with your team’s reality. Delete sections that do not change a decision, and link repeated procedures to focused playbooks instead of expanding this file indefinitely.

Purpose and scope
Who and which repositories or workflows these guidelines cover.
Allowed work
Tasks agents may perform and the permissions each task can use.
Data boundaries
Secrets, personal data, customer data, and destinations that are prohibited or restricted.
Authoritative context
Canonical conventions, architecture notes, commands, examples, and owners.
Verification and handoff
Required checks, evidence, stop conditions, and decisions reserved for humans.
Ownership
Maintainer, review date, and events that require the guidelines to be tested again.

Copyable starting point

# AI-assisted development guidelines

Owner: [team or person]
Applies to: [repositories, paths, and workflows]
Last reviewed: [date]

## 1. Allowed work
- Agents may: [approved tasks]
- Agents may use: [approved tools and access]
- A human must approve: [decisions or effects]

## 2. Data and access boundaries
- Never provide: [secrets, personal data, customer data]
- Never send data to: [prohibited destinations]
- Stop when: [permission or identity is unclear]

## 3. Authoritative context
- Repository guidance: [canonical file or URL]
- Architecture and conventions: [canonical sources]
- Commands and fixtures: [tested sources]

## 4. Working rules
- Inspect the relevant code and instructions before editing.
- Keep changes inside the requested scope.
- Do not invent requirements, APIs, metrics, or compatibility claims.
- Report assumptions and conflicts before they affect the result.

## 5. Verification
- Run: [tests, type checks, linters, or review fixture]
- Confirm: [security, privacy, performance, or product checks]
- Report: [evidence required with the handoff]

## 6. Stop and hand off
Stop when the task requires [production access, destructive action,
unclear authority, sensitive data, or another team-owned decision].
Escalate to: [role or team]

## 7. Reusable workflows
For each repeated task, link one focused playbook or skill with its
trigger, inputs, output, tools, checks, canonical source, and owner.

## 8. Review triggers
Test these guidelines again when [tool, model, repository architecture,
permissions, regulation, or repeated failure] changes.

04 / Pitfalls

What makes guidelines fail

Turning policy into security theater

A long list of warnings is not a control. Bind sensitive actions to real permissions, protected data paths, verification, and a named escalation owner.

Loading every rule into every task

Universal instructions should stay short. Path-specific context and task-specific playbooks reduce noise and make conflicts easier to find.

Assuming one file works in every agent

Instruction locations and supported features vary by product and surface. Keep the team rule canonical, then document and test each actual agent path.

Publishing rules nobody has reproduced

A plausible guideline is still a hypothesis. Run a representative fixture and ask a second person to follow it before treating it as the team workflow.

05 / Checklist

Ready to share with the team?

  • The guidelines name their owner, scope, and review trigger.
  • Sensitive data, access, and prohibited actions are explicit.
  • Organization, repository, path, and task guidance are kept separate.
  • Each repeated workflow has a trigger, expected output, and stop condition.
  • Verification requires observable checks and a truthful handoff.
  • A second teammate reproduced the workflow with the intended agent path.

Primary sources

Editorial method: Skills Board synthesizes the first-party and standards sources cited below into a practical workflow. Product behavior can change, so verify the linked sources before rollout.

More resources

Keep exploring

View all resources

Give the next teammate one trusted place to start.

Save the reviewed skill, document the path that works, and keep the recommendation visible to the whole team.