SuperCharge Claude Code v1.0.0 - Complete Customization Package
Features: - 30+ Custom Skills (cognitive, development, UI/UX, autonomous agents) - RalphLoop autonomous agent integration - Multi-AI consultation (Qwen) - Agent management system with sync capabilities - Custom hooks for session management - MCP servers integration - Plugin marketplace setup - Comprehensive installation script Components: - Skills: always-use-superpowers, ralph, brainstorming, ui-ux-pro-max, etc. - Agents: 100+ agents across engineering, marketing, product, etc. - Hooks: session-start-superpowers, qwen-consult, ralph-auto-trigger - Commands: /brainstorm, /write-plan, /execute-plan - MCP Servers: zai-mcp-server, web-search-prime, web-reader, zread - Binaries: ralphloop wrapper Installation: ./supercharge.sh
This commit is contained in:
47
plugins/claude-code-safety-net/src/index.ts
Normal file
47
plugins/claude-code-safety-net/src/index.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { Plugin } from '@opencode-ai/plugin';
|
||||
import { analyzeCommand, loadConfig } from './core/analyze.ts';
|
||||
import { envTruthy } from './core/env.ts';
|
||||
import { formatBlockedMessage } from './core/format.ts';
|
||||
import { loadBuiltinCommands } from './features/builtin-commands/index.ts';
|
||||
|
||||
export const SafetyNetPlugin: Plugin = async ({ directory }) => {
|
||||
const safetyNetConfig = loadConfig(directory);
|
||||
const strict = envTruthy('SAFETY_NET_STRICT');
|
||||
const paranoidAll = envTruthy('SAFETY_NET_PARANOID');
|
||||
const paranoidRm = paranoidAll || envTruthy('SAFETY_NET_PARANOID_RM');
|
||||
const paranoidInterpreters = paranoidAll || envTruthy('SAFETY_NET_PARANOID_INTERPRETERS');
|
||||
|
||||
return {
|
||||
config: async (opencodeConfig: Record<string, unknown>) => {
|
||||
const builtinCommands = loadBuiltinCommands();
|
||||
const existingCommands = (opencodeConfig.command as Record<string, unknown>) ?? {};
|
||||
|
||||
opencodeConfig.command = {
|
||||
...builtinCommands,
|
||||
...existingCommands,
|
||||
};
|
||||
},
|
||||
|
||||
'tool.execute.before': async (input, output) => {
|
||||
if (input.tool === 'bash') {
|
||||
const command = output.args.command;
|
||||
const result = analyzeCommand(command, {
|
||||
cwd: directory,
|
||||
config: safetyNetConfig,
|
||||
strict,
|
||||
paranoidRm,
|
||||
paranoidInterpreters,
|
||||
});
|
||||
if (result) {
|
||||
const message = formatBlockedMessage({
|
||||
reason: result.reason,
|
||||
command,
|
||||
segment: result.segment,
|
||||
});
|
||||
|
||||
throw new Error(message);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user