@gaodes/pi-primecodex-core

NoxPrime infrastructure utilities for PrimeCodex — settings engine, types, validators, scaffold templates, and shared constants. Zero Pi runtime dependencies.

Packages

Package details

package

Install @gaodes/pi-primecodex-core from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@gaodes/pi-primecodex-core
Package
@gaodes/pi-primecodex-core
Version
0.1.0
Published
May 21, 2026
Downloads
not available
Author
gaodes
License
MIT
Types
package
Size
20 KB
Dependencies
1 dependency · 0 peers

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@gaodes/pi-primecodex-core

NoxPrime infrastructure utilities for PrimeCodex — settings engine, shared types, validators, scaffold templates, and constants. Zero Pi runtime dependencies.

Purpose

pi-primecodex-core is the stable infrastructure base for all @gaodes/* PrimeCodex packages. It provides shared code that every NoxPrime resource depends on, without pulling in the Pi extension runtime.

Exports

Subpath Contents
pi-primecodex-core/settings Settings engine — loadConfig, ensurePrimeSettings, healGlobalConfig, mergeConfig, sanitizeConfig, booleanSetting, stringSetting, numberSetting, objectSetting
pi-primecodex-core/types Shared TypeScript interfaces — UpstreamJson, ExtensionManifest, SkillManifest, PrimeCodexConfig, ToolDefinition
pi-primecodex-core/validate Runtime validators — validateUpstreamJson(), validateSkillFrontmatter(), validatePackageManifest(), validatePrimeSettings()
pi-primecodex-core/scaffold Template generators — createExtensionTemplate(), createSkillTemplate(), createAgentTemplate(), createPromptTemplate()
pi-primecodex-core/constants Paths, regexes, conventions — GLOBAL_SETTINGS_PATH, PROJECT_SETTINGS_PATH, DEFAULT_GITLAB_HOST, SKILL_NAME_REGEX, VERSION_BUMP_RULES
pi-primecodex-core/tsconfig Shared tsconfig.json base for PrimeCodex packages

Install

npm install @gaodes/pi-primecodex-core

Usage

Settings Engine

import {
  booleanSetting,
  loadConfig,
} from "@gaodes/pi-primecodex-core/settings";

const SETTINGS = {
  showOnStartup: booleanSetting("showOnStartup", false, "Show at startup"),
};

const config = loadConfig(SETTINGS);

Validators

import {
  validateUpstreamJson,
  validateSkillFrontmatter,
} from "@gaodes/pi-primecodex-core/validate";

const result = validateUpstreamJson(json);
if (!result.valid) console.error(result.errors);

Scaffold

import { createExtensionTemplate } from "@gaodes/pi-primecodex-core/scaffold";

const files = createExtensionTemplate({
  name: "my-ext",
  description: "My extension",
});
// Returns Record<string, string> of file paths → contents

Architecture

pi-primecodex-core
├── settings/   # Config resolution pipeline
├── types/      # Shared TypeScript interfaces
├── validate/   # Runtime validators
├── scaffold/   # Template generators
├── constants/  # Paths, regexes, conventions
└── index.ts    # Re-exports everything

Consumers

Package Uses
@gaodes/pi-dev-kit Optional dependency — settings engine
@gaodes/pi-test-harness Optional dependency — validators
Future @gaodes/* packages Settings, types, validators, constants

License

MIT