Skills Reference: Brand, Self-Improvement, Learning, Commits, and Coding Patterns
Skill packs for brand content, recursive self-improvement, continuous learning from sessions, semantic commit writing, and code-pattern enforcement in matrix-core.
Overview
This section groups the skill packs that shape how Matrix writes brand content, evolves its own behavior, manages learning from sessions, formats commit messages, and enforces code-pattern guidance. The files are manifest-driven documentation, shell and Python orchestration, and reference guides rather than application runtime code.
The packs split into clear roles: skills/brand handles brand voice and asset approval, skills/self-improve defines a recursive self-optimization loop, skills/continuous-learning-v2 implements session-observation and instinct promotion, skills/writing-git-commits standardizes Conventional Commits, skills/coding-patterns captures code-convention rules, and skills/miniproject/scripts/validate.ts validates memory-file hygiene.
Brand Skill Pack
The brand pack defines how the system writes and reviews branded output: voice, visual identity, messaging, asset organization, and approval controls.
Brand Skill Manifest
skills/brand/SKILL.md declares the brand skill with frontmatter keys name, description, argument-hint, and metadata. Its routing section parses the first word from $ARGUMENTS, loads references/{subcommand}.md, and executes the matching reference. That makes the reference files the real knowledge assets behind the skill.
skills/brand/SKILL.mtx sets id=brand, display="Brand", mcl.verbs=analyze, determinism=seedable, and seed_policy=per_intent, then defines a required target: ArtifactRef slot and an optional constraints: Constraint[] slot. It fails closed if the target cannot be found and clarifies on low confidence.
Reference files
| Path | Responsibility |
|---|---|
skills/brand/references/approval-checklist.md | Asset approval gate covering visual elements, accessibility, content quality, technical requirements, and legal/compliance |
skills/brand/references/asset-organization.md | Kebab-case naming scheme and metadata fields for marketing assets |
skills/brand/references/brand-guideline-template.md | Starting point for a complete brand guideline document |
Asset validation script
skills/brand/scripts/validate-asset.cjs validates marketing assets against brand rules:
| Function | Purpose |
|---|---|
parseFilename | Splits an asset filename into type, campaign, description, timestamp, variant, and extension |
validateFilename | Checks the filename against the naming regex and timestamp/kebab-case rules |
validateFileSize | Compares file size with format-specific limits |
validateFormat | Verifies the extension against image, vector, video, and document format lists |
checkManifest | Looks for the asset in .assets/manifest.json |
suggestFilename | Builds a corrected filename using today's date |
validateAsset | Runs the full validation pipeline and assembles the result object |
Self Improve Pack
The self-improve pack defines a recursive self-optimization loop: map a subsystem, diagnose ranked surfaces, gate the architect, optimize one surface, and verify the result. Each pass writes typed memories that the next pass reads through Cortex.
Orchestrator manifest
skills/self-improve/SKILL.mtx declares id=self-improve, mcl.verbs=build delegate, with sub-skills pointing to matrix://skill/self-map@0.1.0, matrix://skill/self-diagnose@0.1.0, matrix://skill/self-optimize@0.1.0, and matrix://skill/self-verify@0.1.0.
The build procedure requires a sequential plan with a gate before any optimization write. The delegate procedure stops after analysis and gate presentation, letting the architect review ranked surfaces without triggering edits.
Sub-skill manifests
| Manifest | Role |
|---|---|
self-map | Observation pass. Reads a subsystem under /root/matrix, emits a plan with fs.directory_tree, fans out fs.read_text_file across discovered files, persists one Fact memory per file |
self-diagnose | Consumes the map and ranks optimization surfaces. Output is a ranked Pattern memory with concrete file paths and falsifiable success criteria |
self-optimize | Action pass. Reads the target file, generates the full edited content, writes it back with fs.write_file, records the diff with git.git_diff, persists an Event memory describing the change |
self-verify | Verification pass after optimization |
Writing before reading is a hard policy violation. The edit loop is deterministic and auditable: read, change, write, diff, record.
Continuous Learning V2 Pack
This pack is the session-observation system. It monitors tool activity, detects repeatable instincts, scopes them by project, and promotes them into reusable knowledge when confidence and repetition are high enough.
Continuous learning manifest
skills/continuous-learning-v2/SKILL.md describes an instinct-based learning system that evolves session patterns into skills, commands, and agents. Version 2.1 adds project-scoped instincts: observations are scoped by project hash or repo path, cross-project contamination is reduced, and global instincts remain available as shared knowledge.
skills/continuous-learning-v2/SKILL.mtx declares id=continuous-learning-v2 with mcl.verbs=monitor build. It accepts a required target: ArtifactRef and optional constraints: Constraint[].
Observer agent
skills/continuous-learning-v2/agents/observer.md defines the background observer agent (model: haiku). It reads project-scoped observations with a global fallback and converts repeated behavior into instincts. Four pattern classes: user corrections, error resolutions, repeated workflows, and tool preferences.
Observer loop
skills/continuous-learning-v2/agents/observer-loop.sh is the long-running analysis loop with re-entrancy guard, cooldown timer, and idle shutdown. The runtime path:
- Wait for the sleep interval.
- Check whether the project has active session leases.
- Exit if idle too long without active sessions.
- Count observations and skip analysis if too few.
- Run
session-guardian.shbefore analysis. - Tail recent observations into a temporary analysis file.
- Spawn
claudein print mode withReadandWriteallowed. - Let the model produce instinct file instructions.
- Archive processed observations.
Session guardian
skills/continuous-learning-v2/agents/session-guardian.sh decides whether the observer should proceed with three gates: active-hours window, project cooldown, and idle detection. Controlled by environment variables INTERVAL, LOG_PATH, ACTIVE_START, ACTIVE_END, and MAX_IDLE.
Instinct CLI
skills/continuous-learning-v2/scripts/instinct-cli.py manages instinct lifecycle: project detection, path validation, parsing, loading, import, export, status reporting, clustering, and promotion analysis.
| Function | Purpose |
|---|---|
detect_project | Builds the project-scoped directory map and updates the registry |
parse_instinct_file | Parses the YAML-like instinct frontmatter and preserves the body content |
load_all_instincts | Merges project and global instincts, preferring project-scoped entries on ID conflicts |
cmd_status | Prints project, global, and pending instinct counts with scope grouping |
cmd_import | Imports instincts from a file or URL, deduplicates them |
cmd_export | Exports selected instincts with scope and confidence filtering |
cmd_evolve | Clusters instincts into candidate skills, commands, and agents |
cmd_promote | Promotes project instincts into global scope after validation |
Writing Git Commits Pack
skills/writing-git-commits/SKILL.md teaches Conventional Commits as a machine-readable commit style that supports automation, semantic versioning, and readable history. Core commit types: feat, fix, docs, style, refactor, perf, test, chore, and ci, plus breaking-change forms.
Commit structure
| Element | Required | SemVer mapping |
|---|---|---|
| Type prefix | Yes | feat = MINOR, fix = PATCH |
| Scope | Optional | - |
| Breaking marker | Optional | Breaking = MAJOR |
| Description | Yes | - |
| Body | Optional | - |
| Footers | Optional | - |
Pack contents
| Path | Responsibility |
|---|---|
skills/writing-git-commits/SKILL.md | Conventional Commits guidance and child-skill entry point |
skills/writing-git-commits/SKILL.mtx | Manifest for analyze with target resolution |
skills/writing-git-commits/faq/SKILL.md | Practical FAQ for adoption, mood, scope, breaking changes |
skills/writing-git-commits/examples/SKILL.md | Pattern library with examples across types and scopes |
skills/writing-git-commits/specification/SKILL.md | Formal Conventional Commits specification and grammar |
Coding Patterns Pack
skills/coding-patterns/SKILL.md captures code-shaping rules for React components, promises, and restricted patterns. Its allowed tools are Read, Grep, Glob, Write, Edit.
skills/coding-patterns/SKILL.mtx packages the guidance as id=coding-patterns with mcl.verbs=build, accepting the standard target: ArtifactRef and constraints: Constraint[] slots. The manifest is tool-free.
Promise handling rules
skills/coding-patterns/references/rules/promise-handling.md requires Promises to always be awaited unless intentionally fire-and-forget with void. Floating promises are a hard error condition.
React components rules
skills/coding-patterns/references/rules/react-components.md prefers named imports, functional components, top-level hook calls, and dependency arrays that include every referenced value. It defines a standard render order: state, memoized derivations, callbacks, effects, and render output.
Restricted patterns
skills/coding-patterns/references/rules/restricted-patterns.md lists forbidden or discouraged patterns: any, @ts-ignore, direct heavy-package usage, and legacy API call patterns.
Memory Validation Script
skills/miniproject/scripts/validate.ts is a Deno program that walks .memory/, reads Markdown files, parses frontmatter, and validates filenames. Special files are allowed, knowledge- prefixes are flexible, and all standard memory files must follow the <type>-<8_char_hashid>-<title>.md convention. Files under /assets/ are skipped.
| Symbol | Role |
|---|---|
extractFrontmatter | Pulls YAML frontmatter from a Markdown file body |
validateFilename | Checks the filename pattern and title quality |
validateFrontmatter | Verifies required fields and status values for typed memory files |
validateFile | Reads one file and combines filename and frontmatter validation |
validateMemory | Traverses .memory/, reports results, and sets the process exit code |
