git-repokit 0.9.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. git_repokit-0.9.10.dist-info/METADATA +422 -0
  2. git_repokit-0.9.10.dist-info/RECORD +174 -0
  3. git_repokit-0.9.10.dist-info/WHEEL +5 -0
  4. git_repokit-0.9.10.dist-info/entry_points.txt +2 -0
  5. git_repokit-0.9.10.dist-info/licenses/LICENSE +9 -0
  6. git_repokit-0.9.10.dist-info/top_level.txt +1 -0
  7. repokit/__init__.py +8 -0
  8. repokit/__main__.py +12 -0
  9. repokit/__version__.py +4 -0
  10. repokit/_vendor/__init__.py +0 -0
  11. repokit/_vendor/ailib/__init__.py +1 -0
  12. repokit/_vendor/ailib/analyzer.py +177 -0
  13. repokit/_vendor/ailib/backend.py +95 -0
  14. repokit/_vendor/ailib/cache.py +97 -0
  15. repokit/_vendor/ailib/parsers.py +52 -0
  16. repokit/_vendor/ailib/transports/__init__.py +16 -0
  17. repokit/_vendor/ailib/transports/cli.py +312 -0
  18. repokit/_vendor/ailib/transports/openai_compat.py +383 -0
  19. repokit/_vendor/ailib/transports/prompt_file.py +41 -0
  20. repokit/_vendor/ailib/types.py +224 -0
  21. repokit/auth_integration.py +244 -0
  22. repokit/badges.py +183 -0
  23. repokit/branch_utils.py +364 -0
  24. repokit/cli.py +2997 -0
  25. repokit/common_kit.py +202 -0
  26. repokit/config.py +686 -0
  27. repokit/defaults.py +220 -0
  28. repokit/directory_analyzer.py +1244 -0
  29. repokit/directory_profiles.py +423 -0
  30. repokit/git_config.py +370 -0
  31. repokit/github_create.py +142 -0
  32. repokit/github_setup.py +248 -0
  33. repokit/guardrails.py +707 -0
  34. repokit/history_cleaner.py +449 -0
  35. repokit/history_protection.py +434 -0
  36. repokit/hooks/pre-commit-guardrails +122 -0
  37. repokit/hooks/pre-commit-template +28 -0
  38. repokit/layers.py +510 -0
  39. repokit/licenses/0bsd.txt +14 -0
  40. repokit/licenses/LICENSES.md +27 -0
  41. repokit/licenses/__init__.py +142 -0
  42. repokit/licenses/agpl-3.0.txt +661 -0
  43. repokit/licenses/all-rights-reserved.txt +10 -0
  44. repokit/licenses/apache-2.0.txt +201 -0
  45. repokit/licenses/bsd-2-clause.txt +24 -0
  46. repokit/licenses/bsd-3-clause.txt +28 -0
  47. repokit/licenses/bsl-1.0.txt +23 -0
  48. repokit/licenses/cc-by-4.0.txt +395 -0
  49. repokit/licenses/cc-by-sa-4.0.txt +427 -0
  50. repokit/licenses/cc0-1.0.txt +121 -0
  51. repokit/licenses/epl-2.0.txt +277 -0
  52. repokit/licenses/gpl-2.0.txt +339 -0
  53. repokit/licenses/gpl-3.0.txt +674 -0
  54. repokit/licenses/isc.txt +15 -0
  55. repokit/licenses/lgpl-2.1.txt +504 -0
  56. repokit/licenses/lgpl-3.0.txt +165 -0
  57. repokit/licenses/mit.txt +21 -0
  58. repokit/licenses/mpl-2.0.txt +373 -0
  59. repokit/licenses/unlicense.txt +24 -0
  60. repokit/readme_blocks.py +112 -0
  61. repokit/remote_integration.py +627 -0
  62. repokit/repo_manager.py +2796 -0
  63. repokit/template_engine.py +391 -0
  64. repokit/templates/ai/claude/CLAUDE-nested.md.template +25 -0
  65. repokit/templates/ai/claude/CLAUDE.md.template +98 -0
  66. repokit/templates/ai/claude/instructions/step1_context_rebuilder.md +33 -0
  67. repokit/templates/ai/claude/instructions/step2_dev_workflow_process.md +67 -0
  68. repokit/templates/ai/claude/instructions/step3_context_bridge.md +52 -0
  69. repokit/templates/common/CHANGELOG.md.template +15 -0
  70. repokit/templates/common/CONTRIBUTING.md.template +31 -0
  71. repokit/templates/common/README.md.template +30 -0
  72. repokit/templates/common/gitattributes.template +17 -0
  73. repokit/templates/common/gitignore.template +141 -0
  74. repokit/templates/extras/FUNDING.yml.template +13 -0
  75. repokit/templates/extras/ROADMAP.md.template +17 -0
  76. repokit/templates/extras/dependabot.yml.template +22 -0
  77. repokit/templates/extras/one-offs-README.md.template +28 -0
  78. repokit/templates/extras/platform-support.md.template +11 -0
  79. repokit/templates/extras/pull_request_template.md.template +25 -0
  80. repokit/templates/extras/release-template.md.template +34 -0
  81. repokit/templates/extras/settings.json.template +11 -0
  82. repokit/templates/extras/stale.yml.template +14 -0
  83. repokit/templates/github/CODEOWNERS.template +11 -0
  84. repokit/templates/github/ISSUE_TEMPLATE/bug-report.md.template +29 -0
  85. repokit/templates/github/ISSUE_TEMPLATE/feature-request.md.template +19 -0
  86. repokit/templates/github/issues/notes.md.template +18 -0
  87. repokit/templates/github/issues/roadmap.md.template +15 -0
  88. repokit/templates/hooks/pre-commit.template +64 -0
  89. repokit/templates/layers/archetypes/any/claude-plugin/.claude-plugin/marketplace.json +20 -0
  90. repokit/templates/layers/archetypes/any/claude-plugin/plugin/.claude-plugin/plugin.json +15 -0
  91. repokit/templates/layers/archetypes/any/claude-plugin/plugin/README.md +28 -0
  92. repokit/templates/layers/archetypes/c-cpp/cmake-app/.github/workflows/ci-c-cpp.yml +24 -0
  93. repokit/templates/layers/archetypes/c-cpp/cmake-app/.repokit-common.toml.rkappend +4 -0
  94. repokit/templates/layers/archetypes/c-cpp/cmake-app/.vscode/launch.json +29 -0
  95. repokit/templates/layers/archetypes/c-cpp/cmake-app/.vscode/tasks.json +26 -0
  96. repokit/templates/layers/archetypes/c-cpp/cmake-app/CMakeLists.txt +47 -0
  97. repokit/templates/layers/archetypes/c-cpp/cmake-app/CMakePresets.json +23 -0
  98. repokit/templates/layers/archetypes/c-cpp/cmake-app/cmake/GenerateStamp.cmake +45 -0
  99. repokit/templates/layers/archetypes/c-cpp/cmake-app/src/main.cpp +27 -0
  100. repokit/templates/layers/archetypes/c-cpp/cmake-app/tests/test_version.cpp +20 -0
  101. repokit/templates/layers/archetypes/c-cpp/cmake-app/vcpkg.json +5 -0
  102. repokit/templates/layers/archetypes/c-cpp/minimal/.vscode/launch.json +27 -0
  103. repokit/templates/layers/archetypes/c-cpp/minimal/Makefile +10 -0
  104. repokit/templates/layers/archetypes/c-cpp/minimal/build.bat +7 -0
  105. repokit/templates/layers/archetypes/c-cpp/minimal/src/__RK_SNAKE__.c +26 -0
  106. repokit/templates/layers/archetypes/c-cpp/msbuild/.vscode/launch.json +17 -0
  107. repokit/templates/layers/archetypes/c-cpp/msbuild/.vscode/tasks.json +20 -0
  108. repokit/templates/layers/archetypes/c-cpp/msbuild/__RK_PROJECT__.sln +19 -0
  109. repokit/templates/layers/archetypes/c-cpp/msbuild/__RK_PROJECT__.vcxproj +41 -0
  110. repokit/templates/layers/archetypes/c-cpp/msbuild/src/main.cpp +26 -0
  111. repokit/templates/layers/archetypes/js-ts/claude-plugin/.repokit-common.toml +28 -0
  112. repokit/templates/layers/archetypes/js-ts/claude-plugin/.vscode/launch.json +34 -0
  113. repokit/templates/layers/archetypes/js-ts/claude-plugin/plugin/hooks/hooks.json +15 -0
  114. repokit/templates/layers/archetypes/js-ts/claude-plugin/plugin/hooks/scripts/session-start.mjs +23 -0
  115. repokit/templates/layers/archetypes/js-ts/claude-plugin/plugin/tests/manifest.test.js +30 -0
  116. repokit/templates/layers/archetypes/js-ts/node/.repokit-common.toml.rkappend +6 -0
  117. repokit/templates/layers/archetypes/js-ts/node/package.json +13 -0
  118. repokit/templates/layers/archetypes/js-ts/node-package/.github/workflows/release.yml +39 -0
  119. repokit/templates/layers/archetypes/js-ts/node-package/package.json +32 -0
  120. repokit/templates/layers/archetypes/js-ts/node-package/src/index.ts +13 -0
  121. repokit/templates/layers/archetypes/js-ts/node-package/tests/index.test.ts +11 -0
  122. repokit/templates/layers/archetypes/js-ts/script/.vscode/launch.json +34 -0
  123. repokit/templates/layers/archetypes/js-ts/script/__RK_PROJECT__.js +37 -0
  124. repokit/templates/layers/archetypes/js-ts/script/tests/version.test.js +26 -0
  125. repokit/templates/layers/archetypes/js-ts/ts/package.json +18 -0
  126. repokit/templates/layers/archetypes/js-ts/ts/tsconfig.json +15 -0
  127. repokit/templates/layers/archetypes/python/claude-plugin/.github/workflows/ci-python.yml +44 -0
  128. repokit/templates/layers/archetypes/python/claude-plugin/.repokit-common.toml +21 -0
  129. repokit/templates/layers/archetypes/python/claude-plugin/.vscode/launch.json +33 -0
  130. repokit/templates/layers/archetypes/python/claude-plugin/VERSION +1 -0
  131. repokit/templates/layers/archetypes/python/claude-plugin/plugin/hooks/hooks.json +15 -0
  132. repokit/templates/layers/archetypes/python/claude-plugin/plugin/hooks/scripts/run-hook.mjs +42 -0
  133. repokit/templates/layers/archetypes/python/claude-plugin/plugin/hooks/scripts/session_start.py +31 -0
  134. repokit/templates/layers/archetypes/python/claude-plugin/plugin/tests/test_manifest.py +42 -0
  135. repokit/templates/layers/archetypes/python/pypi/.github/workflows/release.yml +63 -0
  136. repokit/templates/layers/archetypes/python/pypi/.vscode/launch.json +43 -0
  137. repokit/templates/layers/archetypes/python/pypi/__RK_SNAKE__/__init__.py +5 -0
  138. repokit/templates/layers/archetypes/python/pypi/__RK_SNAKE__/__main__.py +6 -0
  139. repokit/templates/layers/archetypes/python/pypi/__RK_SNAKE__/_version.py +96 -0
  140. repokit/templates/layers/archetypes/python/pypi/__RK_SNAKE__/cli.py +18 -0
  141. repokit/templates/layers/archetypes/python/pypi/pyproject.toml +71 -0
  142. repokit/templates/layers/archetypes/python/pypi/tests/conftest.py +11 -0
  143. repokit/templates/layers/archetypes/python/pypi/tests/test_version.py +50 -0
  144. repokit/templates/layers/archetypes/python/script/.github/workflows/ci-python.yml +43 -0
  145. repokit/templates/layers/archetypes/python/script/.repokit-common.toml +14 -0
  146. repokit/templates/layers/archetypes/python/script/.vscode/launch.json +33 -0
  147. repokit/templates/layers/archetypes/python/script/VERSION +1 -0
  148. repokit/templates/layers/archetypes/python/script/__RK_PROJECT__.py +40 -0
  149. repokit/templates/layers/archetypes/python/script/tests/test_version.py +25 -0
  150. repokit/templates/layers/archetypes/python/setuppy/requirements.txt +8 -0
  151. repokit/templates/layers/archetypes/python/setuppy/setup.py +23 -0
  152. repokit/templates/layers/languages/c-cpp/.gitignore.rkappend +20 -0
  153. repokit/templates/layers/languages/c-cpp/.repokit-common.toml +7 -0
  154. repokit/templates/layers/languages/c-cpp/include/__RK_SNAKE__/version.h +20 -0
  155. repokit/templates/layers/languages/c-cpp/src/app.rc +25 -0
  156. repokit/templates/layers/languages/js-ts/.editorconfig +15 -0
  157. repokit/templates/layers/languages/js-ts/.github/workflows/ci-js-ts.yml +41 -0
  158. repokit/templates/layers/languages/js-ts/.gitignore.rkappend +13 -0
  159. repokit/templates/layers/languages/js-ts/.repokit-common.toml +19 -0
  160. repokit/templates/layers/languages/js-ts/.vscode/launch.json +24 -0
  161. repokit/templates/layers/languages/js-ts/VERSION +1 -0
  162. repokit/templates/layers/languages/python/.github/workflows/ci-python.yml +76 -0
  163. repokit/templates/layers/languages/python/.gitignore.rkappend +15 -0
  164. repokit/templates/layers/languages/python/.vscode/launch.json +33 -0
  165. repokit/templates/layers/manifest.toml +302 -0
  166. repokit/templates/vault/CLAUDE.md +29 -0
  167. repokit/templates/vault/claude/_maps/MOC-project.md +15 -0
  168. repokit/templates/vault/claude/_oracle/backlinks.md +3 -0
  169. repokit/templates/vault/claude/_oracle/concepts.md +12 -0
  170. repokit/templates/vault/claude/_oracle/manifest.md +10 -0
  171. repokit/templates/vault/claude/_todo/ACTIVE-WORK.md +18 -0
  172. repokit/templates/vault/claude/_todo/OPEN-LOOPS.md +14 -0
  173. repokit/utils.py +316 -0
  174. repokit/vault.py +248 -0
