coding-skill
スター15
フォーク3
更新日2026年4月7日 07:51
Python Coding Standards & Best Practices for Spec2RTL-Agent & EDA Development
インストール
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SKILL.md
readonlyメニュー
Python Coding Standards & Best Practices for Spec2RTL-Agent & EDA Development
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | coding_skill |
| description | Python Coding Standards & Best Practices for Spec2RTL-Agent & EDA Development |
This document outlines the mandatory coding standards, architectural principles, and EDA-specific development practices for the Antigravity AI agent. Adherence to these guidelines is non-negotiable to ensure maximum modularity, readability, and maintainability of the hardware generation pipeline.
black (with an 88-character line limit) and ruff for linting.typing module). This is critical for EDA tools where data types (e.g., AST nodes, binary strings, file paths) frequently cross boundaries.
def parse_verilog_ast(filepath: Path) -> Dict[str, Any]:def parse_verilog(filepath):Args:, Returns:, and Raises: sections explicitly.pathlib.Path for file system operations instead of os.path. EDA tools involve heavy file manipulation (RTL files, GDSII, logs, TCL scripts); pathlib ensures cross-platform reliability.ProgressiveCoder writes code; Verifier tests code; LibrelaneRunner executes CLI).abc module to define interfaces for swappable components.
class BaseLLM(ABC): must define abstract methods like generate(). OpenAILLM and LocalOllamaLLM will inherit and implement this.class BaseHLSCompiler(ABC): must define synthesize().pydantic models) rather than using global variables or deeply nested dictionaries.pydantic-settings).subprocess module with explicit timeout arguments to prevent hanging processes.stdout and stderr streams independently.process.returncode == 0). If a tool fails, wrap the standard error in a custom Python exception.builds/run_YYYYMMDD_HHMMSS/).pycparser or tree-sitter) over complex Regex if possible. If Regex must be used, compile the patterns globally and comment them extensively.LibrelaneManager.generate_tcl() method twice with the same inputs must yield the exact same file hash.openai or anthropic directly into functional logic. Use an intermediary wrapper layer (like litellm or a custom proxy class) so the backend can route to local or cloud models interchangeably..jinja2 or .txt) in a dedicated prompts/ directory. Load and inject variables at runtime.pydantic before passing it to the next EDA stage.Spec2RTLError(Exception) (Base)LLMRateLimitError(Spec2RTLError)HLSSynthesisFailedError(Spec2RTLError)PhysicalDesignRoutingError(Spec2RTLError)logging module. Console logs should be readable for the user (INFO level), but file logs must be highly detailed (DEBUG level), including raw LLM prompts, tool CLI arguments, and execution times.ReflectionAgent for debugging.pytest.unittest.mock to mock tool return codes, API responses, and file outputs.