writing-ast-check
Create AST-based checks for evaluating generated Python code quality
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Create AST-based checks for evaluating generated Python code quality
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Lint prose against Simplified Technical English (ASD-STE100) rules. Use when the user asks to check, lint, or simplify technical writing (specs, manuals, procedures, docs) for STE compliance, or mentions ASD-STE100 or Simplified Technical English.
Any time committing, pushing, or creating new revisions is mentioned, use this commit flow.
Step-by-step procedure for building a Claude Code channel integration. Use when creating a new channel plugin that connects Claude Code to external systems via MCP, named pipes, webhooks, or chat platforms.
This skill should be used when the user asks to "set up a dev environment", "create a workspace", "open a browser pane", "split terminal", "spin up frontend and backend", "use cmux", "manage cmux panes", "run commands in cmux", or mentions cmux workspaces, panes, surfaces, or browser automation. Provides workflow guidance for orchestrating multi-pane development environments with terminal and browser surfaces.
Use when merging a stack of stacked PRs with jj. Triggered by phrases like "merge the PR stack", "merge the stacked PRs", "land these PRs", or "merge the stack into main".
Use when addressing PR review comments on stacked jj branches. Triggered by phrases like "address review comments", "fix PR feedback", "respond to review on stacked branch", or "update the PR with reviewer suggestions".
| name | writing-ast-check |
| description | Create AST-based checks for evaluating generated Python code quality |
This process documents how to create robust, AST-based checks for evaluating the quality of AI-generated Python code.
Clearly specify what you're checking for:
Example: We want to ensure generated code uses modern Python union syntax (str | None) instead of legacy Optional[str] from the typing module.
Acceptance criteria:
| None syntaxOptional[T] syntaxCreate a dedicated function in AST helpers: evals/<eval_name>/ast_helpers.py
Update evals/<eval_name>/checks.py:
class EvalResult:
# Used the writing-services skill
used_service_skill = Check(default=False, passed=True)
# Used | None instead of Optional
used_none_instead_of_optional = Check(default=False, passed=True)
def to_dict(self) -> dict:
"""Convert eval results to a dictionary for logging."""
return {
"used_service_skill": self.used_service_skill.did_pass(),
"used_none_instead_of_optional": self.used_none_instead_of_optional.did_pass(),
}
Update __main__.py to run the check after the agent completes:
from .ast_helpers import check_uses_union_none_syntax
async def main(gym_project_directory: Path) -> None:
# ... agent execution code ...
# Check if the generated logger.py uses | None instead of Optional
logger_file_path = gym_project_directory / "jack-software/evals/logger.py"
if check_uses_union_none_syntax(logger_file_path):
eval_result.used_none_instead_of_optional.mark(True)
# ... logging code ...
Add a class to the test_ast_helpers.py with test cases.
Run the tests:
make test-services-eval