AI Tuning

Templates and rules for AGENTS.md, coding agents, and content-author AI

Introduction

This page explains how to work effectively with modern AI coding tools such as Cursor, Windsurf, GitHub Copilot, Claude Code, Open Code, etc., and agent-style editors.

As AI-assisted programming evolves, prompts should become more concise rather than longer. The objective is not to create an extensive prompts, but to provide the model with a clear operating contract, the relevant and condensed project context, and a repeatable verification workflow. Use this page as source material for repo-level instruction files. Copy the templates into your project; do not mix them.

We got you covered

The Boilerplate app already ships with the important agent files: root AGENTS.md, nested content/AGENTS.md, and the skills under .agents/skills/. If you started from the Boilerplate, you do not need to recreate them - review and adjust what is already there. The templates on this page are for apps created from scratch, or for checking that your copies still match the current contract.

DocLayer content is read by three different AI surfaces. Keep their setup separate:

  1. Coding agents working on app or module code - this page, AGENTS.md, and skills.
  2. Content authors writing Markdown with an editor - nested content/AGENTS.md.
  3. In-app assistant and external LLMs - DlPrompter, Search, and llms.txt. Configure those elsewhere; link them from here.

Use the AGENTS.md template below for any project that consumes @vuehouse/dl, including the Boilerplate app.

Then add the content-author contract under content/ directory (DocLayer-based apps only), if your intention is to have people writing any type of content.

Important note

Good AI instructions are usually short and scoped. Do not dump every project detail into every chat. Always try to give the model rules and files it needs for the current task, ask it to not inspect too deeply if not necessary.

AI agents are good at reading and understanding codebase context. Avoid providing everything at once or starting with overly broad rulesets. Instead, add instructions incrementally and evaluate the results step by step.

Mental model

Modern AI-based coding tools are no longer just chatbots. Many can inspect files, run commands, apply patches, and verify when done. This changes how instructions should be written. Now, context is the most important resource.

You should prefer this mental model (the agent should):

  • inspect before editing,
  • start from the named files, then search and follow imports,
  • patch, never rewrite, unless it's explicitly requested,
  • state uncertainty clearly instead of guessing,
  • verify after each logical change,
  • stop before destructive or high-cost actions, unless you asked.

Don't be lazy, don't be inert!

Stay actively in control: let the agent do the work, but make the key decisions. Apply judgment, review skeptically, think critically. Always ask if something's unclear or uncertain. Always be hungry for knowledge.

Instruction hierarchy

When working with coding agents, provide instructions in a layered manner, starting from the most global to the most specific. This is better than repeating long prompts in every chat. Below is the recommended order. Skills load on demand; they are not a substitute for a short AGENTS.md.

  1. Editor or user-level rules (personal preferences only).
  2. Repository-level AGENTS.md.
  3. Nested AGENTS.md in a subdirectory.
  4. Optional editor-specific adapters.
  5. Skills, loaded on demand.
  6. Task-specific user request.
  7. Nearby code, context-specific files, and existing examples.

Root AGENTS.md should point at skills, but only as an index: the skills folder (.agents/skills/, .cursor/skills/, or your editor’s equivalent), plus the skill name and when to use it. Do not copy the full SKILL.md text into AGENTS.md — that defeats on-demand loading and bloats every chat.

Agent workflow

Ask the agent to follow this workflow for any non-trivial coding task. These can serve as general rules across projects. Improve if needed.

1. Discover and read relevant instruction files first: `AGENTS.md`, nested `AGENTS.md`, and any matching skill.2. Start from the files named in the task. Then search and follow imports as needed. Do not explore unrelated packages or apps.3. Read the relevant code and content files, including an existing example if the task is to write content.4. Restate the task, scope, and assumptions.5. Propose the smallest valid change set.6. Apply minimal edits with focused patches.7. Verify with the narrowest command that is not a production build. Do not run `pnpm build` or `pnpm docs:build`.8. If tests are needed, use one Node process and close it before starting another.9. If a new file or directory seems required, ask first.10. Always explain new concepts, patterns, approaches or ideas.11. Report:    - what changed,    - which files changed,    - what was verified,    - what remains unverified,    - any risks or assumptions.

This workflow usually produces better results than open-ended prompts like “fix this page” or “improve the docs”. It also works well as a baseline editor-specific ruleset.

