harness init: scaffold Hugo skeleton, harness.yaml, CI workflow, theme + element library copies #17
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle#17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
The one-command site bootstrap (docs/DECISIONS.md D15, D21, D25, D26):
harness initin an empty (or fresh git) directory scaffolds a complete, immediately editable site — Hugo skeleton (hugo.toml,content/<lang>/with a starter home page), a copy of the basic theme, a copy of the system element library (layouts/shortcodes/*+editor/elements/*), page-type sidecars,harness.yaml(site title, language list of one, Hugo version pin, defaults), a CI workflow (Forgejo and GitHub variants: checkout → pinned hugo build → commented-out deploy step with rsync/pages examples), and.gitignoreentries (.harness/). Scaffolded copies are developer-owned from then on — no update mechanism by design.Acceptance criteria
harness initthenharness serveyields a working editable site with the basic theme and full element library, no manual stepsharness.yamlinitrefuses to overwrite existing files and reports what it would touch.harness/ignoredversion:field for forward compatibilityBlocked by
Agent Brief
Category: enhancement
Summary: Add a
harness initcommand that bootstraps a complete, immediately editable site in one command: Hugo skeleton with a starter home page, developer-owned copies of the basic theme and the system element library, page-type sidecars,harness.yaml, Forgejo and GitHub CI workflow variants, and a.gitignore— refusing to overwrite anything that already exists.Dependency note: this issue is hard-blocked by #15 (basic theme), which is itself blocked by #14 (system element library) —
initscaffolds copies of both, so they must exist and be stable first. The scheduler handles ordering. The issue body'sdocs/DECISIONS.md D15, D21, D25, D26references point at a file that is not committed — this brief is self-contained.Current behavior:
The harness CLI has a single command,
serve, which requires an already-existing Hugo site and refuses directories without a Hugo config file. The theme (#15), the element library (#14), and the editor sidecars exist only inside this repository's sample site. A user who wants a new deckle-managed site must hand-assemble the Hugo config, content tree, theme, shortcode templates, sidecars, and CI — there is no bootstrap.Desired behavior:
One command, working site.
harness init, run in an empty directory (or a fresh git repository containing nothing but VCS metadata), scaffolds everything such thatharness serveimmediately afterwards yields a working, fully editable site with no manual steps:hugo.tomlwired to the scaffolded theme.content/<lang>/with a starter home page that renders and is editable through the harness (the language code comes from the language list inharness.yaml).themes/.editor/elements/*.yamlsidecar.harness.yaml: the harness's own config — site title, a language list with exactly one entry, a pinned Hugo version, and sensible defaults..gitignorecontaining.harness/(the harness's local runtime/state directory).The command must be usable non-interactively (defaults or flags for the site title and language), so it can run in scripts and tests.
Never overwrites. If any file
initwould create already exists, it refuses: it modifies no existing file, reports the paths it would touch (making the conflicts obvious), and exits nonzero. Aborting without writing anything is the cleanest acceptable behavior.Developer-owned copies. The scaffolded theme and element library are plain-file copies, owned by the site developer from the moment they are written. There is deliberately no update mechanism — no version tracking against the harness binary, no "sync from upstream", no warnings about divergence. Document this ownership in the scaffold (the theme's "fork me" guide from #15 already carries the spirit).
Forward compatibility. Every scaffolded sidecar — element sidecars and page-type sidecars — carries a
version:field so future harness versions can recognize and migrate old schemas.Committed-ready. Everything scaffolded is safe to
git addas-is: no secrets, no tokens, no absolute paths, no machine-specific content anywhere in the output.Key interfaces:
initalongsideserve, sharing the existing command dispatch; conflict refusal exits nonzero, success exits zero and prints what was created.initworks offline with no repository checkout. Keep the embedded scaffold in sync with the canonical theme/library by construction (embed the same files, don't maintain a second copy by hand).harness.yamlshape (site title, single-entry language list, Hugo version pin, defaults) becomes the harness's config contract — later issues read it (the version pin is enforced/auto-downloaded in #5). Keep its Go type in a package importable without the server.Acceptance criteria:
harness initfollowed byharness serveyields a working editable site — basic theme, full element library, starter home page — with no manual stepsharness.yamlis scaffolded with site title, a single-language list, a pinned Hugo version, and defaultsharness.yamland carries a commented-out deploy step with clear rsync/pages instructionsinitrefuses to overwrite: with any conflicting file present it modifies nothing, reports what it would touch, and exits nonzero.gitignorecontains.harness/version:fieldOut of scope:
initonly writes the pinClosing as superseded: the maintainer has decided on a clean-slate reset of the project (issue #29, PR #30). The v1 implementation this issue builds on is being removed and the plan will be re-drawn from scratch; this spec is retired rather than actioned.