用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/aRustyDev/agents --skill implement-from-ir命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Strategic search planning for agent-driven research. Generates structured search-term matrices with tiered fallback strategies, engine-specific operators, and grading criteria before executing any searches. Use this skill whenever research requires more than a single search query — comparing technologies, verifying claims across sources, surveying a landscape, investigating a multi-faceted question, or building evidence for a decision. Do NOT use for quick factual lookups, fetching a single known URL, or questions answerable from a single source. Covers tech, academic, regulatory, and general domains. Think of it as "research planning" — the matrix is the plan, execution comes after.
Create language conversion skills for translating code from language A to language B. Use when building 'convert-X-Y' skills, designing type mappings between languages, establishing idiom translation patterns, or defining conversion methodologies. Provides foundational patterns that specific conversion skills extend.
Guide for translating code between programming languages. Use when converting code from one language to another, planning language migrations, understanding conversion challenges, asking about type mappings, idiom translations, or referencing pattern mappings. Covers APTV workflow, type systems, error handling, concurrency, and language-specific gotchas.
基于 SOC 职业分类
正在显示 SKILL.md
| name | Implement from IR |
| version | 1.0.0 |
| description | Synthesize target language code from IR |
| category | conversion |
| languages | ["python","typescript","rust","java","go","scala","roc","kotlin","swift","elixir"] |
| tools | ["ir-synthesize-python","ir-synthesize-rust","ir-synthesize-typescript","ir-synthesize-go","ir-synthesize-scala","ir-synthesize-roc"] |
Generate idiomatic code in a target language from an Intermediate Representation (IR).
/codebase-implement-from-ir <ir-path> --target <language> [--style <mode>] [--gaps <handling>]
| Parameter | Description | Default |
|---|---|---|
ir-path | Path to IR file (JSON/YAML) | Required |
--target | Target language | Required |
--style | Generation style (minimal, idiomatic, verbose) | idiomatic |
--gaps | Gap handling (warn, error, annotate, ignore) | warn |
Validate the input IR:
Review detected gaps and apply mitigations:
| Gap Severity | Default Action |
|---|---|
| Critical | Halt, require human decision |
| High | Warn, suggest alternatives |
| Medium | Auto-convert with TODO comment |
| Low | Auto-convert silently |
| Info | Log for reference |
Map IR patterns to target idioms:
| Source | Python | Rust | TypeScript | Go | Scala |
|---|---|---|---|---|---|
int | int | i64 | number | int64 | Long |
str | str | String | string | string | String |
bool | bool | bool | boolean | bool | Boolean |
Option[T] | Optional[T] | Option<T> | T | undefined | *T | Option[T] |
Result[T,E] | Result[T,E] | Result<T,E> | Result<T,E> | (T, error) | Either[E,T] |
List[T] | list[T] | Vec<T> | T[] | []T | List[T] |
Dict[K,V] | dict[K,V] | HashMap<K,V> | Map<K,V> | map[K]V | Map[K,V] |
| Pattern | Source IR | Target Transformation |
|---|---|---|
| Pattern Match | MatchExpression | switch/if-else chain (if needed) |
| ADT | TypeDef.adt | sealed class/enum |
| Type Class | TypeClassDef | trait/interface + instances |
| Async | AsyncAnnotation | async/await, Future, goroutine |
| Error Handling | ResultType | Result, Either, (T, error) |
Generate syntactically correct code:
Apply target-language conventions:
Format code with target's standard tools:
black, ruffrustfmtprettiergofmtscalafmtoutput/
├── src/
│ ├── models.{ext} # Type definitions
│ ├── services.{ext} # Functions and methods
│ └── utils.{ext} # Helper functions
├── tests/
│ └── test_models.{ext} # Generated test stubs
├── Cargo.toml # (Rust) Package manifest
├── pyproject.toml # (Python) Package manifest
└── GAPS.md # Gap resolution notes
# Gap Resolution Report
## Critical Gaps (Require Human Decision)
### 1. Higher-Kinded Types (SC-001)
- **Source**: `Functor[F[_]]` in `types.scala`
- **Target**: TypeScript
- **Issue**: TypeScript cannot express HKT
- **Options**:
1. Monomorphize to specific types (List, Option, etc.)
2. Use type-level programming with conditional types
3. Simplify to concrete implementation
## High Severity Gaps (Auto-Converted with Warning)
### 1. Ownership Transfer (RS-001)
- **Source**: `fn take(self)` in `entity.rs`
- **Target**: Python
- **Resolution**: Converted to normal method, added runtime validation
Target these levels in order of priority:
Same observable behavior in all cases:
Follows target conventions even if slightly different:
Efficient for target platform:
/codebase-implement-from-ir analysis.ir.json --target rust
/codebase-implement-from-ir analysis.ir.json --target python --style verbose
/codebase-implement-from-ir analysis.ir.json --target go --gaps error