Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

instructions.md 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. # Document Project Workflow Router
  2. <critical>Communicate all responses in {communication_language}</critical>
  3. <workflow>
  4. <critical>This router determines workflow mode and delegates to specialized sub-workflows</critical>
  5. <step n="1" goal="Check for ability to resume and determine workflow mode">
  6. <action>Check for existing state file at: {project_knowledge}/project-scan-report.json</action>
  7. <check if="project-scan-report.json exists">
  8. <action>Read state file and extract: timestamps, mode, scan_level, current_step, completed_steps, project_classification</action>
  9. <action>Extract cached project_type_id(s) from state file if present</action>
  10. <action>Calculate age of state file (current time - last_updated)</action>
  11. <ask>I found an in-progress workflow state from {{last_updated}}.
  12. **Current Progress:**
  13. - Mode: {{mode}}
  14. - Scan Level: {{scan_level}}
  15. - Completed Steps: {{completed_steps_count}}/{{total_steps}}
  16. - Last Step: {{current_step}}
  17. - Project Type(s): {{cached_project_types}}
  18. Would you like to:
  19. 1. **Resume from where we left off** - Continue from step {{current_step}}
  20. 2. **Start fresh** - Archive old state and begin new scan
  21. 3. **Cancel** - Exit without changes
  22. Your choice [1/2/3]:
  23. </ask>
  24. <check if="user selects 1">
  25. <action>Set resume_mode = true</action>
  26. <action>Set workflow_mode = {{mode}}</action>
  27. <action>Load findings summaries from state file</action>
  28. <action>Load cached project_type_id(s) from state file</action>
  29. <critical>CONDITIONAL CSV LOADING FOR RESUME:</critical>
  30. <action>For each cached project_type_id, load ONLY the corresponding row from: ./documentation-requirements.csv</action>
  31. <action>Skip loading project-types.csv and architecture_registry.csv (not needed on resume)</action>
  32. <action>Store loaded doc requirements for use in remaining steps</action>
  33. <action>Display: "Resuming {{workflow_mode}} from {{current_step}} with cached project type(s): {{cached_project_types}}"</action>
  34. <check if="workflow_mode == deep_dive">
  35. <action>Read fully and follow: ./workflows/deep-dive-workflow.md with resume context</action>
  36. </check>
  37. <check if="workflow_mode == initial_scan OR workflow_mode == full_rescan">
  38. <action>Read fully and follow: ./workflows/full-scan-workflow.md with resume context</action>
  39. </check>
  40. </check>
  41. <check if="user selects 2">
  42. <action>Create archive directory: {project_knowledge}/.archive/</action>
  43. <action>Move old state file to: {project_knowledge}/.archive/project-scan-report-{{timestamp}}.json</action>
  44. <action>Set resume_mode = false</action>
  45. <action>Continue to Step 0.5</action>
  46. </check>
  47. <check if="user selects 3">
  48. <action>Display: "Exiting workflow without changes."</action>
  49. <action>Exit workflow</action>
  50. </check>
  51. <check if="state file age >= 24 hours">
  52. <action>Display: "Found old state file (>24 hours). Starting fresh scan."</action>
  53. <action>Archive old state file to: {project_knowledge}/.archive/project-scan-report-{{timestamp}}.json</action>
  54. <action>Set resume_mode = false</action>
  55. <action>Continue to Step 0.5</action>
  56. </check>
  57. </step>
  58. <step n="3" goal="Check for existing documentation and determine workflow mode" if="resume_mode == false">
  59. <action>Check if {project_knowledge}/index.md exists</action>
  60. <check if="index.md exists">
  61. <action>Read existing index.md to extract metadata (date, project structure, parts count)</action>
  62. <action>Store as {{existing_doc_date}}, {{existing_structure}}</action>
  63. <ask>I found existing documentation generated on {{existing_doc_date}}.
  64. What would you like to do?
  65. 1. **Re-scan entire project** - Update all documentation with latest changes
  66. 2. **Deep-dive into specific area** - Generate detailed documentation for a particular feature/module/folder
  67. 3. **Cancel** - Keep existing documentation as-is
  68. Your choice [1/2/3]:
  69. </ask>
  70. <check if="user selects 1">
  71. <action>Set workflow_mode = "full_rescan"</action>
  72. <action>Display: "Starting full project rescan..."</action>
  73. <action>Read fully and follow: ./workflows/full-scan-workflow.md</action>
  74. <action>After sub-workflow completes, continue to Step 4</action>
  75. </check>
  76. <check if="user selects 2">
  77. <action>Set workflow_mode = "deep_dive"</action>
  78. <action>Set scan_level = "exhaustive"</action>
  79. <action>Display: "Starting deep-dive documentation mode..."</action>
  80. <action>Read fully and follow: ./workflows/deep-dive-workflow.md</action>
  81. <action>After sub-workflow completes, continue to Step 4</action>
  82. </check>
  83. <check if="user selects 3">
  84. <action>Display message: "Keeping existing documentation. Exiting workflow."</action>
  85. <action>Exit workflow</action>
  86. </check>
  87. </check>
  88. <check if="index.md does not exist">
  89. <action>Set workflow_mode = "initial_scan"</action>
  90. <action>Display: "No existing documentation found. Starting initial project scan..."</action>
  91. <action>Read fully and follow: ./workflows/full-scan-workflow.md</action>
  92. <action>After sub-workflow completes, continue to Step 4</action>
  93. </check>
  94. </step>
  95. </workflow>