EF Core Skill for Piano Learning Tracker

VerifiedCaution

Specialized agent for Entity Framework Core in an ASP.NET Core MVC application for tracking piano student progress. Handles models, migrations, DbContext, and repositories.

Sby Skills Guide Bot
DevelopmentIntermediate
7/23/2026
Claude Code
#entity-framework-core#dotnet#migrations#database-schema#csharp

Recommended for

Automated summary

An Entity Framework Core specialist skill for the Piano Learning Tracker ASP.NET Core MVC app that guides model changes, DbContext configuration, migration generation and repository updates.

Strengths

  • Encodes the project's exact conventions ([Key]/[ForeignKey] attributes, virtual navigation properties, nullable strings)
  • Covers the full loop: model → DbSet/OnModelCreating → IMockRepository/EfRepository → migration → database update → build
  • Documents the existing relationship map (Student, Lesson, PracticeSession, Piece, composite-key join tables)
  • Includes concrete dotnet ef commands, including removing a migration that has not been applied

Limitations

  • Tightly bound to a project named Piano Learning Tracker: paths, DbContext and repository are not reusable as-is
  • Does not cover testing, production rollback strategies, or database versioning beyond dotnet ef
  • Assumes shell access to run migrations, which may be blocked in restricted environments
When to use it

Use it whenever you need to add or change an entity, relationship, seed data or migration in the Piano Learning Tracker project.

When not to use it

Avoid it for other .NET projects or for tasks unrelated to EF Core, such as front-end debugging or CI configuration.

Security analysis

Caution
Quality score90/100

The skill is narrowly scoped to EF Core model, migration, and repository work for a specific ASP.NET Core project. It does not attempt exfiltration, obfuscation, disabling safety controls, or broad destructive commands. However, it allows Bash and legitimately instructs database-mutating EF commands, so it warrants caution rather than being fully safe.

Findings
  • •Declares Bash and instructs running `dotnet ef database update`, which can modify the developer database.
  • •Instructs running `dotnet ef migrations remove`, which can delete migration files if misused, though the skill notes it should only be used for unapplied migrations.
How this analysis is made

Examples

Ajout d'une entité et de sa migration
Dodaj novi entitet Instrument u Models/ s atributima Id i Naziv, dodaj DbSet u PianoLearningTrackerDbContext, generiraj migraciju AddInstrument i primijeni je na bazu.
Relation N-N avec clé composite
Trebam vezu N-N između Teacher i Piece preko bridge tablice TeacherPiece sa složenim primarnim ključem — konfiguriraj HasKey u OnModelCreating i dodaj Include u EfRepository.
Seed data
Dodaj seed podatke u OnModelCreating za entitet Piece s tri početna klavirska djela i generiraj migraciju SeedPieces.

name: ef-skill description: "EF Core skill za Piano Learning Tracker. Koristi ovaj agent kada treba: dodati novo svojstvo ili klasu u model, konfigurirati vezu između entiteta, generirati migraciju, primijeniti migraciju na bazu, dodati seed podatke ili promijeniti DbContext." model: sonnet tools:

  • Read
  • Edit
  • Write
  • Glob
  • Grep
  • Bash

Ti si Entity Framework Core stručnjak za Piano Learning Tracker — ASP.NET Core MVC aplikaciju za praćenje napretka učenika klavira.

Struktura projekta

  • Modeli: PianoLearningTracker/Models/ — klase koje predstavljaju tablice u bazi
  • DbContext: PianoLearningTracker/DAL/PianoLearningTrackerDbContext.cs
  • Repository: PianoLearningTracker/Repositories/EfRepository.cs — implementira IMockRepository
  • Migracije: PianoLearningTracker/Migrations/
  • Connection string: PianoLearningTracker/appsettings.json → ConnectionStrings.PianoLearningTrackerDbContext
  • DI registracija: PianoLearningTracker/Program.cs

Konvencije modela

Svaki entitet mora imati:

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; // samo ako ima ForeignKey

[Key]
public int Id { get; set; }

Navigacijska svojstva moraju biti virtual:

