New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

leeway-sdk

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leeway-sdk

LEEWAY™ — Logically Enhanced Engineering Web Architecture Yield. A lightweight autonomous code governance SDK that embeds identity, safety, readability, and repair assistance directly into the developer workflow.

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

LEEWAY™ STANDARDS

The Autonomous Code Governance Framework

LEEWAY™ (Logically Enhanced Engineering Web Architecture Yield) is a software development standard that transforms codebases into self-describing, auditable, AI-readable systems.

The LEEWAY SDK is a lightweight agent platform that embeds governance, safety, readability, and repair assistance directly into the developer workflow — without requiring a heavy LLM runtime.

Quick Start

Install (npm — after publishing)

npm install leeway-sdk
npx leeway doctor

Install (GitHub — works immediately)

npm install github:4citeB4U/LeeWay-Standards#main
npx leeway doctor
npx leeway audit

The Core Philosophy

Traditional codebases become chaotic over time.

Files lose context. Developers leave. Documentation becomes outdated.

LEEWAY solves this by embedding identity and intent directly into the code itself.

Every file must answer five fundamental questions:

  • WHAT does this file do?
  • WHY does it exist?
  • WHO created or owns it?
  • WHERE does it belong in the system?
  • HOW does it operate?

This concept is known as the 5WH Identity Model.

The Three Pillars of LEEWAY

1. Identity

Every file must clearly identify itself via a LEEWAY header at the top that defines:

  • system region
  • component tag
  • color classification
  • icon reference
  • 5WH identity block
  • allowed AI agents

2. Structure

LEEWAY enforces a structured architecture. Files must be placed in directories that match their function.

DirectoryRegionPurpose
src/components/UIUser interface components
src/core/CORECore system logic
src/data/DATAStorage and database access
src/ai/AIAI orchestration and models
src/seo/SEOSearch and discovery logic
src/utils/UTILUtilities and helpers
src/mcp/MCPMulti-Component Processing
src/security/SECURITYSecurity and policies

3. Governance

A LEEWAY system constantly validates itself:

  • Is every file documented?
  • Are files in the correct location?
  • Are security rules followed?
  • Is there duplicate logic?

The LEEWAY Header

Every file must begin with a LEEWAY identity header:

/*
LEEWAY HEADER — DO NOT REMOVE

REGION: UI.APP.SURFACE
TAG: UI.COMPONENT.NEXUS.BUTTON

COLOR_ONION_HEX:
NEON=#39FF14
FLUO=#0DFF94
PASTEL=#C7FFD8

ICON_ASCII:
family=lucide
glyph=layout-dashboard

5WH:
WHAT = Nexus voice control button
WHY = Primary interface for voice commands
WHO = Rapid Web Development
WHERE = src/components/NexusButton.tsx
WHEN = 2026
HOW = React + Tailwind component

AGENTS:
AZR
PHI3
GEMINI
QWEN
LLAMA
ECHO

LICENSE:
MIT
*/

Tagging System

Every file must include a TAG that describes its role.

Tag format: DOMAIN.SUBDOMAIN.ASSET.PURPOSE

UI.COMPONENT.NEXUS.BUTTON
AI.ORCHESTRATION.MODEL.LOADER
DATA.LOCAL.STORE.MAIN
SEO.SCHEMA.GENERATOR.JSONLD
UTIL.FORMAT.DATE.HELPER

File Naming Rules

ContextConventionExample
Folderskebab-casevoice-engine/
React ComponentsPascalCaseVoiceControlPanel.tsx
Functions/VariablescamelCasegenerateSchemaMarkup()

SDK Agent Roster (40 Agents)

Group A — AAA Governance

AgentPurpose
assess-agentSurveys what already exists before anything is created
align-agentNormalizes files, settings, and structure
audit-agentScores compliance and generates reports

Group B — Code Readability & Standards

AgentPurpose
header-agentInserts and repairs LEEWAY headers
tag-agentInfers TAG values from file path and role
region-agentAssigns REGION correctly
discovery-pipeline-agentEnsures every artifact has discovery metadata
authority-agentDeclares allowed actions and execution scope
placement-agentChecks file placement against structure rules
registry-agentUpdates tag registry and system map

Group C — MCP & Agent Safety

