Skip to content

ai.json Reference

ai.json is the single configuration file that aix uses to sync your AI editor settings. It supports JSONC (comments and trailing commas).

ai.lock.json is an optional sibling file for ai.json. Create or refresh it with:

Terminal window
aix validate --lock

When ai.lock.json exists, aix reads it automatically. If the resolved config digest no longer matches, aix stops and asks you to refresh the lockfile. This catches edits to ai.json, inherited configs, local overrides, and resolved entities before aix writes editor files.

The lockfile stores SHA-512 integrity strings and SHA-256 digests for config entities such as skills, rules, prompts, MCP servers, hooks, and editor settings. Hashes prove the content matches the lockfile. They do not prove publisher identity.

Add the $schema field for IDE autocompletion and inline validation:

{
"$schema": "https://x.a1st.dev/schemas/v1/ai.json"
}
FieldTypeDescription
$schemastringJSON Schema URL for IDE validation
scopestring"project" (default) or "user". Sets whether this is a project or user config
extendsstring | string[]Inherit from other configs
skillsobjectMap of skill names to skill references
mcpobjectMap of server names to MCP server configs
rulesobjectMap of rule names to rule definitions
promptsobjectMap of prompt names to prompt definitions
agentsobjectMap of agent names to agent definitions
editorsobject | string[]Editor targeting and editor-specific settings
hooksobjectLifecycle hooks for AI agent events
aixobjectaix tool settings (cache, backups)

Sets whether this config manages project-level or user-level AI configuration. Defaults to "project" when omitted.

{
"scope": "user"
}

When scope is "user", aix writes to user-level editor config locations (e.g., global MCP settings). When "project" (or omitted), aix writes to project-local config files.


Inherit from other configurations. Supports a single string or an array. Configs are resolved and deep-merged in order — later entries override earlier ones.

{
"extends": "github:company/ai-config"
}
{
"extends": ["@company/aix-base", "github:team/project-overrides", "./local-overrides.json"]
}

Source types:

  • npm package: "@company/aix-config" or "aix-config-react"
  • Git shorthand: "github:user/repo", "gitlab:org/repo#v2.0"
  • URL: "https://raw.githubusercontent.com/..."
  • Local path: "./configs/base.json"

See Config Inheritance for merge semantics.


Map of skill names to skill references. Skill names must be lowercase alphanumeric with hyphens (max 64 characters). See Skills for the full concept.

{
"skills": {
"react": "aix-skill-react",
"custom": "./skills/custom",
"remote": "github:user/skills#v2.0:skills/react"
}
}
{
"skills": {
"react": {
"source": {
"git": "https://github.com/user/repo",
"ref": "v2.0",
"path": "skills/react"
},
"enabled": true,
"config": {
"framework": "nextjs"
}
}
}
}
{
"skills": {
"inherited-skill": false
}
}

Map of server names to MCP server configurations. See MCP Servers for the full concept.

{
"mcp": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
},
"cwd": ".",
"shell": false
}
}
}
FieldTypeDefaultDescription
commandstringCommand to run
argsstring[][]Command arguments
envobject{}Environment variables. Use ${VAR} for shell expansion.
cwdstring.Working directory
shellbooleanfalseRun in a shell
{
"mcp": {
"remote-server": {
"url": "https://example.com/mcp",
"headers": {
"Authorization": "Bearer ${TOKEN}"
},
"timeout": 30000
}
}
}
FieldTypeDefaultDescription
urlstringMCP endpoint URL (Streamable HTTP)
headersobject{}Request headers
timeoutnumberConnection timeout in ms
validateOriginbooleantrueValidate server origin

These fields apply to both transport types:

FieldTypeDefaultDescription
enabledbooleantrueEnable/disable the server
toolsstring[] | objectTool access control. Array of allowed tool names, or { include: [], exclude: [] }.
disabledToolsstring[]Tool names to disable
resourcesstring[] | objectResource access control. Array of allowed patterns, or { include: [], exclude: [] }.
autoStartbooleantrueStart with editor
restartOnFailurebooleantrueAuto-restart on crash
maxRestartsnumber3Max restart attempts
{
"mcp": {
"inherited-server": false
}
}

