用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cucuwang/aiase-2026-final-dexuwang627-cloud --skill code-author-dexuwang627-cloud命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | code-author-dexuwang627-cloud |
| description | Produces Python code from task descriptions (max 500 S-LOC) |
| version | 1.0.0 |
| tags | ["code-generation","python"] |
Generate Python code that solves a given programming task description. The output must be self-contained, correct, and pass hidden test cases.
JSON payload with the following structure:
{
"task_id": "task_pair_001",
"task_description": "Write a function that merges overlapping intervals...",
"constraints": {
"entry_function": "merge_intervals",
"max_loc": 500,
"imports_forbidden": ["os", "sys", "subprocess"]
}
}
Fields:
task_id (string, required): Must be passed through to output unchanged.task_description (string, required): Natural language description of the programming task.constraints (object, optional): Contains entry_function (function name), max_loc (S-LOC limit), and imports_forbidden (additional banned imports beyond the defaults).The final result is written to the result file by scripts/run.py, not printed in the chat. The JSON object has this structure:
{
"task_id": "task_pair_001",
"code": "def merge_intervals(intervals: list[list[int]]) -> list[list[int]]:\n ...",
"loc": 12,
"self_test_results": {"passed": 3, "failed": 0},
"rationale": "Standard interval merge with edge-case guards.",
"confidence": 0.9
}
The code field must contain self-contained Python code that:
Analyze: Read the task description carefully. Identify:
Design: Choose the simplest correct approach:
Implement: Write clean Python:
Verify: Use scripts/check.py to validate:
Output: Provide the code as a clean Python snippet.
When generating code, assess confidence based on:
# Validate code from a file
python3 scripts/check.py solution.py
# Or validate directly by providing code as a string argument
# (the checker reads from a file path or stdin)
The checker validates:
Input:
{
"task_id": "pair_001",
"task_description": "Write a function add(a: int, b: int) -> int that returns the sum of two integers.",
"constraints": {"entry_function": "add", "max_loc": 500, "imports_forbidden": []}
}
Output:
{
"task_id": "pair_001",
"code": "def add(a: int, b: int) -> int:\n \"\"\"Return the sum of two integers.\"\"\"\n return a + b",
"confidence": 0.95
}
Input:
{
"task_id": "pair_002",
"task_description": "Write a function find_max(lst: list[int]) -> int that returns the maximum value in a list. Return -1 for empty lists.",
"constraints": {"entry_function": "find_max", "max_loc": 500, "imports_forbidden": []}
}
Output:
{
"task_id": "pair_002",
"code": "def find_max(lst: list[int]) -> int:\n \"\"\"Return the maximum value in a list, or -1 if empty.\"\"\"\n if not lst:\n return -1\n max_val = lst[0]\n for val in lst[1:]:\n if val > max_val:\n max_val = val\n return max_val",
"confidence": 0.9
}
Input:
{
"task_id": "pair_003",
"task_description": "Write a function word_count(text: str) -> dict[str, int] that counts occurrences of each word. Words are separated by whitespace. Case-insensitive.",
"constraints": {"entry_function": "word_count", "max_loc": 500, "imports_forbidden": ["collections"]}
}
Output:
{
"task_id": "pair_003",
"code": "def word_count(text: str) -> dict[str, int]:\n \"\"\"Count occurrences of each word, case-insensitive.\"\"\"\n if not text or not text.strip():\n return {}\n counts: dict[str, int] = {}\n for word in text.lower().split():\n counts[word] = counts.get(word, 0) + 1\n return counts",
"confidence": 0.90
}
Input:
{
"task_id": "pair_004",
"task_description": "Write a function sort_by_length(strings: list[str]) -> list[str] that returns strings sorted by length ascending. Strings of equal length keep their original order.",
"constraints": {"entry_function": "sort_by_length", "max_loc": 500, "imports_forbidden": []}
}
Output:
{
"task_id": "pair_004",
"code": "def sort_by_length(strings: list[str]) -> list[str]:\n \"\"\"Sort strings by length ascending; stable sort preserves original order for ties.\"\"\"\n return sorted(strings, key=len)",
"confidence": 0.95
}
Input:
{
"task_id": "pair_005",
"task_description": "Write a function shortest_path(graph: dict[str, list[str]], start: str, end: str) -> list[str] that returns the shortest path (as a list of nodes) from start to end using BFS. Return empty list if no path exists.",
"constraints": {"entry_function": "shortest_path", "max_loc": 500, "imports_forbidden": []}
}
Output:
{
"task_id": "pair_005",
"code": "def shortest_path(graph: dict[str, list[str]], start: str, end: str) -> list[str]:\n \"\"\"BFS shortest path from start to end. Returns empty list if unreachable.\"\"\"\n if start == end:\n return [start]\n if start not in graph:\n return []\n visited: set[str] = {start}\n queue: list[tuple[str, list[str]]] = [(start, [start])]\n while queue:\n node, path = queue.pop(0)\n for neighbor in graph.get(node, []):\n if neighbor == end:\n return path + [neighbor]\n if neighbor not in visited:\n visited.add(neighbor)\n queue.append((neighbor, path + [neighbor]))\n return []",
"confidence": 0.80
}
scripts/run.py; do not print a fenced JSON block in the chat.task_id must pass through from input unchangedcode must be self-contained Python — no markdown fences around the code itself, no explanations in the chatconfidence must be 0.0–1.0Use this skill when the input is a programming task description asking for Python code generation. The task should specify a function or algorithm to implement. Do not use this skill for code review, debugging, or non-Python tasks.
Read the task description and identify the required function signature, input types, output type, and constraints.
Choose the simplest correct algorithm — prefer standard library, built-in data structures, and iterative solutions over recursion.
Write clean Python code with type hints, docstrings for complex functions, and edge case guards (None, empty, extreme values).
Run python3 scripts/check.py on the generated code to verify syntax, no forbidden imports/calls, and S-LOC ≤ 500. The scripts/ path is relative to this skill's directory — if the terminal's working directory is elsewhere, locate this skill's directory first and run the script from there. If the script cannot be located after one attempt, perform the checks mentally (valid syntax, no forbidden imports, S-LOC ≤ 500) and proceed — do not spend turns searching.
Optionally run python3 scripts/selftest.py on the generated code to count how many sample inputs pass/fail. Extract passed and failed.
Use the terminal tool (do not use process/background tools) with the absolute path to run:
python3 <skill_dir>/scripts/run.py --task_id "<task_id>" \
--code "<your python code>" --loc <int> \
--self_test_passed <int> --self_test_failed <int> \
--rationale "<short reason>" --confidence 0.9
where <skill_dir> is the directory Hermes reports when loading this skill.
scripts/run.py atomically writes the final result to the result file (path from the environment variable AIASE_RESULT_PATH, falling back to ./aiase_result.json).
You do not need to output or repeat the JSON in the chat message.
After generating code:
scripts/check.py <file> to confirm:
scripts/run.py to write the result file.task_id, code, loc, self_test_results, rationale, and confidence.If validation fails, revise the code and re-validate before writing the result file.
基于 SOC 职业分类