@vyuhlabs/dxkit 2.4.8 → 2.5.0

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 (243) hide show
  1. package/CHANGELOG.md +235 -0
  2. package/README.md +360 -439
  3. package/dist/analyzers/security/aggregator.d.ts.map +1 -1
  4. package/dist/analyzers/security/aggregator.js +4 -46
  5. package/dist/analyzers/security/aggregator.js.map +1 -1
  6. package/dist/analyzers/tools/fingerprint.d.ts +91 -26
  7. package/dist/analyzers/tools/fingerprint.d.ts.map +1 -1
  8. package/dist/analyzers/tools/fingerprint.js +111 -22
  9. package/dist/analyzers/tools/fingerprint.js.map +1 -1
  10. package/dist/analyzers/tools/generic.d.ts.map +1 -1
  11. package/dist/analyzers/tools/generic.js +6 -1
  12. package/dist/analyzers/tools/generic.js.map +1 -1
  13. package/dist/analyzers/tools/gitleaks.d.ts +24 -1
  14. package/dist/analyzers/tools/gitleaks.d.ts.map +1 -1
  15. package/dist/analyzers/tools/gitleaks.js +20 -11
  16. package/dist/analyzers/tools/gitleaks.js.map +1 -1
  17. package/dist/analyzers/types.d.ts +6 -4
  18. package/dist/analyzers/types.d.ts.map +1 -1
  19. package/dist/baseline/baseline-file.d.ts +104 -0
  20. package/dist/baseline/baseline-file.d.ts.map +1 -0
  21. package/dist/baseline/baseline-file.js +110 -0
  22. package/dist/baseline/baseline-file.js.map +1 -0
  23. package/dist/baseline/check-renderers.d.ts +108 -0
  24. package/dist/baseline/check-renderers.d.ts.map +1 -0
  25. package/dist/baseline/check-renderers.js +379 -0
  26. package/dist/baseline/check-renderers.js.map +1 -0
  27. package/dist/baseline/check.d.ts +127 -0
  28. package/dist/baseline/check.d.ts.map +1 -0
  29. package/dist/baseline/check.js +462 -0
  30. package/dist/baseline/check.js.map +1 -0
  31. package/dist/baseline/content-hash.d.ts +83 -0
  32. package/dist/baseline/content-hash.d.ts.map +1 -0
  33. package/dist/baseline/content-hash.js +131 -0
  34. package/dist/baseline/content-hash.js.map +1 -0
  35. package/dist/baseline/create.d.ts +96 -0
  36. package/dist/baseline/create.d.ts.map +1 -0
  37. package/dist/baseline/create.js +339 -0
  38. package/dist/baseline/create.js.map +1 -0
  39. package/dist/baseline/entry-to-located.d.ts +35 -0
  40. package/dist/baseline/entry-to-located.d.ts.map +1 -0
  41. package/dist/baseline/entry-to-located.js +72 -0
  42. package/dist/baseline/entry-to-located.js.map +1 -0
  43. package/dist/baseline/finding-identity.d.ts +47 -0
  44. package/dist/baseline/finding-identity.d.ts.map +1 -0
  45. package/dist/baseline/finding-identity.js +292 -0
  46. package/dist/baseline/finding-identity.js.map +1 -0
  47. package/dist/baseline/git-aware-match.d.ts +146 -0
  48. package/dist/baseline/git-aware-match.d.ts.map +1 -0
  49. package/dist/baseline/git-aware-match.js +439 -0
  50. package/dist/baseline/git-aware-match.js.map +1 -0
  51. package/dist/baseline/policy.d.ts +171 -0
  52. package/dist/baseline/policy.d.ts.map +1 -0
  53. package/dist/baseline/policy.js +206 -0
  54. package/dist/baseline/policy.js.map +1 -0
  55. package/dist/baseline/producers/health.d.ts +30 -0
  56. package/dist/baseline/producers/health.d.ts.map +1 -0
  57. package/dist/baseline/producers/health.js +42 -0
  58. package/dist/baseline/producers/health.js.map +1 -0
  59. package/dist/baseline/producers/index.d.ts +164 -0
  60. package/dist/baseline/producers/index.d.ts.map +1 -0
  61. package/dist/baseline/producers/index.js +200 -0
  62. package/dist/baseline/producers/index.js.map +1 -0
  63. package/dist/baseline/producers/licenses.d.ts +23 -0
  64. package/dist/baseline/producers/licenses.d.ts.map +1 -0
  65. package/dist/baseline/producers/licenses.js +46 -0
  66. package/dist/baseline/producers/licenses.js.map +1 -0
  67. package/dist/baseline/producers/quality.d.ts +39 -0
  68. package/dist/baseline/producers/quality.d.ts.map +1 -0
  69. package/dist/baseline/producers/quality.js +84 -0
  70. package/dist/baseline/producers/quality.js.map +1 -0
  71. package/dist/baseline/producers/secret-hmac.d.ts +45 -0
  72. package/dist/baseline/producers/secret-hmac.d.ts.map +1 -0
  73. package/dist/baseline/producers/secret-hmac.js +70 -0
  74. package/dist/baseline/producers/secret-hmac.js.map +1 -0
  75. package/dist/baseline/producers/security.d.ts +59 -0
  76. package/dist/baseline/producers/security.d.ts.map +1 -0
  77. package/dist/baseline/producers/security.js +135 -0
  78. package/dist/baseline/producers/security.js.map +1 -0
  79. package/dist/baseline/producers/tests.d.ts +36 -0
  80. package/dist/baseline/producers/tests.d.ts.map +1 -0
  81. package/dist/baseline/producers/tests.js +69 -0
  82. package/dist/baseline/producers/tests.js.map +1 -0
  83. package/dist/baseline/salt.d.ts +45 -0
  84. package/dist/baseline/salt.d.ts.map +1 -0
  85. package/dist/baseline/salt.js +113 -0
  86. package/dist/baseline/salt.js.map +1 -0
  87. package/dist/baseline/show.d.ts +79 -0
  88. package/dist/baseline/show.d.ts.map +1 -0
  89. package/dist/baseline/show.js +233 -0
  90. package/dist/baseline/show.js.map +1 -0
  91. package/dist/baseline/types.d.ts +482 -0
  92. package/dist/baseline/types.d.ts.map +1 -0
  93. package/dist/baseline/types.js +53 -0
  94. package/dist/baseline/types.js.map +1 -0
  95. package/dist/cli.d.ts.map +1 -1
  96. package/dist/cli.js +360 -81
  97. package/dist/cli.js.map +1 -1
  98. package/dist/codebase-scanner.d.ts.map +1 -1
  99. package/dist/codebase-scanner.js +0 -1
  100. package/dist/codebase-scanner.js.map +1 -1
  101. package/dist/constants.d.ts.map +1 -1
  102. package/dist/constants.js +0 -4
  103. package/dist/constants.js.map +1 -1
  104. package/dist/doctor.d.ts.map +1 -1
  105. package/dist/doctor.js +22 -25
  106. package/dist/doctor.js.map +1 -1
  107. package/dist/fail-on.d.ts +84 -0
  108. package/dist/fail-on.d.ts.map +1 -0
  109. package/dist/fail-on.js +128 -0
  110. package/dist/fail-on.js.map +1 -0
  111. package/dist/generator.d.ts.map +1 -1
  112. package/dist/generator.js +2 -141
  113. package/dist/generator.js.map +1 -1
  114. package/dist/languages/csharp.d.ts.map +1 -1
  115. package/dist/languages/csharp.js +0 -9
  116. package/dist/languages/csharp.js.map +1 -1
  117. package/dist/languages/go.d.ts.map +1 -1
  118. package/dist/languages/go.js +0 -15
  119. package/dist/languages/go.js.map +1 -1
  120. package/dist/languages/index.d.ts +1 -1
  121. package/dist/languages/index.d.ts.map +1 -1
  122. package/dist/languages/index.js.map +1 -1
  123. package/dist/languages/java.d.ts.map +1 -1
  124. package/dist/languages/java.js +0 -6
  125. package/dist/languages/java.js.map +1 -1
  126. package/dist/languages/kotlin.d.ts.map +1 -1
  127. package/dist/languages/kotlin.js +0 -11
  128. package/dist/languages/kotlin.js.map +1 -1
  129. package/dist/languages/python.d.ts.map +1 -1
  130. package/dist/languages/python.js +0 -15
  131. package/dist/languages/python.js.map +1 -1
  132. package/dist/languages/ruby.d.ts.map +1 -1
  133. package/dist/languages/ruby.js +0 -6
  134. package/dist/languages/ruby.js.map +1 -1
  135. package/dist/languages/rust.d.ts.map +1 -1
  136. package/dist/languages/rust.js +0 -4
  137. package/dist/languages/rust.js.map +1 -1
  138. package/dist/languages/types.d.ts +2 -28
  139. package/dist/languages/types.d.ts.map +1 -1
  140. package/dist/languages/typescript.d.ts.map +1 -1
  141. package/dist/languages/typescript.js +26 -4
  142. package/dist/languages/typescript.js.map +1 -1
  143. package/dist/lib.d.ts +2 -3
  144. package/dist/lib.d.ts.map +1 -1
  145. package/dist/lib.js +3 -6
  146. package/dist/lib.js.map +1 -1
  147. package/dist/prompts.d.ts.map +1 -1
  148. package/dist/prompts.js +0 -10
  149. package/dist/prompts.js.map +1 -1
  150. package/dist/report-schema.d.ts +42 -0
  151. package/dist/report-schema.d.ts.map +1 -0
  152. package/dist/report-schema.js +54 -0
  153. package/dist/report-schema.js.map +1 -0
  154. package/dist/ship-installers.d.ts +106 -0
  155. package/dist/ship-installers.d.ts.map +1 -0
  156. package/dist/ship-installers.js +415 -0
  157. package/dist/ship-installers.js.map +1 -0
  158. package/dist/types.d.ts +0 -4
  159. package/dist/types.d.ts.map +1 -1
  160. package/dist/update.d.ts.map +1 -1
  161. package/dist/update.js +0 -4
  162. package/dist/update.js.map +1 -1
  163. package/package.json +17 -11
  164. package/templates/.claude/agents/onboarding.md +5 -4
  165. package/templates/.claude/agents-available/codebase-explorer.md +1 -1
  166. package/templates/.claude/agents-available/debugger.md +2 -2
  167. package/templates/.claude/agents-available/health-auditor.md +2 -2
  168. package/templates/.claude/commands/doctor.md +20 -12
  169. package/templates/.claude/skills/build/SKILL.md.template +22 -30
  170. package/templates/.claude/skills/deploy/SKILL.md.template +5 -25
  171. package/templates/.claude/skills/doctor/SKILL.md +24 -47
  172. package/templates/.claude/skills/gcloud/SKILL.md +5 -5
  173. package/templates/.claude/skills/learned/SKILL.md +1 -1
  174. package/templates/.claude/skills/pulumi/SKILL.md +2 -2
  175. package/templates/.claude/skills/quality/SKILL.md.template +4 -23
  176. package/templates/.claude/skills/review/SKILL.md.template +4 -3
  177. package/templates/.claude/skills/scaffold/SKILL.md.template +5 -15
  178. package/templates/.claude/skills/secrets/SKILL.md +20 -21
  179. package/templates/.claude/skills/session/SKILL.md +20 -31
  180. package/templates/.claude/skills/test/SKILL.md.template +1 -7
  181. package/templates/.devcontainer/devcontainer.json +81 -0
  182. package/templates/.devcontainer/install-agent-clis.sh +42 -0
  183. package/templates/.devcontainer/post-create.sh +67 -0
  184. package/templates/.githooks/pre-commit +55 -0
  185. package/templates/.githooks/pre-push +63 -0
  186. package/templates/.github/workflows/dxkit-baseline-refresh.yml +78 -0
  187. package/templates/.github/workflows/dxkit-guardrails.yml +98 -0
  188. package/templates/CLAUDE.md.template +62 -196
  189. package/dist/project-yaml.d.ts +0 -13
  190. package/dist/project-yaml.d.ts.map +0 -1
  191. package/dist/project-yaml.js +0 -188
  192. package/dist/project-yaml.js.map +0 -1
  193. package/templates/.ai/README.md +0 -117
  194. package/templates/.ai/prompts/execution-prompt.md +0 -9
  195. package/templates/.ai/prompts/planning-prompt.md +0 -18
  196. package/templates/.ai/prompts/session-end-template.md +0 -182
  197. package/templates/.ai/prompts/session-end.md +0 -132
  198. package/templates/.ai/prompts/session-start.md +0 -109
  199. package/templates/.ai/prompts/step-by-step.md +0 -113
  200. package/templates/.ai/sessions/.gitkeep +0 -0
  201. package/templates/.claude/commands/setup-pr-review.md +0 -72
  202. package/templates/.devcontainer/Dockerfile.dev.template +0 -89
  203. package/templates/.devcontainer/devcontainer.json.template +0 -184
  204. package/templates/.devcontainer/docker-compose.yml.template +0 -105
  205. package/templates/.devcontainer/init-scripts/01-init.sql.template +0 -12
  206. package/templates/.devcontainer/post-create.sh.template +0 -298
  207. package/templates/.github/workflows/ci.yml.template +0 -399
  208. package/templates/.github/workflows/quality.yml.template +0 -376
  209. package/templates/.pre-commit-config.yaml.template +0 -106
  210. package/templates/.project/config/edit_config.py +0 -275
  211. package/templates/.project/config/project_config.py +0 -894
  212. package/templates/.project/scripts/codegen/generate-all.sh +0 -20
  213. package/templates/.project/scripts/codegen/validate-all.sh +0 -17
  214. package/templates/.project/scripts/docs/generate-all.sh +0 -30
  215. package/templates/.project/scripts/docs/serve.sh +0 -20
  216. package/templates/.project/scripts/quality/fix-all.sh +0 -138
  217. package/templates/.project/scripts/quality/lint-go.sh +0 -34
  218. package/templates/.project/scripts/quality/lint-python.sh +0 -54
  219. package/templates/.project/scripts/quality/run-all.sh +0 -497
  220. package/templates/.project/scripts/session/commit.sh +0 -70
  221. package/templates/.project/scripts/session/create-pr.sh +0 -165
  222. package/templates/.project/scripts/session/end.sh +0 -207
  223. package/templates/.project/scripts/session/start.sh +0 -233
  224. package/templates/.project/scripts/setup/doctor.sh +0 -404
  225. package/templates/.project/scripts/setup/interactive-setup.sh +0 -585
  226. package/templates/.project/scripts/sync/sync-template.sh +0 -328
  227. package/templates/.project/scripts/test/run-all.sh +0 -179
  228. package/templates/.project/scripts/test/run-quick.sh +0 -25
  229. package/templates/Makefile +0 -514
  230. package/templates/config/versions.yaml +0 -57
  231. package/templates/configs/go/.golangci.yml.template +0 -172
  232. package/templates/configs/go/go.mod.template +0 -15
  233. package/templates/configs/java/README.md +0 -6
  234. package/templates/configs/kotlin/README.md +0 -6
  235. package/templates/configs/node/package.json.template +0 -67
  236. package/templates/configs/node/tsconfig.json.template +0 -53
  237. package/templates/configs/python/pyproject.toml.template +0 -92
  238. package/templates/configs/python/pytest.ini.template +0 -64
  239. package/templates/configs/python/ruff.toml.template +0 -79
  240. package/templates/configs/ruby/README.md +0 -6
  241. package/templates/configs/rust/Cargo.toml.template +0 -51
  242. package/templates/configs/shared/.editorconfig +0 -67
  243. package/templates/scripts/validate-templates.sh +0 -449
