lean-spec 0.2.9 → 0.2.10

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.
@@ -12,132 +12,86 @@
12
12
 
13
13
  > **Why?** Skipping discovery creates duplicate work. Manual file creation breaks LeanSpec tooling.
14
14
 
15
- ## 🔧 How to Manage Specs
16
-
17
- ### Primary Method: MCP Tools (Recommended)
18
-
19
- If you have LeanSpec MCP tools available, **ALWAYS use them**:
20
-
21
- | Action | MCP Tool | Description |
22
- |--------|----------|-------------|
23
- | See project status | `board` | Kanban view + project health metrics |
24
- | List all specs | `list` | Filterable list with metadata |
25
- | Search specs | `search` | Semantic search across all content |
26
- | View a spec | `view` | Full content with formatting |
27
- | Create new spec | `create` | Auto-sequences, proper structure |
28
- | Update spec | `update` | Validates transitions, timestamps |
29
- | Link specs | `link` | Add dependencies (depends_on) |
30
- | Unlink specs | `unlink` | Remove dependencies |
31
- | Check dependencies | `deps` | Visual dependency graph |
32
-
33
- **Why MCP over CLI?**
34
- - Direct tool integration (no shell execution needed)
35
- - ✅ Structured responses (better for AI reasoning)
36
- - Real-time validation (immediate feedback)
37
- - Context-aware (understands project state)
38
-
39
- ### Fallback: CLI Commands
40
-
41
- If MCP tools are not available, use CLI commands:
42
-
43
- ```bash
44
- lean-spec board # Project overview
45
- lean-spec list # See all specs
46
- lean-spec search "query" # Find relevant specs
47
- lean-spec create <name> # Create new spec
48
- lean-spec update <spec> --status <status> # Update status
49
- lean-spec link <spec> --depends-on <other> # Add dependencies
50
- lean-spec unlink <spec> --depends-on <other> # Remove dependencies
51
- lean-spec deps <spec> # Show dependencies
52
- ```
53
-
54
- **Tip:** Check if you have LeanSpec MCP tools available before using CLI.
55
-
56
- ## ⚠️ SDD Workflow Checkpoints
57
-
58
- ### Before Starting ANY Task
59
-
60
- 1. 📋 **Run `board`** - What's the current project state?
61
- 2. 🔍 **Run `search`** - Are there related specs already?
62
- 3. 📝 **Check existing specs** - Is there one for this work?
63
-
64
- ### During Implementation
65
-
66
- 4. 📊 **Update status to `in-progress`** BEFORE coding
67
- 5. 📝 **Document decisions** in the spec as you work
68
- 6. 🔗 **Link dependencies** if you discover blocking relationships
69
-
70
- ### After Completing Work
71
-
72
- 7. ✅ **Update status to `complete`** when done
73
- 8. 📄 **Document what you learned** in the spec
74
- 9. 🤔 **Create follow-up specs** if needed
75
-
76
- ### 🚫 Common Mistakes to Avoid
15
+ ## 🔧 Managing Specs
16
+
17
+ ### MCP Tools (Preferred) with CLI Fallback
18
+
19
+ | Action | MCP Tool | CLI Fallback |
20
+ |--------|----------|--------------|
21
+ | Project status | `board` | `lean-spec board` |
22
+ | List specs | `list` | `lean-spec list` |
23
+ | Search specs | `search` | `lean-spec search "query"` |
24
+ | View spec | `view` | `lean-spec view <spec>` |
25
+ | Create spec | `create` | `lean-spec create <name>` |
26
+ | Update spec | `update` | `lean-spec update <spec> --status <status>` |
27
+ | Link specs | `link` | `lean-spec link <spec> --depends-on <other>` |
28
+ | Unlink specs | `unlink` | `lean-spec unlink <spec> --depends-on <other>` |
29
+ | Dependencies | `deps` | `lean-spec deps <spec>` |
30
+ | Token count | `tokens` | `lean-spec tokens <spec>` |
31
+
32
+ ## ⚠️ Core Rules
33
+
34
+ | Rule | Details |
35
+ |------|---------|
36
+ | **NEVER edit frontmatter manually** | Use `update`, `link`, `unlink` for: `status`, `priority`, `tags`, `assignee`, `transitions`, timestamps, `depends_on` |
37
+ | **ALWAYS link spec references** | Content mentions another spec → `lean-spec link <spec> --depends-on <other>` |
38
+ | **Track status transitions** | `planned` → `in-progress` (before coding) → `complete` (after done) |
39
+ | **No nested code blocks** | Use indentation instead |
40
+
41
+ ### 🚫 Common Mistakes
77
42
 
