porting-to-rs

Convert GraphReFly TypeScript slices into Rust implementations per the canonical spec.

1|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/graphrefly/graphrefly-ts --skill porting-to-rs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: porting-to-rs
Source: https://github.com/graphrefly/graphrefly-ts/tree/main/.claude/skills/porting-to-rs
Command: npx skills add https://github.com/graphrefly/graphrefly-ts --skill porting-to-rs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill guides safe, spec-aligned porting of a GraphReFly slice from TypeScript to the Rust workspace without drifting from the canonical post-Phase 13.6.A behavior.

Core Features & Use Cases

  • Spec-first Rust porting workflow: Enforces reading and implementation against the canonical Rust spec document, not current TS structure.
  • Parallelized research + architecture HALT: In full mode, requires a “HALT → Architecture Discussion → user approval” step before any code changes for the slice.
  • Parity-grade implementation loop: Directs implementation, rule-referenced tests, clippy/fmt self-checks, and (when applicable) parity-test scenario widening.
  • Cross-repo drift prevention: Uses migration-status, porting-deferred, flowcharts, and TLA+ research to avoid reintroducing deferred concerns or violating handle-protocol/lock/refcount invariants.

Quick Start

Use the porting-to-rs skill when you want to implement or extend a GraphReFly Rust port slice in graphrefly-rs based on the canonical TS/Rust spec, by running it with a task description like: porting-to-rs --light “implement Rust parity for the next dispatcher slice and add the required self-test coverage”

Frequently Asked Questions about porting-to-rs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I port TypeScript code to Rust without spec drift?

Porting TypeScript to Rust without spec drift requires enforcing a spec-first workflow that reads and implements against the canonical Rust spec document, rather than copying current TS structure. This prevents behavioral divergence during the porting process.

What is the best way to ensure concurrency safety when porting to Rust?

Ensuring concurrency safety when porting to Rust requires strict refcount and lock discipline, forbidding unsafe code, and enforcing sync-only core constraints. These guardrails prevent race conditions and maintain memory safety during parallel execution.

Do I need user approval before implementing a Rust port slice?

Yes, full-mode Rust porting requires a HALT step for architecture discussion and user approval before any code changes. This ensures deterministic planning and prevents unauthorized modifications to the Rust workspace.

How do I maintain parity tests when adding Rust functionality?

Maintaining parity tests when adding Rust functionality involves running rule-referenced tests, clippy and fmt self-checks, and widening parity-test scenarios when applicable. This ensures the Rust implementation matches canonical spec behavior.

Can I use unsafe code in a Rust port implementation?

No, the Rust port implementation forbids unsafe code entirely. It enforces sync-only core constraints and strict refcount and lock discipline to guarantee memory safety and concurrency safety without unsafe blocks.

How to prevent cross-repo drift when porting to Rust?

Preventing cross-repo drift when porting to Rust requires using migration-status tracking, porting-deferred lists, flowcharts, and TLA+ research. These tools avoid reintroducing deferred concerns or violating handle-protocol, lock, and refcount invariants.