agentleFS
Echo-ScionEcho-Scion/orioncortex/.agents/skills/data-logic/SKILL.md

data-logic

Skill2 starsChanged 6 days agoMITView on GitHub

Use when designing immutable data models, DTOs, type-safe transformation pipelines, or state management logic.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Detect Ecosystem: Check the project root for ecosystem markers (pubspec.yaml = Flutter, package.json = Node/React, Cargo.toml = Rust, …

    line 12
  2. Very specific:

    Use an available file-search tool to locate data model directories (domain/, models/, entities/).

    line 16
  3. Very specific:

    FORBIDDEN (In-Place Mutation): Never mutate state objects directly (e.g., state.field = value).

    line 19
  4. Distinctive:

    FORBIDDEN (Boundary Bleed): Never import UI/Presentation layers (widgets, controllers, HTML elements) into domain models or entities.

    line 20
  5. Very specific:

    FORBIDDEN (Untyped Data): Never use dynamic, any, or raw untyped dictionaries in production domain models.

    line 21
  6. Distinctive:

    FORBIDDEN (Over-Subscription): Never subscribe to broad root state objects in UI widgets.

    line 22
  7. Distinctive:

    Async State Management: Use async state containers for async mutations, read-only providers for one-off fetches.

    line 27

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Data & State Architect

Enforces unidirectional data flow, immutable DTOs, and type-safe state transitions across application layers.

JIT Tool Directives (Execute this FIRST)

  1. Detect Ecosystem: Check the project root for ecosystem markers (pubspec.yaml = Flutter, package.json = Node/React, Cargo.toml = Rust, go.mod = Go, *.csproj = .NET).
  2. Load Ecosystem Canon: Based on detected ecosystem, load the relevant canon:
    • Flutter: canons/ecosystems/flutter/flutter-data-patterns.md
    • Other: Apply universal principles below directly.
  3. Use an available file-search tool to locate data model directories (domain/, models/, entities/).

Architectural Invariants (Negative Constraints)

  • FORBIDDEN (In-Place Mutation): Never mutate state objects directly (e.g., state.field = value). All updates MUST produce a fresh instance via copyWith, immutability records, or pure reducers.
  • FORBIDDEN (Boundary Bleed): Never import UI/Presentation layers (widgets, controllers, HTML elements) into domain models or entities.
  • FORBIDDEN (Untyped Data): Never use dynamic, any, or raw untyped dictionaries in production domain models. Enforce strict schemas (Zod, Freezed, Pydantic).
  • FORBIDDEN (Over-Subscription): Never subscribe to broad root state objects in UI widgets. Enforce granular, field-level reactive selectors to eliminate redundant re-renders.

Universal Workflow Patterns

  1. Selective Watch Rule: Subscribe to specific fields to prevent unnecessary UI rebuilds.
  2. Async State Management: Use async state containers for async mutations, read-only providers for one-off fetches.
  3. Loop Prevention: Handle futures/streams with explicit state matchers (loading/error/data).

Troubleshooting (Universal)

  • Model methods not generated: Missing code generation setup or part directives.
  • UI not updating on state change: Using one-shot read instead of reactive watch.
  • Duplicate state containers: Multiple providers/stores with same responsibility.

🔗 Native Interconnection Pipeline

Data models and state logic do not exist in isolation. Follow the strict 4-stage pipeline:

  1. Upstream Schema Feed: Ingest table schemas and data flow definitions from context/00_Strategy/BLUEPRINT.md (authored via /project-architect).
  2. Contract Encasement: Pass all domain boundaries through strict schemas (Zod/Pydantic/OpenAPI via /api-contract).
  3. Immutable Implementation: Produce unidirectional, immutable DTOs and pure reducers (/data-logic).
  4. Downstream Verification: Feed generated state schemas directly into failing state-delta unit tests (/strict-tdd).

📚 Mandatory Knowledge Routing (JIT References)

If your current task intersects with these domains, you MUST execute view_file on the target BEFORE writing code:

If User Prompt/Task Relates To...Immediately load target with an available file-reading tool
Flutter Logic Patterns.agents/canons/ecosystems/flutter/flutter-logic-patterns.md

Generated by OrionCortex Infrastructure - Universal Data Logic

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.