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
11 changes: 6 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 @@ -35,11 +36,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
11 changes: 6 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 @@ -35,11 +36,11 @@ JA/
### 2. ログ管理
1. `@logging_template.mdc`に従ってログを記録
2. 適切なログカテゴリを選択
3. メトリクスの定期的な確認
3. Codexを含む各エージェントの出力をメトリクスに反映

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

## 開発プロセス
Expand Down
40 changes: 40 additions & 0 deletions codex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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
- `ldd_integration.mdc`: Mapping between Codex agent behaviour and the LDD system
- `README.md`: This file

## 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.
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.
◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢
```
84 changes: 84 additions & 0 deletions codex/ldd_integration.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
description: Integration between Codex Agent and LDD System
version: 1.0.0
date: 2025-03-16
---

# Codex Agent LDD Integration

## Overview

This document defines how the Codex agent's prompt chaining workflow aligns with the existing Log-Driven Development (LDD) system so that Cursor, Roo, Devin, and Codex can collaborate without losing context or traceability.

## Integration Points

### 1. Logging Structure

Codex extends the standard logging template with prompt chaining markers:

```
- Base Template: @logging_template.mdc
- Additional Sections:
- codex_prompt_chain
- tool_invocations
- validation_matrix
- handoff_summary
```

### 2. Memory Bank Synchronisation

Prompt chain checkpoints are persisted alongside LDD state data:

```
## Active States
### Codex Prompt Chain
- Task ID: {TASK_ID}
- Current Stage: {CURRENT_STAGE}
- Prompt Summary: {PROMPT_SNIPPET}
- Generated Artefacts: {ARTEFACT_LIST}
- Pending Validations: {VALIDATION_ITEMS}
```

### 3. SpecStory Alignment

Codex outputs feed into SpecStory stories to preserve reasoning:

```
## Story Context
- Intent Summary: {INTENT}
- Prompt Chain Decisions: {DECISION_LIST}
- Verification Hooks: {TEST_REFERENCES}
```

### 4. Cross-Agent Collaboration

Codex follows the shared Cursor ruleset and adds guardrails for tool invocation:

```
- Always document the exact prompt sent to Codex when major artefacts are produced
- Log every tool invocation (tests, linters, formatters) with outcomes
- Provide explicit handoff notes for Cursor, Roo, or Devin follow-up work
- Flag any unresolved warnings so subsequent agents can plan remediation
```

## Workflow Integration

### Planning Phase
1. Analyse user intent using the existing intent analysis structure
2. Build the initial Codex prompt chain with goals, constraints, and acceptance tests
3. Store the plan in the task log under `codex_prompt_chain`

### Execution Phase
1. Execute each prompt chain stage, recording prompts and responses in the logs
2. Run required tooling and update the validation matrix
3. Sync Memory Bank entries after each major artefact is produced

### Feedback Phase
1. Compare Codex outputs with acceptance criteria stored in SpecStory
2. Document gaps or refactor needs in the feedback log
3. Update prompt chain notes with lessons learned for future iterations

### Optimisation Phase
1. Review the end-to-end prompt chain for reuse opportunities
2. Update Codex templates or guardrails in this directory
3. Share improvements with other agents through the Memory Bank and documentation
72 changes: 72 additions & 0 deletions docs/codex/integration_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Codexエージェント統合ガイド / Codex Agent Integration Guide

◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢
## 概要 / Overview

- CodexエージェントをAuto-coder-agent_Cursor_Roo_codeのLDDワークフローに組み込むためのベストプラクティスをまとめています。
- This guide explains how to onboard the Codex agent into the Log-Driven Development (LDD) workflow so it can collaborate with Cursor, Roo, and Devin agents.
◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢

## 統合の柱 / Integration Pillars

1. **プロンプトチェーン管理 / Prompt Chain Management**
- Codexはユーザー意図→計画→実装→検証の順でプロンプトを連結します。
- Record each stage in task logs using the shared `@logging_template.mdc` so progress is auditable.

2. **ツール実行の明示化 / Explicit Tool Execution**
- リンター、テスト、フォーマッターのコマンドはすべてCodexレスポンス内に記録し、結果をLDDメトリクスへ反映します。
- Every command must be reproducible for CursorやRooが再実行しやすいようにする。

3. **メモリーバンク同期 / Memory Bank Synchronisation**
- Prompt chain checkpoints, generated artefacts, and open issues are appended to `@memory-bank.mdc`.
- これにより、他のエージェントが途中から作業を引き継いでもコンテキストを失いません。

4. **フィードバックループ / Feedback Loop**
- Codex outputはSpecStoryとフィードバックログに反映し、次のイテレーションで改善ポイントを明確化します。

## ワークフロー / Workflow

| フェーズ / Phase | Codexアクション / Codex Action | LDD連携 / LDD Alignment |
|------------------|--------------------------------|-------------------------|
| 計画 / Planning | プロンプトチェーンの設計と制約定義 | タスクログに`codex_prompt_chain`セクションを追加 |
| 実行 / Execution | プロンプト送信と生成物の保存 | ログとメモリーバンクに成果を追記 |
| 検証 / Validation | テストと静的解析の実行 | メトリクスログに結果を記録 |
| 移譲 / Handoff | Cursor/Roo/Devin向けの次アクション整理 | フィードバックログとSpecStoryに要約 |

## ログテンプレートへの追加 / Logging Extensions

- `codex_prompt_chain`: 進行中のステージ、使用したプロンプト、得られた回答を要約。
- `tool_invocations`: 実行したコマンドとステータスを表形式で記録。
- `handoff_summary`: 次の担当エージェントに必要なアクション、残課題、検証フックを列挙。

## メモリ連携 / Memory Integration

```
### Codex Collaboration Snapshot
- Stage: {CURRENT_STAGE}
- Artefacts: {ARTEFACT_LIST}
- Tests: {TEST_RESULTS}
- Pending Follow-up: {FOLLOW_UPS}
```

上記スニペットをメモリーバンクに挿入することで、継続的なコンテキスト共有を実現します。

## マルチエージェント協調 / Multi-Agent Collaboration

- Cursor: Codexが作成したコードやログをレビューし、GUI/UX改善や追加調査を担当。
- Roo: プロジェクトルールとスタイル適用を強化し、Codexの実装を補完。
- Devin: Working Backwardsメソッドで大域的な計画を作成し、Codexのプロンプトチェーンと整合させる。

## ベストプラクティス / Best Practices

1. Codexに送信したプロンプトは再利用できるようテンプレート化して保管する。
2. 大きな変更はステージごとにコミットし、ログにコミットIDを残す。
3. 異常系・失敗例も必ずログへ記録し、次回のプロンプト改善に活用する。
4. 他エージェントとの引き継ぎ時は`handoff_summary`を必須項目として維持する。

## 参考ドキュメント / Related Documents

- `codex/README.md` – Codexディレクトリの構成と利用方法
- `codex/codex_agent_template.mdc` – プロンプトチェーンテンプレート
- `codex/ldd_integration.mdc` – LDD統合の詳細
- `docs/integration_mapping.md` – エージェント間統合マッピング(Devin・Codexを含む)
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- [環境設定](technical/environment.md) - 開発環境のセットアップ
- [ツール設定](technical/tools.md) - 使用ツールの設定方法
- [CI/CD](technical/cicd.md) - 継続的インテグレーション/デプロイメント
- [Codex統合ガイド](codex/integration_guide.md) - CodexエージェントのLDD統合手順

## 運用ドキュメント
- [監視](operations/monitoring.md) - システム監視とアラート
Expand Down
8 changes: 8 additions & 0 deletions docs/instruction_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@

Auto-coder-agent_Cursor_Roo_codeは、ログ駆動開発(LDD)手法を用いたAI支援コーディングシステムです。このシステムは、Cursor IDEと統合され、AIによるコード生成と支援を提供します。

◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢
## Codexエージェント連携 / Codex Agent Integration

- Codexエージェントは`codex/codex_agent_template.mdc`を基点に、プロンプトチェーン形式でCursor/Roo/Devinと協調します。
- Prompt chaining results must be logged in `codex_prompt_chain` sections so all agents can audit the workflow.
- `docs/codex/integration_guide.md`にCodex専用のベストプラクティスとハンドオフ手順を記載しています。
- メトリクスとフィードバックにはCodexの実行結果も含め、LDD全体の継続的改善に活用します。

◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢
## タスク分解

Expand Down
Loading