bmad-method 4.14.0 → 4.14.1

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.
@@ -494,385 +494,313 @@ Generate comprehensive documentation for existing projects optimized for AI deve
494
494
 
495
495
  ### 1. Initial Project Analysis
496
496
 
497
- [[LLM: Begin by conducting a comprehensive analysis of the existing project. Use available tools to:
497
+ [[LLM: First, check if a PRD or requirements document exists in context. If yes, use it to focus your documentation efforts on relevant areas only.
498
498
 
499
- 1. **Project Structure Discovery**: Examine the root directory structure, identify main folders, and understand the overall organization
500
- 2. **Technology Stack Identification**: Look for package.json, requirements.txt, Cargo.toml, pom.xml, etc. to identify languages, frameworks, and dependencies
501
- 3. **Build System Analysis**: Find build scripts, CI/CD configurations, and development commands
502
- 4. **Existing Documentation Review**: Check for README files, docs folders, and any existing documentation
503
- 5. **Code Pattern Analysis**: Sample key files to understand coding patterns, naming conventions, and architectural approaches
504
-
505
- Ask the user these elicitation questions to better understand their needs:
506
-
507
- - What is the primary purpose of this project?
508
- - Are there any specific areas of the codebase that are particularly complex or important for agents to understand?
509
- - What types of tasks do you expect AI agents to perform on this project? (e.g., bug fixes, feature additions, refactoring, testing)
510
- - Are there any existing documentation standards or formats you prefer?
511
- - What level of technical detail should the documentation target? (junior developers, senior developers, mixed team)
512
- ]]
513
-
514
- ### 2. Core Documentation Generation
515
-
516
- [[LLM: Based on your analysis, generate the following core documentation files. Adapt the content and structure to match the specific project type and context you discovered:
517
-
518
- **Core Documents (always generate):**
519
-
520
- 1. **docs/index.md** - Master documentation index
521
- 2. **docs/architecture/index.md** - Architecture documentation index
522
- 3. **docs/architecture/coding-standards.md** - Coding conventions and style guidelines
523
- 4. **docs/architecture/tech-stack.md** - Technology stack and version constraints
524
- 5. **docs/architecture/unified-project-structure.md** - Project structure and organization
525
- 6. **docs/architecture/testing-strategy.md** - Testing approaches and requirements
526
-
527
- **Backend Documents (generate for backend/full-stack projects):**
528
-
529
- 7. **docs/architecture/backend-architecture.md** - Backend service patterns and structure
530
- 8. **docs/architecture/rest-api-spec.md** - API endpoint specifications
531
- 9. **docs/architecture/data-models.md** - Data structures and validation rules
532
- 10. **docs/architecture/database-schema.md** - Database design and relationships
533
- 11. **docs/architecture/external-apis.md** - Third-party integrations
499
+ **IF PRD EXISTS**:
534
500
 
535
- **Frontend Documents (generate for frontend/full-stack projects):**
501
+ - Review the PRD to understand what enhancement/feature is planned
502
+ - Identify which modules, services, or areas will be affected
503
+ - Focus documentation ONLY on these relevant areas
504
+ - Skip unrelated parts of the codebase to keep docs lean
536
505
 
537
- 12. **docs/architecture/frontend-architecture.md** - Frontend patterns and structure
538
- 13. **docs/architecture/components.md** - UI component specifications
539
- 14. **docs/architecture/core-workflows.md** - User interaction flows
540
- 15. **docs/architecture/ui-ux-spec.md** - UI/UX specifications and guidelines
506
+ **IF NO PRD EXISTS**:
507
+ Ask the user:
541
508
 
542
- **Additional Documents (generate if applicable):**
509
+ "I notice you haven't provided a PRD or requirements document. To create more focused and useful documentation, I recommend one of these options:
543
510
 
544
- 16. **docs/prd.md** - Product requirements document (if not exists)
545
- 17. **docs/architecture/deployment-guide.md** - Deployment and operations info
546
- 18. **docs/architecture/security-considerations.md** - Security patterns and requirements
547
- 19. **docs/architecture/performance-guidelines.md** - Performance optimization patterns
511
+ 1. **Create a PRD first** - Would you like me to help create a brownfield PRD before documenting? This helps focus documentation on relevant areas.
548
512
 
549
- **Optional Enhancement Documents:**
513
+ 2. **Provide existing requirements** - Do you have a requirements document, epic, or feature description you can share?
550
514
 
551
- 20. **docs/architecture/troubleshooting-guide.md** - Common issues and solutions
552
- 21. **docs/architecture/changelog-conventions.md** - Change management practices
553
- 22. **docs/architecture/code-review-checklist.md** - Review standards and practices
515
+ 3. **Describe the focus** - Can you briefly describe what enhancement or feature you're planning? For example:
516
+ - 'Adding payment processing to the user service'
517
+ - 'Refactoring the authentication module'
518
+ - 'Integrating with a new third-party API'
554
519
 
555
- Present each document section by section, using the advanced elicitation task after each major section.]]
520
+ 4. **Document everything** - Or should I proceed with comprehensive documentation of the entire codebase? (Note: This may create excessive documentation for large projects)
556
521
 
557
- ### 3. Document Structure Template
522
+ Please let me know your preference, or I can proceed with full documentation if you prefer."
558
523
 
559
- [[LLM: Use this standardized structure for each documentation file, adapting content as needed:
524
+ Based on their response:
560
525
 
561
- ```markdown
562
- # {{Document Title}}
563
-
564
- ## Overview
565
-
566
- {{Brief description of what this document covers and why it's important for AI agents}}
567
-
568
- ## Quick Reference
569
-
570
- {{Key points, commands, or patterns that agents need most frequently}}
571
-
572
- ## Detailed Information
573
-
574
- {{Comprehensive information organized into logical sections}}
575
-
576
- ## Examples
577
-
578
- {{Concrete examples showing proper usage or implementation}}
579
-
580
- ## Common Patterns
526
+ - If they choose option 1-3: Use that context to focus documentation
527
+ - If they choose option 4 or decline: Proceed with comprehensive analysis below
581
528
 
582
- {{Recurring patterns agents should recognize and follow}}
529
+ Begin by conducting analysis of the existing project. Use available tools to:
583
530
 
584
- ## Things to Avoid
585
-
586
- {{Anti-patterns, deprecated approaches, or common mistakes}}
587
-
588
- ## Related Resources
589
-
590
- {{Links to other relevant documentation or external resources}}
591
- ```
531
+ 1. **Project Structure Discovery**: Examine the root directory structure, identify main folders, and understand the overall organization
532
+ 2. **Technology Stack Identification**: Look for package.json, requirements.txt, Cargo.toml, pom.xml, etc. to identify languages, frameworks, and dependencies
533
+ 3. **Build System Analysis**: Find build scripts, CI/CD configurations, and development commands
534
+ 4. **Existing Documentation Review**: Check for README files, docs folders, and any existing documentation
535
+ 5. **Code Pattern Analysis**: Sample key files to understand coding patterns, naming conventions, and architectural approaches
592
536
 
593
- Each document should be:
537
+ Ask the user these elicitation questions to better understand their needs:
594
538
 
595
- - **Concrete and actionable** - Focus on what agents need to do, not just concepts
596
- - **Pattern-focused** - Highlight recurring patterns agents can recognize and replicate
597
- - **Example-rich** - Include specific code examples and real file references
598
- - **Context-aware** - Reference actual project files, folders, and conventions
599
- - **Assumption-free** - Don't assume agents know project history or implicit knowledge
539
+ - What is the primary purpose of this project?
540
+ - Are there any specific areas of the codebase that are particularly complex or important for agents to understand?
541
+ - What types of tasks do you expect AI agents to perform on this project? (e.g., bug fixes, feature additions, refactoring, testing)
542
+ - Are there any existing documentation standards or formats you prefer?
543
+ - What level of technical detail should the documentation target? (junior developers, senior developers, mixed team)
544
+ - Is there a specific feature or enhancement you're planning? (This helps focus documentation)
600
545
  ]]
601
546
 
602
- ### 4. Content Guidelines for Each Document Type
603
-
604
- #### Core Architecture Documents
605
-
606
- ##### docs/architecture/index.md
607
-
608
- [[LLM: Create a comprehensive index of all architecture documentation:
609
-
610
- - List all architecture documents with brief descriptions
611
- - Group documents by category (backend, frontend, shared)
612
- - Include quick links to key sections
613
- - Provide reading order recommendations for different use cases]]
614
-
615
- ##### docs/architecture/unified-project-structure.md
616
-
617
- [[LLM: Document the complete project structure:
618
-
619
- - Root-level directory structure with explanations
620
- - Where each type of code belongs (backend, frontend, tests, etc.)
621
- - File naming conventions and patterns
622
- - Module/package organization
623
- - Generated vs. source file locations
624
- - Build output locations]]
625
-
626
- ##### docs/architecture/coding-standards.md
627
-
628
- [[LLM: Capture project-wide coding conventions:
629
-
630
- - Language-specific style guidelines
631
- - Naming conventions (variables, functions, classes, files)
632
- - Code organization within files
633
- - Import/export patterns
634
- - Comment and documentation standards
635
- - Linting and formatting tool configurations
636
- - Git commit message conventions]]
637
-
638
- ##### docs/architecture/tech-stack.md
639
-
640
- [[LLM: Document all technologies and versions:
641
-
642
- - Primary languages and versions
643
- - Frameworks and major libraries with versions
644
- - Development tools and their versions
645
- - Database systems and versions
646
- - External services and APIs used
647
- - Browser/runtime requirements]]
648
-
649
- ##### docs/architecture/testing-strategy.md
650
-
651
- [[LLM: Define testing approaches and requirements:
547
+ ### 2. Deep Codebase Analysis
652
548
 
653
- - Test file locations and naming conventions
654
- - Unit testing patterns and frameworks
655
- - Integration testing approaches
656
- - E2E testing setup (if applicable)
657
- - Test coverage requirements
658
- - Mocking strategies
659
- - Test data management]]
549
+ [[LLM: Before generating documentation, conduct extensive analysis of the existing codebase:
660
550
 
661
- #### Backend Architecture Documents
551
+ 1. **Explore Key Areas**:
552
+ - Entry points (main files, index files, app initializers)
553
+ - Configuration files and environment setup
554
+ - Package dependencies and versions
555
+ - Build and deployment configurations
556
+ - Test suites and coverage
662
557
 
663
- ##### docs/architecture/backend-architecture.md
558
+ 2. **Ask Clarifying Questions**:
559
+ - "I see you're using [technology X]. Are there any custom patterns or conventions I should document?"
560
+ - "What are the most critical/complex parts of this system that developers struggle with?"
561
+ - "Are there any undocumented 'tribal knowledge' areas I should capture?"
562
+ - "What technical debt or known issues should I document?"
563
+ - "Which parts of the codebase change most frequently?"
664
564
 
665
- [[LLM: Document backend service structure:
565
+ 3. **Map the Reality**:
566
+ - Identify ACTUAL patterns used (not theoretical best practices)
567
+ - Find where key business logic lives
568
+ - Locate integration points and external dependencies
569
+ - Document workarounds and technical debt
570
+ - Note areas that differ from standard patterns
666
571
 
667
- - Service layer organization
668
- - Controller/route patterns
669
- - Middleware architecture
670
- - Authentication/authorization patterns
671
- - Request/response flow
672
- - Background job processing
673
- - Service communication patterns]]
572
+ **IF PRD PROVIDED**: Also analyze what would need to change for the enhancement]]
674
573
 
675
- ##### docs/architecture/rest-api-spec.md
574
+ ### 3. Core Documentation Generation
676
575
 
677
- [[LLM: Specify all API endpoints:
576
+ [[LLM: Generate a comprehensive BROWNFIELD architecture document that reflects the ACTUAL state of the codebase.
678
577
 
679
- - Base URL and versioning strategy
680
- - Authentication methods
681
- - Common headers and parameters
682
- - Each endpoint with:
683
- - HTTP method and path
684
- - Request parameters/body
685
- - Response format and status codes
686
- - Error responses
687
- - Rate limiting and quotas]]
578
+ **CRITICAL**: This is NOT an aspirational architecture document. Document what EXISTS, including:
579
+ - Technical debt and workarounds
580
+ - Inconsistent patterns between different parts
581
+ - Legacy code that can't be changed
582
+ - Integration constraints
583
+ - Performance bottlenecks
688
584
 
689
- ##### docs/architecture/data-models.md
585
+ **Document Structure**:
690
586
 
691
- [[LLM: Define data structures and validation:
587
+ # [Project Name] Brownfield Architecture Document
692
588
 
693
- - Core business entities
694
- - Data validation rules
695
- - Relationships between entities
696
- - Computed fields and derivations
697
- - Data transformation patterns
698
- - Serialization formats]]
699
-
700
- ##### docs/architecture/database-schema.md
701
-
702
- [[LLM: Document database design:
703
-
704
- - Database type and version
705
- - Table/collection structures
706
- - Indexes and constraints
707
- - Relationships and foreign keys
708
- - Migration patterns
709
- - Seed data requirements
710
- - Backup and recovery procedures]]
711
-
712
- ##### docs/architecture/external-apis.md
713
-
714
- [[LLM: Document third-party integrations:
715
-
716
- - List of external services used
717
- - Authentication methods for each
718
- - API endpoints and usage patterns
719
- - Rate limits and quotas
720
- - Error handling strategies
721
- - Webhook configurations
722
- - Data synchronization patterns]]
589
+ ## Introduction
590
+ This document captures the CURRENT STATE of the [Project Name] codebase, including technical debt, workarounds, and real-world patterns. It serves as a reference for AI agents working on enhancements.
723
591
 
724
- #### Frontend Architecture Documents
592
+ ### Document Scope
593
+ [If PRD provided: "Focused on areas relevant to: {enhancement description}"]
594
+ [If no PRD: "Comprehensive documentation of entire system"]
725
595
 
726
- ##### docs/architecture/frontend-architecture.md
596
+ ### Change Log
597
+ | Date | Version | Description | Author |
598
+ |------|---------|-------------|--------|
599
+ | [Date] | 1.0 | Initial brownfield analysis | [Analyst] |
727
600
 
728
- [[LLM: Document frontend application structure:
601
+ ## Quick Reference - Key Files and Entry Points
729
602
 
730
- - Component hierarchy and organization
731
- - State management patterns
732
- - Routing architecture
733
- - Data fetching patterns
734
- - Authentication flow
735
- - Error boundary strategies
736
- - Performance optimization patterns]]
603
+ ### Critical Files for Understanding the System
604
+ - **Main Entry**: `src/index.js` (or actual entry point)
605
+ - **Configuration**: `config/app.config.js`, `.env.example`
606
+ - **Core Business Logic**: `src/services/`, `src/domain/`
607
+ - **API Definitions**: `src/routes/` or link to OpenAPI spec
608
+ - **Database Models**: `src/models/` or link to schema files
609
+ - **Key Algorithms**: [List specific files with complex logic]
737
610
 
738
- ##### docs/architecture/components.md
611
+ ### If PRD Provided - Enhancement Impact Areas
612
+ [Highlight which files/modules will be affected by the planned enhancement]
739
613
 
740
- [[LLM: Specify UI components:
614
+ ## High Level Architecture
741
615
 
742
- - Component library/design system used
743
- - Custom component specifications
744
- - Props and state for each component
745
- - Component composition patterns
746
- - Styling approaches
747
- - Accessibility requirements
748
- - Component testing patterns]]
616
+ ### Technical Summary
617
+ [Real assessment of architecture - mention if it's well-structured or has issues]
749
618
 
750
- ##### docs/architecture/core-workflows.md
619
+ ### Actual Tech Stack (from package.json/requirements.txt)
620
+ | Category | Technology | Version | Notes |
621
+ |----------|------------|---------|--------|
622
+ | Runtime | Node.js | 16.x | [Any constraints] |
623
+ | Framework | Express | 4.18.2 | [Custom middleware?] |
624
+ | Database | PostgreSQL | 13 | [Connection pooling setup] |
625
+ | [etc...] |
751
626
 
752
- [[LLM: Document user interaction flows:
627
+ ### Repository Structure Reality Check
628
+ - Type: [Monorepo/Polyrepo/Hybrid]
629
+ - Package Manager: [npm/yarn/pnpm]
630
+ - Notable: [Any unusual structure decisions]
753
631
 
754
- - Major user journeys
755
- - Screen flow diagrams
756
- - Form handling patterns
757
- - Navigation patterns
758
- - Data flow through workflows
759
- - Error states and recovery
760
- - Loading and transition states]]
632
+ ## Source Tree and Module Organization
761
633
 
762
- ##### docs/architecture/ui-ux-spec.md
634
+ ### Project Structure (Actual)
635
+ ```
636
+ project-root/
637
+ ├── src/
638
+ │ ├── controllers/ # HTTP request handlers
639
+ │ ├── services/ # Business logic (NOTE: inconsistent patterns between user and payment services)
640
+ │ ├── models/ # Database models (Sequelize)
641
+ │ ├── utils/ # Mixed bag - needs refactoring
642
+ │ └── legacy/ # DO NOT MODIFY - old payment system still in use
643
+ ├── tests/ # Jest tests (60% coverage)
644
+ ├── scripts/ # Build and deployment scripts
645
+ └── config/ # Environment configs
646
+ ```
763
647
 
764
- [[LLM: Define UI/UX guidelines:
648
+ ### Key Modules and Their Purpose
649
+ - **User Management**: `src/services/userService.js` - Handles all user operations
650
+ - **Authentication**: `src/middleware/auth.js` - JWT-based, custom implementation
651
+ - **Payment Processing**: `src/legacy/payment.js` - CRITICAL: Do not refactor, tightly coupled
652
+ - **[List other key modules with their actual files]**
765
653
 
766
- - Design system specifications
767
- - Color palette and typography
768
- - Spacing and layout grids
769
- - Responsive breakpoints
770
- - Animation and transition guidelines
771
- - Accessibility standards
772
- - Browser compatibility requirements]]
654
+ ## Data Models and APIs
773
655
 
774
- ### 5. Adaptive Content Strategy
656
+ ### Data Models
657
+ Instead of duplicating, reference actual model files:
658
+ - **User Model**: See `src/models/User.js`
659
+ - **Order Model**: See `src/models/Order.js`
660
+ - **Related Types**: TypeScript definitions in `src/types/`
775
661
 
776
- [[LLM: Adapt your documentation approach based on project characteristics:
662
+ ### API Specifications
663
+ - **OpenAPI Spec**: `docs/api/openapi.yaml` (if exists)
664
+ - **Postman Collection**: `docs/api/postman-collection.json`
665
+ - **Manual Endpoints**: [List any undocumented endpoints discovered]
777
666
 
778
- **For Web Applications:**
667
+ ## Technical Debt and Known Issues
779
668
 
780
- - Focus on component patterns, routing, state management
781
- - Include build processes, asset handling, and deployment
782
- - Cover API integration patterns and data fetching
669
+ ### Critical Technical Debt
670
+ 1. **Payment Service**: Legacy code in `src/legacy/payment.js` - tightly coupled, no tests
671
+ 2. **User Service**: Different pattern than other services, uses callbacks instead of promises
672
+ 3. **Database Migrations**: Manually tracked, no proper migration tool
673
+ 4. **[Other significant debt]**
783
674
 
784
- **For Backend Services:**
675
+ ### Workarounds and Gotchas
676
+ - **Environment Variables**: Must set `NODE_ENV=production` even for staging (historical reason)
677
+ - **Database Connections**: Connection pool hardcoded to 10, changing breaks payment service
678
+ - **[Other workarounds developers need to know]**
785
679
 
786
- - Emphasize service architecture, data models, and API design
787
- - Include database interaction patterns and migration strategies
788
- - Cover authentication, authorization, and security patterns
680
+ ## Integration Points and External Dependencies
789
681
 
790
- **For CLI Tools:**
682
+ ### External Services
683
+ | Service | Purpose | Integration Type | Key Files |
684
+ |---------|---------|------------------|-----------|
685
+ | Stripe | Payments | REST API | `src/integrations/stripe/` |
686
+ | SendGrid | Emails | SDK | `src/services/emailService.js` |
687
+ | [etc...] |
791
688
 
792
- - Focus on command structure, argument parsing, and output formatting
793
- - Include plugin/extension patterns if applicable
794
- - Cover configuration file handling and user interaction patterns
689
+ ### Internal Integration Points
690
+ - **Frontend Communication**: REST API on port 3000, expects specific headers
691
+ - **Background Jobs**: Redis queue, see `src/workers/`
692
+ - **[Other integrations]**
795
693
 
796
- **For Libraries/Frameworks:**
694
+ ## Development and Deployment
797
695
 
798
- - Emphasize public API design and usage patterns
799
- - Include extension points and customization approaches
800
- - Cover versioning, compatibility, and migration strategies
696
+ ### Local Development Setup
697
+ 1. Actual steps that work (not ideal steps)
698
+ 2. Known issues with setup
699
+ 3. Required environment variables (see `.env.example`)
801
700
 
802
- **For Mobile Applications:**
701
+ ### Build and Deployment Process
702
+ - **Build Command**: `npm run build` (webpack config in `webpack.config.js`)
703
+ - **Deployment**: Manual deployment via `scripts/deploy.sh`
704
+ - **Environments**: Dev, Staging, Prod (see `config/environments/`)
803
705
 
804
- - Focus on platform-specific patterns and navigation
805
- - Include state management and data persistence approaches
806
- - Cover platform integration and native feature usage
706
+ ## Testing Reality
807
707
 
808
- **For Data Science/ML Projects:**
708
+ ### Current Test Coverage
709
+ - Unit Tests: 60% coverage (Jest)
710
+ - Integration Tests: Minimal, in `tests/integration/`
711
+ - E2E Tests: None
712
+ - Manual Testing: Primary QA method
809
713
 
810
- - Emphasize data pipeline patterns and model organization
811
- - Include experiment tracking and reproducibility approaches
812
- - Cover data validation and model deployment patterns
813
- ]]
714
+ ### Running Tests
715
+ ```bash
716
+ npm test # Runs unit tests
717
+ npm run test:integration # Runs integration tests (requires local DB)
718
+ ```
814
719
 
815
- ### 6. Quality Assurance
720
+ ## If Enhancement PRD Provided - Impact Analysis
816
721
 
817
- [[LLM: Before completing each document:
722
+ ### Files That Will Need Modification
723
+ Based on the enhancement requirements, these files will be affected:
724
+ - `src/services/userService.js` - Add new user fields
725
+ - `src/models/User.js` - Update schema
726
+ - `src/routes/userRoutes.js` - New endpoints
727
+ - [etc...]
818
728
 
819
- 1. **Accuracy Check**: Verify all file paths, commands, and code examples work
820
- 2. **Completeness Review**: Ensure the document covers the most important patterns an agent would encounter
821
- 3. **Clarity Assessment**: Check that explanations are clear and actionable
822
- 4. **Consistency Verification**: Ensure terminology and patterns align across all documents
823
- 5. **Agent Perspective**: Review from the viewpoint of an AI agent that needs to contribute to this project
729
+ ### New Files/Modules Needed
730
+ - `src/services/newFeatureService.js` - New business logic
731
+ - `src/models/NewFeature.js` - New data model
732
+ - [etc...]
824
733
 
825
- Ask the user to review each completed document and use the advanced elicitation task to refine based on their feedback.]]
734
+ ### Integration Considerations
735
+ - Will need to integrate with existing auth middleware
736
+ - Must follow existing response format in `src/utils/responseFormatter.js`
737
+ - [Other integration points]
826
738
 
827
- ### 7. Final Integration
739
+ ## Appendix - Useful Commands and Scripts
828
740
 
829
- [[LLM: After all documents are completed:
741
+ ### Frequently Used Commands
742
+ ```bash
743
+ npm run dev # Start development server
744
+ npm run build # Production build
745
+ npm run migrate # Run database migrations
746
+ npm run seed # Seed test data
747
+ ```
830
748
 
831
- 1. Ensure all documents are created in the proper BMAD-expected locations:
749
+ ### Debugging and Troubleshooting
750
+ - **Logs**: Check `logs/app.log` for application logs
751
+ - **Debug Mode**: Set `DEBUG=app:*` for verbose logging
752
+ - **Common Issues**: See `docs/troubleshooting.md`]]
832
753
 
833
- - Core docs in `docs/` (index.md, prd.md)
834
- - Architecture shards in `docs/architecture/` subdirectory
835
- - Create the `docs/architecture/` directory if it doesn't exist
754
+ ### 4. Document Delivery
836
755
 
837
- 2. Create/update the master index documents:
756
+ [[LLM: After generating the complete architecture document:
838
757
 
839
- - Update `docs/index.md` to reference all documentation
840
- - Create `docs/architecture/index.md` listing all architecture shards
758
+ 1. **In Web UI (Gemini, ChatGPT, Claude)**:
759
+ - Present the entire document in one response (or multiple if too long)
760
+ - Tell user to copy and save as `docs/brownfield-architecture.md` or `docs/project-architecture.md`
761
+ - Mention it can be sharded later in IDE if needed
841
762
 
842
- 3. Verify document cross-references:
763
+ 2. **In IDE Environment**:
764
+ - Create the document as `docs/brownfield-architecture.md`
765
+ - Inform user this single document contains all architectural information
766
+ - Can be sharded later using PO agent if desired
843
767
 
844
- - Ensure all documents link to related documentation
845
- - Check that file paths match the actual project structure
846
- - Validate that examples reference real files in the project
768
+ The document should be comprehensive enough that future agents can understand:
769
+ - The actual state of the system (not idealized)
770
+ - Where to find key files and logic
771
+ - What technical debt exists
772
+ - What constraints must be respected
773
+ - If PRD provided: What needs to change for the enhancement]]
847
774
 
848
- 4. Provide maintenance guidance:
775
+ ### 5. Quality Assurance
849
776
 
850
- - Document update triggers (when to update each doc)
851
- - Create a simple checklist for keeping docs current
852
- - Suggest automated validation approaches
777
+ [[LLM: Before finalizing the document:
853
778
 
854
- 5. Summary report including:
855
- - List of all documents created with their paths
856
- - Any gaps or areas needing human review
857
- - Recommendations for project-specific additions
858
- - Next steps for maintaining documentation accuracy
779
+ 1. **Accuracy Check**: Verify all technical details match the actual codebase
780
+ 2. **Completeness Review**: Ensure all major system components are documented
781
+ 3. **Focus Validation**: If user provided scope, verify relevant areas are emphasized
782
+ 4. **Clarity Assessment**: Check that explanations are clear for AI agents
783
+ 5. **Navigation**: Ensure document has clear section structure for easy reference
859
784
 
860
- Present a summary of what was created and ask if any additional documentation would be helpful for AI agents working on this specific project.]]
785
+ Apply the advanced elicitation task after major sections to refine based on user feedback.]]
861
786
 
862
787
  ## Success Criteria
863
788
 
864
- - Documentation enables AI agents to understand project context without additional explanation
865
- - All major architectural patterns and coding conventions are captured
866
- - Examples reference actual project files and demonstrate real usage
867
- - Documentation is structured consistently and easy to navigate
868
- - Content is actionable and focuses on what agents need to do, not just understand
789
+ - Single comprehensive brownfield architecture document created
790
+ - Document reflects REALITY including technical debt and workarounds
791
+ - Key files and modules are referenced with actual paths
792
+ - Models/APIs reference source files rather than duplicating content
793
+ - If PRD provided: Clear impact analysis showing what needs to change
794
+ - Document enables AI agents to navigate and understand the actual codebase
795
+ - Technical constraints and "gotchas" are clearly documented
869
796
 
870
797
  ## Notes
871
798
 
872
- - This task is designed to work with any project type, language, or framework
873
- - The documentation should reflect the project as it actually is, not as it should be
874
- - Focus on patterns that agents can recognize and replicate consistently
875
- - Include both positive examples (what to do) and negative examples (what to avoid)
799
+ - This task creates ONE document that captures the TRUE state of the system
800
+ - References actual files rather than duplicating content when possible
801
+ - Documents technical debt, workarounds, and constraints honestly
802
+ - For brownfield projects with PRD: Provides clear enhancement impact analysis
803
+ - The goal is PRACTICAL documentation for AI agents doing real work
876
804
  ==================== END: tasks#document-project ====================
877
805
 
878
806
  ==================== START: tasks#execute-checklist ====================