@aisdlc/core

中文文档
3.2.0发布于 2026/11/05MITTypeScriptESM + CJS构建来源已验证近 30 天下载 4579

Deterministic domain verification, compliance, and reporting engine for AI-SDLC

原始使用文档
文档目录18 节
  1. What is AI-SDLC?
  2. Installation
  3. Usage
  4. AI-SDLC architecture
  5. Core Capabilities
  6. 1. Spec-Driven Development (SDD) & PDaC Architecture
  7. 2. Quality Gates & AST Code Metrics
  8. 3. Verification & Compliance Engines
  9. 4. Security & Software Supply Chain (SCA / SAST)
  10. 5. Git 4-Tier Workflow, Commit Trailers & Agent Detection
  11. 6. Reporting, Engineering KPIs & Interactive Dashboard
  12. 7. Repository Scaffolding & Governance Initialization
  13. When should I use this package?
  14. Related packages
  15. Project
  16. GitHub: https://github.com/altromon/AI-SDLC
  17. Contributing
  18. License

@aisdlc/core

Core library for AI-SDLC, an AI-native Software Development Lifecycle framework focused on engineering governance, traceability, quality gates and controlled AI-assisted software delivery.

npm npm downloads

What is AI-SDLC?

AI-SDLC provides a structured approach to integrating AI into the software development lifecycle without losing engineering discipline, traceability or governance.

The framework is designed around concepts such as:

  • Software Development Lifecycle governance
  • AI-assisted engineering
  • Traceability
  • Quality gates
  • Software requirements and specifications
  • Change management
  • Verification
  • Engineering metrics and KPIs
  • Agent-based workflows
  • MCP integration

@aisdlc/core contains the core functionality used by the AI-SDLC ecosystem.

Installation

npm install @aisdlc/core

Or with pnpm:

pnpm add @aisdlc/core

Or with yarn:

yarn add @aisdlc/core

Usage

The core package is intended to be used as the foundation for AI-SDLC tooling, automation, and custom integrations.

import {
  verifyQualityGate,
  verifyTraceability,
  verifySecrets,
  scaffoldSddChange,
  generateDashboardReport,
  readCodeCoverageSummary,
} from '@aisdlc/core';

// 1. Run the deterministic Quality Gate on the codebase
const qualityResult = verifyQualityGate({
  rootDir: process.cwd(),
});
console.log(`Quality gate passed: ${qualityResult.success}`);

// 2. Audit 360° Requirements Traceability Matrix
const traceResult = verifyTraceability({
  rootDir: process.cwd(),
});
console.log(`Missing test coverage count: ${traceResult.missingTests}`);

// 3. Scan for exposed credentials and high-entropy secrets
const secretResult = verifySecrets({
  rootDir: process.cwd(),
});
console.log(`Secret violations found: ${secretResult.violations.length}`);

// 4. Ingest automated test coverage (LCOV from Coverlet/ReportGenerator, Vitest, etc.)
const coverage = readCodeCoverageSummary(process.cwd());
if (coverage) {
  console.log(`Line coverage: ${coverage.linesPct}%, Branch: ${coverage.branchesPct}%`);
}

AI-SDLC architecture

The project separates the core engineering capabilities from its interfaces and integrations:

                    AI-SDLC
                       │
             ┌─────────┴─────────┐
             │                   │
        @aisdlc/core       Integration layer
             │             ┌─────┴─────┐
             │             │           │
             │        @aisdlc/mcp  @aisdlc/cli
             │
             └──── Core engineering capabilities

This separation allows the core functionality to be reused by different interfaces and integrations.

Core Capabilities

@aisdlc/core provides comprehensive domain logic, verification engines, and governance utilities across 7 functional categories:

1. Spec-Driven Development (SDD) & PDaC Architecture

