Matrix logo

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

PathResponsibility
skills/brand/references/approval-checklist.mdAsset approval gate covering visual elements, accessibility, content quality, technical requirements, and legal/compliance
skills/brand/references/asset-organization.mdKebab-case naming scheme and metadata fields for marketing assets
skills/brand/references/brand-guideline-template.mdStarting point for a complete brand guideline document

Asset validation script

skills/brand/scripts/validate-asset.cjs validates marketing assets against brand rules:

FunctionPurpose
parseFilenameSplits an asset filename into type, campaign, description, timestamp, variant, and extension
validateFilenameChecks the filename against the naming regex and timestamp/kebab-case rules
validateFileSizeCompares file size with format-specific limits
validateFormatVerifies the extension against image, vector, video, and document format lists
checkManifestLooks for the asset in .assets/manifest.json
suggestFilenameBuilds a corrected filename using today's date
validateAssetRuns 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

ManifestRole
self-mapObservation 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-diagnoseConsumes the map and ranks optimization surfaces. Output is a ranked Pattern memory with concrete file paths and falsifiable success criteria
self-optimizeAction 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-verifyVerification 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:

  1. Wait for the sleep interval.
  2. Check whether the project has active session leases.
  3. Exit if idle too long without active sessions.
  4. Count observations and skip analysis if too few.
  5. Run session-guardian.sh before analysis.
  6. Tail recent observations into a temporary analysis file.
  7. Spawn claude in print mode with Read and Write allowed.
  8. Let the model produce instinct file instructions.
  9. 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.

FunctionPurpose
detect_projectBuilds the project-scoped directory map and updates the registry
parse_instinct_fileParses the YAML-like instinct frontmatter and preserves the body content
load_all_instinctsMerges project and global instincts, preferring project-scoped entries on ID conflicts
cmd_statusPrints project, global, and pending instinct counts with scope grouping
cmd_importImports instincts from a file or URL, deduplicates them
cmd_exportExports selected instincts with scope and confidence filtering
cmd_evolveClusters instincts into candidate skills, commands, and agents
cmd_promotePromotes 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

ElementRequiredSemVer mapping
Type prefixYesfeat = MINOR, fix = PATCH
ScopeOptional-
Breaking markerOptionalBreaking = MAJOR
DescriptionYes-
BodyOptional-
FootersOptional-

Pack contents

PathResponsibility
skills/writing-git-commits/SKILL.mdConventional Commits guidance and child-skill entry point
skills/writing-git-commits/SKILL.mtxManifest for analyze with target resolution
skills/writing-git-commits/faq/SKILL.mdPractical FAQ for adoption, mood, scope, breaking changes
skills/writing-git-commits/examples/SKILL.mdPattern library with examples across types and scopes
skills/writing-git-commits/specification/SKILL.mdFormal 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.

SymbolRole
extractFrontmatterPulls YAML frontmatter from a Markdown file body
validateFilenameChecks the filename pattern and title quality
validateFrontmatterVerifies required fields and status values for typed memory files
validateFileReads one file and combines filename and frontmatter validation
validateMemoryTraverses .memory/, reports results, and sets the process exit code