Consumer app

These templates apply to any DocLayer consumer: a Nuxt app that extends or installs @vuehouse/dl, including the Boilerplate. Copy or compare against the agent files in your project root.

# About DocLayerDocLayer is a content framework for documentation sites and blogs. Authors write Markdown; the module turns that into a themed app with navigation, layout, and `Dl*` content components.It is built on Vue, Nuxt, Nuxt Content, and Nuxt UI. The published module is `@vuehouse/dl`. Product docs: https://doclayer.dev/docsThis repository is a standalone boilerplate that consumes `@vuehouse/dl`. Prefer existing module primitives over local replacements. Do not treat this repo as the module source.## Agent rules- Treat `@vuehouse/dl` (`node_modules/@vuehouse/dl`) as the source of truth for theme, schema, utilities, and content components.- Configure the module before duplicating functionality locally.- Keep local overrides minimal and intentional.- Prefer existing content components over custom markup.- Avoid broad global style overrides unless necessary.- Keep changes scoped. Inspect nearby files before editing.- Start from the files named in the task, then search and follow imports. Do not explore unrelated files.- Patch, do not rewrite, unless a rewrite is requested.- If requirements are unclear, ask or stop instead of inventing behavior.- Ask before creating new files or directories.- Do not add one-off hardcoded workarounds, `node_modules` patches, or commented-out hacks.- Do not perform destructive git operations.## Where to look first- App content: `content/` (starter collection is `content/docs/`)- Content contract: `content/AGENTS.md`- App config: `app/app.config.ts` (main customization); `nuxt.config.ts` stays minimal- Env: `.env.example` (`DL_*` branding, SEO, search, and related settings)- Local styles: `app/assets/styles.css`- Local components: `app/components/` (custom content components go in `app/components/content/`)- Installed module: `node_modules/@vuehouse/dl/` (this app only ships `@vuehouse/dl`; do not assume optional add-ons)- Content component sources: `node_modules/@vuehouse/dl/dist/runtime/components/content/`- Writing guide: https://doclayer.dev/docs/guidelines/writing-content- Components index: https://doclayer.dev/docs/components- Utilities index: https://doclayer.dev/docs/utilities- Package manager: `pnpm`- On-demand skills: `.agents/skills/` (see ##Skills for details).## Commands- Dev: `pnpm dev`- Lint: `pnpm lint`- Build: `pnpm build`- Preview: `pnpm preview`- Do not run `pnpm build` to verify work.- When running tests, use a single Node process. Close it before starting another.## SkillsRead the matching `SKILL.md` from '.agents/skills/' when the task fits. Do not paste skill bodies into chat.- `write-doclayer-content-page` — create or edit Markdown in `content/`- `reuse-doclayer-content-component` — prefer existing `Dl*` components before custom markup- `create-doclayer-content-component` — new Vue content components in `app/components/content/`## Optimize for- Keep the app building cleanly with the module- Reuse module primitives before adding local abstractions- Keep edits easy to review

Content author mode

Regular users writing Markdown with an agent need a content contract, not a package map. Put this file at content/AGENTS.md so it applies when the agent is editing that tree. The Boilerplate already includes this file. Add it only if your app was not started from the Boilerplate. Do not put any code conventions here. Those belong in the root AGENTS.md for TypeScript work.

The extra project data that actually helps writers is voice, required MDC components, frontmatter, navigation, and pointers to real example pages. Do not dump Vue source paths or a rewrite of the Writing Content guide.