CapabilityDescriptionPrimary Exports
Change ScaffoldingDeterministically scaffolds active SDD change packages (proposal.md, spec.md, design.md, tasks.md) with correlative numbering and canonical handoff.yaml sidecar.scaffoldSddChange, getNextCorrelativeNumber, slugify
Product Handoff SidecarsGenerates, deposits, and validates canonical handoff.yaml (HOF-*) sidecars with cryptographic SHA-256 citations across active changes.depositProductHandoffSidecar, loadProductHandoffSidecar, scanAllProductHandoffs
Change Integration & PromotionPromotes approved requirements to the active baseline, links architecture components, applies proposals, and archives change workspaces.integrateSddChange, verifySddIntegration, detectActiveChangeForIntegration
SDD Framework AdaptersPolymorphic abstraction layer supporting multiple SDD specification formats (OpenSpec and SpecKit) seamlessly.getSddAdapter, OpenSpecAdapter, SpecKitAdapter
PDaC Graph & Cryptographic DriftConstructs the Product Definition as Code graph and audits SHA-256 digests across specifications to detect out-of-sync drift.verifyPdacGraph, syncPdacDigests, computeCanonicalSha256, extractCitations
Progressive Friction & Anti-BypassEnforces governance gates based on change risk profile (patch, standard, critical) and prevents unauthorized modifications to protected core paths.verifyProgressiveFriction, detectProfileFromChange, isPathProtectedFromPatch

2. Quality Gates & AST Code Metrics

CapabilityDescriptionPrimary Exports
Deterministic Quality GateEvaluates codebases against formal policies (quality-policy.yaml) across Cyclomatic Complexity, Cognitive Complexity, Maintainability Index, and function length.verifyQualityGate, createDefaultQualityPolicy, parseQualityPolicy
Polyglot & TypeScript AST AnalysisNative AST-based function and class metric extraction for TypeScript/JavaScript, plus zero-heuristic parsing for Python, Go, Java, C#, C++, and Rust.extractFunctions, extractFunctionsTypeScriptAst, extractFunctionsPolyglot, calculateMetrics

3. Verification & Compliance Engines

CapabilityDescriptionPrimary Exports
360° Requirements Traceability MatrixAudits bidirectional traceability links between Upstream Product Handoffs (HOF), Midstream Arc42 Components (CMP), and Downstream Acceptance Tests (.feature).verifyTraceability, generateTraceabilityReportMarkdown, parseFrontmatter
Task Governance & Human Review PlansAudits task completion status, human review checklists, and autonomy classification levels (AUTONOMOUS, HUMAN_REVIEW_PLAN, etc.).verifyTasksGovernance, generateGovernanceReportMarkdown, parseTasksDoc
Verification & Acceptance Test CoverageVerifies that 100% of defined requirements and engineering tasks have corresponding automated tests implemented on disk.verifyTestingCoverage, scanAllTestArtifacts, generateTestingCoverageReportMarkdown
Specification Schema ValidationValidates Markdown frontmatter and structure against canonical JSON Schemas (Draft 2020-12) for proposals, specs, designs, and tasks.verifyArtifactsSchemas, validateArtifactSchema, validateAgainstSchema
Duplicate Requirements DetectionTokenizes and computes lexical similarity (Jaccard $\ge 85%$), duplicate hashes, and BDD scenario collisions before code authoring.verifyArtifactDuplicates, calculateJaccardSimilarity, generateDuplicatesReportMarkdown
BDD Gherkin SynchronizationExtracts gherkin blocks from Markdown specifications and synchronizes them to standalone executable .feature files under tests/features/.extractGherkinFeatures, checkGherkinInSync, extractGherkinBlock

4. Security & Software Supply Chain (SCA / SAST)

