claude-autopm 1.20.1 → 1.22.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 (141) hide show
  1. package/README.md +255 -878
  2. package/autopm/.claude/agents/cloud/gcp-cloud-functions-engineer.md +5 -10
  3. package/autopm/.claude/agents/cloud/gemini-api-expert.md +1 -1
  4. package/autopm/.claude/agents/cloud/openai-python-expert.md +1 -1
  5. package/autopm/.claude/agents/cloud/terraform-infrastructure-expert.md +7 -11
  6. package/autopm/.claude/agents/core/mcp-manager.md +7 -0
  7. package/autopm/.claude/agents/data/airflow-orchestration-expert.md +1 -1
  8. package/autopm/.claude/agents/data/kedro-pipeline-expert.md +1 -1
  9. package/autopm/.claude/agents/data/langgraph-workflow-expert.md +1 -1
  10. package/autopm/.claude/agents/databases/bigquery-expert.md +1 -1
  11. package/autopm/.claude/agents/databases/cosmosdb-expert.md +1 -1
  12. package/autopm/.claude/agents/databases/mongodb-expert.md +1 -1
  13. package/autopm/.claude/agents/databases/postgresql-expert.md +1 -1
  14. package/autopm/.claude/agents/databases/redis-expert.md +1 -1
  15. package/autopm/.claude/agents/decision-matrices/playwright-testing-selection.md +6 -0
  16. package/autopm/.claude/agents/decision-matrices/python-backend-selection.md +7 -0
  17. package/autopm/.claude/agents/decision-matrices/ui-framework-selection.md +7 -0
  18. package/autopm/.claude/agents/devops/azure-devops-specialist.md +1 -1
  19. package/autopm/.claude/agents/devops/github-operations-specialist.md +7 -0
  20. package/autopm/.claude/agents/devops/mcp-context-manager.md +7 -0
  21. package/autopm/.claude/agents/devops/ssh-operations-expert.md +1 -1
  22. package/autopm/.claude/agents/devops/traefik-proxy-expert.md +1 -1
  23. package/autopm/.claude/agents/frameworks/nats-messaging-expert.md +1 -1
  24. package/autopm/.claude/agents/frameworks/react-frontend-engineer.md +1 -1
  25. package/autopm/.claude/agents/languages/bash-scripting-expert.md +1 -1
  26. package/autopm/.claude/agents/languages/javascript-frontend-engineer.md +1 -1
  27. package/autopm/.claude/agents/languages/nodejs-backend-engineer.md +3 -7
  28. package/autopm/.claude/agents/languages/python-backend-engineer.md +1 -1
  29. package/autopm/.claude/commands/ai/langgraph-workflow.md +17 -0
  30. package/autopm/.claude/commands/ai/openai-chat.md +17 -0
  31. package/autopm/.claude/commands/azure/active-work.md +17 -0
  32. package/autopm/.claude/commands/azure/aliases.md +17 -0
  33. package/autopm/.claude/commands/azure/blocked-items.md +17 -0
  34. package/autopm/.claude/commands/azure/clean.md +17 -0
  35. package/autopm/.claude/commands/azure/docs-query.md +17 -0
  36. package/autopm/.claude/commands/azure/feature-decompose.md +17 -0
  37. package/autopm/.claude/commands/azure/feature-list.md +17 -0
  38. package/autopm/.claude/commands/azure/feature-new.md +17 -0
  39. package/autopm/.claude/commands/azure/feature-show.md +17 -0
  40. package/autopm/.claude/commands/azure/feature-start.md +17 -0
  41. package/autopm/.claude/commands/azure/fix-integration-example.md +17 -0
  42. package/autopm/.claude/commands/azure/help.md +17 -0
  43. package/autopm/.claude/commands/azure/import-us.md +17 -0
  44. package/autopm/.claude/commands/azure/init.md +17 -0
  45. package/autopm/.claude/commands/azure/next-task.md +17 -0
  46. package/autopm/.claude/commands/azure/search.md +17 -0
  47. package/autopm/.claude/commands/azure/sprint-status.md +17 -0
  48. package/autopm/.claude/commands/azure/standup.md +17 -0
  49. package/autopm/.claude/commands/azure/sync-all.md +17 -0
  50. package/autopm/.claude/commands/azure/task-analyze.md +17 -0
  51. package/autopm/.claude/commands/azure/task-close.md +17 -0
  52. package/autopm/.claude/commands/azure/task-edit.md +17 -0
  53. package/autopm/.claude/commands/azure/task-list.md +17 -0
  54. package/autopm/.claude/commands/azure/task-new.md +17 -0
  55. package/autopm/.claude/commands/azure/task-reopen.md +17 -0
  56. package/autopm/.claude/commands/azure/task-show.md +17 -0
  57. package/autopm/.claude/commands/azure/task-start.md +17 -0
  58. package/autopm/.claude/commands/azure/task-status.md +17 -0
  59. package/autopm/.claude/commands/azure/task-sync.md +17 -0
  60. package/autopm/.claude/commands/azure/us-edit.md +17 -0
  61. package/autopm/.claude/commands/azure/us-list.md +17 -0
  62. package/autopm/.claude/commands/azure/us-new.md +17 -0
  63. package/autopm/.claude/commands/azure/us-parse.md +17 -0
  64. package/autopm/.claude/commands/azure/us-show.md +17 -0
  65. package/autopm/.claude/commands/azure/us-status.md +17 -0
  66. package/autopm/.claude/commands/azure/validate.md +17 -0
  67. package/autopm/.claude/commands/azure/work-item-sync.md +17 -0
  68. package/autopm/.claude/commands/cloud/infra-deploy.md +17 -0
  69. package/autopm/.claude/commands/config/toggle-features.md +15 -0
  70. package/autopm/.claude/commands/context/create.md +16 -0
  71. package/autopm/.claude/commands/context/prime.md +16 -0
  72. package/autopm/.claude/commands/context/update.md +16 -0
  73. package/autopm/.claude/commands/github/workflow-create.md +17 -0
  74. package/autopm/.claude/commands/infrastructure/ssh-security.md +17 -0
  75. package/autopm/.claude/commands/infrastructure/traefik-setup.md +17 -0
  76. package/autopm/.claude/commands/kubernetes/deploy.md +16 -0
  77. package/autopm/.claude/commands/mcp/context-setup.md +17 -0
  78. package/autopm/.claude/commands/mcp/docs-refresh.md +17 -0
  79. package/autopm/.claude/commands/playwright/test-scaffold.md +17 -0
  80. package/autopm/.claude/commands/pm/blocked.md +17 -0
  81. package/autopm/.claude/commands/pm/clean.md +17 -0
  82. package/autopm/.claude/commands/pm/context.md +17 -0
  83. package/autopm/.claude/commands/pm/epic-close.md +17 -0
  84. package/autopm/.claude/commands/pm/epic-decompose.md +16 -0
  85. package/autopm/.claude/commands/pm/epic-edit.md +17 -0
  86. package/autopm/.claude/commands/pm/epic-list.md +17 -0
  87. package/autopm/.claude/commands/pm/epic-merge.md +17 -0
  88. package/autopm/.claude/commands/pm/epic-oneshot.md +17 -0
  89. package/autopm/.claude/commands/pm/epic-refresh.md +17 -0
  90. package/autopm/.claude/commands/pm/epic-show.md +17 -0
  91. package/autopm/.claude/commands/pm/epic-split.md +17 -0
  92. package/autopm/.claude/commands/pm/epic-start.md +17 -0
  93. package/autopm/.claude/commands/pm/epic-status.md +17 -0
  94. package/autopm/.claude/commands/pm/epic-sync-modular.md +17 -0
  95. package/autopm/.claude/commands/pm/epic-sync-original.md +17 -0
  96. package/autopm/.claude/commands/pm/epic-sync.md +54 -4
  97. package/autopm/.claude/commands/pm/help.md +17 -0
  98. package/autopm/.claude/commands/pm/import.md +17 -0
  99. package/autopm/.claude/commands/pm/in-progress.md +17 -0
  100. package/autopm/.claude/commands/pm/init.md +17 -0
  101. package/autopm/.claude/commands/pm/issue-analyze.md +17 -0
  102. package/autopm/.claude/commands/pm/issue-close.md +17 -0
  103. package/autopm/.claude/commands/pm/issue-edit.md +17 -0
  104. package/autopm/.claude/commands/pm/issue-reopen.md +17 -0
  105. package/autopm/.claude/commands/pm/issue-show.md +17 -0
  106. package/autopm/.claude/commands/pm/issue-start.md +16 -0
  107. package/autopm/.claude/commands/pm/issue-status.md +17 -0
  108. package/autopm/.claude/commands/pm/issue-sync.md +17 -0
  109. package/autopm/.claude/commands/pm/next.md +17 -0
  110. package/autopm/.claude/commands/pm/prd-edit.md +17 -0
  111. package/autopm/.claude/commands/pm/prd-list.md +17 -0
  112. package/autopm/.claude/commands/pm/prd-new.md +16 -0
  113. package/autopm/.claude/commands/pm/prd-parse.md +17 -0
  114. package/autopm/.claude/commands/pm/prd-status.md +17 -0
  115. package/autopm/.claude/commands/pm/search.md +17 -0
  116. package/autopm/.claude/commands/pm/standup.md +17 -0
  117. package/autopm/.claude/commands/pm/status.md +17 -0
  118. package/autopm/.claude/commands/pm/sync.md +17 -0
  119. package/autopm/.claude/commands/pm/test-reference-update.md +17 -0
  120. package/autopm/.claude/commands/pm/validate.md +17 -0
  121. package/autopm/.claude/commands/pm/what-next.md +17 -0
  122. package/autopm/.claude/commands/python/api-scaffold.md +17 -0
  123. package/autopm/.claude/commands/python/docs-query.md +17 -0
  124. package/autopm/.claude/commands/react/app-scaffold.md +17 -0
  125. package/autopm/.claude/commands/testing/prime.md +17 -0
  126. package/autopm/.claude/commands/testing/run.md +17 -0
  127. package/autopm/.claude/commands/ui/bootstrap-scaffold.md +17 -0
  128. package/autopm/.claude/commands/ui/tailwind-system.md +17 -0
  129. package/autopm/.claude/hooks/pre-agent-context7.js +224 -0
  130. package/autopm/.claude/hooks/pre-command-context7.js +229 -0
  131. package/autopm/.claude/rules/context7-enforcement.md +292 -0
  132. package/autopm/.claude/rules/framework-path-rules.md +180 -0
  133. package/autopm/.claude/scripts/pm/epic-sync/README.md +208 -0
  134. package/autopm/.claude/scripts/pm/epic-sync/create-epic-issue.sh +68 -192
  135. package/autopm/.claude/scripts/pm/epic-sync/create-task-issues.sh +60 -328
  136. package/autopm/.claude/scripts/pm/epic-sync/update-epic-file.sh +61 -354
  137. package/autopm/.claude/scripts/pm/epic-sync/update-references.sh +67 -305
  138. package/autopm/.claude/scripts/pm/epic-sync.sh +137 -0
  139. package/package.json +4 -2
  140. package/scripts/add-context7-to-commands.js +351 -0
  141. package/scripts/validate-framework-paths.sh +104 -0
