@the-bearded-bear/claude-craft 3.0.2 → 3.1.0

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 (30) hide show
  1. package/Dev/i18n/de/Common/agents/ralph-conductor.md +146 -0
  2. package/Dev/i18n/de/Common/commands/ralph-run.md +171 -0
  3. package/Dev/i18n/de/Common/commands/setup-project-context.md +286 -0
  4. package/Dev/i18n/en/Common/agents/ralph-conductor.md +146 -0
  5. package/Dev/i18n/en/Common/commands/ralph-run.md +171 -0
  6. package/Dev/i18n/en/Common/commands/setup-project-context.md +286 -0
  7. package/Dev/i18n/es/Common/agents/ralph-conductor.md +146 -0
  8. package/Dev/i18n/es/Common/commands/ralph-run.md +171 -0
  9. package/Dev/i18n/es/Common/commands/setup-project-context.md +286 -0
  10. package/Dev/i18n/fr/Common/agents/ralph-conductor.md +146 -0
  11. package/Dev/i18n/fr/Common/commands/ralph-run.md +171 -0
  12. package/Dev/i18n/fr/Common/commands/setup-project-context.md +286 -0
  13. package/Dev/i18n/pt/Common/agents/ralph-conductor.md +146 -0
  14. package/Dev/i18n/pt/Common/commands/ralph-run.md +171 -0
  15. package/Dev/i18n/pt/Common/commands/setup-project-context.md +286 -0
  16. package/Tools/Ralph/README.md +303 -0
  17. package/Tools/Ralph/lib/checkpoint.sh +238 -0
  18. package/Tools/Ralph/lib/circuit-breaker.sh +172 -0
  19. package/Tools/Ralph/lib/dod-validator.sh +306 -0
  20. package/Tools/Ralph/lib/loop.sh +232 -0
  21. package/Tools/Ralph/lib/session.sh +234 -0
  22. package/Tools/Ralph/ralph.sh +491 -0
  23. package/Tools/Ralph/templates/ralph.yml.template +178 -0
  24. package/Tools/i18n/ralph/de.sh +147 -0
  25. package/Tools/i18n/ralph/en.sh +147 -0
  26. package/Tools/i18n/ralph/es.sh +147 -0
  27. package/Tools/i18n/ralph/fr.sh +147 -0
  28. package/Tools/i18n/ralph/pt.sh +147 -0
  29. package/cli/index.js +90 -0
  30. package/package.json +1 -1
