<< All versions

Skill v1.0.0

currentAutomated scan100/100
alizainx/intelligence-systems-skills/d-systems-metaprogramming
──Details
PublishedNovember 4, 2026 at 12:42 AM
Content Hashsha256:4b5f84777d3e1f0d...
Git SHA5d098c90c1e6
──Files
Files (1 file, 1.4 KB)
SKILL.md1.4 KBactive
SKILL.md · 27 lines · 1.4 KB

name: d-systems-metaprogramming id: ISS-010 token_budget: 700 chain_with: [cpp-modern-raii, nim-ast-systems, odin-data-oriented] description: "D (@safe / -betterC) systems programming, compile-time function execution (CTFE), design-by-contract, and scoped lifetimes." metadata: version: "1.0.0"


d-systems-metaprogramming (ISS-010)

1. First-Principles Invariant

  • Bright/Alexandrescu Design-by-Contract Law: Annotate modules with @safe pure nothrow @nogc and dip1000 scoped pointer lifetimes so memory and GC constraints are compiler-enforced.

2. Fast-Pass Low-Token Protocol (Web & Coding Agents)

  • Use templates (if (isIntegral!T)) and CTFE (enum table = buildTable();) to generate optimal specialized machine code without C preprocessor macros.

3. Zero-Bug & Zero-Vulnerability Guards

  1. Enable -preview=dip1000 and mark borrowed references scope or return scope to prevent escaping stack pointers.
  2. Use -betterC for freestanding kernels, C-ABI libraries, and zero-runtime targets where D runtime/GC is prohibited.
  3. Attach in (...) preconditions, out (result; ...) postconditions, and invariant { ... } blocks to stateful aggregates.
  4. Use scope(exit), scope(failure), and scope(success) guards immediately after resource acquisition.
  5. Verify bounds safety in @trusted blocks with explicit slice length assertions (assert(idx < slice.length)).

4. Verification Gate

  • ldc2 -O2 -dip1000 -w -wi -unittest
All versions