Skip to content

Commit af76337

Browse files
authored
Merge pull request #55 from YagoBorba/feature/educational-mode-35
Feature/educational mode 35
2 parents c417de3 + 0778da7 commit af76337

33 files changed

Lines changed: 2187 additions & 29 deletions

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ StackCode is a suite of tools designed to work together seamlessly:
6161
Integrates seamlessly with Husky git hooks. The `stc validate` command ensures that no non-conventional commit ever makes it into your repository.
6262

6363
- ⚙️ **Flexible Configuration (`config`):**
64-
Manage global preferences (like language) and project-specific settings (like enabling commit validation) with a simple, interactive command.
64+
Manage global preferences (like language and educational mode) and project-specific settings (like enabling commit validation) with a simple, interactive command.
65+
66+
- 🎓 **Educational Mode (`--educate`):**
67+
**NEW!** Learn while you work. Enable educational mode to receive helpful explanations about best practices behind every action. Configure globally with `stc config set educate true` or use the `--educate` flag on any command for on-demand learning.
6568

6669
## 🛠️ Under the Hood (Main Technologies)
6770

@@ -102,6 +105,22 @@ This is the best approach for ensuring everyone on a project uses the exact same
102105
npx stc commit
103106
```
104107

108+
### 🎓 Enable Educational Mode (Recommended for Beginners)
109+
110+
StackCode can teach you best practices as you work. To enable educational explanations:
111+
112+
```bash
113+
# Enable educational mode globally (shows explanations on all commands)
114+
stc config set educate true
115+
116+
# Or use on-demand with any command
117+
stc validate "feat: new feature" --educate
118+
stc commit --educate
119+
stc init --educate
120+
```
121+
122+
Educational mode explains the "why" behind each action, making it perfect for learning DevOps best practices!
123+
105124
## 📚 Documentation
106125

107126
For detailed information about the project:

docs/ARCHITECTURE.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ StackCode follows a **modular monorepo architecture** with clear separation of c
5353
- **Command Layer:** Entry points for all CLI operations
5454
- **Command Handlers:** Individual command implementations
5555
- **Interactive Prompts:** User guidance and input collection
56+
- **Educational Mode:** Contextual learning system with best practice explanations
5657
- **Error Handling:** Consistent error reporting and recovery
5758

5859
**Architecture:**
@@ -61,14 +62,16 @@ StackCode follows a **modular monorepo architecture** with clear separation of c
6162
cli/
6263
├── src/
6364
│ ├── index.ts # Main CLI entry point
65+
│ ├── educational-mode.ts # Educational mode management
6466
│ ├── commands/ # Command implementations
6567
│ │ ├── init.ts # Project scaffolding
6668
│ │ ├── generate.ts # File generation
6769
│ │ ├── commit.ts # Conventional commits
6870
│ │ ├── git.ts # Git workflow management
6971
│ │ ├── release.ts # Version management
7072
│ │ ├── validate.ts # Commit validation
71-
│ │ └── config.ts # Configuration management
73+
│ │ ├── config.ts # Configuration management
74+
│ │ └── ui.ts # Interactive prompts and feedback
7275
│ └── types/ # CLI-specific type definitions
7376
└── test/ # Command tests
7477
```
@@ -402,6 +405,49 @@ const result = await validateStackDependencies("go");
402405
| `python` | `pip`, `python` ||
403406
| `node-js`, `node-ts`, `react`, `vue` | `npm` ||
404407

408+
## 🎓 Educational Mode Architecture
409+
410+
### Overview
411+
412+
The Educational Mode is a cross-cutting feature that enhances the user experience by providing contextual explanations and best practice guidance throughout the StackCode toolkit.
413+
414+
### Implementation
415+
416+
```typescript
417+
// Educational Mode Flow
418+
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
419+
│ User Command │ -> │ Mode Detection │ -> │ Show Messages │
420+
│ --educate or │ │ Global Config + │ │ Best Practices │
421+
│ global config │ │ Command Flag │ │ & Explanations │
422+
└─────────────────┘ └─────────────────┘ └─────────────────┘
423+
```
424+
425+
### Key Components
426+
427+
- **`educational-mode.ts`:** Core educational mode logic
428+
- `initEducationalMode()`: Detects configuration and command flags
429+
- `showEducationalMessage()`: Displays contextual tips
430+
- `showBestPractice()`: Shows best practice explanations
431+
- `showSecurityTip()`: Highlights security considerations
432+
433+
- **Configuration Integration:**
434+
- Global setting: `stackcode config set educate true/false`
435+
- Per-command flag: `--educate` on any command
436+
- Interactive setup via `stackcode config`
437+
438+
- **Message System:**
439+
- Internationalized explanations (PT/EN)
440+
- Fallback messages for reliability
441+
- Context-aware content based on command
442+
443+
### Educational Content Coverage
444+
445+
- **Project Initialization:** Explains scaffolding decisions and dependencies
446+
- **File Generation:** Describes purpose of .gitignore, README, etc.
447+
- **Git Workflows:** Explains conventional commits and version control benefits
448+
- **Security Practices:** Highlights importance of .gitignore for secrets
449+
- **Automation Benefits:** Shows value of Husky, CI/CD, and release automation
450+
405451
## 🚀 Deployment and Distribution
406452

407453
### NPM Packages

0 commit comments

Comments
 (0)