data-structure-selector
Purpose
Choose the most appropriate data structure for the workload, operations, constraints, and failure modes of a problem.
Trigger this skill when
- You need a structure or algorithm recommendation grounded in the real workload.
- A current implementation choice feels arbitrary, costly, or hard to justify.
- You want to reason about correctness or performance before writing more code.
Expected inputs
- problem statement
- required operations
- input size expectations
- mutation/access patterns
- implementation constraints
Deliverables
- recommended structure options
- selection rationale
- tradeoff table
- rejected alternatives
- next implementation checks
Operating procedure
- Identify the data or algorithmic concern this skill is meant to assess.
- Separate facts about operations, sizes, ordering, and mutation from assumptions.
- Review the current or proposed approach against the workload, invariants, complexity, and representation constraints.
- Surface concrete risks, tradeoffs, and improvement options.
- Prefer the least complex structure or algorithm that meets the stated needs.
- Hand off to the next most relevant skill if the issue is broader than this skill alone can resolve.
Quality gates
- Findings are tied to the stated workload or concrete algorithm steps.
- Recommendations explain why the choice fits the context.
- Tradeoffs are stated when multiple options are viable.
- Output distinguishes asymptotic concerns from practical implementation risks.
Handoff targets
- time-space-tradeoff-reviewer
- stack-queue-tree-graph-advisor
- complexity-red-flag-detector
Output style
- Be explicit about uncertainty.
- Prefer short, evidence-based findings over generic claims of efficiency.
- Call out hidden assumptions such as sorted input, bounded size, or low mutation.
- End with recommended next actions.
Failure modes to avoid
- Do not recommend advanced structures without a workload that justifies them.
- Do not rely on Big-O alone when locality or constant factors dominate.
- Do not conflate proof of correctness with a single successful example.
- Do not ignore edge cases, degenerate inputs, or mutation semantics.
Minimum output skeleton
## Summary
## Findings
## Risks
## Recommendations
## Tradeoffs
## Recommended next skill