# AI-Native Development Environment Setup: Chezmoi-Managed Terminal-First AI CLI Workflow

> This article introduces a carefully designed Linux dotfiles configuration tailored for AI-assisted engineering, covering full configurations for Codex and Claude Code, reusable Agent skills, the Graphiti memory layer, and reproducible development environment setup.

- 板块: [Openclaw Llm](https://www.zingnex.cn/en/forum/board/openclaw-llm)
- 发布时间: 2026-05-23T19:15:19.000Z
- 最近活动: 2026-05-23T19:21:32.870Z
- 热度: 163.9
- 关键词: AI辅助开发, dotfiles, Chezmoi, Codex, Claude Code, AGENTS.md, 终端工作流, Linux配置, 可复用技能, Graphiti
- 页面链接: https://www.zingnex.cn/en/forum/thread/ai-chezmoiai-cli
- Canonical: https://www.zingnex.cn/forum/thread/ai-chezmoiai-cli
- Markdown 来源: floors_fallback

---

## Introduction / Main Floor: AI-Native Development Environment Setup: Chezmoi-Managed Terminal-First AI CLI Workflow

This article introduces a carefully designed Linux dotfiles configuration tailored for AI-assisted engineering, covering full configurations for Codex and Claude Code, reusable Agent skills, the Graphiti memory layer, and reproducible development environment setup.

## Original Author and Source

- **Original Author/Maintainer**: Kevin-Mok
- **Source Platform**: GitHub
- **Original Title**: ai-cli-dotfiles / KM's Four-Codex Operating Environment
- **Original Link**: https://github.com/Kevin-Mok/ai-cli-dotfiles
- **Publication Date**: May 23, 2026

---

## Core Philosophy: Configuration as Code for AI-Assisted Engineering

This repository is not just a set of Linux configuration files, but a complete operating system layer for AI-assisted engineering. Beneath the surface of traditional chezmoi dotfiles lies a traceable operation layer designed for Codex: AGENTS files, runtime default configurations, reusable local skills, Graphiti-supported memory layer, and ExecPlans designed for parallel terminal-agent work.

For AI-native engineers, the core value of this repository lies in: **it demonstrates how to build a reproducible, traceable, and collaborative AI-assisted development environment**.

---

## Technology Stack Overview

| Layer | Repository Evidence | Reason for Selection |
|------|---------|---------|
| chezmoi | dot_config/chezmoi/ | Reproducible across machines, avoiding configuration lock-in to a single laptop |
| Codex CLI | dot_codex/config.toml | Versioned models, inference, trust boundaries, MCP, and session default configurations |
| AGENT Instruction Chain | AGENTS.md, AGENTS.repo.md | Transform planning, validation, commit norms, and document synchronization into reviewable workflow rules |
| Claude Code | dot_claude/CLAUDE.md | Import via @path to share the same AGENTS.md behavior baseline |
| Local Skills | dot_agents/skills/ | Package repetitive tasks into reusable local capabilities |
| Graphiti MCP | dot_codex/config.toml | Add a retrievable memory layer for multi-session work |
| Shell Toolchain | fish, tmux, kitty, i3 | Terminal-first execution, optimized for multiple parallel panes |

---

## Instruction Chain Upgrade

The system achieves behavioral consistency through hierarchical AGENTS files:

- **AGENTS.md**: Shared baseline instructions
- **AGENTS.repo.md**: Points to repository-specific authoritative sources
- **dot_codex/AGENTS.md**: Normative work document for Codex
- **dot_claude/CLAUDE.md**: Imports via @path to share the same baseline

These instructions are not vague philosophies, but specific engineering behavior norms:

- **Planning Mode**: Non-trivial work uses explicit steps, assumptions, risks, and validation
- **Failure Reproduction Priority**: Must have a reproducible failure case before fixing
- **Explicit Validation**: Prove via tests, diffs, logs, or manual checks before completion
- **Document Synchronization**: Behavioral changes are accompanied by document updates
- **Small Reversible Steps**: Changes remain reviewable and easy to roll back
- **Conventional Commits**: Commit history clearly conveys intent

## Traceable Codex Default Configuration

dot_codex/config.toml allows each Codex session to start with a strong configuration:

- Default model and inference level
- Trusted local project paths
- MCP server configuration
- Notifications, status bar, TUI key mapping preferences
- Repository-specific developer instructions

This means new Codex panes immediately inherit the same configuration without needing re-briefing.

## Reusable Local Skills

dot_agents/skills/ transforms repetitive prompts into reusable capabilities. Each skill is installed to ~/.agents/skills/<name>/SKILL.md for Codex use, and symlinked to ~/.claude/skills/ for Claude Code use.

Main skill categories:
- **commit-plan**: Review worktree before commit, separate concerns, mark risky changes
- **research**: Research task automation
- **browser**: Browser automation
- **design**: Design workflow
- **docs**: Document lookup
- **media**: Media tasks

## Graphiti Memory Layer

Via Neo4j-supported Graphiti MCP, Codex gains a local temporal memory surface for long-running multi-session work. Memories include source and evolution context, supporting continuous tracking of complex projects.

---
