一键导入
project-conventions
Core conventions and patterns for SentenceStudio
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Core conventions and patterns for SentenceStudio
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | project-conventions |
| description | Core conventions and patterns for SentenceStudio |
| domain | project-conventions |
| confidence | high |
| source | codebase-audit-2026-03-26 |
SentenceStudio is a .NET MAUI Blazor Hybrid language learning app. .NET 10 SDK (10.0.101), multi-platform (iOS, Android, Mac Catalyst), with .NET Aspire orchestration.
| Project | Purpose | Build |
|---|---|---|
SentenceStudio.Shared | Core: DbContext, repos, services, models, migrations | Multi-TFM |
SentenceStudio.AppLib | Blazor Hybrid library, Scriban templates | Multi-TFM |
SentenceStudio.UI | Blazor RCL — web pages, components | dotnet build (no -f) |
SentenceStudio.MacCatalyst/iOS/Android | MAUI app heads | -f net10.0-{platform} |
SentenceStudio.Api | ASP.NET Core backend | net10.0 |
SentenceStudio.WebApp | Blazor Server frontend | net10.0 |
SentenceStudio.AppHost | Aspire orchestration | net10.0 |
SentenceStudio.Infrastructure | Server-side persistence (ServerDbContext) | net10.0 |
SentenceStudio.Workers | Background services | net10.0 |
# MAUI (NEVER use dotnet run)
dotnet build -f net10.0-maccatalyst
dotnet build -t:Run -f net10.0-maccatalyst
# UI project (no TFM flag)
dotnet build src/SentenceStudio.UI/SentenceStudio.UI.csproj
# Tests
dotnet test
tests/SentenceStudio.UnitTests, tests/SentenceStudio.IntegrationTests, tests/SentenceStudio.Api.Tests<i class="bi bi-{name}"></i> — NEVER emojis<PageHeader> → <ToolbarActions> → main content with card card-ss<span class="spinner-border spinner-border-sm"><div class="alert alert-{danger|warning|success}">@attribute [Authorize] on protected pages@implements IAsyncDisposableApplicationDbContext — SQLite on mobile, PostgreSQL on serverValueGeneratedNever()dotnet ef migrations add — NEVER hand-write, NEVER raw SQL ALTER TABLEUserProfileIdEnsureCreatedAsync before MigrateAsyncMigrations/ (PostgreSQL), Migrations/Sqlite/ (mobile)src/SentenceStudio.AppLib/Resources/Raw/*.scriban-txtIChatClient (Microsoft.Extensions.AI) via AiService.SendPrompt<T>()[Description] attributes on properties — no [JsonPropertyName]_connectivity.IsInternetAvailable before AI callsIAiGatewayClient for server routingIServiceProviderTask<T>)ILogger<T> for structured loggingWeakReferenceMessenger.Default.Send() for cross-component messaging_serviceProvider.CreateScope() → GetRequiredService<ApplicationDbContext>()_logger.LogError(ex, "context {Field}", value)InvalidOperationException for state violationsArgumentException for invalid argumentsConnectivityChangedMessageActivityTimer.StartSession(activityType, PlanItemId, resourceId, skillId) unconditionally — when PlanItemId is null/empty the service creates a synthetic DailyPlanCompletion with PlanItemId = "adhoc-{guid}" so freeform sessions get duration tracking.activityType string must parse to a PlanActivityType enum value or the ad-hoc row is silently dropped. Valid enum values (see IProgressService.cs): VocabularyReview, Reading, Listening, VideoWatching, Shadowing, Cloze, Translation, Writing, SceneDescription, Conversation, VocabularyGame. NOT valid: VocabularyMatching (use VocabularyGame), HowDoYouSay, WordAssociation, MinimalPairs.ReconstructPlanFromDatabase filters adhoc-* so they don't show up in "Today's Plan"; GetActivityLogAsync includes them so day-detail shows freeform practice with its own "Freeform practice" cluster.ResourceIdParam; VocabQuiz/VocabMatching use plural ResourceIdsParam (comma-separated — take .Split(',').FirstOrDefault() for ad-hoc persistence).Default iteration limit is 1000. Dynamic learning resources ("New Words") can return thousands of unpracticed terms. Any service rendering {{ for t in terms }} must cap the collection before passing to the template — current cap is 40 random words in TranslationService and ClozureService. If adding a new activity that loops vocab, apply the same cap.
VStart() / VEnd() not Top() / Bottom()HStart() / HEnd() not Start() / End()FillAndExpand — legacy patterndotnet run for MAUI apps/docs/ not repo root{what this skill teaches agents}
Use when working with an Aspire distributed application and operating the AppHost or its resources through the Aspire CLI: start/restart/stop/wait on the app; iterate via watch, rebuild, hot reload, or resource commands; inspect resources, logs, traces, docs, or health; add integrations; manage secrets/config; publish, deploy, or rerun a named pipeline step; initialize Aspire in an existing app; recover missing `.modules` files in a TypeScript AppHost; discover the frontend URL for Playwright from Aspire state; expose custom dashboard/resource commands; or understand Aspire AppHost APIs in C# or TypeScript. Use it even if the task is described in terms of AppHost, resources, dashboard, app bootstrap, missing generated modules, Playwright URL discovery, or local distributed app workflow without naming Aspire. Do not use for non-Aspire .NET apps, container-only repos with no AppHost, or ordinary build and test tasks.
Systematic recovery procedure for Aspire AppHost failures caused by orphaned processes holding critical ports (especially 22070). Covers diagnostics, two-pass cleanup (AppHost + dcp tree, then orphaned services), verification, and restart validation. USE FOR: "aspire won't start", "cannot access disposed object", "address already in use", "aspire dashboard not loading", "port 22070 in use", "aspire restart failed", "orphaned dcp processes", dashboard stuck on "starting", build succeeds but services won't start, previous Aspire session crashed and won't restart. DO NOT USE FOR: initial Aspire setup, configuration changes, deployment issues, or general Aspire CLI usage (use the aspire skill instead).
End-to-end testing and verification for SentenceStudio. USE THIS SKILL whenever the user says "test", "verify", "check", "validate", "confirm it works", "smoke test", "run the app and check", "does it work", "try it", "make sure", or any variation of testing a feature or fix in a running app. Also use after EVERY bug fix or feature implementation as a mandatory final verification step — even if you think a build check is enough. Covers: launching via Aspire, interacting with Playwright (webapp) or maui-devflow-debug (native), verifying UI state, checking database records, and reading structured logs. If someone asks you to test anything in this app, or to verify a fix works, or to run a smoke test, or to check that CRUD operations work, or to confirm audio/quiz/import/activity features behave correctly — this is the skill to use. Do NOT skip this skill when verification is needed.
Run build, deploy, inspect, and fix loops for .NET MAUI apps that already have MAUI DevFlow integrated. USE FOR: launching MAUI apps, selecting devices or emulators, waiting for or recovering agent connections, broker/port/adb connectivity issues, visual tree inspection, screenshots, UI interaction, Blazor WebView CDP debugging, reading DevFlow logs, and iterative app debugging. DO NOT USE FOR: first-time DevFlow package setup (use maui-devflow-onboard), or generic desktop automation unrelated to MAUI. INVOKES: maui devflow CLI, dotnet CLI, Android adb/android tools, and Apple simctl tools.
Add MAUI DevFlow to a .NET MAUI project with agent package references, MauiProgram.cs registration, Blazor WebView support, GTK variants, Central Package Management guidance, and verification commands. USE FOR: first-time DevFlow setup, reviewing what files to edit, choosing DevFlow packages, or continuing after `maui devflow init` installs skills. DO NOT USE FOR: troubleshooting an already-integrated app that cannot connect, iterative app debugging, UI inspection, or generic MAUI build failures (use maui-devflow-debug). INVOKES: maui devflow CLI and dotnet CLI.