78
43
  | ❌ Don't | ✅ Do Instead |
79
44
  |----------|---------------|
80
45
  | Create spec files manually | Use `create` tool |
81
- | Skip discovery before new work | Run `board` and `search` first |
82
- | Leave status as "planned" after starting | Update to `in-progress` immediately |
83
- | Finish work without updating spec | Document decisions, update status |
46
+ | Skip discovery | Run `board` and `search` first |
47
+ | Leave status as "planned" | Update to `in-progress` before coding |
84
48
  | Edit frontmatter manually | Use `update` tool |
85
- | Forget about specs mid-conversation | Check spec status periodically |
86
-
87
- ## Core Rules
88
49
 
89
- 1. **Read README.md first** - Understand project context
90
- 2. **Check specs/** - Review existing specs before starting
91
- 3. **Use MCP tools** - Prefer MCP over CLI when available
92
- 4. **Follow LeanSpec principles** - Clarity over documentation
93
- 5. **Keep it minimal** - If it doesn't add clarity, cut it
94
- 6. **NEVER manually edit frontmatter** - Use `update`, `link`, `unlink` tools
95
- 7. **Track progress in specs** - Update status and document decisions
50
+ ## 📋 SDD Workflow
96
51
 
97
- ## When to Use Specs
98
-
99
- **Write a spec for:**
100
- - Features affecting multiple parts of the system
101
- - Breaking changes or significant refactors
102
- - Design decisions needing team alignment
52
+ ```
53
+ BEFORE: board → search → check existing specs
54
+ DURING: update status to in-progress → code → document decisions → link dependencies
55
+ AFTER: update status to complete document learnings
56
+ ```
103
57
 
104
- **Skip specs for:**
105
- - Bug fixes
106
- - Trivial changes
107
- - Self-explanatory refactors
58
+ **Status tracks implementation, NOT spec writing.**
108
59
 
109
60
  ## Spec Dependencies
110
61
 
111
- ### `depends_on` - Blocking Dependency
112
- Directional dependency - this spec cannot start until dependencies are complete.
113
- **Use when:** True blocking dependency, work order matters, one spec builds on another.
62
+ Use `depends_on` to express blocking relationships between specs:
63
+ - **`depends_on`** = True blocker, work order matters, directional (A depends on B)
114
64
 
65
+ Link dependencies when one spec builds on another:
115
66
  ```bash
116
67
  lean-spec link <spec> --depends-on <other-spec>
117
68
  ```
118
69
 
119
- **Note:** Only use `depends_on` for actual blocking dependencies. Don't link specs just because they're "related" - link them when one truly blocks the other.
120
-
121
- ## Quality Standards
70
+ ## When to Use Specs
122
71
 
123
- - **Status tracking is mandatory:**
124
- - `planned` → after creation
125
- - `in-progress` BEFORE starting implementation
126
- - `complete` AFTER finishing implementation
127
- - Specs stay in sync with implementation
128
- - Never leave specs with stale status
72
+ | Write spec | ❌ Skip spec |
73
+ |---------------|--------------|
74
+ | Multi-part features | Bug fixes |
75
+ | Breaking changes | Trivial changes |
76
+ | Design decisions | Self-explanatory refactors |
129
77
 
130
- ## Spec Complexity Guidelines
78
+ ## Token Thresholds
131
79
 
132
80
  | Tokens | Status |
133
81
  |--------|--------|
134
82
  | <2,000 | ✅ Optimal |
135
83
  | 2,000-3,500 | ✅ Good |
136
84
  | 3,500-5,000 | ⚠️ Consider splitting |
137
- | >5,000 | 🔴 Should split |
85
+ | >5,000 | 🔴 Must split |
86
+
87
+ ## First Principles (Priority Order)
138
88
 
139
- Use `tokens` tool to check spec size.
89
+ 1. **Context Economy** - <2,000 tokens optimal, >3,500 needs splitting
90
+ 2. **Signal-to-Noise** - Every word must inform a decision
91
+ 3. **Intent Over Implementation** - Capture why, let how emerge
92
+ 4. **Bridge the Gap** - Both human and AI must understand
93
+ 5. **Progressive Disclosure** - Add complexity only when pain is felt
140
94
 
141
95
  ---
142
96
 
143
- **Remember:** LeanSpec tracks what you're building. Keep specs in sync with your work!
97
+ **Remember:** LeanSpec tracks what you're building. Keep specs in sync with your work!
@@ -1,5 +0,0 @@
1
- export { backfillCommand, backfillTimestamps } from './chunk-SZNMHOHN.js';
2
- import './chunk-K4VTB6BF.js';
3
- import './chunk-ENX5NYTE.js';
4
- //# sourceMappingURL=backfill-WYW47B42.js.map
5
- //# sourceMappingURL=backfill-WYW47B42.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/frontmatter.ts"],"names":[],"mappings":";;;;;;;AAuDO,SAAS,oBAAoB,IAAA,EAAqC;AACvE,EAAA,MAAM,UAAA,GAAa,CAAC,SAAA,EAAW,WAAA,EAAa,WAAW,KAAK,CAAA;AAE5D,EAAA,KAAA,MAAW,SAAS,UAAA,EAAY;AAC9B,IAAA,IAAI,IAAA,CAAK,KAAK,CAAA,YAAa,IAAA,EAAM;AAC/B,MAAA,IAAA,CAAK,KAAK,CAAA,GAAK,IA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A,EACF;AAGA,EAAA,IAAI,OAAO,YAAA,EAAc;AACvB,IAAA,KAAA,MAAW,CAAC,KAAK,KAAK,CAAA,IAAK,OAAO,OAAA,CAAQ,MAAA,CAAO,YAAY,CAAA,EAAG;AAC9D,MAAA,IAAI,WAAA,CAAY,GAAG,CAAA,KAAM,KAAA,EAAO;AAC9B,QAAA,OAAO,KAAA;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAEA,EAAA,OAAO,IAAA;AACT","file":"chunk-ENX5NYTE.js","sourcesContent":["import * as fs from 'node:fs/promises';\nimport * as path from 'node:path';\nimport matter from 'gray-matter';\nimport yaml from 'js-yaml';\nimport dayjs from 'dayjs';\nimport type { LeanSpecConfig } from './config.js';\n\n// Valid status values\nexport type SpecStatus = 'planned' | 'in-progress' | 'complete' | 'archived';\n\n// Valid priority values\nexport type SpecPriority = 'low' | 'medium' | 'high' | 'critical';\n\n// Status transition record\nexport interface StatusTransition {\n status: SpecStatus;\n at: string; // ISO 8601 timestamp\n}\n\n// Core frontmatter fields\nexport interface SpecFrontmatter {\n // Required fields\n status: SpecStatus;\n created: string; // YYYY-MM-DD format\n\n // Recommended fields\n tags?: string[];\n priority?: SpecPriority;\n\n // Power user fields\n depends_on?: string[];\n updated?: string;\n completed?: string;\n assignee?: string;\n reviewer?: string;\n issue?: string;\n pr?: string;\n epic?: string;\n breaking?: boolean;\n due?: string; // YYYY-MM-DD format\n\n // Timestamp fields (for velocity tracking)\n created_at?: string; // ISO 8601 timestamp\n updated_at?: string; // ISO 8601 timestamp\n completed_at?: string; // ISO 8601 timestamp\n transitions?: StatusTransition[]; // Status change history\n\n // Allow any additional fields (for extensibility)\n [key: string]: unknown;\n}\n\n/**\n * Convert Date objects to YYYY-MM-DD string format\n * (gray-matter auto-parses YYYY-MM-DD strings as Date objects)\n */\nexport function normalizeDateFields(data: Record<string, unknown>): void {\n const dateFields = ['created', 'completed', 'updated', 'due'];\n \n for (const field of dateFields) {\n if (data[field] instanceof Date) {\n data[field] = (data[field] as Date).toISOString().split('T')[0];\n }\n }\n}\n\n/**\n * Enrich frontmatter with timestamps for velocity tracking\n * Auto-generates timestamps when missing and tracks status transitions\n */\nexport function enrichWithTimestamps(\n data: Record<string, unknown>,\n previousData?: Record<string, unknown>\n): void {\n const now = new Date().toISOString();\n\n // Set created_at if missing - always use current timestamp\n // Do NOT infer from created date field since that's just YYYY-MM-DD without time\n if (!data.created_at) {\n data.created_at = now;\n }\n\n // Update updated_at on any change (if previousData exists)\n if (previousData) {\n data.updated_at = now;\n }\n\n // Set completed_at when status changes to complete\n if (\n data.status === 'complete' &&\n previousData?.status !== 'complete' &&\n !data.completed_at\n ) {\n data.completed_at = now;\n // Also set the completed date field\n if (!data.completed) {\n data.completed = new Date().toISOString().split('T')[0];\n }\n }\n\n // Track status transition (optional)\n if (previousData && data.status !== previousData.status) {\n if (!Array.isArray(data.transitions)) {\n data.transitions = [];\n }\n (data.transitions as StatusTransition[]).push({\n status: data.status as SpecStatus,\n at: now,\n });\n }\n}\n\n/**\n * Normalize tags field - parse JSON strings into arrays\n * Handles cases where AI accidentally creates tags as '[\"..\",\"..\"]' strings\n */\nexport function normalizeTagsField(data: Record<string, unknown>): void {\n if (data.tags && typeof data.tags === 'string') {\n try {\n // Try to parse as JSON array\n const parsed = JSON.parse(data.tags as string);\n if (Array.isArray(parsed)) {\n data.tags = parsed;\n }\n } catch {\n // If not valid JSON, treat as comma-separated string\n data.tags = (data.tags as string).split(',').map(t => t.trim());\n }\n }\n}\n\n/**\n * Validate and coerce custom field types\n */\nexport function validateCustomField(\n value: unknown,\n expectedType: 'string' | 'number' | 'boolean' | 'array'\n): { valid: boolean; coerced?: unknown; error?: string } {\n switch (expectedType) {\n case 'string':\n if (typeof value === 'string') {\n return { valid: true, coerced: value };\n }\n // Coerce to string\n return { valid: true, coerced: String(value) };\n \n case 'number':\n if (typeof value === 'number') {\n return { valid: true, coerced: value };\n }\n // Try to coerce to number\n const num = Number(value);\n if (!isNaN(num)) {\n return { valid: true, coerced: num };\n }\n return { valid: false, error: `Cannot convert '${value}' to number` };\n \n case 'boolean':\n if (typeof value === 'boolean') {\n return { valid: true, coerced: value };\n }\n // Coerce string to boolean\n if (value === 'true' || value === 'yes' || value === '1') {\n return { valid: true, coerced: true };\n }\n if (value === 'false' || value === 'no' || value === '0') {\n return { valid: true, coerced: false };\n }\n return { valid: false, error: `Cannot convert '${value}' to boolean` };\n \n case 'array':\n if (Array.isArray(value)) {\n return { valid: true, coerced: value };\n }\n return { valid: false, error: `Expected array but got ${typeof value}` };\n \n default:\n return { valid: false, error: `Unknown type: ${expectedType}` };\n }\n}\n\n/**\n * Validate custom fields according to config\n */\nexport function validateCustomFields(\n frontmatter: Record<string, unknown>,\n config?: LeanSpecConfig\n): Record<string, unknown> {\n if (!config?.frontmatter?.custom) {\n return frontmatter;\n }\n \n const result = { ...frontmatter };\n \n for (const [fieldName, expectedType] of Object.entries(config.frontmatter.custom)) {\n if (fieldName in result) {\n const validation = validateCustomField(result[fieldName], expectedType);\n if (validation.valid) {\n result[fieldName] = validation.coerced;\n } else {\n console.warn(`Warning: Invalid custom field '${fieldName}': ${validation.error}`);\n }\n }\n }\n \n return result;\n}\n\n// Parse frontmatter from a spec file\nexport async function parseFrontmatter(\n filePath: string,\n config?: LeanSpecConfig\n): Promise<SpecFrontmatter | null> {\n try {\n const content = await fs.readFile(filePath, 'utf-8');\n const parsed = matter(content, {\n engines: {\n yaml: (str) => yaml.load(str, { schema: yaml.FAILSAFE_SCHEMA }) as Record<string, unknown>\n }\n });\n\n if (!parsed.data || Object.keys(parsed.data).length === 0) {\n // No frontmatter found, try fallback to inline fields\n return parseFallbackFields(content);\n }\n\n // Validate required fields\n if (!parsed.data.status) {\n console.warn(`Warning: Missing required field 'status' in ${filePath}`);\n return null;\n }\n\n if (!parsed.data.created) {\n console.warn(`Warning: Missing required field 'created' in ${filePath}`);\n return null;\n }\n\n // Validate status enum\n const validStatuses: SpecStatus[] = ['planned', 'in-progress', 'complete', 'archived'];\n if (!validStatuses.includes(parsed.data.status)) {\n console.warn(`Warning: Invalid status '${parsed.data.status}' in ${filePath}. Valid values: ${validStatuses.join(', ')}`);\n }\n\n // Validate priority enum if present\n if (parsed.data.priority) {\n const validPriorities: SpecPriority[] = ['low', 'medium', 'high', 'critical'];\n if (!validPriorities.includes(parsed.data.priority)) {\n console.warn(`Warning: Invalid priority '${parsed.data.priority}' in ${filePath}. Valid values: ${validPriorities.join(', ')}`);\n }\n }\n\n // Normalize tags field (parse JSON strings to arrays)\n normalizeTagsField(parsed.data);\n \n // Warn about unknown fields (informational only)\n const knownFields = [\n 'status', 'created', 'tags', 'priority', 'depends_on',\n 'updated', 'completed', 'assignee', 'reviewer', 'issue', 'pr', 'epic', 'breaking', 'due',\n 'created_at', 'updated_at', 'completed_at', 'transitions'\n ];\n \n // Add custom fields from config to known fields\n const customFields = config?.frontmatter?.custom ? Object.keys(config.frontmatter.custom) : [];\n const allKnownFields = [...knownFields, ...customFields];\n \n const unknownFields = Object.keys(parsed.data).filter(k => !allKnownFields.includes(k));\n if (unknownFields.length > 0) {\n console.warn(`Info: Unknown fields in ${filePath}: ${unknownFields.join(', ')}`);\n }\n \n // Validate and coerce custom fields\n const validatedData = validateCustomFields(parsed.data, config);\n\n return validatedData as SpecFrontmatter;\n } catch (error) {\n console.error(`Error parsing frontmatter from ${filePath}:`, error);\n return null;\n }\n}\n\n// Fallback: Parse inline fields from older specs\nfunction parseFallbackFields(content: string): SpecFrontmatter | null {\n const statusMatch = content.match(/\\*\\*Status\\*\\*:\\s*(?:📅\\s*)?(\\w+(?:-\\w+)?)/i);\n const createdMatch = content.match(/\\*\\*Created\\*\\*:\\s*(\\d{4}-\\d{2}-\\d{2})/);\n\n if (statusMatch && createdMatch) {\n const status = statusMatch[1].toLowerCase().replace(/\\s+/g, '-') as SpecStatus;\n const created = createdMatch[1];\n\n return {\n status,\n created,\n };\n }\n\n return null;\n}\n\n// Update frontmatter in a spec file\nexport async function updateFrontmatter(\n filePath: string,\n updates: Partial<SpecFrontmatter>\n): Promise<void> {\n const content = await fs.readFile(filePath, 'utf-8');\n const parsed = matter(content, {\n engines: {\n yaml: (str) => yaml.load(str, { schema: yaml.FAILSAFE_SCHEMA }) as Record<string, unknown>\n }\n });\n\n // Store previous data for timestamp enrichment\n const previousData = { ...parsed.data };\n\n // Merge updates with existing data\n const newData = { ...parsed.data, ...updates };\n\n // Ensure date fields remain as strings (gray-matter auto-parses YYYY-MM-DD as Date objects)\n normalizeDateFields(newData);\n\n // Enrich with timestamps\n enrichWithTimestamps(newData, previousData);\n\n // Auto-update timestamps if fields exist (legacy behavior)\n if (updates.status === 'complete' && !newData.completed) {\n newData.completed = dayjs().format('YYYY-MM-DD');\n }\n\n if ('updated' in parsed.data) {\n newData.updated = dayjs().format('YYYY-MM-DD');\n }\n\n // Update visual metadata badges in content\n let updatedContent = parsed.content;\n updatedContent = updateVisualMetadata(updatedContent, newData as SpecFrontmatter);\n\n // Stringify back to file\n const newContent = matter.stringify(updatedContent, newData);\n await fs.writeFile(filePath, newContent, 'utf-8');\n}\n\n// Update visual metadata badges in content\nfunction updateVisualMetadata(content: string, frontmatter: SpecFrontmatter): string {\n const statusEmoji = getStatusEmojiPlain(frontmatter.status);\n const statusLabel = frontmatter.status.charAt(0).toUpperCase() + frontmatter.status.slice(1).replace('-', ' ');\n \n // Parse created date with dayjs - handles all formats consistently\n const created = dayjs(frontmatter.created).format('YYYY-MM-DD');\n \n // Build metadata line\n let metadataLine = `> **Status**: ${statusEmoji} ${statusLabel}`;\n \n if (frontmatter.priority) {\n const priorityLabel = frontmatter.priority.charAt(0).toUpperCase() + frontmatter.priority.slice(1);\n metadataLine += ` · **Priority**: ${priorityLabel}`;\n }\n \n metadataLine += ` · **Created**: ${created}`;\n \n if (frontmatter.tags && frontmatter.tags.length > 0) {\n metadataLine += ` · **Tags**: ${frontmatter.tags.join(', ')}`;\n }\n \n // For enterprise template with assignee/reviewer\n let secondLine = '';\n if (frontmatter.assignee || frontmatter.reviewer) {\n const assignee = frontmatter.assignee || 'TBD';\n const reviewer = frontmatter.reviewer || 'TBD';\n secondLine = `\\n> **Assignee**: ${assignee} · **Reviewer**: ${reviewer}`;\n }\n \n // Replace existing metadata block or add after title\n const metadataPattern = /^>\\s+\\*\\*Status\\*\\*:.*(?:\\n>\\s+\\*\\*Assignee\\*\\*:.*)?/m;\n \n if (metadataPattern.test(content)) {\n // Replace existing metadata\n return content.replace(metadataPattern, metadataLine + secondLine);\n } else {\n // Add after title (# title)\n const titleMatch = content.match(/^#\\s+.+$/m);\n if (titleMatch) {\n const insertPos = titleMatch.index! + titleMatch[0].length;\n return content.slice(0, insertPos) + '\\n\\n' + metadataLine + secondLine + '\\n' + content.slice(insertPos);\n }\n }\n \n return content;\n}\n\nfunction getStatusEmojiPlain(status: string): string {\n switch (status) {\n case 'planned': return '🗓️';\n case 'in-progress': return '⏳';\n case 'complete': return '✅';\n case 'archived': return '📦';\n default: return '📄';\n }\n}\n\n// Get spec file path from spec directory\nexport async function getSpecFile(specDir: string, defaultFile: string = 'README.md'): Promise<string | null> {\n const specFile = path.join(specDir, defaultFile);\n \n try {\n await fs.access(specFile);\n return specFile;\n } catch {\n return null;\n }\n}\n\n// Filter specs by criteria\nexport interface SpecFilterOptions {\n status?: SpecStatus | SpecStatus[];\n tags?: string[];\n priority?: SpecPriority | SpecPriority[];\n assignee?: string;\n customFields?: Record<string, unknown>;\n}\n\nexport function matchesFilter(frontmatter: SpecFrontmatter, filter: SpecFilterOptions): boolean {\n // Status filter\n if (filter.status) {\n const statuses = Array.isArray(filter.status) ? filter.status : [filter.status];\n if (!statuses.includes(frontmatter.status)) {\n return false;\n }\n }\n\n // Tags filter (spec must have ALL specified tags)\n if (filter.tags && filter.tags.length > 0) {\n if (!frontmatter.tags || frontmatter.tags.length === 0) {\n return false;\n }\n const hasAllTags = filter.tags.every(tag => frontmatter.tags!.includes(tag));\n if (!hasAllTags) {\n return false;\n }\n }\n\n // Priority filter\n if (filter.priority) {\n const priorities = Array.isArray(filter.priority) ? filter.priority : [filter.priority];\n if (!frontmatter.priority || !priorities.includes(frontmatter.priority)) {\n return false;\n }\n }\n\n // Assignee filter\n if (filter.assignee) {\n if (frontmatter.assignee !== filter.assignee) {\n return false;\n }\n }\n \n // Custom fields filter\n if (filter.customFields) {\n for (const [key, value] of Object.entries(filter.customFields)) {\n if (frontmatter[key] !== value) {\n return false;\n }\n }\n }\n\n return true;\n}\n"]}