claude-autopm 1.21.0 → 1.22.1

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 (134) hide show
  1. package/autopm/.claude/agents/cloud/gcp-cloud-functions-engineer.md +5 -10
  2. package/autopm/.claude/agents/cloud/gemini-api-expert.md +1 -1
  3. package/autopm/.claude/agents/cloud/openai-python-expert.md +1 -1
  4. package/autopm/.claude/agents/cloud/terraform-infrastructure-expert.md +7 -11
  5. package/autopm/.claude/agents/core/mcp-manager.md +7 -0
  6. package/autopm/.claude/agents/data/airflow-orchestration-expert.md +1 -1
  7. package/autopm/.claude/agents/data/kedro-pipeline-expert.md +1 -1
  8. package/autopm/.claude/agents/data/langgraph-workflow-expert.md +1 -1
  9. package/autopm/.claude/agents/databases/bigquery-expert.md +1 -1
  10. package/autopm/.claude/agents/databases/cosmosdb-expert.md +1 -1
  11. package/autopm/.claude/agents/databases/mongodb-expert.md +1 -1
  12. package/autopm/.claude/agents/databases/postgresql-expert.md +1 -1
  13. package/autopm/.claude/agents/databases/redis-expert.md +1 -1
  14. package/autopm/.claude/agents/decision-matrices/playwright-testing-selection.md +6 -0
  15. package/autopm/.claude/agents/decision-matrices/python-backend-selection.md +7 -0
  16. package/autopm/.claude/agents/decision-matrices/ui-framework-selection.md +7 -0
  17. package/autopm/.claude/agents/devops/azure-devops-specialist.md +1 -1
  18. package/autopm/.claude/agents/devops/github-operations-specialist.md +7 -0
  19. package/autopm/.claude/agents/devops/mcp-context-manager.md +7 -0
  20. package/autopm/.claude/agents/devops/ssh-operations-expert.md +1 -1
  21. package/autopm/.claude/agents/devops/traefik-proxy-expert.md +1 -1
  22. package/autopm/.claude/agents/frameworks/nats-messaging-expert.md +1 -1
  23. package/autopm/.claude/agents/frameworks/react-frontend-engineer.md +1 -1
  24. package/autopm/.claude/agents/languages/bash-scripting-expert.md +1 -1
  25. package/autopm/.claude/agents/languages/javascript-frontend-engineer.md +1 -1
  26. package/autopm/.claude/agents/languages/nodejs-backend-engineer.md +9 -6
  27. package/autopm/.claude/agents/languages/python-backend-engineer.md +1 -1
  28. package/autopm/.claude/commands/ai/langgraph-workflow.md +17 -0
  29. package/autopm/.claude/commands/ai/openai-chat.md +17 -0
  30. package/autopm/.claude/commands/azure/active-work.md +17 -0
  31. package/autopm/.claude/commands/azure/aliases.md +17 -0
  32. package/autopm/.claude/commands/azure/blocked-items.md +17 -0
  33. package/autopm/.claude/commands/azure/clean.md +17 -0
  34. package/autopm/.claude/commands/azure/docs-query.md +17 -0
  35. package/autopm/.claude/commands/azure/feature-decompose.md +17 -0
  36. package/autopm/.claude/commands/azure/feature-list.md +17 -0
  37. package/autopm/.claude/commands/azure/feature-new.md +17 -0
  38. package/autopm/.claude/commands/azure/feature-show.md +17 -0
  39. package/autopm/.claude/commands/azure/feature-start.md +17 -0
  40. package/autopm/.claude/commands/azure/fix-integration-example.md +17 -0
  41. package/autopm/.claude/commands/azure/help.md +17 -0
  42. package/autopm/.claude/commands/azure/import-us.md +17 -0
  43. package/autopm/.claude/commands/azure/init.md +17 -0
  44. package/autopm/.claude/commands/azure/next-task.md +17 -0
  45. package/autopm/.claude/commands/azure/search.md +17 -0
  46. package/autopm/.claude/commands/azure/sprint-status.md +17 -0
  47. package/autopm/.claude/commands/azure/standup.md +17 -0
  48. package/autopm/.claude/commands/azure/sync-all.md +17 -0
  49. package/autopm/.claude/commands/azure/task-analyze.md +17 -0
  50. package/autopm/.claude/commands/azure/task-close.md +17 -0
  51. package/autopm/.claude/commands/azure/task-edit.md +17 -0
  52. package/autopm/.claude/commands/azure/task-list.md +17 -0
  53. package/autopm/.claude/commands/azure/task-new.md +17 -0
  54. package/autopm/.claude/commands/azure/task-reopen.md +17 -0
  55. package/autopm/.claude/commands/azure/task-show.md +17 -0
  56. package/autopm/.claude/commands/azure/task-start.md +17 -0
  57. package/autopm/.claude/commands/azure/task-status.md +17 -0
  58. package/autopm/.claude/commands/azure/task-sync.md +17 -0
  59. package/autopm/.claude/commands/azure/us-edit.md +17 -0
  60. package/autopm/.claude/commands/azure/us-list.md +17 -0
  61. package/autopm/.claude/commands/azure/us-new.md +17 -0
  62. package/autopm/.claude/commands/azure/us-parse.md +17 -0
  63. package/autopm/.claude/commands/azure/us-show.md +17 -0
  64. package/autopm/.claude/commands/azure/us-status.md +17 -0
  65. package/autopm/.claude/commands/azure/validate.md +17 -0
  66. package/autopm/.claude/commands/azure/work-item-sync.md +17 -0
  67. package/autopm/.claude/commands/cloud/infra-deploy.md +17 -0
  68. package/autopm/.claude/commands/config/toggle-features.md +15 -0
  69. package/autopm/.claude/commands/context/create.md +16 -0
  70. package/autopm/.claude/commands/context/prime.md +16 -0
  71. package/autopm/.claude/commands/context/update.md +16 -0
  72. package/autopm/.claude/commands/github/workflow-create.md +17 -0
  73. package/autopm/.claude/commands/infrastructure/ssh-security.md +17 -0
  74. package/autopm/.claude/commands/infrastructure/traefik-setup.md +17 -0
  75. package/autopm/.claude/commands/kubernetes/deploy.md +16 -0
  76. package/autopm/.claude/commands/mcp/context-setup.md +17 -0
  77. package/autopm/.claude/commands/mcp/docs-refresh.md +17 -0
  78. package/autopm/.claude/commands/playwright/test-scaffold.md +17 -0
  79. package/autopm/.claude/commands/pm/blocked.md +17 -0
  80. package/autopm/.claude/commands/pm/clean.md +17 -0
  81. package/autopm/.claude/commands/pm/context.md +17 -0
  82. package/autopm/.claude/commands/pm/epic-close.md +17 -0
  83. package/autopm/.claude/commands/pm/epic-decompose.md +16 -0
  84. package/autopm/.claude/commands/pm/epic-edit.md +17 -0
  85. package/autopm/.claude/commands/pm/epic-list.md +17 -0
  86. package/autopm/.claude/commands/pm/epic-merge.md +17 -0
  87. package/autopm/.claude/commands/pm/epic-oneshot.md +17 -0
  88. package/autopm/.claude/commands/pm/epic-refresh.md +17 -0
  89. package/autopm/.claude/commands/pm/epic-show.md +17 -0
  90. package/autopm/.claude/commands/pm/epic-split.md +17 -0
  91. package/autopm/.claude/commands/pm/epic-start.md +17 -0
  92. package/autopm/.claude/commands/pm/epic-status.md +17 -0
  93. package/autopm/.claude/commands/pm/epic-sync-modular.md +17 -0
  94. package/autopm/.claude/commands/pm/epic-sync-original.md +17 -0
  95. package/autopm/.claude/commands/pm/epic-sync.md +17 -0
  96. package/autopm/.claude/commands/pm/help.md +17 -0
  97. package/autopm/.claude/commands/pm/import.md +17 -0
  98. package/autopm/.claude/commands/pm/in-progress.md +17 -0
  99. package/autopm/.claude/commands/pm/init.md +17 -0
  100. package/autopm/.claude/commands/pm/issue-analyze.md +17 -0
  101. package/autopm/.claude/commands/pm/issue-close.md +17 -0
  102. package/autopm/.claude/commands/pm/issue-edit.md +17 -0
  103. package/autopm/.claude/commands/pm/issue-reopen.md +17 -0
  104. package/autopm/.claude/commands/pm/issue-show.md +17 -0
  105. package/autopm/.claude/commands/pm/issue-start.md +16 -0
  106. package/autopm/.claude/commands/pm/issue-status.md +17 -0
  107. package/autopm/.claude/commands/pm/issue-sync.md +17 -0
  108. package/autopm/.claude/commands/pm/next.md +17 -0
  109. package/autopm/.claude/commands/pm/prd-edit.md +17 -0
  110. package/autopm/.claude/commands/pm/prd-list.md +17 -0
  111. package/autopm/.claude/commands/pm/prd-new.md +16 -0
  112. package/autopm/.claude/commands/pm/prd-parse.md +17 -0
  113. package/autopm/.claude/commands/pm/prd-status.md +17 -0
  114. package/autopm/.claude/commands/pm/search.md +17 -0
  115. package/autopm/.claude/commands/pm/standup.md +17 -0
  116. package/autopm/.claude/commands/pm/status.md +17 -0
  117. package/autopm/.claude/commands/pm/sync.md +17 -0
  118. package/autopm/.claude/commands/pm/test-reference-update.md +17 -0
  119. package/autopm/.claude/commands/pm/validate.md +17 -0
  120. package/autopm/.claude/commands/pm/what-next.md +17 -0
  121. package/autopm/.claude/commands/python/api-scaffold.md +17 -0
  122. package/autopm/.claude/commands/python/docs-query.md +17 -0
  123. package/autopm/.claude/commands/react/app-scaffold.md +17 -0
  124. package/autopm/.claude/commands/testing/prime.md +17 -0
  125. package/autopm/.claude/commands/testing/run.md +17 -0
  126. package/autopm/.claude/commands/ui/bootstrap-scaffold.md +17 -0
  127. package/autopm/.claude/commands/ui/tailwind-system.md +17 -0
  128. package/autopm/.claude/hooks/context7-reminder.md +29 -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/hooks/unified-context7-enforcement.sh +38 -0
  132. package/autopm/.claude/rules/context7-enforcement.md +327 -0
  133. package/package.json +1 -1
  134. package/scripts/add-context7-to-commands.js +351 -0
