#348 Scaffold new extensions to publish-ready quality (12/12) by default
Opened by magistr · 5/13/2026
Problem
Following the documented swamp-extension-model workflow today produces an extension that scores 4/12 (33%) on swamp extension quality. The missing factors are not bugs or stylistic preferences — they're explicitly client-earnable items in the rubric:
has-readme(2 pt) — no README writtenreadme-example(1 pt) — README has no fenced code blocksrich-readme(1 pt) — README is shortsymbols-docs(1 pt) — no JSDoc on exported symbolshas-license(1 pt) — no LICENSE filerepository-verified(2 pt) —repository:field unset in manifest- (often)
fast-check(1 pt) — re-exporting barez.enum(...)/z.object(...)failsdeno doc --lint
This is a real friction point. After creating @magistr/telegram-send end-to-end today, getting from 33% → 100% took an extra round trip: write README, write LICENSE, add module + symbol JSDoc, restructure exports to satisfy deno doc --lint, add a verified repository URL, re-format, re-score, dry-run, push.
All of that work is mechanical and predictable — it could be done by scaffolding at extension-creation time.
Proposed solution
Add a swamp extension new <name> (or init) subcommand that scaffolds a publish-ready skeleton from a single prompt:
swamp extension new @magistr/foo
# prompts: kind (model/workflow/vault/driver/datastore/report), license (MIT default),
# repository URL (optional, validated against the verified-host list)The resulting directory should reach 12/12 on swamp extension quality immediately, with TODO: markers in the spots that require human input (description, code example, repository URL if skipped).
Concretely, the scaffold should produce:
manifest.yamlwithname,version(fromswamp extension version),description: TODO,repository:(if supplied),additionalFiles: [README.md, LICENSE.md], and the right typed-content array seeded with one entry.README.mdskeleton that already meetsrich-readmeandreadme-examplethresholds — sections for Install, Setup, Usage with two fenced code blocks of placeholder commands, ≥500 characters of structure.LICENSE.mdpopulated from the chosen SPDX identifier (MIT default), with current year and the authenticated collective name auto-filled..gitignoreanddeno.jsonmatching the existing per-extension layout convention (good-planning / issue-lifecycle style).- For a model:
extensions/models/<snake>.tswhoseexport const modelcarries a module-level JSDoc with@example, and whose any-exported Zod schemas have explicit type annotations sodeno doc --lintpasses (fast-check). The currentswamp-extension-modelQuick Start exportsmodelonly — that's fine; but if it grows to export schemas they should be annotated, and the template should demonstrate the safe pattern (or simply keep schemas un-exported).
Alternatives considered
- Document-only fix. Update the
swamp-extension-modelSKILL.md Quick Start so it ships a polished file by default (README + LICENSE + JSDoc + repository). This raises the floor without new CLI surface area, but Claude/users still have to copy and customize four files manually for each new extension. A scaffolder is strictly better, but the SKILL.md update is a worthwhile first step on its own. - Quality-as-warning during
extension push. Todayqualityis opt-in andpushdoesn't surface the score. Makingpushprint a single-line "X/12 (Y%)" alongside the dry-run summary would at least make the gap visible at the moment authors care most. (Suggesting this in addition to scaffolding, not instead.) - Defer to per-collective templates. Some collectives might want their own LICENSE / README header. The scaffolder can accept
--template <path>later; for v1 the built-in MIT/skeleton is enough.
Additional context
- Existing
swamp-extension-publishskill already encodes the publishing state machine and surfacesqualityas optional. Anewcommand would close the loop on the other end — authoring — so authors don't only learn about the rubric at push time. - The
repository-verifiedfactor specifically requires a public HTTPS URL on github.com/gitlab.com/codeberg.org/bitbucket.org. The scaffolder should validate the host up-front rather than letting the failure surface at push. - Real example for context:
@magistr/telegram-sendv2026.05.13.1 (https://swamp-club.com/extensions/@magistr/telegram-send) — went from 33% → 100% by adding the items listed above, no code or behavior change.
Open
No activity in this phase yet.
Sign in to post a ripple.