Skip to content
This repository was archived by the owner on Mar 20, 2026. It is now read-only.
Open
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
17 changes: 12 additions & 5 deletions EN/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Auto-coder-agent_Cursor_Roo_code

## Overview
This project is a codebase for an automated coding agent using Cursor and Roo.
It adopts Log-Driven Development (LDD) to effectively manage and utilize AI interaction history.
This project is a codebase for automated coding workflows powered by Cursor, Roo, and Codex agents.
It adopts Log-Driven Development (LDD) to effectively manage and utilize multi-agent interaction history.

## Features
- Automatic saving of Cursor AI interaction history
- Automatic saving of Cursor / Codex AI interaction history
- Development management through Log-Driven Development (LDD)
- Multilingual support (Japanese/English)
- Metrics-based quality management
- Prompt-chaining templates and integration guides for the Codex agent

## Directory Structure
```
Expand All @@ -25,6 +26,12 @@ EN/
3. Initialize Memory Bank
4. Verify Environment Settings

### Codex Cloud Init (Optional but Recommended)
1. Grant execute permission: `chmod +x codex/init_codex_cloud_env.sh`
2. Run `./codex/init_codex_cloud_env.sh` to clone/update the repository, create `.venv`, and install dependencies.
3. Populate the generated `.env` with `OPENAI_API_KEY` and other environment variables.
4. Review `codex/cloud_init_sequence.mdc` for verification commands and logging guidance.

## Usage

### 1. Basic Usage
Expand All @@ -35,11 +42,11 @@ EN/
### 2. Log Management
1. Record logs according to `@logging_template.mdc`
2. Select appropriate log categories
3. Regularly check metrics
3. Reflect outputs from Cursor, Roo, Codex, and Devin agents in the metrics

### 3. Feedback Loop
1. Record feedback after task completion
2. Integrate AI analysis results
2. Integrate AI analysis results from Cursor, Roo, Codex, and Devin
3. Implement improvement suggestions

## Development Process
Expand Down
17 changes: 12 additions & 5 deletions JA/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Auto-coder-agent_Cursor_Roo_code

## 概要
このプロジェクトは、CursorとRooを使用した自動コーディングエージェントのためのコードベースです
ログ駆動開発(LDD)を採用し、AIとの対話履歴を効果的に管理・活用します。
このプロジェクトは、Cursor・Roo・Codexエージェントを活用した自動コーディングワークフローのコードベースです
ログ駆動開発(LDD)を採用し、複数エージェントとの対話履歴を効果的に管理・活用します。

## 特徴
- Cursor AIとの対話履歴の自動保存
- Cursor / Codex AIとの対話履歴の自動保存
- ログ駆動開発(LDD)による開発管理
- 多言語対応(日本語/英語)
- メトリクスベースの品質管理
- Codexエージェント向けプロンプトチェーンテンプレートと統合ガイド

## ディレクトリ構造
```
Expand All @@ -25,6 +26,12 @@ JA/
3. メモリバンクの初期化
4. 環境設定の確認

### Codexクラウド初期化(推奨)
1. 実行権限付与: `chmod +x codex/init_codex_cloud_env.sh`
2. `./codex/init_codex_cloud_env.sh` を実行し、リポジトリ同期・仮想環境構築・依存インストールを自動化
3. 生成された `.env` に `OPENAI_API_KEY` など必要な値を入力
4. 詳細手順と検証コマンドは `codex/cloud_init_sequence.mdc` を参照

## 使用方法

### 1. 基本的な使用方法
Expand All @@ -35,11 +42,11 @@ JA/
### 2. ログ管理
1. `@logging_template.mdc`に従ってログを記録
2. 適切なログカテゴリを選択
3. メトリクスの定期的な確認
3. Codexを含む各エージェントの出力をメトリクスに反映

### 3. フィードバックループ
1. タスク完了後のフィードバック記録
2. AI分析結果の統合
2. AI分析結果の統合(Cursor / Roo / Codex / Devin)
3. 改善提案の実装

## 開発プロセス
Expand Down
52 changes: 52 additions & 0 deletions codex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Codex Agent Integration

## Overview

This directory provides templates and integration guides that adapt the Auto-coder-agent_Cursor_Roo_code repository for use with the Codex agent. The resources here extend the existing Cursor and Roo workflows so that Codex can participate in the Log-Driven Development (LDD) process with consistent logging, context management, and metric tracking.

