Add the local project, framework submodule, hooks and templates

After the repositories and the mirror, the script now creates the local
project: the directory, git on main, credential-free origin (and github)
remotes, and the license history from Gitea. Then it adds the framework as
a submodule over SSH, installs its skills and git hooks once (plan gate
optional), and copies the AGENTS.md and artifact registry templates.

Nothing is overwritten without a yes: an existing directory, core.hooksPath,
AGENTS.md or docs/artifact-registry.md each ask first (default no). Without
SSH the framework steps can only be skipped, after a yes. No commit is made
in the new project. New optional config key FRAMEWORK_REPO.

New library files git.sh, localproject.sh and framework.sh. Tests run real
git against local bare repositories that stand in for Gitea and the
framework, with a private git configuration (769 checks). The README is now
the full guide.

Task: MIL-003#1
Task: MIL-003#2
Task: MIL-003#3
Task: MIL-003#4
Task: MIL-003#5
Refs #15
Refs #16
Refs #17
Refs #18
Refs #19

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-05 15:54:02 +08:00
co-authored by Claude Sonnet 5.5
parent 736cdb42fc
commit 0030334e5e
19 changed files with 1185 additions and 68 deletions
+22 -1
View File
@@ -4,7 +4,7 @@
#
# Part of create-project.sh: sourced by it, never run on its own.
#
# Provides: create_all, confirm_reuse, apply_plan
# Provides: create_all, confirm_reuse, confirm_framework_access, apply_plan
create_all() {
IS_CREATION_STARTED=1
@@ -15,6 +15,25 @@ create_all() {
if ((PROJECT[has_github])); then
configure_mirror
fi
create_local_project
add_framework
install_framework
copy_templates
}
# confirm_framework_access: the framework comes over SSH. Without SSH the
# Maintainer can still go on, without the framework steps, after a yes.
confirm_framework_access() {
if ((${STATE[is_ssh_ok]:-0})); then
STATE[skip_framework]=0
return 0
fi
warn "SSH to Gitea ($(gitea_host) port ${CONFIG[GITEA_SSH_PORT]}) did not work, so the framework cannot be added: ${STATE[ssh_note]}"
prompt_yes_no "Create the repositories and the local project without the framework" n
if ! ((REPLY)); then
die "stopped: set up SSH access to Gitea (see the README) and run again"
fi
STATE[skip_framework]=1
}
confirm_reuse() {
@@ -42,5 +61,7 @@ apply_plan() {
return 0
fi
confirm_reuse
confirm_local_directory
confirm_framework_access
create_all
}