create-extension

Implements Flare TEE extensions with handlers, state, and InstructionSender Solidity contracts.

Updated Aug 1, 2026
One-click install
npx skills add https://github.com/charlesms1246/Cifra --skill create-extension-charlesms1246
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-extension
Source: https://github.com/charlesms1246/Cifra/tree/main/tee-extension/skills/create-extension
Command: npx skills add https://github.com/charlesms1246/Cifra --skill create-extension-charlesms1246

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building a Flare TEE extension requires coordinating an off-chain HTTP handler app, an on-chain InstructionSender Solidity contract, and a Docker deployment, with strict protocol rules (OPType routing, DataFixed decoding, ActionResult status codes) that are easy to get wrong. ## Core Features & Use Cases - Architecture Guidance: Separates developer-editable code (configuration, types, handlers, contract, tests) from infrastructure (HTTP server, routing, DataFixed parsing, state locking) in any programming language. - Protocol Specification: Defines the full instruction lifecycle, handler signature (state, msg) -> (data, status, err), ActionResult status codes, async processing via the sign server, and bytes32 string encoding rules. - Contract Integration: Explains how to write the InstructionSender Solidity contract with matching bytes32 constants, TEE machine selection, fee forwarding, and correct message encoding. - Use Case: A developer wants to add a new operation to a Flare TEE extension — the Skill walks them through defining OPType constants, writing the handler, updating the Solidity contract, and verifying the build. ## Quick Start Use the create-extension skill to add a new SAY_HELLO operation to my Flare TEE extension, including the handler and the matching InstructionSender contract function.

Frequently Asked Questions about create-extension

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

FAQPage Schema
How do I build a Flare TEE extension?

Define OPType constants and a version, define request/response/state types, write handler functions with signature (state, msg) -> (data, status, err), register them with the framework, and add matching bytes32 constants and send functions to the InstructionSender Solidity contract.

How does the InstructionSender contract send instructions to a TEE extension?

The contract calls sendInstructions on TeeExtensionRegistry with a TeeInstructionParams struct containing opType, opCommand, and message. It selects TEE machines via getRandomTeeIds, must be payable, and forwards at least 1000 wei as the fee.

What programming languages can I use for a TEE extension?

The skill is language-independent; Go, Python, and TypeScript scaffolds exist. You implement configuration, types, handlers, and tests in your language while the infrastructure layer handles HTTP serving, routing, and state locking.

Why does my TEE extension return unsupported op type?

This happens when the OPType string constants in your handler code do not exactly match the bytes32 constants in the Solidity contract. Strings are UTF-8 encoded, right-padded with zero bytes to 32 bytes, then hex-encoded, so any mismatch causes routing to fail.

How do I handle long-running tasks in a TEE extension?

Return a status of 2 or higher immediately to indicate pending, continue processing in the background, then POST the final ActionResult to the TEE node's /result endpoint on SIGN_PORT. Send intermediate updates only with strictly lower status values.

Should I ABI-encode the message passed to sendInstructions?

No. Pass the _message bytes directly to params.message unless your handler specifically expects ABI-encoded data. Double-wrapping with abi.encode is a common mistake that breaks decoding on the extension side.