-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopier.yml
More file actions
156 lines (134 loc) · 6.16 KB
/
Copy pathcopier.yml
File metadata and controls
156 lines (134 loc) · 6.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
_subdirectory: copier-template
_answers_file: .copier-answers.yml
_templates_suffix: .jinja
l0_source_sha:
type: str
default: unknown
help: "Source git SHA for the L0 template revision used to render this L1 repo."
company_slug:
type: str
default: holdingco
help: "Company slug for path derivation (e.g., holdingco, softwareco, healthco)"
company_name:
type: str
default: Holding Company
help: "Company display name (e.g., Holding Company, Software Company)"
repo_slug:
type: str
default: "{{ company_slug }}"
help: "Slug for the generated company repository (defaults to company_slug)."
maintainer_handle:
type: str
default: "@template-owner"
help: "Owner handle used in generated docs/contracts."
l1_org_docs_profile:
type: str
default: rich
choices:
- rich
- compact
help: "Organization docs profile for generated L1 repositories."
l2_org_docs_default:
type: str
default: compact
choices:
- compact
- rich
help: "Default org-context profile for generated tpl-project-repo and tpl-monorepo repositories."
enable_vouch_gate:
type: bool
default: false
help: "Enable vouch trust-gate baseline in generated L1/L2 repositories."
enable_community_pack:
type: bool
default: false
help: "Enable community collaboration baseline (issue templates, CoC, support docs)."
enable_release_pack:
type: bool
default: false
help: "Enable release baseline (release-please, release checks, publish automation)."
_tasks:
- "chmod +x scripts/new-repo-from-copier.sh scripts/check-template-ci.sh scripts/install-hooks.sh scripts/ci/smoke.sh scripts/ci/full.sh scripts/release/check.sh scripts/release/publish.sh scripts/lib/check-template-ak.py .githooks/pre-commit .githooks/pre-push"
- "chmod +x copier/tpl-agent-repo/scripts/ci/smoke.sh copier/tpl-agent-repo/scripts/ci/full.sh copier/tpl-org-repo/scripts/ci/smoke.sh copier/tpl-org-repo/scripts/ci/full.sh copier/tpl-project-repo/scripts/ci/smoke.sh copier/tpl-project-repo/scripts/ci/full.sh"
- "{{ 'true' if l1_org_docs_profile == 'rich' else 'rm -f docs/org/purpose.md docs/org/mission.md docs/org/vision.md docs/org/strategic_objectives.md docs/org/values_ethics.md docs/org/governance.md docs/org/glossary.md' }}"
- "{{ 'true' if enable_community_pack else 'rm -f CODE_OF_CONDUCT.md SUPPORT.md .github/pull_request_template.md .github/ISSUE_TEMPLATE/config.yml .github/ISSUE_TEMPLATE/bug-report.yml .github/ISSUE_TEMPLATE/feature-request.yml' }}"
- "{{ 'true' if enable_release_pack else 'rm -f .github/workflows/release-please.yml .github/workflows/release-check.yml .github/workflows/publish.yml .release-please-config.json .release-please-manifest.json CHANGELOG.md SECURITY.md && rm -rf scripts/release' }}"
- "rm -rf copier/template-repo"
- |
if [ -f contracts/provenance-seal.yml ]; then
if command -v sha256sum >/dev/null 2>&1; then
content_hash="$(
find . -type f \
! -path './.git/*' \
! -path './contracts/provenance-seal.yml' \
| LC_ALL=C sort \
| while IFS= read -r path; do
sha256sum "$path"
done \
| sha256sum \
| awk '{print $1}'
)"
elif command -v shasum >/dev/null 2>&1; then
content_hash="$(
find . -type f \
! -path './.git/*' \
! -path './contracts/provenance-seal.yml' \
| LC_ALL=C sort \
| while IFS= read -r path; do
shasum -a 256 "$path"
done \
| shasum -a 256 \
| awk '{print $1}'
)"
else
content_hash="unavailable"
fi
tmp_file="$(mktemp)"
awk -v hash="$content_hash" '{ gsub("__RENDER_HASH__", hash); print }' contracts/provenance-seal.yml > "$tmp_file"
mv "$tmp_file" contracts/provenance-seal.yml
fi
_message_after_copy: |
L1 company repository scaffolded at {{ _copier_conf.dst_path }}
Company: {{ company_name }} ({{ company_slug }})
Repository: {{ repo_slug }}
Structure:
- AGENTS.md (company-level context, loaded by pi)
- scripts/ (shared tooling: rocs.sh, docs-list.sh, new-repo-from-copier.sh)
- copier/ (L2 templates)
- owned/ (L2 projects we operate - gitignored, each has own .git)
- contrib/ (L2 upstream contributions - gitignored)
- infra/ (L2 infrastructure - gitignored)
- agents/ (L2 AI agent repos - gitignored)
Embedded L2 templates:
- copier/tpl-project-repo/ (Delivery projects)
- copier/tpl-agent-repo/ (AI agent repos)
- copier/tpl-org-repo/ (Organization handbooks)
- copier/tpl-monorepo/ (Monorepo workspaces)
- copier/tpl-package/ (Packages inside monorepos)
Next steps:
- Initialize git: git init && git add . && git commit -m "Init from L0"
- Run: bash ./scripts/check-template-ci.sh
- Create L2 project:
./scripts/new-repo-from-copier.sh tpl-project-repo ./owned/my-project \
-d repo_slug=my-project --defaults --overwrite
- Create L2 agent:
./scripts/new-repo-from-copier.sh tpl-agent-repo ./agents/agent-myagent \
-d repo_slug=agent-myagent --defaults --overwrite
- Create L2 org handbook:
./scripts/new-repo-from-copier.sh tpl-org-repo ./myorg-handbook \
-d repo_slug=myorg-handbook --defaults --overwrite
Organization docs profile (L1):
- currently {{ l1_org_docs_profile }}
- toggle at generation time with: -d l1_org_docs_profile=rich|compact
Default L2 org-context profile (tpl-project-repo / tpl-monorepo):
- currently {{ l2_org_docs_default }}
- toggle at generation time with: -d l2_org_docs_default=compact|rich
Community pack:
- currently {{ 'enabled' if enable_community_pack else 'disabled' }}
- toggle at generation time with: -d enable_community_pack=true|false
Release pack:
- currently {{ 'enabled' if enable_release_pack else 'disabled' }}
- toggle at generation time with: -d enable_release_pack=true|false
Vouch trust-gate:
- currently {{ 'enabled' if enable_vouch_gate else 'disabled' }}
- toggle at generation time with: -d enable_vouch_gate=true|false