Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt

Use this file to discover all available pages before exploring further.

Version: 1.0
Last Updated: 2026-03-10
Status: ✅ Complete
Maps the SKILL.md portable format to pf_ai_skills columns for the import/export pipeline.

SKILL.md Format

Based on .cursor/skills and agentskills.io conventions. A SKILL.md file consists of:
  1. YAML frontmatter delimited by ---
  2. Markdown body with ## System Prompt and optional ## Constraints / ## Examples sections

Example

---
name: Policy Reviewer
skill_code: policy_reviewer
description: Reviews organizational policies for compliance
category: compliance
module: gr
model_preference: anthropic/claude-3.5-sonnet
temperature: 0.3
max_tokens: 4096
output_format: text
use_rag: true
rag_source_types: [documents, policies]
rag_match_count: 5
rag_match_threshold: 0.7
tags: [compliance, review, policy]
version: 1.0.0
source: manual
---

## System Prompt

You are an expert policy reviewer specializing in behavioral health compliance...

## Constraints

- Always cite specific regulatory references
- Flag potential HIPAA violations immediately

## Examples

### Input

Review this medication administration policy for OTP compliance.

### Output

**Compliance Assessment:** ...

Field Mapping: SKILL.md ↔ pf_ai_skills

SKILL.md FieldLocationpf_ai_skills ColumnTypeRequiredNotes
namefrontmatternametextDisplay name
skill_codefrontmatterskill_codetextUnique per org; validated ^[a-z][a-z0-9_]*$
descriptionfrontmatterdescriptiontextMax 500 chars
categoryfrontmattercategorytextEnum: compliance, housing, hr, finance, operations, general
modulefrontmattermoduletextCore module: gr, hr, fa, lo, rh, fm, it, ce
model_preferencefrontmattermodel_preferencetexte.g., anthropic/claude-3.5-sonnet
temperaturefrontmattertemperaturenumeric0.0–2.0; default 0.7
max_tokensfrontmattermax_tokensintegerDefault 4096
output_formatfrontmatteroutput_formattexttext, markdown, json, structured
use_ragfrontmatteruse_ragbooleanDefault false
rag_source_typesfrontmatterrag_source_typestext[]Only when use_rag: true
rag_match_countfrontmatterrag_match_countintegerOnly when use_rag: true
rag_match_thresholdfrontmatterrag_match_thresholdnumericOnly when use_rag: true
tagsfrontmattertagstext[]Inline YAML array
versionfrontmatterversiontextSemver string
sourcefrontmattersourcetextSet to import on import
## System Promptbodysystem_prompttextMax 50,000 chars
## Constraintsbodyconstraintstext[]Parsed from - item list
## ExamplesbodyexamplesjsonbParsed from ### Input / ### Output pairs

Serializer

Location: src/platform/ai/utils/skill-md-serializer.ts
Function: skillToSkillMd(skill: AISkill): string
Produces a valid SKILL.md string from an AISkill object. YAML values are escaped when they contain special characters. Arrays use inline flow style [item1, item2].

Parser

Location: src/platform/ai/utils/skill-md-parser.ts
Function: parseSkillMd(content: string): ParseSkillMdResult
Uses regex-based frontmatter extraction (no gray-matter dependency). Returns { data, errors, warnings }. Fatal errors (missing frontmatter, missing name) prevent import; warnings (unknown fields) are informational.

Import Conflict Resolution

When importing, if skill_code already exists for the current org:
ResolutionBehavior
RenameAppends _imported suffix (or user-edited code) and creates new skill
ReplaceOverwrites existing skill data via useUpdateAISkill
Hook: useImportAISkill at src/platform/ai/hooks/useImportAISkill.ts

Round-Trip Fidelity

The serializer and parser are tested for round-trip fidelity: serialize → parse → compare preserves all mapped fields. See tests/unit/platform/ai/skill-md-parser.test.ts and tests/unit/platform/ai/skill-md-serializer.test.ts.

References

  • Parent spec: specs/pf/specs/PF-62-PHASE-2-3-EXPANSION.md
  • Serializer: src/platform/ai/utils/skill-md-serializer.ts
  • Parser: src/platform/ai/utils/skill-md-parser.ts
  • Import hook: src/platform/ai/hooks/useImportAISkill.ts
  • UI: src/platform/ai/components/ImportSkillDialog.tsx, src/platform/ai/components/CreateSkillWizard.tsx