afd-rust

Implement Rust AFD commands with error handling and registry patterns.

4|1|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/lushly-dev/afd --skill afd-rust
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: afd-rust
Source: https://github.com/lushly-dev/afd/tree/main/.claude/skills/afd-rust
Command: npx skills add https://github.com/lushly-dev/afd --skill afd-rust

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires afd, tokio, serde, serde_json, async-trait, and includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide and practical examples for implementing Agent-First Development (AFD) commands using Rust, ensuring robust command definition, error handling, and integration within the AFD ecosystem.

Core Features & Use Cases

  • Command Definition: Learn to define commands with parameters, schemas, and handlers using the afd crate.
  • Error Handling: Implement sophisticated error management with custom error codes, suggestions, and retry logic using CommandResult and CommandError.
  • Registry & Execution: Understand how to build and manage a CommandRegistry for command discovery and execution, including batch and streaming operations.
  • Metadata & Testing: Utilize metadata types for richer command feedback and implement unit and async tests for reliability.
  • Use Case: You are building a new microservice in Rust that needs to expose capabilities as AFD commands. This Skill will guide you through defining your commands, handling various success and failure scenarios, and ensuring your commands are discoverable and testable.

Quick Start

Use the afd-rust skill to see an example of defining a new command using the CommandHandler trait.

Frequently Asked Questions about afd-rust

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

FAQPage Schema
How do I define AFD commands in Rust using the afd crate?

To define AFD commands in Rust, you implement the CommandHandler trait using the afd crate, specifying parameters, JSON schemas, and handler logic for structured inputs and outputs.

What's the best way to handle errors in Rust AFD commands?

The best way to handle errors in Rust AFD commands is using CommandResult and CommandError types, which support custom error codes, contextual suggestions, and retry logic for robust failure management.

How does a CommandRegistry work for batch and streaming execution in Rust?

A CommandRegistry in Rust manages AFD command discovery and execution, enabling batch processing and streaming operations by registering handlers that can be dynamically resolved and invoked.

Can I build an MCP server in Rust using afd command patterns?

Yes, you can build an MCP server in Rust using afd command patterns, as the framework provides structured command definition, schema validation, and registry execution required for server integration.

Do I need tokio and async-trait to implement AFD commands in Rust?

Yes, tokio and async-trait are required dependencies for implementing AFD commands in Rust, as the framework uses asynchronous handlers and traits to support concurrent command execution and streaming.

How do I test async AFD commands in Rust?

You test async AFD commands in Rust by writing unit and async tests that validate command handlers, error scenarios, and metadata outputs using the afd crate's testing strategies and CommandResult assertions.