plankc/.claude/skills/data-structure/SKILL.md
Mandatory use when editing or defining data structures in the compiler.
npx skillsauth add plankevm/plank-monorepo data-structureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When referencing elements within arenas/IndexVecs, store typed indices rather than references. This avoids lifetime complexity and enables mutation.
When storing a variable number of children/elements, prefer storing a Span<I>
pointing into a shared arena over Vec<T> per-parent.
Never manually construct typed indices (e.g., MyIdx::new(5)). Instead, obtain
indices from collection operations:
.push() returns the new element's index.enumerate_idx() yields (I, &T) pairs.iter_idx() yields indices onlyThis ensures indices always correspond to valid elements and prevents off-by-one errors or stale index usage.
Vec<T> when elements are referenced by indexusize indices across different collections&T references instead of typed indicesRange<I> when Span<I> would allow CopyThe plank_core crate houses some foundational data structures & helpers to be
used when defining and structuring data.
Define new indices by importing and using the newtype_index macro:
use plank_core::{newtype_index};
newtype_index! {
pub struct ExampleId;
pub struct StorageIdx;
}
Newtyped indices are compact u32 indices to prevent accidental mixup of
different IDs/indices. They are niche optimized such that Option<NewtypedId> &
NewtypedId fit into 4-bytes.
plank_core::IndexVec<I, T>Similar to Rust's native Vec just that element access and iteration is
restricted to the associated index type for type safety. Favor IndexVec over
Vec unless using for stack/queue type purposes where you're not referencing
specific elements directly.
Use .enumerate_idx() to iterate over elements plus indices in a type-safe
manner. .push returns the new element's index. Other useful methods:
.enumerate_mut_idx.get.get_mut.len_idx.iter_idx (iterate over indices only)plank_core::Span<T>More convenient version of std::ops::Range. Implements Copy if T is copy,
allowing containing structs to be Copy, but requires .iter() to iterate.
Instantiate with Span::new
plank_core::DenseIndexSet<I>Type safe bit set that's indexed via I. Instantiate with with_capacity, new or with_capacity_in_bits.
Core methods:
set.contains(i: I) -> boolset.add(i: I) -> bool (returns true if added, false if already present)set.remove(i: I) -> bool (returns true if removed, false if not within set)set.clear() (clears all elements, retains capacity)development
Mandatory use when adding, modifying, or reviewing diagnostic emission in any frontend pipeline stage. Use when touching emit_ methods, Session::emit_diagnostic, or the Diagnostic/Cause/Claim builder API.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.