Skilllibrary repo-scaffold-factory
Generate the base repository file structure including README, AGENTS.md, docs layout, ticket templates, and the agent configuration scaffold. Use when creating a greenfield repo foundation or resetting a weakly structured project. This generates a generic starting structure that other skills then customize. Do not use when the repo already has established structure (risks overwriting).
git clone https://github.com/merceralex397-collab/skilllibrary
T=$(mktemp -d) && git clone --depth=1 https://github.com/merceralex397-collab/skilllibrary "$T" && mkdir -p ~/.claude/skills && cp -r "$T/01-package-scaffolding/repo-scaffold-factory" ~/.claude/skills/merceralex397-collab-skilllibrary-repo-scaffold-factory && rm -rf "$T"
01-package-scaffolding/repo-scaffold-factory/SKILL.mdRepo Scaffold Factory
Use this skill to generate the initial repository file tree. This is a TWO-PHASE process.
Phase A: Generate the base scaffold
Option 1: Script-assisted generation (recommended for large scaffolds)
If a bootstrap script is available (e.g.,
scripts/bootstrap_repo_scaffold.py), use it for deterministic mechanical work: copying template files, substituting placeholders, and generating metadata.
python3 scripts/bootstrap_repo_scaffold.py \ --dest <destination-path> \ --project-name "<Project Name>" \ --model-provider "<provider>" \ --planner-model "<planner-model-string>" \ --implementer-model "<implementer-model-string>"
Common placeholder substitutions:
→ project name__PROJECT_NAME__
→ URL-safe slug__PROJECT_SLUG__
→ prefix for agent filenames__AGENT_PREFIX__
→ provider label__MODEL_PROVIDER__
→ stack/framework label__STACK_LABEL__
Derive arguments from the canonical brief and user decisions.
Option 2: Manual generation
If no script exists, create the structure manually:
# Core structure mkdir -p src tests docs scripts .github/ISSUE_TEMPLATE .github/workflows # Agent-operated repo additions mkdir -p tickets # Plus agent config dir: .opencode/, .copilot/, .codex/, or equivalent
Generate these files:
- README.md: Project name, one-line description, quick-start commands, pointer to AGENTS.md
- AGENTS.md: Reading order, before-making-changes checklist, commit convention, what NOT to modify
- .github/ISSUE_TEMPLATE/: Bug report and feature request templates
- .github/pull_request_template.md: PR template with checklist
- docs/ARCHITECTURE.md: Placeholder for system design
- docs/CONTRIBUTING.md: Setup and workflow instructions
- .gitignore: Language-appropriate ignores
Phase B: Customize with project-specific content
After the base files exist, customize them with actual project content from the canonical brief:
Files to customize now
- README.md — Replace generic sections with actual project description and setup instructions
- AGENTS.md — Populate with actual project rules, conventions, and truth hierarchy
- Canonical brief — Ensure it's placed correctly (
ordocs/spec/CANONICAL-BRIEF.md
)docs/BRIEF.md - docs/process/workflow.md — Customize if the project has specific process requirements
Files to leave for other skills
- START-HERE.md — Generated by
at flow endhandoff-brief - Agent prompts — Customized by
(or equivalent)opencode-team-bootstrap - Project-local skills — Customized by
project-skill-bootstrap
Files NOT to customize at this stage
- Standard workflow tools, enforcement plugins, and stage-gate config — keep as generated
Output contract
./ ├── README.md ├── AGENTS.md ├── .gitignore ├── docs/ │ ├── BRIEF.md or spec/CANONICAL-BRIEF.md (input, not generated) │ ├── ARCHITECTURE.md │ └── CONTRIBUTING.md ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ └── feature_request.md │ └── pull_request_template.md ├── src/ ├── tests/ ├── scripts/ ├── tickets/ (if agent-operated) └── <agent-config-dir>/ (if agent-operated)
Failure handling
- No canonical brief: Stop. Cannot generate meaningful scaffold without knowing what the project is.
- No stack profile: Proceed with generic structure. Log warning: "Stack not specified, using generic scaffold."
- Directory already exists with content: Do not overwrite. Report conflict and ask for confirmation.
- Git init fails: Continue without git. Note that repo is not version controlled.
References
- This is step 3 of the scaffold-kickoff flow — continue to
../opencode-team-bootstrap/SKILL.md - GitHub template repositories: https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template