@@ -0,0 +1,147 @@
1
+ #!/bin/bash
2
+ # =============================================================================
3
+ # Ralph Wiggum - Mensagens em Portugues
4
+ # =============================================================================
5
+
6
+ # Header
7
+ MSG_HEADER="Ralph Wiggum - Loop Continuo de Agente IA"
8
+ MSG_VERSION="Versao"
9
+
10
+ # Status
11
+ MSG_ITERATION="Iteracao"
12
+ MSG_OF="de"
13
+ MSG_SESSION="Sessao"
14
+ MSG_STATUS="Status"
15
+ MSG_RUNNING="Executando"
16
+ MSG_COMPLETE="Completo"
17
+ MSG_FAILED="Falhou"
18
+ MSG_TIMEOUT="Tempo esgotado"
19
+ MSG_CIRCUIT_BREAKER="Disjuntor"
20
+
21
+ # Session
22
+ MSG_SESSION_CREATED="Sessao criada"
23
+ MSG_SESSION_RESUMED="Sessao retomada"
24
+ MSG_SESSION_ID="ID da sessao"
25
+ MSG_SESSION_NOT_FOUND="Sessao nao encontrada"
26
+ MSG_SESSION_DIR="Diretorio da sessao"
27
+
28
+ # Loop
29
+ MSG_STARTING_LOOP="Iniciando loop Ralph"
30
+ MSG_PROMPT="Prompt"
31
+ MSG_INVOKING_CLAUDE="Invocando Claude..."
32
+ MSG_WAITING="Aguardando"
33
+ MSG_SECONDS="segundos"
34
+ MSG_LOOP_COMPLETE="Loop completo"
35
+ MSG_LOOP_STOPPED="Loop parado"
36
+
37
+ # Definition of Done
38
+ MSG_DOD_TITLE="Definition of Done"
39
+ MSG_DOD_CHECKING="Verificando criterios DoD..."
40
+ MSG_DOD_PASSED="DoD APROVADO"
41
+ MSG_DOD_FAILED="DoD NAO COMPLETO"
42
+ MSG_DOD_ITEM_PASSED="OK"
43
+ MSG_DOD_ITEM_FAILED="FALHA"
44
+ MSG_DOD_ITEM_SKIPPED="IGNORADO"
45
+ MSG_DOD_REQUIRED="Obrigatorio"
46
+ MSG_DOD_OPTIONAL="Opcional"
47
+ MSG_DOD_ALL_REQUIRED_PASSED="Todos os criterios obrigatorios aprovados!"
48
+ MSG_DOD_MISSING_REQUIRED="Criterios obrigatorios faltando:"
49
+ MSG_DOD_HUMAN_GATE="Validacao humana"
50
+ MSG_DOD_HUMAN_PROMPT="Parece correto? (s/n):"
51
+
52
+ # Validators
53
+ MSG_VALIDATOR_COMMAND="Executando comando"
54
+ MSG_VALIDATOR_OUTPUT="Verificando padrao de saida"
55
+ MSG_VALIDATOR_FILE="Verificando alteracoes de arquivos"
56
+ MSG_VALIDATOR_HOOK="Executando hook"
57
+ MSG_VALIDATOR_HUMAN="Aguardando validacao humana"
58
+
59
+ # Circuit Breaker
60
+ MSG_CB_TRIGGERED="Disjuntor acionado"
61
+ MSG_CB_NO_CHANGES="Sem alteracoes de arquivos por"
62
+ MSG_CB_ITERATIONS="iteracoes"
63
+ MSG_CB_REPEATED_ERRORS="Erros repetidos detectados"
64
+ MSG_CB_OUTPUT_DECLINE="Saida reduzida em"
65
+ MSG_CB_PERCENT="porcento"
66
+ MSG_CB_MAX_REACHED="Maximo de iteracoes atingido"
67
+ MSG_CB_RESET="Disjuntor reiniciado"
68
+
69
+ # Checkpointing
70
+ MSG_CHECKPOINT_CREATING="Criando checkpoint..."
71
+ MSG_CHECKPOINT_CREATED="Checkpoint criado"
72
+ MSG_CHECKPOINT_RESTORING="Restaurando de checkpoint..."
73
+ MSG_CHECKPOINT_RESTORED="Checkpoint restaurado"
74
+ MSG_CHECKPOINT_BRANCH="Branch de checkpoint"
75
+ MSG_CHECKPOINT_COMMIT="Commit"
76
+ MSG_CHECKPOINT_FAILED="Falha no checkpoint"
77
+
78
+ # Configuration
79
+ MSG_CONFIG_LOADING="Carregando configuracao..."
80
+ MSG_CONFIG_LOADED="Configuracao carregada"
81
+ MSG_CONFIG_NOT_FOUND="Arquivo de configuracao nao encontrado"
82
+ MSG_CONFIG_USING_DEFAULTS="Usando configuracao padrao"
83
+ MSG_CONFIG_INVALID="Configuracao invalida"
84
+ MSG_CONFIG_CREATED="Configuracao criada"
85
+
86
+ # Output
87
+ MSG_OUTPUT_LOG="Arquivo de log"
88
+ MSG_OUTPUT_METRICS="Arquivo de metricas"
89
+ MSG_OUTPUT_WRITING="Escrevendo saida..."
90
+ MSG_OUTPUT_SAVED="Saida salva"
91
+
92
+ # Errors
93
+ MSG_ERROR="Erro"
94
+ MSG_ERROR_CLAUDE_NOT_FOUND="Comando claude nao encontrado"
95
+ MSG_ERROR_NO_PROMPT="Nenhum prompt fornecido"
96
+ MSG_ERROR_INVALID_SESSION="Sessao invalida"
97
+ MSG_ERROR_TIMEOUT="Operacao expirou"
98
+ MSG_ERROR_VALIDATION="Erro de validacao"
99
+ MSG_ERROR_GIT_NOT_FOUND="Git nao encontrado (necessario para checkpointing)"
100
+ MSG_ERROR_JQ_NOT_FOUND="jq nao encontrado (necessario para parsing JSON)"
101
+ MSG_ERROR_YQ_NOT_FOUND="yq nao encontrado (necessario para parsing YAML)"
102
+
103
+ # Summary
104
+ MSG_SUMMARY_TITLE="Resumo da sessao"
105
+ MSG_SUMMARY_ITERATIONS="Total de iteracoes"
106
+ MSG_SUMMARY_DURATION="Duracao"
107
+ MSG_SUMMARY_DOD_STATUS="Status DoD"
108
+ MSG_SUMMARY_FILES_CHANGED="Arquivos alterados"
109
+ MSG_SUMMARY_EXIT_REASON="Motivo da saida"
110
+
111
+ # Help
112
+ MSG_HELP_USAGE="Uso"
113
+ MSG_HELP_DESCRIPTION="Executar Claude em loop continuo ate completar a tarefa"
114
+ MSG_HELP_OPTIONS="Opcoes"
115
+ MSG_HELP_PROMPT="O prompt da tarefa para Claude"
116
+ MSG_HELP_CONFIG="Caminho para arquivo ralph.yml"
117
+ MSG_HELP_CONTINUE="Retomar sessao existente"
118
+ MSG_HELP_MAX_ITER="Iteracoes maximas (padrao: 25)"
119
+ MSG_HELP_VERBOSE="Ativar saida verbosa"
120
+ MSG_HELP_DRY_RUN="Mostrar o que seria feito sem executar"
121
+ MSG_HELP_LANG="Idioma (en, fr, es, de, pt)"
122
+ MSG_HELP_HELP="Mostrar esta mensagem de ajuda"
123
+ MSG_HELP_EXAMPLES="Exemplos"
124
+ MSG_HELP_EXAMPLE_BASIC="Uso basico com prompt"
125
+ MSG_HELP_EXAMPLE_CONFIG="Com arquivo de configuracao"
126
+ MSG_HELP_EXAMPLE_RESUME="Retomar sessao anterior"
127
+
128
+ # Menu (if interactive)
129
+ MSG_MENU_TITLE="O que deseja fazer?"
130
+ MSG_MENU_START="Iniciar nova sessao Ralph"
131
+ MSG_MENU_RESUME="Retomar sessao existente"
132
+ MSG_MENU_LIST="Listar sessoes"
133
+ MSG_MENU_CONFIG="Criar configuracao"
134
+ MSG_MENU_HELP="Ajuda"
135
+ MSG_MENU_QUIT="Sair"
136
+
137
+ # Misc
138
+ MSG_PRESS_ENTER="Pressione Enter para continuar..."
139
+ MSG_YES="sim"
140
+ MSG_NO="nao"
141
+ MSG_CANCEL="Cancelado"
142
+ MSG_GOODBYE="Adeus!"
143
+ MSG_INVALID_CHOICE="Escolha invalida"
144
+ MSG_CONFIRM="Confirmar"
145
+ MSG_WARNING="Aviso"
146
+ MSG_INFO="Info"
147
+ MSG_SUCCESS="Sucesso"
package/cli/index.js CHANGED
@@ -134,6 +134,7 @@ ${c.bold}Commands:${c.reset}
134
134
  ${c.green}install <path>${c.reset} Install to specific directory
