ref-agents 1.0.0__py3-none-any.whl

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 (175) hide show
  1. ref_agents/__init__.py +9 -0
  2. ref_agents/api_keys.json.example +8 -0
  3. ref_agents/auth.py +129 -0
  4. ref_agents/codemap/..md +62 -0
  5. ref_agents/codemap/CODE_MAP.md +37 -0
  6. ref_agents/codemap/core.md +43 -0
  7. ref_agents/codemap/models.md +43 -0
  8. ref_agents/codemap/prompts.md +40 -0
  9. ref_agents/codemap/security.md +45 -0
  10. ref_agents/codemap/tools.md +94 -0
  11. ref_agents/codemap/tools_browser.md +44 -0
  12. ref_agents/codemap/utils.md +42 -0
  13. ref_agents/codemap/workflow.md +42 -0
  14. ref_agents/config/ai_patterns.yaml +101 -0
  15. ref_agents/config/frameworks/angular.yaml +104 -0
  16. ref_agents/config/frameworks/aspnet.yaml +84 -0
  17. ref_agents/config/frameworks/ef_core.yaml +81 -0
  18. ref_agents/config/frameworks/react.yaml +111 -0
  19. ref_agents/config/frameworks/spring_boot.yaml +117 -0
  20. ref_agents/config/languages/csharp.yaml +153 -0
  21. ref_agents/config/languages/java.yaml +188 -0
  22. ref_agents/config/languages/javascript.yaml +172 -0
  23. ref_agents/config/languages/python.yaml +153 -0
  24. ref_agents/config/languages/typescript.yaml +193 -0
  25. ref_agents/constants.py +553 -0
  26. ref_agents/core/__init__.py +15 -0
  27. ref_agents/core/config_loader.py +160 -0
  28. ref_agents/core/config_models.py +167 -0
  29. ref_agents/core/config_parsing.py +84 -0
  30. ref_agents/core/language_detector.py +388 -0
  31. ref_agents/core/validation_models.py +66 -0
  32. ref_agents/core/validation_primitives.py +176 -0
  33. ref_agents/errors.py +34 -0
  34. ref_agents/license_client.py +247 -0
  35. ref_agents/models/__init__.py +22 -0
  36. ref_agents/models/gherkin.py +45 -0
  37. ref_agents/models/hierarchy.py +80 -0
  38. ref_agents/models/invest.py +59 -0
  39. ref_agents/models/version.py +49 -0
  40. ref_agents/prompts/__init__.py +9 -0
  41. ref_agents/prompts/start_agent.py +772 -0
  42. ref_agents/rules/architecture/backend_patterns.md +43 -0
  43. ref_agents/rules/architecture/diagramming.md +100 -0
  44. ref_agents/rules/architecture/frontend_patterns.md +40 -0
  45. ref_agents/rules/architecture/impact_analysis.md +129 -0
  46. ref_agents/rules/architecture/migration_strategy.md +208 -0
  47. ref_agents/rules/architecture/regression_protocol.md +77 -0
  48. ref_agents/rules/architecture/system_design.md +97 -0
  49. ref_agents/rules/common/codemap_standard.md +97 -0
  50. ref_agents/rules/common/core_protocol.md +59 -0
  51. ref_agents/rules/common/prompt_engineering.md +294 -0
  52. ref_agents/rules/development/debugging.md +32 -0
  53. ref_agents/rules/development/implementation.md +205 -0
  54. ref_agents/rules/operations/completion.md +119 -0
  55. ref_agents/rules/operations/cutover_protocol.md +218 -0
  56. ref_agents/rules/operations/discovery.md +179 -0
  57. ref_agents/rules/operations/fix_workflow.md +87 -0
  58. ref_agents/rules/operations/forensics.md +278 -0
  59. ref_agents/rules/operations/platform.md +263 -0
  60. ref_agents/rules/operations/synchronous_flow.md +25 -0
  61. ref_agents/rules/product/ac_validation.md +25 -0
  62. ref_agents/rules/product/brainstorming.md +27 -0
  63. ref_agents/rules/product/ref_flow.md +101 -0
  64. ref_agents/rules/product/requirements_std.md +114 -0
  65. ref_agents/rules/product/spec_writing.md +235 -0
  66. ref_agents/rules/product/strategy.md +96 -0
  67. ref_agents/rules/quality/documentation_standards.md +46 -0
  68. ref_agents/rules/quality/parity_testing.md +234 -0
  69. ref_agents/rules/quality/project_documentation.md +56 -0
  70. ref_agents/rules/quality/qa_lead.md +111 -0
  71. ref_agents/rules/quality/test_design.md +146 -0
  72. ref_agents/rules/quality/testing_standards.md +293 -0
  73. ref_agents/rules/review/pr_review.md +116 -0
  74. ref_agents/rules/security/security_audit.md +83 -0
  75. ref_agents/security/__init__.py +22 -0
  76. ref_agents/security/dependency_audit.py +188 -0
  77. ref_agents/security/file_audit.py +208 -0
  78. ref_agents/security/network_scan.py +179 -0
  79. ref_agents/security/report_generator.py +313 -0
  80. ref_agents/security/secret_scan.py +252 -0
  81. ref_agents/security/url_scan.py +240 -0
  82. ref_agents/security_scan.py +236 -0
  83. ref_agents/server.py +1586 -0
  84. ref_agents/session.py +100 -0
  85. ref_agents/tool_names.py +55 -0
  86. ref_agents/tools/__init__.py +8 -0
  87. ref_agents/tools/agents_generator.py +315 -0
  88. ref_agents/tools/ai_pattern_detector.py +815 -0
  89. ref_agents/tools/brownfield_populator.py +529 -0
  90. ref_agents/tools/browser/__init__.py +50 -0
  91. ref_agents/tools/browser/evidence_verifier.py +302 -0
  92. ref_agents/tools/browser/execution_logger.py +249 -0
  93. ref_agents/tools/browser/playwright_mcp_client.py +259 -0
  94. ref_agents/tools/browser/screenshot_utils.py +184 -0
  95. ref_agents/tools/browser/test_executor.py +537 -0
  96. ref_agents/tools/code_quality_scanner.py +629 -0
  97. ref_agents/tools/codemap/..md +93 -0
  98. ref_agents/tools/codemap/CODE_MAP.md +30 -0
  99. ref_agents/tools/codemap/browser.md +44 -0
  100. ref_agents/tools/codemap.py +403 -0
  101. ref_agents/tools/codemap_freshness.py +234 -0
  102. ref_agents/tools/comment_smell_scanner.py +346 -0
  103. ref_agents/tools/complexity.py +436 -0
  104. ref_agents/tools/complexity_ast.py +333 -0
  105. ref_agents/tools/compliance.py +246 -0
  106. ref_agents/tools/compliance_remediation.py +846 -0
  107. ref_agents/tools/context_graph.py +839 -0
  108. ref_agents/tools/context_manager.py +550 -0
  109. ref_agents/tools/context_tools.py +121 -0
  110. ref_agents/tools/cross_repo_linker.py +393 -0
  111. ref_agents/tools/dead_code_scanner.py +637 -0
  112. ref_agents/tools/debt_scanner.py +1092 -0
  113. ref_agents/tools/dependency_graph.py +272 -0
  114. ref_agents/tools/discovery_audit.py +372 -0
  115. ref_agents/tools/docs_scanner.py +600 -0
  116. ref_agents/tools/evaluate_gate.py +119 -0
  117. ref_agents/tools/external_detector.py +524 -0
  118. ref_agents/tools/features_generator.py +282 -0
  119. ref_agents/tools/flow_gap_detector.py +373 -0
  120. ref_agents/tools/flow_mapper.py +327 -0
  121. ref_agents/tools/full_suite_runner.py +740 -0
  122. ref_agents/tools/gherkin_parser.py +227 -0
  123. ref_agents/tools/guard_tools.py +139 -0
  124. ref_agents/tools/handoff_tools.py +282 -0
  125. ref_agents/tools/health_scanner.py +1211 -0
  126. ref_agents/tools/hierarchy_manager.py +289 -0
  127. ref_agents/tools/invest_scorer.py +249 -0
  128. ref_agents/tools/jira_confluence_export.py +306 -0
  129. ref_agents/tools/json_output.py +76 -0
  130. ref_agents/tools/migration_mapper.py +946 -0
  131. ref_agents/tools/migration_readiness_scanner.py +209 -0
  132. ref_agents/tools/pattern_learner.py +522 -0
  133. ref_agents/tools/report_utils.py +155 -0
  134. ref_agents/tools/requirements_serializer.py +225 -0
  135. ref_agents/tools/security_audit_tool.py +106 -0
  136. ref_agents/tools/sequencing_engine.py +288 -0
  137. ref_agents/tools/summary_generator.py +275 -0
  138. ref_agents/tools/symbol_resolver.py +306 -0
  139. ref_agents/tools/symbol_smoke_runner.py +336 -0
  140. ref_agents/tools/test_plan_validator.py +189 -0
  141. ref_agents/tools/test_smell_walker.py +902 -0
  142. ref_agents/tools/tier1_fixer.py +502 -0
  143. ref_agents/tools/validators/__init__.py +419 -0
  144. ref_agents/tools/validators/architect.py +268 -0
  145. ref_agents/tools/validators/cutover_engineer.py +167 -0
  146. ref_agents/tools/validators/developer.py +180 -0
  147. ref_agents/tools/validators/discovery.py +150 -0
  148. ref_agents/tools/validators/forensic_engineer.py +191 -0
  149. ref_agents/tools/validators/impact_architect.py +181 -0
  150. ref_agents/tools/validators/migration_planner.py +166 -0
  151. ref_agents/tools/validators/parity_tester.py +155 -0
  152. ref_agents/tools/validators/platform_engineer.py +134 -0
  153. ref_agents/tools/validators/pr_reviewer.py +129 -0
  154. ref_agents/tools/validators/product_manager.py +291 -0
  155. ref_agents/tools/validators/qa_lead.py +172 -0
  156. ref_agents/tools/validators/scrum_master.py +212 -0
  157. ref_agents/tools/validators/security_owner.py +162 -0
  158. ref_agents/tools/validators/specifier.py +134 -0
  159. ref_agents/tools/validators/strategist.py +149 -0
  160. ref_agents/tools/validators/tester.py +121 -0
  161. ref_agents/tools/version_manager.py +202 -0
  162. ref_agents/tools/workflow_tools.py +1549 -0
  163. ref_agents/utils/__init__.py +21 -0
  164. ref_agents/utils/git_utils.py +351 -0
  165. ref_agents/utils/handoff_logger.py +368 -0
  166. ref_agents/utils/ignore_matcher.py +270 -0
  167. ref_agents/workflow/__init__.py +19 -0
  168. ref_agents/workflow/capabilities.py +328 -0
  169. ref_agents/workflow/state_machine.py +708 -0
  170. ref_agents/workflow/transitions.py +658 -0
  171. ref_agents-1.0.0.dist-info/METADATA +365 -0
  172. ref_agents-1.0.0.dist-info/RECORD +175 -0
  173. ref_agents-1.0.0.dist-info/WHEEL +4 -0
  174. ref_agents-1.0.0.dist-info/entry_points.txt +2 -0
  175. ref_agents-1.0.0.dist-info/licenses/LICENSE +115 -0
@@ -0,0 +1,153 @@
1
+ # C# Language Configuration for REF Agents
2
+ # Used by debt_scanner, ai_pattern_detector, compliance tools
3
+
4
+ language: csharp
5
+ extensions: [".cs", ".csx"]
6
+ parser: regex
7
+
8
+ # Debt detection patterns
9
+ debt_patterns:
10
+ todo_fixme:
11
+ description: "TODO/FIXME comments indicate incomplete work"
12
+ severity: medium
13
+ pattern: "//\\s*(TODO|FIXME|XXX|HACK|BUG)[\\s:]+(.+)"
14
+ suggestion: "Address the TODO or create a tracked issue"
15
+
16
+ async_void:
17
+ description: "async void swallows exceptions; callers cannot await or catch"
18
+ severity: critical
19
+ pattern: "async\\s+void\\s+\\w+\\s*\\([^)]*\\)"
20
+ suggestion: "Use async Task instead of async void (exception: event handlers with EventArgs parameter)"
21
+
22
+ task_result_wait:
23
+ description: ".Result and .Wait() block the thread and cause deadlocks in ASP.NET context"
24
+ severity: critical
25
+ pattern: "\\.Result\\b|\\.Wait\\(\\)"
26
+ suggestion: "Use await instead of .Result/.Wait()"
27
+
28
+ empty_catch:
29
+ description: "Empty catch blocks swallow exceptions silently"
30
+ severity: high
31
+ pattern: "catch\\s*(?:\\([^)]*\\))?\\s*\\{\\s*\\}"
32
+ suggestion: "Log or handle the exception; never swallow silently"
33
+
34
+ catch_exception:
35
+ description: "Catching generic Exception masks specific failures"
36
+ severity: high
37
+ pattern: "catch\\s*\\(\\s*Exception\\s+"
38
+ suggestion: "Catch specific exception types: IOException, InvalidOperationException, etc."
39
+
40
+ console_write:
41
+ description: "Console.Write* bypasses structured logging; no levels, rotation, or observability"
42
+ severity: high
43
+ pattern: "Console\\.(Write|WriteLine|Error)\\b"
44
+ suggestion: "Use ILogger<T> injected via DI: _logger.LogInformation(), _logger.LogError()"
45
+
46
+ hardcoded_credential:
47
+ description: "Hardcoded connection strings and passwords are a security vulnerability"
48
+ severity: critical
49
+ pattern: "(?i)(ConnectionString|Password|ApiKey|Secret)\\s*=\\s*\"[^\"]{4,}\""
50
+ suggestion: "Use IConfiguration / environment variables / Azure Key Vault / AWS Secrets Manager"
51
+
52
+ gc_collect:
53
+ description: "Explicit GC.Collect() degrades throughput and indicates a memory management problem"
54
+ severity: medium
55
+ pattern: "GC\\.Collect\\s*\\("
56
+ suggestion: "Remove GC.Collect(). Fix the root cause: IDisposable misuse or large object pinning"
57
+
58
+ pragma_warning_disable:
59
+ description: "#pragma warning disable without inline justification hides real issues"
60
+ severity: medium
61
+ pattern: "#pragma\\s+warning\\s+disable(?!\\s+\\d+\\s*//)"
62
+ suggestion: "Add an inline comment explaining why the warning is suppressed"
63
+
64
+ interface_no_i_prefix:
65
+ description: "Interface name missing 'I' prefix violates .NET naming convention"
66
+ severity: medium
67
+ pattern: "\\binterface\\s+(?!I)[A-Z]\\w*"
68
+ suggestion: "Rename interface to start with 'I' (e.g., IRepository, IService)"
69
+
70
+ private_field_no_underscore:
71
+ description: "Private field missing '_' prefix violates .NET naming convention"
72
+ severity: low
73
+ pattern: "private\\s+(?:readonly\\s+)?[\\w<>\\[\\]]+\\s+(?!_)[a-z]\\w*\\s*[;=]"
74
+ suggestion: "Prefix private fields with underscore: private readonly ILogger _logger"
75
+
76
+ magic_numbers:
77
+ description: "Magic numbers violate DRY and hurt maintainability"
78
+ severity: low
79
+ pattern: "(?<![\\w.])\\d{2,}(?![\\w.])"
80
+ suggestion: "Extract to named constants: private const int MaxRetries = 3"
81
+
82
+ missing_xml_doc:
83
+ description: "Public API missing XML documentation"
84
+ severity: medium
85
+ pattern: "^\\s*public\\s+(?!override\\s+string\\s+ToString)(?:(?:static|abstract|virtual|sealed|async|partial)\\s+)*(?!class|interface|struct|record|enum)[\\w<>\\[\\]]+\\s+\\w+\\s*\\("
86
+ suggestion: "Add XML doc: /// <summary>...</summary> with <param> and <returns>"
87
+
88
+ # Deprecated API patterns
89
+ deprecated_imports:
90
+ "System.Threading.Thread.Sleep": "Use Task.Delay with await for async code"
91
+ "System.Web.HttpContext": "Use Microsoft.AspNetCore.Http.IHttpContextAccessor"
92
+ "System.Web.Mvc": "Use Microsoft.AspNetCore.Mvc"
93
+ "System.Web.Http": "Use Microsoft.AspNetCore.Mvc"
94
+
95
+ # Naming conventions (reference — enforced subset uses regex patterns above)
96
+ naming:
97
+ generic_names:
98
+ - data
99
+ - result
100
+ - temp
101
+ - obj
102
+ - val
103
+ - item
104
+ - list
105
+ - map
106
+ - str
107
+ - num
108
+ - flag
109
+ - x
110
+ - y
111
+ - z
112
+
113
+ conventions:
114
+ classes: PascalCase
115
+ interfaces: PascalCase with I prefix (e.g. IRepository)
116
+ methods: PascalCase
117
+ properties: PascalCase
118
+ private_fields: _camelCase (underscore prefix)
119
+ local_variables: camelCase
120
+ constants: PascalCase (for public) or ALL_CAPS (for private static readonly)
121
+ namespaces: PascalCase.PascalCase
122
+
123
+ # Quality thresholds
124
+ thresholds:
125
+ complexity: 12
126
+ function_length: 50
127
+ nesting_depth: 3
128
+ file_length: 400
129
+ comment_ratio: 0.3
130
+ class_ratio: 0.3
131
+
132
+ # File exclusions
133
+ exclusions:
134
+ skip_analysis:
135
+ - "**/.git/**"
136
+ - "**/bin/**"
137
+ - "**/obj/**"
138
+ - "**/.vs/**"
139
+ - "**/Migrations/**"
140
+ - "**/.*/**"
141
+ - "**/packages/**"
142
+ - "**/node_modules/**"
143
+
144
+ # AI anti-patterns
145
+ anti_patterns:
146
+ god_class:
147
+ description: "Class with too many responsibilities"
148
+ max_methods: 20
149
+ max_fields: 15
150
+
151
+ copy_paste:
152
+ description: "Duplicated code blocks"
153
+ min_block_size: 5
@@ -0,0 +1,188 @@
1
+ # Java Language Configuration for REF Agents
2
+
3
+ language: java
4
+ extensions: [".java"]
5
+ parser: regex
6
+
7
+ # Debt detection patterns
8
+ debt_patterns:
9
+ todo_fixme:
10
+ description: "TODO/FIXME comments indicate incomplete work"
11
+ severity: medium
12
+ pattern: "//\\s*(TODO|FIXME|XXX|HACK|BUG)[\\s:]+(.+)"
13
+ suggestion: "Address the TODO or create a tracked issue"
14
+
15
+ empty_catch:
16
+ description: "Empty catch blocks swallow exceptions"
17
+ severity: high
18
+ pattern: "catch\\s*\\([^)]+\\)\\s*\\{\\s*\\}"
19
+ suggestion: "Log or handle the exception"
20
+
21
+ catch_exception:
22
+ description: "Catching generic Exception masks bugs and catches RuntimeExceptions"
23
+ severity: high
24
+ pattern: "catch\\s*\\(\\s*Exception\\s+"
25
+ suggestion: "Catch specific exceptions: IOException, SQLException, etc."
26
+
27
+ catch_throwable:
28
+ description: "Catching Throwable includes Errors"
29
+ severity: high
30
+ pattern: "catch\\s*\\(\\s*Throwable\\s+"
31
+ suggestion: "Catch Exception, not Throwable"
32
+
33
+ system_out:
34
+ description: "System.out bypasses logging, no levels/rotation/structured output"
35
+ severity: high
36
+ pattern: "System\\.(out|err)\\.(print|println)\\("
37
+ suggestion: "Use SLF4J: logger.info(), logger.error()"
38
+
39
+ printStackTrace:
40
+ description: "printStackTrace sends to stderr"
41
+ severity: medium
42
+ pattern: "\\.printStackTrace\\(\\)"
43
+ suggestion: "Use logger.error with exception"
44
+
45
+ raw_types:
46
+ description: "Raw types bypass generics type safety"
47
+ severity: medium
48
+ pattern: "\\b(List|Map|Set|Collection)\\s+\\w+\\s*="
49
+ suggestion: "Use parameterized types: List<String>"
50
+
51
+ string_concat_loop:
52
+ description: "String concatenation in loops is inefficient"
53
+ severity: medium
54
+ pattern: "for.*\\+.*String|while.*\\+.*String"
55
+ suggestion: "Use StringBuilder"
56
+
57
+ public_fields:
58
+ description: "Public fields break encapsulation"
59
+ severity: medium
60
+ pattern: "public\\s+(?!static|final|class|interface|enum)\\w+\\s+\\w+\\s*;"
61
+ suggestion: "Use private fields with getters/setters"
62
+
63
+ magic_numbers:
64
+ description: "Magic numbers violate DRY and hurt maintainability"
65
+ severity: medium
66
+ pattern: "(?<!\\d)[0-9]{2,}(?!\\d)"
67
+ suggestion: "Extract to named constants (e.g., private static final int MAX_RETRIES = 3)"
68
+
69
+ missing_javadoc:
70
+ description: "Public APIs must be documented for maintainability"
71
+ severity: medium
72
+ pattern: "public\\s+(?!class)\\w+.*\\{"
73
+ suggestion: "Add Javadoc with @param, @return, @throws"
74
+
75
+ # Code Quality Patterns
76
+ unused_import:
77
+ description: "Unused imports clutter code"
78
+ severity: low
79
+ pattern: "^import\\s+.*;"
80
+ suggestion: "Remove unused imports (IDE can auto-remove)"
81
+
82
+ null_pointer_risk:
83
+ description: "Potential null pointer dereference"
84
+ severity: high
85
+ pattern: "\\w+\\.\\w+\\(\\).*\\.\\w+|\\w+\\[.*\\]\\.\\w+"
86
+ suggestion: "Add null checks or use Optional"
87
+
88
+ missing_override:
89
+ description: "Method overrides without @Override annotation"
90
+ severity: medium
91
+ pattern: "public\\s+\\w+\\s+\\w+\\s*\\([^)]*\\)"
92
+ suggestion: "Add @Override annotation for clarity"
93
+
94
+ equals_without_hashcode:
95
+ description: "Class overrides equals() but not hashCode()"
96
+ severity: high
97
+ pattern: "public\\s+boolean\\s+equals"
98
+ suggestion: "Override hashCode() when overriding equals()"
99
+
100
+ final_mutable_collections:
101
+ description: "Final collections can still be modified"
102
+ severity: medium
103
+ pattern: "final\\s+(List|Map|Set|Collection)"
104
+ suggestion: "Use Collections.unmodifiableList() or ImmutableList"
105
+
106
+ string_concatenation:
107
+ description: "String concatenation in loops is inefficient"
108
+ severity: medium
109
+ pattern: "for\\s*\\(.*\\+.*String|while\\s*\\(.*\\+.*String"
110
+ suggestion: "Use StringBuilder for multiple concatenations"
111
+
112
+ magic_string:
113
+ description: "Magic strings should be constants"
114
+ severity: medium
115
+ pattern: "['\"][A-Z_]{3,}['\"]"
116
+ suggestion: "Extract to named constants"
117
+
118
+ # Deprecated patterns
119
+ deprecated_imports:
120
+ "java.util.Date": "Use java.time.LocalDate/LocalDateTime"
121
+ "java.util.Calendar": "Use java.time API"
122
+ "java.util.Vector": "Use ArrayList or CopyOnWriteArrayList"
123
+ "java.util.Hashtable": "Use HashMap or ConcurrentHashMap"
124
+ "java.util.Stack": "Use Deque (ArrayDeque)"
125
+ "java.util.StringTokenizer": "Use String.split or Scanner"
126
+ "sun.misc.BASE64": "Use java.util.Base64"
127
+
128
+ # Naming conventions
129
+ naming:
130
+ generic_names:
131
+ - data
132
+ - result
133
+ - temp
134
+ - obj
135
+ - val
136
+ - item
137
+ - list
138
+ - map
139
+ - str
140
+ - num
141
+ - flag
142
+ - x
143
+ - y
144
+ - z
145
+
146
+ conventions:
147
+ classes: PascalCase
148
+ interfaces: PascalCase
149
+ methods: camelCase
150
+ variables: camelCase
151
+ constants: UPPER_SNAKE_CASE
152
+ packages: lowercase
153
+
154
+ # Quality thresholds (production-grade)
155
+ thresholds:
156
+ complexity: 12 # Maintainable, testable code
157
+ function_length: 50 # Single responsibility
158
+ nesting_depth: 3 # Readable code
159
+ file_length: 400 # Encourages class extraction
160
+ comment_ratio: 0.3
161
+ class_ratio: 0.3
162
+
163
+ # File exclusions
164
+ exclusions:
165
+ # Skip entire analysis (autogenerated, vendor, coverage, hidden dirs, data files)
166
+ skip_analysis:
167
+ - "**/.git/**"
168
+ - "**/target/**"
169
+ - "**/build/**"
170
+ - "**/.gradle/**"
171
+ - "**/.mvn/**"
172
+ - "**/.*/**" # Hidden directories
173
+ - "**/*.json" # JSON files excluded from complexity checks
174
+ - "**/vendor/**"
175
+ - "**/vendors/**"
176
+ - "**/third-party/**"
177
+ - "**/third_party/**"
178
+
179
+ # AI anti-patterns
180
+ anti_patterns:
181
+ god_class:
182
+ description: "Class with too many responsibilities"
183
+ max_methods: 20
184
+ max_fields: 15
185
+
186
+ copy_paste:
187
+ description: "Duplicated code blocks"
188
+ min_block_size: 5
@@ -0,0 +1,172 @@
1
+ # JavaScript Language Configuration for REF Agents
2
+
3
+ language: javascript
4
+ extensions: [".js", ".jsx", ".mjs", ".cjs"]
5
+ parser: regex
6
+
7
+ # Debt detection patterns
8
+ debt_patterns:
9
+ todo_fixme:
10
+ description: "TODO/FIXME comments indicate incomplete work"
11
+ severity: medium
12
+ pattern: "//\\s*(TODO|FIXME|XXX|HACK|BUG)[\\s:]+(.+)"
13
+ suggestion: "Address the TODO or create a tracked issue"
14
+
15
+ var_usage:
16
+ description: "Using var instead of let/const"
17
+ severity: medium
18
+ pattern: "\\bvar\\s+\\w+"
19
+ suggestion: "Use const for constants, let for variables"
20
+
21
+ console_log:
22
+ description: "console.log leaks to production, use structured logging"
23
+ severity: high
24
+ pattern: "console\\.(log|debug|info|warn|error)\\("
25
+ suggestion: "Use structured logging library (e.g., pino, winston)"
26
+
27
+ empty_catch:
28
+ description: "Empty catch blocks swallow errors"
29
+ severity: high
30
+ pattern: "catch\\s*\\([^)]*\\)\\s*\\{\\s*\\}"
31
+ suggestion: "Handle or log the error"
32
+
33
+ eval_usage:
34
+ description: "eval() is a security risk"
35
+ severity: critical
36
+ pattern: "\\beval\\s*\\("
37
+ suggestion: "Use safer alternatives like JSON.parse"
38
+
39
+ document_write:
40
+ description: "document.write is deprecated"
41
+ severity: high
42
+ pattern: "document\\.write\\("
43
+ suggestion: "Use DOM manipulation methods"
44
+
45
+ innerhtml_assignment:
46
+ description: "innerHTML can cause XSS vulnerabilities"
47
+ severity: high
48
+ pattern: "\\.innerHTML\\s*="
49
+ suggestion: "Use textContent or sanitize input"
50
+
51
+ sync_xhr:
52
+ description: "Synchronous XHR blocks the main thread"
53
+ severity: high
54
+ pattern: "XMLHttpRequest.*false\\s*\\)"
55
+ suggestion: "Use async requests or fetch API"
56
+
57
+ # Code Quality Patterns
58
+ unused_import:
59
+ description: "Unused imports increase bundle size"
60
+ severity: low
61
+ pattern: "^import\\s+.*from|require\\s*\\(['\"].*['\"]\\)"
62
+ suggestion: "Remove unused imports"
63
+
64
+ missing_async_await:
65
+ description: "Promise not awaited"
66
+ severity: high
67
+ pattern: "Promise\\s*\\.(then|catch)\\s*\\("
68
+ suggestion: "Use async/await for better error handling"
69
+
70
+ direct_mutation:
71
+ description: "Direct state mutation in React/Redux"
72
+ severity: critical
73
+ pattern: "\\.(push|pop|shift|unshift|splice|sort|reverse)\\s*\\(|\\w+\\s*=\\s*\\w+\\["
74
+ suggestion: "Use immutable patterns (spread, map, filter)"
75
+
76
+ loose_equality:
77
+ description: "Using == instead of === loses type safety"
78
+ severity: medium
79
+ pattern: "\\s==\\s"
80
+ suggestion: "Use === for strict equality"
81
+
82
+ typeof_undefined:
83
+ description: "typeof undefined is unnecessary"
84
+ severity: low
85
+ pattern: "typeof\\s+\\w+\\s*===\\s*['\"]undefined['\"]"
86
+ suggestion: "Use !== undefined or optional chaining"
87
+
88
+ with_statement:
89
+ description: "with statement is deprecated and error-prone"
90
+ severity: high
91
+ pattern: "\\bwith\\s*\\("
92
+ suggestion: "Use explicit variable references"
93
+
94
+ # Deprecated patterns
95
+ deprecated_imports:
96
+ "jquery": "Consider using vanilla JS or modern frameworks"
97
+ "underscore": "Use native array methods or lodash-es"
98
+ "moment": "Use date-fns or dayjs"
99
+
100
+ # Naming conventions
101
+ naming:
102
+ generic_names:
103
+ - data
104
+ - result
105
+ - temp
106
+ - handler
107
+ - callback
108
+ - cb
109
+ - fn
110
+ - val
111
+ - obj
112
+ - arr
113
+ - x
114
+ - y
115
+ - z
116
+
117
+ conventions:
118
+ functions: camelCase
119
+ classes: PascalCase
120
+ constants: UPPER_SNAKE_CASE
121
+ variables: camelCase
122
+
123
+ # Quality thresholds
124
+ thresholds:
125
+ complexity: 15
126
+ function_length: 80
127
+ nesting_depth: 4
128
+ file_length: 400
129
+ comment_ratio: 0.3
130
+ class_ratio: 0.5
131
+
132
+ # File exclusions (autogenerated, vendor, coverage, hidden dirs)
133
+ exclusions:
134
+ # Skip entire analysis (autogenerated, vendor, coverage, hidden dirs)
135
+ skip_analysis:
136
+ - "**/node_modules/**"
137
+ - "**/.next/**"
138
+ - "**/.nuxt/**"
139
+ - "**/.cache/**"
140
+ - "**/.git/**"
141
+ - "**/coverage/**"
142
+ - "**/dist/**"
143
+ - "**/build/**"
144
+ - "**/.dist/**"
145
+ - "**/.build/**"
146
+ - "**/.*/**" # Hidden directories (e.g., .vscode, .idea)
147
+ - "**/*.generated.js"
148
+ - "**/*.generated.jsx"
149
+ - "**/*.auto.js"
150
+ - "**/*.auto.jsx"
151
+ - "**/*.json" # JSON files excluded from complexity checks
152
+ - "**/vendor/**"
153
+ - "**/vendors/**"
154
+ - "**/third-party/**"
155
+ - "**/third_party/**"
156
+
157
+ # Skip file-level complexity check only (still analyze per-function)
158
+ file_complexity:
159
+ - "*.test.js"
160
+ - "*.test.jsx"
161
+ - "*.spec.js"
162
+ - "*.spec.jsx"
163
+
164
+ # AI anti-patterns
165
+ anti_patterns:
166
+ callback_hell:
167
+ description: "Deeply nested callbacks"
168
+ max_depth: 3
169
+
170
+ copy_paste:
171
+ description: "Duplicated code blocks"
172
+ min_block_size: 5
@@ -0,0 +1,153 @@
1
+ # Python Language Configuration for REF Agents
2
+ # Used by debt_scanner, ai_pattern_detector, compliance tools
3
+
4
+ language: python
5
+ extensions: [".py", ".pyw", ".pyi"]
6
+ parser: ast
7
+
8
+ # Debt detection patterns
9
+ debt_patterns:
10
+ todo_fixme:
11
+ description: "TODO/FIXME comments indicate incomplete work"
12
+ severity: medium
13
+ pattern: "#\\s*(TODO|FIXME|XXX|HACK|BUG)[\\s:]+(.+)"
14
+ suggestion: "Address the TODO or create a tracked issue"
15
+
16
+ bare_except:
17
+ description: "Bare except catches all exceptions including system exits"
18
+ severity: critical
19
+ ast_node: ExceptHandler
20
+ condition: "node.type is None"
21
+ suggestion: "Use specific exception types"
22
+
23
+ broad_except:
24
+ description: "except Exception is too broad"
25
+ severity: high
26
+ ast_node: ExceptHandler
27
+ condition: "node.type.id == 'Exception'"
28
+ suggestion: "Catch specific exceptions like ValueError, TypeError"
29
+
30
+ missing_type_hints:
31
+ description: "Type hints enable static analysis and catch bugs at dev time"
32
+ severity: high
33
+ ast_node: FunctionDef
34
+ condition: "no return type or missing arg types"
35
+ suggestion: "Add type hints: def func(arg: Type) -> ReturnType"
36
+
37
+ missing_docstring:
38
+ description: "Public APIs must be documented for maintainability"
39
+ severity: medium
40
+ ast_node: FunctionDef
41
+ condition: "not private and no docstring"
42
+ suggestion: "Add Google/Numpy style docstring with Args/Returns/Raises"
43
+
44
+ high_complexity:
45
+ description: "Function has too many branches"
46
+ severity: high
47
+ ast_node: FunctionDef
48
+ condition: "complexity > threshold"
49
+ suggestion: "Refactor into smaller functions"
50
+
51
+ long_function:
52
+ description: "Function exceeds line limit"
53
+ severity: medium
54
+ ast_node: FunctionDef
55
+ condition: "lines > threshold"
56
+ suggestion: "Break into smaller focused functions"
57
+
58
+ deep_nesting:
59
+ description: "Code is nested too deeply"
60
+ severity: medium
61
+ ast_node: FunctionDef
62
+ condition: "nesting > threshold"
63
+ suggestion: "Use early returns or extract methods"
64
+
65
+ # Deprecated imports
66
+ deprecated_imports:
67
+ distutils: "Use setuptools or build instead"
68
+ imp: "Use importlib instead"
69
+ optparse: "Use argparse instead"
70
+ formatter: "Removed in Python 3.10"
71
+ parser: "Use ast instead"
72
+ symbol: "Use ast instead"
73
+ asynchat: "Use asyncio instead"
74
+ asyncore: "Use asyncio instead"
75
+ smtpd: "Use aiosmtpd instead"
76
+ cgi: "Use modern web frameworks"
77
+ cgitb: "Use proper error handling"
78
+
79
+ # Naming conventions
80
+ naming:
81
+ generic_names:
82
+ - data
83
+ - result
84
+ - temp
85
+ - tmp
86
+ - handler
87
+ - manager
88
+ - helper
89
+ - utils
90
+ - misc
91
+ - stuff
92
+ - thing
93
+ - obj
94
+ - val
95
+ - var
96
+ - foo
97
+ - bar
98
+ - baz
99
+ - item
100
+ - elem
101
+ - info
102
+ - x
103
+ - y
104
+ - z
105
+
106
+ conventions:
107
+ functions: snake_case
108
+ classes: PascalCase
109
+ constants: UPPER_SNAKE_CASE
110
+ modules: snake_case
111
+ variables: snake_case
112
+
113
+ # Quality thresholds (production-grade)
114
+ thresholds:
115
+ complexity: 12 # Maintainable, testable code
116
+ function_length: 50 # Single responsibility
117
+ nesting_depth: 3 # Readable, avoid arrow anti-pattern
118
+ file_length: 300 # Encourages module extraction
119
+ comment_ratio: 0.4
120
+ class_ratio: 0.5
121
+
122
+ # File exclusions
123
+ exclusions:
124
+ # Skip entire analysis (autogenerated, vendor, coverage, hidden dirs, data files)
125
+ skip_analysis:
126
+ - "**/node_modules/**"
127
+ - "**/.git/**"
128
+ - "**/__pycache__/**"
129
+ - "**/.venv/**"
130
+ - "**/venv/**"
131
+ - "**/dist/**"
132
+ - "**/build/**"
133
+ - "**/coverage/**"
134
+ - "**/.*/**" # Hidden directories
135
+ - "**/*.json" # JSON files excluded from complexity checks
136
+ - "**/vendor/**"
137
+ - "**/vendors/**"
138
+ - "**/third-party/**"
139
+ - "**/third_party/**"
140
+
141
+ # AI anti-patterns
142
+ anti_patterns:
143
+ over_abstraction:
144
+ description: "Too many classes relative to functions"
145
+ threshold: 0.5
146
+
147
+ copy_paste:
148
+ description: "Duplicated code blocks"
149
+ min_block_size: 5
150
+
151
+ verbose_comments:
152
+ description: "Excessive comments"
153
+ max_ratio: 0.4