Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0012629
clean
harumiWeb Feb 5, 2026
0447eda
Implement patch runner for Excel workbooks with support for set_value…
harumiWeb Feb 5, 2026
01113b7
feat: Enhance patch functionality with auto_formula support and struc…
harumiWeb Feb 5, 2026
18ed53f
feat: Update FEATURE_SPEC and TASKS for review requirements and clari…
harumiWeb Feb 6, 2026
04c9699
feat: Update FEATURE_SPEC and TASKS for extension requirements; enhan…
harumiWeb Feb 6, 2026
5e35dd2
update
harumiWeb Feb 6, 2026
0ae7df5
feat: Update FEATURE_SPEC and TASKS for next phase features; add spec…
harumiWeb Feb 6, 2026
c0cce6e
feat: enhance patch operations with new features and validations
harumiWeb Feb 6, 2026
92d27ed
feat: enhance PatchOp model with detailed operation descriptions and …
harumiWeb Feb 8, 2026
5100866
update
harumiWeb Feb 8, 2026
eb869ce
feat: add alpha_col option to convert column keys to Excel-style name…
harumiWeb Feb 8, 2026
9cc0f69
feat: add merged_ranges output for alpha_col option and update relate…
harumiWeb Feb 8, 2026
a555b69
feat: update MCP documentation and extract options to reflect alpha_c…
harumiWeb Feb 16, 2026
8421741
feat: normalize `ops` input in `exstruct_patch` to accept both object…
harumiWeb Feb 16, 2026
397f1f1
更新
harumiWeb Feb 16, 2026
63999a4
feat: improve MCP mode and chunk specification guide, enhance error m…
harumiWeb Feb 16, 2026
7954e63
remove
harumiWeb Feb 16, 2026
60d168a
feat: Add read range, read cells, and read formulas tools
harumiWeb Feb 16, 2026
69c20ce
feat: Add release notes for v0.4.4, detailing new Excel editing MVP, …
harumiWeb Feb 16, 2026
068919b
feat: Add Codacy Issues Fetcher skill with workflow and error handlin…
harumiWeb Feb 16, 2026
54a18df
fix: address PR57 review comments
harumiWeb Feb 16, 2026
db7f7ba
Merge remote-tracking branch 'origin/main' into feat/edit-mcp
harumiWeb Feb 17, 2026
9c76ede
fix: regenerate uv.lock after merging main
harumiWeb Feb 17, 2026
66bf289
fix: use StrEnum for fallback reason enum
harumiWeb Feb 17, 2026
a278d87
feat: Update patch operation documentation and improve test assertions
harumiWeb Feb 17, 2026
bbb2510
fix: handle app termination gracefully in test_shapes_extraction
harumiWeb Feb 17, 2026
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
54 changes: 54 additions & 0 deletions .agents/skills/codacy-issues-fetcher/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: codacy-issues-fetcher
description: Retrieve and format Codacy analysis issues by running `scripts/codacy_issues.py` in the ExStruct workspace. Use when users ask to inspect repository or pull-request Codacy findings, filter by severity, or produce structured issue output for review and fix planning.
---

# Codacy Issues Fetcher

Run `scripts/codacy_issues.py` as the primary interface to Codacy issue retrieval.
Avoid reimplementing API calls unless the script itself must be changed.

## Workflow

1. Confirm prerequisites.
- Run from repository root so `scripts/codacy_issues.py` is reachable.
- Ensure `CODACY_API_TOKEN` is set and valid.
- Prefer explicit `org` and `repo` if user provides them; otherwise rely on Git `origin` auto-detection.

2. Choose scope and severity.
- Repository scope: omit `--pr`.
- Pull request scope: pass `--pr <number>`.
- Severity filter (`--min-level`): `Error`, `High`, `Warning`, `Info`.
- Provider (`--provider`): `gh`, `gl`, `bb` (default is effectively `gh`).

3. Run one of the command patterns.

```powershell
# Repository issues (explicit target)
python scripts/codacy_issues.py <org> <repo> --provider gh --min-level Warning

# Pull request issues (explicit target)
python scripts/codacy_issues.py <org> <repo> --pr <number> --provider gh --min-level Warning

# Pull request issues (auto-detect org/repo from git origin)
python scripts/codacy_issues.py --pr <number> --min-level Warning
```

4. Parse output JSON and respond with actionable summary.
- Trust payload fields: `scope`, `organization`, `repository`, `pullRequest`, `minLevel`, `total`, `issues`.
- `issues` entries are formatted as:
`<level> | <file_path>:<line_no> | <rule> | <category> | <message>`
- Report high-severity findings first, then summarize counts.

