diff --git a/.gitignore b/.gitignore index a76e85f6..39381e5d 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ test-project-install/* sample-project/* flattened-codebase.xml *.stats.md +.next-context.json diff --git a/README.md b/README.md index d6b84935..cb6f6c3b 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,54 @@ NEXT-METHOD is an intelligent wrapper around BMAD-METHOD that provides an iterative, guided development experience. Instead of manually choosing which tasks or commands to run, you simply type `next` repeatedly, and the system intelligently suggests and executes the next appropriate step. +## 🧠 The Philosophy of "Next": Beyond Vanilla BMAD + +### The Evolution from Method + +The choice of "Next Method" over vanilla BMAD method represents a fundamental philosophical shift in how we approach AI-driven development. While BMAD (Brainstorming, Modeling, Analysis, and Development) provides a robust framework for systematic software creation, it operates within the traditional paradigm of explicit choice and conscious decision-making. + +### The Paradox of Choice in Development + +Vanilla BMAD method, despite its sophistication, presents developers with what psychologists call "the paradox of choice" - an overwhelming array of possibilities that can lead to decision paralysis. When every task, every workflow, every architectural decision requires explicit selection, the cognitive load becomes a barrier to flow state and creative momentum. + +### The Emergence of Flow Through Iteration + +"Next Method" embodies the philosophical principle that true creativity emerges not from perfect planning, but from continuous iteration and contextual awareness. By removing the burden of choice and replacing it with intelligent suggestion, we create a development environment where: + +- **Flow State Flourishes**: Developers can maintain deep focus without context-switching between decision-making and execution +- **Emergent Intelligence Arises**: The system's suggestions become more sophisticated as context accumulates, creating a form of collective intelligence +- **Serendipity is Amplified**: Unexpected connections and insights emerge through the iterative process rather than upfront planning + +### The Zen of "Just Next" + +The name "Next" carries profound philosophical weight. It represents: + +1. **Present-Moment Focus**: Unlike comprehensive planning that spans the entire project lifecycle, "Next" keeps us anchored in the current moment +2. **Trust in Emergence**: It embodies the belief that the right path reveals itself through iteration, not through exhaustive upfront analysis +3. **Simplicity as Sophistication**: The reduction to a single command represents the highest form of complexity management - making the complex simple + +### Beyond Method: The Meta-Method + +"Next Method" is not merely a method; it's a meta-method that transcends the traditional boundaries of development methodology. It represents: + +- **Methodological Evolution**: Moving from static frameworks to adaptive, context-aware systems +- **Cognitive Enhancement**: Augmenting human decision-making rather than replacing it +- **Emergent Architecture**: Allowing system design to emerge organically through iterative development + +### The Philosophical Foundation + +This approach is grounded in several philosophical traditions: + +- **Pragmatism**: Truth and value emerge through action and iteration, not through abstract reasoning +- **Process Philosophy**: Reality is fundamentally processual and emergent, not static and predetermined +- **Complexity Theory**: Complex systems exhibit emergent properties that cannot be predicted from their components alone + +### Why Not Vanilla BMAD? + +Vanilla BMAD method, while excellent, represents the culmination of 20th-century software engineering thinking - comprehensive, systematic, and deterministic. "Next Method" represents 21st-century thinking - adaptive, emergent, and contextually intelligent. + +The difference is not in capability but in philosophy: vanilla BMAD gives you all the tools and asks you to choose wisely; "Next Method" gives you the next tool and trusts that wisdom emerges through use. + ## šŸš€ Quick Start ```bash @@ -13,6 +61,11 @@ npm install -g next-method # Or use npx npx next-method install +# Initialize a new project +start +# or +init + # Start the iterative development process next ``` @@ -48,6 +101,7 @@ next --auto ## šŸ“‹ Available Commands ### Core Commands +- `start` or `init` - Initialize a new Next Method project or reset existing project - `next` - Get next suggested action and execute it - `next --auto` - Automatically execute the most logical next step - `next --suggest` - Show all available next steps without executing @@ -59,6 +113,7 @@ next --auto - `next update` - Update existing BMAD installation (wraps bmad update) ### NPM Scripts +- `npm run start` or `npm run init` - Initialize a new Next Method project - `npm run next` - Run the next command locally - `npm run next:auto` - Auto-execute next step - `npm run next:suggest` - Show suggestions only @@ -128,12 +183,19 @@ NEXT-METHOD creates a `.next-context.json` file in your project directory to mai cd your-project ``` -3. **Start the iterative process:** +3. **Initialize the project:** + ```bash + start + # or + init + ``` + +4. **Start the iterative process:** ```bash next ``` -4. **Keep going:** +5. **Keep going:** ```bash next next diff --git a/package.json b/package.json index 96b03e46..aae806a1 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,8 @@ "next": "node tools/installer/bin/next.js", "next:auto": "node tools/installer/bin/next.js next --auto", "next:suggest": "node tools/installer/bin/next.js next --suggest", + "start": "node tools/installer/bin/next.js start", + "init": "node tools/installer/bin/next.js start", "build": "node tools/cli.js build", "build:agents": "node tools/cli.js build --agents-only", "build:teams": "node tools/cli.js build --teams-only", diff --git a/tools/installer/bin/next.js b/tools/installer/bin/next.js index 069ab603..b26e0da5 100644 --- a/tools/installer/bin/next.js +++ b/tools/installer/bin/next.js @@ -249,6 +249,152 @@ program } }); +program + .command('start') + .description('Initialize a new Next Method project or reset existing project') + .option('-f, --force', 'Force reset even if project already exists') + .option('-t, --type ', 'Specify project type (greenfield/brownfield)') + .action(async (options) => { + try { + console.log(chalk.blue('šŸš€ Initializing Next Method project...')); + + // Check if project already exists + if (nextContext.context.projectType && !options.force) { + const { confirmReset } = await inquirer.prompt([ + { + type: 'confirm', + name: 'confirmReset', + message: 'Project already exists. Do you want to reset and start over?', + default: false + } + ]); + + if (!confirmReset) { + console.log(chalk.yellow('Project initialization cancelled.')); + return; + } + } + + // Reset context + nextContext.updateContext({ + currentPhase: 'start', + projectType: null, + lastAction: null, + suggestions: [], + history: [], + metadata: {} + }); + + // Detect or set project type + let projectType = options.type; + if (!projectType) { + const { detectedType } = await detectProjectType(); + projectType = detectedType; + } + + // Update context with detected type + nextContext.updateContext({ projectType }); + + // Add to history + nextContext.addToHistory('start', { + status: 'project_initialized', + type: projectType, + timestamp: new Date().toISOString() + }); + + console.log(chalk.green(`āœ… Project initialized successfully!`)); + console.log(chalk.cyan(` Project Type: ${projectType}`)); + console.log(chalk.cyan(` Current Phase: start`)); + + // Show next suggestions + const suggestions = nextContext.getNextSuggestions(); + if (suggestions.length > 0) { + console.log(chalk.blue('\nšŸ’” Next suggested steps:')); + suggestions.slice(0, 3).forEach((s, index) => { + console.log(chalk.cyan(` ${index + 1}. ${s.title}`)); + }); + console.log(chalk.gray('\nRun "next" to continue or "next --suggest" to see all options')); + } + + } catch (error) { + console.error(chalk.red('Project initialization failed:'), error.message); + process.exit(1); + } + }); + +program + .command('init') + .description('Initialize a new Next Method project or reset existing project') + .option('-f, --force', 'Force reset even if project already exists') + .option('-t, --type ', 'Specify project type (greenfield/brownfield)') + .action(async (options) => { + try { + console.log(chalk.blue('šŸš€ Initializing Next Method project...')); + + // Check if project already exists + if (nextContext.context.projectType && !options.force) { + const { confirmReset } = await inquirer.prompt([ + { + type: 'confirm', + name: 'confirmReset', + message: 'Project already exists. Do you want to reset and start over?', + default: false + } + ]); + + if (!confirmReset) { + console.log(chalk.yellow('Project initialization cancelled.')); + return; + } + } + + // Reset context + nextContext.updateContext({ + currentPhase: 'start', + projectType: null, + lastAction: null, + suggestions: [], + history: [], + metadata: {} + }); + + // Detect or set project type + let projectType = options.type; + if (!projectType) { + const { detectedType } = await detectProjectType(); + projectType = detectedType; + } + + // Update context with detected type + nextContext.updateContext({ projectType }); + + // Add to history + nextContext.addToHistory('start', { + status: 'project_initialized', + type: projectType, + timestamp: new Date().toISOString() + }); + + console.log(chalk.green(`āœ… Project initialized successfully!`)); + console.log(chalk.cyan(` Project Type: ${projectType}`)); + console.log(chalk.cyan(` Current Phase: start`)); + + // Show next suggestions + const suggestions = nextContext.getNextSuggestions(); + if (suggestions.length > 0) { + console.log(chalk.blue('\nšŸ’” Next suggested steps:')); + suggestions.slice(0, 3).forEach((s, index) => { + console.log(chalk.cyan(` ${index + 1}. ${s.title}`)); + }); + console.log(chalk.gray('\nRun "next" to continue or "next --suggest" to see all options')); + } + + } catch (error) { + console.error(chalk.red('Project initialization failed:'), error.message); + process.exit(1); + } + }); + async function executeSuggestion(suggestion) { console.log(chalk.green(`\nā–¶ļø Executing: ${suggestion.title}`)); @@ -332,6 +478,7 @@ async function detectProjectType() { return { type: projectType, + detectedType: projectType, files: files.filter(f => !f.startsWith('.') && !f.includes('node_modules')) }; }