scaffold
Use to materialize a new full-stack project from the base-tpl template with a subtractive battery interview. Triggers on "scaffold a new project", "/sdlc:scaffold", "заскафолдь проєкт", "новий проєкт з темплейта", "розгорни проєкт з base-tpl", "scaffold from template" — typically right after /sdlc:interview produced docs/idea-brief.md in an empty folder. Reads the brief (name/context), asks stack + battery questions (web frontend, deploy, CI, Prometheus+Grafana observability, freshness bump), then runs base-tpl's scaffold.sh: full template copy with unselected batteries physically removed. "Yes to everything" reproduces the template byte-for-byte. Not the same as /sdd:scaffold (which materializes a skeleton planned by /sdd:survey inside an SDD flow) — this one copies a ready-made template into an empty folder.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 15
- Forks
- 13
01 前言 Front Matter
- name
- scaffold
- model
- inherit
- agents
- []
- effort
- medium
- triggers
- [ "/sdlc:scaffold", "scaffold a new project", "scaffold from template", "заскафолдь проєкт", "новий проєкт з темплейта", "розгорни проєкт з base-tpl" ]
- description
- Use to materialize a new full-stack project from the base-tpl template with a subtractive battery interview. Triggers on "scaffold a new project", "/sdlc:scaffold", "заскафолдь проєкт", "новий проєкт з темплейта", "розгорни проєкт з base-tpl", "scaffold from template" — typically right after /sdlc:interview produced docs/idea-brief.md in an empty folder. Reads the brief (name/context), asks stack + battery questions (web frontend, deploy, CI, Prometheus+Grafana observability, freshness bump), then runs base-tpl's scaffold.sh: full template copy with unselected batteries physically removed. "Yes to everything" reproduces the template byte-for-byte. Not the same as /sdd:scaffold (which materializes a skeleton planned by /sdd:survey inside an SDD flow) — this one copies a ready-made template into an empty folder.
03 SKILL.md 正文
Skill: scaffold (new project from base-tpl)
Матеріалізує новий проєкт із темплейта base-tpl субтрактивно: копіюється повний
наповнений шлях, невибрані батарейки фізично видаляються (теки, сервіси compose,
CI-джоби, рядки README). «Так на все» = темплейт байт-у-байт. Механіка вирізання живе
у scaffold.sh в корені base-tpl і тестується CI-матрицею base-tpl — цей скіл лише
збирає відповіді і викликає двигун.
Джерело темплейта
- Якщо задано env
SDLC_BASE_TPL— використовуй цей шлях (локальний клон base-tpl). - Інакше — свіжий shallow-клон публічного репо:
Клон разовий, після скафолда його можна видалити.git clone --depth 1 https://github.com/genkovich/base-tpl /tmp/base-tpl-$$
Кроки
1. Контекст: idea-brief
Якщо у поточній теці є docs/idea-brief.md (продукт /sdlc:interview у greenfield-режимі) —
прочитай його: назва продукту (kebab-case slug) і суть беруться звідти, назву не питай
(лише підтверди slug одним рядком у першому питанні кроку 2). Якщо brief-а нема —
спитай назву проєкту (kebab-case slug) перед техінтерв'ю.
Ціль скафолда — поточна тека, якщо вона порожня або містить лише docs/ з brief-ом;
інакше — нова тека ./<slug>.
2. Техінтерв'ю — виклик А (стек)
Один AskUserQuestion із чотирма питаннями; рекомендований варіант першим:
- Мова бекенда: Go (Recommended) / PHP / Python / TypeScript
- Архітектура: Модульний моноліт (Recommended) / Мікросервіси
- Фронтенд: React + FSD (Recommended) / Без фронта / Flat React
- Auth: Google OAuth (Recommended) / Без auth / Email + password
Чесність про наповнення base-tpl. Наповнені шляхи зараз:
| Вибір | Стан |
|---|---|
| Go + моноліт | ✅ templates/go-react |
| React + FSD | ✅ (той самий шлях) |
| Без фронта | ✅ реальна субтракція (--no-web) |
| Google OAuth | ✅ вшито в темплейт |
| PHP / Python / TypeScript | 🔒 ще не наповнено |
| Мікросервіси | 🔒 ще не наповнено |
| Flat React | 🔒 ще не наповнено |
| Без auth / Email + password | 🔒 ще не наповнено (auth вшито в темплейт) |
Вибір 🔒-варіанта → зупинись і скажи прямо: «цей шлях у base-tpl ще не наповнено —
наповни templates/<стек> у base-tpl або обери наповнений варіант». Не генеруй
заглушок замість темплейта.
3. Техінтерв'ю — виклик Б (батарейки)
Другий AskUserQuestion: одне multiSelect-питання про батарейки + одне про freshness:
- Батарейки (multiSelect, всі увімкнені за замовчуванням — Enter лишає все):
- Deploy —
deploy/(Caddy авто-TLS, prod-compose) + deploy-workflow (GHCR → VPS → health-гейт) - CI —
.github/workflows/ci.yml(ті самі перевірки, щоmake check) - Моніторинг — Prometheus + Grafana локально і в проді (ендпоінт
/metricsв api лишається завжди)
- Deploy —
- Freshness — оновити піни інфраструктури до свіжих версій? Так (Recommended) / Ні.
Невибрана батарейка фізично зникає: тека, сервіси compose, CI-джоби, рядки README.
4. Виклик двигуна
BASE_TPL=${SDLC_BASE_TPL:-/tmp/base-tpl-$$} # див. «Джерело темплейта»
OWNER=$(gh api user -q .login 2>/dev/null || echo example)
"$BASE_TPL/scaffold.sh" "$TARGET" "$SLUG" "$OWNER" \
[--no-web] [--no-deploy] [--no-ci] [--no-observability] \
[--brief docs/idea-brief.md] \
[--no-git] # лише якщо обрано freshness — git init робиться після бампів
scaffold.sh сам: копіює tracked-файли темплейта, вирізає невибрані батарейки за
маркерами battery:<name>, перейменовує бренд (myapp → slug, MyApp → Display,
example/myapp → owner/slug), копіює api/.env.example → api/.env,
кладе brief у docs/idea-brief.md і робить git init + t0-коміт.
5. Freshness (якщо обрано)
Після субтракції, до git init (тому --no-git у кроці 4):
- Зістав піни поверхні стека: Go toolchain і base-образи в
api/Dockerfile,GO_VERSION/NODE_VERSIONу workflows, docker-теги (postgres,prom/prometheus,grafana/grafana,caddy,nginx), версії GitHub Actions. - Свіжі версії бери через context7 (
resolve-library-id→query-docs); для docker-тегів і Actions, яких context7 не знає — WebSearch або registry (hub.docker.com, github releases). Якщо жоден інструмент недоступний — чесно скіпни freshness зі звітом, скафолд не блокуй. - Застосуй бампи → гейт:
make check(при--no-web—make api-check). Червоно → відкат бампів (скафолд віддається зеленим, зі звітом що і чому відкачено). - Заверши:
git init -b main && git add -A && git commit -m "t0: scaffold <slug> from base-tpl (go-react)".
Бампаються піни інфраструктури, не go.mod/package-lock.json (залежності коду
оновлюються своїм циклом у проєкті).
6. Фінальне повідомлення
/init— кореневого CLAUDE.md у темплейті навмисно немає; згенеруй його вже з контекстом проєкту (api/CLAUDE.md,web/CLAUDE.mdі path-rules приїхали з темплейтом).make check— наскрізна перевірка.make up→ повний локальний стек (порти — у README проєкту).- Google-логін потребує реальних
GOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRETвapi/.env(одна env-пара: закоміченийapi/.env.example→ gitignoredapi/.env, його читає і локальний дев-цикл, і compose). - Далі по SDLC: фічі через
/sdlc:interview <slug>(feature mode) у новому репо.
Поширені помилки
- Скіл починає «допомагати» руками після scaffold.sh (правити файли, докручувати) — ні: скафолд закінчується t0-комітом, все інше — окремі кроки у проєкті.
- Вибрано 🔒-варіант, а скіл згенерував заглушку сам — заборонено, чесна відмова.
- Freshness бампнув go.mod/package-lock — відкат: це піни коду, не інфри.
- Забутий
--no-gitпри freshness → бампи розмазуються по історії після t0.
04 同仓库更多 Skills
release
Run the whole local release pipeline in order, stopping at each human gate. Triggers on "run the release", "prepare a release", "/release", "зроби реліз", "підготуй реліз". Drives the four stages back to back — bump-version → curate-changelog → release-notes → check-docs-drift — pausing after each so the human reviews the diff before the next stage. Prepares everything in the working tree; never tags, commits, or pushes. The tag push (which fires CI) stays the human's action.
release-notes
Draft partner-facing release notes from the same commits as the changelog. Triggers on "draft release notes", "release notes for the next version", "/release-notes", "нотатки релізу", "release notes партнеру". Same input as curate-changelog, different audience and tone: a short, benefit-first narrative for a user or partner — "what's new for you" — not a categorized engineer's list. Keeps only changes a user actually notices; drops internal refactors and tooling. Prints the notes to the chat to seed a GitHub Release description or a partner announcement. Writes no file.
curate-changelog
Curate the [Unreleased] section of docs/CHANGELOG.md from git history. Triggers on "curate the changelog", "update the changelog", "/curate-changelog", "онови changelog", "курування журналу". Reads git log since the last tag, FILTERS out what a reader never feels (test/ci/chore/merge), GROUPS commits about one feature into one bullet, and REWRITES technical subjects into plain language under the six Keep a Changelog categories (Added/Changed/Deprecated/ Removed/Fixed/Security). The result must have FEWER lines than the raw log — that is the proof of curation, not a dump. Leaves the edit in the working tree; never commits or pushes.
codify-rule
Turn a repeated mistake into a durable, path-scoped rule in .claude/rules/. Triggers on "codify this rule", "make a rule so this doesn't happen again", "/codify-rule", "закодифікуй правило", "петля помилка-правило". Use only when the same mistake showed up TWICE (twice = a pattern, once = noise). Names the wrong shape and the right shape with one short example of each, scopes the rule to the paths that matter, and leaves the edit in the working tree so the next agent on this repo inherits the fix. Edits only .claude/rules/; never commits or pushes.
check-docs-drift
Find and fix where docs/api.md fell behind the code. Triggers on "check for doc drift", "is the API doc up to date", "/check-docs-drift", "перевір дрейф документації", "docs drift". Runs the deterministic scripts/check-docs-drift.py (parses the public NoteBook methods with ast, compares to what docs/api.md documents — NO LLM finds the gap), reports the drift, and PROPOSES the doc edit that closes it. The gap is found by parsing; the agent writes the missing documentation in the doc's existing style. Edits only docs/; never commits or pushes.
bump-version
Decide and apply the next semver for a release. Triggers on "bump the version", "what version is next", "/bump-version", "простав версію", "яка наступна версія". Reads the next number from the deterministic scripts/next-version.sh (NEVER guesses it), explains in plain language WHICH part moved and why (e.g. "MINOR, because a feat landed: filter notes by tag"), edits the version line in pyproject.toml, and proposes the matching `git tag vX.Y.Z`. The number is decided by a rule; the agent explains and applies — the human confirms the tag. Never pushes a tag itself.