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:
61
plugins/examples/git-workflow/commands/smart-commit.ts
Normal file
61
plugins/examples/git-workflow/commands/smart-commit.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* Git Smart Commit Command
|
||||
* Creates intelligent commits with auto-staging and conventional commits
|
||||
*/
|
||||
|
||||
import { exec } from 'child_process'
|
||||
import { promisify } from 'util'
|
||||
|
||||
const execAsync = promisify(exec)
|
||||
|
||||
export interface SmartCommitOptions {
|
||||
message?: string
|
||||
type?: 'feat' | 'fix' | 'docs' | 'style' | 'refactor' | 'test' | 'chore'
|
||||
scope?: string
|
||||
stageAll?: boolean
|
||||
amend?: boolean
|
||||
}
|
||||
|
||||
export async function handle(
|
||||
args: SmartCommitOptions,
|
||||
context: any
|
||||
): Promise<string> {
|
||||
const { message, type = 'feat', scope, stageAll = true, amend = false } = args
|
||||
|
||||
try {
|
||||
// Stage files if requested
|
||||
if (stageAll && !amend) {
|
||||
await execAsync('git add -A')
|
||||
context.sandbox.log('Staged all changes')
|
||||
}
|
||||
|
||||
// Generate commit message if not provided
|
||||
let commitMessage = message
|
||||
|
||||
if (!commitMessage) {
|
||||
// Get diff to generate intelligent message
|
||||
const { stdout: diff } = await execAsync('git diff --cached --stat')
|
||||
|
||||
if (!diff || diff.trim().length === 0) {
|
||||
return 'No changes to commit'
|
||||
}
|
||||
|
||||
// Simple auto-generation based on diff
|
||||
commitMessage = `${type}${scope ? `(${scope})` : ''}: `
|
||||
commitMessage += 'update code based on changes'
|
||||
}
|
||||
|
||||
// Create commit
|
||||
const amendFlag = amend ? '--amend' : ''
|
||||
const { stdout } = await execAsync(
|
||||
`git commit ${amendFlag} -m "${commitMessage}"`
|
||||
)
|
||||
|
||||
return `✓ Committed successfully:\n${stdout}`
|
||||
} catch (error: any) {
|
||||
throw new Error(`Git commit failed: ${error.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
// Export for CLI usage
|
||||
export default { handle }
|
||||
Reference in New Issue
Block a user