135
135
  ${c.green}init${c.reset} Initialize workflow in current project
136
136
  ${c.green}flatten${c.reset} Generate flattened codebase summary
137
+ ${c.green}ralph${c.reset} Run Ralph Wiggum continuous loop
137
138
  ${c.green}help${c.reset} Show this help message
138
139
 
139
140
  ${c.bold}Options:${c.reset}
@@ -157,6 +158,9 @@ ${c.bold}Examples:${c.reset}
157
158
  ${c.dim}# Flatten codebase for context${c.reset}
158
159
  npx @the-bearded-bear/claude-craft flatten --output=context.md
159
160
 
161
+ ${c.dim}# Run Ralph continuous loop${c.reset}
162
+ npx @the-bearded-bear/claude-craft ralph "Implement user authentication"
163
+
160
164
  ${c.bold}Technologies:${c.reset}
161
165
  ${Object.entries(TECHNOLOGIES).map(([key, val]) => ` ${c.cyan}${key.padEnd(12)}${c.reset} ${val.desc}`).join('\n')}
162
166
 
@@ -485,6 +489,10 @@ ${c.bold}Documentation:${c.reset}
485
489
  await this.flattenCodebase(options);
486
490
  break;
487
491
 
492
+ case 'ralph':
493
+ await this.runRalph(args.slice(1), options);
494
+ break;
495
+
488
496
  case 'help':