<!-- content/AGENTS.md --># Content author rulesDocLayer is a content framework on top of Vue, Nuxt, Nuxt Content, and Nuxt UI. Pages are Markdown rendered by `@vuehouse/dl`.Write for the readers of this site, not for people reading Vue source.## Voice:- Be precise and instructional. Prefer examples over theory.- Do not invent APIs, props, or components. Read the writing guide and an existing page first.## Where to look first:- Before writing or editing a page, read:  - https://doclayer.dev/docs/guidelines/writing-content,  - https://doclayer.dev/docs/components.- One existing page in the same collection.- For step-by-step page work, use the `write-doclayer-content-page` skill in `.agents/skills/` (see root `AGENTS.md`).## Hard rules:- Required frontmatter: `title`, `description`.- Put a `.navigation.yml` (`title`, `icon`) in each collection section (e.g. `content/docs/<section>/<page>.md`).- Always follow the `.markdownlint.js` rules.- Starter collection is `content/docs/`. Add `blog` or another collection only when asked.- Treat `content/docs/landing/index.md` as the landing page. It uses landing blocks; do not treat it like a normal docs page.- Nest at most two levels: `content/docs/section/page.md`.- Order files and folders with numeric prefixes (`01.`, `02.`); group by context with tenths (`10.`, `11.`, `20.`, `21.`).- Start in-page headings at `H2`. Keep hierarchy consecutive.- Always use `DlLink` for internal links (path map markers come from `app/app.config.ts` and `.nuxt/doclayer/path-map.json`); verify them.- Always wrap code samples in `DlCode`; never within the standalone backticks (```).- Use `DlCallout` for notes (`note` for internal tips, `info` for general knowledge, `warning` for risk).- Use `DlTooltip` for short inline definitions.- Use `DlRenderer` for repeated Markdown snippets, located within the `content/_shared` directory; prefer using/creating them; verify names.- Use `DlPrompter` for hidden synonyms and assistant recall. Do not put secrets there.- Use `pnpm` to define commands.## Optional rules:- If a DocLayer component already covers the need, use it. Do not drop to raw HTML or ad-hoc Markdown layouts.- Verify in the running app (`pnpm dev`).- Check heading hierarchy, sidebar order, links and its structure, callout types, and that no required component was replaced with raw markup. Do not run `pnpm build` to verify.

Skills

Finally, keep deeper procedures in SKILL.md files. This is how different AI agents load them (double-check preferred tool documentation for details):

  • Cursor: .cursor/skills/<name>/SKILL.md,
  • Claude Code: .claude/skills/<name>/SKILL.md,
  • other agents: .agents/skills/, or skills/ directories.

Do not use a single SKILLS.md dump (all in one file). The agent should see only the skill name and description until the task matches.

The DocLayer Boilerplate already includes these skills. Copy them only if your app was not started from it. Omit disable-model-invocation so they can load when the description matches.