## Contents

- `codex_agent_template.mdc`: Prompt-chaining oriented template for Codex agent executions
- `cloud_init_sequence.mdc`: Cloud initialisation playbook shared across agents
- `init_codex_cloud_env.sh`: Shell script for reproducible Codex bootstrapping
- `ldd_integration.mdc`: Mapping between Codex agent behaviour and the LDD system
- `README.md`: This file

## Codexクラウド初期化 / Codex Cloud Bootstrap

Codexクラウド環境で本リポジトリを利用する際は、`init_codex_cloud_env.sh` を実行し、仮想環境と依存関係を自動セットアップします。
詳細な手順とログ連携フローは `cloud_init_sequence.mdc` を参照してください。

1. スクリプトに実行権限を付与: `chmod +x codex/init_codex_cloud_env.sh`
2. 必要に応じて `REPO_URL` や `WORKSPACE_ROOT` などの環境変数を上書き
3. `./codex/init_codex_cloud_env.sh` を実行し、`.env` と LDDログ基盤を生成
4. `.env` に `OPENAI_API_KEY` 等を設定し、Codex実行前に確認

## Prompt Chaining & Tool Orchestration

The Codex agent is expected to:

1. Build a prompt chain that moves from user intent → plan → implementation → validation
2. Record each stage of the chain in standardised log sections so that other agents can review the reasoning trail
3. Invoke tooling (tests, linters, formatters) explicitly and document their outcomes for reproducibility
4. Feed structured artefacts back into the Memory Bank to keep shared context synchronised

## Integration with LDD

Codex leverages the existing LDD assets by:

- Re-using the shared logging templates with Codex-specific sections for prompt chaining
- Writing execution traces into the Memory Bank so Cursor, Roo, and Devin agents can resume work seamlessly
- Aligning generated stories and plans with SpecStory archives for long-term traceability
- Following the Cursor ruleset to guarantee consistent style, safety, and communication standards

## Usage

1. Start with `codex_agent_template.mdc` when orchestrating Codex runs inside this repository
2. Populate the prompt chain placeholders (intent, plan, draft, review, tests) before sending Codex requests
3. Mirror every Codex action in the LDD logs so other agents can audit or hand over tasks
4. Consult `docs/codex/integration_guide.md` for detailed workflows and best practices shared by all agents

## Visual Format

Codex contributions should continue to use the standard `◤◢` framed blocks for highlighted context to remain visually aligned with existing documentation and templates.
73 changes: 73 additions & 0 deletions codex/cloud_init_sequence.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
description: Codex Cloud Init Sequence for Log-Driven Development environments
version: 1.1.0
date: 2025-03-20
---

# Codexクラウド初期化シーケンス / Codex Cloud Init Sequence

◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢
## 概要 / Overview
- Codexエージェントをクラウド環境で実行するための初期化手順を示します。
- This guide walks through the reproducible bootstrap steps so the Codex agent can join the Log-Driven Development (LDD) workflow.
◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢

## 事前条件 / Prerequisites
- Bash 5.x 以上
- Git, Python 3.10+, pip
- アクセス可能な `OPENAI_API_KEY`
- Writable workspace (default: `$HOME/repos`)

## 初期化フロー / Initialisation Flow

1. **スクリプト取得 / Fetch Script**
- `codex/init_codex_cloud_env.sh` をダウンロード、またはリポジトリから取得します。
2. **実行権限付与 / Allow Execution**
- `chmod +x codex/init_codex_cloud_env.sh`
3. **環境変数の調整 / Configure Overrides**
- 必要に応じて以下の環境変数を指定して実行:
```bash
REPO_URL=<custom_repo>
TARGET_BRANCH=<branch>
WORKSPACE_ROOT=<workspace_path>
PYTHON_BIN=<python_command>
```
4. **初期化実行 / Run Initialiser**
- `./codex/init_codex_cloud_env.sh`
- クリーンなリポジトリクローンと `.venv` 作成、依存インストールを自動化します。
5. **.env 更新 / Update .env**
- 生成された `.env` に `OPENAI_API_KEY` を記載し、その他の値を環境に合わせて編集します。
6. **LDDアセット確認 / Verify LDD Assets**
- `@logging_template.mdc` と `@memory-bank.mdc` が存在することを確認し、`logs/` ディレクトリにアクセス権があるか検証します。

