data
Skill2 starsChanged 9 months agoMITView on GitHub
Generate data layer code (Freezed DTOs, repository implementations, data sources) from feature specifications or API references. Creates the bridge between domain entities and external data sources. Use after /domain to implement the data layer.
We split this skill into the rules it gives an agent
11 rules. 0 are common, 7 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
7
Distinctive
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
- Very specific: line 23
After /domain has created entities and repository interfaces
- Distinctive: line 24
When implementing API integration
- Distinctive: line 25
When adding local storage/caching
- Distinctive: line 26
When you have backend code or OpenAPI specs as reference
- Very specific: line 64
If domain layer doesn't exist, ask user to run /domain {feature} first.
- Very specific: line 80
Use reference files in reference/ directory as templates:
- Distinctive: line 130
Before finishing data layer generation:
- Very specific: line 156
Handle API field names: - Use @JsonKey for snake_case
- Distinctive: line 157
Repository is the boundary: - Only repository returns domain entities
- Distinctive: line 158
Data sources return DTOs: - Never return domain entities from data sources
- Distinctive: line 159
Typed failures: - No hardcoded error strings, use Failure types
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Data - Data Layer Generator
Generate data layer components that implement domain interfaces and handle external data sources.
Philosophy
The data layer is the only place for:
- Freezed models with JSON serialization
- API field mapping (
@JsonKey) - Repository implementations
- Data source abstractions (remote, local, cache)
This keeps the domain pure while handling all serialization and external communication here.
When to Use This Skill
- After
/domainhas created entities and repository interfaces - When implementing API integration
- When adding local storage/caching
- When you have backend code or OpenAPI specs as reference
- User asks to "implement repository", "create DTOs", or "wire up API"
Note: This skill replaces the former
/apiskill. All API integration functionality is now here.
What This Skill Creates
lib/features/{feature}/data/
├── models/
│ ├── {entity}_model.dart # Freezed DTO with JSON
│ └── {entity}_model.g.dart # Generated JSON code
├── repositories/
│ └── {feature}_repository_impl.dart # Implements domain interface
└── data_sources/
├── {feature}_remote_data_source.dart # API calls
└── {feature}_local_data_source.dart # Local storage (optional)Input Sources
| Source | What Claude Extracts |
Feature spec (.spec.md) | Endpoints, DTOs, storage needs |
| Backend code (NestJS, Express) | Controllers, DTOs, types |
| OpenAPI/Swagger spec | Paths, schemas, request/response shapes |
| Endpoint descriptions | GET /users → User[] |
Workflow
Step 1: Locate Requirements
Check for:
lib/features/{feature}/.spec.md # Feature specification
lib/features/{feature}/domain/ # Domain entities/repository interfaceIf domain layer doesn't exist, ask user to run /domain {feature} first.
Step 2: Analyze Data Sources
From spec:
- API Endpoints - Section 3.1 (URLs, methods, request/response shapes)
- Local Storage - Section 3.2 (what to persist, cache strategy)
- Field Mappings - API field names vs domain field names
From backend code (if provided):
- Extract endpoint paths from controllers/routes
- Extract request/response shapes from DTOs
- Map snake_case API fields to camelCase Dart fields
Step 3: Generate Code
Use reference files in reference/ directory as templates:
| Component | Reference File |
| Simple DTO | reference/models/simple_model.dart |
| Nested DTO | reference/models/nested_model.dart |
| Custom converters | reference/models/custom_converter_model.dart |
| Request DTOs | reference/models/request_models.dart |
| Pagination | reference/models/paginated_response.dart |
| Basic repository | reference/repositories/basic_repository_impl.dart |
| Cached repository | reference/repositories/cached_repository_impl.dart |
| Mock repository | reference/repositories/mock_repository.dart |
| Remote data source | reference/data_sources/remote_data_source.dart |
| Local (prefs) | reference/data_sources/local_data_source_prefs.dart |
| Local (secure) | reference/data_sources/local_data_source_secure.dart |
| Failures | reference/failures/failures.dart |
| Error mapping | reference/failures/dio_error_handler.dart |
| i18n mapping | reference/failures/failure_mapper.dart |
| Provider registration | reference/providers/repository_provider.dart |
Step 4: Run Code Generation
dart run build_runner build --delete-conflicting-outputsStep 5: Verify
dart run .claude/skills/data/scripts/check.dart {feature}Commands
# Generate data layer from spec
/data {feature}
# Generate only DTOs
/data {feature} --only=models
# Generate only repository implementation
/data {feature} --only=repository
# Add new endpoint to existing data layer
/data {feature} --add-endpoint={methodName}Checklist
Before finishing data layer generation:
- All DTOs match API response shapes
@JsonKeymappings handle snake_case → camelCasetoEntity()andfromEntity()methods implemented- Repository implements all domain interface methods
- Data source handles all API endpoints
- Error handling uses typed Failures (no hardcoded strings)
- Nullable fields handled correctly
- Run
build_runnerto generate code - No lint errors after generation
Naming Conventions
| Element | Convention | Example |
| DTO class | {Entity}Model | MemoryModel |
| DTO file | {entity}_model.dart | memory_model.dart |
| Repository impl | {Feature}RepositoryImpl | MemoriesRepositoryImpl |
| Remote data source | {Feature}RemoteDataSource | MemoriesRemoteDataSource |
| Local data source | {Feature}LocalDataSource | MemoriesLocalDataSource |
Data Layer Rules
- Freezed for all DTOs - Immutability + JSON + equality
- Always map to domain -
toEntity()andfromEntity()required - Handle API field names - Use
@JsonKeyfor snake_case - Repository is the boundary - Only repository returns domain entities
- Data sources return DTOs - Never return domain entities from data sources
- Typed failures - No hardcoded error strings, use Failure types
What Goes Where
| Concern | Layer | Example |
| Entity fields & business logic | Domain | Memory.isSynced |
| JSON serialization | Data | @JsonKey(name: 'is_synced') |
| API endpoints | Data | _dio.get('/memories') |
| Field mapping | Data | toEntity(), fromEntity() |
| Error types | Data | NetworkFailure.noConnection() |
| Error messages | Presentation | t.errors.noConnection (i18n) |
Guides
| Guide | Use For |
| patterns-guide.md | Basic pattern descriptions and when to use |
| advanced-patterns.md | Pagination, retry, caching, uploads, auth interceptor |
| examples.md | Complete before/after examples by input source |
| reference/ | Actual code templates |
Related Skills
/domain- Run first to create entities and repository interfaces/feature-init- Initialize feature scaffold (run before /domain and /data)/plan- Plan data sources before implementation/presentation- Implement UI layer after data layer is complete/testing- Create tests for repositories and data sources/i18n- Localize error messages (via failure mapper)
Other versions14 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 14
- Zafer-Liu/Data-Analysis-Agent★ 2.6ksame name
- trycompai/comp★ 2ksame name
- whitecircle/halo★ 825same name
- notque/vexjoy-agent★ 443same name
- notque/claude-code-toolkit★ 442same name
- robium-ai/robium★ 93same name
- emretasss/stellar-paygate-mcp★ 1same name
- Evan-Kim2028/agent-skills★ 1same name
- joaocarloscruz/skills★ 1same name
- ksed8/cc-loopkit★ 1same name
4 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use content, frontend and 3 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Rayan55050Skillcontent
Создание контента: посты, статьи, тексты
Also in 3 projects that use this
imehrSkillfrontend
Use when building UI components, pages, or features - guides Claude through the approved frontend stack (Next.js 15, React 19, Shadcn, Tailwind) with design-first workflow for complex UIs, enforcing patterns and quality standards
Also in 4 projects that use this
alxyrginSkillwriting
Создание контента для личного бренда — статьи, посты, туториалы. Use when user asks to "напиши статью", "создай пост", "подготовь контент", "write article", "create content", or when task requires content creation for blogging, LinkedIn, Medium, or other publishing platforms.
Also in 3 projects that use this
0xSeroSkillsecurity
Also in 4 projects that use this
NVIDIASkillresearch
Before designing a feature, research how comparable libraries solve the problem, check best practices, known pitfalls, and upstream changes. Use when starting a new feature, investigating an unfamiliar area, or the user asks to research something.
Also in 4 projects that use this
In this repository27 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- a11ySkill
- account-deletionSkill
- analyticsSkill
- authSkill
- ci-cdSkill
- coreSkill
- deep-linkingSkill
- designSkill
- domainSkill
- feature-initSkill
- flavorsSkill
- force-updateSkill
- i18nSkill
- in-app-purchasesSkill
- initSkill
- local-authSkill
- network-connectivitySkill
- offlineSkill
- phone-authSkill
- planSkill
- presentationSkill
- push-notificationsSkill
- releaseSkill
- skill-createSkill
- social-loginSkill
- testingSkill
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
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.