Map of rule names to rule definitions. See Rules.

{
"rules": {
"code-style": "./rules/style.md",
"remote-rule": "github:company/rules#main/typescript.md"
}
}
{
"rules": {
"code-style": {
"activation": "always",
"content": "Always use TypeScript strict mode."
},
"testing": {
"activation": "glob",
"globs": ["**/*.test.ts", "**/*.spec.ts"],
"path": "./rules/testing.md"
},
"security": {
"activation": "auto",
"description": "Apply when working on authentication or authorization code.",
"path": "./rules/security.md"
}
}
}
FieldTypeDefaultDescription
activationstring"always""always", "auto", "glob", or "manual"
descriptionstringWhen the rule applies (required for "auto" mode)
globsstring[]File patterns (required for "glob" mode)
contentstringInline rule text
pathstringPath to a markdown file
gitobject{ url, ref, path } for git-hosted rules
npmobject{ npm, path, version } for npm-hosted rules

One source field (content, path, git, or npm) is required.


Map of prompt names to prompt definitions. See Prompts.

{
"prompts": {
"review": "./prompts/review.md",
"plan": "./prompts/plan.md"
}
}
{
"prompts": {
"review": {
"description": "Review code changes for quality issues",
"argumentHint": "[file] [message]",
"path": "./prompts/review.md"
}
}
}
FieldTypeDescription
descriptionstringShown in the editor’s command picker
argumentHintstringHint for arguments (e.g., "[file] [message]")
contentstringInline prompt text
pathstringPath to a markdown file
gitobject{ url, ref, path } for git-hosted prompts
npmobject{ npm, path, version } for npm-hosted prompts

Map of specialized agent names to agent definitions. See Agents.

{
"agents": {
"code-reviewer": "./agents/code-reviewer.md"
}
}
{
"agents": {
"code-reviewer": {
"description": "Review code changes",
"mode": "subagent",
"model": "sonnet",
"tools": ["Read", "Grep"],
"permissions": {
"edit": "deny"
},
"content": "Review the current diff."
}
}
}
FieldTypeDescription
descriptionstringWhen the editor should use the agent
modestring"primary" or "subagent"
modelstringEditor model alias or model ID
toolsarrayTool names available to the agent
permissionsobjectPortable allow, ask, or deny capability policies
mcpobjectMCP servers available to this agent when supported
contentstringInline agent instructions
pathstringPath to a markdown file
gitobject{ url, ref, path } for git-hosted agents
npmobject{ npm, path, version } for npm-hosted agents
editorobjectEditor-specific fields keyed by editor ID for round-trip safety

Configure which editors to install to and provide editor-specific settings.

{
"editors": ["cursor", "copilot", "claude-code", "opencode"]
}
{
"editors": {
"cursor": {
"enabled": true,
"rules": {
"cursor-only": {
"content": "Cursor-specific instructions here"
}
},
"aiSettings": {}
},
"windsurf": {
"enabled": true,
"cascadeSettings": {}
},
"claude-code": {
"enabled": true,
"permissions": {}
},
"opencode": {
"enabled": true
}
}
}

If editors is omitted, aix auto-detects installed editors at install time. See Editor Configuration.


Lifecycle hooks for AI agent events. See Hooks.

{
"hooks": {
"session_start": [
{
"matcher": ".*",
"hooks": [
{
"command": "echo 'Session started'",
"timeout": 5,
"show_output": true
}
]
}
]
}
}

Settings for the aix tool itself. These don’t affect AI editor behavior.

{
"aix": {
"cache": {
"maxBackups": 5,
"maxBackupAgeDays": 30,
"maxCacheAgeDays": 7
}
}
}
FieldTypeDefaultRangeDescription
cache.maxBackupsnumber51–100Max backup files to keep
cache.maxBackupAgeDaysnumber301–365Max backup age before cleanup
cache.maxCacheAgeDaysnumber71–365Max cache age before cleanup