CapabilityDescriptionPrimary Exports
License Compliance & SCAScans direct and transitive dependencies, maps SPDX identifiers against license-policy.yaml, flags restricted/blocked licenses, and evaluates vulnerability thresholds.verifyLicenses, scanInstalledLicenses, scanWithNativeFs, scanWithTrivy, scanWithSyft, evaluateVulnerabilityThresholds
SBOM & Third-Party NoticesGenerates enterprise-ready CycloneDX 1.5 JSON SBOMs and compiles complete markdown third-party license notices.generateCycloneDxSbom, writeCycloneDxSbom, generateThirdPartyNotices, writeThirdPartyNotices
Secret Scanning & Entropy AuditingScans git diffs and codebase files for exposed API keys, private credentials, and high-entropy strings (Shannon entropy $\ge 4.3$). Audits structured exception suppressions.verifySecrets, calculateShannonEntropy, runGitleaksCli, generateSecretsReportMarkdown, parseSecuritySuppression, generateSuppressionsAuditReport
Static Application Security (SAST)AST and pattern analysis for OWASP Top 10 vulnerabilities (SQLi, command injection, SSRF, path traversal, prompt injection). Supports Semgrep CLI.verifySast, scanFileForSast, runSemgrepCli, detectPromptInjection
Data Protection & Privacy-by-Design (PII-SAST & RoPA)Audits Personal Data Assets (DATA-ASSET-*), GDPR Art. 30 Records (PRIV-ROPA-*), Privacy Requirements (PRIV-REQ-*), DPIA gates (DPIA-*), and static PII-SAST rules (PRIV-001–PRIV-008) against privacy-policy.yaml.verifyPrivacy, loadPrivacyPolicy, scanFileForPrivacyViolations, generateRopaInventoryMarkdown, generatePrivacyReportMarkdown

5. Git 4-Tier Workflow, Commit Trailers & Agent Detection

