codi-cli / constants
constants
Type Aliases
AnySkillCategory
type AnySkillCategory = typeof ALL_SKILL_CATEGORIES[number];
Defined in: constants.ts:250
Union type covering both built-in and dynamic skill categories.
PresetSourceType
type PresetSourceType = typeof PRESET_SOURCE_TYPES[number];
Defined in: constants.ts:115
Union type of all valid preset source identifiers.
SkillCategory
type SkillCategory = typeof SKILL_CATEGORIES[number];
Defined in: constants.ts:222
Union type of all built-in skill category names.
Variables
ALL_SKILL_CATEGORIES
const ALL_SKILL_CATEGORIES: readonly ["Brand Identity", "Code Quality", "Content Creation", "Content Refinement", "Creative and Design", "Developer Tools", "Developer Workflow", "Document Generation", "File Format Tools", "Planning", "Productivity", "Testing", "Workflow", "Codi Platform"];
Defined in: constants.ts:248
All valid skill categories including the dynamic platform category.
ARTIFACT_MANIFEST_FILENAME
const ARTIFACT_MANIFEST_FILENAME: "artifact-manifest.json" = "artifact-manifest.json";
Defined in: constants.ts:153
Filename of the manifest enumerating all managed artifact files.
ARTIFACT_TYPES
const ARTIFACT_TYPES: readonly ["rules", "skills", "agents"];
Defined in: constants.ts:197
All recognised artifact type directory names.
AUDIT_FILENAME
const AUDIT_FILENAME: "audit.jsonl" = "audit.jsonl";
Defined in: constants.ts:133
Filename of the append-only audit event log.
BACKUP_EXCLUDE_DIRS
const BACKUP_EXCLUDE_DIRS: readonly string[];
Defined in: constants.ts:165
Directories under .codi/ that are NEVER walked by the backup snapshotter.
Exact-prefix match: a path is excluded iff it equals an entry exactly OR
begins with <entry>/. Single source of truth — every walker that
recurses .codi/ MUST import this list.
BACKUP_MANIFEST_FILENAME
const BACKUP_MANIFEST_FILENAME: "backup-manifest.json" = "backup-manifest.json";
Defined in: constants.ts:147
Filename of the JSON file that records backup metadata for a configuration snapshot.
BACKUPS_DIR
const BACKUPS_DIR: "backups" = "backups";
Defined in: constants.ts:157
Name of the directory that stores configuration backups.
BRAND_CATEGORY
const BRAND_CATEGORY: "brand";
Defined in: constants.ts:201
Category label assigned to brand skills.
CLI_COMMANDS
const CLI_COMMANDS: readonly ["init", "generate", "validate", "status", "add", "verify", "doctor", "update", "clean", "compliance", "ci", "watch", "revert", "backup", "preset", "docs-update", "docs", "docs-stamp", "docs-check", "contribute", "skill", "onboard"];
Defined in: constants.ts:259
Complete list of top-level CLI command names registered by the binary.
CONTEXT_TOKENS_LARGE
const CONTEXT_TOKENS_LARGE: 200000 = 200_000;
Defined in: constants.ts:139
Token budget for large context-window models (e.g. Claude with 200 K context).
CONTEXT_TOKENS_SMALL
const CONTEXT_TOKENS_SMALL: 32000 = 32_000;
Defined in: constants.ts:141
Token budget for small context-window models (e.g. 32 K context).
DEFAULT_MAX_FILE_LINES
const DEFAULT_MAX_FILE_LINES: 700 = 700;
Defined in: constants.ts:291
Default maximum lines-of-code limit enforced on source files via rules.
DEFAULT_PRESET
const DEFAULT_PRESET: string;
Defined in: constants.ts:109
Fully-qualified name of the preset applied when no preset is explicitly configured.
DOC_PROJECT_DIR
const DOC_PROJECT_DIR: "docs/project" = "docs/project";
Defined in: constants.ts:309
Relative path to the directory that stores agent-generated project documents.
DOC_STAMP_FILENAME
const DOC_STAMP_FILENAME: ".doc-stamp" = ".doc-stamp";
Defined in: constants.ts:311
Filename of the hidden stamp file used to track the last documentation generation timestamp.
EVALS_FILENAME
const EVALS_FILENAME: "evals.json" = "evals.json";
Defined in: constants.ts:319
Filename of the JSON file that holds skill evaluation records.
FEEDBACK_DIR
const FEEDBACK_DIR: "feedback" = "feedback";
Defined in: constants.ts:315
Directory name (within .codi) where skill feedback files are stored.
FLAGS_FILENAME
const FLAGS_FILENAME: "flags.yaml" = "flags.yaml";
Defined in: constants.ts:127
Filename of the feature-flags configuration file.
GIT_CLONE_DEPTH
const GIT_CLONE_DEPTH: "1" = "1";
Defined in: constants.ts:287
Shallow-clone depth used when cloning repositories to minimise download size.
GIT_COMMIT_FIRST_LINE_LIMIT
const GIT_COMMIT_FIRST_LINE_LIMIT: 72 = 72;
Defined in: constants.ts:305
Maximum character length for the first line of a git commit message.
MANAGED_BY_VALUES
const MANAGED_BY_VALUES: readonly ["codi", "user"];
Defined in: constants.ts:102
Valid values for the managed_by field in artifact frontmatter.
MANIFEST_FILENAME
const MANIFEST_FILENAME: "codi.yaml";
Defined in: constants.ts:125
Filename of the primary project manifest written to the .codi directory.
MAX_AGENT_LINES
const MAX_AGENT_LINES: 200 = 200;
Defined in: constants.ts:301
Recommended maximum line count for an agent definition file.
MAX_ARTIFACT_CHARS
const MAX_ARTIFACT_CHARS: 6000 = 6_000;
Defined in: constants.ts:76
Maximum character length of a single artifact’s content when injected into context.
MAX_BACKUPS
const MAX_BACKUPS: 50 = 50;
Defined in: constants.ts:98
Maximum number of configuration backups retained before the oldest is pruned.
MAX_COMPONENT_LINES
const MAX_COMPONENT_LINES: 150 = 150;
Defined in: constants.ts:333
Maximum line count for a single UI component before it is flagged for refactoring.
MAX_CONTEXT_LINES
const MAX_CONTEXT_LINES: 300 = 300;
Defined in: constants.ts:297
Recommended maximum line count for a context injection file.
MAX_DESCRIPTION_LENGTH
const MAX_DESCRIPTION_LENGTH: 512 = 512;
Defined in: constants.ts:72
Maximum character length allowed for a general artifact description.
MAX_FEEDBACK_AGE_DAYS
const MAX_FEEDBACK_AGE_DAYS: 90 = 90;
Defined in: constants.ts:323
Maximum age in days for a feedback entry before it is eligible for pruning.
MAX_FEEDBACK_ENTRIES
const MAX_FEEDBACK_ENTRIES: 1000 = 1000;
Defined in: constants.ts:321
Maximum number of feedback entries retained per skill before the oldest are pruned.
MAX_FUNCTION_LINES
const MAX_FUNCTION_LINES: 30 = 30;
Defined in: constants.ts:331
Maximum line count for a single function before it is flagged for refactoring.
MAX_NAME_LENGTH
const MAX_NAME_LENGTH: 64 = 64;
Defined in: constants.ts:70
Maximum character length allowed for an artifact name.
MAX_PRESET_ZIP_ERROR_BYTES
const MAX_PRESET_ZIP_ERROR_BYTES: 10485760 = 10_485_760;
Defined in: constants.ts:121
Preset ZIP archive size (bytes) at which the installer aborts with an error.
MAX_PRESET_ZIP_WARN_BYTES
const MAX_PRESET_ZIP_WARN_BYTES: 1048576 = 1_048_576;
Defined in: constants.ts:119
Preset ZIP archive size (bytes) at which the installer emits a warning.
MAX_SKILL_DESCRIPTION_LENGTH
const MAX_SKILL_DESCRIPTION_LENGTH: 1024 = 1024;
Defined in: constants.ts:74
Maximum character length allowed for a skill description.
MAX_SKILL_LINES
const MAX_SKILL_LINES: 500 = 500;
Defined in: constants.ts:299
Recommended maximum line count for a skill definition file.
MAX_TOTAL_ARTIFACT_CHARS
const MAX_TOTAL_ARTIFACT_CHARS: 12000 = 12_000;
Defined in: constants.ts:78
Maximum total character count across all artifacts injected into a single context window.
MCP_FILENAME
const MCP_FILENAME: "mcp.yaml" = "mcp.yaml";
Defined in: constants.ts:129
Filename of the MCP server configuration file.
MIN_CODE_COVERAGE_PERCENT
const MIN_CODE_COVERAGE_PERCENT: 80 = 80;
Defined in: constants.ts:329
Minimum acceptable code coverage percentage enforced in CI.
MIN_FEEDBACK_FOR_EVOLVE
const MIN_FEEDBACK_FOR_EVOLVE: 3 = 3;
Defined in: constants.ts:325
Minimum number of feedback entries required before a skill evolution is triggered.
NAME_PATTERN
const NAME_PATTERN: RegExp;
Defined in: constants.ts:82
Regex that artifact names must satisfy: lowercase letters, digits, and hyphens only.
NAME_PATTERN_STRICT
const NAME_PATTERN_STRICT: RegExp;
Defined in: constants.ts:84
Strict variant of NAME_PATTERN: must also start with a lowercase letter.
OPERATIONS_LEDGER_FILENAME
const OPERATIONS_LEDGER_FILENAME: "operations.json" = "operations.json";
Defined in: constants.ts:151
Filename of the ledger that records all mutating operations applied to the project.
PLATFORM_CATEGORY
const PLATFORM_CATEGORY: "Codi Platform";
Defined in: constants.ts:245
Platform category — derived from PROJECT_NAME_DISPLAY to stay in sync.
PRE_COMMIT_MAX_FILE_LINES
const PRE_COMMIT_MAX_FILE_LINES: 800 = 800;
Defined in: constants.ts:293
Maximum lines-of-code limit checked by the pre-commit hook (slightly relaxed).
PRESET_LOCK_FILENAME
const PRESET_LOCK_FILENAME: "preset-lock.json" = "preset-lock.json";
Defined in: constants.ts:149
Filename of the lockfile that pins the currently installed preset version.
PRESET_MANIFEST_FILENAME
const PRESET_MANIFEST_FILENAME: "preset.yaml" = "preset.yaml";
Defined in: constants.ts:145
Filename of the per-preset manifest describing preset metadata.
PRESET_SOURCE_TYPES
const PRESET_SOURCE_TYPES: readonly ["builtin", "zip", "github", "local"];
Defined in: constants.ts:113
All supported sources from which a preset can be installed.
PROJECT_CLI
const PROJECT_CLI: "codi" = PROJECT_NAME;
Defined in: constants.ts:10
CLI binary name — derived from PROJECT_NAME.
PROJECT_CONTEXT_ANCHOR
const PROJECT_CONTEXT_ANCHOR: "<!-- codi:project-context:insert-here -->" = "<!-- codi:project-context:insert-here -->";
Defined in: constants.ts:347
Anchor marker emitted at the top of every adapter instruction file.
The onboarding skill/playbook replaces this anchor with a
<!-- codi:project-context:start --> ... <!-- codi:project-context:end -->
block. codi generate preserves that block across regenerations by
re-inserting it in place of this anchor on the next run.
PROJECT_CONTEXT_END
const PROJECT_CONTEXT_END: "<!-- codi:project-context:end -->" = "<!-- codi:project-context:end -->";
Defined in: constants.ts:339
Closing HTML comment marker that delimits the injected project-context block.
PROJECT_CONTEXT_START
const PROJECT_CONTEXT_START: "<!-- codi:project-context:start -->" = "<!-- codi:project-context:start -->";
Defined in: constants.ts:337
Opening HTML comment marker that delimits the injected project-context block.
PROJECT_DIR
const PROJECT_DIR: ".codi";
Defined in: constants.ts:12
Hidden configuration directory created inside a project (.codi).
PROJECT_NAME
const PROJECT_NAME: "codi" = "codi";
Defined in: constants.ts:6
The internal project identifier and CLI binary name.
PROJECT_NAME_DISPLAY
const PROJECT_NAME_DISPLAY: "Codi" = "Codi";
Defined in: constants.ts:8
Title-case display name for use in prose and UI.
PROJECT_REPO
const PROJECT_REPO: "lehidalgo/codi" = "lehidalgo/codi";
Defined in: constants.ts:14
GitHub repository slug (owner/repo).
PROJECT_TAGLINE
const PROJECT_TAGLINE: "Unified AI agent configuration" = "Unified AI agent configuration";
Defined in: constants.ts:20
One-line product tagline used in generated documentation and CLI output.
PROJECT_TARGET_BRANCH
const PROJECT_TARGET_BRANCH: "develop" = "develop";
Defined in: constants.ts:18
Default git branch used for upstream comparisons and contributions.
PROJECT_URL
const PROJECT_URL: "https://github.com/lehidalgo/codi";
Defined in: constants.ts:16
Public GitHub URL for the project repository.
REGISTRY_INDEX_FILENAME
const REGISTRY_INDEX_FILENAME: "index.json" = "index.json";
Defined in: constants.ts:155
Filename of the registry index used to look up available built-in artifacts.
RETENTION_CANCELLED_ERROR
const RETENTION_CANCELLED_ERROR: string;
Defined in: constants.ts:176
Standardised abort message when a destructive op cannot proceed because retention is full and the user declined to delete any backup. Callers emit this verbatim so log scrapers and tests can match it reliably.
SKILL_CATEGORIES
const SKILL_CATEGORIES: readonly ["Brand Identity", "Code Quality", "Content Creation", "Content Refinement", "Creative and Design", "Developer Tools", "Developer Workflow", "Document Generation", "File Format Tools", "Planning", "Productivity", "Testing", "Workflow"];
Defined in: constants.ts:205
Ordered tuple of all built-in skill category display names.
SKILL_CATEGORY
const SKILL_CATEGORY: object;
Defined in: constants.ts:228
Named constants for each skill category — use in template interpolation instead of
hardcoding strings. Typed with satisfies to guarantee every key is a valid SkillCategory.
Type Declaration
BRAND_IDENTITY
readonly BRAND_IDENTITY: "Brand Identity" = "Brand Identity";
CODE_QUALITY
readonly CODE_QUALITY: "Code Quality" = "Code Quality";
CONTENT_CREATION
readonly CONTENT_CREATION: "Content Creation" = "Content Creation";
CONTENT_REFINEMENT
readonly CONTENT_REFINEMENT: "Content Refinement" = "Content Refinement";
CREATIVE_AND_DESIGN
readonly CREATIVE_AND_DESIGN: "Creative and Design" = "Creative and Design";
DEVELOPER_TOOLS
readonly DEVELOPER_TOOLS: "Developer Tools" = "Developer Tools";
DEVELOPER_WORKFLOW
readonly DEVELOPER_WORKFLOW: "Developer Workflow" = "Developer Workflow";
DOCUMENT_GENERATION
readonly DOCUMENT_GENERATION: "Document Generation" = "Document Generation";
FILE_FORMAT_TOOLS
readonly FILE_FORMAT_TOOLS: "File Format Tools" = "File Format Tools";
PLANNING
readonly PLANNING: "Planning" = "Planning";
PRODUCTIVITY
readonly PRODUCTIVITY: "Productivity" = "Productivity";
TESTING
readonly TESTING: "Testing" = "Testing";
WORKFLOW
readonly WORKFLOW: "Workflow" = "Workflow";
SKILL_OUTPUT_FILENAME
const SKILL_OUTPUT_FILENAME: "SKILL.md" = "SKILL.md";
Defined in: constants.ts:135
Filename of the rendered skill output written during skill execution.
STATE_FILENAME
const STATE_FILENAME: "state.json" = "state.json";
Defined in: constants.ts:131
Filename of the persistent CLI state file.
SUPPORTED_PLATFORMS
const SUPPORTED_PLATFORMS: readonly ["claude-code", "cursor", "codex", "windsurf", "cline", "copilot"];
Defined in: constants.ts:184
Agent platform IDs — single source of truth for compatibility fields.
SUPPORTED_PLATFORMS_YAML
const SUPPORTED_PLATFORMS_YAML: string;
Defined in: constants.ts:193
YAML-ready inline list for template interpolation.
TOKEN_HASH_LENGTH
const TOKEN_HASH_LENGTH: 12 = 12;
Defined in: constants.ts:88
Length (in hex characters) of the hash segment in a verification token.
TOKEN_PREFIX
const TOKEN_PREFIX: "codi" = PROJECT_NAME;
Defined in: constants.ts:90
Namespace prefix prepended to every generated verification token.
VERSIONS_DIR
const VERSIONS_DIR: "versions" = "versions";
Defined in: constants.ts:317
Directory name used to store versioned skill snapshots.
WATCH_DEBOUNCE_MS
const WATCH_DEBOUNCE_MS: 500 = 500;
Defined in: constants.ts:94
Debounce delay in milliseconds applied to filesystem watch events.
Functions
devArtifactName()
function devArtifactName(base): string;
Defined in: constants.ts:43
Name for project-development artifacts (prefix + base + -dev).
Parameters
| Parameter | Type | Description |
|---|---|---|
|
|
|
The unprefixed artifact name (e.g. |
Returns
string
The development-variant name (e.g. "codi-minimal-dev").
Example
devArtifactName("minimal"); // => "codi-minimal-dev"
isKnownSkillCategory()
function isKnownSkillCategory(v): v is "Brand Identity" | "Code Quality" | "Content Creation" | "Content Refinement" | "Creative and Design" | "Developer Tools" | "Developer Workflow" | "Document Generation" | "File Format Tools" | "Planning" | "Productivity" | "Testing" | "Workflow" | "Codi Platform";
Defined in: constants.ts:253
Returns true if the value is a known built-in skill category.
Parameters
| Parameter | Type |
|---|---|
|
|
|
Returns
v is “Brand Identity” | “Code Quality” | “Content Creation” | “Content Refinement” | “Creative and Design” | “Developer Tools” | “Developer Workflow” | “Document Generation” | “File Format Tools” | “Planning” | “Productivity” | “Testing” | “Workflow” | “Codi Platform”
prefixedName()
function prefixedName(base): string;
Defined in: constants.ts:31
Prefix a base artifact name with the project name.
Parameters
| Parameter | Type | Description |
|---|---|---|
|
|
|
The unprefixed artifact name (e.g. |
Returns
string
The fully-prefixed name (e.g. "codi-balanced").
Example
prefixedName("balanced"); // => "codi-balanced"
resolveArtifactName()
function resolveArtifactName(input, validNames): string | undefined;
Defined in: constants.ts:58
Resolve an artifact name: accept both short (“strict”) and prefixed (“codi-strict”) forms.
Parameters
| Parameter | Type | Description |
|---|---|---|
|
|
|
The name to resolve — may be short or already prefixed. |
|
|
readonly |
The list of fully-qualified valid artifact names. |
Returns
string | undefined
The resolved name if found in validNames, or undefined if not recognised.
Example
resolveArtifactName("strict", ["codi-strict", "codi-balanced"]); // => "codi-strict"
resolveArtifactName("codi-strict", ["codi-strict"]); // => "codi-strict"
resolveArtifactName("unknown", ["codi-strict"]); // => undefined