489
497
  case '--help':
490
498
  case '-h':
@@ -517,6 +525,88 @@ ${c.bold}Documentation:${c.reset}
517
525
  const flattener = require('./flattener');
518
526
  await flattener.flatten(targetPath, outputFile, options);
519
527
  }
528
+
529
+ // Run Ralph Wiggum continuous loop
530
+ async runRalph(args, options) {
531
+ this.printBanner();
532
+ console.log(`${c.bold}Ralph Wiggum - Continuous AI Agent Loop${c.reset}\n`);
533
+
534
+ // Build ralph.sh path
535
+ const ralphScript = path.join(CLI_ROOT, 'Tools', 'Ralph', 'ralph.sh');
536
+
537
+ // Check if script exists
538
+ if (!fs.existsSync(ralphScript)) {
539
+ console.log(`${c.red}Error: Ralph script not found at ${ralphScript}${c.reset}`);
540
+ console.log(`${c.yellow}Make sure you have the full claude-craft installation.${c.reset}`);
541
+ process.exit(1);
542
+ }
543
+
544
+ // Build command arguments
545
+ const ralphArgs = [];
546
+
547
+ // Add language if specified
548
+ if (options.lang) {
549
+ ralphArgs.push(`--lang=${options.lang}`);
550
+ }
551
+
552
+ // Add config if specified
553
+ if (options.config) {
554
+ ralphArgs.push(`--config=${options.config}`);
555
+ }
556
+
557
+ // Add continue if specified
558
+ if (options.continue) {
559
+ ralphArgs.push(`--continue=${options.continue}`);
560
+ }
561
+
562
+ // Add max-iterations if specified
563
+ if (options['max-iterations']) {
564
+ ralphArgs.push(`--max-iterations=${options['max-iterations']}`);
565
+ }
566
+
567
+ // Add verbose if specified
568
+ if (options.verbose) {
569
+ ralphArgs.push('--verbose');
570
+ }
571
+
572
+ // Add dry-run if specified
573
+ if (options['dry-run']) {
574
+ ralphArgs.push('--dry-run');
575
+ }
576
+
577
+ // Add remaining positional arguments (the prompt)
578
+ const promptArgs = args.filter(arg => !arg.startsWith('--'));
579
+ if (promptArgs.length > 0) {
580
+ ralphArgs.push(promptArgs.join(' '));
581
+ }
582
+
583
+ console.log(`${c.dim}Running: bash ${ralphScript} ${ralphArgs.join(' ')}${c.reset}\n`);
584
+
585
+ // Execute ralph.sh
586
+ try {
587
+ const ralph = spawn('bash', [ralphScript, ...ralphArgs], {
588
+ stdio: 'inherit',
589
+ cwd: this.config.targetPath,
590
+ });
591
+
592
+ ralph.on('close', (code) => {
593
+ if (code === 0) {
594
+ console.log(`\n${c.green}Ralph session completed successfully.${c.reset}`);
595
+ } else {
596
+ console.log(`\n${c.yellow}Ralph session ended with code ${code}.${c.reset}`);
597
+ }
598
+ process.exit(code);
599
+ });
600
+
601
+ ralph.on('error', (err) => {
602
+ console.error(`${c.red}Failed to start Ralph: ${err.message}${c.reset}`);
603
+ process.exit(1);
604
+ });
605
+ } catch (error) {
606
+ console.error(`${c.red}Error running Ralph: ${error.message}${c.reset}`);
607
+ process.exit(1);
608
+ }
609
+ }
520
610
  }
521
611
 
522
612
  // Run CLI
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-bearded-bear/claude-craft",
3
- "version": "3.0.2",
3
+ "version": "3.1.0",
4
4
  "description": "A comprehensive framework for AI-assisted development with Claude Code. Install standardized rules, agents, and commands for your projects.",
5
5
  "main": "cli/index.js",
6
6
  "bin": {