@@ -1,165 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Create Pull Request with Auto-Populated Content
4
-
5
- set -e
6
-
7
- # Colors
8
- CYAN='\033[36m'
9
- GREEN='\033[32m'
10
- RED='\033[0;31m'
11
- YELLOW='\033[1;33m'
12
- RESET='\033[0m'
13
-
14
- echo ""
15
- echo -e "${CYAN}🚀 Create Pull Request${RESET}"
16
- echo "======================================"
17
- echo ""
18
-
19
- # Get current branch and base branch
20
- CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
21
- BASE_BRANCH=${1:-main}
22
-
23
- # Validate not on main/master
24
- if [[ "$CURRENT_BRANCH" == "main" ]] || [[ "$CURRENT_BRANCH" == "master" ]]; then
25
- echo -e "${RED}❌ Error: Cannot create PR from main/master branch${RESET}"
26
- echo "Create a feature branch first: git checkout -b feature/your-feature"
27
- exit 1
28
- fi
29
-
30
- echo -e "${CYAN}Branch Information:${RESET}"
31
- echo " Current branch: ${GREEN}$CURRENT_BRANCH${RESET}"
32
- echo " Base branch: ${GREEN}$BASE_BRANCH${RESET}"
33
- echo ""
34
-
35
- # Check if gh CLI is installed
36
- if ! command -v gh &> /dev/null; then
37
- echo -e "${RED}❌ Error: GitHub CLI (gh) not found${RESET}"
38
- echo "Install with: brew install gh"
39
- echo "Or visit: https://cli.github.com/"
40
- exit 1
41
- fi
42
-
43
- # Check if branch is pushed to remote
44
- if ! git ls-remote --exit-code --heads origin "$CURRENT_BRANCH" &>/dev/null; then
45
- echo -e "${YELLOW}⚠️ Branch not pushed to remote${RESET}"
46
- read -p "Push branch to remote? (y/n): " -n 1 -r
47
- echo ""
48
- if [[ $REPLY =~ ^[Yy]$ ]]; then
49
- echo -e "${CYAN}Pushing branch...${RESET}"
50
- git push -u origin "$CURRENT_BRANCH"
51
- echo -e "${GREEN}✓${RESET} Branch pushed"
52
- echo ""
53
- else
54
- echo -e "${RED}❌ Cannot create PR without pushing branch${RESET}"
55
- exit 1
56
- fi
57
- fi
58
-
59
- # Get commit information
60
- echo -e "${CYAN}Analyzing changes...${RESET}"
61
- echo ""
62
-
63
- # Get all commits in this branch (not in base branch)
64
- COMMITS=$(git log "$BASE_BRANCH".."$CURRENT_BRANCH" --oneline --no-decorate)
65
- COMMIT_COUNT=$(echo "$COMMITS" | wc -l | tr -d ' ')
66
- FIRST_COMMIT_MSG=$(git log "$BASE_BRANCH".."$CURRENT_BRANCH" --format=%s --reverse | head -1)
67
-
68
- # Get file changes summary
69
- FILES_CHANGED=$(git diff --name-only "$BASE_BRANCH"..."$CURRENT_BRANCH" | wc -l | tr -d ' ')
70
- GO_FILES=$(git diff --name-only "$BASE_BRANCH"..."$CURRENT_BRANCH" | grep "\.go$" | wc -l | tr -d ' ')
71
- PY_FILES=$(git diff --name-only "$BASE_BRANCH"..."$CURRENT_BRANCH" | grep "\.py$" | wc -l | tr -d ' ')
72
-
73
- # Get diff stats
74
- DIFF_STATS=$(git diff --stat "$BASE_BRANCH"..."$CURRENT_BRANCH")
75
- INSERTIONS=$(echo "$DIFF_STATS" | tail -1 | grep -oP '\d+(?= insertion)' || echo "0")
76
- DELETIONS=$(echo "$DIFF_STATS" | tail -1 | grep -oP '\d+(?= deletion)' || echo "0")
77
-
78
- echo " Commits: $COMMIT_COUNT"
79
- echo " Files changed: $FILES_CHANGED (Go: $GO_FILES, Python: $PY_FILES)"
80
- echo " Lines: +$INSERTIONS -$DELETIONS"
81
- echo ""
82
-
83
- # Generate PR title from first commit or branch name
84
- if [ -n "$FIRST_COMMIT_MSG" ]; then
85
- PR_TITLE="$FIRST_COMMIT_MSG"
86
- else
87
- PR_TITLE=$(echo "$CURRENT_BRANCH" | sed 's|feature/||' | sed 's|bugfix/||' | sed 's|fix/||' | sed 's/-/ /g' | sed 's/\b\(.\)/\u\1/g')
88
- fi
89
-
90
- echo -e "${CYAN}PR Title:${RESET} $PR_TITLE"
91
- echo ""
92
-
93
- # Generate description based on commits
94
- DESCRIPTION=$(git log "$BASE_BRANCH".."$CURRENT_BRANCH" --format="- %s" --reverse | head -10)
95
-
96
- # Build PR body
97
- PR_BODY="## Description
98
-
99
- $DESCRIPTION
100
-
101
- ## Type of Change
102
-
103
- - [ ] 🐛 Bug fix
104
- - [ ] ✨ New feature
105
- - [ ] 📚 Documentation update
106
- - [ ] ♻️ Refactoring
107
- - [ ] ⚡ Performance improvement
108
-
109
- ## Checklist
110
-
111
- - [ ] Code follows project style guidelines
112
- - [ ] \`make quality\` passes
113
- - [ ] \`make test\` passes
114
- - [ ] Documentation updated (if needed)
115
-
116
- ## Testing Instructions
117
-
118
- 1. Checkout this branch: \`git checkout $CURRENT_BRANCH\`
119
- 2. Run quality checks: \`make quality\`
120
- 3. Run tests: \`make test\`
121
- 4. Verify changes work as expected
122
-
123
- ---
124
- 🤖 Generated with AI-assisted development
125
- "
126
-
127
- # Create temporary file for PR body
128
- TMP_PR_FILE="tmp/pr-body-$(date +%Y%m%d-%H%M%S).md"
129
- mkdir -p tmp
130
- echo "$PR_BODY" > "$TMP_PR_FILE"
131
-
132
- echo -e "${CYAN}PR Body Preview:${RESET}"
133
- head -20 "$TMP_PR_FILE"
134
- echo "..."
135
- echo ""
136
-
137
- # Confirm before creating PR
138
- read -p "Create PR with this content? (y/n): " -n 1 -r
139
- echo ""
140
-
141
- if [[ ! $REPLY =~ ^[Yy]$ ]]; then
142
- echo -e "${YELLOW}⚠️ Cancelled${RESET}"
143
- echo "PR body saved at: $TMP_PR_FILE"
144
- exit 0
145
- fi
146
-
147
- echo ""
148
- echo -e "${CYAN}Creating pull request...${RESET}"
149
-
150
- # Create PR using gh CLI
151
- if gh pr create --title "$PR_TITLE" --body-file "$TMP_PR_FILE" --base "$BASE_BRANCH"; then
152
- echo ""
153
- echo -e "${GREEN}✅ Pull request created successfully!${RESET}"
154
- echo ""
155
- PR_URL=$(gh pr view --json url --jq .url)
156
- echo -e "${CYAN}🔗 PR URL:${RESET} $PR_URL"
157
- else
158
- echo ""
159
- echo -e "${RED}❌ Failed to create PR${RESET}"
160
- echo "PR body saved at: $TMP_PR_FILE"
161
- exit 1
162
- fi
163
-
164
- echo ""
165
- echo -e "${GREEN}✨ Done!${RESET}"
@@ -1,207 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Interactive session end script
4
- # Leverages AI context to create comprehensive checkpoint
5
-
6
- set -e
7
-
8
- # Colors
9
- CYAN='\033[36m'
10
- GREEN='\033[32m'
11
- YELLOW='\033[1;33m'
12
- RESET='\033[0m'
13
-
14
- echo ""
15
- echo -e "${CYAN}📋 Session End - Create Checkpoint${RESET}"
16
- echo "================================"
17
- echo ""
18
-
19
- # Get developer info
20
- DEVELOPER=$(git config user.name | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g')
21
- DATE=$(date +%Y-%m-%d)
22
- SESSIONS_DIR=".ai/sessions/$DEVELOPER/$DATE"
23
-
24
- # Create sessions directory if it doesn't exist
25
- mkdir -p "$SESSIONS_DIR"
26
-
27
- # Find next session number
28
- SESSION_NUM=1
29
- while [ -f "$SESSIONS_DIR/session-$SESSION_NUM.md" ]; do
30
- SESSION_NUM=$((SESSION_NUM + 1))
31
- done
32
-
33
- CHECKPOINT_FILE="$SESSIONS_DIR/session-$SESSION_NUM.md"
34
-
35
- echo -e "${CYAN}Session Information:${RESET}"
36
- echo " Developer: $DEVELOPER"
37
- echo " Date: $DATE"
38
- echo " Session: $SESSION_NUM"
39
- echo " Checkpoint: $CHECKPOINT_FILE"
40
- echo ""
41
-
42
- # Show recent activity
43
- echo -e "${CYAN}Recent Activity:${RESET}"
44
- echo ""
45
-
46
- # Show recent commits (if any)
47
- RECENT_COMMITS=$(git log --since="6 hours ago" --oneline --no-decorate 2>/dev/null | head -5)
48
- if [ -n "$RECENT_COMMITS" ]; then
49
- echo "Recent commits:"
50
- echo "$RECENT_COMMITS" | sed 's/^/ /'
51
- echo ""
52
- fi
53
-
54
- # Show current changes
55
- CURRENT_CHANGES=$(git status --short 2>/dev/null)
56
- if [ -n "$CURRENT_CHANGES" ]; then
57
- echo "Uncommitted changes:"
58
- echo "$CURRENT_CHANGES" | sed 's/^/ /'
59
- echo ""
60
- fi
61
-
62
- if [ -z "$RECENT_COMMITS" ] && [ -z "$CURRENT_CHANGES" ]; then
63
- echo " (No git activity detected)"
64
- echo ""
65
- fi
66
-
67
- # Create AI prompt from template
68
- TMP_PROMPT_FILE="tmp/session-end-$(date +%Y%m%d-%H%M%S).md"
69
- mkdir -p tmp
70
-
71
- # Read template and substitute variables
72
- TEMPLATE_FILE=".ai/prompts/session-end-template.md"
73
-
74
- if [ ! -f "$TEMPLATE_FILE" ]; then
75
- echo -e "${YELLOW}⚠${RESET} Template not found: $TEMPLATE_FILE"
76
- exit 1
77
- fi
78
-
79
- # Build git activity sections
80
- GIT_COMMITS_SECTION=""
81
- GIT_CHANGES_SECTION=""
82
-
83
- if [ -n "$RECENT_COMMITS" ]; then
84
- GIT_COMMITS_SECTION="Recent commits:
85
- \`\`\`
86
- $RECENT_COMMITS
87
- \`\`\`"
88
- fi
89
-
90
- if [ -n "$CURRENT_CHANGES" ]; then
91
- GIT_CHANGES_SECTION="Current changes:
92
- \`\`\`
93
- $CURRENT_CHANGES
94
- \`\`\`"
95
- fi
96
-
97
- # Create detailed instructions file
98
- INSTRUCTIONS_FILE="tmp/session-end-instructions-$(date +%Y%m%d-%H%M%S).md"
99
-
100
- awk -v dev="$DEVELOPER" \
101
- -v date="$DATE" \
102
- -v session="$SESSION_NUM" \
103
- -v checkpoint="$CHECKPOINT_FILE" \
104
- -v commits="$GIT_COMMITS_SECTION" \
105
- -v changes="$GIT_CHANGES_SECTION" \
106
- '{
107
- gsub(/{DEVELOPER}/, dev);
108
- gsub(/{DATE}/, date);
109
- gsub(/{SESSION_NUM}/, session);
110
- gsub(/{CHECKPOINT_FILE}/, checkpoint);
111
- gsub(/{GIT_COMMITS}/, commits);
112
- gsub(/{GIT_CHANGES}/, changes);
113
- print;
114
- }' "$TEMPLATE_FILE" > "$INSTRUCTIONS_FILE"
115
-
116
- # Create short prompt file that references the instructions
117
- cat > "$TMP_PROMPT_FILE" << EOF
118
- Please read the checkpoint instructions and create a comprehensive session checkpoint:
119
-
120
- 📋 **Instructions**: \`$INSTRUCTIONS_FILE\`
121
-
122
- Read that file for complete details on:
123
- - Session information (developer, date, checkpoint location)
124
- - What to document
125
- - How to fill the template
126
- - Recent git activity
127
-
128
- Then ask me any clarifying questions and create the checkpoint.
129
- EOF
130
-
131
- echo -e "${GREEN}✓${RESET} Checkpoint files created"
132
- echo ""
133
-
134
- # Show short prompt
135
- echo -e "${CYAN}Copy This Prompt to AI:${RESET}"
136
- echo -e "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
137
- cat "$TMP_PROMPT_FILE"
138
- echo -e "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
139
- echo ""
140
-
141
- # Copy options
142
- echo -e "${CYAN}Files Created:${RESET}"
143
- echo " 📄 Short prompt: ${YELLOW}$TMP_PROMPT_FILE${RESET}"
144
- echo " 📋 Instructions: ${YELLOW}$INSTRUCTIONS_FILE${RESET}"
145
- echo ""
146
- echo "Choose an option:"
147
- echo " 1) Copy short prompt to clipboard"
148
- echo " 2) I'll copy manually"
149
- echo " 3) Skip for now"
150
- echo ""
151
- read -p "Your choice (1/2/3): " -n 1 -r
152
- echo ""
153
- echo ""
154
-
155
- case $REPLY in
156
- 1)
157
- if command -v pbcopy &> /dev/null; then
158
- cat "$TMP_PROMPT_FILE" | pbcopy
159
- echo -e "${GREEN}✓${RESET} Short prompt copied to clipboard!"
160
- elif command -v xclip &> /dev/null; then
161
- cat "$TMP_PROMPT_FILE" | xclip -selection clipboard
162
- echo -e "${GREEN}✓${RESET} Short prompt copied to clipboard!"
163
- elif command -v clip.exe &> /dev/null; then
164
- cat "$TMP_PROMPT_FILE" | clip.exe
165
- echo -e "${GREEN}✓${RESET} Short prompt copied to clipboard!"
166
- else
167
- echo -e "${YELLOW}⚠${RESET} Clipboard tool not found"
168
- echo "Copy manually from: $TMP_PROMPT_FILE"
169
- fi
170
- echo ""
171
- echo "Paste to AI. The AI will read the instructions file and create the checkpoint."
172
- ;;
173
- 2)
174
- echo -e "${GREEN}✓${RESET} Prompt saved at: ${YELLOW}$TMP_PROMPT_FILE${RESET}"
175
- echo ""
176
- echo "Copy and paste it to your AI assistant."
177
- ;;
178
- 3)
179
- echo -e "${YELLOW}⚠${RESET} Skipped. Run 'make session-end' again when ready."
180
- exit 0
181
- ;;
182
- *)
183
- echo -e "${YELLOW}Invalid choice.${RESET}"
184
- echo "Prompt saved at: $TMP_PROMPT_FILE"
185
- ;;
186
- esac
187
-
188
- echo ""
189
- echo -e "${CYAN}After AI Creates Checkpoint:${RESET}"
190
- echo ""
191
- echo "1. Verify checkpoint: ${YELLOW}$CHECKPOINT_FILE${RESET}"
192
- echo "2. Review for completeness"
193
- echo "3. Commit: ${YELLOW}make session-commit${RESET}"
194
- echo ""
195
-
196
- # Skill evolution reminder
197
- if [ -d ".claude/skills" ]; then
198
- echo -e "${CYAN}Skill Evolution:${RESET}"
199
- echo " Update skills with session learnings:"
200
- echo " - ${YELLOW}.claude/skills/learned/references/gotchas.md${RESET} (general gotchas)"
201
- echo " - ${YELLOW}.claude/skills/learned/references/conventions.md${RESET} (new conventions)"
202
- echo " - ${YELLOW}.claude/skills/<area>/references/gotchas.md${RESET} (area-specific)"
203
- echo ""
204
- fi
205
-
206
- echo -e "${GREEN}✨ Great session!${RESET}"
207
- echo ""
@@ -1,233 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Colors
4
- CYAN='\033[36m'
5
- RESET='\033[0m'
6
-
7
- echo -e "${CYAN}🤖 AI Session Start${RESET}"
8
- echo "===================="
9
- echo ""
10
-
11
- DEVELOPER=$(git config user.name | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g')
12
- SESSIONS_DIR=".ai/sessions/$DEVELOPER"
13
- mkdir -p "$SESSIONS_DIR"
14
-
15
- # Find last checkpoint
16
- LAST_CHECKPOINT=$(find "$SESSIONS_DIR" -name "session-*.md" -type f 2>/dev/null | sort -r | head -1)
17
-
18
- if [ -n "$LAST_CHECKPOINT" ]; then
19
- echo -e "${CYAN}📄 Last checkpoint found:${RESET} $LAST_CHECKPOINT"
20
- echo ""
21
- else
22
- echo -e "${CYAN}ℹ️ No previous checkpoints found for $DEVELOPER${RESET}"
23
- echo ""
24
- fi
25
-
26
- echo -e "${CYAN}📋 Session Start Prompt Available:${RESET} .ai/prompts/session-start.md"
27
- echo ""
28
-
29
- # Ask if user wants to create a tmp file with the prompts
30
- read -p "Would you like to create a tmp file with the session prompts? (y/n): " -n 1 -r
31
- echo ""
32
-
33
- if [[ $REPLY =~ ^[Yy]$ ]]; then
34
- echo ""
35
-
36
- # If there's a checkpoint, extract info and show to user
37
- USE_CHECKPOINT="n"
38
- PREV_GOAL=""
39
-
40
- if [ -n "$LAST_CHECKPOINT" ]; then
41
- echo -e "${CYAN}═══════════════════════════════════════════════════════════${RESET}"
42
- echo -e "${CYAN}Previous session found${RESET}"
43
- echo -e "${CYAN}═══════════════════════════════════════════════════════════${RESET}"
44
- echo ""
45
-
46
- # Try to extract what was accomplished
47
- ACCOMPLISHED=$(grep -m 1 "^## Accomplished" "$LAST_CHECKPOINT" -A 1 2>/dev/null | tail -1 | sed 's/^[[:space:]]*-[[:space:]]*//')
48
- if [ -n "$ACCOMPLISHED" ]; then
49
- echo "Last accomplished:"
50
- echo " → $ACCOMPLISHED"
51
- echo ""
52
- fi
53
-
54
- # Try to extract the next session goal from the checkpoint
55
- PREV_GOAL=$(awk '/^### Goal$/{getline; while(NF==0) getline; print; exit}' "$LAST_CHECKPOINT")
56
- if [ -n "$PREV_GOAL" ]; then
57
- echo "Next session goal (from checkpoint):"
58
- echo " → $PREV_GOAL"
59
- echo ""
60
- fi
61
-
62
- read -p "Continue from this checkpoint? (y/n): " -n 1 -r USE_CHECKPOINT
63
- echo ""
64
- echo ""
65
- fi
66
-
67
- # Now ask for the session goal
68
- echo -e "${CYAN}What is your goal for this session?${RESET}"
69
-
70
- if [[ $USE_CHECKPOINT =~ ^[Yy]$ ]] && [ -n "$PREV_GOAL" ]; then
71
- echo ""
72
- echo "Goal from checkpoint: \"$PREV_GOAL\""
73
- echo ""
74
- echo "Your options:"
75
- echo " • Press Enter to accept this goal"
76
- echo " • Type a new/modified goal to use instead"
77
- echo " • Type 'skip' to leave as placeholder {YOUR_GOAL_HERE}"
78
- echo ""
79
- elif [ -n "$PREV_GOAL" ]; then
80
- echo ""
81
- echo "Available goal from checkpoint: \"$PREV_GOAL\""
82
- echo ""
83
- echo "Your options:"
84
- echo " • Type your own goal for this fresh start"
85
- echo " • Press Enter to leave as placeholder {YOUR_GOAL_HERE}"
86
- echo ""
87
- else
88
- echo "(Press Enter to leave as placeholder if you'll decide later)"
89
- echo ""
90
- fi
91
-
92
- read -p "> " SESSION_GOAL
93
-
94
- # Handle 'skip' keyword
95
- if [ "$SESSION_GOAL" = "skip" ]; then
96
- SESSION_GOAL=""
97
- fi
98
-
99
- # Provide feedback on what was chosen
100
- echo ""
101
- if [[ $USE_CHECKPOINT =~ ^[Yy]$ ]] && [ -z "$SESSION_GOAL" ] && [ -n "$PREV_GOAL" ]; then
102
- SESSION_GOAL="$PREV_GOAL"
103
- echo -e "${CYAN}✓ Using goal from checkpoint${RESET}"
104
- elif [ -n "$SESSION_GOAL" ]; then
105
- echo -e "${CYAN}✓ Using custom goal: \"$SESSION_GOAL\"${RESET}"
106
- else
107
- echo -e "${CYAN}ℹ Goal left as placeholder - you'll need to edit the prompt${RESET}"
108
- fi
109
-
110
- # Ensure goal ends with proper punctuation if it's set
111
- if [ -n "$SESSION_GOAL" ] && [[ ! "$SESSION_GOAL" =~ [.!?]$ ]]; then
112
- SESSION_GOAL="${SESSION_GOAL}."
113
- fi
114
-
115
- # Create tmp directory if it doesn't exist
116
- TMP_DIR="tmp"
117
- mkdir -p "$TMP_DIR"
118
-
119
- TMP_FILE="$TMP_DIR/session-start-$(date +%Y%m%d-%H%M%S).md"
120
-
121
- {
122
- echo "# Session Start - Copy & Paste These Prompts"
123
- echo ""
124
- if [[ $USE_CHECKPOINT =~ ^[Yy]$ ]] && [ -n "$LAST_CHECKPOINT" ]; then
125
- echo "**Continuing from checkpoint:** \`$LAST_CHECKPOINT\`"
126
- echo ""
127
- elif [ -n "$LAST_CHECKPOINT" ]; then
128
- echo "**Starting fresh** (previous checkpoint available but not used: \`$LAST_CHECKPOINT\`)"
129
- echo ""
130
- fi
131
- echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
132
- echo ""
133
- echo "## 🎯 PROMPT 1: Plan the Session"
134
- echo ""
135
- if [ -z "$SESSION_GOAL" ]; then
136
- echo "**Instructions:** Copy the prompt below, replace \`{YOUR_GOAL_HERE}\` with your actual goal, then paste to AI."
137
- else
138
- echo "**Instructions:** Copy the prompt below and paste to AI (goal already filled in)."
139
- fi
140
- echo ""
141
- echo "\`\`\`"
142
-
143
- if [[ $USE_CHECKPOINT =~ ^[Yy]$ ]] && [ -n "$LAST_CHECKPOINT" ]; then
144
- # User chose to continue from checkpoint
145
- sed -e "s|{CHECKPOINT_PATH}|$LAST_CHECKPOINT|g" \
146
- -e "s|{IF_CONTINUING_FROM_CHECKPOINT}||g" \
147
- -e "s|{END_IF}||g" \
148
- .ai/prompts/planning-prompt.md | \
149
- if [ -n "$SESSION_GOAL" ]; then
150
- sed "s|{YOUR_GOAL_HERE}|$SESSION_GOAL|g"
151
- else
152
- cat
153
- fi
154
- else
155
- # User chose fresh start (remove checkpoint section)
156
- sed -e '/^{IF_CONTINUING_FROM_CHECKPOINT}$/,/^{END_IF}$/d' \
157
- .ai/prompts/planning-prompt.md | \
158
- if [ -n "$SESSION_GOAL" ]; then
159
- sed "s|{YOUR_GOAL_HERE}|$SESSION_GOAL|g"
160
- else
161
- cat
162
- fi
163
- fi
164
-
165
- echo "\`\`\`"
166
- echo ""
167
- echo "**What to expect:** AI will analyze your goal and create a detailed plan with file changes, components, tests, and architecture alignment."
168
- echo ""
169
- echo "📚 *For planning best practices, see: .ai/prompts/session-start.md*"
170
- echo ""
171
- echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
172
- echo ""
173
- echo "## ⚡ PROMPT 2: Execute Step-by-Step"
174
- echo ""
175
- echo "**Instructions:** After reviewing and approving the plan, copy the prompt below and replace \`{FIRST_COMPONENT_FROM_PLAN}\` with the first component from the plan."
176
- echo ""
177
- echo "\`\`\`"
178
-
179
- cat .ai/prompts/execution-prompt.md
180
-
181
- echo "\`\`\`"
182
- echo ""
183
- echo "**What to expect:** AI will explain what/why/how before implementing each component, ensuring alignment with your architecture."
184
- echo ""
185
- echo "📚 *For step-by-step guidance, see: .ai/prompts/step-by-step.md*"
186
- echo ""
187
- echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
188
- echo ""
189
- echo "💡 **Full workflow guide:** docs/developer-guide/session-workflow.md"
190
- } > "$TMP_FILE"
191
-
192
- echo -e "${CYAN}✅ Created tmp file:${RESET} $TMP_FILE"
193
- echo ""
194
- echo "You can now:"
195
- echo " • View the file: cat $TMP_FILE"
196
- echo " • Edit the file: \$EDITOR $TMP_FILE"
197
- echo " • Copy the prompts from the file"
198
- echo ""
199
- else
200
- echo -e "${CYAN}Skipped creating tmp file${RESET}"
201
- echo ""
202
- fi
203
-
204
- echo "════════════════════════════════════════════════════════════════"
205
- echo -e "${CYAN}📖 Next Steps:${RESET}"
206
- echo ""
207
-
208
- if [[ $REPLY =~ ^[Yy]$ ]]; then
209
- echo "1. Review the tmp file: $TMP_FILE"
210
- if [ -n "$LAST_CHECKPOINT" ]; then
211
- echo "2. Decide if you want to continue from the checkpoint or start fresh"
212
- echo "3. Tell AI your goal (mention checkpoint if continuing)"
213
- else
214
- echo "2. Tell AI your goal and ask it to plan the session"
215
- fi
216
- echo "$([ -n "$LAST_CHECKPOINT" ] && echo "4" || echo "3"). Validate the plan (scope, architecture alignment)"
217
- echo "$([ -n "$LAST_CHECKPOINT" ] && echo "5" || echo "4"). Begin step-by-step development"
218
- else
219
- if [ -n "$LAST_CHECKPOINT" ]; then
220
- echo "1. Review the checkpoint: $LAST_CHECKPOINT"
221
- echo "2. Decide if you want to continue from the checkpoint or start fresh"
222
- echo "3. Tell AI your goal (mention checkpoint if continuing)"
223
- else
224
- echo "1. This is a new session (no previous checkpoint)"
225
- echo "2. Read the session start prompt: .ai/prompts/session-start.md"
226
- echo "3. Tell AI your goal and ask it to plan the session"
227
- fi
228
- echo "$([ -n "$LAST_CHECKPOINT" ] && echo "4" || echo "4"). Validate the plan (scope, architecture alignment)"
229
- echo "$([ -n "$LAST_CHECKPOINT" ] && echo "5" || echo "5"). Begin step-by-step development"
230
- fi
231
-
232
- echo ""
233
- echo "💡 See: docs/developer-guide/session-workflow.md for full guide"