LLMWikis Coding Standards
LLMWikis coding standards are part of the active 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 | llmwikis.org |
| Source URL | https://llmwikis.org/ |
| Canonical AIWikis URL | https://aiwikis.org/llmwikis/files/uai-coding-standards-uai-da40d274/ |
| Source reference | .uai/coding-standards.uai |
| File type | uai |
| Content category | uai-system |
| Last fetched | 2026-06-22T01:56:21.9510185Z |
| Last changed | 2026-05-31T17:24:35.0801038Z |
| Content hash | sha256:da40d274eb5996083f9a7eec1fc6bbb93080e9fc4ab6d31ff4a90b31d8186f14 |
| Import status | unchanged |
| Raw source layer | data/sources/llmwikis/uai-coding-standards-uai-da40d274eb59.uai |
| Normalized source layer | data/normalized/llmwikis/uai-coding-standards-uai-da40d274eb59.txt |
Current File Content
Structure Preview
- Coding Standards
- Codebase Reflection
- Mandatory Stack Profile Selection
- Universal Defaults
- LLMWikis Local Defaults
- Testing Requirement
- Memory Setup Requirement
Raw Version
Local absolute paths are redacted in this public view. The source hash and source-side raw layer are based on the unredacted source file.
---
uai: "1.0"
type: coding-standards
title: "LLMWikis Coding Standards"
project: "LLMWikis.org"
created: "2026-05-31"
updated: "2026-05-31"
status: active
---
# Coding Standards
LLMWikis coding standards are part of the active Project Handoff memory suite. Read this file before code changes, and update it when a reviewed change discovers a better local pattern.
## Codebase Reflection
Before writing or changing code, inspect the target codebase and name the good parts already working there. For LLMWikis, the current good parts are:
- WordPress PHP owns managed public routes, seeded page content, redirects, route metadata, discovery files, starter-bundle output, and runtime lint hooks.
- The setup wizard keeps reusable planning logic in `assets/js/setup-wizard-core.js` and keeps DOM wiring in `assets/js/site.js`, which makes the core behavior unit-testable.
- Public support boundaries are explicit: browser-only planning, no repository writer, no automatic sync, no public MCP/write API, no open editing, and no SDK/CLI/certification/endorsement/UAI-1 conformance claim.
- Public pages and wizard packets preserve source authority, review state, trust labels, source policy, and UAIX/AIWikis/LLMWikis boundaries.
- Tests are layered: Node unit tests for core wizard behavior, Playwright coverage for browser behavior, PowerShell public-surface checks, PHP/Studio lint when available, and workspace deployment readiness checks for package work.
Use those good parts before adding new abstractions, files, routes, or package behavior.
## Mandatory Stack Profile Selection
The 2026-05-31 coding-standards report was applied to the LLMWikis setup wizard and Project Handoff alignment 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 LLMWikis 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, registry, template, fixture, constant, route map, or typed `.uai` record can remove real duplication.
- Apply "once and only once": each route, support claim, schema shape, package version, public-boundary statement, generated artifact list, and deployment fact should have one canonical owner whenever practical.
- Follow SOLID principles by default: single-purpose units, extension without churn, substitutable contracts, narrow interfaces, and dependency direction that keeps high-level policy separate from low-level rendering or transport details.
- Keep changes small, reviewable, and aligned with existing WordPress/theme/plugin boundaries.
- Use structured APIs, arrays, registries, templates, and validators instead of brittle string manipulation when the codebase provides a better path.
- Preserve user preferences, site-specific customizations, public-support boundaries, source authority, security constraints, and existing handoff evidence.
## LLMWikis Local Defaults
- Keep `setup-wizard-core.js` as the source of truth for wizard model, packet, readiness, first files, and first actions. Keep `site.js` as the browser adapter.
- When wizard output changes, update unit tests, browser fixture expectations, public-surface assertions, and the static fallback digest in PHP when applicable.
- Keep public copy bounded. Do not turn planned features into current support claims.
- Keep UAIX as canonical for UAI-1, AI Memory, Project Handoff, Agent File Handoff, schemas, registries, validators, conformance, governance, and public support boundaries.
- Keep AIWikis as reviewed long-memory/cold-memory evidence, not as source authority for current LLMWikis code or package state.
- Keep multisite AIWikis public memory route rules intact: site-owned memory goes under `/{site}/`; `/org/` is global company material; root memory indexes such as `/files/`, `/concepts/`, and `/reports/` are invalid.
## Testing Requirement
Automated testing is required no matter what language or framework the project uses. For LLMWikis code changes, choose the smallest meaningful set from:
- `node --check wp-content/themes/llmwikis-knowledge-theme/assets/js/setup-wizard-core.js`
- `node --check wp-content/themes/llmwikis-knowledge-theme/assets/js/site.js`
- `npm run test:unit`
- `npm run test:e2e`
- `powershell -NoProfile -ExecutionPolicy Bypass -File scripts/Test-LlmWikisPublicSurface.ps1`
- `studio wp eval-file scripts/lint-llmwikis.php` when Studio is available
For package work, also run the workspace deployment checklist from `[local path redacted]`. If a required check cannot run, record the command, reason, and residual risk in the final handoff and in the relevant `.uai` memory.
## Memory Setup Requirement
Every LLMWikis Project Handoff or code-capable setup must create or verify `.uai/coding-standards.uai`.
Short-term memory should carry a compact 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 llmwikis.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; Mandatory Stack Profile Selection; Universal Defaults; LLMWikis Local 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-1049(primary) - Historical hash records are stored in
data/hashes/source-file-history.jsonl.
Machine-Readable Metadata
{
"title": "LLMWikis Coding Standards",
"source_site": "llmwikis.org",
"source_url": "https://llmwikis.org/",
"canonical_url": "https://aiwikis.org/llmwikis/files/uai-coding-standards-uai-da40d274/",
"source_reference": ".uai/coding-standards.uai",
"file_type": "uai",
"content_category": "uai-system",
"content_hash": "sha256:da40d274eb5996083f9a7eec1fc6bbb93080e9fc4ab6d31ff4a90b31d8186f14",
"last_fetched": "2026-06-22T01:56:21.9510185Z",
"last_changed": "2026-05-31T17:24:35.0801038Z",
"import_status": "unchanged",
"duplicate_group_id": "sfg-1049",
"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.
- LLMWikis.org LLMWikis.org source-system overview for transparent AIWikis memory demonstration.
- LLMWikis.org Source Memory Guide AIWikis source-governed page for durable AI memory, evidence routing, and agent-readable retrieval.
- LLMWikis.org Files Site-scoped current-source file index for LLMWikis.org.