## Error Handling

- `HTTP 401` / `Unauthorized`: token invalid or missing permissions. Ask user to set or refresh `CODACY_API_TOKEN`.
- `CODACY_API_TOKEN is not set`: export the environment variable before retrying.
- `Invalid --provider`: use only `gh`, `gl`, or `bb`.
- Segment validation errors (`Invalid org/repo/pr`): sanitize input and rerun.

## Output Policy

- Return concise triage-ready results, not raw command logs.
- Include the exact command you used when reproducibility matters.
- If no issues match the selected `--min-level`, state that explicitly.
4 changes: 4 additions & 0 deletions .agents/skills/codacy-issues-fetcher/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
interface:
display_name: "Codacy Issues Fetcher"
short_description: "Run codacy_issues.py to fetch and triage Codacy findings"
default_prompt: "Use $codacy-issues-fetcher to collect Codacy issues for this repository or PR and summarize the highest-priority fixes."
2 changes: 2 additions & 0 deletions .bandit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bandit]
exclude_dirs = tests,benchmark
1 change: 1 addition & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
exclude_paths:
- "benchmark/**"
- "tests/**"
102 changes: 13 additions & 89 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,10 @@ AI は必ず次のルールに従ってコードを生成してください。

### 2.4 import の順序

```

1. 標準ライブラリ
2. サードパーティ
3. exstruct 内のモジュール

```

### 2.5 Docstring(Google スタイル)

関数・クラスには必ず Docstring を付ける。
Expand Down Expand Up @@ -111,51 +107,7 @@ AI は必要であれば **禁止事項を回避するためにリファクタ

---

# 5. AI に依頼するときの標準プロンプト(Developer Prompt)

AI に実装依頼する際は、以下のフォーマットが推奨されます。

```

あなたは ExStruct のコア開発エンジニアです。
mypy strict + Ruff check を完全に通過するコードのみ生成してください。

遵守事項:

- 型ヒント完全
- 境界は BaseModel、内部は dataclass を返す
- 1 関数 = 1 責務
- import 順序厳守
- Google スタイルの docstring
- 外部ライブラリ(xlwings, pandas)は Any 扱い
- 複雑度を抑えること
- 必要に応じて補助関数を追加して良い

出力は Python コードのみ。

```

---

# 6. AI にエラー修正を依頼する際のルール

mypy / Ruff のエラーが出た場合、AI への指示は次のテンプレートを使用します:

```

以下は mypy / Ruff のエラーメッセージです。
すべてのエラーが解消されるようにコードを修正してください。

<エラー全文>

```

AI は差分修正タスクが得意なため、
この方式が最も効率的かつ正確です。

---

# 7. AI の責務外(人間が担当する領域)
# 5. AI の責務外(人間が担当する領域)

AI は以下の領域は担当しません。人間が判断します。

Expand All @@ -168,45 +120,17 @@ AI は以下の領域は担当しません。人間が判断します。

---

# 8. AI を開発パイプラインと組み合わせる例

推奨フロー:

1. 人間:仕様を記述
2. AI:コード生成(テンプレート+ガイドラインに従う)
3. 自動:`mypy strict` チェック
4. 自動:`ruff check --fix`
5. AI:エラー出たら修正
6. 人間:レビューしてマージ

このサイクルにより **高速 & 高品質の開発が可能** になります。

---

# 9. 最終目標

AI エージェントが ExStruct のコードを書く場合でも:

- バグのない型安全なコード
- 一貫したコーディングスタイル
- 仕様の誤解を最小化した実装
- 人間が安心してレビューできるコード

を常に提供できるようにする。

この AGENTS ガイドラインは
**Codex / ChatGPT を“チームメンバー”として扱うための基盤** です。

---

# 10. 各種仕様の確認

AI エージェントは必要に応じて以下のドキュメントを参照して ExStruct の開発をする
# 6. 遵守すべき作業手順

- 処理アーキテクチャ: `docs/architecture/pipeline.md`
- プロジェクトアーキテクチャ: `docs/contributors/architecture.md`
- コーディングガイドライン: `docs/agents/CODING_GUIDELINES.md`
- データモデル: `docs/agents/DATA_MODEL.md`
- タスク: `docs/agents/TASKS.md`
AI はコード生成前に以下の手順を必ず踏んでください。

