Skip to content
Agentmart
Submit a tool

aide-agents-md

The AIDE pattern for session-scoped, workspace-scoped, and user-scoped agent instructions — the AGENTS.md (and equivalent) file convention.

Skill by AnonymousNomad

IndexedApache-2.0★ 53
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/anonymousnomad-aide-agents-md

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

The AIDE pattern for session-scoped, workspace-scoped, and user-scoped agent instructions — the AGENTS.md (and equivalent) file convention. Use when implementing the AIDE analog of Claude Code's CLAUDE.md, Cursor's Rules, Aider's conventions file, or Cline's Memory Bank. Use when the user asks "make AIDE always do X" or "this project uses tabs, never spaces" or "when I say commit I mean signed". Use when reviewing the prompt composition for the chat path.

Use cases: agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/aide-agents-md

What's inside

Skill name
aide-agents-md
Description
The AIDE pattern for session-scoped, workspace-scoped, and user-scoped agent instructions — the AGENTS.md (and equivalent) file convention. Use when implementing the AIDE analog of Claude Code's CLAUDE.md, Cursor's Rules, Aider's conventions file, or Cline's Memory Bank. Use when the user asks "make AIDE always do X" or "this project uses tabs, never spaces" or "when I say commit I mean signed". Use when reviewing the prompt composition for the chat path.
License
Apache-2.0
Instructions
219 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • files: referenced but missing: scripts/aide-bundle.cjs

Files (1)

  • SKILL.md

SKILL.md (first lines)

# AGENTS.md — Persistent Agent Instructions, Scoped Three Ways

Born 2026-08-31 from the wiring audit. AIDE has `harness/credo.md` (the global credo) and `aide-advanced-orchestration` Pattern 5 (AGENTS.md export) but the **load order, scoping rules, and edit UX** are not specified or wired. Every rival (Claude Code, Cursor, Cline, Copilot, Aider) has this. AIDE's version is "the credo is global, period" — too coarse. This skill IS the wire-in.

## The AIDE AGENTS.md contract (3 scopes, 1 precedence)

```
Priority (highest to lowest):
1. SESSION scope:    .aide/agents/session.md       (ephemeral, current session only)
2. WORKSPACE scope:  <workspace>/AGENTS.md         (committed, project-wide)
3. USER scope:       ~/.aide/agents/user.md        (cross-workspace, operator's preferences)
4. GLOBAL scope:     harness/credo.md              (the oath, non-overridable)
```

**Why 4 levels, not 3:** the global credo is **non-overridable** by the other three. It's the oath. The other three are preferences layered on top.

**The "non-overridable" rule:** the credo defines the oaths (protect user, evidence over confidence, etc.). Workspace AGENTS.md can ADD constraints ("always run tests before commit") but cannot REMOVE an oath. A diff that conflicts with the credo is rejected with `OATH_CONFLICT`.

## Files to touch (when wiring)

| File | Change |
|---|---|
| `node/src/services/agent-instructions.mjs` | NEW: `loadInstructions({workspace, userHome, sessionId})` returns the merged, deduplicated, oath-checked instruction set. |
| `node/src/services/scaffold.mjs` | EXTEND: `composeScaffold` calls `loadInstructions` and prepends the merged set to the system prompt. |
| `node/src/routes/agent.ts` (or new `node/src/routes/instructions.ts`) | ADD: `GET /api/instructions` (show merged), `PUT /api/instructions/scope/:scope` (edit one scope), `GET /api/instructions/scopes` (list all 4). |
| `common/contracts/agent.ts` or new `common/contracts/instructions.ts` | ADD: the 4 zod schemas. |
| `node/src/server.ts` | Wire the routes. |
| `tests/arch/agents-md.test.ts` | NEW: 5 tests (scope precedence, oath conflict, dedup, session expiry, edit UX). |
| `scripts/aide-bundle.cjs` | (optional) `bundle instructions` CLI. |
| `browser/src/...` | (optional) "Edit workspace instructions" UI in the settings panel. |

## The contract (zod-strict)

```ts
// in common/contracts/instructions.ts

export const InstructionScope = z.enum(['session', 'workspace', 'user', 'global']);

export const InstructionEntry = z.object({
  scope: InstructionScope,
  path: z.string(),       // file path for verification
  body: z.string(),
  lines: z.number().int().gte(0),
  modified_at: z.number().int(),
  oath_check: z.enum(['pass', 'fail', 'unknown']).default('unknown'),
  oath_conflict: z.string().nullable().optional()
}).strict();

## The load + merge algorithm

```js
// node/src/services/agent-instructions.mjs
import { promises as fs } from 'node:fs';
import path from 'node:path';
import os from 'node:os';

const OATHS = [
  'protect the user and their data',
  'evidence over confidence',
  'finish the procedure',
  'preserve the workspace',
  'carry knowledge forward'
];

const SCOPE_PATHS = {
  global:    'harness/credo.md',
  workspace: 'AGENTS.md',
  user:      path.join(os.homedir(), '.aide', 'agents', 'user.md'),
  session:   path.join('.aide', 'agents', 'session.md')
};

export async function loadInstructions({ workspace, sessionId }) {
  const entries = [];
  const conflicts = [];
  for (const [scope, relPath] of Object.entries(SCOPE_PATHS)) {
    const absPath = scope === 'user' || scope === 'global' ? relPath : path.join(workspace, relPath);
    let body;
    try { body = await fs.readFile(absPath, 'utf8'); }
    catch (e) {
      if (e.code === 'ENOENT') continue;
      throw e;
    }
    const oathCheck = checkOaths(scope, body);
    const entry = {
      scope, path: absPath, body,
      lines: body.split('\n').length,
      modified_at: (await fs.stat(absPath)).mtimeMs,
      oath_check: oathCheck.status,
      oath_conflict: oathCheck.conflict
    };
    entries.push(entry);
    if (oathCheck.status === 'fail') {
      conflicts.push({ scope, path: absPath, snippet: oathCheck.snippet, conflicting_oath: oathCheck.oath });
    }
  }
  const merged = entries
    .sort((a, b) => orderByScope(a.scope) - orderByScope(b.scope))
    .map(e => '# [' + e.scope + ']\n' + e.body)
    .join('\n\n');
  return { merged, entries, conflicts };
}

function orderByScope(scope) {
  return { global: 0, user: 1, workspace: 2, session: 3 }[scope];
}

function checkOaths(scope, body) {
  const violations = [

## The scaffold integration

```js
// in harness/scaffold.mjs:
import { loadInstructions } from '../node/src/services/agent-instructions.mjs';

export async function composeScaffoldWithInstructions({ workspace, effectiveContextTokens, taskFamily, sessionId }) {
  const baseScaffold = composeScaffold({ effectiveContextTokens, taskFamily });
  const instructions = await loadInstructions({ workspace, sessionId });
  const header = '[AIDE instructions | ' + instructions.entries.length + ' scope(s) loaded]';

From AnonymousNomad/covert-coder, Apache-2.0.

More from AnonymousNomad/covert-coder

Signals

Stars
53
Forks
15
Open issues
2
Last commit (this folder)
Aug 31, 2026 (1 month ago)
Last release
Aug 10, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from AnonymousNomad

Cite this page

aide-agents-md skill. Agent Mart. https://agentmart.dev/skills/anonymousnomad-aide-agents-md (last updated 2026-10-24)