CapabilityDescriptionPrimary Exports
4-Tier Git Branch ManagementClassifies and orchestrates the 4-tier branch hierarchy (main $\rightarrow$ release/* $\rightarrow$ feat/* $\rightarrow$ task/*) to ensure isolation and discipline.classifyBranch, generateBranchHierarchyPlan
Automated Task CheckoutResolves task context from active SDD changes and automatically checkouts or cascades required branch tiers.checkoutTaskBranch, locateTaskInActiveChanges, resolveBranchHierarchy
Commit Trailer EngineParses, formats, and validates standardized Git commit trailers (Task-ID, Handoff-Digest, Model, Autonomy).parseCommitTrailers, formatCommitTrailers, inferMissingTrailers, extractCommitKpisFromRange
AI Agent Author DetectionUniversally and IDE-independently detects whether git commits or active sessions originate from a human developer or an AI agent.detectAuthorIdentity
Git Hook InstallerProgrammatically installs deterministic Git hooks (e.g. prepare-commit-msg) for automated metadata injection.installGitHooks

6. Reporting, Engineering KPIs & Interactive Dashboard

CapabilityDescriptionPrimary Exports
Interactive Offline DashboardGenerates a 100% self-contained offline HTML dashboard with Cytoscape.js interactive graph for visualizing the full PDaC and RTM network (including ARCH-INTRO-*, Bounded Contexts BC-*, DATA-ASSET-*, PRIV-ROPA-*, and PRIV-REQ-*).generateDashboardReport, buildGraphElements, renderDashboardHtml
Formal Code Quality ReportingCompiles granular polyglot code quality analysis into structured Markdown reports (reports/QUALITY_REPORT.md).generateQualityReport, writeQualityReport, calculateRating
Code Coverage IngestionPassively ingests test coverage summaries from standard formats (coverage/lcov.info, coverage/coverage-summary.json) across polyglot stacks (.NET via Coverlet & ReportGenerator, Node.js, Python).readCodeCoverageSummary
Pull Request KPIs & TelemetryCalculates human vs. AI agent contribution ratios, review cycle duration, and token usage, formatting them for PR templates.aggregatePrKpis, formatPrKpiMarkdown, injectKpisIntoPrBody
Release KPIs & Defect Injection RateComputes release-level engineering metrics, Defect Injection Rate (DIR) per author/model, rework costs, and defect density.aggregateReleaseKpis, formatReleaseKpiMarkdown, writeReleaseKpiReport

7. Repository Scaffolding & Governance Initialization

CapabilityDescriptionPrimary Exports
AI-SDLC Project BootstrappingConfigures policies (quality-policy.yaml, license-policy.yaml, privacy-policy.yaml), all 34 schemas, 38 starter templates, arc42 architecture templates, CI workflows, and AI agent rules (11 specialized agents). Injects standard npm scripts into consumer package.json.initProject, resolveAgentTargets, collectAgentFiles
Canonical Starter Templates & SchemasPre-bundled, typed constants for all 34 Draft 2020-12 JSON schemas and 38 base templates (Product, Security, Privacy, Safety, Manuals, Compliance, SDD, CI/CD). Provides automatic in-memory fallback during schema validation.STARTER_BASE_TEMPLATES, STARTER_SCHEMAS, STARTER_SCHEMAS_MAP, STARTER_QUALITY_POLICY, STARTER_LICENSE_POLICY, STARTER_PRIVACY_POLICY, STARTER_PULL_REQUEST_TEMPLATE, STARTER_GITHUB_PULL_REQUEST_TEMPLATE
Universal MCP ScaffoldingPre-bundled Model Context Protocol server configuration files for immediate IDE integration without manual setup.STARTER_CURSOR_MCP, STARTER_ANTIGRAVITY_MCP, STARTER_VSCODE_MCP
Multi-Provider CI/CD PipelinesProduction-ready pipeline definitions using npx @aisdlc/cli across GitHub Actions (including automated PR KPI aggregation), GitLab CI, Azure DevOps, and Bitbucket Pipelines.STARTER_GITHUB_CI, STARTER_GITHUB_SDD_INTEGRATE, STARTER_GITHUB_PR_KPI, STARTER_GITHUB_DEPLOY_DASHBOARD, STARTER_GITLAB_CI, STARTER_AZURE_PIPELINES, STARTER_BITBUCKET_PIPELINES

When should I use this package?

Use @aisdlc/core when you are:

  • Building tooling on top of AI-SDLC
  • Integrating AI-SDLC into an existing engineering platform
  • Creating custom AI-assisted development workflows
  • Developing extensions or integrations
  • Building your own interface over the AI-SDLC capabilities

If you simply want to use AI-SDLC from the command line, start with @aisdlc/cli.

If you want MCP integration, see @aisdlc/mcp.

PackagePurpose
@aisdlc/coreCore AI-SDLC capabilities
@aisdlc/cliCommand-line interface
@aisdlc/mcpMCP integration

Project

AI-SDLC is an open-source project:

GitHub: https://github.com/altromon/AI-SDLC

For architecture, governance, processes and the complete project documentation, see the repository.

Contributing

Contributions, issues and architectural discussions are welcome.

Please see the GitHub repository for contribution guidelines and development information.

License

See the repository license for the current licensing terms.

版本与发布记录

@aisdlc/core 共发布 30 个版本,首次发布于 2026/10/02;过去 12 个月发布了 30 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.2.0latest2026/11/051 天前
3.1.02026/11/042 天前
3.0.02026/11/024 天前
2.5.12026/11/015 天前
2.5.02026/10/316 天前
2.4.02026/10/306 天前

关于 @aisdlc/core 的常见问题

@aisdlc/core 是什么?

Deterministic domain verification, compliance, and reporting engine for AI-SDLC

如何安装 @aisdlc/core?

在项目目录运行 npm install @aisdlc/core,或使用 pnpm add / yarn add / bun add。

@aisdlc/core 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@aisdlc/core 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@aisdlc/core 可以商用吗?

@aisdlc/core 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@aisdlc/core 的下载量有多少?

根据 npm 官方下载统计,@aisdlc/core 在 2026/10/05 – 2026/11/03 这 30 天内被下载 4,579 次,日均约 153 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aisdlc/core 还在维护吗?

最新版本 3.2.0 发布于 2026/11/05(1 天前);至今共发布 30 个版本,其中过去 12 个月发布了 30 个;首次发布于 2026/10/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。