Nimi Coding
Status: Active Version: 1.0 Maintainer: @snowzane Created: 2026-03-03 Last Updated: 2026-03-12 Scope: Nimi public methodology Language: English Legacy Alias: Oriented-AI Spec Coding
Part A — Method Definition & Design Goals
A1. Definition
Nimi Coding is software development against an AI-readable, enforceable, layered, cross-checked source of truth.
It treats source-of-truth artifacts as an executable governance system for AI-first executors, with one default lifecycle:
Rule -> Table -> Generate -> Check -> Evidence
Where:
Rule: Defines invariants and cross-domain contracts.Table: Stores structured facts in machine-verifiable form.Generate: Produces readable projections from source facts.Check: Enforces consistency and drift via deterministic guards.Evidence: Closes the loop through command outputs and audit records.
A2. Applicability
This methodology is designed for:
- Systems with complex rules and strong cross-module coupling.
- Multi-team environments requiring stable semantic boundaries.
- Workflows where AI agents are primary implementers or collaborators.
- Delivery chains requiring traceability, consistency, and regression resistance.
A3. Out of Scope
This methodology does not directly solve:
- Business strategy correctness.
- Legal conclusions (engineering governance only, not legal advice).
- Organizational politics or role conflicts.
- One-off prototypes where formal governance is intentionally unnecessary.
A4. Design Goals
- Decision Complete: No hidden decisions are pushed to implementers.
- Machine Verifiable: Core rules can be checked deterministically.
- Traceable: Every change maps to Rule IDs and evidence.
- Regress-resistant: Fixes can be hardened into long-term guards.
- Portable: The method can migrate across repositories and stacks.
Part B — Core Axioms
B1. One Fact One Home
A fact has exactly one authoritative source.
Projections, tutorials, and comments are not authoritative fact stores.
B2. Contract-first / Table-first / Projection-last
- Define contracts first.
- Maintain structured facts second.
- Generate readable projections last.
Never edit projections first and backfill sources later.
B3. Deterministic Guard First
Any rule that can be machine-checked must be enforced in CI/scripts, not in human memory.
B4. Evidence over Assertion
"I think this is done" is not completion.
Each change requires reproducible evidence:
- Executed commands.
- Command outputs.
- Not-run items with reasons.
B5. Stable Anchors
Rules must have stable anchors (for example, Rule IDs).
Cross-doc, cross-table, and cross-check references should depend on anchors, not paragraph positions.
B6. No Execution-State Pollution in Spec
Normative source-of-truth documents define contracts, not run snapshots.
Execution state belongs in reports/plans, not in normative sections.
B7. Gate-based Enforcement Language
This methodology uses Gate semantics instead of MUST/SHOULD distinctions:
- Hard Gate: If it fails, merge is blocked.
- Soft Gate: If it fails, merge is allowed only with explicit risk and owner.
- Advisory: Recommendation only, tracked for trend and optimization.
Part C — Artifact Architecture
C1. Layer Model (Policy / Kernel / Domain / Tables / Generated / Report)
| Layer | Purpose | Artifact Characteristics | Manual Edit |
|---|---|---|---|
| Policy | Governance principles and red lines | Gate classes and execution boundaries (Hard/Soft/Advisory) | Yes |
| Kernel | Cross-domain core contracts | Rule IDs and invariants | Yes |
| Domain | Domain increments | References Kernel without duplicating core contracts | Yes |
| Tables | Structured fact source | YAML/JSON/Schema data | Yes |
| Generated | Machine-generated projections | Read-only views | No |
| Report/Plan | Execution evidence and process | Audit, plan, and result records | Yes |
C2. Inputs, Outputs, and Boundaries
Policy -> Kernel: Governance defines Gate classes and writing rules.Kernel -> Domain: Domain adds local increments and references.Kernel + Tables -> Generated: Generators produce projections from source facts.Check -> Report: Check outputs are recorded as audit evidence.
Boundary rules:
- Domain must not define cross-domain core facts.
- Generated artifacts are not editing entry points.
- Reports must not mutate normative source facts.
C3. Traceability Chain
Standard traceability chain:
Rule ID -> Table row -> Generated view -> Check rule -> Evidence record
Any broken link is a governance defect.
Part D — Rule & Fact System Design
D1. Rule ID Naming and Numbering
Use the fixed format:
AISC-<AREA>-NNN
Rules:
<AREA>: 2-12 uppercase letters (for exampleCORE,FLOW,AUDIT).NNN: Three-digit sequence, never reused.- Validation regex:
^AISC-[A-Z]{2,12}-[0-9]{3}$.
Suggested number bands:
001-009: Core invariants.010-099: Incremental rules.100+: Extension/migration-reserved rules.
Examples:
AISC-CORE-001AISC-FLOW-023AISC-AUDIT-110
D2. Structured Fact Table Design
Recommended fields (adaptable by organization):
| Field | Description |
|---|---|
id | Row-level unique identifier |
name | Semantic name |
value | Enum/config value |
source_rule | Source Rule ID |
status | active / deprecated / draft |
version | Semantic version |
owner | Responsible person or team |
updated_at | Last update timestamp |
Hard constraints:
- Every structured fact row must include
source_rule. source_rulemust resolve to an existing Rule ID and must beAISC-*.- Missing/invalid
source_ruleis a Hard Gate failure. - Cross-table references must be verifiable (existence, uniqueness, type validity).
- Table schema changes must be paired with guard upgrades.
D3. Generated Projection Constraints
- Generated files must include "DO NOT EDIT".
- Generation must be deterministic and repeatable.
- Drift-check commands must detect source/projection mismatch.
- Generation failures block merge; "merge now, fix later" is not allowed.
Part E — Execution Protocol (Change Lifecycle)
E1. Change Classification
Classify each change as one or more of:
Rule Change: Contract clauses changed.Fact Change: Structured facts changed.Projection Change: Generator logic or projection outputs changed.Guard Change: Check scripts/rules changed.
E2. Mandatory Order
The standard sequence is fixed:
- Update Rule.
- Update Table.
- Run Generate.
- Run Check.
- Publish Evidence.
Any skipped step requires an explicit exemption note.
E3. Failure Handling
Recommended severity classes:
- Blocking: Core invariant break, unresolvable rule, or drift failure.
- High: Cross-table inconsistency or missing key guards.
- Medium: Readability or non-critical coverage gaps.
Handling:
- Blocking: Stop merge and fix first.
- High: Fix within a bounded window with regression protection.
- Medium: Track in the plan and close with scheduled follow-up.
E4. Decision Closure
Every change must include:
- Intent (
Why). - Scope (
What). - Execution steps and commands (
How). - Acceptance criteria (
Done). - Risk and rollback strategy (
Risk/Rollback).
Part F — Two-Layer Quality Guard
F1. Layer 1: CI Deterministic Guards
Guard coverage should include:
- Rule ID parseability and uniqueness.
- Table field completeness and type validity.
- Cross-table reference consistency.
- Drift checks between fact source and generated projection.
- Naming conventions and forbidden-pattern checks.
- Rule reference coverage.
- Key implementation/spec mapping checks (constants/enums/state machines).
Existing Check Catalog (Methodology-related Baseline)
check:runtime-spec-kernel-consistencycheck:runtime-spec-kernel-docs-driftcheck:sdk-spec-kernel-consistencycheck:sdk-spec-kernel-docs-driftcheck:desktop-spec-kernel-consistencycheck:desktop-spec-kernel-docs-driftcheck:future-spec-kernel-consistencycheck:future-spec-kernel-docs-driftcheck:platform-spec-kernel-consistencycheck:platform-spec-kernel-docs-driftcheck:realm-spec-kernel-consistencycheck:realm-spec-kernel-docs-driftcheck:spec-human-doc-driftcheck:scope-catalog-driftcheck:runtime-bridge-method-drift
Minimal Hard Gate (Merge Admission)
consistencychecks must pass for all affected domains.docs-driftchecks must pass for all affected domains.- Global
spec-human-doc-driftmust pass. scope-catalog-driftis a Hard Gate for cross-domain mapping.runtime-bridge-method-driftis a Hard Gate for interface projection drift (triggered by relevant changes).
F2. Layer 2: Semantic Audit
Semantic audit covers areas not easily automated:
- Design soundness (strategy, performance, resilience).
- Spec completeness (missing constraints or dimensions).
- Cross-domain semantic alignment (terms, state, and error semantics).
- Evolution feasibility (migration cost and compatibility strategy).
Constraints:
- Semantic audit does not replace CI checks.
- Machine-verifiable defects must flow back to Layer 1 guards.
F3. Bi-directional Audit Model
Bi-directional audit has two lanes:
Lane A: Spec -> Impl: Verify whether spec is implemented.Lane B: Impl -> Spec: Verify whether implementation changes are written back to spec.
Governance roles:
- LLM/automation performs continuous audit.
- Human reviewers are the final arbiter.
Trigger model:
- Event-driven, not fixed cadence.
- Recommended trigger events:
- Kernel/Table changes
- Major feature merges
- Pre-release freeze windows
F4. Defect Backflow
Standard backflow:
- Detect defect.
- Decide whether it is machine-verifiable.
- If yes: add guard rule and fix defect together.
- If no: record semantic audit item and re-review condition.
- Update templates/check catalog after retrospective.
Part G — Templates & Playbooks
G1. PR Template (Generic)
## Change Summary
- Change Type: Rule / Fact / Projection / Guard
- Affected Areas: ...
- Rule IDs: ...
## Files
- Contract files:
- Fact tables:
- Generated views:
- Guard scripts:
## Execution
1. `<generate-command>`
2. `<consistency-check-command>`
3. `<drift-check-command>`
## Gate Results
- Hard Gate: PASS / FAIL
- Soft Gate: PASS / FAIL (if FAIL, risk owner required)
- Advisory: observations / trend notes
## Results
- PASS:
- FAIL:
- Not Run (reason):
## Risks
- Compatibility:
- Rollback:G2. Audit Report Template (Generic)
# Spec Audit Report
Date: YYYY-MM-DD
Scope: ...
## Evidence
- Commands:
- `<command-1>`
- `<command-2>`
- Inputs:
- `<file-or-module-1>`
## Findings
### Blocking
1. ...
### High
1. ...
### Medium
1. ...
## Bi-directional Audit
- Lane A (Spec -> Impl):
- Lane B (Impl -> Spec):
- Human Verdict (Final Arbiter): PASS / CONDITIONAL PASS / FAIL
## Recommended Actions
1. ...
2. ...
## Acceptance Criteria
- [ ] ...
- [ ] ...G3. New Rule Introduction Template (Rule/Table/Check Sync)
## New Rule
- Rule ID: `AISC-<AREA>-NNN`
- Contract location: `<kernel-file>`
- Intent: ...
## Fact Impact
- Table: `<table-file>`
- Fields changed: ...
- source_rule mapping: `AISC-*` (required on every structured fact row)
## Projection Impact
- Generated target: `<generated-file>`
- Regeneration required: yes/no
## Guard Impact
- Existing checks affected: ...
- New deterministic check needed: yes/no
- Check logic summary: ...
## Verification
1. `<generate-command>`
2. `<consistency-check-command>`
3. `<drift-check-command>`G4. Migration Template (Doc-style Spec -> Executable Spec)
## Migration Plan
Phase 1: Inventory
- Collect existing normative statements.
- Identify duplicated facts and conflicting definitions.
Phase 2: Kernelization
- Move cross-domain rules into Kernel contracts.
- Assign stable Rule IDs using `AISC-<AREA>-NNN`.
Phase 3: Structuring
- Convert enumerable facts into Tables.
- Add `source_rule` for every table row (must reference `AISC-*`).
Phase 4: Automation
- Introduce Generate pipeline.
- Introduce Consistency + Drift checks.
Phase 5: Governance
- Define PR evidence policy.
- Define semantic audit cadence and backflow rules.Part H — Anti-Patterns & Red Lines
H1. Red Lines
- Manually editing Generated projections.
- Defining the same fact in multiple locations.
- Running semantic audit without deterministic guards.
- Merging changes without evidence chain.
- Writing execution snapshots into normative spec content.
H2. Common Anti-Patterns
- Treating "local green checks" as "global safety".
- Updating prose but not source facts and guard scripts.
- Changing rules without updating
source_rulebindings. - Explaining rules by personal memory instead of rule text.
H3. Evolution Governance (Phase / Deferred / Deprecation)
Recommended policy:
Phase: Define constraint level (Draft/Normative/Frozen).Deferred: Record deferrals, trigger conditions, and review date.Deprecation: Define deprecation window, migration path, and removal gate.- Every status transition must include evidence and ownership.
Appendix
Appendix A — Glossary
| Term | Definition |
|---|---|
| Spec-first | Define contracts before implementation |
| Kernel | Cross-domain authoritative rule layer |
| Domain | Domain increment layer |
| Table | Structured fact source |
| Generated | Read-only projections generated from fact source |
| Drift | Mismatch between source facts and projections |
| Consistency | Alignment among rules, facts, and references |
| Evidence | Command outputs and audit records as proof chain |
| Semantic Audit | Non-deterministic semantic review |
| Hard Gate | Check failure blocks merge |
| Soft Gate | Check failure can merge only with risk owner |
| Advisory | Recommendation used for trend tracking and optimization |
| Lane A | Spec -> Impl audit lane |
| Lane B | Impl -> Spec audit lane |
Appendix B — 90-Day Minimum Adoption Roadmap (L1/L2/L3)
L1 (Day 1-30): Build the Skeleton
- Establish Kernel/Domain/Table/Generated layers.
- Pilot one core area with
AISC-<AREA>-NNNand Table-first flow. - Introduce minimum Generate and Drift-check.
L2 (Day 31-60): Strengthen Guards
- Extend consistency checks (references, cross-table, naming).
- Introduce audit and PR evidence templates.
- Add blocking guards on high-risk paths.
L3 (Day 61-90): Operationalize at Organization Scale
- Roll out Two-Layer Guard across all domains.
- Standardize semantic-defect-to-script backflow.
- Run quarterly reviews: rule coverage, regression rate, change throughput.
Appendix C — Document Maintenance Rules
- This document maintains methodology design, not execution snapshots.
- Version upgrades must state new axioms, flow changes, or template changes.
- Any new layer or guard mechanism must update Part C/F/G together.
- Keep examples project-agnostic except when command baselines are explicitly listed.