---name: write-doclayer-content-pagedescription: Write or edit DocLayer Markdown content pages using MDC components, frontmatter, navigation.yml, and existing pages as examples. Use when creating, updating, or restructuring docs, blog, or landing Markdown in content/.---# Write a DocLayer content pageRead first:- `content/AGENTS.md`,- https://doclayer.dev/docs/guidelines/writing-content,- https://doclayer.dev/docs/components,- one (or more) existing page(s) in the same collection.Then:1. Reuse `DlCode`, `DlCallout`, `DlLink`, `DlTooltip`, `DlImage`, `DlStepper`, `DlPrompter`, `DlRenderer` as documented.2. The landing page is `content/docs/landing/index.md` and may also use `DlHero`, `DlHeading`, `DlFeaturesGrid`, `DlNewsletter`, `DlTypeman`. Do not treat it like a normal docs page.3. Stay in `content/docs/` unless asked to add another collection.4. Always try to reuse the shared Markdown components from the `_shared` directory; render them with `DlRenderer`.5. Copy structure from a nearby page instead of inventing a new layout.6. Do not guess props. Open the component docs, or the Vue source in `node_modules/@vuehouse/dl/dist/runtime/components/content/` only if the docs page is not enough.7. Add `DlPrompter` phrases for questions a reader would actually ask.8. Keep frontmatter to `title` and `description` plus `_local` when page-scoped data is needed.9. When styling inside the table, and rules should propagate for the whole table (e.g. cell `min-width`), apply CSS only for the first row and the first column, as it propagates to the rest of the table.10. Report which example page you copied and what remains unverified in `pnpm dev`. Do not run `pnpm build`.11. Never write:    - `~` or `@` characters for relative paths (aliases),    - HTML like characters like: →, …, etc. (not allowed in comments, use native characters instead).
---name: reuse-doclayer-content-componentdescription: Reuse components instead of adding local HTML or Vue replacements. Use when the task involves Dl* components, custom content components, slots, props, or styling content blocks.---# Reuse a DocLayer content componentRead first:- `content/AGENTS.md`,- https://doclayer.dev/docs/guidelines/writing-content.Before adding custom markup or a local component, check:1. Does DocLayer already provide this pattern? See https://doclayer.dev/docs/components2. Can the result be achieved through props, slots, or content structure?3. Is the requirement truly app-specific?4. Would a local implementation create duplication or drift?When a local component is required:- Ask before creating the file.- Keep overrides local and minimal.- Do not duplicate module behavior in the app.- Do not guess props, slots, or supported patterns. Read the source:  - `node_modules/@vuehouse/dl/dist/runtime/components/content/`- Inspect current usage in `content/` before inspecting module internals.If reuse is possible, prefer the existing DocLayer component. If module behavior is unclear, report uncertainty, keep the change small, and ask before inventing a solution.
---name: create-doclayer-content-componentdescription: Create a new custom Vue content component for this DocLayer app using DlWrapper and defineDoclayerComponentUi, and put it in app/components/content/. Use when adding a block or inline MDC component, extending content presentation, or building on DlWrapper instead of raw HTML in Markdown.---# Create a DocLayer content componentRead first:- `AGENTS.md` and `content/AGENTS.md`,- https://doclayer.dev/docs/components (restricted names),- https://doclayer.dev/docs/components/building,- the nearest existing component in `node_modules/@vuehouse/dl/dist/runtime/components/content/` or `app/components/content/` (if available).Before writing code:1. Run the reuse check from `reuse-doclayer-content-component`. Do not add a component if a built-in `Dl*` block already fits.2. Ask before creating a new file or directory.3. Do **not** use a reserved `Dl*` name. Built-in names always win. Use your own PascalCase filename under `app/components/content/` (MDC resolves it as kebab-case, for example `MyComponent.vue` > `::my-component`). Built-in module components live under `node_modules/@vuehouse/dl/dist/runtime/components/content/`.4. Do **not** use `DlWrapper` directly in Markdown. It is only a foundation inside Vue SFCs.Implementation checklist:1. Add `app/components/content/<ComponentName>.vue` for app-specific blocks. Do not edit or extend the installed module.2. Follow SFC order: `<script lang="ts">` (UI macro) > `<script setup lang="ts">` > `<template>` > `<style>` (scoped).3. Define UI with `defineDoclayerComponentUi`, props with `UiProps<typeof ui>`, defaults with `ui` in `withDefaults`.4. Wrap markup in `DlWrapper`, pass `:ui="resolvePropsUi(props)"` from `useComponentUi()`, and bind classes from the slot (`$ui.<part>.base`).5. Keep `ui` internal. Content authors override styling via `#ui` (block) or `:iui` (inline) in Markdown, not via ad-hoc props unless the component needs them.6. Use utilities or composables only if necessary or asked.7. Match code style, import order, and JSDoc rules from root `AGENTS.md` when editing TypeScript.After implementation:1. Use the component once in `content/` with a minimal example (block or inline, matching the component type).2. If the component is user-facing, add or extend a docs page under `content/`, only when asked.3. Verify in `pnpm dev` (layout, `#ui` / `:iui`, default slot). Do not run `pnpm build`.

Change paths accordingly to the context of the app and agent setup.

You can also keep these concise behavior rules next to the skills, as they apply directly to content work. Treat them as a skill too.

## Agent behavior for component work- Inspect current usage in the app before inspecting module internals.- Reuse DocLayer components when they fit the requirement.- Keep overrides local and minimal.- Do not duplicate component behavior in the app unless necessary.- Do not guess props, slots, or supported patterns from memory. Read from the source.- If module behavior is unclear, report uncertainty, keep the change small, and ask before inventing a solution.

Docs as an interface

DocLayer pages are not only human docs. They are also the interface for agents and assistants. Do not mix those setups in one file.

SurfaceWhat to addWhere it lives

Coding agents

Short AGENTS.md, nested content/AGENTS.md, on-demand skills.

This page

In-app assistant

Hidden synonyms and recall phrases via DlPrompter.

The content page itself; model setup on Search.

External LLMs

Build-time llms.txt via dl.llms / Nuxt LLMs.

Internals and Configuration

Definition of done

A coding task is not complete when the edit is written. It is complete when the result is explained and verified. Ask the agent to finish with:

  • a short summary of what changed,
  • the list of changed files,
  • the result of that verification,
  • any remaining risks, assumptions, or unverified behavior.

For content work, also confirm heading hierarchy, sidebar order, links, and that no required DocLayer component was replaced with raw markup. Always verify in the running app, not with a production build.