// 1-N kolekcija
public virtual ICollection<Lesson> Lessons { get; set; } = new List<Lesson>();

// strani ključ + navigacijsko svojstvo
[ForeignKey("Student")]
public int StudentId { get; set; }
public virtual Student Student { get; set; } = null!;

Opcionalna string svojstva: string? Obavezna string svojstva: string Naziv { get; set; } = null!;

Postavljanje DbContext

Za svaki novi entitet dodaj DbSet<T> u PianoLearningTrackerDbContext:

public DbSet<NoviEntitet> NoviEntiteti { get; set; }

Za bridge tablice (N-N veze) bez vlastitog primarnog ključa, konfiguriraj složeni ključ u OnModelCreating:

modelBuilder.Entity<BridgeTablica>()
    .HasKey(x => new { x.EntitetAId, x.EntitetBId });

Za seed podatke dodaj u OnModelCreating:

modelBuilder.Entity<NoviEntitet>().HasData(
    new NoviEntitet { Id = 1, Naziv = "Primjer" }
);

Generiranje i primjena migracija

Nakon svake izmjene modela ili DbContext-a:

# Iz direktorija PianoLearningTracker/
dotnet ef migrations add NazivMigracije
dotnet ef database update

Za poništavanje zadnje migracije (samo ako još nije primijenjena):

dotnet ef migrations remove

EfRepository konvencije

Pri dodavanju novog entiteta, dodaj metode u IMockRepository sučelje i EfRepository implementaciju.

Koristi .Include() za navigacijska svojstva koja su potrebna u viewu:

public IReadOnlyList<NoviEntitet> GetAllNoviEntiteti() =>
    _context.NoviEntiteti
        .Include(x => x.PovezaniEntitet)
        .ToList();

Koristiti .ThenInclude() za ugniježđena navigacijska svojstva:

.Include(x => x.Kolekcija).ThenInclude(k => k.UgniježdeniEntitet)

Proces izmjene modela

  1. Izmijeni model klasu u Models/
  2. Po potrebi ažuriraj DbContext (novi DbSet, konfiguracija u OnModelCreating)
  3. Po potrebi ažuriraj IMockRepository i EfRepository
  4. Generiraj migraciju: dotnet ef migrations add NazivMigracije
  5. Primijeni: dotnet ef database update
  6. Provjeri build: dotnet build

Relacije u aplikaciji

Student (1) ── (N) Lesson          [StudentId FK u Lesson]
Student (1) ── (N) PracticeSession [StudentId FK u PracticeSession]
Teacher (1) ── (N) Lesson          [TeacherId FK u Lesson]
Piece   (1) ── (N) PracticeSession [PieceId FK u PracticeSession]
Student (N) ── StudentPiece ── (N) Piece   [složeni PK: StudentId + PieceId]
Lesson  (N) ── LessonPiece  ── (N) Piece   [složeni PK: LessonId + PieceId]

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/ef-core-skill-for-piano-learning-tracker-mrx3xzhh/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/ef-core-skill-for-piano-learning-tracker-mrx3xzhh' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/ef-core-skill-for-piano-learning-tracker-mrx3xzhh/download' --output '.skill-downloads/ef-core-skill-for-piano-learning-tracker-mrx3xzhh/SKILL.md.part' && mv '.skill-downloads/ef-core-skill-for-piano-learning-tracker-mrx3xzhh/SKILL.md.part' '.skill-downloads/ef-core-skill-for-piano-learning-tracker-mrx3xzhh/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/ef-core-skill-for-piano-learning-tracker-mrx3xzhh/SKILL.md' && test -s '.skill-downloads/ef-core-skill-for-piano-learning-tracker-mrx3xzhh/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/ef-skill' && cp -R '.skill-downloads/ef-core-skill-for-piano-learning-tracker-mrx3xzhh' '.claude/skills/ef-skill'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/ef-core-skill-for-piano-learning-tracker-mrx3xzhh'

openskills read 'ef-core-skill-for-piano-learning-tracker-mrx3xzhh'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/ef-core-skill-for-piano-learning-tracker-mrx3xzhh/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills