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
@@ -0,0 +1,29 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "name": "__RK_PROJECT__ --version (Windows, Debug)",
6
+ "type": "cppvsdbg",
7
+ "request": "launch",
8
+ "program": "${workspaceFolder}/build/Debug/__RK_PROJECT__.exe",
9
+ "args": ["--version"],
10
+ "cwd": "${workspaceFolder}",
11
+ "stopAtEntry": false,
12
+ "environment": [],
13
+ "console": "integratedTerminal",
14
+ "preLaunchTask": "Build Debug"
15
+ },
16
+ {
17
+ "name": "__RK_PROJECT__ --version (gdb, single-config build)",
18
+ "type": "cppdbg",
19
+ "request": "launch",
20
+ "program": "${workspaceFolder}/build/__RK_PROJECT__",
21
+ "args": ["--version"],
22
+ "cwd": "${workspaceFolder}",
23
+ "stopAtEntry": false,
24
+ "environment": [],
25
+ "MIMode": "gdb",
26
+ "preLaunchTask": "Build Debug"
27
+ }
28
+ ]
29
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "label": "Configure",
6
+ "detail": "cmake --preset windows-release (once, and after CMakeLists.txt changes); the Visual Studio generator builds Debug and Release from one configure",
7
+ "type": "shell",
8
+ "command": "cmake --preset windows-release",
9
+ "problemMatcher": []
10
+ },
11
+ {
12
+ "label": "Build Debug",
13
+ "type": "shell",
14
+ "command": "cmake --build build --config Debug",
15
+ "group": { "kind": "build", "isDefault": true },
16
+ "problemMatcher": ["$msCompile", "$gcc"]
17
+ },
18
+ {
19
+ "label": "Test",
20
+ "type": "shell",
21
+ "command": "ctest --test-dir build -C Debug --output-on-failure",
22
+ "group": "test",
23
+ "problemMatcher": []
24
+ }
25
+ ]
26
+ }
@@ -0,0 +1,47 @@
1
+ cmake_minimum_required(VERSION 3.20)
2
+
3
+ # The version lives in one place: include/__RK_SNAKE__/version.h (edited by
4
+ # repokit-common's sync-versions.py). CMake reads it here; it is never typed twice.
5
+ file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/include/__RK_SNAKE__/version.h" _rk_ver
6
+ REGEX "^#define __RK_MACRO___VERSION_(MAJOR|MINOR|PATCH) ")
7
+ foreach(_line IN LISTS _rk_ver)
8
+ string(REGEX MATCH "_(MAJOR|MINOR|PATCH) +([0-9]+)" _m "${_line}")
9
+ set(_rk_${CMAKE_MATCH_1} ${CMAKE_MATCH_2})
10
+ endforeach()
11
+
12
+ project(__RK_PROJECT__
13
+ VERSION ${_rk_MAJOR}.${_rk_MINOR}.${_rk_PATCH}
14
+ DESCRIPTION "__RK_DESCRIPTION__"
15
+ LANGUAGES CXX RC)
16
+ message(STATUS "__RK_PROJECT__ version ${PROJECT_VERSION}")
17
+
18
+ set(CMAKE_CXX_STANDARD 17)
19
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
20
+ if(MSVC)
21
+ add_compile_options(/utf-8 /W4)
22
+ endif()
23
+
24
+ # Build stamp, generated at build time so commits never dirty the tree:
25
+ # <version>_<branch>_<build count>-<date>-<short hash>.
26
+ add_custom_target(__RK_SNAKE___stamp ALL
27
+ COMMAND ${CMAKE_COMMAND}
28
+ -DSRC_DIR=${CMAKE_CURRENT_SOURCE_DIR}
29
+ -DOUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/generated/__RK_SNAKE___stamp.h
30
+ -DBASE_VERSION=${PROJECT_VERSION}
31
+ -DMACRO=__RK_MACRO__
32
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/GenerateStamp.cmake
33
+ BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/generated/__RK_SNAKE___stamp.h
34
+ COMMENT "Version stamp")
35
+
36
+ add_executable(__RK_PROJECT__ src/main.cpp)
37
+ if(WIN32)
38
+ target_sources(__RK_PROJECT__ PRIVATE src/app.rc)
39
+ endif()
40
+ target_include_directories(__RK_PROJECT__ PRIVATE
41
+ include ${CMAKE_CURRENT_BINARY_DIR}/generated)
42
+ add_dependencies(__RK_PROJECT__ __RK_SNAKE___stamp)
43
+
44
+ enable_testing()
45
+ add_executable(test_version tests/test_version.cpp)
46
+ target_include_directories(test_version PRIVATE include)
47
+ add_test(NAME version COMMAND test_version)
@@ -0,0 +1,23 @@
1
+ {
2
+ "version": 6,
3
+ "configurePresets": [
4
+ {
5
+ "name": "windows-release",
6
+ "generator": "Visual Studio 17 2022",
7
+ "architecture": "x64",
8
+ "binaryDir": "${sourceDir}/build",
9
+ "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
10
+ }
11
+ ],
12
+ "buildPresets": [
13
+ { "name": "windows-release", "configurePreset": "windows-release", "configuration": "Release" }
14
+ ],
15
+ "testPresets": [
16
+ {
17
+ "name": "windows-release",
18
+ "configurePreset": "windows-release",
19
+ "configuration": "Release",
20
+ "output": { "outputOnFailure": true }
21
+ }
22
+ ]
23
+ }
@@ -0,0 +1,45 @@
1
+ # Writes OUT_FILE with <MACRO>_VERSION_FULL in the house format:
2
+ # <base>_<branch>_<build count>-<YYYYMMDD>-<short hash>
3
+ # Outside a git checkout (a source archive) the git fields read "unknown".
4
+ # The file is rewritten only when its content changes, so builds stay incremental.
5
+ function(_rk_git out)
6
+ execute_process(COMMAND git ${ARGN} WORKING_DIRECTORY "${SRC_DIR}"
7
+ OUTPUT_VARIABLE _o ERROR_QUIET RESULT_VARIABLE _rc OUTPUT_STRIP_TRAILING_WHITESPACE)
8
+ if(_rc EQUAL 0 AND NOT _o STREQUAL "")
9
+ set(${out} "${_o}" PARENT_SCOPE)
10
+ else()
11
+ set(${out} "unknown" PARENT_SCOPE)
12
+ endif()
13
+ endfunction()
14
+
15
+ # Only this project's own repository counts. A source tree unpacked inside
16
+ # another checkout (an archive under a home-directory repo, a vendored copy)
17
+ # must not take that outer repository's branch, count and hash.
18
+ _rk_git(_top rev-parse --show-toplevel)
19
+ get_filename_component(_src_real "${SRC_DIR}" REALPATH)
20
+ if(NOT _top STREQUAL "unknown")
21
+ get_filename_component(_top "${_top}" REALPATH)
22
+ endif()
23
+ string(TOLOWER "${_src_real}" _src_l)
24
+ string(TOLOWER "${_top}" _top_l)
25
+ if(_top_l STREQUAL _src_l)
26
+ _rk_git(_branch rev-parse --abbrev-ref HEAD)
27
+ _rk_git(_count rev-list --count HEAD)
28
+ _rk_git(_hash rev-parse --short HEAD)
29
+ _rk_git(_date log -1 --format=%cd --date=format:%Y%m%d)
30
+ else()
31
+ foreach(_v _branch _count _hash _date)
32
+ set(${_v} "unknown")
33
+ endforeach()
34
+ endif()
35
+
36
+ set(_full "${BASE_VERSION}_${_branch}_${_count}-${_date}-${_hash}")
37
+ set(_text "#pragma once\n#define ${MACRO}_VERSION_FULL \"${_full}\"\n")
38
+ if(EXISTS "${OUT_FILE}")
39
+ file(READ "${OUT_FILE}" _old)
40
+ else()
41
+ set(_old "")
42
+ endif()
43
+ if(NOT _old STREQUAL _text)
44
+ file(WRITE "${OUT_FILE}" "${_text}")
45
+ endif()
@@ -0,0 +1,27 @@
1
+ // __RK_PROJECT__ -- __RK_DESCRIPTION__
2
+ #include <cctype>
3
+ #include <cstdio>
4
+ #include <cstring>
5
+
6
+ #include "__RK_SNAKE__/version.h"
7
+ #include "__RK_SNAKE___stamp.h"
8
+
9
+ // Like Python's get_display_version(): "ALPHA 0.1.0" while the project-wide
10
+ // phase is set, "0.1.0" once it is empty or "stable".
11
+ static void print_project_phase() {
12
+ const char* phase = __RK_MACRO___PROJECT_PHASE;
13
+ if (phase[0] == '\0' || std::strcmp(phase, "stable") == 0) return;
14
+ for (; *phase; ++phase) std::putchar(std::toupper(static_cast<unsigned char>(*phase)));
15
+ std::putchar(' ');
16
+ }
17
+
18
+ int main(int argc, char** argv) {
19
+ if (argc > 1 && std::strcmp(argv[1], "--version") == 0) {
20
+ std::printf("__RK_PROJECT__ ");
21
+ print_project_phase();
22
+ std::printf("%s (%s)\n", __RK_MACRO___VERSION_STRING, __RK_MACRO___VERSION_FULL);
23
+ return 0;
24
+ }
25
+ std::printf("__RK_PROJECT__: try --version\n");
26
+ return 0;
27
+ }
@@ -0,0 +1,20 @@
1
+ // The version string agrees with its components. A plain assert executable,
2
+ // registered with CTest (the xormove pattern: no test framework needed).
3
+ #include <cassert>
4
+ #include <cstdio>
5
+ #include <string>
6
+
7
+ #include "__RK_SNAKE__/version.h"
8
+
9
+ int main() {
10
+ std::string expected = std::to_string(__RK_MACRO___VERSION_MAJOR) + "." +
11
+ std::to_string(__RK_MACRO___VERSION_MINOR) + "." +
12
+ std::to_string(__RK_MACRO___VERSION_PATCH);
13
+ std::string phase = __RK_MACRO___VERSION_PHASE;
14
+ if (!phase.empty()) expected += "-" + phase;
15
+ if (expected != __RK_MACRO___VERSION_STRING) {
16
+ std::printf("version string %s != components %s\n", __RK_MACRO___VERSION_STRING, expected.c_str());
17
+ return 1;
18
+ }
19
+ return 0;
20
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "__RK_PROJECT__",
3
+ "version-string": "0.1.0",
4
+ "dependencies": []
5
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "name": "__RK_PROJECT__ --version (Windows; build.bat first, from a Developer Command Prompt)",
6
+ "type": "cppvsdbg",
7
+ "request": "launch",
8
+ "program": "${workspaceFolder}/build/__RK_PROJECT__.exe",
9
+ "args": ["--version"],
10
+ "cwd": "${workspaceFolder}",
11
+ "stopAtEntry": false,
12
+ "environment": [],
13
+ "console": "integratedTerminal"
14
+ },
15
+ {
16
+ "name": "__RK_PROJECT__ --version (gdb; make first)",
17
+ "type": "cppdbg",
18
+ "request": "launch",
19
+ "program": "${workspaceFolder}/build/__RK_PROJECT__",
20
+ "args": ["--version"],
21
+ "cwd": "${workspaceFolder}",
22
+ "stopAtEntry": false,
23
+ "environment": [],
24
+ "MIMode": "gdb"
25
+ }
26
+ ]
27
+ }
@@ -0,0 +1,10 @@
1
+ CC ?= cc
2
+ CFLAGS ?= -O2 -Wall -Iinclude
3
+
4
+ build/__RK_PROJECT__: src/__RK_SNAKE__.c include/__RK_SNAKE__/version.h
5
+ mkdir -p build
6
+ $(CC) $(CFLAGS) -o $@ src/__RK_SNAKE__.c
7
+
8
+ .PHONY: clean
9
+ clean:
10
+ rm -rf build
@@ -0,0 +1,7 @@
1
+ @echo off
2
+ rem Build __RK_PROJECT__ with MSVC (run from a Developer Command Prompt).
3
+ setlocal
4
+ cd /d "%~dp0"
5
+ if not exist build mkdir build
6
+ rc /nologo /I include /fo build\app.res src\app.rc || exit /b 1
7
+ cl /nologo /O2 /utf-8 /W4 /I include /Fo:build\ /Fe:build\__RK_PROJECT__.exe src\__RK_SNAKE__.c build\app.res || exit /b 1
@@ -0,0 +1,26 @@
1
+ /* __RK_PROJECT__ -- __RK_DESCRIPTION__ */
2
+ #include <ctype.h>
3
+ #include <stdio.h>
4
+ #include <string.h>
5
+
6
+ #include "__RK_SNAKE__/version.h"
7
+
8
+ /* Like Python's get_display_version(): "ALPHA 0.1.0" while the project-wide
9
+ * phase is set, "0.1.0" once it is empty or "stable". */
10
+ static void print_project_phase(void) {
11
+ const char *phase = __RK_MACRO___PROJECT_PHASE;
12
+ if (phase[0] == '\0' || strcmp(phase, "stable") == 0) return;
13
+ for (; *phase; ++phase) putchar(toupper((unsigned char)*phase));
14
+ putchar(' ');
15
+ }
16
+
17
+ int main(int argc, char **argv) {
18
+ if (argc > 1 && strcmp(argv[1], "--version") == 0) {
19
+ printf("__RK_PROJECT__ ");
20
+ print_project_phase();
21
+ printf("%s\n", __RK_MACRO___VERSION_STRING);
22
+ return 0;
23
+ }
24
+ printf("__RK_PROJECT__: try --version\n");
25
+ return 0;
26
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "name": "__RK_PROJECT__ --version (Debug x64)",
6
+ "type": "cppvsdbg",
7
+ "request": "launch",
8
+ "program": "${workspaceFolder}/x64/Debug/__RK_PROJECT__.exe",
9
+ "args": ["--version"],
10
+ "cwd": "${workspaceFolder}",
11
+ "stopAtEntry": false,
12
+ "environment": [],
13
+ "console": "integratedTerminal",
14
+ "preLaunchTask": "Build Debug"
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "label": "Build Debug",
6
+ "detail": "run VS Code from a Developer Command Prompt (or with msbuild on PATH)",
7
+ "type": "shell",
8
+ "command": "msbuild __RK_PROJECT__.sln -p:Configuration=Debug -p:Platform=x64",
9
+ "group": { "kind": "build", "isDefault": true },
10
+ "problemMatcher": ["$msCompile"]
11
+ },
12
+ {
13
+ "label": "Build Release",
14
+ "type": "shell",
15
+ "command": "msbuild __RK_PROJECT__.sln -p:Configuration=Release -p:Platform=x64",
16
+ "group": "build",
17
+ "problemMatcher": ["$msCompile"]
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,19 @@
1
+
2
+ Microsoft Visual Studio Solution File, Format Version 12.00
3
+ # Visual Studio Version 17
4
+ VisualStudioVersion = 17.0.31903.59
5
+ MinimumVisualStudioVersion = 10.0.40219.1
6
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "__RK_PROJECT__", "__RK_PROJECT__.vcxproj", "{__RK_GUID_PROJECT__}"
7
+ EndProject
8
+ Global
9
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
10
+ Release|x64 = Release|x64
11
+ EndGlobalSection
12
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
13
+ {__RK_GUID_PROJECT__}.Release|x64.ActiveCfg = Release|x64
14
+ {__RK_GUID_PROJECT__}.Release|x64.Build.0 = Release|x64
15
+ EndGlobalSection
16
+ GlobalSection(ExtensibilityGlobals) = postSolution
17
+ SolutionGuid = {__RK_GUID_SOLUTION__}
18
+ EndGlobalSection
19
+ EndGlobal
@@ -0,0 +1,41 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <ItemGroup Label="ProjectConfigurations">
4
+ <ProjectConfiguration Include="Release|x64">
5
+ <Configuration>Release</Configuration>
6
+ <Platform>x64</Platform>
7
+ </ProjectConfiguration>
8
+ </ItemGroup>
9
+ <PropertyGroup Label="Globals">
10
+ <VCProjectVersion>17.0</VCProjectVersion>
11
+ <ProjectGuid>{__RK_GUID_PROJECT__}</ProjectGuid>
12
+ <RootNamespace>__RK_PASCAL__</RootNamespace>
13
+ </PropertyGroup>
14
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
15
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
16
+ <ConfigurationType>Application</ConfigurationType>
17
+ <PlatformToolset>v143</PlatformToolset>
18
+ <CharacterSet>Unicode</CharacterSet>
19
+ </PropertyGroup>
20
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
21
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
22
+ <ClCompile>
23
+ <LanguageStandard>stdcpp17</LanguageStandard>
24
+ <AdditionalIncludeDirectories>$(ProjectDir)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
25
+ <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
26
+ </ClCompile>
27
+ <ResourceCompile>
28
+ <AdditionalIncludeDirectories>$(ProjectDir)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
29
+ </ResourceCompile>
30
+ </ItemDefinitionGroup>
31
+ <ItemGroup>
32
+ <ClCompile Include="src\main.cpp" />
33
+ </ItemGroup>
34
+ <ItemGroup>
35
+ <ClInclude Include="include\__RK_SNAKE__\version.h" />
36
+ </ItemGroup>
37
+ <ItemGroup>
38
+ <ResourceCompile Include="src\app.rc" />
39
+ </ItemGroup>
40
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
41
+ </Project>
@@ -0,0 +1,26 @@
1
+ // __RK_PROJECT__ -- __RK_DESCRIPTION__
2
+ #include <cctype>
3
+ #include <cstdio>
4
+ #include <cstring>
5
+
6
+ #include "__RK_SNAKE__/version.h"
7
+
8
+ // Like Python's get_display_version(): "ALPHA 0.1.0" while the project-wide
9
+ // phase is set, "0.1.0" once it is empty or "stable".
10
+ static void print_project_phase() {
11
+ const char* phase = __RK_MACRO___PROJECT_PHASE;
12
+ if (phase[0] == '\0' || std::strcmp(phase, "stable") == 0) return;
13
+ for (; *phase; ++phase) std::putchar(std::toupper(static_cast<unsigned char>(*phase)));
14
+ std::putchar(' ');
15
+ }
16
+
17
+ int main(int argc, char** argv) {
18
+ if (argc > 1 && std::strcmp(argv[1], "--version") == 0) {
19
+ std::printf("__RK_PROJECT__ ");
20
+ print_project_phase();
21
+ std::printf("%s\n", __RK_MACRO___VERSION_STRING);
22
+ return 0;
23
+ }
24
+ std::printf("__RK_PROJECT__: try --version\n");
25
+ return 0;
26
+ }
@@ -0,0 +1,28 @@
1
+ # git-repokit-common settings for __RK_PROJECT__, a Claude Code plugin.
2
+ #
3
+ # The plugin lives in plugin/ with its own README for the marketplace; this
4
+ # root holds the repository's tooling. The version lives in VERSION; the
5
+ # vendored tool at scripts/repokit-common/ keeps package.json and the plugin
6
+ # manifest in step. "human" tags (v0.1.0) match the version Claude Code reads
7
+ # from plugin/.claude-plugin/plugin.json.
8
+
9
+ [tool.repokit-common]
10
+ version-source = "VERSION"
11
+ changelog = "CHANGELOG.md"
12
+ repo-url = "https://github.com/__RK_ORG__/__RK_PROJECT__"
13
+ tag-prefix = "v"
14
+ tag-format = "human"
15
+ private-patterns = ["private/", "local/", ".env"]
16
+ # What a push runs: npm test, once the dependencies are installed (see the
17
+ # js-ts language layer's settings for why the guard is there).
18
+ test-command = "if [ -d node_modules ] || ! grep -q devDependencies package.json; then npm test; else echo dependencies not installed: run npm install and the push will run npm test; fi"
19
+
20
+ [[tool.repokit-common.extra-targets]]
21
+ path = "package.json"
22
+ type = "json"
23
+ field = "version"
24
+
25
+ [[tool.repokit-common.extra-targets]]
26
+ path = "plugin/.claude-plugin/plugin.json"
27
+ type = "json"
28
+ field = "version"
@@ -0,0 +1,34 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "name": "Hook: session-start.mjs (type the event JSON, then Ctrl+Z Enter / Ctrl+D)",
6
+ "type": "node",
7
+ "request": "launch",
8
+ "program": "${workspaceFolder}/plugin/hooks/scripts/session-start.mjs",
9
+ "cwd": "${workspaceFolder}",
10
+ "env": { "__RK_MACRO___DEBUG": "1" },
11
+ "console": "integratedTerminal",
12
+ "skipFiles": ["<node_internals>/**"]
13
+ },
14
+ {
15
+ "name": "npm test",
16
+ "type": "node",
17
+ "request": "launch",
18
+ "runtimeExecutable": "npm",
19
+ "runtimeArgs": ["test"],
20
+ "cwd": "${workspaceFolder}",
21
+ "console": "integratedTerminal",
22
+ "skipFiles": ["<node_internals>/**"]
23
+ },
24
+ {
25
+ "name": "node: current file",
26
+ "type": "node",
27
+ "request": "launch",
28
+ "program": "${file}",
29
+ "cwd": "${workspaceFolder}",
30
+ "console": "integratedTerminal",
31
+ "skipFiles": ["<node_internals>/**"]
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "hooks": [
6
+ {
7
+ "type": "command",
8
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/session-start.mjs\"",
9
+ "timeout": 10
10
+ }
11
+ ]
12
+ }
13
+ ]
14
+ }
15
+ }
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ // SessionStart hook for __RK_PROJECT__.
3
+ //
4
+ // Claude Code runs this when a session starts and passes the event as JSON on
5
+ // stdin. Anything printed to stdout as JSON with "additionalContext" reaches
6
+ // the session; an empty object is a no-op. Replace the body with the plugin's
7
+ // work; keep it quick (the hooks.json timeout is 10 seconds).
8
+
9
+ import { readFileSync } from "node:fs";
10
+
11
+ let event = {};
12
+ try {
13
+ const raw = readFileSync(0, "utf8");
14
+ event = raw.trim() ? JSON.parse(raw) : {};
15
+ } catch {
16
+ event = {};
17
+ }
18
+
19
+ const output = {};
20
+ if (process.env.__RK_MACRO___DEBUG) {
21
+ output.additionalContext = `__RK_PROJECT__ saw a ${event.hook_event_name ?? "SessionStart"} event (source: ${event.source ?? "unknown"}).`;
22
+ }
23
+ process.stdout.write(JSON.stringify(output));
@@ -0,0 +1,30 @@
1
+ // The plugin's manifests parse, agree with VERSION, and the hook script answers.
2
+ import { test } from "node:test";
3
+ import assert from "node:assert/strict";
4
+ import { readFileSync } from "node:fs";
5
+ import { spawnSync } from "node:child_process";
6
+ import { dirname, join } from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
+
9
+ const PLUGIN = join(dirname(fileURLToPath(import.meta.url)), "..");
10
+ const ROOT = join(PLUGIN, "..");
11
+
12
+ test("plugin.json names the plugin and carries VERSION", () => {
13
+ const manifest = JSON.parse(readFileSync(join(PLUGIN, ".claude-plugin", "plugin.json"), "utf8"));
14
+ assert.equal(manifest.name, "__RK_PROJECT__");
15
+ assert.equal(manifest.version, readFileSync(join(ROOT, "VERSION"), "utf8").trim());
16
+ });
17
+
18
+ test("marketplace.json lists this plugin from ./plugin", () => {
19
+ const marketplace = JSON.parse(readFileSync(join(ROOT, ".claude-plugin", "marketplace.json"), "utf8"));
20
+ assert.ok(marketplace.plugins.some((p) => p.source === "./plugin" && p.name === "__RK_PROJECT__"));
21
+ });
22
+
23
+ test("hooks.json parses and the SessionStart script returns JSON", () => {
24
+ const hooks = JSON.parse(readFileSync(join(PLUGIN, "hooks", "hooks.json"), "utf8"));
25
+ assert.ok(hooks.hooks.SessionStart);
26
+ const r = spawnSync(process.execPath, [join(PLUGIN, "hooks", "scripts", "session-start.mjs")],
27
+ { input: JSON.stringify({ hook_event_name: "SessionStart", source: "startup" }), encoding: "utf8" });
28
+ assert.equal(r.status, 0, r.stderr);
29
+ assert.doesNotThrow(() => JSON.parse(r.stdout));
30
+ });
@@ -0,0 +1,6 @@
1
+
2
+ # package.json carries the same version; the version tool keeps it in step.
3
+ [[tool.repokit-common.extra-targets]]
4
+ path = "package.json"
5
+ type = "json"
6
+ field = "version"
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "__RK_PROJECT__",
3
+ "version": "0.1.0",
4
+ "description": "__RK_DESCRIPTION__",
5
+ "private": true,
6
+ "type": "module",
7
+ "engines": {
8
+ "node": ">=20"
9
+ },
10
+ "scripts": {
11
+ "test": "node --test"
12
+ }
13
+ }
@@ -0,0 +1,39 @@
1
+ name: Publish to npm
2
+
3
+ # Triggered when a GitHub Release is PUBLISHED -- not on tag push -- so that
4
+ # "publish a release" is the single deliberate ship action. The release event
5
+ # checks out the release's tag, so the right version is built. Needs an
6
+ # NPM_TOKEN secret (an automation token) on the repository.
7
+
8
+ on:
9
+ release:
10
+ types: [published]
11
+
12
+ permissions:
13
+ id-token: write
14
+ contents: read
15
+
16
+ jobs:
17
+ publish:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v7
21
+
22
+ - name: Set up Node
23
+ uses: actions/setup-node@v7
24
+ with:
25
+ node-version: '22'
26
+ registry-url: 'https://registry.npmjs.org'
27
+
28
+ - name: Install
29
+ shell: bash
30
+ run: |
31
+ if [ -f package-lock.json ]; then npm ci; else npm install; fi
32
+
33
+ - name: Test
34
+ run: npm test
35
+
36
+ - name: Publish
37
+ run: npm publish --provenance --access public
38
+ env:
39
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}