88
99const fs = require ( 'fs' ) ;
1010const path = require ( 'path' ) ;
11- const agentPatterns = require ( './agent-patterns' ) ;
11+ const { agentPatterns } = require ( './agent-patterns' ) ;
1212
1313/**
1414 * Parse YAML frontmatter from markdown content
@@ -110,7 +110,7 @@ function analyzeAgent(agentPath, options = {}) {
110110 results . frontmatter = frontmatter ;
111111
112112 // Check for missing frontmatter
113- const missingFmPattern = agentPatterns . agentPatterns . missing_frontmatter ;
113+ const missingFmPattern = agentPatterns . missing_frontmatter ;
114114 const missingFmResult = missingFmPattern . check ( content ) ;
115115 if ( missingFmResult ) {
116116 results . structureIssues . push ( {
@@ -124,7 +124,7 @@ function analyzeAgent(agentPath, options = {}) {
124124 // If frontmatter exists, check its fields
125125 if ( frontmatter ) {
126126 // Check for missing name
127- const missingNamePattern = agentPatterns . agentPatterns . missing_name ;
127+ const missingNamePattern = agentPatterns . missing_name ;
128128 const missingNameResult = missingNamePattern . check ( frontmatter ) ;
129129 if ( missingNameResult ) {
130130 results . structureIssues . push ( {
@@ -136,7 +136,7 @@ function analyzeAgent(agentPath, options = {}) {
136136 }
137137
138138 // Check for missing description
139- const missingDescPattern = agentPatterns . agentPatterns . missing_description ;
139+ const missingDescPattern = agentPatterns . missing_description ;
140140 const missingDescResult = missingDescPattern . check ( frontmatter ) ;
141141 if ( missingDescResult ) {
142142 results . structureIssues . push ( {
@@ -148,7 +148,7 @@ function analyzeAgent(agentPath, options = {}) {
148148 }
149149
150150 // Check for unrestricted tools
151- const unrestrictedToolsPattern = agentPatterns . agentPatterns . unrestricted_tools ;
151+ const unrestrictedToolsPattern = agentPatterns . unrestricted_tools ;
152152 const unrestrictedToolsResult = unrestrictedToolsPattern . check ( frontmatter ) ;
153153 if ( unrestrictedToolsResult ) {
154154 results . toolIssues . push ( {
@@ -160,7 +160,7 @@ function analyzeAgent(agentPath, options = {}) {
160160 }
161161
162162 // Check for unrestricted Bash
163- const unrestrictedBashPattern = agentPatterns . agentPatterns . unrestricted_bash ;
163+ const unrestrictedBashPattern = agentPatterns . unrestricted_bash ;
164164 const unrestrictedBashResult = unrestrictedBashPattern . check ( frontmatter ) ;
165165 if ( unrestrictedBashResult ) {
166166 results . toolIssues . push ( {
@@ -174,7 +174,7 @@ function analyzeAgent(agentPath, options = {}) {
174174 }
175175
176176 // Check for missing role
177- const missingRolePattern = agentPatterns . agentPatterns . missing_role ;
177+ const missingRolePattern = agentPatterns . missing_role ;
178178 const missingRoleResult = missingRolePattern . check ( content ) ;
179179 if ( missingRoleResult ) {
180180 results . structureIssues . push ( {
@@ -187,7 +187,7 @@ function analyzeAgent(agentPath, options = {}) {
187187 }
188188
189189 // Check for missing output format
190- const missingOutputPattern = agentPatterns . agentPatterns . missing_output_format ;
190+ const missingOutputPattern = agentPatterns . missing_output_format ;
191191 const missingOutputResult = missingOutputPattern . check ( content ) ;
192192 if ( missingOutputResult ) {
193193 results . structureIssues . push ( {
@@ -199,7 +199,7 @@ function analyzeAgent(agentPath, options = {}) {
199199 }
200200
201201 // Check for missing constraints
202- const missingConstraintsPattern = agentPatterns . agentPatterns . missing_constraints ;
202+ const missingConstraintsPattern = agentPatterns . missing_constraints ;
203203 const missingConstraintsResult = missingConstraintsPattern . check ( content ) ;
204204 if ( missingConstraintsResult ) {
205205 results . structureIssues . push ( {
@@ -211,7 +211,7 @@ function analyzeAgent(agentPath, options = {}) {
211211 }
212212
213213 // Check for missing XML structure
214- const missingXmlPattern = agentPatterns . agentPatterns . missing_xml_structure ;
214+ const missingXmlPattern = agentPatterns . missing_xml_structure ;
215215 const missingXmlResult = missingXmlPattern . check ( content ) ;
216216 if ( missingXmlResult && ( options . verbose || missingXmlPattern . certainty !== 'LOW' ) ) {
217217 results . xmlIssues . push ( {
@@ -223,7 +223,7 @@ function analyzeAgent(agentPath, options = {}) {
223223 }
224224
225225 // Check for unnecessary CoT
226- const unnecessaryCotPattern = agentPatterns . agentPatterns . unnecessary_cot ;
226+ const unnecessaryCotPattern = agentPatterns . unnecessary_cot ;
227227 const unnecessaryCotResult = unnecessaryCotPattern . check ( content ) ;
228228 if ( unnecessaryCotResult && ( options . verbose || unnecessaryCotPattern . certainty !== 'LOW' ) ) {
229229 results . cotIssues . push ( {
@@ -235,7 +235,7 @@ function analyzeAgent(agentPath, options = {}) {
235235 }
236236
237237 // Check for missing CoT
238- const missingCotPattern = agentPatterns . agentPatterns . missing_cot ;
238+ const missingCotPattern = agentPatterns . missing_cot ;
239239 const missingCotResult = missingCotPattern . check ( content ) ;
240240 if ( missingCotResult && ( options . verbose || missingCotPattern . certainty !== 'LOW' ) ) {
241241 results . cotIssues . push ( {
@@ -247,7 +247,7 @@ function analyzeAgent(agentPath, options = {}) {
247247 }
248248
249249 // Check example count
250- const exampleCountPattern = agentPatterns . agentPatterns . example_count_suboptimal ;
250+ const exampleCountPattern = agentPatterns . example_count_suboptimal ;
251251 const exampleCountResult = exampleCountPattern . check ( content ) ;
252252 if ( exampleCountResult && options . verbose ) {
253253 results . exampleIssues . push ( {
@@ -259,7 +259,7 @@ function analyzeAgent(agentPath, options = {}) {
259259 }
260260
261261 // Check for vague instructions
262- const vaguePattern = agentPatterns . agentPatterns . vague_instructions ;
262+ const vaguePattern = agentPatterns . vague_instructions ;
263263 const vagueResult = vaguePattern . check ( content ) ;
264264 if ( vagueResult && ( options . verbose || vaguePattern . certainty !== 'LOW' ) ) {
265265 results . antiPatternIssues . push ( {
@@ -271,7 +271,7 @@ function analyzeAgent(agentPath, options = {}) {
271271 }
272272
273273 // Check for prompt bloat
274- const bloatPattern = agentPatterns . agentPatterns . prompt_bloat ;
274+ const bloatPattern = agentPatterns . prompt_bloat ;
275275 const bloatResult = bloatPattern . check ( content ) ;
276276 if ( bloatResult && options . verbose ) {
277277 results . antiPatternIssues . push ( {
0 commit comments