builtin-dsl

Extend Dang's standard library by adding built-in functions and methods in registerStdlib().

23|9|Updated Jul 13, 2025
One-click install
npx skills add https://github.com/vito/dang --skill builtin-dsl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: builtin-dsl
Source: https://github.com/vito/dang/tree/main/.agents/skills/builtin-dsl
Command: npx skills add https://github.com/vito/dang --skill builtin-dsl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables adding or modifying builtin functions and methods in the Dang standard library by centralizing changes in the registerStdlib() function of pkg/dang/stdlib.go.

Core Features & Use Cases

  • Define global functions with the Builtin DSL and add methods on types with Method(), including Doc, Example, Params, Returns, and Impl to implement runtime behavior.
  • Organize builtins and methods in a single, maintainable location, ensuring consistent discovery, type registration, eval-env integration, and testability.
  • Use the DSL to extend the language capabilities for custom glue code, adapters, and library ergonomics, with examples that demonstrate how to call new bindings from Dang code.

Quick Start

Edit the pkg/dang/stdlib.go file inside registerStdlib() to add or modify a builtin function or method, then run the tests to verify the changes.

Frequently Asked Questions about builtin-dsl

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

FAQPage Schema
How do I add custom built-in functions to the Dang standard library?

You add custom built-in functions to the Dang standard library by editing pkg/dang/stdlib.go and wiring new global functions inside registerStdlib() using the Builtin() DSL, including Doc, Example, Params, and Returns definitions for complete registration.

Can I attach new methods to existing types in Dang's stdlib?

Yes, you can attach new methods to existing types in Dang's stdlib by using the Method() DSL within the registerStdlib() function, providing the necessary Impl, Doc, and Params definitions to implement the runtime behavior.

What metadata definitions are required when extending Dang's built-in functions?

Extending Dang's built-in functions requires defining Example, Params, Returns, and Doc within the Builtin() or Method() DSLs to ensure consistent discovery, type registration, eval-env integration, and testability across the standard library.

Where should I centralize modifications to Dang's standard library?

You should centralize modifications to Dang's standard library inside the registerStdlib() function located in pkg/dang/stdlib.go, organizing all builtins and methods in a single maintainable location for consistent eval-env integration.

Does extending Dang's standard library require changes across code, docs, and tests?

Yes, extending Dang's standard library requires editing pkg/dang/stdlib.go in registerStdlib() to apply changes across code, docs, and tests, using the Builtin() and Method() DSLs to implement and verify the new bindings.