CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

polymorphic-parent-resources

Serve a child resource that hangs off many different parents — comments, reports, duplications, attachments — from a single Rails controller, using a route concern plus `resource_for` from the rolemodel_rails gem. Use when a child resource needs to attach to several parent models, when about to write a second or third namespaced controller that differs only by its parent (`Articles::CommentsController`, `Widgets::CommentsController`), when a route concern passes a `*_type` route default such as `commentable_type` or `reportable_type`, when a controller looks up its parent with a hard-coded `Parent.find(params[:parent_id])` that now needs to support more parents, or when consolidating duplicated per-parent controllers.

Quality

93%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

Quality

Content

92%Weight 40%Scale 1-5

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

A high-quality skill body: executable end-to-end code, an explicit prerequisite check, sharp handling of the shallow-routing member-action trap, and a genuinely useful gotchas table. The only conciseness concern is the inline version-sensitive prerequisite/fallback material, which could live in a dedicated section or reference.

Suggestions

Move the rolemodel_rails version requirement and temporary fallback module out of the main flow — e.g., into a short 'Prerequisite' note linking a reference file — so the version-sensitive material does not age in the core pattern.

Consider trimming the overview's enumeration of naive approaches to one sentence each, since the 'When to Use' section already carries the trigger conditions.

DimensionReasoningScore

Conciseness

The body is lean and dense — no explanation of Rails basics, a compact symptom→cause→fix gotchas table, and every section earning its place — but the version-sensitive prerequisite section (rolemodel_rails >= 2.4.0 plus an inline temporary fallback module) is time-sensitive material not placed in a deprecation/old-patterns section, holding it below the 'every token earns its place' anchor. It is well above 'mostly efficient with some unnecessary explanation' (3).

4 / 5

Actionability

All guidance is fully executable and copy-paste ready: complete model, routing, and controller code; a runnable version check (`bundle info rolemodel_rails`); a working type-allowlist guard; and a concrete `params.expect` strong-params example. Specific examples cover the common cases, matching the top anchor.

5 / 5

Workflow Clarity

The pattern is sequenced clearly (prerequisite check → models → routing → controller → views → type guarding) with an explicit validation checkpoint up front, a gotchas table that maps symptoms to fixes for error recovery, and a retrofit reference that includes suite-run, route-table diff, and grep verification with fix-before-proceeding loops. The batch consolidation workflow is fully validated, so the batch-operation cap does not apply.

5 / 5

Progressive Disclosure

The body is a well-organized overview with clearly headed sections, and the single bundle reference (`references/retrofit.md`) is one level deep, signaled in two places, and accurately described ('audit commands, the consolidation order, and how to keep specs and routes green'). The retrofit material is appropriately split out rather than inlined, and navigation is easy.

5 / 5

Total

19

/

20

Passed

Description

92%Weight 40%Scale 1-5

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

An excellent description: third-person, concrete about both mechanism and trigger situations, with a rich explicit 'Use when...' clause covering new-code, retrofit, and consolidation contexts. Its only weakness is omitting the most natural trigger word, 'polymorphic', from the description text.

Suggestions

Include the word 'polymorphic' (ideally as 'polymorphic association' or 'polymorphic parent') in the description itself — it is the most natural term a Rails developer would use and currently appears only in the metadata triggers.

DimensionReasoningScore

Specificity

The description lists multiple concrete actions — serving a child resource from a single controller via a route concern plus `resource_for`, replacing hard-coded `Parent.find(params[:parent_id])` lookups, consolidating duplicated per-parent controllers — with concrete artifacts (`Articles::CommentsController`, `commentable_type`, `generated reports/duplications/attachments`). Coverage is comprehensive rather than leaving minor gaps, so it matches the top anchor rather than the 4 anchor.

5 / 5

Completeness

It clearly answers 'what' (serve child resources hanging off many parents from one controller using a route concern and `resource_for`) and 'when' with an explicit five-clause 'Use when...' listing concrete trigger situations. Both halves are explicit with concrete trigger phrases, matching the top anchor.

5 / 5

Trigger Term Quality

Good natural-phrase coverage — 'comments on multiple models', 'commentable', 'reportable', 'namespaced controller', 'consolidating duplicated per-parent controllers' — but the single most natural term a Rails developer would say, 'polymorphic', never appears in the description itself. This is a few natural terms short of the comprehensive anchor, but well above 'some relevant keywords with missing synonyms' (3).

4 / 5

Distinctiveness Conflict Risk

It carves out a clear niche — Rails polymorphic child controllers via a route concern with `*_type` defaults and the `rolemodel_rails` gem — with distinctive triggers (`commentable_type` route default, per-parent namespaced controllers) that are unlikely to fire a wrong skill. It is not merely 'mostly distinct with minor overlap' (4) because no closely related skill would claim these triggers.

5 / 5

Total

19

/

20

Passed

Validation

93%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation — 15 / 16 Passed

Validation for skill structure

CriteriaDescriptionResult

metadata_version

'metadata.version' is missing

Warning

Total

15

/

16

Passed

Repository

RoleModel/rolemodel-skills

Path

skills/polymorphic-parent-resources/SKILL.md

Reviewed

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.