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.
- package/.claude-plugin/marketplace.json +6 -6
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +123 -1
- package/README.md +186 -159
- package/SECURITY.md +25 -81
- package/adapters/codex/install.sh +58 -16
- package/adapters/opencode/install.sh +92 -23
- package/lib/index.js +47 -4
- package/lib/patterns/review-patterns.js +58 -11
- package/lib/patterns/slop-patterns.js +154 -147
- package/lib/platform/detect-platform.js +99 -350
- package/lib/platform/detection-configs.js +93 -0
- package/lib/platform/state-dir.js +122 -0
- package/lib/platform/verify-tools.js +10 -78
- package/lib/schemas/README.md +195 -0
- package/lib/schemas/validator.js +247 -0
- package/lib/sources/custom-handler.js +199 -0
- package/lib/sources/policy-questions.js +239 -0
- package/lib/sources/source-cache.js +164 -0
- package/lib/state/workflow-state.js +368 -665
- package/lib/types/README.md +292 -0
- package/lib/types/agent-frontmatter.d.ts +134 -0
- package/lib/types/command-frontmatter.d.ts +107 -0
- package/lib/types/hook-frontmatter.d.ts +115 -0
- package/lib/types/index.d.ts +84 -0
- package/lib/types/plugin-manifest.d.ts +102 -0
- package/lib/types/skill-frontmatter.d.ts +89 -0
- package/lib/utils/cache-manager.js +154 -0
- package/lib/utils/context-optimizer.js +5 -36
- package/lib/utils/deprecation.js +37 -0
- package/lib/utils/shell-escape.js +88 -0
- package/mcp-server/index.js +513 -22
- package/package.json +6 -2
- package/plugins/deslop-around/.claude-plugin/plugin.json +1 -1
- package/plugins/deslop-around/lib/index.js +170 -0
- package/plugins/deslop-around/lib/patterns/review-patterns.js +58 -11
- package/plugins/deslop-around/lib/patterns/slop-patterns.js +169 -129
- package/plugins/deslop-around/lib/platform/detect-platform.js +162 -316
- package/plugins/deslop-around/lib/platform/detection-configs.js +93 -0
- package/plugins/deslop-around/lib/platform/state-dir.js +122 -0
- package/plugins/deslop-around/lib/platform/verify-tools.js +10 -78
- package/plugins/deslop-around/lib/schemas/README.md +195 -0
- package/plugins/deslop-around/lib/schemas/validator.js +247 -0
- package/plugins/deslop-around/lib/sources/custom-handler.js +199 -0
- package/plugins/deslop-around/lib/sources/policy-questions.js +239 -0
- package/plugins/deslop-around/lib/sources/source-cache.js +164 -0
- package/plugins/deslop-around/lib/state/workflow-state.js +387 -484
- package/plugins/deslop-around/lib/types/README.md +292 -0
- package/plugins/deslop-around/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/deslop-around/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/deslop-around/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/deslop-around/lib/types/index.d.ts +84 -0
- package/plugins/deslop-around/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/deslop-around/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/deslop-around/lib/utils/cache-manager.js +154 -0
- package/plugins/deslop-around/lib/utils/context-optimizer.js +115 -37
- package/plugins/deslop-around/lib/utils/deprecation.js +37 -0
- package/plugins/deslop-around/lib/utils/shell-escape.js +88 -0
- package/plugins/next-task/.claude-plugin/plugin.json +1 -1
- package/plugins/next-task/agents/delivery-validator.md +2 -2
- package/plugins/next-task/agents/implementation-agent.md +3 -4
- package/plugins/next-task/agents/planning-agent.md +77 -19
- package/plugins/next-task/agents/review-orchestrator.md +21 -122
- package/plugins/next-task/agents/task-discoverer.md +164 -23
- package/plugins/next-task/commands/next-task.md +180 -14
- package/plugins/next-task/lib/index.js +170 -0
- package/plugins/next-task/lib/patterns/review-patterns.js +58 -11
- package/plugins/next-task/lib/patterns/slop-patterns.js +169 -129
- package/plugins/next-task/lib/platform/detect-platform.js +162 -316
- package/plugins/next-task/lib/platform/detection-configs.js +93 -0
- package/plugins/next-task/lib/platform/state-dir.js +122 -0
- package/plugins/next-task/lib/platform/verify-tools.js +10 -78
- package/plugins/next-task/lib/schemas/README.md +195 -0
- package/plugins/next-task/lib/schemas/validator.js +247 -0
- package/plugins/next-task/lib/sources/custom-handler.js +199 -0
- package/plugins/next-task/lib/sources/policy-questions.js +239 -0
- package/plugins/next-task/lib/sources/source-cache.js +164 -0
- package/plugins/next-task/lib/state/workflow-state.js +387 -484
- package/plugins/next-task/lib/types/README.md +292 -0
- package/plugins/next-task/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/next-task/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/next-task/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/next-task/lib/types/index.d.ts +84 -0
- package/plugins/next-task/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/next-task/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/next-task/lib/utils/cache-manager.js +154 -0
- package/plugins/next-task/lib/utils/context-optimizer.js +115 -37
- package/plugins/next-task/lib/utils/deprecation.js +37 -0
- package/plugins/next-task/lib/utils/shell-escape.js +88 -0
- package/plugins/project-review/.claude-plugin/plugin.json +1 -1
- package/plugins/project-review/lib/index.js +170 -0
- package/plugins/project-review/lib/patterns/review-patterns.js +58 -11
- package/plugins/project-review/lib/patterns/slop-patterns.js +169 -129
- package/plugins/project-review/lib/platform/detect-platform.js +162 -316
- package/plugins/project-review/lib/platform/detection-configs.js +93 -0
- package/plugins/project-review/lib/platform/state-dir.js +122 -0
- package/plugins/project-review/lib/platform/verify-tools.js +10 -78
- package/plugins/project-review/lib/schemas/README.md +195 -0
- package/plugins/project-review/lib/schemas/validator.js +247 -0
- package/plugins/project-review/lib/sources/custom-handler.js +199 -0
- package/plugins/project-review/lib/sources/policy-questions.js +239 -0
- package/plugins/project-review/lib/sources/source-cache.js +164 -0
- package/plugins/project-review/lib/state/workflow-state.js +387 -484
- package/plugins/project-review/lib/types/README.md +292 -0
- package/plugins/project-review/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/project-review/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/project-review/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/project-review/lib/types/index.d.ts +84 -0
- package/plugins/project-review/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/project-review/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/project-review/lib/utils/cache-manager.js +154 -0
- package/plugins/project-review/lib/utils/context-optimizer.js +115 -37
- package/plugins/project-review/lib/utils/deprecation.js +37 -0
- package/plugins/project-review/lib/utils/shell-escape.js +88 -0
- package/plugins/reality-check/.claude-plugin/plugin.json +1 -1
- package/plugins/reality-check/agents/code-explorer.md +1 -1
- package/plugins/ship/.claude-plugin/plugin.json +1 -1
- package/plugins/ship/lib/index.js +170 -0
- package/plugins/ship/lib/patterns/review-patterns.js +58 -11
- package/plugins/ship/lib/patterns/slop-patterns.js +169 -129
- package/plugins/ship/lib/platform/detect-platform.js +162 -316
- package/plugins/ship/lib/platform/detection-configs.js +93 -0
- package/plugins/ship/lib/platform/state-dir.js +122 -0
- package/plugins/ship/lib/platform/verify-tools.js +10 -78
- package/plugins/ship/lib/schemas/README.md +195 -0
- package/plugins/ship/lib/schemas/validator.js +247 -0
- package/plugins/ship/lib/sources/custom-handler.js +199 -0
- package/plugins/ship/lib/sources/policy-questions.js +239 -0
- package/plugins/ship/lib/sources/source-cache.js +164 -0
- package/plugins/ship/lib/state/workflow-state.js +387 -484
- package/plugins/ship/lib/types/README.md +292 -0
- package/plugins/ship/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/ship/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/ship/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/ship/lib/types/index.d.ts +84 -0
- package/plugins/ship/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/ship/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/ship/lib/utils/cache-manager.js +154 -0
- package/plugins/ship/lib/utils/context-optimizer.js +115 -37
- package/plugins/ship/lib/utils/deprecation.js +37 -0
- package/plugins/ship/lib/utils/shell-escape.js +88 -0
- package/scripts/install/codex.sh +216 -72
- package/scripts/install/opencode.sh +197 -21
- package/lib/state/workflow-state.schema.json +0 -282
- package/plugins/deslop-around/lib/state/workflow-state.schema.json +0 -282
- package/plugins/next-task/agents/policy-selector.md +0 -248
- package/plugins/next-task/lib/state/tasks-registry.schema.json +0 -85
- package/plugins/next-task/lib/state/workflow-state.schema.json +0 -282
- package/plugins/next-task/lib/state/worktree-status.schema.json +0 -219
- package/plugins/project-review/lib/state/workflow-state.schema.json +0 -282
- 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
|
+
};
|