MCPcopy Create free account
hub / github.com/EvoMap/evolver / extractStepVerb

Function extractStepVerb

src/gep/skillPublisher.js:218–230  ·  view source on GitHub ↗

* Extract the leading verb from a strategy step for bolding. * Only extracts a single verb to avoid splitting compound phrases. * e.g. "Verify Cursor CLI installation" -> "Verify" * "Run `npm test` to check" -> "Run" * "Configure non-interactive mode" -> "Configure" * * Excludes anti

(step)

Source from the content-addressed store, hash-verified

216 * anti-pattern list items in the dedicated "## Avoid" section instead.
217 */
218function extractStepVerb(step) {
219 var ANTI_PATTERN_MARKERS = /^(AVOID|DO|DON'?T|NEVER|NOT|STOP|SKIP|IGNORE|FORBIDDEN|WARN|WARNING|CAUTION|NOTE)\b/i;
220 if (ANTI_PATTERN_MARKERS.test(step)) return '';
221 // Only match a capitalized verb at the very start (no leading backtick/special chars)
222 var match = step.match(/^([A-Z][a-z]+)/);
223 if (!match) return '';
224 // Extra safety: do not treat single-capital-letter + no-lowercase abbreviations
225 // (already filtered by the [a-z]+ requirement) or common non-verbs like
226 // "The", "This", "These", "Those" as verbs.
227 var DETERMINERS = new Set(['The', 'This', 'These', 'Those', 'That', 'A', 'An']);
228 if (DETERMINERS.has(match[1])) return '';
229 return match[1];
230}
231
232/**
233 * Remove the leading verb from a step (already shown in bold).

Callers 2

geneToSkillMdFunction · 0.85
stripLeadingVerbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected