aidp 0.1.0

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.
Files changed (79) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +210 -0
  4. data/bin/aidp +5 -0
  5. data/lib/aidp/analyze/agent_personas.rb +71 -0
  6. data/lib/aidp/analyze/agent_tool_executor.rb +445 -0
  7. data/lib/aidp/analyze/data_retention_manager.rb +426 -0
  8. data/lib/aidp/analyze/database.rb +243 -0
  9. data/lib/aidp/analyze/dependencies.rb +335 -0
  10. data/lib/aidp/analyze/error_handler.rb +486 -0
  11. data/lib/aidp/analyze/export_manager.rb +425 -0
  12. data/lib/aidp/analyze/feature_analyzer.rb +397 -0
  13. data/lib/aidp/analyze/focus_guidance.rb +517 -0
  14. data/lib/aidp/analyze/incremental_analyzer.rb +543 -0
  15. data/lib/aidp/analyze/language_analysis_strategies.rb +897 -0
  16. data/lib/aidp/analyze/large_analysis_progress.rb +504 -0
  17. data/lib/aidp/analyze/memory_manager.rb +365 -0
  18. data/lib/aidp/analyze/parallel_processor.rb +460 -0
  19. data/lib/aidp/analyze/performance_optimizer.rb +694 -0
  20. data/lib/aidp/analyze/prioritizer.rb +402 -0
  21. data/lib/aidp/analyze/progress.rb +75 -0
  22. data/lib/aidp/analyze/progress_visualizer.rb +320 -0
  23. data/lib/aidp/analyze/report_generator.rb +582 -0
  24. data/lib/aidp/analyze/repository_chunker.rb +702 -0
  25. data/lib/aidp/analyze/ruby_maat_integration.rb +572 -0
  26. data/lib/aidp/analyze/runner.rb +245 -0
  27. data/lib/aidp/analyze/static_analysis_detector.rb +577 -0
  28. data/lib/aidp/analyze/steps.rb +53 -0
  29. data/lib/aidp/analyze/storage.rb +600 -0
  30. data/lib/aidp/analyze/tool_configuration.rb +456 -0
  31. data/lib/aidp/analyze/tool_modernization.rb +750 -0
  32. data/lib/aidp/execute/progress.rb +76 -0
  33. data/lib/aidp/execute/runner.rb +135 -0
  34. data/lib/aidp/execute/steps.rb +113 -0
  35. data/lib/aidp/shared/cli.rb +117 -0
  36. data/lib/aidp/shared/config.rb +35 -0
  37. data/lib/aidp/shared/project_detector.rb +119 -0
  38. data/lib/aidp/shared/providers/anthropic.rb +26 -0
  39. data/lib/aidp/shared/providers/base.rb +17 -0
  40. data/lib/aidp/shared/providers/cursor.rb +102 -0
  41. data/lib/aidp/shared/providers/gemini.rb +26 -0
  42. data/lib/aidp/shared/providers/macos_ui.rb +26 -0
  43. data/lib/aidp/shared/sync.rb +15 -0
  44. data/lib/aidp/shared/util.rb +41 -0
  45. data/lib/aidp/shared/version.rb +7 -0
  46. data/lib/aidp/shared/workspace.rb +21 -0
  47. data/lib/aidp.rb +53 -0
  48. data/templates/ANALYZE/01_REPOSITORY_ANALYSIS.md +100 -0
  49. data/templates/ANALYZE/02_ARCHITECTURE_ANALYSIS.md +151 -0
  50. data/templates/ANALYZE/03_TEST_ANALYSIS.md +182 -0
  51. data/templates/ANALYZE/04_FUNCTIONALITY_ANALYSIS.md +200 -0
  52. data/templates/ANALYZE/05_DOCUMENTATION_ANALYSIS.md +202 -0
  53. data/templates/ANALYZE/06_STATIC_ANALYSIS.md +233 -0
  54. data/templates/ANALYZE/07_REFACTORING_RECOMMENDATIONS.md +316 -0
  55. data/templates/COMMON/AGENT_BASE.md +129 -0
  56. data/templates/COMMON/CONVENTIONS.md +19 -0
  57. data/templates/COMMON/TEMPLATES/ADR_TEMPLATE.md +21 -0
  58. data/templates/COMMON/TEMPLATES/DOMAIN_CHARTER.md +27 -0
  59. data/templates/COMMON/TEMPLATES/EVENT_EXAMPLE.yaml +16 -0
  60. data/templates/COMMON/TEMPLATES/MERMAID_C4.md +46 -0
  61. data/templates/COMMON/TEMPLATES/OPENAPI_STUB.yaml +11 -0
  62. data/templates/EXECUTE/00_PRD.md +36 -0
  63. data/templates/EXECUTE/01_NFRS.md +27 -0
  64. data/templates/EXECUTE/02A_ARCH_GATE_QUESTIONS.md +13 -0
  65. data/templates/EXECUTE/02_ARCHITECTURE.md +42 -0
  66. data/templates/EXECUTE/03_ADR_FACTORY.md +22 -0
  67. data/templates/EXECUTE/04_DOMAIN_DECOMPOSITION.md +24 -0
  68. data/templates/EXECUTE/05_CONTRACTS.md +27 -0
  69. data/templates/EXECUTE/06_THREAT_MODEL.md +23 -0
  70. data/templates/EXECUTE/07_TEST_PLAN.md +24 -0
  71. data/templates/EXECUTE/08_TASKS.md +29 -0
  72. data/templates/EXECUTE/09_SCAFFOLDING_DEVEX.md +25 -0
  73. data/templates/EXECUTE/10_IMPLEMENTATION_AGENT.md +30 -0
  74. data/templates/EXECUTE/11_STATIC_ANALYSIS.md +22 -0
  75. data/templates/EXECUTE/12_OBSERVABILITY_SLOS.md +21 -0
  76. data/templates/EXECUTE/13_DELIVERY_ROLLOUT.md +21 -0
  77. data/templates/EXECUTE/14_DOCS_PORTAL.md +23 -0
  78. data/templates/EXECUTE/15_POST_RELEASE.md +25 -0
  79. metadata +301 -0
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "open3"
4
+ require "timeout"
5
+ require_relative "base"
6
+ require_relative "../util"
7
+
8
+ module Aidp
9
+ module Shared
10
+ module Providers
11
+ class Cursor < Base
12
+ def self.available?
13
+ !!Aidp::Shared::Util.which("cursor-agent")
14
+ end
15
+
16
+ def name = "cursor"
17
+
18
+ def send(prompt:, session: nil)
19
+ raise "cursor-agent not available" unless self.class.available?
20
+
21
+ # Always use non-interactive mode with -p flag
22
+ cmd = ["cursor-agent", "-p"]
23
+ puts "📝 Sending prompt to cursor-agent"
24
+
25
+ # Enable debug output if requested
26
+ if ENV["AIDP_DEBUG"]
27
+ puts "🔍 Debug mode enabled - showing cursor-agent output"
28
+ end
29
+
30
+ # Setup logging if log file is specified
31
+ log_file = ENV["AIDP_LOG_FILE"]
32
+ if log_file
33
+ puts "📝 Logging to: #{log_file}"
34
+ end
35
+
36
+ Open3.popen3(*cmd) do |stdin, stdout, stderr, wait|
37
+ # Send the prompt to stdin
38
+ stdin.puts prompt
39
+ stdin.close
40
+
41
+ # Log the prompt if debugging
42
+ if ENV["AIDP_DEBUG"] || log_file
43
+ prompt_log = "📝 Sending prompt to cursor-agent:\n#{prompt}"
44
+ puts prompt_log if ENV["AIDP_DEBUG"]
45
+ File.write(log_file, "#{Time.now.iso8601} #{prompt_log}\n", mode: "a") if log_file
46
+ end
47
+
48
+ # Handle debug output and logging
49
+ if ENV["AIDP_DEBUG"] || log_file
50
+ # Start threads to capture and display output in real-time
51
+ stdout_thread = Thread.new do
52
+ stdout.each_line do |line|
53
+ output = "📤 cursor-agent: #{line.chomp}"
54
+ puts output if ENV["AIDP_DEBUG"]
55
+ File.write(log_file, "#{Time.now.iso8601} #{output}\n", mode: "a") if log_file
56
+ end
57
+ end
58
+
59
+ stderr_thread = Thread.new do
60
+ stderr.each_line do |line|
61
+ output = "❌ cursor-agent error: #{line.chomp}"
62
+ puts output if ENV["AIDP_DEBUG"]
63
+ File.write(log_file, "#{Time.now.iso8601} #{output}\n", mode: "a") if log_file
64
+ end
65
+ end
66
+ end
67
+
68
+ # Wait for completion with a reasonable timeout
69
+ begin
70
+ Timeout.timeout(300) do # 5 minutes timeout
71
+ result = wait.value
72
+
73
+ # Stop debug threads
74
+ if ENV["AIDP_DEBUG"]
75
+ stdout_thread&.kill
76
+ stderr_thread&.kill
77
+ end
78
+
79
+ return :ok if result.success?
80
+ raise "cursor-agent failed with exit code #{result.exitstatus}"
81
+ end
82
+ rescue Timeout::Error
83
+ # Stop debug threads
84
+ if ENV["AIDP_DEBUG"]
85
+ stdout_thread&.kill
86
+ stderr_thread&.kill
87
+ end
88
+
89
+ # Kill the process if it's taking too long
90
+ begin
91
+ Process.kill("TERM", wait.pid)
92
+ rescue
93
+ nil
94
+ end
95
+ raise Timeout::Error, "cursor-agent timed out after 5 minutes"
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+
5
+ module Aidp
6
+ module Shared
7
+ module Providers
8
+ class Gemini < Base
9
+ def self.available?
10
+ !!Aidp::Shared::Util.which("gemini")
11
+ end
12
+
13
+ def name = "gemini"
14
+
15
+ def send(prompt:, session: nil)
16
+ raise "gemini CLI not available" unless self.class.available?
17
+
18
+ # Use Gemini CLI for non-interactive mode
19
+ cmd = ["gemini", "chat", "--prompt", prompt]
20
+ system(*cmd)
21
+ :ok
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+
5
+ module Aidp
6
+ module Shared
7
+ module Providers
8
+ class MacOSUI < Base
9
+ def self.available?
10
+ RUBY_PLATFORM.include?("darwin")
11
+ end
12
+
13
+ def name = "macos"
14
+
15
+ def send(prompt:, session: nil)
16
+ raise "macOS UI not available on this platform" unless self.class.available?
17
+
18
+ # Use macOS UI for interactive mode
19
+ cmd = ["osascript", "-e", "display dialog \"#{prompt}\" with title \"Aidp\" buttons {\"OK\"} default button \"OK\""]
20
+ system(*cmd)
21
+ :ok
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "fileutils"
4
+
5
+ module Aidp
6
+ module Shared
7
+ # Synchronization utilities
8
+ class Sync
9
+ def self.ensure_workspace_sync
10
+ # Placeholder for workspace synchronization logic
11
+ true
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "fileutils"
4
+
5
+ module Aidp
6
+ module Shared
7
+ # Utility functions shared between execute and analyze modes
8
+ class Util
9
+ def self.which(cmd)
10
+ exts = ENV["PATHEXT"] ? ENV["PATHEXT"].split(";") : [""]
11
+ ENV["PATH"].split(File::PATH_SEPARATOR).each do |path|
12
+ exts.each do |ext|
13
+ exe = File.join(path, "#{cmd}#{ext}")
14
+ return exe if File.executable?(exe) && !File.directory?(exe)
15
+ end
16
+ end
17
+ nil
18
+ end
19
+
20
+ def self.ensure_dirs(output_files, project_dir)
21
+ output_files.each do |file|
22
+ dir = File.dirname(File.join(project_dir, file))
23
+ FileUtils.mkdir_p(dir) unless dir == "."
24
+ end
25
+ end
26
+
27
+ def self.safe_file_write(path, content)
28
+ FileUtils.mkdir_p(File.dirname(path))
29
+ File.write(path, content)
30
+ end
31
+
32
+ def self.project_root?(dir = Dir.pwd)
33
+ File.exist?(File.join(dir, ".git")) ||
34
+ File.exist?(File.join(dir, "package.json")) ||
35
+ File.exist?(File.join(dir, "Gemfile")) ||
36
+ File.exist?(File.join(dir, "pom.xml")) ||
37
+ File.exist?(File.join(dir, "build.gradle"))
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aidp
4
+ module Shared
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "fileutils"
4
+ require "digest"
5
+
6
+ module Aidp
7
+ module Shared
8
+ # Workspace management utilities
9
+ class Workspace
10
+ def self.current
11
+ Dir.pwd
12
+ end
13
+
14
+ def self.ensure_project_root
15
+ unless Aidp::Shared::Util.project_root?
16
+ raise "Not in a project root directory. Please run from a directory with .git, package.json, Gemfile, etc."
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
data/lib/aidp.rb ADDED
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Shared modules
4
+ require "aidp/shared/version"
5
+ require "aidp/shared/config"
6
+ require "aidp/shared/workspace"
7
+ require "aidp/shared/util"
8
+ require "aidp/shared/cli"
9
+ require "aidp/shared/project_detector"
10
+ require "aidp/shared/sync"
11
+ require "aidp/shared/providers/base"
12
+ require "aidp/shared/providers/cursor"
13
+ require "aidp/shared/providers/anthropic"
14
+ require "aidp/shared/providers/gemini"
15
+ require "aidp/shared/providers/macos_ui"
16
+
17
+ # Execute mode modules
18
+ require "aidp/execute/steps"
19
+ require "aidp/execute/runner"
20
+ require "aidp/execute/progress"
21
+
22
+ # Analyze mode modules
23
+ require "aidp/analyze/steps"
24
+ require "aidp/analyze/runner"
25
+ require "aidp/analyze/progress"
26
+ require "aidp/analyze/dependencies"
27
+ require "aidp/analyze/storage"
28
+ require "aidp/analyze/prioritizer"
29
+ require "aidp/analyze/database"
30
+ require "aidp/analyze/ruby_maat_integration"
31
+ require "aidp/analyze/feature_analyzer"
32
+ require "aidp/analyze/focus_guidance"
33
+ require "aidp/analyze/agent_personas"
34
+ require "aidp/analyze/agent_tool_executor"
35
+ require "aidp/analyze/static_analysis_detector"
36
+ require "aidp/analyze/tool_configuration"
37
+ require "aidp/analyze/tool_modernization"
38
+ require "aidp/analyze/language_analysis_strategies"
39
+ require "aidp/analyze/report_generator"
40
+ require "aidp/analyze/export_manager"
41
+ require "aidp/analyze/incremental_analyzer"
42
+ require "aidp/analyze/progress_visualizer"
43
+ require "aidp/analyze/data_retention_manager"
44
+ require "aidp/analyze/repository_chunker"
45
+ require "aidp/analyze/parallel_processor"
46
+ require "aidp/analyze/memory_manager"
47
+ require "aidp/analyze/large_analysis_progress"
48
+ require "aidp/analyze/performance_optimizer"
49
+ require "aidp/analyze/error_handler"
50
+
51
+ module Aidp
52
+ VERSION = Aidp::Shared::VERSION
53
+ end
@@ -0,0 +1,100 @@
1
+ # Repository Analysis Template
2
+
3
+ You are a **Repository Analyst**, an expert in version control analysis and code evolution patterns. Your role is to analyze the repository's history to understand code evolution, identify problematic areas, and provide data-driven insights for refactoring decisions.
4
+
5
+ ## Your Expertise
6
+
7
+ - Version control system analysis (Git, SVN, etc.)
8
+ - Code evolution patterns and trends
9
+ - Repository mining and metrics analysis
10
+ - Code churn analysis and hotspots identification
11
+ - Developer collaboration patterns
12
+ - Technical debt identification through historical data
13
+
14
+ ## Analysis Objectives
15
+
16
+ 1. **Repository Mining**: Use Code Maat to analyze repository activity
17
+ 2. **Churn Analysis**: Identify high-activity areas that may indicate technical debt
18
+ 3. **Coupling Analysis**: Understand dependencies between modules/components
19
+ 4. **Authorship Patterns**: Analyze code ownership and knowledge distribution
20
+ 5. **Focus Area Prioritization**: Recommend which areas to analyze first
21
+
22
+ ## Required Analysis Steps
23
+
24
+ ### 1. Code Maat Integration
25
+
26
+ - Check if Docker is available for Code Maat analysis
27
+ - Run Code Maat analysis for the repository
28
+ - Parse and interpret the results
29
+
30
+ ### 2. Repository Activity Analysis
31
+
32
+ - Analyze code churn by entity (files/modules)
33
+ - Identify hotspots (frequently changed areas)
34
+ - Analyze coupling between different parts of the codebase
35
+ - Examine authorship patterns and ownership distribution
36
+
37
+ ### 3. Focus Area Recommendations
38
+
39
+ - Prioritize areas for detailed analysis based on:
40
+ - High churn (frequently changed files)
41
+ - High coupling (files with many dependencies)
42
+ - Knowledge concentration (files with few authors)
43
+ - Age patterns (old vs. new code)
44
+
45
+ ### 4. Repository Health Assessment
46
+
47
+ - Identify potential technical debt indicators
48
+ - Assess code stability and maintainability
49
+ - Evaluate team collaboration patterns
50
+ - Identify areas that need immediate attention
51
+
52
+ ## Output Requirements
53
+
54
+ ### Primary Output: Repository Analysis Report
55
+
56
+ Create a comprehensive markdown report that includes:
57
+
58
+ 1. **Executive Summary**
59
+ - Key findings and recommendations
60
+ - Overall repository health assessment
61
+ - Priority areas for analysis
62
+
63
+ 2. **Repository Metrics**
64
+ - Code churn analysis results
65
+ - Coupling analysis results
66
+ - Authorship patterns
67
+ - File age distribution
68
+
69
+ 3. **Focus Area Recommendations**
70
+ - Prioritized list of areas to analyze
71
+ - Reasoning for each recommendation
72
+ - Expected analysis effort for each area
73
+
74
+ 4. **Technical Debt Indicators**
75
+ - High-churn areas that may need refactoring
76
+ - Knowledge silos (files with single authors)
77
+ - Coupling issues that may indicate architectural problems
78
+
79
+ ### Secondary Output: Repository Metrics CSV
80
+
81
+ Create a CSV file with raw metrics data for further analysis.
82
+
83
+ ## Analysis Guidelines
84
+
85
+ - **Data-Driven**: Base all recommendations on actual repository metrics
86
+ - **Actionable**: Provide specific, actionable insights
87
+ - **Prioritized**: Focus on areas that will provide the most value
88
+ - **Contextual**: Consider the project's specific context and constraints
89
+
90
+ ## Questions to Ask (if needed)
91
+
92
+ If you need more information to complete the analysis, ask about:
93
+
94
+ - Project goals and constraints
95
+ - Team size and structure
96
+ - Current pain points or areas of concern
97
+ - Specific areas the team wants to focus on
98
+ - Timeline and resource constraints for analysis
99
+
100
+ Remember: Your analysis will guide the entire analyze mode workflow, so be thorough and provide clear, actionable recommendations.
@@ -0,0 +1,151 @@
1
+ # Architecture Analysis Template
2
+
3
+ You are an **Architecture Analyst**, an expert in software architecture patterns and design principles. Your role is to analyze the codebase's architectural structure, identify patterns and anti-patterns, assess dependencies and coupling, and provide recommendations for architectural improvements.
4
+
5
+ ## Your Expertise
6
+
7
+ - Software architecture patterns and design principles
8
+ - Dependency analysis and coupling identification
9
+ - Architectural decision making and trade-offs
10
+ - System design patterns (MVC, MVVM, Clean Architecture, etc.)
11
+ - Microservices vs monolith analysis
12
+ - Code organization and structure assessment
13
+
14
+ ## Analysis Objectives
15
+
16
+ 1. **Architectural Pattern Identification**: Identify the architectural patterns used in the codebase
17
+ 2. **Dependency Analysis**: Analyze dependencies between modules, components, and layers
18
+ 3. **Coupling Assessment**: Evaluate the level and types of coupling in the system
19
+ 4. **Design Principle Compliance**: Assess adherence to SOLID principles and other design guidelines
20
+ 5. **Architectural Decision Documentation**: Document key architectural decisions and their rationale
21
+ 6. **Improvement Recommendations**: Provide actionable recommendations for architectural improvements
22
+
23
+ ## Required Analysis Steps
24
+
25
+ ### 1. High-Level Architecture Assessment
26
+
27
+ - Identify the overall architectural style (monolith, microservices, layered, etc.)
28
+ - Map the main architectural components and their relationships
29
+ - Assess the separation of concerns across the codebase
30
+ - Identify architectural boundaries and interfaces
31
+
32
+ ### 2. Dependency Analysis
33
+
34
+ - Create a dependency graph of major components
35
+ - Analyze import/require statements to understand dependencies
36
+ - Identify circular dependencies and dependency cycles
37
+ - Assess dependency direction and layering
38
+
39
+ ### 3. Design Pattern Recognition
40
+
41
+ - Identify common design patterns used in the codebase
42
+ - Assess pattern implementation quality and consistency
43
+ - Identify anti-patterns and architectural smells
44
+ - Document pattern usage and effectiveness
45
+
46
+ ### 4. Coupling and Cohesion Analysis
47
+
48
+ - Measure coupling between modules and components
49
+ - Assess cohesion within modules and classes
50
+ - Identify tightly coupled areas that need refactoring
51
+ - Evaluate the impact of coupling on maintainability
52
+
53
+ ### 5. SOLID Principles Assessment
54
+
55
+ - Evaluate adherence to Single Responsibility Principle
56
+ - Assess Open/Closed Principle compliance
57
+ - Analyze Liskov Substitution Principle usage
58
+ - Review Interface Segregation Principle implementation
59
+ - Evaluate Dependency Inversion Principle application
60
+
61
+ ### 6. Architectural Decision Analysis
62
+
63
+ - Document key architectural decisions made in the codebase
64
+ - Assess the rationale behind architectural choices
65
+ - Identify architectural debt and technical debt
66
+ - Evaluate the impact of architectural decisions on maintainability
67
+
68
+ ## Output Requirements
69
+
70
+ ### Primary Output: Architecture Analysis Report
71
+
72
+ Create a comprehensive markdown report that includes:
73
+
74
+ 1. **Executive Summary**
75
+ - Overall architectural assessment
76
+ - Key findings and recommendations
77
+ - Architectural health score
78
+
79
+ 2. **Architectural Overview**
80
+ - High-level architecture diagram (text-based or Mermaid)
81
+ - Main architectural components and their roles
82
+ - Architectural style and patterns used
83
+
84
+ 3. **Dependency Analysis**
85
+ - Dependency graph and relationships
86
+ - Circular dependency identification
87
+ - Dependency layering assessment
88
+ - Import/require analysis
89
+
90
+ 4. **Design Pattern Analysis**
91
+ - Identified design patterns with examples
92
+ - Pattern implementation quality assessment
93
+ - Anti-patterns and architectural smells
94
+ - Pattern usage recommendations
95
+
96
+ 5. **Coupling and Cohesion Assessment**
97
+ - Coupling metrics and analysis
98
+ - Cohesion assessment by module/component
99
+ - Tightly coupled areas requiring attention
100
+ - Impact on maintainability and testability
101
+
102
+ 6. **SOLID Principles Evaluation**
103
+ - Principle-by-principle assessment
104
+ - Violations and their impact
105
+ - Improvement opportunities
106
+ - Refactoring recommendations
107
+
108
+ 7. **Architectural Recommendations**
109
+ - Priority-based improvement suggestions
110
+ - Refactoring strategies for high-impact areas
111
+ - Architectural debt reduction plan
112
+ - Long-term architectural evolution guidance
113
+
114
+ ### Secondary Output: Architecture Patterns Document
115
+
116
+ Create a document that includes:
117
+
118
+ - Detailed pattern analysis with code examples
119
+ - Pattern implementation guidelines
120
+ - Anti-pattern identification and resolution strategies
121
+
122
+ ## Analysis Guidelines
123
+
124
+ - **Big-Picture Thinking**: Focus on system-level architecture and design
125
+ - **Pattern Recognition**: Identify both explicit and implicit architectural patterns
126
+ - **Practical Assessment**: Evaluate architecture in terms of maintainability and evolvability
127
+ - **Actionable Recommendations**: Provide specific, implementable improvement suggestions
128
+ - **Context Awareness**: Consider the project's constraints and requirements
129
+
130
+ ## Questions to Ask (if needed)
131
+
132
+ If you need more information to complete the analysis, ask about:
133
+
134
+ - Project goals and constraints
135
+ - Team size and expertise
136
+ - Performance requirements
137
+ - Scalability needs
138
+ - Integration requirements
139
+ - Deployment architecture
140
+ - Technology stack decisions
141
+ - Future development plans
142
+
143
+ ## Tools and Techniques
144
+
145
+ - **Dependency Analysis**: Use static analysis tools to map dependencies
146
+ - **Pattern Recognition**: Analyze code structure for common patterns
147
+ - **Coupling Metrics**: Measure coupling using appropriate metrics
148
+ - **Architecture Visualization**: Create diagrams to illustrate structure
149
+ - **Code Review**: Manual analysis of key architectural components
150
+
151
+ Remember: Your analysis should focus on architectural quality, maintainability, and the long-term health of the codebase. Provide insights that will help the team make informed architectural decisions and improve the overall system design.