## ログ・メモリ連携 / Logging & Memory Hooks
- 初期化結果を `logs/system/` へ保存し、Codex実行開始時に参照できるようにします。
- メモリバンクには以下のスニペットを挿入し、Codexが参照できるコンテキストを保持します。

```markdown
### Codex Cloud Init Snapshot
- Repo Path: {TARGET_DIR}
- Branch: {TARGET_BRANCH}
- Venv: {VENV_DIR}
- Dependencies: affiliate_automation/requirements.txt
- Owner: {OPERATOR}
```

## 検証コマンド / Verification Commands
| Purpose | Command | Expected Result |
|---------|---------|----------------|
| Pythonバージョン確認 | `${PYTHON_BIN:-python3} --version` | 3.10 以上 |
| 依存関係の確認 | `source .venv/bin/activate && pip list` | 必須ライブラリが表示される |
| LDDテンプレート確認 | `ls @logging_template.mdc` | テンプレートが存在する |
| ログディレクトリ確認 | `ls logs/tasks` | 初期ディレクトリが作成されている |

## トラブルシューティング / Troubleshooting
- **未コミット変更が存在**: スクリプトは警告のみを出します。必要なら手動で stash してから再実行してください。
- **依存ファイルが見つからない**: `REQUIREMENTS_FILE` 環境変数で別の requirements ファイルを指定できます。
- **Pythonコマンドが存在しない**: `PYTHON_BIN` を `python` など適切なコマンドに変更してください。
- **プロキシ環境**: `PIP_INDEX_URL` や `HTTPS_PROXY` を事前にエクスポートしてから実行します。

## 次のステップ / Next Steps
- Codexプロンプトチェーンを `codex/codex_agent_template.mdc` で構築。
- `docs/codex/integration_guide.md` に沿ってログとメモリ更新を実施。
- 他エージェント(Cursor / Roo / Devin)とのハンドオフ計画を作成。
88 changes: 88 additions & 0 deletions codex/codex_agent_template.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
description: Codex Agent Template with Prompt Chaining and Tool Orchestration
version: 1.0.0
date: 2025-03-16
---

# Codex Agent Template

## Prompt Chaining Workflow

◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢
### Stage Overview
{% for stage in prompt_chain %}
{{ loop.index }}. **{{ stage.name }}**
- Purpose: {{ stage.purpose }}
- Expected Output: {{ stage.output }}
{% endfor %}
◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢

## Codex Prompt Blocks

{% for block in prompt_blocks %}
### {{ block.title }}
◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢
```{{ block.language }}
{{ block.content }}
```
◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢
{% endfor %}

## Execution Checklist

- Current Repository Path: **{{ repository.path }}**
- Target Branch: **{{ repository.branch }}**
- Required Tools: {{ tools | join(", ") }}
- Additional Context Files: {{ context_files | join(", ") }}

## Plan to Implementation Trace

{% for step in implementation_trace %}
{{ loop.index }}. Plan Step: **{{ step.plan }}**
- Codex Action: {{ step.action }}
- Artefact: {{ step.artefact }}
- Log Reference: {{ step.log_reference }}
{% endfor %}

## Testing & Validation Matrix

| Category | Command | Expected Result | Status |
|----------|---------|----------------|--------|
{% for test in tests %}| {{ test.category }} | `{{ test.command }}` | {{ test.expectation }} | {{ test.status }} |
{% endfor %}

## Memory Bank Update

◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢
### Active Context Injection
- Task ID: {{ memory.task_id }}
- Prompt Chain Stage: {{ memory.current_stage }}
- Key Decisions:
{% for decision in memory.decisions %}- {{ decision }}
{% endfor %}
- Follow-up Items:
{% for follow_up in memory.follow_ups %}- {{ follow_up }}
{% endfor %}
◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢

## Handoff Notes

- Consumer Agents: {{ handoff.consumers | join(", ") }}
- Required Next Steps: {{ handoff.next_steps | join(", ") }}
- Verification Hooks: {{ handoff.verification | join(", ") }}

## Visual Guidelines

### Invalid Format (NG)
```xml
<thinking>
インラインプロンプトはこのテンプレートでは使用しません。
</thinking>
```

### Valid Format (OK)
```
◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢
Codex agent reasoning and outcomes appear inside framed blocks for consistency.
◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢
```
Loading