Receber por email
← Voltar para o catálogo

nondominium-holochain-dna-dev

Specialized skill for nondominium Holochain DNA development, focusing on zome creation, entry patterns, integrity/coordinator architecture, ValueFlows compliance, and WASM optimization. Use when creating new zomes, implementing entry types, or modifying Holochain DNA code.

239estrelas
Atualizado há 6 meses

Ver no GitHub ↗ Licença: NOASSERTION

Como adicionar

/plugin marketplace add Microck/ordinary-claude-skills

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/nondominium-holochain-dna-dev-mpsnztsa/svg)](https://www.skillteca.com.br/skills/nondominium-holochain-dna-dev-mpsnztsa)
#ai

Skills relacionadas

Ver todas de DevOps e Infra →

Alerta por categoria

Receba novas skills de DevOps e Infra toda segunda

1 email curto, só com as skills novas de DevOps e Infra. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

Nondominium Holochain DNA Development

This skill transforms Claude into a specialized nondominium Holochain DNA development assistant, providing expert guidance for creating zomes, implementing entry patterns, and following ValueFlows standards.

When to Use This Skill

Use this skill when:

  • Creating new zomes or modifying existing DNA code
  • Implementing entry types and validation functions
  • Working with integrity/coordinator architecture
  • Following ValueFlows compliance patterns
  • Optimizing WASM compilation and performance
  • Implementing capability-based access control
  • Creating cross-zome communication patterns

Do NOT use for:

  • Testing workflows (use the Tryorama testing skill)
  • Frontend/UI development (use appropriate web development skills)
  • Generic Holochain development outside nondominium context

Core DNA Development Workflows

1. Zome Creation Workflow

Create new zomes following nondominium's 3-zome architecture pattern:

  1. Initialize Zome Structure

``bash ./scripts/create_zome.sh <zome_name> both ``

  1. Implement Integrity Layer
  2. Define entry types in lib.rs
  3. Add validation functions
  4. Define link types and relationships
  5. See assets/entry_types/ for templates
  1. Implement Coordinator Layer
  2. Import integrity types: use zome_<name>_integrity::*;
  3. Implement CRUD functions following naming conventions
  4. Add cross-zome calls for business logic
  5. See assets/function_templates/ for patterns
  1. Configure Dependencies

``toml # Cargo.toml [zome_traits] hdk_integrity = "zome_<name>_integrity" ``

  1. Validate Structure

``bash ./scripts/sync_integrity_coordinator.sh <zome_name> ``

2. Entry Creation Workflow

Follow ValueFlows-compliant entry patterns:

  1. Define Entry Structure - NO TIMESTAMP FIELDS

```rust #[hdk_entry_helper] #[derive(Clone, PartialEq)] pub struct EconomicResource { // Business fields pub resource_specification: ActionHash, // Link to spec pub current_state: String,

// Agent information (NO timestamps!) pub created_by: AgentPubKey, } ```

  1. Create Input Structure

``rust #[derive(Serialize, Deserialize, Debug)] pub struct CreateEconomicResourceInput { pub resource_specification: ActionHash, pub current_state: String, } ``

  1. Implement Create Function
  2. Get agent pubkey: agent_info()?.agent_initial_pubkey
  3. Validate input data
  4. Create entry with NO created_at field
  5. Create discovery links for global access
  6. Create agent links for ownership tracking
  7. Handle errors with custom error types
  1. Add Discovery Patterns

```rust // Global anchor - discoverable by everyone let path = Path::from("resources"); create_link(path.path_entry_hash()?, entry_hash, LinkTypes::AllResources, LinkTag::new("resource"))?;

// Agent link - discoverable by agent create_link(agent_pubkey, entry_hash, LinkTypes::AgentToResources, LinkTag::new("created"))?;

// Hierarchical link - facility to its specification create_link(facility_hash, spec_hash, LinkTypes::SpecificationToFacility, LinkTag::new("implements"))?; ```

  1. Get Timestamps from Action Headers When Needed

``rust let record = get(entry_hash, GetOptions::default())?; let action = record.action().as_create()?; let created_at = action.timestamp(); ``

3. Build and Validation Workflow

  1. Build WASM

``bash ./scripts/build_wasm.sh release [zome_name] ``

  1. Validate Patterns

``bash ./scripts/validate_entry.sh <zome_name> ``

  1. Check Performance
  2. Monitor WASM file sizes (target < 500KB per zome)
  3. Review optimization suggestions
  4. Test memory usage patterns
  1. Package hApp

``bash ./scripts/package_happ.sh production ``

Critical Holochain DNA Patterns

✅ CORRECT Data Structure Patterns

NEVER use SQL-style foreign keys in entry fields!

// ❌ WRONG - Direct ActionHash references
struct BadFacility {
    pub facility_hash: ActionHash,  // SQL-style foreign key
    pub owner: ActionHash,        // Should be a link instead
}

// ✅ CORRECT - Use links for relationships
struct GoodFacility {
    pub conforms_to: ActionHash,     // Link to specification
    // No direct references to other entries
}

// ✅ CORRECT - Link patterns for relationships
create_link(facility_hash, owner_hash, LinkTypes::FacilityToOwner, LinkTag::new("managed_by"))?;

✅ NO Manual Timestamps

Use Holochain's built-in header metadata:

// ❌ WRONG - Manual timestamps
struct BadEntry {
    pub created_at: Timestamp,    // Redundant!
    pub updated_at: Timestamp,    // Redundant!
}

// ✅ CORRECT - No timestamps in entries
struct GoodEntry {
    pub name: String,
    pub description: String,
    // No created_at/updated_at fields
}

// Get timestamps from action header when needed:
let record = get(entry_hash, GetOptions::default())?;
let action = record.action().as_create()?;
let created_at = action.timestamp();

✅ CORRECT Entry Definition Pattern (Updated 2025)

Use #[hdk_entry_helper] macro with proper validation requirements:

#[hdk_entry_helper]
#[derive(Clone, PartialEq)]
pub struct FacilitySpecification {
    pub name: String,
    pub description: String,
    pub facility_type: String, // Use Display impl for enums
    pub created_by: AgentPubKey,
    pub is_active: bool,
    // NO ActionHash fields for relationships
}

#[hdk_entry_types]
#[unit_enum(UnitEntryTypes)]
pub enum EntryTypes {
    #[entry_def(required_validations = 2)]  // Specify validation requirements
    FacilitySpecification(FacilitySpecification),

    #[entry_def(required_validations = 2)]
    EconomicFacility(EconomicFacility),

    #[entry_def(required_validations = 3)]  // Higher validation for bookings
    FacilityBooking(FacilityBooking),

    #[entry_def(required_validations = 2, visibility = "private")]
    PrivateFacilityData(PrivateFacilityData),
}

🆕 NEW - Advanced Validation Options:

#[hdk_entry_types]
#[unit_enum(UnitEntryTypes)]
pub enum EntryTypes {
    // Public entry with standard validation
    #[entry_def(required_validations = 2)]
    PublicEntry(PublicEntry),

    // Private entry with higher validation
    #[entry_def(required_validations = 5, visibility = "private")]
    PrivateEntry(PrivateEntry),

    // Entry with custom name
    #[entry_def(name = "custom_entry", required_validations = 3)]
    CustomEntry(CustomEntry),
}

🆕 NEW - Base64 Agent Keys Option: For web-compatible applications, consider base64 encoded agent keys:

#[hdk_entry_helper]
#[derive(Clone, PartialEq)]
pub struct FacilitySpecification {
    pub name: String,
    pub description: String,
    pub created_by: AgentPubKeyB64, // Base64 encoded for web compatibility
    pub is_active: bool,
}

✅ CORRECT Link Patterns

Use comprehensive link types for discovery:

#[hdk_link_types]
pub enum LinkTypes {
    // Discovery anchors
    AllFacilitySpecifications,
    AllEconomicFacilities,

    // Hierarchical relationships
    SpecificationToFacility,   // FacilitySpec -> EconomicFacility
    FacilityToBookings,        // EconomicFacility -> FacilityBookings

    // Agent-centric patterns
    AgentToOwnedSpecs,         // Agent -> FacilitySpecs they created
    AgentToManagedFacilities,  // Agent -> EconomicFacilities they manage

    // Type-based discovery
    SpecsByType,               // FacilityType -> FacilitySpecs
    FacilitiesByLocation,      // Location -> EconomicFacilities
    FacilitiesByState,         // FacilityState -> EconomicFacilities
}

Function Naming Conventions

  • create_[entry_type] - Creates new entries with validation and links
  • get_[entry_type] - Retrieves single entry by hash
  • get_all_[entry_type] - Global discovery via anchor links
  • get_my_[entry_type] - Agent-spec
Compartilhar X LinkedIn