**以上。AI はこのガイドラインに従って ExStruct の開発に参加してください。**
1. **要件の理解**:仕様書や設計資料を読み込み、要件を完全に理解する
2. **設計の検討**:必要に応じて関数分割やモデル設計を検討する。
3. **仕様の定義**: 要件に基づいて、関数の引数・戻り値の型を定義する。
4. **タスクの割り当て**: 各タスクを明確に定義し、実装順序を決定する。
5. **コード実装**: 上記の基準を守りながらコードを実装する。
6. **コードレビュー**: 自動生成されたコードを自己レビューし、品質基準を満たしているか確認する。
7. **テストコードの生成**: 必要に応じて、テストコードも生成する。
8. **テストの実行**: 生成されたテストコードを実行し、期待通りの動作を確認する。
9. **静的解析**: `uv run task precommit-run` を実行し、mypy / Ruff エラーがないことを確認する。
10. **ドキュメントの更新**: 変更があれば、関連するドキュメントも更新する。
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ All notable changes to this project are documented in this file. This changelog

- _No unreleased changes yet._

## [0.4.4] - 2026-02-16

### Added

- Added an MVP of Excel editing for MCP via `exstruct_patch`, including atomic apply semantics and expanded operations: `set_range_values`, `fill_formula`, `set_value_if`, and `set_formula_if`.
- Added direct A1-oriented MCP read tools for extracted JSON: `exstruct_read_range`, `exstruct_read_cells`, and `exstruct_read_formulas`.
- Added patch safety/review options: `dry_run`, `return_inverse_ops`, `preflight_formula_check`, and `auto_formula`.

### Changed

- Improved `exstruct_patch` input compatibility: `ops` now accepts both object lists (recommended) and JSON object strings.
- Enabled `alpha_col` support more broadly across extraction/read flows, and added `merged_ranges` output support for alpha-column mode.
- Updated MCP documentation and chunking guidance, including clearer error messages and mode guidance.
- Changed MCP default conflict policy to `overwrite` for output handling.

## [0.4.2] - 2026-01-23

### Changed
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ exstruct-mcp --root C:\data --log-file C:\logs\exstruct-mcp.log --on-conflict re
Available tools:

- `exstruct_extract`
- `exstruct_patch`
- `exstruct_read_json_chunk`
- `exstruct_validate_input`

Notes:

- In MCP, `exstruct_extract` defaults to `options.alpha_col=true` (column keys: `A`, `B`, ...). Set `options.alpha_col=false` for legacy 0-based numeric string keys.
- Logs go to stderr (and optionally `--log-file`) to avoid contaminating stdio responses.
- On Windows with Excel, standard/verbose can use COM for richer extraction. On non-Windows, COM is unavailable and extraction uses openpyxl-based fallbacks.

Expand Down
2 changes: 2 additions & 0 deletions docs/README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ exstruct-mcp --root C:\data --log-file C:\logs\exstruct-mcp.log --on-conflict re
Available tools:

- `exstruct_extract`
- `exstruct_patch`
- `exstruct_read_json_chunk`
- `exstruct_validate_input`

Notes:

- In MCP, `exstruct_extract` defaults to `options.alpha_col=true` (column keys: `A`, `B`, ...). Set `options.alpha_col=false` for legacy 0-based numeric string keys.
- Logs go to stderr (and optionally `--log-file`) to avoid contaminating stdio responses.
- On Windows with Excel, standard/verbose can use COM for richer extraction. On non-Windows, COM is unavailable and extraction uses openpyxl-based fallbacks.

Expand Down
7 changes: 7 additions & 0 deletions docs/README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,16 @@ exstruct-mcp --root C:\data --log-file C:\logs\exstruct-mcp.log --on-conflict re
利用可能なツール:

- `exstruct_extract`
- `exstruct_patch`
- `exstruct_read_json_chunk`
- `exstruct_read_range`
- `exstruct_read_cells`
- `exstruct_read_formulas`
- `exstruct_validate_input`

- `exstruct_read_range` / `exstruct_read_cells` / `exstruct_read_formulas` は v0.4.4 で追加され、MCPサーバー実装とテストに登録済みです。
- MCPでは `exstruct_extract` の `options.alpha_col=true` が既定です(列キーは `A`, `B`, ...)。従来の0始まり数値キーが必要な場合は `options.alpha_col=false` を指定してください。

注意点:

- 標準入出力の応答を汚染しないよう、ログは標準エラー出力(およびオプションで`--log-file`で指定したファイル)に出力されます。
Expand Down
68 changes: 0 additions & 68 deletions docs/agents/API_DESIGN.md

This file was deleted.

Loading
Loading