@@ -0,0 +1,351 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Automatically add "Required Documentation Access" section to all commands
5
+ * that don't already have it.
6
+ */
7
+
8
+ const fs = require('fs');
9
+ const path = require('path');
10
+ const { execSync } = require('child_process');
11
+
12
+ // Command categories with their Context7 topic mappings
13
+ const CATEGORY_MAPPINGS = {
14
+ 'ai': {
15
+ topics: ['ai/llm-integration', 'ai/workflow-orchestration', 'openai/api', 'langchain/agents'],
16
+ description: 'AI integration and LLM workflows'
17
+ },
18
+ 'azure': {
19
+ topics: ['azure-devops/boards', 'agile/user-stories', 'project-management/work-items', 'agile/sprint-planning'],
20
+ description: 'Azure DevOps integration and agile workflows'
21
+ },
22
+ 'cloud': {
23
+ topics: ['cloud/infrastructure', 'devops/deployment', 'terraform/best-practices', 'cloud/security'],
24
+ description: 'cloud infrastructure deployment'
25
+ },
26
+ 'config': {
27
+ topics: ['configuration-management/best-practices', 'devops/feature-flags'],
28
+ description: 'configuration management'
29
+ },
30
+ 'context': {
31
+ topics: ['ai/context-management', 'llm/prompt-engineering', 'ai/rag-systems'],
32
+ description: 'AI context management'
33
+ },
34
+ 'github': {
35
+ topics: ['github/workflows', 'ci-cd/github-actions', 'devops/automation'],
36
+ description: 'GitHub workflow creation'
37
+ },
38
+ 'infrastructure': {
39
+ topics: ['security/ssh-hardening', 'infrastructure/reverse-proxy', 'security/best-practices', 'devops/traefik'],
40
+ description: 'infrastructure setup and security'
41
+ },
42
+ 'kubernetes': {
43
+ topics: ['kubernetes/deployment', 'kubernetes/best-practices', 'devops/container-orchestration'],
44
+ description: 'Kubernetes deployment'
45
+ },
46
+ 'mcp': {
47
+ topics: ['mcp/protocol', 'mcp/servers', 'ai/context-management', 'mcp/integration'],
48
+ description: 'MCP server setup and documentation'
49
+ },
50
+ 'playwright': {
51
+ topics: ['playwright/testing', 'testing/e2e', 'testing/best-practices', 'playwright/patterns'],
52
+ description: 'Playwright test scaffolding'
53
+ },
54
+ 'pm': {
55
+ topics: ['agile/epic-management', 'project-management/issue-tracking', 'agile/task-breakdown', 'project-management/workflow'],
56
+ description: 'project management workflows'
57
+ },
58
+ 'python': {
59
+ topics: ['python/api-development', 'fastapi/best-practices', 'python/documentation', 'api-design/rest'],
60
+ description: 'Python API development'
61
+ },
62
+ 'react': {
63
+ topics: ['react/application-setup', 'react/best-practices', 'frontend/architecture', 'react/tooling'],
64
+ description: 'React application scaffolding'
65
+ },
66
+ 'testing': {
67
+ topics: ['testing/strategy', 'testing/automation', 'tdd/workflow', 'testing/best-practices'],
68
+ description: 'testing workflows'
69
+ },
70
+ 'ui': {
71
+ topics: ['ui/bootstrap', 'ui/tailwind', 'frontend/design-systems', 'css/frameworks'],
72
+ description: 'UI framework setup'
73
+ }
74
+ };
75
+
76
+ // Special mappings for specific commands
77
+ const COMMAND_SPECIFIC_MAPPINGS = {
78
+ 'epic-decompose': {
79
+ topics: ['agile/epic-decomposition', 'agile/task-sizing', 'agile/user-stories', 'project-management/task-breakdown'],
80
+ description: 'decomposing epics'
81
+ },
82
+ 'epic-split': {
83
+ topics: ['agile/epic-splitting', 'project-management/dependency-mapping', 'agile/priority-frameworks', 'architecture/component-analysis'],
84
+ description: 'splitting PRDs into epics'
85
+ },
86
+ 'issue-analyze': {
87
+ topics: ['agile/issue-analysis', 'agile/parallel-work', 'project-management/task-dependencies', 'agile/estimation'],
88
+ description: 'analyzing issues'
89
+ },
90
+ 'issue-start': {
91
+ topics: ['agile/issue-planning', 'tdd/workflow', 'git/branching', 'collaboration/parallel-work'],
92
+ description: 'starting work on issues'
93
+ },
94
+ 'prd-new': {
95
+ topics: ['product-management/prd-templates', 'product-management/requirements', 'agile/user-stories', 'product-management/success-metrics'],
96
+ description: 'creating PRDs'
97
+ },
98
+ 'prd-parse': {
99
+ topics: ['product-management/prd-to-epic', 'agile/epic-structure', 'architecture/technical-design', 'project-management/task-breakdown'],
100
+ description: 'converting PRDs to epics'
101
+ },
102
+ 'feature-decompose': {
103
+ topics: ['agile/feature-breakdown', 'azure-devops/features', 'agile/task-sizing', 'project-management/work-breakdown'],
104
+ description: 'decomposing Azure features'
105
+ },
106
+ 'us-new': {
107
+ topics: ['agile/user-stories', 'agile/invest-criteria', 'azure-devops/user-stories', 'requirements/writing'],
108
+ description: 'creating user stories'
109
+ },
110
+ 'task-analyze': {
111
+ topics: ['agile/task-analysis', 'project-management/task-planning', 'agile/estimation', 'azure-devops/tasks'],
112
+ description: 'analyzing tasks'
113
+ },
114
+ 'workflow-create': {
115
+ topics: ['github/workflows', 'ci-cd/github-actions', 'devops/pipeline-design', 'ci-cd/best-practices'],
116
+ description: 'creating GitHub workflows'
117
+ },
118
+ 'infra-deploy': {
119
+ topics: ['infrastructure/deployment', 'cloud/best-practices', 'devops/automation', 'infrastructure/configuration'],
120
+ description: 'deploying infrastructure'
121
+ },
122
+ 'ssh-security': {
123
+ topics: ['security/ssh-hardening', 'security/authentication', 'infrastructure/security', 'security/best-practices'],
124
+ description: 'SSH security hardening'
125
+ },
126
+ 'traefik-setup': {
127
+ topics: ['infrastructure/reverse-proxy', 'traefik/configuration', 'devops/networking', 'security/tls'],
128
+ description: 'Traefik setup'
129
+ },
130
+ 'test-scaffold': {
131
+ topics: ['playwright/scaffolding', 'testing/e2e', 'testing/page-objects', 'playwright/best-practices'],
132
+ description: 'scaffolding Playwright tests'
133
+ },
134
+ 'api-scaffold': {
135
+ topics: ['python/api-scaffolding', 'fastapi/structure', 'api-design/rest', 'python/best-practices'],
136
+ description: 'scaffolding Python APIs'
137
+ },
138
+ 'app-scaffold': {
139
+ topics: ['react/project-setup', 'react/application-structure', 'frontend/tooling', 'react/best-practices'],
140
+ description: 'scaffolding React applications'
141
+ }
142
+ };
143
+
144
+ function getCommandCategory(filePath) {
145
+ const parts = filePath.split('/');
146
+ const commandsIndex = parts.indexOf('commands');
147
+ if (commandsIndex >= 0 && commandsIndex < parts.length - 1) {
148
+ return parts[commandsIndex + 1];
149
+ }
150
+ return null;
151
+ }
152
+
153
+ function getCommandName(filePath) {
154
+ return path.basename(filePath, '.md');
155
+ }
156
+
157
+ function getTopicsForCommand(filePath) {
158
+ const commandName = getCommandName(filePath);
159
+ const category = getCommandCategory(filePath);
160
+
161
+ // Check for command-specific mapping first
162
+ if (COMMAND_SPECIFIC_MAPPINGS[commandName]) {
163
+ return COMMAND_SPECIFIC_MAPPINGS[commandName];
164
+ }
165
+
166
+ // Fall back to category mapping
167
+ if (category && CATEGORY_MAPPINGS[category]) {
168
+ return CATEGORY_MAPPINGS[category];
169
+ }
170
+
171
+ // Default generic topics
172
+ return {
173
+ topics: ['best-practices/general', 'development/workflow'],
174
+ description: 'executing this command'
175
+ };
176
+ }
177
+
178
+ function generateContext7Section(filePath) {
179
+ const mapping = getTopicsForCommand(filePath);
180
+ const { topics, description } = mapping;
181
+
182
+ const documentationQueries = topics
183
+ .map(topic => `- \`mcp://context7/${topic}\` - ${topic.split('/').pop().replace(/-/g, ' ')} best practices`)
184
+ .join('\n');
185
+
186
+ return `## Required Documentation Access
187
+
188
+ **MANDATORY:** Before ${description}, query Context7 for best practices:
189
+
190
+ **Documentation Queries:**
191
+ ${documentationQueries}
192
+
193
+ **Why This is Required:**
194
+ - Ensures adherence to current industry standards and best practices
195
+ - Prevents outdated or incorrect implementation patterns
196
+ - Provides access to latest framework/tool documentation
197
+ - Reduces errors from stale knowledge or assumptions
198
+
199
+ `;
200
+ }
201
+
202
+ function shouldProcessFile(filePath) {
203
+ const fileName = path.basename(filePath);
204
+
205
+ // Skip non-command files
206
+ const skipFiles = [
207
+ 'README.md',
208
+ 'COMMANDS.md',
209
+ 'COMMAND_MAPPING.md',
210
+ 'INTEGRATION_FIX.md',
211
+ 'ui-framework-commands.md',
212
+ 'ux-design-commands.md',
213
+ 'code-rabbit.md',
214
+ 'prompt.md',
215
+ 're-init.md'
216
+ ];
217
+
218
+ return !skipFiles.includes(fileName);
219
+ }
220
+
221
+ function hasContext7Section(content) {
222
+ return content.includes('## Required Documentation Access');
223
+ }
224
+
225
+ function findInsertionPoint(content) {
226
+ const lines = content.split('\n');
227
+
228
+ // Look for common section headers where we should insert BEFORE
229
+ const beforeSections = [
230
+ '## Instructions',
231
+ '## Required Rules',
232
+ '## Quick Check',
233
+ '## Description',
234
+ '## Usage Examples',
235
+ '## Overview',
236
+ '## Pre-flight Checks',
237
+ '## Validation',
238
+ '## Steps'
239
+ ];
240
+
241
+ for (let i = 0; i < lines.length; i++) {
242
+ for (const section of beforeSections) {
243
+ if (lines[i].trim().startsWith(section)) {
244
+ return i;
245
+ }
246
+ }
247
+ }
248
+
249
+ // If no known section found, insert after usage block (usually has ```)
250
+ let usageEndIndex = -1;
251
+ let inUsageBlock = false;
252
+ for (let i = 0; i < lines.length; i++) {
253
+ if (lines[i].includes('## Usage') || lines[i].includes('## Example')) {
254
+ inUsageBlock = true;
255
+ }
256
+ if (inUsageBlock && lines[i].trim() === '```') {
257
+ usageEndIndex = i + 1;
258
+ break;
259
+ }
260
+ }
261
+
262
+ if (usageEndIndex > 0) {
263
+ return usageEndIndex;
264
+ }
265
+
266
+ // Last resort: insert after first heading block (after frontmatter and title)
267
+ let headingCount = 0;
268
+ for (let i = 0; i < lines.length; i++) {
269
+ if (lines[i].startsWith('#')) {
270
+ headingCount++;
271
+ if (headingCount >= 2) {
272
+ return i;
273
+ }
274
+ }
275
+ }
276
+
277
+ return 10; // Fallback to line 10
278
+ }
279
+
280
+ function addContext7Section(filePath) {
281
+ let content = fs.readFileSync(filePath, 'utf8');
282
+
283
+ if (hasContext7Section(content)) {
284
+ return { modified: false, reason: 'already has section' };
285
+ }
286
+
287
+ const context7Section = generateContext7Section(filePath);
288
+ const insertionLine = findInsertionPoint(content);
289
+
290
+ const lines = content.split('\n');
291
+ lines.splice(insertionLine, 0, context7Section);
292
+
293
+ const newContent = lines.join('\n');
294
+ fs.writeFileSync(filePath, newContent, 'utf8');
295
+
296
+ return { modified: true, insertionLine };
297
+ }
298
+
299
+ function main() {
300
+ const commandsDir = path.join(__dirname, '../autopm/.claude/commands');
301
+
302
+ // Find all .md files recursively
303
+ const findCommand = `find "${commandsDir}" -name "*.md" -type f`;
304
+ const files = execSync(findCommand, { encoding: 'utf8' })
305
+ .trim()
306
+ .split('\n')
307
+ .filter(f => f.length > 0);
308
+
309
+ console.log(`\nšŸ“‹ Found ${files.length} command files\n`);
310
+
311
+ const results = {
312
+ modified: [],
313
+ skipped: [],
314
+ alreadyHas: []
315
+ };
316
+
317
+ for (const file of files) {
318
+ const fileName = path.relative(commandsDir, file);
319
+
320
+ if (!shouldProcessFile(file)) {
321
+ results.skipped.push(fileName);
322
+ continue;
323
+ }
324
+
325
+ const result = addContext7Section(file);
326
+
327
+ if (result.modified) {
328
+ results.modified.push({ file: fileName, line: result.insertionLine });
329
+ console.log(`āœ… Added to: ${fileName} (line ${result.insertionLine})`);
330
+ } else {
331
+ results.alreadyHas.push(fileName);
332
+ console.log(`ā­ļø Skip: ${fileName} (${result.reason})`);
333
+ }
334
+ }
335
+
336
+ console.log(`\nšŸ“Š Summary:`);
337
+ console.log(` Modified: ${results.modified.length}`);
338
+ console.log(` Already has Context7: ${results.alreadyHas.length}`);
339
+ console.log(` Skipped (non-command files): ${results.skipped.length}`);
340
+ console.log(` Total processed: ${files.length}\n`);
341
+
342
+ if (results.modified.length > 0) {
343
+ console.log(`✨ Successfully added Context7 sections to ${results.modified.length} commands!\n`);
344
+ }
345
+ }
346
+
347
+ if (require.main === module) {
348
+ main();
349
+ }
350
+
351
+ module.exports = { addContext7Section, getTopicsForCommand };
@@ -0,0 +1,104 @@
1
+ #!/bin/bash
2
+
3
+ # Validate Framework Paths
4
+ # Ensures no hardcoded 'autopm/' paths exist in framework files
5
+
6
+ set -e
7
+
8
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
10
+
11
+ echo ""
12
+ echo "šŸ” Validating Framework Paths"
13
+ echo "=============================="
14
+ echo ""
15
+
16
+ # Colors for output
17
+ RED='\033[0;31m'
18
+ GREEN='\033[0;32m'
19
+ YELLOW='\033[1;33m'
20
+ NC='\033[0m' # No Color
21
+
22
+ # Track violations
23
+ violations=0
24
+
25
+ # Function to check for violations
26
+ check_violations() {
27
+ local pattern="$1"
28
+ local description="$2"
29
+ local files
30
+
31
+ # Search for pattern, excluding:
32
+ # - Comments in JS files (lines starting with * or //)
33
+ # - Comments in shell scripts (lines starting with #)
34
+ # - "Migrated from" comments
35
+ # - The framework-path-rules.md file itself (contains examples)
36
+ files=$(grep -r "$pattern" "$PROJECT_ROOT/autopm/.claude" \
37
+ --include="*.md" \
38
+ --include="*.sh" \
39
+ --include="*.js" \
40
+ --exclude="framework-path-rules.md" \
41
+ 2>/dev/null | \
42
+ grep -v "Migrated from" | \
43
+ grep -v "^\s*\*" | \
44
+ grep -v "^\s*//" | \
45
+ grep -v "^\s*#" || true)
46
+
47
+ if [ -n "$files" ]; then
48
+ echo -e "${RED}āŒ Found violations: $description${NC}"
49
+ echo "$files"
50
+ echo ""
51
+ ((violations++))
52
+ return 1
53
+ fi
54
+
55
+ return 0
56
+ }
57
+
58
+ echo "Checking for hardcoded 'autopm/' paths..."
59
+ echo ""
60
+
61
+ # Check for bash autopm references
62
+ if ! check_violations "bash autopm" "Hardcoded 'bash autopm' commands"; then
63
+ echo -e "${YELLOW} Fix: Replace 'bash autopm/.claude/' with 'bash .claude/'${NC}"
64
+ echo ""
65
+ fi
66
+
67
+ # Check for node autopm references
68
+ if ! check_violations "node autopm" "Hardcoded 'node autopm' commands"; then
69
+ echo -e "${YELLOW} Fix: Replace 'node autopm/.claude/' with 'node .claude/'${NC}"
70
+ echo ""
71
+ fi
72
+
73
+ # Check for source autopm references
74
+ if ! check_violations "source autopm" "Hardcoded 'source autopm' commands"; then
75
+ echo -e "${YELLOW} Fix: Replace 'source autopm/.claude/' with 'source .claude/'${NC}"
76
+ echo ""
77
+ fi
78
+
79
+ # Check for ./autopm references
80
+ if ! check_violations "\./autopm" "Hardcoded './autopm' paths"; then
81
+ echo -e "${YELLOW} Fix: Replace './autopm/.claude/' with './.claude/'${NC}"
82
+ echo ""
83
+ fi
84
+
85
+ # Check for autopm/.claude in non-comment contexts
86
+ if ! check_violations 'autopm/\.claude' "Hardcoded 'autopm/.claude' paths"; then
87
+ echo -e "${YELLOW} Fix: Replace 'autopm/.claude/' with '.claude/'${NC}"
88
+ echo ""
89
+ fi
90
+
91
+ # Summary
92
+ echo "=============================="
93
+ if [ $violations -eq 0 ]; then
94
+ echo -e "${GREEN}āœ… All checks passed! No hardcoded 'autopm/' paths found.${NC}"
95
+ echo ""
96
+ exit 0
97
+ else
98
+ echo -e "${RED}āŒ Validation failed with $violations violation(s).${NC}"
99
+ echo ""
100
+ echo "Please fix the hardcoded paths before committing."
101
+ echo "See autopm/.claude/rules/framework-path-rules.md for guidelines."
102
+ echo ""
103
+ exit 1
104
+ fi