awesome-slash 2.4.4 → 2.5.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 (151) hide show
  1. package/.claude-plugin/marketplace.json +6 -6
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +123 -1
  4. package/README.md +186 -159
  5. package/SECURITY.md +25 -81
  6. package/adapters/codex/install.sh +58 -16
  7. package/adapters/opencode/install.sh +92 -23
  8. package/lib/index.js +47 -4
  9. package/lib/patterns/review-patterns.js +58 -11
  10. package/lib/patterns/slop-patterns.js +154 -147
  11. package/lib/platform/detect-platform.js +99 -350
  12. package/lib/platform/detection-configs.js +93 -0
  13. package/lib/platform/state-dir.js +122 -0
  14. package/lib/platform/verify-tools.js +10 -78
  15. package/lib/schemas/README.md +195 -0
  16. package/lib/schemas/validator.js +247 -0
  17. package/lib/sources/custom-handler.js +199 -0
  18. package/lib/sources/policy-questions.js +239 -0
  19. package/lib/sources/source-cache.js +164 -0
  20. package/lib/state/workflow-state.js +368 -665
  21. package/lib/types/README.md +292 -0
  22. package/lib/types/agent-frontmatter.d.ts +134 -0
  23. package/lib/types/command-frontmatter.d.ts +107 -0
  24. package/lib/types/hook-frontmatter.d.ts +115 -0
  25. package/lib/types/index.d.ts +84 -0
  26. package/lib/types/plugin-manifest.d.ts +102 -0
  27. package/lib/types/skill-frontmatter.d.ts +89 -0
  28. package/lib/utils/cache-manager.js +154 -0
  29. package/lib/utils/context-optimizer.js +5 -36
  30. package/lib/utils/deprecation.js +37 -0
  31. package/lib/utils/shell-escape.js +88 -0
  32. package/mcp-server/index.js +513 -22
  33. package/package.json +6 -2
  34. package/plugins/deslop-around/.claude-plugin/plugin.json +1 -1
  35. package/plugins/deslop-around/lib/index.js +170 -0
  36. package/plugins/deslop-around/lib/patterns/review-patterns.js +58 -11
  37. package/plugins/deslop-around/lib/patterns/slop-patterns.js +169 -129
  38. package/plugins/deslop-around/lib/platform/detect-platform.js +162 -316
  39. package/plugins/deslop-around/lib/platform/detection-configs.js +93 -0
  40. package/plugins/deslop-around/lib/platform/state-dir.js +122 -0
  41. package/plugins/deslop-around/lib/platform/verify-tools.js +10 -78
  42. package/plugins/deslop-around/lib/schemas/README.md +195 -0
  43. package/plugins/deslop-around/lib/schemas/validator.js +247 -0
  44. package/plugins/deslop-around/lib/sources/custom-handler.js +199 -0
  45. package/plugins/deslop-around/lib/sources/policy-questions.js +239 -0
  46. package/plugins/deslop-around/lib/sources/source-cache.js +164 -0
  47. package/plugins/deslop-around/lib/state/workflow-state.js +387 -484
  48. package/plugins/deslop-around/lib/types/README.md +292 -0
  49. package/plugins/deslop-around/lib/types/agent-frontmatter.d.ts +134 -0
  50. package/plugins/deslop-around/lib/types/command-frontmatter.d.ts +107 -0
  51. package/plugins/deslop-around/lib/types/hook-frontmatter.d.ts +115 -0
  52. package/plugins/deslop-around/lib/types/index.d.ts +84 -0
  53. package/plugins/deslop-around/lib/types/plugin-manifest.d.ts +102 -0
  54. package/plugins/deslop-around/lib/types/skill-frontmatter.d.ts +89 -0
  55. package/plugins/deslop-around/lib/utils/cache-manager.js +154 -0
  56. package/plugins/deslop-around/lib/utils/context-optimizer.js +115 -37
  57. package/plugins/deslop-around/lib/utils/deprecation.js +37 -0
  58. package/plugins/deslop-around/lib/utils/shell-escape.js +88 -0
  59. package/plugins/next-task/.claude-plugin/plugin.json +1 -1
  60. package/plugins/next-task/agents/delivery-validator.md +2 -2
  61. package/plugins/next-task/agents/implementation-agent.md +3 -4
  62. package/plugins/next-task/agents/planning-agent.md +77 -19
  63. package/plugins/next-task/agents/review-orchestrator.md +21 -122
  64. package/plugins/next-task/agents/task-discoverer.md +164 -23
  65. package/plugins/next-task/commands/next-task.md +180 -14
  66. package/plugins/next-task/lib/index.js +170 -0
  67. package/plugins/next-task/lib/patterns/review-patterns.js +58 -11
  68. package/plugins/next-task/lib/patterns/slop-patterns.js +169 -129
  69. package/plugins/next-task/lib/platform/detect-platform.js +162 -316
  70. package/plugins/next-task/lib/platform/detection-configs.js +93 -0
  71. package/plugins/next-task/lib/platform/state-dir.js +122 -0
  72. package/plugins/next-task/lib/platform/verify-tools.js +10 -78
  73. package/plugins/next-task/lib/schemas/README.md +195 -0
  74. package/plugins/next-task/lib/schemas/validator.js +247 -0
  75. package/plugins/next-task/lib/sources/custom-handler.js +199 -0
  76. package/plugins/next-task/lib/sources/policy-questions.js +239 -0
  77. package/plugins/next-task/lib/sources/source-cache.js +164 -0
  78. package/plugins/next-task/lib/state/workflow-state.js +387 -484
  79. package/plugins/next-task/lib/types/README.md +292 -0
  80. package/plugins/next-task/lib/types/agent-frontmatter.d.ts +134 -0
  81. package/plugins/next-task/lib/types/command-frontmatter.d.ts +107 -0
  82. package/plugins/next-task/lib/types/hook-frontmatter.d.ts +115 -0
  83. package/plugins/next-task/lib/types/index.d.ts +84 -0
  84. package/plugins/next-task/lib/types/plugin-manifest.d.ts +102 -0
  85. package/plugins/next-task/lib/types/skill-frontmatter.d.ts +89 -0
  86. package/plugins/next-task/lib/utils/cache-manager.js +154 -0
  87. package/plugins/next-task/lib/utils/context-optimizer.js +115 -37
  88. package/plugins/next-task/lib/utils/deprecation.js +37 -0
  89. package/plugins/next-task/lib/utils/shell-escape.js +88 -0
  90. package/plugins/project-review/.claude-plugin/plugin.json +1 -1
  91. package/plugins/project-review/lib/index.js +170 -0
  92. package/plugins/project-review/lib/patterns/review-patterns.js +58 -11
  93. package/plugins/project-review/lib/patterns/slop-patterns.js +169 -129
  94. package/plugins/project-review/lib/platform/detect-platform.js +162 -316
  95. package/plugins/project-review/lib/platform/detection-configs.js +93 -0
  96. package/plugins/project-review/lib/platform/state-dir.js +122 -0
  97. package/plugins/project-review/lib/platform/verify-tools.js +10 -78
  98. package/plugins/project-review/lib/schemas/README.md +195 -0
  99. package/plugins/project-review/lib/schemas/validator.js +247 -0
  100. package/plugins/project-review/lib/sources/custom-handler.js +199 -0
  101. package/plugins/project-review/lib/sources/policy-questions.js +239 -0
  102. package/plugins/project-review/lib/sources/source-cache.js +164 -0
  103. package/plugins/project-review/lib/state/workflow-state.js +387 -484
  104. package/plugins/project-review/lib/types/README.md +292 -0
  105. package/plugins/project-review/lib/types/agent-frontmatter.d.ts +134 -0
  106. package/plugins/project-review/lib/types/command-frontmatter.d.ts +107 -0
  107. package/plugins/project-review/lib/types/hook-frontmatter.d.ts +115 -0
  108. package/plugins/project-review/lib/types/index.d.ts +84 -0
  109. package/plugins/project-review/lib/types/plugin-manifest.d.ts +102 -0
  110. package/plugins/project-review/lib/types/skill-frontmatter.d.ts +89 -0
  111. package/plugins/project-review/lib/utils/cache-manager.js +154 -0
  112. package/plugins/project-review/lib/utils/context-optimizer.js +115 -37
  113. package/plugins/project-review/lib/utils/deprecation.js +37 -0
  114. package/plugins/project-review/lib/utils/shell-escape.js +88 -0
  115. package/plugins/reality-check/.claude-plugin/plugin.json +1 -1
  116. package/plugins/reality-check/agents/code-explorer.md +1 -1
  117. package/plugins/ship/.claude-plugin/plugin.json +1 -1
  118. package/plugins/ship/lib/index.js +170 -0
  119. package/plugins/ship/lib/patterns/review-patterns.js +58 -11
  120. package/plugins/ship/lib/patterns/slop-patterns.js +169 -129
  121. package/plugins/ship/lib/platform/detect-platform.js +162 -316
  122. package/plugins/ship/lib/platform/detection-configs.js +93 -0
  123. package/plugins/ship/lib/platform/state-dir.js +122 -0
  124. package/plugins/ship/lib/platform/verify-tools.js +10 -78
  125. package/plugins/ship/lib/schemas/README.md +195 -0
  126. package/plugins/ship/lib/schemas/validator.js +247 -0
  127. package/plugins/ship/lib/sources/custom-handler.js +199 -0
  128. package/plugins/ship/lib/sources/policy-questions.js +239 -0
  129. package/plugins/ship/lib/sources/source-cache.js +164 -0
  130. package/plugins/ship/lib/state/workflow-state.js +387 -484
  131. package/plugins/ship/lib/types/README.md +292 -0
  132. package/plugins/ship/lib/types/agent-frontmatter.d.ts +134 -0
  133. package/plugins/ship/lib/types/command-frontmatter.d.ts +107 -0
  134. package/plugins/ship/lib/types/hook-frontmatter.d.ts +115 -0
  135. package/plugins/ship/lib/types/index.d.ts +84 -0
  136. package/plugins/ship/lib/types/plugin-manifest.d.ts +102 -0
  137. package/plugins/ship/lib/types/skill-frontmatter.d.ts +89 -0
  138. package/plugins/ship/lib/utils/cache-manager.js +154 -0
  139. package/plugins/ship/lib/utils/context-optimizer.js +115 -37
  140. package/plugins/ship/lib/utils/deprecation.js +37 -0
  141. package/plugins/ship/lib/utils/shell-escape.js +88 -0
  142. package/scripts/install/codex.sh +216 -72
  143. package/scripts/install/opencode.sh +197 -21
  144. package/lib/state/workflow-state.schema.json +0 -282
  145. package/plugins/deslop-around/lib/state/workflow-state.schema.json +0 -282
  146. package/plugins/next-task/agents/policy-selector.md +0 -248
  147. package/plugins/next-task/lib/state/tasks-registry.schema.json +0 -85
  148. package/plugins/next-task/lib/state/workflow-state.schema.json +0 -282
  149. package/plugins/next-task/lib/state/worktree-status.schema.json +0 -219
  150. package/plugins/project-review/lib/state/workflow-state.schema.json +0 -282
  151. package/plugins/ship/lib/state/workflow-state.schema.json +0 -282
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Source Cache
3
+ * File-based persistence for task source preferences
4
+ *
5
+ * State directory is platform-aware:
6
+ * - Claude Code: .claude/sources/
7
+ * - OpenCode: .opencode/sources/
8
+ * - Codex CLI: .codex/sources/
9
+ *
10
+ * @module lib/sources/source-cache
11
+ */
12
+
13
+ const fs = require('fs');
14
+ const path = require('path');
15
+ const { getStateDir } = require('../platform/state-dir');
16
+
17
+ const PREFERENCE_FILE = 'preference.json';
18
+
19
+ /**
20
+ * Get the sources directory path (platform-aware)
21
+ * @returns {string} Path to sources directory
22
+ */
23
+ function getSourcesDir() {
24
+ return path.join(getStateDir(), 'sources');
25
+ }
26
+
27
+ /**
28
+ * Validate tool name to prevent path traversal
29
+ * @param {string} toolName - Tool name to validate
30
+ * @returns {boolean} True if valid
31
+ */
32
+ function isValidToolName(toolName) {
33
+ // Prevent path traversal and shell metacharacters
34
+ return /^[a-zA-Z0-9_-]+$/.test(toolName);
35
+ }
36
+
37
+ /**
38
+ * Ensure sources directory exists
39
+ * @returns {string} Path to sources directory
40
+ */
41
+ function ensureDir() {
42
+ const sourcesDir = getSourcesDir();
43
+ if (!fs.existsSync(sourcesDir)) {
44
+ fs.mkdirSync(sourcesDir, { recursive: true });
45
+ }
46
+ return sourcesDir;
47
+ }
48
+
49
+ /**
50
+ * Get cached source preference
51
+ * @returns {Object|null} Preference object or null if not cached
52
+ * @example
53
+ * // Returns: { source: 'github' }
54
+ * // Or: { source: 'custom', type: 'cli', tool: 'tea' }
55
+ */
56
+ function getPreference() {
57
+ const filePath = path.join(getSourcesDir(), PREFERENCE_FILE);
58
+ if (!fs.existsSync(filePath)) {
59
+ return null;
60
+ }
61
+ try {
62
+ return JSON.parse(fs.readFileSync(filePath, 'utf8'));
63
+ } catch (err) {
64
+ console.error(`Failed to read preference file:`, err.message);
65
+ return null;
66
+ }
67
+ }
68
+
69
+ /**
70
+ * Save source preference
71
+ * @param {Object} preference - Preference object
72
+ * @param {string} preference.source - Source type (github, gitlab, local, custom, other)
73
+ * @param {string} [preference.type] - For custom: mcp, cli, skill, file
74
+ * @param {string} [preference.tool] - Tool name or path
75
+ * @param {string} [preference.description] - For other: user's free text
76
+ */
77
+ function savePreference(preference) {
78
+ ensureDir();
79
+ const filePath = path.join(getSourcesDir(), PREFERENCE_FILE);
80
+ fs.writeFileSync(filePath, JSON.stringify({
81
+ ...preference,
82
+ savedAt: new Date().toISOString()
83
+ }, null, 2));
84
+ }
85
+
86
+ /**
87
+ * Get cached tool capabilities (for custom sources)
88
+ * @param {string} toolName - Tool identifier (e.g., 'tea', 'glab')
89
+ * @returns {Object|null} Capabilities object or null
90
+ */
91
+ function getToolCapabilities(toolName) {
92
+ // Prevent path traversal
93
+ if (!isValidToolName(toolName)) {
94
+ console.error(`Invalid tool name: ${toolName}`);
95
+ return null;
96
+ }
97
+ const filePath = path.join(getSourcesDir(), `${toolName}.json`);
98
+ if (!fs.existsSync(filePath)) {
99
+ return null;
100
+ }
101
+ try {
102
+ return JSON.parse(fs.readFileSync(filePath, 'utf8'));
103
+ } catch (err) {
104
+ console.error(`Failed to read tool capabilities for ${toolName}:`, err.message);
105
+ return null;
106
+ }
107
+ }
108
+
109
+ /**
110
+ * Save tool capabilities after discovery
111
+ * @param {string} toolName - Tool identifier
112
+ * @param {Object} capabilities - Discovered capabilities
113
+ * @param {string[]} capabilities.features - Available features (issues, prs, ci)
114
+ * @param {Object} capabilities.commands - Command mappings
115
+ */
116
+ function saveToolCapabilities(toolName, capabilities) {
117
+ // Prevent path traversal
118
+ if (!isValidToolName(toolName)) {
119
+ console.error(`Invalid tool name: ${toolName}`);
120
+ return;
121
+ }
122
+ ensureDir();
123
+ const filePath = path.join(getSourcesDir(), `${toolName}.json`);
124
+ fs.writeFileSync(filePath, JSON.stringify({
125
+ ...capabilities,
126
+ discoveredAt: new Date().toISOString()
127
+ }, null, 2));
128
+ }
129
+
130
+ /**
131
+ * Clear all cached preferences
132
+ */
133
+ function clearCache() {
134
+ const sourcesDir = getSourcesDir();
135
+ if (fs.existsSync(sourcesDir)) {
136
+ const files = fs.readdirSync(sourcesDir);
137
+ for (const file of files) {
138
+ const filePath = path.join(sourcesDir, file);
139
+ const stats = fs.statSync(filePath);
140
+ if (stats.isFile()) {
141
+ fs.unlinkSync(filePath);
142
+ }
143
+ }
144
+ }
145
+ }
146
+
147
+ /**
148
+ * Check if preference matches a specific source
149
+ * @param {string} source - Source to check
150
+ * @returns {boolean} True if preference matches
151
+ */
152
+ function isPreferred(source) {
153
+ const pref = getPreference();
154
+ return pref?.source === source;
155
+ }
156
+
157
+ module.exports = {
158
+ getPreference,
159
+ savePreference,
160
+ getToolCapabilities,
161
+ saveToolCapabilities,
162
+ clearCache,
163
+ isPreferred
164
+ };