Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ StackCode is a suite of tools designed to work together seamlessly:
Integrates seamlessly with Husky git hooks. The `stc validate` command ensures that no non-conventional commit ever makes it into your repository.

- βš™οΈ **Flexible Configuration (`config`):**
Manage global preferences (like language) and project-specific settings (like enabling commit validation) with a simple, interactive command.
Manage global preferences (like language and educational mode) and project-specific settings (like enabling commit validation) with a simple, interactive command.

- πŸŽ“ **Educational Mode (`--educate`):**
**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.

## πŸ› οΈ Under the Hood (Main Technologies)

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

### πŸŽ“ Enable Educational Mode (Recommended for Beginners)

StackCode can teach you best practices as you work. To enable educational explanations:

```bash
# Enable educational mode globally (shows explanations on all commands)
stc config set educate true

# Or use on-demand with any command
stc validate "feat: new feature" --educate
stc commit --educate
stc init --educate
```

Educational mode explains the "why" behind each action, making it perfect for learning DevOps best practices!

## πŸ“š Documentation

For detailed information about the project:
Expand Down
48 changes: 47 additions & 1 deletion docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ StackCode follows a **modular monorepo architecture** with clear separation of c
- **Command Layer:** Entry points for all CLI operations
- **Command Handlers:** Individual command implementations
- **Interactive Prompts:** User guidance and input collection
- **Educational Mode:** Contextual learning system with best practice explanations
- **Error Handling:** Consistent error reporting and recovery

**Architecture:**
Expand All @@ -61,14 +62,16 @@ StackCode follows a **modular monorepo architecture** with clear separation of c
cli/
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ index.ts # Main CLI entry point
β”‚ β”œβ”€β”€ educational-mode.ts # Educational mode management
β”‚ β”œβ”€β”€ commands/ # Command implementations
β”‚ β”‚ β”œβ”€β”€ init.ts # Project scaffolding
β”‚ β”‚ β”œβ”€β”€ generate.ts # File generation
β”‚ β”‚ β”œβ”€β”€ commit.ts # Conventional commits
β”‚ β”‚ β”œβ”€β”€ git.ts # Git workflow management
β”‚ β”‚ β”œβ”€β”€ release.ts # Version management
β”‚ β”‚ β”œβ”€β”€ validate.ts # Commit validation
β”‚ β”‚ └── config.ts # Configuration management
β”‚ β”‚ β”œβ”€β”€ config.ts # Configuration management
β”‚ β”‚ └── ui.ts # Interactive prompts and feedback
β”‚ └── types/ # CLI-specific type definitions
└── test/ # Command tests
```
Expand Down Expand Up @@ -402,6 +405,49 @@ const result = await validateStackDependencies("go");
| `python` | `pip`, `python` | βœ… |
| `node-js`, `node-ts`, `react`, `vue` | `npm` | βœ… |

## πŸŽ“ Educational Mode Architecture

### Overview

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.

### Implementation

```typescript
// Educational Mode Flow
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ User Command β”‚ -> β”‚ Mode Detection β”‚ -> β”‚ Show Messages β”‚
β”‚ --educate or β”‚ β”‚ Global Config + β”‚ β”‚ Best Practices β”‚
β”‚ global config β”‚ β”‚ Command Flag β”‚ β”‚ & Explanations β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

### Key Components

- **`educational-mode.ts`:** Core educational mode logic
- `initEducationalMode()`: Detects configuration and command flags
- `showEducationalMessage()`: Displays contextual tips
- `showBestPractice()`: Shows best practice explanations
- `showSecurityTip()`: Highlights security considerations

- **Configuration Integration:**
- Global setting: `stackcode config set educate true/false`
- Per-command flag: `--educate` on any command
- Interactive setup via `stackcode config`

- **Message System:**
- Internationalized explanations (PT/EN)
- Fallback messages for reliability
- Context-aware content based on command

### Educational Content Coverage

- **Project Initialization:** Explains scaffolding decisions and dependencies
- **File Generation:** Describes purpose of .gitignore, README, etc.
- **Git Workflows:** Explains conventional commits and version control benefits
- **Security Practices:** Highlights importance of .gitignore for secrets
- **Automation Benefits:** Shows value of Husky, CI/CD, and release automation

## πŸš€ Deployment and Distribution

### NPM Packages
Expand Down
Loading