repokit/defaults.py ADDED
@@ -0,0 +1,220 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Default configuration values for RepoKit.
4
+
5
+ This module provides centralized default values to prevent duplication
6
+ and ensure consistency across the codebase.
7
+ """
8
+
9
+ from typing import List
10
+
11
+ # Default private directories that should not appear in public branches
12
+ DEFAULT_PRIVATE_DIRS = [
13
+ "private",
14
+ "revisions",
15
+ "logs",
16
+ "convos"
17
+ ]
18
+
19
+ # Default sensitive files that should not appear in public branches.
20
+ # `.repokit.json` left this list in 0.9.6 (djdarcy, 2026-10-24: "Track it"):
21
+ # the record of how a project was made is committed with it, as the template
22
+ # route and git-repokit itself do; it holds nothing private.
23
+ DEFAULT_SENSITIVE_FILES = [
24
+ "CLAUDE.md",
25
+ ]
26
+
27
+ # Default sensitive file patterns (supports glob patterns)
28
+ # Cross-platform compatible patterns using Python's fnmatch/pathlib
29
+ DEFAULT_SENSITIVE_PATTERNS = [
30
+ "Clipboard Text*",
31
+ "nul", # Windows reserved name
32
+ "*.tmp",
33
+ "*.log",
34
+ ".env*",
35
+ "*.backup",
36
+ "*.bak",
37
+ "*.*~", # Vim backup files (primary pattern for files like listall.cmd~)
38
+ "*~", # Vim backup files (fallback for single extension)
39
+ "logs/*", # All files in logs directory
40
+ "logs/**/*", # All files in logs subdirectories
41
+ "revisions/*", # All files in revisions directory
42
+ "revisions/**/*", # All files in revisions subdirectories
43
+ ]
44
+
45
+ # Default branch configurations for BranchContext
46
+ DEFAULT_PRIVATE_BRANCHES = [
47
+ "private",
48
+ "local"
49
+ ]
50
+
51
+ DEFAULT_PUBLIC_BRANCHES = [
52
+ "main",
53
+ "master",
54
+ "dev",
55
+ "test",
56
+ "staging",
57
+ "live",
58
+ "prod",
59
+ "production"
60
+ ]
61
+
62
+ # Files/directories that should only exist in private branches
63
+ DEFAULT_PRIVATE_PATTERNS = [
64
+ "CLAUDE.md",
65
+ "private/",
66
+ "convos/",
67
+ "logs/",
68
+ "credentials/",
69
+ "secrets/",
70
+ ".env.local",
71
+ ".env.private",
72
+ "**/__private__*",
73
+ "**/private_*",
74
+ "*~", # Vim backup files
75
+ "*.*~", # Vim backup files (multiple extensions)
76
+ ]
77
+
78
+ # Files that should be excluded from public branches during merges
79
+ DEFAULT_EXCLUDE_FROM_PUBLIC = [
80
+ "CLAUDE.md",
81
+ "private/claude/",
82
+ "private/docs/",
83
+ "private/notes/",
84
+ "private/temp/",
85
+ "revisions/",
86
+ "test-runs/",
87
+ "test_runs/",
88
+ ]
89
+
90
+ # Branch-specific excludes - files that should only exist in certain branches
91
+ BRANCH_SPECIFIC_EXCLUDES = {
92
+ "private": [], # Private branch can contain everything
93
+ "dev": DEFAULT_PRIVATE_DIRS + DEFAULT_SENSITIVE_FILES,
94
+ "main": DEFAULT_PRIVATE_DIRS + DEFAULT_SENSITIVE_FILES,
95
+ "staging": DEFAULT_PRIVATE_DIRS + DEFAULT_SENSITIVE_FILES,
96
+ "test": DEFAULT_PRIVATE_DIRS + DEFAULT_SENSITIVE_FILES,
97
+ "live": DEFAULT_PRIVATE_DIRS + DEFAULT_SENSITIVE_FILES,
98
+ }
99
+
100
+ # Branch strategies -- the one definition. Everything else (config defaults,
101
+ # CLI choices and help, the branches publish pushes, directory_analyzer's
102
+ # list) derives from this table.
103
+ #
104
+ # branches branches created (and pushed on publish)
105
+ # worktrees branches checked out as worktrees beside the repository
106
+ # private_branch the local-only branch for private work, or None for none
107
+ # push branches publish pushes (default: branches)
108
+ #
109
+ # main-only is the recommended model: one branch, private notes kept out of
110
+ # git (in S3, in a separate repository under private/). The others are the
111
+ # private-branch model: private work on a local-only branch, finished work
112
+ # moved to the public branches. Valid, more involved, fully supported.
113
+ BRANCH_STRATEGIES = {
114
+ "main-only": {
115
+ "branches": ["main"],
116
+ "worktrees": [],
117
+ "private_branch": None,
118
+ },
119
+ "standard": {
120
+ "branches": ["main", "dev", "staging", "test", "live"],
121
+ "worktrees": ["main", "dev"],
122
+ "private_branch": "private",
123
+ },
124
+ "simple": {
125
+ "branches": ["main", "dev"],
126
+ "worktrees": ["main"],
127
+ "private_branch": "private",
128
+ },
129
+ "gitflow": {
130
+ "branches": ["main", "develop", "release", "hotfix"],
131
+ "worktrees": ["main", "develop"],
132
+ "private_branch": "private",
133
+ # release/hotfix are local working branches; publish pushes these two
134
+ "push": ["main", "develop"],
135
+ },
136
+ "github-flow": {
137
+ "branches": ["main"],
138
+ "worktrees": ["main"],
139
+ "private_branch": "private",
140
+ },
141
+ # minimal used to declare private_branch "main", but --private-branch's
142
+ # CLI default always overrode it, so `create` has always made a "private"
143
+ # branch beside main. Honouring "main" would commit private files to the
144
+ # public branch (the pre-commit guard refuses them), so the table states
145
+ # what minimal has always done.
146
+ "minimal": {
147
+ "branches": ["main"],
148
+ "worktrees": [],
149
+ "private_branch": "private",
150
+ },
151
+ }
152
+
153
+ PRIVATE_BRANCH_STRATEGIES = [name for name in BRANCH_STRATEGIES if name != "main-only"]
154
+
155
+ # What a bare `repokit create` makes. adopt and migrate build the private-branch
156
+ # model only, so they default to the strategy below instead.
157
+ DEFAULT_BRANCH_STRATEGY = "main-only"
158
+ DEFAULT_ADOPT_STRATEGY = "standard"
159
+
160
+
161
+ def strategy_branch_list(name: str) -> List[str]:
162
+ """All branches a strategy has, its private branch first when it has one."""
163
+ strategy = BRANCH_STRATEGIES[name]
164
+ private = strategy["private_branch"]
165
+ branches = list(strategy["branches"])
166
+ if private and private not in branches:
167
+ branches.insert(0, private)
168
+ return branches
169
+
170
+
171
+ def strategy_push_branches(name: str) -> List[str]:
172
+ """Branches publish pushes for a strategy; [] for an unknown strategy."""
173
+ strategy = BRANCH_STRATEGIES.get(name)
174
+ if strategy is None:
175
+ return []
176
+ return list(strategy.get("push", strategy["branches"]))
177
+
178
+
179
+ # Branch lists per strategy, private branch included (used by directory_analyzer)
180
+ DEFAULT_BRANCH_STRATEGIES = {name: strategy_branch_list(name) for name in BRANCH_STRATEGIES}
181
+
182
+ # Default directory profiles - centralized from directory_profiles.py
183
+ DEFAULT_DIRECTORY_PROFILES = {
184
+ "minimal": ["src", "tests", "docs"],
185
+ "standard": [
186
+ "src", "tests", "docs", "scripts", "config",
187
+ "logs", "private", "convos", "revisions"
188
+ ],
189
+ "complete": [
190
+ "src", "tests", "docs", "scripts", "config", "logs",
191
+ "private", "convos", "revisions", "data", "examples",
192
+ "tools", "resources", "assets"
193
+ ]
194
+ }
195
+
196
+ # Directory groups by purpose - centralized from directory_profiles.py
197
+ DEFAULT_DIRECTORY_GROUPS = {
198
+ "development": ["src", "tests", "scripts", "tools"],
199
+ "documentation": ["docs", "examples", "resources"],
200
+ "operations": ["config", "logs", "data"],
201
+ "privacy": ["private", "convos", "credentials"],
202
+ }
203
+
204
+ # Directory type mapping (conceptual → actual name) - from directory_profiles.py
205
+ DEFAULT_DIRECTORY_TYPE_MAPPING = {
206
+ "src": "src", # Will be customized for each project (e.g., "repokit")
207
+ "tests": "tests",
208
+ "docs": "docs",
209
+ "config": "config",
210
+ "scripts": "scripts",
211
+ "private": "private",
212
+ "convos": "convos",
213
+ "logs": "logs",
214
+ }
215
+
216
+ # Enhanced private directory sets - from directory_profiles.py
217
+ DEFAULT_PRIVATE_DIR_SETS = {
218
+ "standard": DEFAULT_PRIVATE_DIRS.copy(),
219
+ "enhanced": DEFAULT_PRIVATE_DIRS + ["credentials", "secrets", "local"],
220
+ }