0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GraphForge 改修モード:構造化リファクタリング

Posted at

上記の続報です。


GraphForge 改修モード:主要ポイント

ディレクトリ構成

C:\work\GraphForge
├── build/<ID>/app/structure.json
├── dashboard.py
└── langgraph_v21/
    ├── consistency.py
    ├── graph_build.py
    ├── refactor_graph.py
    └── structure_writer.py

静的チェック (consistency.py)

import ast, json
from typing import Dict, List

def quick_check(files: Dict[str,str]) -> List[str]:
    issues: List[str] = []
    for fn, content in files.items():
        if not content.strip():
            issues.append(f"{fn} is empty")
        if "TODO" in content:
            issues.append(f"{fn} contains TODO comment")
        try:
            if fn.endswith('.py'):
                ast.parse(content)
            elif fn.endswith('.json'):
                json.loads(content)
        except Exception as e:
            issues.append(f"{type(e).__name__} in {fn}: {e}")
    return issues

UIフロー (dashboard.py)

[1] プロジェクト選択
[2] ファイル選択
[3] 改修指示入力
[4] 指示確認
[5] 改修実行 → 差分プレビュー
[6] 上書き保存

改修例

# Before
def greet(name):
    # TODO: default
    return f"Hello, {name}"

# After (指示:「省略時は"World"を使う」)
def greet(name: str = "World"):
    return f"Hello, {name}"

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?