Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### Added
- Codex integration: `agents/codex/AGENTS.md` flat entry point (all rules inlined)
- `ai-rules generate` command: resolves `@rules/` imports and writes a flat file
for agents without native import support (`supports_imports = false`)
- `src/ai_rules/generator.py`: `resolve_imports()` and `generate_flat_file()` functions
- `agents.toml`: Codex agent registered (`install_dir = ~/.codex`, no import support)
- `tests/test_generator.py`: 7 tests for the generator module
- `rules/cli.md`: require shell completion for every CLI tool
- `rules/commits.md`: prefer detailed commit messages

## [0.3.1] - 2026-03-26

### Added
Expand Down
37 changes: 28 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@ supported AI assistants.

## Supported assistants

| Key | Assistant | Config file |
|----------|--------------|---------------------------|
| `claude` | Claude Code | `agents/claude/CLAUDE.md` |
| Key | Assistant | Config file | Import support |
|----------|--------------|-------------------------------|----------------|
| `claude` | Claude Code | `agents/claude/CLAUDE.md` | native |
| `codex` | Codex | `agents/codex/AGENTS.md` | flat file |

## Structure

```
ai-rules/
├── agents/
│ └── claude/
│ └── CLAUDE.md # Claude Code entry point (imports rules via @rules/)
│ ├── claude/
│ │ └── CLAUDE.md # Claude Code entry point (imports rules via @rules/)
│ └── codex/
│ └── AGENTS.md # Codex entry point (flat file, generated via `ai-rules generate`)
├── rules/ # Shared rule files by topic
│ ├── principles.md
│ ├── language.md
Expand Down Expand Up @@ -89,10 +92,11 @@ Options:
--help Show this message and exit.

Commands:
list List available agents.
status Show installation status for one or all agents.
install Install rules for one or all agents.
update Update installation for one or all agents.
list List available agents.
status Show installation status for one or all agents.
install Install rules for one or all agents.
update Update installation for one or all agents.
generate Generate flat rule files for agents without native import support.
```

### Examples
Expand All @@ -114,6 +118,10 @@ ai-rules install claude
# Dry run
ai-rules install --dry-run

# Regenerate flat files for agents without native import support
ai-rules generate
ai-rules generate codex

# Shell completion (bash/zsh/fish)
ai-rules --install-completion
```
Expand All @@ -131,6 +139,17 @@ For each declared link in `agents.toml`, `ai-rules install`:
| `~/.claude/CLAUDE.md` | `agents/claude/CLAUDE.md` |
| `~/.claude/rules` | `rules/` |
| `~/.claude/settings.json` | `settings.json` |
| `~/.codex/AGENTS.md` | `agents/codex/AGENTS.md` |

### Agents without native import support (Codex)

Codex does not support `@rules/` imports natively. Its entry point is a flat
file generated from the Claude entry point with all imports resolved inline.
Regenerate it after updating any rule file:

```bash
ai-rules generate codex
```

## Development

Expand Down
8 changes: 4 additions & 4 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
Improvements and additions to consider for future iterations of this config.

## Codex integration
- [ ] Add `agents/codex/AGENTS.md` entry point (flat file — no @rules/ import support)
- [ ] Add `generate` command to CLI: concatenate rules/ into a flat file for agents without native import support
- [ ] Register Codex agent in `agents.toml`
- [ ] Add tests for generate command and Codex agent
- [x] Add `agents/codex/AGENTS.md` entry point (flat file — no @rules/ import support)
- [x] Add `generate` command to CLI: concatenate rules/ into a flat file for agents without native import support
- [x] Register Codex agent in `agents.toml`
- [x] Add tests for generate command and Codex agent

## Naming conventions
- [ ] Add naming conventions for other languages (JavaScript/TypeScript, Python, Go...) in `rules/naming.md` as they become relevant in projects
Expand Down
10 changes: 10 additions & 0 deletions agents.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,13 @@ supports_imports = true
[[agents.claude.links]]
source = "settings.json"
target = "settings.json"

[agents.codex]
name = "Codex"
entry_point = "agents/codex/AGENTS.md"
install_dir = "~/.codex"
supports_imports = false

[[agents.codex.links]]
source = "agents/codex/AGENTS.md"
target = "AGENTS.md"
Loading
Loading