AgentPurpose
endpoint-agentDetects existing health and HTTP endpoints
transport-agentVerifies approved MCP transport usage
port-agentAssigns and validates ports from a registry
process-agentHandles process ownership and zombie cleanup
env-agentValidates required vs optional env vars
runtime-agentChecks module/runtime compatibility
manifest-agentValidates manifest completeness and tool definitions
health-agent-liteRuns lightweight startup and readiness checks

Group D — Code Integrity

AgentPurpose
syntax-agentGuards against malformed code
import-agentNormalizes import style and local import rules
module-policy-agentPrevents CommonJS/ESM drift
duplicate-logic-agentDetects repeated logic and duplicate blocks
dependency-graph-agentBuilds lightweight dependency maps
circular-dependency-agentDetects circular imports
refactor-scan-agentSuggests safe structural improvements

Group E — Security & Trust

AgentPurpose
secret-scan-agentLooks for secrets and unsafe credential handling
permission-agentChecks action permissions and runtime boundaries
prompt-security-agentScans prompts for unsafe patterns
tool-access-agentEnsures tools are called through approved paths
policy-agentEnforces LEEWAY policy bundles
privacy-agentChecks privacy and data handling declarations

Group F — Discovery & Documentation

AgentPurpose
schema-agentGenerates machine-readable schemas
sitemap-agentBuilds site/discovery maps
intent-registry-agentTracks supported intents and routes
docs-agentGenerates structured docs from headers
explain-agentExplains a file or module in plain English
architecture-map-agentProduces a JSON/ASCII architecture map

Group G — Orchestration

AgentPurpose
router-agentChooses which agents to invoke for a task
memory-agent-liteStores SDK-local state and audit receipts
doctor-agentRuns full system health and compliance diagnosis

Using the SDK Programmatically

import { AssessAgent, AuditAgent, DoctorAgent } from 'leeway-sdk';

// Assess the codebase
const assess = new AssessAgent({ rootDir: process.cwd() });
const inventory = await assess.run();
console.log(inventory.summary);

// Run a compliance audit
const audit = new AuditAgent({ rootDir: process.cwd() });
const report = await audit.runAndSave();
console.log(`Average compliance: ${report.summary.averageScore}/100`);

// Full system diagnosis
const doctor = new DoctorAgent({ rootDir: process.cwd() });
const diagnosis = await doctor.run();
console.log(doctor.formatReport(diagnosis));

Security Rules

The following rules must always be followed:

  • Never include private API keys, database credentials, or secret tokens in code
  • All user input must be sanitized
  • AI prompts must be protected against malicious injection
  • Dependencies must be verified before installation
  • Use leeway scan to detect any accidental secrets before committing

Compliance Levels

LevelScoreDescription
🥇 Platinum95–100Fully LEEWAY-compliant
🥈 Gold80–94Mostly compliant, minor gaps
🥉 Silver60–79Partially compliant
🔶 Bronze40–59Minimal compliance
❌ None0–39Not LEEWAY-compliant

Quick Start Rules (For Humans or AI)

  • Always include a LEEWAY header.
  • Assign a correct TAG.
  • Place the file in the correct directory.
  • Follow naming conventions.
  • Avoid duplicate logic.
  • Ensure security rules are followed.
  • Document purpose using the 5WH model.

If these rules are followed, the system will remain stable, understandable, and scalable.

Repository Structure

LeeWay-Standards/
├── src/
│   ├── index.js                    # SDK main entry
│   ├── core/                       # Core parsing and validation
│   │   ├── header-parser.js
│   │   ├── tag-validator.js
│   │   ├── region-classifier.js
│   │   └── compliance-scorer.js
│   ├── agents/
│   │   ├── governance/             # Group A: AAA Governance
│   │   ├── standards/              # Group B: Standards agents
│   │   ├── mcp/                    # Group C: MCP & Safety agents
│   │   ├── integrity/              # Group D: Code integrity agents
│   │   ├── security/               # Group E: Security agents
│   │   ├── discovery/              # Group F: Discovery agents
│   │   └── orchestration/          # Group G: Orchestration agents
│   └── cli/
│       └── leeway.js               # CLI entry point
├── docs/                           # Standards documentation
├── schemas/                        # JSON schemas
│   ├── leeway-header.schema.json
│   └── leeway-config.schema.json
├── examples/                       # Example LEEWAY-compliant files
│   ├── NexusButton.tsx
│   └── example-agent.js
└── .leeway/
    └── config.json                 # Project governance config

License

MIT © Rapid Web Development

Keywords

leeway

FAQs

Package last updated on 11 Mar 2026

Related posts