一键导入
add-entity
Scaffold a new Spiderly entity end-to-end (entity class, Angular pages, routes, menu, migration)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scaffold a new Spiderly entity end-to-end (entity class, Angular pages, routes, menu, migration)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use the moment you're forced into a workaround because the clean Spiderly-native path didn't exist — you looked for a lifecycle hook, an override, an entity attribute, or a generator option and it was structurally missing, so you had to bypass or copy generated code, or reach into framework internals. Also use when the gap is in Spiderly's own skills, plugins, or docs — a skill that should have fired but didn't, or skill/doc content that was missing, stale, or wrong for the case you hit. Turns that gap into a pre-filled GitHub issue URL against filiptrivan/spiderly that the user copies and submits. Also invoke manually to report a Spiderly limitation. NOT for hacks in the consumer's own business logic, NOT for ordinary bugs in your own code.
Log past Spiderly's email-code auth wall to visually verify the running Angular admin panel — screenshot a page, click through a flow, or dogfood a UI change without writing a test. Use when asked to "verify the admin UI", "check this page renders", "screenshot the admin panel", "does this screen look right", or to eyeball a change in the live app. For authoring Playwright test suites or debugging CI traces, use the e2e-testing skill instead.
Add the API-keys feature to a Spiderly app — per-key authentication via an X-Api-Key header, where each key is a first-class principal carrying its own roles. Use when a project needs machine/partner/agent access to its REST API (generate, scope-to-roles, expire, revoke). Opt-in; not part of the default app.
Back up and restore a Spiderly app's Postgres database, and archive logs off the VPS. Use when setting up automated database backups, scheduling pg_dump to object storage (Cloudflare R2), restoring from a backup, running a restore drill, configuring backup retention, or archiving Serilog file logs. Covers the backup and restore scripts, cron scheduling, and the R2 bucket Terraform.
Deploy a Spiderly project to production and keep it running. Use when deploying, redeploying, shipping, releasing, or rolling out the .NET backend or Angular admin — first-time setup or an ongoing deploy — and when diagnosing a down or erroring production origin (502/521, container crash-loop, failed deploy workflow). Covers the recommended VPS + Docker Compose + Caddy + Cloudflare + Terraform stack, CI/CD pipelines, TLS with Cloudflare origin certificates, and infrastructure-as-code layout.
Upgrade a Spiderly consumer app's package version (NuGet + npm) to a newer Spiderly release. Use when the user asks to upgrade Spiderly, bump the Spiderly version, jump to a newer Spiderly release, or migrate to a newer Spiderly package version. Do NOT use for EF Core schema migrations (see ef-migrations skill).
| name | add-entity |
| description | Scaffold a new Spiderly entity end-to-end (entity class, Angular pages, routes, menu, migration) |
Follow these steps in order. Do not skip ahead.
Ask the user:
Product, BlogPost)BusinessObject<long> (CRUD, default) or ReadonlyObject<long> (lookup table)Do NOT proceed until the user confirms the entity design.
Note: This command prompts interactively for the entity name. Tell the user to run it themselves in a terminal, then continue with Step 3 once it completes.
spiderly add-new-entity
If the user chose data view format:
spiderly add-new-entity --data-view
This creates:
Backend/{App}.Business/Entities/{Entity}.cs (empty entity with [DoNotAuthorize])Frontend/src/app/pages/{kebab-name}/{kebab-name}-list.component.ts + .htmlFrontend/src/app/pages/{kebab-name}/{kebab-name}-details.component.ts + .htmlFrontend/src/app/app.routes.tsFrontend/src/app/business/layout/layout.component.tsUse the entity-design skill to write the entity with correct attributes. Replace the CLI-generated empty entity.
Checklist:
[DisplayName] on the name/title property[Required] on mandatory fields[StringLength(max, MinimumLength = min)] on ALL strings (never omit — avoids NVARCHAR(MAX))virtual on navigation propertiesList<T> with { get; } = new() on collections[WithMany] on M2O child side, [CascadeDelete] or [SetNull] for delete behavior[UIOrderedOneToMany] on parent collection + OrderNumber on child (if ordered)[M2M] on junction entities with exactly 2 [M2MWithMany] propertiesStorageAttribute subclass ([DiskStorage] / [S3PublicStorage] / [S3PrivateStorage] / custom) + [AcceptedFileTypes] + [MaxFileSize] + [StringLength][DoNotAuthorize] if the entity needs authorizationAlso add the collection property to related parent entities (e.g., public virtual List<Product> Products { get; } = new(); on Category).
dotnet build
Run from the Backend/ directory. This triggers Spiderly source generators which produce:
Fix any build errors before continuing.
spiderly add-migration Add{EntityName}Table
spiderly update-database
Use PascalCase for migration names. If the migration looks wrong, spiderly remove-migration and fix the entity first.
{kebab-name}-list.component.ts)Update the cols array in ngOnInit() with actual entity columns:
this.cols = [
{
name: this.translocoService.translate("Name"),
filterType: "text",
field: "name",
},
{
name: this.translocoService.translate("Price"),
filterType: "numeric",
field: "price",
},
{
actions: [
{ name: this.translocoService.translate("Details"), field: "Details" },
{ name: this.translocoService.translate("Delete"), field: "Delete" },
],
},
];
Add keys to Frontend/src/assets/i18n/en.json (and to any other language files your app uses):
{
"{EntityName}": "...",
"{EntityName}List": "..."
// property name keys as needed
}
In layout.component.ts, change 'pi pi-fw pi-list' to an appropriate PrimeNG icon.
ng build
From Frontend/. Fix any build errors.
If the entity requires custom business logic (validation, computed fields, side effects), override hooks in {Entity}Service (which extends {Entity}ServiceGenerated):
protected override async Task OnBeforeSave{Entity}AndReturnMainUIFormDTO(
{Entity}SaveBodyDTO saveBodyDTO) { }
protected override async Task OnAfterSave{Entity}AndReturnMainUIFormDTO(
{Entity}SaveBodyDTO saveBodyDTO,
{Entity}MainUIFormDTO mainUIFormDTO) { }
See the backend-hooks skill for the full hook reference.
dotnet run)