agentleFS
BULDEEBULDEE/ai-craftsman-superpowers/skills/scaffold/SKILL.md

scaffold

Skill35 starsChanged 2 months agoApache-2.0View on GitHub

Unified scaffolder for all pack types. Use when creating new entities, use cases, components, hooks, API resources, or custom packs. Types loaded from active packs.

29 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use autopilot, migrate and 2 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.
  • an8079Skill

    autopilot

    Also in 3 projects that use this

  • genomewalkerSkill

    migrate

    Import soul data from SQLite or shared chitta files

    Also in 3 projects that use this

  • AnthropicSkill

    design-system

    Audit, document, or extend your design system. Use when checking for naming inconsistencies or hardcoded values across components, writing documentation for a component's variants, states, and accessibility notes, or designing a new pattern that fits the existing system.

    Also in 3 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 6 projects that use this

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 2 are distinctive, and 10 are very specific to this project.

  • 0

    Common

    Most of the 25 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the Read tool to read .craft-config.yml.

    line 18
  2. Very specific:

    Use the Glob tool: Glob("packs/*/pack.yml").

    line 24
  3. Distinctive:

    Before generating ANY code, you MUST load and read the canonical example for the requested type.

    line 43
  4. Very specific:

    Before generating entity, usecase, component, or hook code, offer the user a template variant matching their case, loaded from the pack's …

    line 56
  5. Very specific:

    Follow the exact patterns: final class, private constructor, factory methods, Value Objects

    line 81
  6. Distinctive:

    Follow the exact patterns: named exports, branded types, TanStack Query integration

    line 86
  7. Very specific:

    Create pack.yml with the name, version 1.0.0, description placeholder, and stack ["*"]

    line 91
  8. Very specific:

    Create a starter validator in hooks/<name>-validator.sh with a pack_validate_<name>() function

    line 92
  9. Very specific:

    Create empty directories: agents/, knowledge/canonical/, commands/scaffold-types/, static-analysis/, templates/

    line 93
  10. Very specific:

    Create a test file at tests/packs/test-<name>.sh with basic structure checks

    line 94
  11. Very specific:

    Run scripts/validate-pack.sh packs/<name>/ to verify the generated pack

    line 95
  12. Very specific:

    Run /craftsman:verify to ensure code passes all hook validators

    line 101

“Common” is measured: kept by at least 6 in 10 of the 25 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/craftsman:scaffold - Unified Scaffolder

Outcome Contract

  • Outcome: generated code that already satisfies the active rules, not a template to fix afterwards.
  • Done when: the generated files pass the quality gate on write, the template variant was chosen deliberately, and the code compiles or lints clean.
  • Evidence: the hook output on the generated files and the variant selected.

Project Context

Use the Read tool to read .craft-config.yml. If the file does not exist, say "No config found. Run /craftsman:setup first."

Available Types

Detect available scaffold types from loaded packs:

Use the Glob tool: Glob("packs/*/pack.yml"). For each found file, use the Read tool to read it and extract the scaffold_types: list. Display each pack's types as **<pack-name>:** <type1>, <type2>, .... If no scaffold types found, say "No scaffold types available. Check pack configuration."

Usage

/craftsman:scaffold <type> [name]

Examples:

/craftsman:scaffold entity Order
/craftsman:scaffold usecase CreateOrder
/craftsman:scaffold component UserProfile
/craftsman:scaffold hook useOrders
/craftsman:scaffold pack my-go-pack

Iron Law

Before generating ANY code, you MUST load and read the canonical example for the requested type.

TypeCanonical Example
entitypacks/symfony/knowledge/canonical/php-entity.php
usecasepacks/symfony/knowledge/canonical/php-usecase.php
componentpacks/react/knowledge/canonical/ts-react-component.tsx
hookpacks/react/knowledge/canonical/ts-tanstack-hook.ts
api-resourcepacks/symfony/knowledge/canonical/php-state-provider.php
pack(generates new pack from convention - no canonical needed)

Template Variants (v2.1.0+)

Before generating entity, usecase, component, or hook code, offer the user a template variant matching their case, loaded from the pack's templates/ directory:

PackTemplateUse Case
Symfonybounded-context-backendStandard DDD entity
Symfonycrud-apiAPI Platform 4 CRUD
Symfonyevent-sourcedEvent Sourcing + Projections
Reactbounded-context-frontendStandard TanStack Query hook
Reactform-heavyMulti-step wizard + Zod
Reactdashboard-dataTanStack Table + Recharts

Process

Phase 1: Context

  1. Detect project stack from .craft-config.yml
  2. Validate the requested type exists in an active pack
  3. Load the canonical example for the type

Phase 2: Generate

Based on the type argument:

Symfony types (entity, usecase):

  • Load the canonical example file from packs/symfony/knowledge/canonical/
  • Follow the exact patterns: final class, private constructor, factory methods, Value Objects
  • Generate: Entity/UseCase + tests + migration if needed

React types (component, hook):

  • Load the canonical example file from packs/react/knowledge/canonical/
  • Follow the exact patterns: named exports, branded types, TanStack Query integration
  • Generate: Component/Hook + tests + Storybook if component

Meta type (pack):

  • Generate the full pack directory structure under packs/<name>/
  • Create pack.yml with the name, version 1.0.0, description placeholder, and stack ["*"]
  • Create a starter validator in hooks/<name>-validator.sh with a pack_validate_<name>() function
  • Create empty directories: agents/, knowledge/canonical/, commands/scaffold-types/, static-analysis/, templates/
  • Create a test file at tests/packs/test-<name>.sh with basic structure checks
  • Run scripts/validate-pack.sh packs/<name>/ to verify the generated pack
  • Print next steps: "Pack created at packs/<name>/. Edit pack.yml to configure stack compatibility and add your rules."

Phase 3: Verify

After generation:

  • Run /craftsman:verify to ensure code passes all hook validators
  • Confirm naming conventions match project standards

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.