@@ -0,0 +1,229 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Pre-Command Context7 Hook
5
+ *
6
+ * MANDATORY: This hook enforces Context7 documentation queries BEFORE command execution.
7
+ *
8
+ * Workflow:
9
+ * 1. Intercept command execution (e.g., /pm:epic-decompose)
10
+ * 2. Extract command file path from .claude/commands/{category}/{command}.md
11
+ * 3. Parse "Documentation Queries" section
12
+ * 4. Query Context7 MCP for each link
13
+ * 5. Inject results into execution context
14
+ * 6. Allow command to proceed with Context7 knowledge
15
+ *
16
+ * Zero Tolerance: If Context7 query fails, execution STOPS.
17
+ */
18
+
19
+ const fs = require('fs');
20
+ const path = require('path');
21
+
22
+ /**
23
+ * Extract command metadata from invocation
24
+ * @param {string} commandInvocation - e.g., "/pm:epic-decompose feature-name"
25
+ * @returns {object} { category, command, args }
26
+ */
27
+ function parseCommandInvocation(commandInvocation) {
28
+ // Remove leading slash and split
29
+ const cleaned = commandInvocation.replace(/^\//, '');
30
+ const [categoryCommand, ...args] = cleaned.split(/\s+/);
31
+ const [category, command] = categoryCommand.split(':');
32
+
33
+ return {
34
+ category: category || 'pm', // Default to pm if no category
35
+ command: command || categoryCommand,
36
+ args: args,
37
+ fullCommand: categoryCommand
38
+ };
39
+ }
40
+
41
+ /**
42
+ * Find command file in .claude/commands/
43
+ * @param {string} category - Command category (pm, azure, cloud, etc.)
44
+ * @param {string} command - Command name (epic-decompose, issue-start, etc.)
45
+ * @returns {string|null} - Path to command file or null
46
+ */
47
+ function findCommandFile(category, command) {
48
+ const baseDir = path.join(process.cwd(), '.claude', 'commands');
49
+
50
+ // Try exact match first
51
+ let commandPath = path.join(baseDir, category, `${command}.md`);
52
+ if (fs.existsSync(commandPath)) {
53
+ return commandPath;
54
+ }
55
+
56
+ // Try with underscores (epic-decompose → epic_decompose)
57
+ const underscored = command.replace(/-/g, '_');
58
+ commandPath = path.join(baseDir, category, `${underscored}.md`);
59
+ if (fs.existsSync(commandPath)) {
60
+ return commandPath;
61
+ }
62
+
63
+ // Try without category prefix if command includes it
64
+ if (command.includes('-')) {
65
+ const [, actualCommand] = command.split('-', 2);
66
+ if (actualCommand) {
67
+ commandPath = path.join(baseDir, category, `${actualCommand}.md`);
68
+ if (fs.existsSync(commandPath)) {
69
+ return commandPath;
70
+ }
71
+ }
72
+ }
73
+
74
+ return null;
75
+ }
76
+
77
+ /**
78
+ * Extract Documentation Queries from command file
79
+ * @param {string} filePath - Path to command .md file
80
+ * @returns {Array<{url: string, description: string}>}
81
+ */
82
+ function extractDocumentationQueries(filePath) {
83
+ const content = fs.readFileSync(filePath, 'utf8');
84
+ const queries = [];
85
+
86
+ // Find the Documentation Queries section
87
+ const querySection = content.match(/\*\*Documentation Queries:\*\*\s*\n([\s\S]*?)(?=\n\n|\*\*Why This is Required|\n##|$)/);
88
+
89
+ if (!querySection) {
90
+ return queries; // No Documentation Queries section found
91
+ }
92
+
93
+ // Extract each mcp://context7/... line
94
+ const lines = querySection[1].split('\n');
95
+ for (const line of lines) {
96
+ const match = line.match(/`(mcp:\/\/context7\/[^`]+)`\s*-\s*(.+)/);
97
+ if (match) {
98
+ queries.push({
99
+ url: match[1],
100
+ description: match[2].trim()
101
+ });
102
+ }
103
+ }
104
+
105
+ return queries;
106
+ }
107
+
108
+ /**
109
+ * Query Context7 MCP server
110
+ * @param {string} mcpUrl - e.g., "mcp://context7/agile/epic-decomposition"
111
+ * @returns {Promise<object>} - Context7 response
112
+ */
113
+ async function queryContext7(mcpUrl) {
114
+ // Parse MCP URL: mcp://context7/category/topic
115
+ const urlMatch = mcpUrl.match(/mcp:\/\/context7\/(.+)/);
116
+ if (!urlMatch) {
117
+ throw new Error(`Invalid Context7 URL format: ${mcpUrl}`);
118
+ }
119
+
120
+ const topicPath = urlMatch[1]; // e.g., "agile/epic-decomposition"
121
+
122
+ // In real implementation, this would call the MCP server
123
+ // For now, return a placeholder that instructs Claude to query
124
+ return {
125
+ url: mcpUrl,
126
+ topic: topicPath,
127
+ instruction: `MANDATORY: Query Context7 MCP for topic "${topicPath}" before proceeding with implementation.`,
128
+ placeholder: true
129
+ };
130
+ }
131
+
132
+ /**
133
+ * Main hook execution
134
+ * @param {string} commandInvocation - Full command string from user
135
+ */
136
+ async function main(commandInvocation) {
137
+ console.log('\n🔒 Context7 Pre-Command Hook Activated\n');
138
+
139
+ // Parse command
140
+ const { category, command, args, fullCommand } = parseCommandInvocation(commandInvocation || process.argv[2] || '');
141
+
142
+ console.log(`📋 Command: /${fullCommand}`);
143
+ console.log(` Category: ${category}`);
144
+ console.log(` Command: ${command}`);
145
+ if (args.length > 0) {
146
+ console.log(` Arguments: ${args.join(' ')}`);
147
+ }
148
+
149
+ // Find command file
150
+ const commandFile = findCommandFile(category, command);
151
+ if (!commandFile) {
152
+ console.log(`\n⚠️ Warning: Command file not found for /${fullCommand}`);
153
+ console.log(` Searched: .claude/commands/${category}/${command}.md`);
154
+ console.log(` Proceeding without Context7 enforcement (file may not exist yet)\n`);
155
+ return;
156
+ }
157
+
158
+ console.log(` File: ${path.relative(process.cwd(), commandFile)}`);
159
+
160
+ // Extract Documentation Queries
161
+ const queries = extractDocumentationQueries(commandFile);
162
+
163
+ if (queries.length === 0) {
164
+ console.log(`\n❌ CRITICAL: No Documentation Queries found in command file!`);
165
+ console.log(` This violates Context7 enforcement policy.`);
166
+ console.log(` ALL commands MUST have Documentation Queries section.`);
167
+ console.log(`\n Please add to ${path.basename(commandFile)}:`);
168
+ console.log(` ## Required Documentation Access`);
169
+ console.log(` **MANDATORY:** Before [action], query Context7 for best practices:`);
170
+ console.log(` **Documentation Queries:**`);
171
+ console.log(` - \`mcp://context7/...\` - Description`);
172
+ console.log(`\n Blocking execution until fixed.\n`);
173
+ process.exit(1);
174
+ }
175
+
176
+ console.log(`\n📚 Context7 Documentation Queries Required: ${queries.length}\n`);
177
+
178
+ // Query Context7 for each link
179
+ const results = [];
180
+ for (const query of queries) {
181
+ console.log(` ➜ ${query.url}`);
182
+ console.log(` ${query.description}`);
183
+
184
+ try {
185
+ const result = await queryContext7(query.url);
186
+ results.push(result);
187
+ } catch (error) {
188
+ console.log(`\n❌ Context7 query FAILED: ${error.message}`);
189
+ console.log(` Cannot proceed without Context7 documentation.`);
190
+ console.log(` Please ensure Context7 MCP server is running.\n`);
191
+ process.exit(1);
192
+ }
193
+ }
194
+
195
+ console.log(`\n✅ Context7 Queries Complete\n`);
196
+ console.log(`📖 REMINDER: You MUST use Context7 documentation in your implementation:`);
197
+ console.log(` • Apply patterns from Context7 examples`);
198
+ console.log(` • Verify API signatures against Context7 results`);
199
+ console.log(` • Follow best practices documented in Context7`);
200
+ console.log(` • Flag any conflicts between training data and Context7`);
201
+ console.log(`\n🚀 Proceeding with command execution...\n`);
202
+
203
+ // In production, this would inject Context7 results into Claude's context
204
+ // For now, we output instruction for Claude to see
205
+ if (results.length > 0 && results[0].placeholder) {
206
+ console.log(`⚡ ACTION REQUIRED:`);
207
+ console.log(` Before implementing /${fullCommand}, you MUST:`);
208
+ for (const result of results) {
209
+ console.log(` • ${result.instruction}`);
210
+ }
211
+ console.log();
212
+ }
213
+ }
214
+
215
+ // Execute if run directly
216
+ if (require.main === module) {
217
+ const commandInvocation = process.argv.slice(2).join(' ');
218
+ main(commandInvocation).catch(error => {
219
+ console.error('\n❌ Hook execution failed:', error.message);
220
+ process.exit(1);
221
+ });
222
+ }
223
+
224
+ module.exports = {
225
+ parseCommandInvocation,
226
+ findCommandFile,
227
+ extractDocumentationQueries,
228
+ queryContext7
229
+ };
@@ -0,0 +1,38 @@
1
+ #!/bin/bash
2
+
3
+ # Unified Context7 Enforcement Hook
4
+ # Triggered by Claude Code on tool-use events
5
+ # Shows Context7 queries that MUST be performed before command/agent execution
6
+
7
+ set -e
8
+
9
+ # Get the user's prompt/command
10
+ PROMPT="${PROMPT:-$1}"
11
+
12
+ # Check if this is a command invocation (starts with /)
13
+ if [[ "$PROMPT" =~ ^/([a-z-]+):([a-z-]+) ]]; then
14
+ CATEGORY="${BASH_REMATCH[1]}"
15
+ COMMAND="${BASH_REMATCH[2]}"
16
+
17
+ echo ""
18
+ echo "🔒 Context7 Enforcement: Command Detected"
19
+ echo " Command: /$CATEGORY:$COMMAND"
20
+ echo ""
21
+
22
+ # Run the command hook
23
+ node .claude/hooks/pre-command-context7.js "$PROMPT"
24
+
25
+ elif [[ "$PROMPT" =~ ^@([a-z-]+) ]]; then
26
+ AGENT="${BASH_REMATCH[1]}"
27
+
28
+ echo ""
29
+ echo "🔒 Context7 Enforcement: Agent Detected"
30
+ echo " Agent: @$AGENT"
31
+ echo ""
32
+
33
+ # Run the agent hook
34
+ node .claude/hooks/pre-agent-context7.js "$PROMPT"
35
+ fi
36
+
37
+ # Always allow execution to continue
38
+ exit 0
@@ -0,0 +1,327 @@
1
+ # Context7 Documentation Enforcement
2
+
3
+ > **CRITICAL**: This rule has HIGHEST PRIORITY. ALL commands and agents MUST query Context7 before execution.
4
+
5
+ ---
6
+
7
+ ## 🔴 VISUAL REMINDER FOR EVERY COMMAND/AGENT
8
+
9
+ **WHEN YOU SEE:** User writes `/pm:epic-decompose` or `@aws-cloud-architect`
10
+
11
+ **YOU MUST IMMEDIATELY:**
12
+
13
+ 1. 📖 **ANNOUNCE**: "I will now query Context7 for required documentation..."
14
+ 2. 🔍 **READ** the command/agent file to extract Documentation Queries
15
+ 3. 🌐 **QUERY** Context7 MCP for EACH listed topic using mcp__context7__get-library-docs
16
+ 4. 📝 **SUMMARIZE** key findings from Context7 results
17
+ 5. ✅ **CONFIRM**: "Context7 verification complete. Proceeding with [command/agent]..."
18
+
19
+ **VISUAL OUTPUT FOR USER:**
20
+
21
+ ```
22
+ 🔒 Context7 Enforcement Active
23
+
24
+ 📋 Command: /pm:epic-decompose
25
+ 📚 Querying Context7 for required documentation...
26
+
27
+ ➜ mcp://context7/agile/epic-decomposition
28
+ ➜ mcp://context7/agile/task-sizing
29
+ ➜ mcp://context7/agile/user-stories
30
+ ➜ mcp://context7/project-management/task-breakdown
31
+
32
+ ✅ Context7 queries complete
33
+ 📖 Key findings: [summarize what you learned]
34
+
35
+ Proceeding with epic decomposition using Context7 best practices...
36
+ ```
37
+
38
+ ---
39
+
40
+ ## Core Context7 Philosophy
41
+
42
+ **Prime Directive**: Query live documentation from Context7 MCP BEFORE implementing any solution.
43
+ **Zero Tolerance**: No implementation without Context7 query. No reliance on training data. No shortcuts.
44
+
45
+ ## Why This is Critical
46
+
47
+ ### Problems We Solve
48
+
49
+ - **Hallucinations**: AI training data becomes stale, leading to outdated patterns
50
+ - **API Changes**: Frameworks evolve - training data doesn't reflect latest versions
51
+ - **Best Practices Drift**: Industry standards change faster than model retraining
52
+ - **Version Conflicts**: Code suggestions may target wrong framework versions
53
+
54
+ ### Context7 Benefits
55
+
56
+ - **Always Current**: Live documentation reflects latest releases
57
+ - **Verified Patterns**: Real code examples from official sources
58
+ - **API Accuracy**: Current function signatures, parameters, return types
59
+ - **Breaking Changes**: Immediate awareness of deprecated patterns
60
+
61
+ ## The Context7 Cycle
62
+
63
+ ### 1. QUERY Phase (Before Implementation)
64
+
65
+ **MANDATORY Steps:**
66
+ 1. Read command/agent file to extract `**Documentation Queries:**` section
67
+ 2. Query EACH Context7 MCP link listed
68
+ 3. Analyze results for relevant patterns, APIs, and best practices
69
+ 4. Summarize key findings before proceeding
70
+
71
+ **Required Information:**
72
+ - Current API signatures and parameters
73
+ - Recommended patterns and anti-patterns
74
+ - Breaking changes from recent versions
75
+ - Official code examples
76
+
77
+ ### 2. IMPLEMENT Phase (Using Context7 Knowledge)
78
+
79
+ **Requirements:**
80
+ - Apply patterns EXACTLY as documented in Context7 results
81
+ - Use API signatures from Context7 (not from training data)
82
+ - Follow architectural recommendations from live docs
83
+ - Reference Context7 findings in code comments where applicable
84
+
85
+ **Verification:**
86
+ - Cross-check implementation against Context7 examples
87
+ - Validate parameters match current API documentation
88
+ - Ensure no deprecated patterns are used
89
+
90
+ ### 3. VALIDATE Phase (Post-Implementation)
91
+
92
+ **Mandatory Checks:**
93
+ - Implementation matches Context7 best practices
94
+ - No training data hallucinations introduced
95
+ - Code follows latest framework conventions
96
+ - All deprecation warnings addressed
97
+
98
+ ## Enforcement Rules
99
+
100
+ ### ABSOLUTE REQUIREMENTS
101
+
102
+ **For ALL Commands:**
103
+ - MUST read `## Required Documentation Access` section
104
+ - MUST query EVERY `mcp://context7/...` link before execution
105
+ - MUST summarize Context7 findings before proceeding
106
+ - MUST apply Context7 guidance in implementation
107
+
108
+ **For ALL Agents:**
109
+ - MUST read `**Documentation Queries:**` section
110
+ - MUST query Context7 before making technical decisions
111
+ - MUST verify API signatures against live documentation
112
+ - MUST flag conflicts between training data and Context7
113
+
114
+ **For ALL Implementations:**
115
+ - NO code based solely on training data for technical specifics
116
+ - NO assumptions about API signatures without Context7 verification
117
+ - NO "I think this is how it works" - VERIFY with Context7
118
+ - NO skipping Context7 "because it's a small change"
119
+
120
+ ### PROHIBITED PRACTICES
121
+
122
+ - ❌ Implementing without querying Context7 first
123
+ - ❌ "I remember how this works" - training data is stale
124
+ - ❌ Skipping Context7 for "simple" or "obvious" tasks
125
+ - ❌ Using cached knowledge instead of live documentation
126
+ - ❌ Proceeding when Context7 query fails (STOP and report)
127
+ - ❌ Ignoring Context7 guidance because training data "seems better"
128
+
129
+ ## Query Quality Standards
130
+
131
+ ### Effective Context7 Queries
132
+
133
+ **DO:**
134
+ - ✅ Query ALL links in Documentation Queries section
135
+ - ✅ Request specific topics relevant to the task
136
+ - ✅ Ask for code examples and patterns
137
+ - ✅ Verify API signatures and parameters
138
+ - ✅ Check for breaking changes and migrations
139
+
140
+ **DON'T:**
141
+ - ❌ Skip queries assuming training data is sufficient
142
+ - ❌ Query only one link when multiple are listed
143
+ - ❌ Accept generic results - request specifics
144
+ - ❌ Ignore version mismatches in results
145
+
146
+ ### Coverage Requirements
147
+
148
+ - **100% Query Rate**: Every command/agent execution queries Context7
149
+ - **Complete Coverage**: ALL listed Context7 links must be queried
150
+ - **Result Validation**: Verify Context7 returned relevant information
151
+ - **Fallback Protocol**: If Context7 fails, STOP and report (don't proceed with stale data)
152
+
153
+ ## Integration with Workflow
154
+
155
+ ### Command Execution Flow
156
+
157
+ ```
158
+ User executes command: /pm:epic-decompose feature-name
159
+
160
+ BEFORE execution:
161
+ 1. Read .claude/commands/pm/epic-decompose.md
162
+ 2. Extract Documentation Queries section:
163
+ - mcp://context7/agile/epic-decomposition
164
+ - mcp://context7/agile/task-sizing
165
+ - mcp://context7/agile/user-stories
166
+ - mcp://context7/project-management/task-breakdown
167
+ 3. Query Context7 for EACH link
168
+ 4. Summarize findings: "Context7 confirms INVEST criteria for user stories..."
169
+ 5. PROCEED with command execution using Context7 guidance
170
+
171
+ DURING execution:
172
+ - Apply Context7 patterns
173
+ - Reference Context7 examples
174
+ - Follow Context7 best practices
175
+
176
+ AFTER execution:
177
+ - Validate against Context7 standards
178
+ - Flag any deviations from documentation
179
+ ```
180
+
181
+ ### Agent Invocation Flow
182
+
183
+ ```
184
+ User invokes agent: @aws-cloud-architect design VPC
185
+
186
+ BEFORE invocation:
187
+ 1. Read .claude/agents/cloud/aws-cloud-architect.md
188
+ 2. Extract Documentation Queries section:
189
+ - mcp://context7/aws/compute
190
+ - mcp://context7/aws/networking
191
+ - mcp://context7/terraform/aws
192
+ 3. Query Context7 for EACH link
193
+ 4. Summarize: "Context7 shows VPC best practices: /16 for staging, /20 for prod..."
194
+ 5. PROCEED with agent work using Context7 knowledge
195
+
196
+ DURING agent work:
197
+ - Use current AWS API patterns from Context7
198
+ - Apply Terraform AWS provider patterns from Context7
199
+ - Follow networking best practices from Context7
200
+
201
+ AFTER agent work:
202
+ - Cross-check VPC design against Context7 recommendations
203
+ - Ensure no deprecated patterns used
204
+ ```
205
+
206
+ ## Violation Consequences
207
+
208
+ **If Context7 enforcement is violated:**
209
+
210
+ ### Immediate Actions
211
+
212
+ 1. **STOP** execution immediately
213
+ 2. **IDENTIFY** what was implemented without Context7 verification
214
+ 3. **DELETE** code based on potentially stale training data
215
+ 4. **QUERY** Context7 for the relevant documentation
216
+ 5. **REIMPLEMENT** using Context7 guidance
217
+ 6. **DOCUMENT** violation and correction
218
+
219
+ ### Severity Levels
220
+
221
+ **Level 1 - Minor (Warning):**
222
+ - Partial Context7 queries (some links skipped)
223
+ - Action: Complete missing queries, validate implementation
224
+
225
+ **Level 2 - Moderate (Correction Required):**
226
+ - No Context7 queries performed
227
+ - Action: Stop, query Context7, review implementation
228
+
229
+ **Level 3 - Critical (Revert and Redo):**
230
+ - Implementation contradicts Context7 documentation
231
+ - Action: Delete code, start over with Context7 guidance
232
+
233
+ ### No Exceptions Policy
234
+
235
+ - NO "small changes" exceptions
236
+ - NO "I'm confident this is right" exceptions
237
+ - NO "Context7 is slow" exceptions
238
+ - NO "training data matches Context7" assumptions
239
+
240
+ ## Success Metrics
241
+
242
+ ### Compliance Indicators
243
+
244
+ - ✅ 100% of commands query Context7 before execution
245
+ - ✅ 100% of agents query Context7 before implementation
246
+ - ✅ Zero implementations based solely on training data
247
+ - ✅ All API signatures verified against live documentation
248
+ - ✅ No deprecated patterns in codebase
249
+ - ✅ Context7 findings documented in comments/commits
250
+
251
+ ### Quality Indicators
252
+
253
+ - ✅ Implementation matches Context7 examples
254
+ - ✅ No "unexpected behavior" due to API changes
255
+ - ✅ Code follows latest framework conventions
256
+ - ✅ Breaking changes identified and addressed proactively
257
+
258
+ ## Automation and Enforcement
259
+
260
+ ### Pre-Command Hook
261
+
262
+ File: `.claude/hooks/pre-command-context7.js`
263
+
264
+ **Purpose**: Automatically extract and query Context7 before command execution
265
+
266
+ **Behavior**:
267
+ 1. Intercept command execution
268
+ 2. Read command file from `.claude/commands/{category}/{command}.md`
269
+ 3. Extract `**Documentation Queries:**` section
270
+ 4. Query Context7 MCP for each link
271
+ 5. Inject results into command context
272
+ 6. Proceed with execution
273
+
274
+ ### Pre-Agent Hook
275
+
276
+ File: `.claude/hooks/pre-agent-context7.js`
277
+
278
+ **Purpose**: Automatically extract and query Context7 before agent invocation
279
+
280
+ **Behavior**:
281
+ 1. Intercept agent invocation
282
+ 2. Read agent file from `.claude/agents/{category}/{agent}.md`
283
+ 3. Extract `**Documentation Queries:**` section
284
+ 4. Query Context7 MCP for each link
285
+ 5. Inject results into agent context
286
+ 6. Proceed with agent work
287
+
288
+ ### Validation Rule
289
+
290
+ File: `.claude/rules/context7-enforcement.md` (this file)
291
+
292
+ **Purpose**: Remind Claude to ALWAYS query Context7
293
+
294
+ **Enforcement**:
295
+ - Read by Claude on every session start
296
+ - Highest priority in rule hierarchy
297
+ - Zero tolerance for violations
298
+
299
+ ## Emergency Fallback
300
+
301
+ **If Context7 MCP is unavailable:**
302
+
303
+ 1. **ALERT** user immediately: "⚠️ Context7 MCP unavailable - cannot verify documentation"
304
+ 2. **REQUEST** user decision:
305
+ - WAIT for Context7 to become available (RECOMMENDED)
306
+ - PROCEED with explicit user acknowledgment and risk acceptance
307
+ 3. **DOCUMENT** in code: `// WARNING: Implemented without Context7 verification - Context7 MCP was unavailable`
308
+ 4. **FLAG** for review: Add TODO to re-verify with Context7 when available
309
+
310
+ **DO NOT:**
311
+ - ❌ Silently proceed without Context7
312
+ - ❌ Assume training data is sufficient
313
+ - ❌ Skip documentation queries
314
+
315
+ ## Related Rules
316
+
317
+ - **TDD Enforcement** (`.claude/rules/tdd.enforcement.md`) - Tests first, always
318
+ - **Agent Usage** (`.claude/rules/agent-usage.md`) - When to use specialized agents
319
+ - **Code Quality** (`.claude/rules/code-quality.md`) - Standards and anti-patterns
320
+
321
+ ## Final Reminder
322
+
323
+ > **Context7 is NOT optional. It is MANDATORY for EVERY command and agent execution.**
324
+ >
325
+ > Training data becomes stale. APIs change. Best practices evolve.
326
+ >
327
+ > Context7 keeps us current. Query it. Every. Single. Time.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-autopm",
3
- "version": "1.21.0",
3
+ "version": "1.22.1",
4
4
  "description": "Autonomous Project Management Framework for Claude Code - Advanced AI-powered development automation",
5
5
  "main": "bin/autopm.js",
6
6
  "bin": {