UAIX Coding Standards
UAIX coding standards are part of the required Project Handoff memory suite. Read this file before code changes, and update it when a reviewed change discovers a better local pattern.
Metadata
| Field | Value |
|---|---|
| Source site | uaix.org |
| Source URL | https://uaix.org/ |
| Canonical AIWikis URL | https://aiwikis.org/uaix/files/uai-coding-standards-uai-83f42094/ |
| Source reference | .uai/coding-standards.uai |
| File type | uai |
| Content category | uai-system |
| Last fetched | 2026-06-22T01:56:21.9510185Z |
| Last changed | 2026-06-05T22:24:37.9556043Z |
| Content hash | sha256:83f42094cf60df9dd4a9230c3c011b6b39dfcbf39a0b23fb1182fe527f09851c |
| Import status | unchanged |
| Raw source layer | data/sources/uaix/uai-coding-standards-uai-83f42094cf60.uai |
| Normalized source layer | data/normalized/uaix/uai-coding-standards-uai-83f42094cf60.txt |
Current File Content
Structure Preview
- Coding Standards
- Codebase Reflection Rule
- Required Stack Profile Selection
- Universal Defaults
- WordPress And PHP Defaults
- Testing Requirement
- Memory Setup Requirement
Raw Version
---
uai: "1.0"
type: coding-standards
title: "UAIX Coding Standards"
project: "UAIX.org"
created: "2026-05-31"
updated: "2026-05-31"
status: active
---
# Coding Standards
UAIX coding standards are part of the required Project Handoff memory suite. Read this file before code changes, and update it when a reviewed change discovers a better local pattern.
## Codebase Reflection Rule
Before writing or changing code, inspect the codebase being set up or edited. Identify the "good parts" already working there: naming conventions, file layout, reusable helpers, test style, routing patterns, data validation, escaping, build commands, release checks, and owner preferences. Use those good parts as the first source of truth for project-specific standards.
If the codebase is new or thin, create an initial standard from the selected language, framework, package manager, test runner, deployment target, security boundary, and owner instructions. Mark unknowns as placeholders until verified.
## Required Stack Profile Selection
The 2026-05-31 coding-standards report was applied to the UAIX AI Memory Package Wizard and Project Handoff guidance. Code-capable setup now treats stack standards as required, not advisory.
- A human using the wizard can select applicable language, framework, data, API, deployment, and security profiles.
- A visiting AI agent must still infer applicable profiles from package manifests, source layout, framework configuration, route/schema files, tests, CI, deployment scripts, and owner instructions before coding.
- If the human-selected profiles conflict with codebase evidence, stop and record the conflict before editing.
- Missing `.uai/coding-standards.uai`, missing stack-profile inference, or missing automated-test mapping is a setup failure for programming-related agents.
Current UAIX profile set: PHP/WordPress, JavaScript/Node/Express, TypeScript/React, Angular, Vue, Python, Java/Spring Boot, C#/.NET, HTML/CSS, SQL, MongoDB, REST/HTTP APIs, GraphQL, Protocol Buffers/gRPC, Cloud/Twelve-Factor App, and OWASP Secure Coding.
## Universal Defaults
- Prefer DRY design: do not repeat yourself when a shared helper, template, registry, fixture, constant, or typed record can remove real duplication.
- Apply "once and only once": each business rule, route definition, schema shape, version value, support claim, validation rule, and deployment fact should have one canonical owner whenever practical.
- Follow SOLID principles by default: single-purpose units, open extension points, substitutable contracts, narrow interfaces, and dependency direction that keeps high-level policy from depending on low-level details.
- Keep changes small, reversible, and aligned to existing architecture.
- Use structured APIs, parsers, registries, and framework helpers instead of brittle string manipulation when available.
- Preserve user preferences, site-specific customizations, support boundaries, and security constraints.
- Never place secrets, credentials, private user data, or unsupported public claims in source, generated artifacts, logs, or handoff memory.
## WordPress And PHP Defaults
- Follow WordPress escaping, sanitization, nonce, capability, hook, enqueue, translation, and filesystem conventions.
- Escape output at the last safe boundary with the narrowest appropriate WordPress helper.
- Sanitize and validate every inbound value before use.
- Keep theme presentation, plugin service logic, machine artifact generation, and deployment tooling in their existing ownership boundaries.
- Reuse existing UAIX registries and resolver helpers before adding parallel route, copy, manifest, schema, or ZIP-generation logic.
- Keep generated package files deterministic where tests expect stable manifests, hashes, paths, or ZIP entries.
## Testing Requirement
Automated testing is required no matter what language or framework the project uses. At setup time, record the available unit, integration, smoke, lint, type, format, route, package, or deployment checks in `.uai/test-plan.uai`.
For every code change, run targeted automated checks that cover the touched behavior. If no test harness exists, create or document the smallest repeatable automated check before relying on manual verification. If a check cannot run, record the command, reason, and residual risk.
## Memory Setup Requirement
Every UAIX Project Handoff or AI Memory setup that can involve code must create or verify `.uai/coding-standards.uai`.
Short-term memory should carry a brief coding-standards overview and link here. Long-term memory should preserve durable standard changes, rationale, and evidence when standards move beyond immediate working context.
Why This File Exists
This is a UAI AI Memory handoff file from uaix.org. It is shown here because AIWikis.org is demonstrating the real source files that make the UAIX / LLM Wiki memory system work, not only summarizing those systems after the fact.
Role
This .uai file is a compact coding-standards packet. It keeps one kind of durable project truth separate from the rest of the archive so an agent can load the topic it needs without pulling the whole project history into prompt context.
Structure
The file is structured around these visible headings: Coding Standards; Codebase Reflection Rule; Required Stack Profile Selection; Universal Defaults; WordPress And PHP Defaults; Testing Requirement; Memory Setup Requirement. Those headings are retrieval anchors: a crawler or LLM can decide whether the file is relevant before reading every line.
Prompt-Size And Retrieval Benefit
Keeping this material in a separate file reduces prompt pressure because an agent can load this exact unit only when its role, source site, category, or hash is relevant. The surrounding index pages point to it, while this page preserves the full content for audit and exact recall.
How To Use It
- Humans should read the metadata first, then inspect the raw content when they need exact wording or provenance.
- LLMs and agents should use the source site, category, hash, headings, and related files to decide whether this file belongs in the active prompt.
- Crawlers should treat the AIWikis page as transparent evidence and follow the source URL/source reference for authority boundaries.
- Future maintainers should regenerate this page whenever the source hash changes, then review the explanation if the role or structure changed.
Update Requirements
When this source file changes, update the raw source layer, normalized source layer, hash history, this rendered page, generated explanation, source-file inventory, changed-files report, and any source-section index that links to it.
Related Pages
- Source overview
- Site file index
- Site report index
- UAI system index
- Source provenance
- Site directory
- Organization reports
Provenance And History
- Current observation:
2026-06-22T01:56:21.9510185Z - Source origin:
current-source-workspace - Retrieval method:
local-source-workspace - Duplicate group:
sfg-624(primary) - Historical hash records are stored in
data/hashes/source-file-history.jsonl.
Machine-Readable Metadata
{
"title": "UAIX Coding Standards",
"source_site": "uaix.org",
"source_url": "https://uaix.org/",
"canonical_url": "https://aiwikis.org/uaix/files/uai-coding-standards-uai-83f42094/",
"source_reference": ".uai/coding-standards.uai",
"file_type": "uai",
"content_category": "uai-system",
"content_hash": "sha256:83f42094cf60df9dd4a9230c3c011b6b39dfcbf39a0b23fb1182fe527f09851c",
"last_fetched": "2026-06-22T01:56:21.9510185Z",
"last_changed": "2026-06-05T22:24:37.9556043Z",
"import_status": "unchanged",
"duplicate_group_id": "sfg-624",
"duplicate_role": "primary",
"related_files": [
],
"generated_explanation": true,
"explanation_last_generated": "2026-06-22T01:56:21.9510185Z"
} Next Useful Routes
- Start Here A task-first reading path for AIWikis.org, separating newcomer learning, source-memory lookup, maintainer workflow, and AI-agent retrieval.
- Topic Index A tag-oriented index for LLM Wiki, AI memory, UAI, source governance, crawling, and retrieval topics.
- Source Map AIWikis source-governed page for durable AI memory, evidence routing, and agent-readable retrieval.
- UAIX.org UAIX.org source-system overview for transparent AIWikis memory demonstration.
- UAIX.org Source Memory Guide AIWikis source-governed page for durable AI memory, evidence routing, and agent-readable retrieval.
- UAIX.org Files Site-scoped current-source file index for UAIX.org.