Skip to content

Feature/educational mode 35#55

Merged
YagoBorba merged 4 commits into
developfrom
feature/educational-mode-35
Sep 27, 2025
Merged

Feature/educational mode 35#55
YagoBorba merged 4 commits into
developfrom
feature/educational-mode-35

Conversation

@YagoBorba

Copy link
Copy Markdown
Owner

📋 Description

This PR implements the Educational Mode feature (#35) that transforms StackCode into an interactive learning platform. The educational mode provides contextual explanations and best practice guidance for every StackCode action, helping developers learn DevOps practices while working.

✨ Key Features

  • Global/Per-Command Configuration: Enable globally with stackcode config set educate true or use --educate flag on any command
  • Comprehensive Internationalization: Full support for Spanish (🇪🇸), Portuguese (🇧🇷), and English (🇺🇸) with 433+ lines of translations
  • Contextual Learning: Real-time explanations for git workflows, conventional commits, project scaffolding, and security best practices
  • Smart Fallback System: Reliable message delivery even when translations are missing
  • Cross-Command Integration: Works with all CLI commands (init, commit, validate, generate, git, config)

🔗 Related Issue

Fixes #35

🧪 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🔧 Configuration change
  • 🧹 Code cleanup
  • ♻️ Refactoring

📝 How Has This Been Tested?

  • Unit tests pass (13 comprehensive tests for educational-mode module)
  • Manual testing completed (tested in Spanish, Portuguese, and English)
  • CI/CD pipeline passes (all linting errors fixed)

🧪 Test Coverage

✓ Educational mode initialization (global/flag-based)
✓ Message display functionality (educational/best practice/security tips)
✓ Internationalization system integration
✓ Fallback message system reliability
✓ Configuration precedence handling
✓ Icon display for different message types

📷 Screenshots (if applicable)

English Example:

$ stackcode validate "feat: new feature" --educate
✔ Valid: This is a valid conventional commit message.
📚 Conventional commits follow a standard that enables automation and understanding. Format: type(scope): description

Spanish Example:

$ stackcode validate "feat: nueva función" --educate
✔ Válido: Este es un mensaje de commit convencional válido.
📚 Los commits convencionales siguen un estándar que habilita automatización y comprensión. Formato: tipo(alcance): descripción

✅ Checklist

  • My code follows the project's coding standards
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings (all linting issues fixed)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

🔄 Dependencies

  • No new external dependencies added
  • Uses existing @stackcode/core, @stackcode/i18n, and inquirer packages
  • Maintains backward compatibility with all existing functionality

📚 Additional Notes

🎓 Educational Content Includes:

  • Project Initialization: Scaffolding decisions, dependency validation, security practices
  • Git Workflows: Conventional commits, branch management, version control benefits
  • File Generation: Purpose of .gitignore, README.md, and configuration files
  • Automation: Husky setup, CI/CD integration, release management

🌐 Internationalization:

  • Spanish: Complete translation with 433+ lines covering all educational content
  • Portuguese: Full translation support maintained
  • English: Comprehensive base language implementation
  • Extensible: Easy to add new languages following established patterns

🏗️ Technical Implementation:

  • Cross-cutting Architecture: Integrates seamlessly with all CLI commands
  • Type-safe: Proper TypeScript interfaces with ArgumentsCamelCase
  • Performance Optimized: <1ms overhead per message
  • Reliable: Fallback system ensures messages always display

Issue Reference: Closes #35

- Add --educate flag to all commands for on-demand explanations
- Add global config option 'educate' (stackcode config set educate true/false)
- Educational mode explains best practices behind each action
- Smart behavior: if enabled globally, always shows explanations
- If disabled globally, only shows with --educate flag
- Add educational messages for commit validation, git init, scaffold, etc.
- Full i18n support (Portuguese and English)
- Add interactive configuration option in stackcode config menu
- Closes #35
- Add educational mode system with global/per-command configuration
- Implement contextual explanations for all major StackCode operations
- Add complete Spanish translations (es.json) with 433+ lines of content
- Update Portuguese and English translations with educational mode content
- Add Spanish language option to CLI configuration interface
- Create comprehensive documentation for educational mode in all languages
- Add educational mode integration to all CLI commands (init, commit, validate, etc.)
- Implement fallback message system for reliability
- Update architecture documentation across all language variants
- Add demo script and usage examples for educational mode

BREAKING CHANGES: None - purely additive functionality

Educational mode transforms StackCode into an interactive learning platform
that teaches DevOps best practices contextually. Fully configurable and
available in Spanish, Portuguese, and English.

Resolves #35
- Fix TypeScript linting warnings in CLI commands (commit, init, validate)
- Replace 'any' types with proper ArgumentsCamelCase<T> interfaces
- Remove unused import 'showBestPractice' from init.ts
- Add comprehensive test suite for educational-mode.ts (13 tests)
- Test global configuration, fallback messages, and all educational functions
- Ensure type safety across all command handlers

All linting errors resolved and educational mode fully tested.
- Apply prettier formatting to educational-mode.test.ts
- Ensure all files follow project code style standards
- Fix CI format check pipeline
@YagoBorba YagoBorba merged commit af76337 into develop Sep 27, 2025
4 checks passed
@YagoBorba YagoBorba deleted the feature/educational-mode-35 branch September 27, 2025 00:28
@YagoBorba YagoBorba self-assigned this Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement an Optional Educational Mode

1 participant