Files
Alexander BaranovandClaude Sonnet 5 64e6c2f5f5 fix: force UTF-8 stdout/stderr in repoctl and drop non-ASCII em dashes
End-to-end smoke testing of `init` and `adopt` (plan -> approve -> apply -> verify)
via subprocess surfaced a real portability bug: on Windows, sys.stdout defaults to
the console codepage rather than UTF-8 when not attached to a UTF-8 terminal, so
machine YAML/JSON output containing non-ASCII characters (an em dash in generated
skill/docstring text) could fail to decode for downstream consumers. repoctl now
reconfigures stdout/stderr to UTF-8 unconditionally in main(), and the offending
em dashes are replaced with ASCII hyphens so generated file content is unaffected
either way.

Verified via manual CLI smoke tests: full init and adopt flows (including baseline
re-check, plan-hash approval, collision rejection on re-apply, and preservation of
profiles-source/, profiles/ and legacy kdb.yaml) work end to end.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-24 15:04:11 +03:00

24 lines
1.0 KiB
Markdown

---
name: repository-bootstrap
description: Bootstrap a new repository into Repository Stewardship using repoctl init. Use when creating a new repository or scaffolding ops/contract.yaml, kdb/kdb.yaml and agent entrypoints from scratch.
---
# repository-bootstrap
Thin wrapper around `repoctl init`. Do not reimplement classification, template
rendering or validation here - call the CLI and explain its output.
## Procedure
1. Collect the missing decisions from the user: repository type
(`infrastructure-config` | `service-config` | `software` | `project`), `metadata.name`,
`title`, `owners`, `lifecycle`.
2. Run `repoctl init --repo <path> --answers <answers-file> --output json` to obtain a
`BootstrapPlan` (this performs no writes).
3. Show the user the planned files and the `planHash`.
4. Only after explicit approval, run
`repoctl init --repo <path> --apply --plan <plan-file> --approve <planHash>`.
5. Report the resulting `repoctl validate --repo <path>` findings.
Never invent files outside the plan and never skip the approval step.