########WORKFLOW######## ##### MODE 1 FULL DISCOVERY (PERTAMA KALI) ###### Read workflow_ai/constitution/new_san_variant/AGENTS.md Execute Full Repository Discovery. Rescan the entire ERP repository. Rediscover all modules, business capabilities, routes, controllers, models, services, APIs, reports and database objects. Regenerate MODULE_LIST.md. Update discovery artifacts. Do not modify source code. Generate DISCOVERY_REPORT.md. Stop after completion. ##### Mode 2 - Refresh Discovery (Yang akan paling sering dipakai) ###### Read workflow_ai/constitution/new_san_variant/AGENTS.md Execute Repository Refresh Discovery. Compare the current repository against the existing discovery artifacts. Detect: - New modules - Removed modules - Renamed modules - Moved modules - New controllers - New models - New services - New APIs - New database tables Update MODULE_LIST.md. Do NOT overwrite existing knowledge unless changes are confirmed. Generate DISCOVERY_DELTA_REPORT.md. ##### Mode 3 - Target Discovery ##### Read workflow_ai/constitution/new_san_variant/AGENTS.md Execute Target Discovery. Target Module: Finance Rediscover only this module. Update: Knowledge Business Flow Dependencies API Database Do not analyze unrelated modules. ######### BUILD AI Operating System ########## Read workflow_ai/core/prompts/01_BUILD_AIOS.md Execute every task autonomously. Read every markdown under AI_DRAFT. Build the AI Operating System. Do not modify ERP source code. Commit your work only inside workflow_ai/. Stop after Sprint 1 is completed. ######### Read workflow_ai/core/prompts/02_DISCOVER_PROJECT.md Execute every task. Use the AI Operating System created in Sprint 1. Analyze the ERP. Generate all documentation. Do not modify source code. Stop after Sprint 2. ######### Read workflow_ai/core/prompts/03_ENTERPRISE_AUDIT.md Use the AI Operating System, Knowledge Base, Project Catalog, and Standards created in Sprint 1 and Sprint 2. Perform a complete Enterprise Audit. Do not modify any ERP source code. Generate all reports under workflow_ai/reports/. Stop after Sprint 3 is completed. ######### Read workflow_ai/core/prompts/04_MODERNIZATION_ROADMAP.md Use every report generated from Sprint 3. Generate a complete ERP modernization roadmap. Do not modify ERP source code. Stop after Sprint 4. ######### Read workflow_ai/core/prompts/05_IMPLEMENTATION_MASTER_PLAN.md Use every artifact generated from Sprint 1 until Sprint 4. Build a complete Enterprise Implementation Master Plan. Generate all planning documents. Do not modify ERP source code. Stop after Sprint 5. ######### Read workflow_ai/core/prompts/05_5_ENTERPRISE_PLAN_VALIDATION.md Load every artifact generated from Sprint 1 until Sprint 5. Perform a complete Enterprise Go / No Go Assessment. Validate everything. Generate Go / No Go decision. Do not modify ERP source code. Stop after Sprint 5.5. ######### Read workflow_ai/core/prompts/06_CONTROLLED_IMPLEMENTATION.md Load the approved TASK_QUEUE.md. Select ONLY ONE approved task with the highest priority. Prepare an implementation plan. If approval is required, stop before modifying source code. If automatic approval policy exists, implement only that single task. Update documentation, memory, and task status. Stop after the task is completed. ########## Read workflow_ai/core/prompts/06_GENERATE_ENTERPRISE_BACKLOG.md Generate the complete Enterprise Backlog from every audit, roadmap, planning document, and knowledge base. Create executable tasks with priorities, dependencies, estimates, and acceptance criteria. Do not modify ERP source code. Stop after the backlog has been generated. ########## Read workflow_ai/core/prompts/02_5_BUILD_ENTERPRISE_KNOWLEDGE_BASE.md Analyze the entire ERP repository. Reverse engineer the ERP. Generate the complete Enterprise Knowledge Base under workflow_ai/knowledge/. Create documentation for every discovered Business Domain and every discovered ERP Module. Do not modify any source code. Stop after the Enterprise Knowledge Base has been fully generated. ######### Read workflow_ai/core/prompts/02_2_ENUMERATE_ERP_MODULES.md Execute the entire prompt. Scan the complete ERP repository. Automatically discover every ERP module. Generate all outputs into workflow_ai/discovery/. Do not modify source code. Stop after the module enumeration is completed. ########## Read and execute the instructions defined in: workflow_ai/core/prompts/02_2_DISCOVER_ERP_STRUCTURE.md Requirements: - Treat the prompt file as the authoritative specification. - Scan the entire ERP repository. - Prioritize analysis of application/modules recursively. - Do not modify any source code. - Do not rename modules. - Do not create new modules. - Do not refactor anything. - Only analyze and document the current ERP. Generate all outputs into: workflow_ai/discovery/ If an output file already exists, update it instead of creating duplicates. Display progress for every phase. When finished, provide: 1. Total modules discovered 2. Total controllers 3. Total models 4. Total views 5. Total database tables 6. Total routes 7. Total methods 8. List of generated markdown files Stop after Sprint 2.2 is completely finished. atau gunakan ini Read: workflow_ai/core/prompts/02_2_DISCOVER_ERP_STRUCTURE.md Execute every phase sequentially. Before starting each phase: - Explain what you are going to do. - Execute the phase. - Save all generated markdown files. - Validate the outputs. After each phase, continue automatically to the next phase until Sprint 2.2 is complete. Never modify ERP source code. Never stop unless an unrecoverable error occurs. The final deliverable must be a complete discovery package under: workflow_ai/discovery/ ######### Read and execute: workflow_ai/core/prompts/02_3_BUILD_BUSINESS_CAPABILITY_CATALOG.md Read all discovery artifacts generated in Sprint 2.2. Transform the discovered ERP structure into a complete Business Capability Catalog. Do not scan the repository again unless required to validate a finding. Do not modify any source code. Generate all outputs into: workflow_ai/knowledge/ Display progress for every phase. At the end, summarize: - Total Business Capabilities - Total Business Objects - Total Master Data entities - Total Business Documents - Total Operational Reports - Total Accounting Processes - Total Tax Processes Stop after Sprint 2.3 is complete. ####### Read and execute: workflow_ai/core/prompts/02_4_BUILD_ENTERPRISE_KNOWLEDGE_BASE.md Read all discovery and knowledge artifacts generated in Sprint 2.2 and Sprint 2.3. Build a complete Enterprise Knowledge Base. Generate documentation under: workflow_ai/knowledge/ Do not modify source code. Do not refactor. Display progress for every phase. At completion, provide a summary including: - Total Business Domains - Total ERP Modules - Total Knowledge Documents - Total Database Tables Documented - Total Business Rules - Total Reports - Total Technical Debt Findings Stop after Sprint 2.4 is complete. ###### Read and execute: workflow_ai/core/prompts/03_ENTERPRISE_AUDIT.md Perform a complete Enterprise Audit using the Enterprise Knowledge Base as the primary source. Only access source code when evidence or verification is required. Do not modify any source code. Do not modify the database. Generate all audit reports under: workflow_ai/reports/ Display progress after every phase. At completion provide: - Overall Enterprise Health Score - Total Findings - Critical Findings - High Findings - Medium Findings - Low Findings - Top 10 Risks Stop after Sprint 3 is complete. ######## Read and execute: workflow_ai/core/prompts/04_BUILD_ENTERPRISE_ROADMAP.md Read every audit report under workflow_ai/reports/. Transform all validated findings into an Enterprise Roadmap. Do not modify source code. Do not create implementation tasks yet. Generate all outputs under: workflow_ai/planning/ Display progress after every phase. At completion provide: - Total Roadmap Items - Total Epics - Total Critical Initiatives - Total High Initiatives - Total Medium Initiatives - Total Low Initiatives - Estimated Overall Implementation Effort Stop after Sprint 4 is complete. ####### Read and execute: workflow_ai/core/prompts/05_BUILD_IMPLEMENTATION_PLAN.md Read all planning, audit and knowledge documents. Convert the Enterprise Roadmap into a complete implementation plan. Generate every document under: workflow_ai/planning/ Do not modify source code. Display progress after every phase. At completion provide: - Total Work Packages - Total Module Plans - Total Testing Plans - Total Deployment Plans - Estimated Total Implementation Effort Stop after Sprint 5 is complete. ######## Read and execute: workflow_ai/core/prompts/05_5_VALIDATE_IMPLEMENTATION_READINESS.md Read every discovery, knowledge, audit and planning artifact. Validate the complete implementation plan. Generate all outputs into: workflow_ai/planning/ Do not modify source code. Do not generate implementation tasks. Display progress after every validation phase. At completion provide: - Overall Readiness Score - Blocking Issues - Missing Dependencies - Missing Test Coverage - Final Status (READY / READY WITH CONDITIONS / NOT READY) Stop after Sprint 5.5 is complete. ######## Read and execute: workflow_ai/core/prompts/05_8_GENERATE_ENTERPRISE_BACKLOG.md Read every discovery, knowledge, audit and planning artifact. Generate a complete Enterprise Backlog. Do not modify source code. Generate all outputs under: workflow_ai/backlog/ Display progress after every phase. At completion provide: - Total Epics - Total Features - Total Stories - Total Tasks - Total Subtasks - Total Releases - Total Planned Sprints Stop after Sprint 5.8 is complete. ############# Read and execute: workflow_ai/core/prompts/06_EXECUTE_ENTERPRISE_BACKLOG.md Read the complete Enterprise Backlog. Select only the highest priority READY task. Do not execute blocked tasks. Implement only one task. Run validation. Update documentation. Generate execution reports under: workflow_ai/execution/ Stop after completing one task successfully. Wait for further instruction before continuing. ########### Read and execute: workflow_ai/core/prompts/05_9_GENERATE_AI_TASK_PACKAGES.md Read the complete Enterprise Backlog. Transform every Task into AI-optimized Task Packages. Each Package must: - Have a single responsibility. - Be executable independently. - Be testable independently. - Be reversible independently. - Contain all required context. Generate all outputs under: workflow_ai/packages/ Do not modify source code. Display progress after every phase. At completion provide: - Total Packages - Total Backend Packages - Total Frontend Packages - Total Database Packages - Total Testing Packages - Total Documentation Packages Stop after Sprint 5.9 is complete. ###### Read workflow_ai/constitution/new_san_variant/AGENTS.md Initialize the AI ERP Operating System. Follow the startup sequence exactly. Determine the current project state by inspecting the workflow_ai directory. Resume automatically from the last completed phase. Do not ask which sprint to execute. Do not modify ERP source code during initialization. Generate a BOOT_REPORT.md summarizing: - Current project phase - Completed phases - Incomplete phases - Missing artifacts - Readiness score - Recommended next action If the project is already fully initialized, continue automatically to the next pending phase. Stop only if human approval is required or an unrecoverable error occurs. ######### Read and execute: workflow_ai/core/prompts/02_6_MODULE_DEEP_ANALYSIS.md Analyze every discovered ERP module one by one. Do not skip any module. Generate complete module documentation under: workflow_ai/knowledge/modules/ Build the ERP Graph continuously. Create review requests only when confidence is below 80%. Update MODULE_QUEUE.md after each completed module. Display progress after each analyzed module. Do not modify source code. Stop only after 100% module coverage has been achieved. ######### FASE BERIKUTNYA YANG KURANG (SPRINT 6.1, 7, 8) ######### ######### SPRINT 6.1: EXECUTE MASTER AGENT (CODING PHASE) ######### Read workflow_ai/core/runtime/MASTER_AGENT.md Read constitution/new_san_variant/AGENTS.md Assume the role of the Master Agent. Initialize context for project `new_san_variant`. Find the highest priority Package that is in `READY` state. Create an implementation plan for that package. Wait for my approval before modifying the ERP source code. Once approved, execute the code changes. Update the package status to `IMPLEMENTED` and update the execution report. Stop after completing this single package. ######### SPRINT 7: ENTERPRISE QA & SECURITY TESTING ######### Read workflow_ai/core/handbooks/AUDIT_HANDBOOK.md Read workflow_ai/core/handbooks/STANDARDS_HANDBOOK.md Perform a complete Quality Assurance and Security Test on the newly implemented features in `new_san_variant`. Verify there are no SQL Injections, XSS, or CSRF vulnerabilities. Verify that the implementation strictly adheres to the Active Regional Compliance Modules (e.g., ID_TAX_STANDARD, ID_ACCOUNTING_STANDARD). Generate a QA_REPORT in workflow_ai/projects/new_san_variant/reports/. If any test fails, automatically generate a Bug Fix Package in the Backlog. Stop after the QA Report is generated. ######### SPRINT 8: DEPLOYMENT & RELEASE MANAGEMENT ######### Read workflow_ai/projects/new_san_variant/packages/ Identify all packages that are in `TESTED` or `IMPLEMENTED` state. Bundle these packages into a new Release Candidate. Generate a comprehensive RELEASE_NOTES.md inside workflow_ai/projects/new_san_variant/reports/. Create a database migration script for any schema changes introduced in this release. Mark the bundled packages as `DONE`. Stop after the Release Notes and Migration Scripts are generated. ################################################################## ######### RE-ANALYSIS / DISCOVERY PROMPTS FOR MULTI-TENANT ######### ######### RE-ANALYZE / REFRESH DISCOVERY FOR new_san_variant ######### Read workflow_ai/core/runtime/MASTER_AGENT.md Read constitution/new_san_variant/AGENTS.md Assume the role of the Master Agent for project `new_san_variant`. Execute a Refresh Discovery on the ERP source code associated with this project. Update the artifacts inside `workflow_ai/projects/new_san_variant/discovery/` and `workflow_ai/projects/new_san_variant/reports/`. Do not modify the ERP source code. Ensure all generated reports adhere to the Active Regional Compliance Modules of this project. Stop after the discovery and audit reports are fully updated. ######### RE-ANALYZE / REFRESH DISCOVERY FOR OTHER PROJECT (e.g. new_san_variant) ######### Read workflow_ai/core/runtime/MASTER_AGENT.md Read constitution/new_san_variant/AGENTS.md Assume the role of the Master Agent for project `new_san_variant`. Execute a Refresh Discovery on the ERP source code associated with this project. Update the artifacts inside `workflow_ai/projects/new_san_variant/discovery/`. Stop after the discovery reports are updated.