---
description:
globs:
alwaysApply: false
---
$meta:
name: 'lamlSyntaxSpecification'
version: 1.2
purpose: "Define LAML syntax rules, value types, and assignment strategies"
spec: '.cursor/rules/g-laml.mdc'
domains:
- 'syntax.definition.specification'
- 'rules.management.system'
- 'workflow.validation.laml'
syntax:
purpose: "Define LAML syntax rules and patterns"
yamlEscaping:
doubleQuotes: "In double quotes: escape backslashes and asterisks with backslash"
singleQuotes: "In single quotes: most characters are literal"
recommendation: "Use single quotes for reference examples with asterisk"
definitions:
reference:
purpose: "Enable content reuse and consistency"
prefix: "\\*" # The asterisk symbol
escaping: "Use \\* to display literal asterisk without reference interpretation"
notation: 'dotNotation'
validation: 'mustExist'
types:
internal:
definition: "Reference to content within the same document"
format: "\\*section.subsection.property"
example: "\\*$meta.name"
external:
definition: "Reference to content in external LAML files"
format: "\\*$refs.externalKey.section.property"
requirement: "External key must be defined in $refs section"
example: "\\*$refs.laml.syntax.reference"
literal:
definition: "Value of pseudo-enumeration"
format: 'camelCase'
quotes: 'single'
maxWords: 5
structure: 'compoundWordsInCamelCase'
example: "format: 'userAuthEmailPassword'"
descriptive:
definition: "Human-readable explanations"
format: 'naturalLanguage'
quotes: 'double'
focus: "what the thing does, not how it works"
example: "purpose: 'Define boundaries and validation conditions'"
boolean:
definition: "true or false values"
triggers:
- 'has'
- 'is'
- 'can'
- 'should'
- 'must'
- 'allows'
- 'requires'
- 'contains'
example: "hasPrefix: true"
priorityOrder:
purpose: "Preferred value type selection when multiple options are valid"
value: [ 'reference', 'boolean', 'literalOrDescriptive' ]
array: [ 'reference', 'literal', 'descriptive' ]
note: "Choose higher priority type when context allows multiple valid options"
section:
definition: "A yaml element that represents a distinct conceptual area or
subject matter boundary within the document"
structure:
purpose: "Guidelines for structuring LAML document content"
mandatorySections:
$meta:
purpose: "Document identity and metadata"
position: 'first'
required: true
structure:
name: "Document identifier in camelCase format"
purpose: "Brief description of document purpose and goals"
version: "Numeric version (e.g., 1.0, 2.1)"
spec: "Full path to LAML spec file"
optionalSections:
$refs:
purpose: "External file references for LAML documents"
position: 'afterMeta'
required: false
structure:
referenceKey: "Identifier for the referenced file in camelCase format"
path: "Relative path to external LAML file from project root"
description: "Brief description of referenced file purpose"
usage: "Enable referencing external LAML files using \\*$refs.key.path syntax"
example: "laml:
\ path: \".cursor/rules/g-laml.laml.mdc\"
\ description: \"LAML syntax specification\"
# Usage: *$refs.laml.syntax.reference\n"
supportedFormats:
lamlFiles:
extensions: [ '\\*.laml.mdc', '\\*.laml.md' ]
requirement: "All content must be wrapped in ```yaml blocks"
exception: "Cursor frontmatter (---...---) allowed at start of .mdc files"
validation: "Ensure no unwrapped content outside yaml blocks"
principles:
purpose: "Foundational principles and design philosophy for LAML"
llmTrustPrinciple:
definition: "LLM autonomy in structure design for optimal comprehension"
rule: "LLM can use any YAML structure and format not explicitly defined in the
\\*structure section"
scope: "Applies to all content outside mandatory sections and defined constraints"
constraints:
- "Must maintain LAML validity"
- "Must not contradict mandatory sections"
- "Must preserve document coherence"
examples:
- "Custom subsection hierarchies within defined sections"
- "Additional metadata fields beyond required ones"
- "Domain-specific organizational patterns"
designPhilosophy:
purpose: "Core design principles governing LAML document creation and maintenance"
note: "Principles are ordered by priority - higher priority principles override
lower priority ones when conflicts arise"
mandatoryCompliance:
definition: "All LAML mandatory requirements must be satisfied before applying
other principles"
priority: 1
application:
- "Ensure $meta section presence"
- "Verify required fields"
- "Validate syntax compliance"
validation:
- "Required elements must be present"
- "Related elements must align"
- "References must resolve correctly"
examples:
correct: "$meta: { name: 'documentName', purpose: 'Brief description' }"
incorrect: "Missing $meta section entirely"
conceptualGrouping:
definition: "Combine related concepts and subjects into coherent sections"
priority: 2
application:
- "Group by conceptual relationship"
- "Create distinct subject boundaries"
- "Align with domain logic"
validation:
- "Related concepts discoverable together"
- "Clear section purposes"
- "Explicit cross-references"
examples:
correct: "authenticationMethods: { oauth: {...}, saml: {...} }"
incorrect: "Separating oauth and saml into different sections"
conflictResolution: "Maintain conceptual coherence over other concerns"
conceptualDuplicationElimination:
definition: "Eliminate conceptual duplication - concepts and meanings should not
repeat across different sections"
priority: 3
application:
- "Identify repeated concepts and meanings"
- "Consolidate similar concepts into single sections"
- "Use reference notation (\\*) for shared conceptual elements"
validation:
- "Each concept appears in only one authoritative location"
- "References must exist before use"
- "All references resolve correctly"
conceptualCriteria:
focus: "Semantic meaning rather than textual similarity"
guidelines:
- "Same concept in different words: consolidate into single definition"
- "Different aspects of same concept: group under unified section"
- "Overlapping meanings: clarify boundaries or merge concepts"
- "Redundant conceptual categories: eliminate or merge hierarchies"
rationale: "Prevent conceptual confusion by ensuring each meaning has single
source of truth"
examples:
conceptualDuplication: "Having both 'userAuth' and 'authentication' sections
covering same concepts"
consolidated: "Single 'authentication' section with all related concepts and
sub-references"
correctReference: "loginProcess: \\*authentication.methods.oauth"
conflictResolution: "Preserve conceptual grouping over duplication elimination"
simplicity:
definition: "Simple decisions are preferred over complex ones"
priority: 4
application:
- "Choose straightforward solutions"
- "Minimize cognitive load"
- "Use standard YAML constructs"
validation:
- "Fewer dependencies preferred"
- "Readable over compact"
- "Consistent patterns"
examples:
preferred: "required: true"
avoid: "Complex conditional logic"
conflictResolution: "Accept some duplication if it improves simplicity"
clarity:
definition: "Content must be non-contradictory and unambiguous"
priority: 5
application:
- "Single valid interpretation"
- "No conflicting information"
- "Explicit relationships"
validation:
- "All references must resolve to existing content"
- "No circular dependencies"
- "Consistent terminology"
examples:
correct: "required: true"
incorrect: "required: 'sometimes'"
conflictResolution: "Choose simpler approach even if additional clarification needed"
conciseness:
definition: "Use shortest possible structural approaches while maintaining
completeness"
priority: 6
application:
- "Prefer flat structures"
- "Use inline notation when appropriate"
- "Minimal hierarchy depth"
validation:
- "Readability not compromised"
- "Clear relationships maintained"
- "Logical separation preserved"
examples:
compact: "config: { timeout: 30, retries: 3, host: 'api.example.com' }"
verbose: "config:
\ timeout: 30
\ retries: 3
\ host: 'api.example.com'"
arrayInline: "tags: ['syntax', 'validation', 'structure']"
conflictResolution: "Always defer to higher priority principles - conciseness is
lowest priority"
implementationGuidelines:
purpose: "Practical rules for applying LAML principles"
priorityHierarchy:
order:
- 'mandatoryCompliance'
- 'conceptualGrouping'
- 'conceptualDuplicationElimination'
- 'simplicity'
- 'clarity'
- 'conciseness'
explanation: "Priority order from highest to lowest - when principles conflict,
higher priority principles override lower priority ones"
validationProcess:
steps:
- "Verify mandatory sections presence and structure"
- "Check reference integrity and resolution"
- "Validate value type consistency"
- "Assess conceptual coherence"
- "Review simplicity and clarity"
- "Evaluate conciseness and expression efficiency"
scenarios:
purpose: "Scenario-based approach to LAML document management"
standardWorkflow:
analyze: "Assess current LAML document state and identify requirements"
validate: "Check LAML compliance and structure including mandatory definitions"
design: "Plan optimal LAML structure with appropriate domain organization"
implement: "Execute LAML changes while maintaining specification integrity"
verify: "Confirm LAML compliance and document coherence across all domains"
documentCreation:
triggers:
- 'Create LAML document'
- 'New LAML file'
- 'Initialize LAML'
description: "User requests creation of new LAML-compliant documentation"
workflow: "*scenarios.standardWorkflow"
specialization:
analyze: "Identify document purpose, domain structure, and required content"
validate: "Ensure $meta section completeness and specification path presence"
design: "Define optimal structure and conceptual hierarchy"
implement: "Create document with mandatory $meta section and appropriate structure"
verify: "Validate LAML compliance and document coherence"
resources:
- 'lamlSpecification'
- 'contentRequirements'
- 'syntaxRules'
outcomes:
- 'compliantLamlDocument'
- 'validMetaSection'
- 'coherentStructure'
documentUpdate:
triggers:
- 'Update LAML'
- 'Modify LAML document'
- 'Enhance LAML'
description: "User requests modification of existing LAML document"
workflow: "*scenarios.standardWorkflow"
specialization:
analyze: "Assess current document state and identify modification scope"
validate: "Check impact of proposed changes on LAML compliance"
design: "Plan changes preserving original intent and improving structure"
implement: "Apply modifications maintaining specification integrity"
verify: "Ensure continued LAML compliance and enhanced organization"
resources:
- 'existingDocument'
- 'changeRequirements'
- 'lamlSpecification'
- 'syntaxRules'
outcomes:
- 'improvedDocument'
- 'updatedVersion'
- 'maintainedCompliance'
- 'enhancedStructure'
documentRefactoring:
triggers:
- 'Refactor LAML'
- 'Restructure LAML'
- 'Reorganize LAML'
- 'Optimize LAML structure'
description: "User requests structural refactoring of existing LAML document
without changing semantic content or behavior"
workflow: "*scenarios.standardWorkflow"
specialization:
analyze: "Thoroughly assess current document state, identify refactoring scope,
and establish complete behavioral baseline"
validate: "Verify that proposed structural changes maintain 100% semantic
equivalence and behavioral consistency"
design: "Plan structural improvements that preserve all existing functionality
while optimizing organization and readability"
implement: "Execute refactoring with strict preservation of all semantic
content, references, and functional behavior"
verify: "Confirm absolute semantic equivalence between original and refactored
versions with zero functional changes"
criticalRequirements:
noInformationLoss: "Refactoring MUST NOT result in any information loss,
deletion, or omission of existing content"
semanticPreservation: "All semantic meaning, relationships, and behaviors must
remain strictly identical"
functionalEquivalence: "Refactored document must produce identical operational
outcomes as original"
referenceIntegrity: "All internal references must remain valid and functionally equivalent"
noSideEffects: "Refactoring must not introduce any unintended changes or
behavioral side effects"
conservativeApproach: "When in doubt, preserve existing structure rather than
risk semantic changes"
validationCriteria:
- 'Every piece of information in original document must be present in
refactored version'
- 'All references must resolve to equivalent content'
- 'Document behavior and functionality must remain unchanged'
- 'No assumptions about content importance - all content is preserved'
- 'Structural changes only affect organization, not content or meaning'
resources:
- 'existingDocument'
- 'lamlSpecification'
- 'behavioralBaseline'
- 'semanticPreservationChecklist'
- 'syntaxRules'
outcomes:
- 'structurallyImprovedDocument'
- 'preservedFunctionality'
- 'maintainedSemanticEquivalence'
- 'enhancedOrganization'
complianceVerification:
triggers:
- 'Verify LAML'
- 'Check compliance'
- 'Validate LAML'
description: "User requests validation of LAML document compliance"
workflow: "*scenarios.standardWorkflow"
specialization:
analyze: "Examine document structure against LAML requirements"
validate: "Systematically check all mandatory conditions and syntax rules"
design: "Plan corrections for any compliance violations"
implement: "Apply necessary corrections to achieve full compliance"
verify: "Confirm complete LAML specification adherence"
resources:
- 'targetDocument'
- 'lamlSpecification'
- 'syntaxRules'
- 'validationProcess'
outcomes:
- 'complianceReport'
- 'correctedViolations'
- 'validatedDocument'
- 'verifiedCompliance'