Configuration
Project Command Catalog
ai-factory commands
ai-factory commands . packages/api packages/web --json
ai-factory commands --mapping tools/project.json --json
Это read-only catalog, а не runner. Он работает без установки/configuration AI Factory в проекте. Читает только scripts из package.json и composer.json в явно выбранных каталогах (default: project root), локальное package-manager evidence и необязательный явно выбранный JSON mapping.
Существующие Make/Task/just source files хешируются без parsing или выполнения recipes. Рекурсивное раскрытие workspace globs, выполнение Make/Task/just, project imports, plugins, lifecycle hooks и probes --help не выполняются.
CLI пропускает extension command imports на этом route, включая собственный help. Существующие workflows сохраняются.
Для Node scripts явный packageManager или одно однозначное локальное lock-file family выбирает npm/pnpm/yarn/bun. Неизвестные managers, конфликтующие lock families, нечитаемое evidence, неподдерживаемые script values и duplicate JSON keys остаются unresolved. Явный manager, конфликтующий с lock family, также остаётся unresolved. Composer string/array declarations каталогизируются без раскрытия references, callbacks, hooks или external code. Проверка доступности executable/tool не подразумевается.
Оба варианта output содержат одни versioned data:
| Field | Значение |
|---|---|
schema_version |
Сейчас 1 |
revision_sha256 |
Привязывает все read/missing/unresolved source records, включая runner evidence и поддерживаемые recipe-file fingerprints |
commands[].id / name / kind |
Точная declaration identity, script label и вид источника package/composer/mapping |
cwd |
Working directory относительно project root (. для корня), нормализован в forward slashes |
source.path / sha256 / pointer |
Исходное source location, точная byte revision и JSON pointer; неподдерживаемые names используют unresolved ordinal identity |
argv |
Структурированные invocation tokens либо null для unresolved/withheld; никогда не shell-escaped command string |
inputs |
Явные mapping input names либо null, если неизвестны; input values не собираются |
output_mode |
Объявленный human / json из mapping, иначе unknown |
status / reason |
declared или unresolved с ограниченным reason code |
verification / effects |
Всегда not_run / unknown; declarations не могут заявлять observed success |
sources |
Read/missing/unresolved source records, включая recipe files, оставленные без parsing |
ambiguities |
Command IDs с одинаковым name и selection_required: true; default не выбирается |
Выбирайте точные ID и CWD, а не одно имя вроде test. Используйте project context или спросите пользователя, если подходят несколько definitions. Обновляйте выбор после изменения source hash, включая catalog revision_sha256; предыдущие selection/verification не могут молча переноситься на новые bytes.
Это declaration/evidence fingerprints, а не полный dependency graph: scripts, imports и external tools, вызываемые command, по-прежнему требуют независимого изучения и execution evidence.
Execution требует собственного существующего authorization и observed evidence. Catalog не предоставляет доступ к shell, network, production, commit или publishing.
Явные Project Mappings
Укажите в --mapping существующий project-owned JSON object с commands. Это может быть существующий metadata file с другими top-level fields; default mapping path, обязательного нового config file, schema key, generated registry или config rewrite нет. Примеры declarations для commands с неполным Make/Task/just/custom CLI discovery:
{
"commands": [
{ "name": "verify", "cwd": ".", "argv": ["make", "verify"], "inputs": ["TEST_FILTER"], "output_mode": "human" },
{ "name": "diagnostics", "cwd": "packages/api", "argv": ["node", "tools/project.mjs", "diagnose", "--json"], "output_mode": "json" }
]
}
Entries принимают только name, cwd, argv, inputs и output_mode; они не могут объявлять себя verified или переопределять автоматически обнаруженную command. Их identity включает mapping path и array index. Существующие project owners сохраняют ownership своих файлов; AI Factory читает их только при явном выборе.
Raw npm/Composer script bodies и посторонние manifest fields исключены, поэтому встроенные в эти bodies credentials не попадают ни в один output view. Mapping invocations с credential/authentication markers, URLs, shell substitutions или inline evaluation консервативно скрываются целиком (argv: null), а не частично редактируются. Command labels с явными credential-assignment markers также скрываются.
Это не универсальный secret detector: произвольные unlabeled literals невозможно классифицировать. Не храните literal secrets в mappings; используйте runtime environment/secret management и самостоятельно проверяйте скрытые invocation приватно перед разрешённым использованием.
Discovery принимает до 32 явных project-relative directories, 2,000 commands, 1 MiB на читаемый source и 8 MiB суммарно; limit/access/parse failures остаются видимыми в source records. Он отклоняет traversal, absolute/drive paths, symbolic links/junctions, non-regular sources и malformed/duplicate-key JSON.
Windows separators в relative paths нормализуются; invocation tokens не переписываются для другой OS. Workspace directories и inherited package managers не угадываются: перечислите directories и предоставьте local evidence либо explicit mapping. Неизвестные effects остаются неизвестными.
.ai-factory.json
{
"version": "2.8.0",
"agents": [
{
"id": "claude",
"skillsDir": ".claude/skills",
"agentsDir": ".claude/agents",
"installedSkills": ["aif", "aif-plan", "aif-improve", "aif-implement", "aif-commit", "aif-build-automation"],
"installedAgentFiles": [
"best-practices-sidecar.md",
"commit-preparer.md",
"docs-auditor.md",
"implement-coordinator.md",
"implement-worker.md",
"loop-critic.md",
"loop-evaluator.md",
"loop-invariant-prep.md",
"loop-orchestrator.md",
"loop-perf-prep.md",
"loop-planner.md",
"loop-producer.md",
"loop-refiner.md",
"loop-test-prep.md",
"plan-coordinator.md",
"plan-polisher.md",
"review-sidecar.md",
"review-validator.md",
"rules-sidecar.md",
"security-sidecar.md"
],
"mcp": {
"github": true,
"postgres": false,
"filesystem": false,
"chromeDevtools": false,
"playwright": false
}
},
{
"id": "codex",
"skillsDir": ".codex/skills",
"agentsDir": ".codex/agents",
"configFiles": ["config.toml"],
"installedSkills": ["aif", "aif-plan", "aif-implement"],
"installedAgentFiles": [
"best-practices-sidecar.toml",
"commit-preparer.toml",
"docs-auditor.toml",
"implement-coordinator.toml",
"implement-worker.toml",
"plan-coordinator.toml",
"plan-polisher.toml",
"review-sidecar.toml",
"review-validator.toml",
"security-sidecar.toml"
],
"installedConfigFiles": ["config.toml"],
"mcp": {
"github": false,
"postgres": false,
"filesystem": false,
"chromeDevtools": false,
"playwright": false
}
},
{
"id": "codex-app",
"skillsDir": ".agents/skills",
"installedSkills": ["aif", "aif-plan"],
"mcp": {
"github": true,
"postgres": false,
"filesystem": true,
"chromeDevtools": false,
"playwright": true
}
},
{
"id": "antigravity",
"skillsDir": ".agents/skills",
"agentsDir": ".agents/agents",
"installedSkills": ["aif", "aif-plan", "aif-implement", "aif-commit"],
"installedAgentFiles": [
"best-practices-sidecar.md",
"commit-preparer.md",
"docs-auditor.md",
"implement-coordinator.md",
"implement-worker.md",
"plan-coordinator.md",
"plan-polisher.md",
"review-sidecar.md",
"rules-sidecar.md",
"security-sidecar.md"
],
"mcp": {
"github": true,
"postgres": false,
"filesystem": true,
"chromeDevtools": false,
"playwright": false
}
}
],
"extensions": [
{
"name": "aif-ext-example",
"source": "https://github.com/user/aif-ext-example.git",
"version": "1.0.0"
}
]
}
Array agents может включать любые встроенные agent IDs и runtime IDs, предоставленные установленными extensions. Каждый agent сохраняет свои skillsDir, список installed skills и MCP preferences. Runtimes, поддерживающие custom agent files, также сохраняют agentsDir и installedAgentFiles, чтобы ai-factory update мог обновлять package-managed agent files вместе со skills.
Codex дополнительно сохраняет configFiles / installedConfigFiles для managed files вроде .codex/config.toml. Updates обновляют файлы, которые по-прежнему совпадают с сохранённым installation baseline; local modifications и ранее существовавшие неотслеживаемые config files сохраняются. Codex app устанавливает Codex-style skills в .agents/skills и может записывать MCP config в .codex/config.toml, но не определяет runtime-global agentsDir.
AI Factory также хранит внутренние maps managedSkills, managedAgentFiles, managedConfigFiles и agentFileSources, опущенные выше для краткости. Managed entries сохраняют source/install hashes. Skill entries могут дополнительно содержать renderContextHash, который обнаруживает изменившиеся template paths или shared-runtime profiles даже при неизменных package source bytes, и rawInstalledHash, включающий injection content, extension tool-request metadata и точные file bytes. Эти fields не меняют native agent/config ownership.
Kilo Code использует те же ownership checks при снятии runtime с выбора: удаляются только tracked workflow files, совпадающие с сохранённым raw installation receipt. Untracked или modified workflows сохраняются. Установка skill не удаляет legacy directories в .kilocode/skills/; одни их имена не доказывают ownership AI Factory и не разрешают migration.
Удаление runtime удаляет ненужные ему skills, только если они совпадают и с сохранённым raw baseline, и с normalized install hash. Modified skills и legacy entries без raw baseline сохраняются с warning. Init, update и upgrade создают raw baseline, только когда весь установленный skill совпадает с rendered package source, проверенными registered injections и объявленными native tool requests. Unknown files, links, injection markers или недоступные injection sources не позволяют создать новый deletion baseline, в том числе после переустановки skill.
Extensions могут объявлять skill/runtime-scoped toolPermissions в manifest. Claude Code skill fields содержат ownership comments aif-ext-tools; global permission settings или новый permission map в .ai-factory.json не создаются.
Updates сохраняют unowned field, пока его source owner и extension-native declaration не меняются. Удаление replacement или изменённые replacement defaults используют текущий source field и заново собирают оставшиеся requests без сохранения grants предыдущего source. Остальные runtimes отмечаются как unsupported. Syntax, native policy behavior и package-default reconciliation limit описаны в Skill Tool Permissions.
agentFileSources записывает bundled или extension ownership. loadConfig() по-прежнему читает legacy Claude-only keys subagentsDir, installedSubagents и managedSubagents; новые saves используют универсальные имена и дополняют sources, когда bundled inventory или manifests установленных extensions предоставляют evidence.
Agent files от extensions могут предназначаться для non-Claude runtimes, например Codex. Такие files часто являются bounded helper workers (например, one-shot reviewers или plan polishers), а не автоматическими эквивалентами bundled Claude coordinator agents. Документация и prompts должны явно описывать эти support boundaries, а не подразумевать полный parity между runtimes.
AI Factory копирует такие runtime-specific agent files дословно; runtime-local keys вроде model, model_reasoning_effort, sandbox_mode и developer_instructions должны находиться в самом agent file, а не в .ai-factory.json или workflow prompts. Для bounded Codex helpers предпочтительны read-only advisory workers, если только runtime-native agent действительно не владеет записью в конкретный artifact.
Agent-file lifecycle теперь единообразен во всём CLI:
- Bundled files
loop-*требуютaif-loopвinstalledSkillsruntime. При его отсутствииinitиupdate(включая--force) пропускают их и удаляют ранее tracked bundled loop files с диска и из fieldsinstalledAgentFiles,agentFileSourcesиmanagedAgentFiles. Это относится к Claude и Codex bundles; extension-owned и untracked user files сохраняются. См. Subagents. extension addустанавливает file, записываетinstalledAgentFilesиagentFileSources, сразу создаёт свежиеmanagedAgentFileshashes.ai-factory updateсохраняет tracked extension-owned agent files, даже если extension manifest временно отсутствует, выдаёт warning и пропускает только source-driven drift healing, которое нельзя безопасно разрешить.extension removeудаляет runtime-local file и одновременно очищаетinstalledAgentFiles,agentFileSourcesиmanagedAgentFiles.
Optional array extensions отслеживает установленные extensions по name, original source и version. Теперь ai-factory update обновляет эти extensions из saved sources до base-skill updates, а ai-factory extension update [name] --force обновляет их без полного base-skill update flow.
Extension refresh использует сохранённый field source:
- npm sources проверяются по npm registry и пропускаются, если published version не изменилась
- GitHub sources получают
extension.jsonчерез GitHub API перед cloning - local paths и non-GitHub git sources требуют
--forceдля refresh
При частом обновлении GitHub-backed extensions задайте GITHUB_TOKEN, чтобы повысить GitHub API rate limit для этих checks.
Каталоги Codex Skills и Migration
Для Codex CLI AI Factory выбирает каталог skills по состоянию проекта до создания любых directories командой. Codex app сохраняет default .agents/skills.
| Saved Codex CLI target | Состояние проекта при начале command | Effective target |
|---|---|---|
Не задан или .codex/skills |
.agents/ существует как directory, в том числе пустой |
.agents/skills |
Не задан или .codex/skills |
.agents/ отсутствует либо является обычным file |
.codex/skills |
.agents/skills |
Directory существует либо требует повторного создания | .agents/skills |
| Другой project-relative path | С .agents/ или без него |
Saved path |
Наличие .codex/ не переопределяет существующий directory .agents/. Пустой проект, инициализированный одновременно с CLI и app, сохраняет их раздельные defaults для первой command независимо от порядка выбора. Последующий update видит directory .agents/ от app и подготавливает CLI migration. Повторный init сохраняет saved shared или custom targets.
Shared Content и Native Files
CLI и app могут использовать один физический skill directory. AI Factory один раз устанавливает объединённый required skill set, сохраняя selections и results каждого runtime. Shared content использует $aif-*, effective skill path, configuration paths .codex и общий Codex rendering profile. Singleton сохраняет собственные runtime metadata; sharing не меняет MCP capabilities ни одного runtime.
Custom project paths влияют на project-local helper references. Home-scope references сохраняют обычный home skill directory runtime; project override не считается home override. CLI и app, совместно использующие custom target, применяют общий Codex home profile (~/.codex/skills); singleton app сохраняет ~/.agents/skills.
Universal может совместно использовать физический skill directory с Codex CLI или Codex app с общим Codex rendering profile и примерами $aif-*. Universal в собственном directory сохраняет default profile.
Другие несовместимые renderers не могут совместно использовать физический directory. Nested targets, paths за пределами проекта, unsafe links и overlaps с native files или migration state отклоняются до изменения installed files.
Переносятся только skills. .codex/agents/, .codex/config.toml, custom native files и их ownership records остаются на месте при migration. Последующие native updates выполняются отдельно. Удаление одного runtime сохраняет skills, необходимые оставшемуся, и .codex/config.toml, пока другой runtime его использует. Перемещение skills не гарантирует исчезновения Codex context-budget warnings.
Конфликты и восстановление
init, update, upgrade и изменяющие extension commands подготавливают targets до обычной установки или удаления. Preflight сравнивает фактические files, включая injections, с известными bundled либо installed extension sources и сохранённым ownership evidence. Совместимые copies могут быть объединены. Unknown files, local edits, изменённый injection content, отсутствующие baselines или неразрешённые extension sources останавливают migration; --force не обходит эту проверку.
Если conflict указывает два directories, сохраните обе copies и сравните указанные skill files с их bundled или installed extension source. Сделайте backup local work перед разрешением. Восстановите proven source revision либо согласуйте изменения вручную, затем повторите command. AI Factory не объединяет local edits и не выдумывает отсутствующие ownership hashes. Unknown entries вне managed skill directories, включая пустые directories, сохраняются. Не удаляйте весь directory .codex.
Migration записывает и проверяет destination files, атомарно сохраняет новый skill target, затем удаляет только proven source files. Project lock предотвращает одновременные AI Factory mutations. Journal и raw recovery copies находятся в .ai-factory/skill-migrations/; завершённые operations сохраняют свои copies для inspection.
На POSIX systems migration и rollback сохраняют file permission bits, включая executable scripts и private config files. Конфликтующие permissions или одновременные permission changes останавливают migration. Recovery journals и backup files используют 0600; operation directories — 0700. Ownership, ACLs и extended attributes не входят в эту permission guarantee. Legacy journals без permission history не могут безопасно воссоздать прежние files на POSIX: recovery сохраняет материал и сообщает об отсутствующих metadata вместо угадывания permissions.
После interruption повторите command. Recovery откатывает destination writes, если old config всё ещё текущий, либо завершает cleanup, если new config был committed. Если files или .ai-factory.json изменились одновременно, recovery останавливается и сохраняет свой материал. Сохраните этот directory, согласуйте указанную file/config revision с saved copies и повторите попытку. Последующая ошибка extension или native-update не откатывает уже committed skill migration.
Задайте LOG_LEVEL=debug для target decisions, rendering profiles и migration diagnostics. Обычный output сообщает conflicts и recovery locations без debug logging. Поведение replacements и injections описано в Extensions.
Antigravity Directory Layout и Migration
Antigravity 2.0 использует структуру directory .agents/ для всего agent context, skills, autonomous workers, rules и MCP configurations.
Структура directory
your-project/
└── .agents/
├── skills/ # Modular Agent Skills in standard multi-file format (SKILL.md)
│ ├── aif/
│ │ └── SKILL.md
│ └── aif-plan/
│ └── SKILL.md
├── agents/ # Native autonomous workers and quality sidecars (subagent: true)
│ ├── implement-coordinator.md
│ ├── implement-worker.md
│ ├── plan-coordinator.md
│ ├── plan-polisher.md
│ ├── review-sidecar.md
│ ├── security-sidecar.md
│ ├── best-practices-sidecar.md
│ ├── rules-sidecar.md
│ ├── commit-preparer.md
│ └── docs-auditor.md
├── rules/ # Project rules with YAML frontmatter triggers
│ ├── aif-guardrails.md (trigger: always_on)
│ └── aif-conventions.md (trigger: model_decision)
└── mcp_config.json # Model Context Protocol configuration
Migration с Antigravity 1.0 (.agent/) и Subagents Layout
При выполнении ai-factory upgrade:
- Flat Workflow Staging: Реальные установки Antigravity 1.0 только с
.agent/workflows/<name>.md(без directories.agent/skills/) обнаруживаются автоматически. Неизменённые flat workflows сначала помещаются в.agent/skills/<name>/с managed state, и только затем выполняется skill target migration, обеспечивая плавный upgrade path. - Workflow Cleanup: AI Factory удаляет legacy flat workflow files из
.agent/workflows/, только когда они совпадают с точными историческими generator output variants (полный package template, simplified frontmatter или headless). Workflows с изменёнными пользователем YAML metadata (изменённыйdescription:, добавленные custom fields) либо body edits сохраняются. - Cross-Agent Skill Protection: Удаление legacy skill directory проверяет все files по package templates пофайлово с CRLF normalization. Skill directories других agents (например,
.claude/skills/qa/) либо содержащие user modifications или untracked files никогда не удаляются. - Rules Cleanup: Legacy rules в
.agent/rules/сравниваются с известными rule templates перед удалением. Изменённые пользователем rules сохраняются с warning. - Empty Directory Cleanup:
.agent/workflows/references/,.agent/workflows/,.agent/rules/и.agent/удаляются снизу вверх только при полной пустоте. Если существуют user files, структура directories сохраняется. - Subagents Migration: Любой legacy directory
.agents/subagents/на диске переносится в.agents/agents/пофайлово.- Если destination не существует, file копируется, а source удаляется.
- Если destination существует с идентичным content, source copy удаляется.
- Collision Safety: Если file в
.agents/subagents/конфликтует с destination file в.agents/agents/с отличающимся content, destination никогда не перезаписывается, source file сохраняется в.agents/subagents/, а warning записывается в log. .agents/subagents/удаляется, только если все files перенесены чисто и directory пуст.
Защита Native Agent Files и Custom Rules
- Init и Update:
ai-factory initиai-factory updateобнаруживают ранее существовавшие untracked files в.agents/agents/и.agents/rules/. Untracked user files и locally modified files сохраняются с warning и никогда не перезаписываются. - Artifact Language Compliance: Guardrail rules, установленные в
.agents/rules/aif-guardrails.md, передают выбор языка generated artifacts настройкеlanguage.artifactsиз.ai-factory/config.yaml(default English, если не задано), сохраняя code, identifiers и technical syntax на English, а user communication определяют черезlanguage.ui.
.ai-factory/config.yaml — User Preferences
Редактируемый пользователем configuration file для language, paths, workflow settings и rules hierarchy. Создаётся /aif во время project setup.
Полную key-by-key schema и матрицу чтения/записи built-in skills см. в Config Reference.
Двухфайловая architecture:
.ai-factory.json— CLI state (agents, installed skills, MCP config) — управляется package ai-factoryconfig.yaml— User preferences (language, paths, workflow) — редактируется developers
/aif создаёт начальный config.yaml из skills/aif/references/config-template.yaml, сохраняя структуру template с комментариями вместо перезаписи минимальным YAML blob.
При setup reruns /aif обновляет только принадлежащее ему managed key subset (language.*, paths.*, workflow.*, выбранные git.* и rules.base). Существующие комментарии, manual customizations вне targeted keys, unknown sections и registrations rules.<area> сохраняются.
Эти комментарии намеренны: они часть human-editable experience config.yaml, а не ненужный formatting noise.
# AI Factory Configuration
# All sections are optional — defaults are used when not specified.
# Language Settings
language:
# Language for AI-agent communication (prompts, questions, explanations)
# Options: en, ru, de, fr, es, zh, ja, ko, pt, it
ui: en
# Language for generated artifacts (plans, specs, documentation)
artifacts: en
# How to handle technical terms: keep | translate | mixed
technical_terms: keep
# Path Configuration (all relative to project root)
paths:
description: .ai-factory/DESCRIPTION.md
architecture: .ai-factory/ARCHITECTURE.md
docs: docs/
roadmap: .ai-factory/ROADMAP.md
research: .ai-factory/RESEARCH.md
rules_file: .ai-factory/RULES.md
plan: .ai-factory/PLAN.md
plans: .ai-factory/plans/
fix_plan: .ai-factory/FIX_PLAN.md
security: .ai-factory/SECURITY.md
references: .ai-factory/references/
patches: .ai-factory/patches/
evolutions: .ai-factory/evolutions/
evolution: .ai-factory/evolution/
specs: .ai-factory/specs/
rules: .ai-factory/rules/
qa: .ai-factory/qa/
archive: .ai-factory/archive/
# Optional extra context for /aif-warmup
warmup:
paths: []
# Example:
# paths:
# - docs/domain/
# - infrastructure/decisions.md
# Workflow Settings
workflow:
explore_mode: regular # regular | ultra; explicit mode wins
plan_mode: ask # ask | fast | full | ultra; explicit mode wins
improve_check: false # true enables +check; --no-check overrides once
# roadmap_next_mode: full # optional; otherwise concrete plan_mode or ultra
# roadmap_next_capacity: # optional user-owned positive integer estimates
# fast: 1
# full: 2
# ultra: 3
auto_create_dirs: true # Create .ai-factory/ directories when missing
plan_id_format: slug # full filename / ultra directory ID: slug | sequential
analyze_updates_architecture: true
architecture_updates_roadmap: true
verify_mode: normal # strict | normal | lenient
# Git Settings
git:
enabled: true # Set false for non-git repositories
base_branch: main # Diff / review / merge target when git is enabled
create_branches: true # Full/ultra plans may create branches
branch_prefix: feature/ # Prefix for auto-created plan branches
skip_push_after_commit: false # If true, /aif-commit skips push prompt after commit
# Rules Configuration
rules:
base: .ai-factory/rules/base.md # Base rules file
# api: .ai-factory/rules/api.md
# frontend: .ai-factory/rules/frontend.md
# backend: .ai-factory/rules/backend.md
# database: .ai-factory/rules/database.md
Для повторяющихся command options задайте workflow.explore_mode: ultra, workflow.plan_mode: full или workflow.improve_check: true. Явные command arguments переопределяют эти defaults; отсутствие settings сохраняет существующее behavior. Precedence и one-invocation overrides описаны в Command defaults.
/aif-plan-overview — read-only consumer plan/archive paths и language. /aif-roadmap-next также читает roadmap/context paths и необязательные workflow.roadmap_next_mode / workflow.roadmap_next_capacity. Их закомментированные примеры принадлежат пользователю и сохраняются при setup reruns; ни один advisor не записывает config. См. Roadmap-next defaults.
/aif-skills-audit — read-only config consumer для context paths, scoped rules и language. Работает без config, не вводит keys и сообщает результат в chat, если --output не задаёт новый report file. См. installed-library auditing.
Текущие config-aware skills читают config.yaml на Step 0. Сейчас это:
- Read-only planning advisors:
/aif-plan-overview,/aif-roadmap-next - Core workflow и quality commands:
/aif,/aif-plan,/aif-implement,/aif-verify,/aif-commit,/aif-review,/aif-rules-check,/aif-roadmap,/aif-explore,/aif-loop,/aif-rules,/aif-warmup - Дополнительные utility commands:
/aif-architecture,/aif-docs,/aif-fix,/aif-improve,/aif-evolve,/aif-skills-audit,/aif-transfer,/aif-reference,/aif-distillation,/aif-security-checklist,/aif-qa,/aif-qa-check,/aif-archive
Остальные skills пока config-agnostic и опираются на repository context, явные arguments или фиксированные non-configurable paths вроде skill-context.
Текущие config-agnostic built-ins: /aif-best-practices, /aif-build-automation, /aif-ci, /aif-dockerize, /aif-grounded и /aif-skill-generator.
Language semantics:
language.uiуправляет prompts, questions, progress updates, summaries и подсказками следующего шага.language.artifactsуправляет generated или persisted artifacts, включая plans, fix plans, patches, rules, references, security ignore state, документацию, QA outputs и research snapshots/aif-exploreвpaths.research.- Явный
/aif-explore ultraиспользует ту же language policy и создаёт named bundles в<parent(paths.research)>/research/<english-topic-slug>/; дополнительный path key не нужен. language.technical_termsуправляет сохранением, переводом или смешанным представлением human-readable terminology, при этом commands, paths, identifiers, branch names, config keys, package names, API names, machine-readable metadata keys и enum values, а также raw errors остаются неизменными там, где это требуется.
Необязательный technical writing: /aif-docs может применять writing.profile: simple-technical к точным Markdown paths из writing.targets, включая runbooks в paths.docs. Default — none с пустым списком. Сначала определите artifact language; разговор на русском не переводит English document или issue. writing.dictionary может указывать на read-only project terminology file. Сохранение смысла приоритетнее style; code, commands, identifiers и quoted errors сохраняются точно. Это editorial aid, а не requirement-correctness gate или standards certification. /aif сохраняет эти user-owned settings при reruns. Configuration, language precedence и skip behavior описаны в Writing settings.
Git workflow semantics:
git.enabled: falseполностью выключает branch/worktree assumptions./aif-plan fullпо-прежнему записываетpaths.plans/<slug>.md;/aif-plan ultraзаписываетpaths.plans/<slug>/index.mdи phase files.git.base_branch— branch для diff, review, verify, rules-check и merge guidance. Skills не должны hardcodemain.git.create_branches: falseсохраняет git awareness, но выключает automatic branch creation для full и ultra plans.git.skip_push_after_commit: trueзаставляет/aif-commitостановиться после local commit без push prompt.- Ultra строго opt-in через
/aif-plan ultra; новый config key не требуется, существующие fast/full prompts и artifact shapes не меняются. paths.planостаётся default fast-plan file. Если нужны fast plans внутриpaths.plans/, вручную изменитеpaths.planвconfig.yaml.paths.docsопределяет, куда/aif-docsзаписывает подробные documentation pages.README.mdостаётся landing page в project root.warmup.paths— упорядоченный список дополнительных files или directories для/aif-warmup. Entries разрешаются от project root и должны оставаться внутри него; directories рекурсивно сканируются на readable text files. Отсутствующий config эквивалентен пустому списку.paths.qaопределяет, где/aif-qaи/aif-qa-checkсохраняют QA artifacts. Derived branch slug добавляется автоматически:<paths.qa>/<branch-slug>/change-summary.md,test-plan.md,test-cases.md,qa-check.mdи browser replay scripts внутриbrowser-replay/. Agent-mode/aif-qa-checkтакже использует root-level<paths.qa>/agent-context.mdи<paths.qa>/agent-history.mdдля повторного использования non-sensitive cross-QA setup facts и recurring learnings, включая стабильные browser routes/selectors и безопасные command/test-filter patterns. Run-specific details, например branch names, QA target paths, summary counts, assertion totals и one-off command transcripts, остаются в<paths.qa>/<branch-slug>/qa-check.md. Slug — детерминированное, filesystem-safe, стабильное derived value с обязательным safe-slug truncation до 40 characters и коротким hash suffix для защиты от collisions; полный алгоритм см. вskills/aif-qa/SKILL.md./aif-qa-checkпривязывает results к проверенному commit и working tree digest либо manual build identifier при недоступном git, а также к deterministic test-case, target и proven replay-script digests. Заменённые replay files сохраняются вbrowser-replay/history/.
Текущие schema limits: config.yaml пока оставляет .ai-factory/skill-context/ фиксированным по command contract. README.md и docs-html/ остаются фиксированными в текущем documentation workflow.
Rules Hierarchy
AI Factory поддерживает трёхуровневую rules hierarchy:
-
paths.rules_file — Axioms (универсальные project rules)
- Краткий плоский список жёстких требований
- Управляется
/aif-rules
-
rules/base.md — Project-specific base conventions
- Naming conventions, module boundaries, error handling
- Создаётся
/aifна основе codebase analysis
-
rules.<area> — Paths area-specific rule files в
config.yaml- Примеры:
api,frontend,backend,database - Создаются
/aif-rules area:<name>
- Примеры:
Каждая area — именованный config key, значение которого задаёт rule file path. Например: rules.api: .ai-factory/rules/api.md.
Priority: Более конкретные rules имеют приоритет. rules.api > rules/base.md > paths.rules_file
MCP Configuration
AI Factory может настроить следующие MCP servers:
| MCP Server | Применение | Env Variable |
|---|---|---|
| GitHub | PRs, issues, repo operations | GITHUB_TOKEN |
| Postgres | Database queries | DATABASE_URL |
| Filesystem | Расширенные file operations | - |
| Chrome Devtools | Browser inspection, debugging, performance | - |
| Playwright | Browser automation, web testing | - |
Configuration сохраняется в settings file agent (например, .mcp.json для Claude Code и Universal / Other, .cursor/mcp.json для Cursor, .vscode/mcp.json для GitHub Copilot, .roo/mcp.json для Roo Code, .kilocode/mcp.json для Kilo Code, opencode.json для OpenCode, .codex/config.toml для Codex app, .agents/mcp_config.json для Antigravity).
Runtime Format Contract
Source of truth для runtime MCP shapes и wrapper examples:
skills/aif/references/SETUP-MCP.md
Краткое соответствие keys:
- Standard MCP runtimes (включая Antigravity в
.agents/mcp_config.json) используютmcpServers.<server> - OpenCode использует
mcp.<server> - GitHub Copilot использует
servers.<server> - Codex app использует TOML tables в
mcp_servers.<server>
Environment Variables
MCP configs используют placeholders ${VAR} для credentials. OpenCode сохраняет credentials в environment, GitHub Copilot получает ${env:VAR} в .vscode/mcp.json, а Codex app — credential names в env_vars внутри .codex/config.toml. Задайте их перед запуском agent:
export GITHUB_TOKEN="ghp_your_token"
export DATABASE_URL="postgresql://user:pass@localhost:5432/db"
Runtime-specific wrapper examples намеренно сосредоточены в связанном MCP reference /aif, чтобы избежать docs drift. Setup skill читает его только при configuration выбранных MCP servers.
Структура проекта
После initialization (пример для Claude Code; остальные agents используют собственный directory). Ниже показаны default paths; многие AI Factory artifacts можно переместить через config.yaml.
your-project/
├── .claude/ # Agent config dir (varies: .cursor/, .codex/, .ai/, etc.)
│ ├── agents/
│ │ ├── best-practices-sidecar.md
│ │ ├── commit-preparer.md
│ │ ├── docs-auditor.md
│ │ ├── implement-coordinator.md
│ │ ├── implement-worker.md
│ │ ├── loop-critic.md
│ │ ├── loop-evaluator.md
│ │ ├── loop-invariant-prep.md
│ │ ├── loop-orchestrator.md
│ │ ├── loop-perf-prep.md
│ │ ├── loop-planner.md
│ │ ├── loop-producer.md
│ │ ├── loop-refiner.md
│ │ ├── loop-test-prep.md
│ │ ├── plan-coordinator.md
│ │ ├── plan-polisher.md
│ │ ├── review-sidecar.md
│ │ ├── review-validator.md
│ │ ├── rules-sidecar.md
│ │ └── security-sidecar.md
│ ├── skills/
│ │ ├── aif/
│ │ ├── aif-plan/
│ │ ├── aif-improve/
│ │ ├── aif-implement/
│ │ ├── aif-commit/
│ │ ├── aif-dockerize/
│ │ ├── aif-build-automation/
│ │ ├── aif-verify/
│ │ ├── aif-docs/
│ │ ├── aif-reference/
│ │ ├── aif-review/
│ │ └── aif-skill-generator/
│ └── settings.local.json # Permissions config (gitignored)
├── .ai-factory/ # AI Factory working directory
│ ├── DESCRIPTION.md # Project specification
│ ├── ARCHITECTURE.md # Architecture decisions and guidelines
│ ├── ROADMAP.md # Strategic milestones
│ ├── RULES.md # Project-wide conventions
│ ├── RESEARCH.md # Regular /aif-explore snapshot
│ ├── research/ # Explicit ultra research bundles
│ │ └── <english-topic-slug>/
│ │ ├── INDEX.md # Manifest and adaptive artifact index
│ │ ├── RESEARCH.md # Plan-compatible Active Summary + Sessions
│ │ └── ... # Only justified C4, ADR, or dependency files
│ ├── PLAN.md # Current plan (from /aif-plan fast)
│ ├── SECURITY.md # Ignored security items (from /aif-security-checklist ignore)
│ ├── rules/ # Base and named area rules
│ ├── archive/ # Archived plans and roadmap snapshots
│ ├── extensions/ # Installed extensions (from ai-factory extension add)
│ │ └── <extension-name>/
│ │ └── extension.json
│ ├── references/ # Knowledge references from external sources (from /aif-reference)
│ │ └── <topic>.md
│ ├── plans/ # Full .md plans and ultra plan directories
│ │ ├── <branch-name>.md
│ │ └── <ultra-id>/
│ │ ├── index.md
│ │ └── phase-01-<slug>.md
│ ├── skill-context/ # Optional global/build files + individual skill directories; see docs/evolve.md
│ │ ├── aif-fix/
│ │ │ └── SKILL.md
│ │ └── aif-review/
│ │ └── SKILL.md
│ ├── patches/ # Self-improvement patches (from /aif-fix)
│ │ └── 2026-02-07-14.30.md
│ ├── evolutions/ # Evolution logs (from /aif-evolve, directly or via /aif-transfer)
│ │ ├── 2026-02-08-10.00.md
│ │ └── patch-cursor.json # Incremental evolve cursor (latest processed patch)
│ ├── evolution/ # Active reflex loop state (from /aif-loop)
│ │ ├── current.json
│ │ └── <task-alias>/
│ │ ├── run.json
│ │ ├── history.jsonl
│ │ └── artifact.md
│ └── qa/ # QA artifacts (from /aif-qa and /aif-qa-check)
│ ├── agent-context.md # Reusable non-sensitive automated QA setup facts
│ ├── agent-history.md # Append-only reusable cross-QA learnings
│ └── <branch-slug>/
│ ├── change-summary.md
│ ├── test-plan.md
│ ├── test-cases.md
│ ├── browser-replay/
│ │ ├── TC-NNN.js
│ │ └── history/
│ │ └── TC-NNN-<script-digest>.js
│ └── qa-check.md
├── .mcp.json # MCP servers config (Claude Code project scope)
├── .codex/config.toml # Codex app MCP config when Codex app is selected
└── .ai-factory.json # AI Factory config
Reflex Loop Files
/aif-loop сохраняет компактный state с возможностью resume между sessions. Ниже показаны defaults; base loop directory можно перенести через paths.evolution.
.ai-factory/evolution/current.json— active loop pointer (на текущий run).ai-factory/evolution/<task-alias>/run.json— текущий run snapshot (loop execution state).ai-factory/evolution/<task-alias>/history.jsonl— append-only event history.ai-factory/evolution/<task-alias>/artifact.md— последний artifact output
Полные phase contracts и stop conditions см. в Reflex Loop.
Evolution Cursor File
/aif-evolve использует лёгкий cursor для инкрементальной обработки patches. Ниже показаны defaults; patch и evolution-log directories можно перенести через paths.patches и paths.evolutions.
.ai-factory/evolutions/patch-cursor.json— marker последнего обработанного patch- Первый run (без cursor): evolve читает все patches
- Последующие runs: evolve читает patches новее cursor (с небольшим overlap window, чтобы обнаружить пропущенные моменты)
- Для принудительного полного rescan: удалите
patch-cursor.jsonи снова запустите/aif-evolve
/aif-transfer повторно использует paths.evolutions текущего проекта для approved delegated evolve log, но не копирует source patches в paths.patches и никогда не читает и не продвигает текущий patch cursor для transferred evidence.
Best Practices
Artifact Ownership и Context Gates
- Ограничивайте context artifact ownership соответствующей command (roadmap —
/aif-roadmap, rules —/aif-rules, architecture —/aif-architecture, research —/aif-explore). - Считайте
/aif-rules-check,/aif-commit,/aif-reviewи/aif-verifyread-only consumers context artifacts по умолчанию. - Используйте
WARNдля неблокирующих gate findings (отсутствующие optional files, неоднозначный mapping) иERRORдля blocking violations. - Parseable quality gates добавляют финальный JSON block
aif-gate-resultс lowercase status valuespass/warn/fail; см. Quality Gates.
Logging
Все implementations включают подробный configurable logging:
- Используйте log levels (DEBUG, INFO, WARN, ERROR)
- Управляйте через environment variable
LOG_LEVEL - Добавляйте rotation для file-based logs
Commits
- Commit checkpoints через каждые 3-5 tasks для крупных features
- Следуйте формату conventional commits
- Содержательные messages вместо простого "update code"
Testing
- Вопрос всегда задаётся до создания plan
- При «без tests» test tasks не создаются
- Test code никогда не добавляется скрытно
См. также
- Начало работы — установка, поддерживаемые agents, первый проект
- Development Workflow — использование workflow skills
- Config Reference — полная
config.yamlschema и матрица использования skills - Reflex Loop — contracts и storage layout для
/aif-loop - Extensions — создание и установка extensions
- Security — сканирование external skills перед использованием