Skip to content
cc-data-organization logo

Skill: cc-data-organization

cc-data-organization

Audit and fix data organization: variable declarations, data types, magic numbers, naming conventions, and global data. Three modes: CHECKER (92-item checklist -> status table), APPLIER (type selection and naming guidance), TRANSFORMER (fix violations). Cover modern types: concurrent/shared state...

SKILL.md

Full skill instructions

Skill: cc-data-organization

STOP - Priority 1: Never Skip

ItemWhy Critical
No magic numbers in business logicSource of silent bugs
Currency uses integer cents, never floatFinancial bugs are lawsuits
No float == comparisonsNon-deterministic failures
Variables initialized before useUndefined behavior
Boolean naming is unambiguousLogic inversion bugs

Skipping Priority 1 items is NEVER acceptable. They represent latent defects that will manifest later.


Modes

CHECKER

Purpose: Execute data organization checklists against code Triggers:

  • "review my variable declarations"
  • "check for magic numbers"
  • "review data type usage"
  • "check my variable names" Non-Triggers:
  • "what type should I use for X" -> APPLIER
  • "how should I name this variable" -> APPLIER
  • "fix these magic numbers" -> TRANSFORMER Checklist: See checklists.md Metrics: See hard-data.md for Span/​Live Time measures (goal: minimize both) Output Format: | Item | Status | Evidence | Location | |------|--------|----------|----------| Severity:
  • VIOLATION: Fails checklist item
  • WARNING: Partial compliance
  • PASS: Meets requirement

APPLIER

Purpose: Guide data type selection, variable naming, and structure design Triggers:

  • "what data type should I use for..."
  • "how should I name this variable"
  • "best practice for enums/​constants"
  • "how should I organize this data" Non-Triggers:
  • "review my types" -> CHECKER
  • "fix this" -> TRANSFORMER
  • "audit my code" -> CHECKER Produces: Type recommendations, naming conventions, enum patterns, constant definitions, structure designs Constraints:
  • [p.308] Eliminate semantic literals - Replace business values (86400, 12, 0.07) with named constants. Loop bounds 0, 1 and array indices are typically fine.
  • [p.295] For currency: integer cents or BCD, never float
  • [p.306] Enums (language-dependent):
    • C/​C++: Reserve 0 for invalid, define First/​Last bounds
    • TypeScript string enums: No zero-reservation needed (no uninitialized risk)
    • Rust/​Kotlin: Leverage exhaustive matching instead of bounds checks
  • [p.259] Minimize scope: Declare variables in innermost block where all usages occur. Balance with testability—sometimes slightly wider scope enables testing.
  • [p.263] Names describe the entity clearly: Reader should understand purpose without searching for definition. Examples: d (bad) → data (vague) → userData (better) → validatedUserSubmission (good for complex entity)
  • [p.279] Problem Orientation: names refer to problem domain (employeeData, printerReady), not computing (inputRec, bitFlag)
  • [p.263] Name length heuristic: 2-4 words, long enough to describe purpose, short enough to scan. Research shows 10-16 chars minimizes debugging effort [Gorla et al. 1990], but this is guidance, not a hard rule.

TRANSFORMER

Purpose: Fix data organization violations Triggers:

  • CHECKER findings with VIOLATION status
  • "replace magic numbers with constants"
  • "fix float comparison"
  • "refactor these globals" Non-Triggers:
  • Large refactorings beyond data organization -> cc-refactoring-guidance
  • Control flow restructuring -> cc-control-flow-quality Input -> Output:
  • Magic 86400 -> SECONDS_PER_DAY = 86400
  • if (a == b) floats -> if (Math.abs(a-b) < EPSILON)
  • true, false, true params -> enum values
  • Unstructured variables -> grouped structure
  • Direct global access -> access routines Preserves: Behavior, unrelated code Verification: Re-run CHECKER; VIOLATION count = 0

Rationalization Counters

ExcuseReality
"Everyone knows what 12 means"Named constants aid maintenance [Glass 1991]
"Floats are close enough for =="0.1 added 10 times rarely equals 1.0
"Magic numbers are faster to type"Debugging hard-coded literals takes far longer
"I don't need custom types"One typedef change vs hundreds of declarations
"Short names are faster to type"Code read far more than written; favor read-time convenience
"Global variables are more convenient"Convenience writing trades against difficulty reading, debugging, modifying

Sunk Cost Counters

For resisting changes to "working" code:

ExcuseReality
"It works, why change it?"Violations are latent defects; "works" means "hasn't failed yet"
"I already invested time in this"Time invested in bad code is lost regardless; fix now or pay more later
"Refactoring will break things"Violations already broken; you just haven't discovered how yet
"Currency has always used floats here"Every penny calculation is a potential lawsuit
"We've had no bugs from these magic numbers"You've had bugs—you attributed them to other causes
"The code passed review before"Past reviews missed issues; evidence now shows violations

Success-Bias Warning

Past success does NOT predict future safety.

Violations that "worked for years" fail when:

  • Edge cases finally occur (currency rounding in new scenarios)
  • Scale changes (global variable contention under load)
  • Maintenance happens (magic numbers misunderstood by new developers)
  • Requirements shift (hard-coded values need changing)

Every checklist item applies regardless of past success. "Worked until it didn't" examples fill bug databases.

Modern Data Types Coverage

Beyond Code Complete's C-era focus:

Concurrent Access

When data may be accessed from multiple threads/​async contexts:

  • Identify shared state - Mark variables accessed across thread boundaries
  • Access routines are mandatory - Never expose shared data directly
  • Consider immutability - Immutable data eliminates race conditions by design
  • Document thread safety - Comment whether type/​routine is thread-safe
  • Violations: Data races, torn reads, lost updates

Nullable/​Optional Types

Modern languages use Option<T>, Maybe, T? instead of null pointers:

  • Prefer non-nullable by default - Make nullability explicit and intentional
  • Handle all cases - Exhaustive matching on Option/​Maybe types
  • Avoid null as "not found" - Use Option types or result types instead
  • Document null semantics - When null is valid, document what it means
  • C-style pointer guidance still applies to unsafe code

Temporal Data

Dates and times are a common bug source:

  • Store timestamps in UTC - Convert to local only for display
  • Use timezone-aware types - Never use naive datetime for user-facing data
  • Be explicit about precision - Seconds, milliseconds, nanoseconds?
  • Name with time unit - timeoutMs, durationSeconds, not just timeout
  • Avoid magic time values - 86400 → SECONDS_PER_DAY

Security-Sensitive Data

Secrets, tokens, API keys require special handling:

  • Clear from memory after use - Don't leave secrets in variables longer than needed
  • Never log sensitive data - Redact in all log statements
  • Use dedicated types - SecureString, SensitiveData wrappers
  • Limit scope aggressively - Shortest possible lifetime

Chain

AfterNext
Data organization verifiedcc-control-flow-quality (CHECKER)

More skills from diegosouzapw

accessibility logo
diegosouzapw/awesome-omni-skill

accessibility

Accessibility guidelines for VS Code features — covers accessibility help dialogs, accessible views, verbosity settings, accessibility signals, ARIA alerts/status announcements, keyboard navigation, and ARIA labels/roles. Applies to both new interactive UI surfaces and updates to existing feature...

62 1
View
mermaid-diagrams logo
diegosouzapw/awesome-omni-skill

mermaid-diagrams

Mermaid diagram creation for flowcharts, sequences, ERDs, and more. Generate diagrams from text in markdown files. Use for documentation, architecture diagrams, and visual representations. Triggers on mermaid, flowchart, sequence diagram, ERD, entity relationship, gantt chart, pie chart, class di...

62 1
View
tauri2-react-rust logo
diegosouzapw/awesome-omni-skill

tauri2-react-rust

Guides development of cross-platform desktop apps with Tauri 2, TypeScript, React, and Rust. Use when building Tauri apps, implementing IPC, designing Rust backend or TypeScript/React frontend, when researching or cloning a website (open site, snapshot elements), when verifying local dev or built...

62 1
View
fp-ts-errors logo
diegosouzapw/awesome-omni-skill

fp-ts-errors

Handle errors as values using fp-ts Either and TaskEither for cleaner, more predictable TypeScript code. Use when implementing error handling patterns with fp-ts.

62 0
View
ring:pre-dev-research logo
diegosouzapw/awesome-omni-skill

ring:pre-dev-research

Gate 0 research phase for pre-dev workflow. Dispatches 3 parallel research agents to gather codebase patterns, external best practices, and framework documentation BEFORE creating PRD/TRD. Outputs research.md with file:line references.

62 0
View
create-assistant logo
diegosouzapw/awesome-omni-skill

create-assistant

Create and configure Vapi voice AI assistants with models, voices, transcribers, tools, hooks, and advanced settings. Use when building voice agents, phone bots, customer support assistants, or any conversational AI that handles phone or web calls.

62 0
View
codex-headless logo
diegosouzapw/awesome-omni-skill

codex-headless

Delegiere Aufgaben an OpenAI Codex CLI im Headless-Mode. Nutzt ChatGPT Subscription (KEIN API Key). Nur Workspace-Zugriff, KEIN System-Zugriff. Auto-Accept mit --full-auto. Web-Recherche mit --search.

62 0
View
social-media-scheduler logo
diegosouzapw/awesome-omni-skill

social-media-scheduler

Generate a full week of social media content for any topic. Outputs platform-optimized posts for Twitter/X, LinkedIn, and Instagram with hashtags and posting times.

62 0
View
Data Privacy Compliance logo
diegosouzapw/awesome-omni-skill

Data Privacy Compliance

Data privacy and regulatory compliance specialist for GDPR, CCPA, HIPAA, and international data protection laws. Use when implementing privacy controls, conducting data protection impact assessments, ensuring regulatory compliance, or managing data subject rights. Expert in consent management, da...

62 0
View
triple-review logo
diegosouzapw/awesome-omni-skill

triple-review

Reviews a task using the TRIPLE protocol, as the review agent.

62 0
View
Tech Stack & Architecture Decision logo
diegosouzapw/awesome-omni-skill

Tech Stack & Architecture Decision

Define and document the technology stack and architecture decisions for a project. Use when the user needs to choose a tech stack, make architecture decisions, define infrastructure choices, or document technology selections. Triggers on requests like "define the tech stack", "choose technologies...

62 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View