@aisdlc/core 4.5.0 → 4.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3394,7 +3394,8 @@ function verifyQualityGate(options = {}) {
3394
3394
  const requireUiTests = Boolean(options.requireUiComponentTests ?? policy.require_ui_component_tests);
3395
3395
  const untestedFunctions = requireUnitTests ? auditUnitTestsPerFunction(results, rootDir, policy.test_patterns) : [];
3396
3396
  const untestedUiComponents = requireUiTests ? auditUiComponents(rootDir, policy) : [];
3397
- const coverageViolations = evaluateCoverageThresholds(rootDir, policy, options.requireCoverageReport);
3397
+ const requireCoverageReport = options.requireCoverageReport ?? policy.enforce_mode === "STRICT";
3398
+ const coverageViolations = evaluateCoverageThresholds(rootDir, policy, requireCoverageReport);
3398
3399
  const baselineFile = resolveBaselineFilePath(rootDir, options);
3399
3400
  if (options.updateBaseline) {
3400
3401
  const entries = extractBaselineEntriesFromResults(results);
@@ -18784,6 +18785,53 @@ function serializeSarifDocument(doc, pretty = true) {
18784
18785
  function writeSecuritySarifReport(outputPath, doc, pretty = true) {
18785
18786
  writeReportFileIfChanged(outputPath, serializeSarifDocument(doc, pretty));
18786
18787
  }
18788
+ var AISDLC_MANIFEST_FILENAME = ".aisdlc.json";
18789
+ function getAisdlcVersion() {
18790
+ try {
18791
+ const req = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
18792
+ const pkg = req("../package.json");
18793
+ if (pkg?.version) return pkg.version;
18794
+ } catch {
18795
+ }
18796
+ return "0.0.0";
18797
+ }
18798
+ function readAisdlcManifest(rootDir) {
18799
+ const manifestPath = path14__namespace.join(rootDir, AISDLC_MANIFEST_FILENAME);
18800
+ if (!fs12__namespace.existsSync(manifestPath)) return null;
18801
+ try {
18802
+ const raw = JSON.parse(fs12__namespace.readFileSync(manifestPath, "utf-8"));
18803
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
18804
+ const record = raw;
18805
+ if (typeof record.version !== "string" || !record.version.trim()) return null;
18806
+ return { ...record, version: record.version.trim() };
18807
+ } catch {
18808
+ return null;
18809
+ }
18810
+ }
18811
+ function writeAisdlcManifest(rootDir, version = getAisdlcVersion()) {
18812
+ const manifestPath = path14__namespace.join(rootDir, AISDLC_MANIFEST_FILENAME);
18813
+ let data = {};
18814
+ if (fs12__namespace.existsSync(manifestPath)) {
18815
+ try {
18816
+ const existing = JSON.parse(fs12__namespace.readFileSync(manifestPath, "utf-8"));
18817
+ if (existing && typeof existing === "object" && !Array.isArray(existing)) {
18818
+ data = existing;
18819
+ }
18820
+ } catch {
18821
+ }
18822
+ }
18823
+ data.version = version;
18824
+ fs12__namespace.writeFileSync(manifestPath, JSON.stringify(data, null, 2) + "\n", "utf-8");
18825
+ }
18826
+ function formatAisdlcVersionOutput(rootDir = process.cwd()) {
18827
+ const installed = getAisdlcVersion();
18828
+ const manifest = readAisdlcManifest(rootDir);
18829
+ if (!manifest) return installed;
18830
+ if (manifest.version === installed) {
18831
+ return `${installed} (repo: ${manifest.version})`;
18832
+ }
18833
+ return `${installed} (repo: ${manifest.version} \u2014 differs from installed CLI)`;
18834
+ }
18787
18835
 
18788
18836
  // src/init/agent-templates.ts
18789
18837
  var SPECIALIZED_AGENT_TEMPLATES = [
@@ -19138,7 +19186,7 @@ var LIFECYCLE_SKILL_TEMPLATES = [
19138
19186
  description: "Orchestrate end-to-end AI-SDLC onboarding and Phase 0 Inception for brand-new (Greenfield) projects, from repository initialization (aisdlc init) and NAF v4 Vision (ARCH-INTRO-*) through ProductShape, STRIDE Threat Modeling, arc42 Architecture, 2-checkpoint transversal auditor/adversary verification, and topological wave SDD delivery.",
19139
19187
  references: "[`process/02_product_definition.md`](../../process/02_product_definition.md), [`process/04b_data_protection_and_privacy.md`](../../process/04b_data_protection_and_privacy.md), [`process/05_architecture_arc42_nafv4.md`](../../process/05_architecture_arc42_nafv4.md), [`process/06_spec_driven_development.md`](../../process/06_spec_driven_development.md), and [`process/09_agent_protocols.md`](../../process/09_agent_protocols.md).",
19140
19188
  globs: "product/**, specs/product/**, architecture/**, templates/**",
19141
- body: '## Purpose & Trigger\nUse this skill when starting a **brand-new software project from scratch (Greenfield)** or when `specs/product/` has no canonical baseline yet. It coordinates the sequential execution of AI-SDLC MCP/CLI tools and specialized role agents so no code is written before product vision, security enclaves, privacy-by-design controls, and architecture contracts exist.\n\n## Consolidated Inception Quality & Adversarial Checkpoint\nAcross Phase 0 and Inception, quality auditing and adversarial stress-testing are concentrated at the completion of Inception design (or after product shaping):\n- **Concurrent Inspection**: Concurrently invoke [`agent-auditor`](../agent-auditor/SKILL.md) (evaluating YAGNI, structural debt, and simplification) and [`agent-adversary`](../agent-adversary/SKILL.md) (stress-testing logic traps, SPOFs, attack vectors, or broken invariants) in clean, isolated context windows.\n- **Non-Invasive Review**: Neither auditor nor adversary modifies deliverables directly; both deliver structured reports citing canonical IDs and SHA-256 digests.\n- **Consolidated Remediation**: Consolidate findings and emit the Workflow Handoff back to authoring agents to resolve blocking defects and apply simplifications (max 2 correction rounds).\n- **Anti-Ping-Pong Guardrail**: Bounded strictly to maximum **1 correction round**. If non-blocking advisories remain, proceed to the downstream phase; if blocking defects persist, escalate immediately to the Human Tech Lead.\n\n## End-to-End Execution Playbook\n\n### Step 1: Branch-Before-Change & Repository Turnkey Initialization\n1. **Branch-Before-Change**: Verify the active branch (`git branch --show-current`). If currently on a protected branch (`main`, `master`, `release/*`), create and switch to an inception branch (e.g., `feat/inception-baseline` or `chore/aisdlc-inception`) **before** modifying or creating any files.\n2. If the workspace has not been initialized with AI-SDLC schemas, policies, and templates, run MCP tool `new` (or CLI `npx @aisdlc/cli init`).\n3. Install the Git telemetry hook via `npx aisdlc git hook install` (`pnpm run git:hook:install`).\n4. Verify `quality-policy.yaml`, `license-policy.yaml`, and `privacy-policy.yaml` are present in the repository root.\n5. Commit initial scaffolding, push (`git push -u origin <branch>`), and open a **Draft PR** (`gh pr create --draft`, with graceful fallback if no remote or CLI auth exists) so all Phase 0 Inception artifacts (`ARCH-INTRO-001`, ProductShape, Threat/Privacy, Architecture) are pushed incrementally to the Draft PR.\n\n### Step 2: Phase 0 Product Inception (`agent-product-analyst`)\n1. Delegate to or adopt [`agent-product-analyst`](../agent-product-analyst/SKILL.md).\n2. **Iterative Discovery Interview (Up to 15 Questions or Until Product Scope is 100% Clear)**: Before generating artifacts, clarify with the human Product Owner in rounds of 3\u20135 questions:\n - Core mission statement and business problem.\n - Primary actors (`ACT-*`) and external systems.\n - **Target Interaction & Presentation Modality (`CON-*` / `ARCH-INTRO-001`)**: Explicitly define at inception how human actors will interact with the MVP (e.g., **Web UI**, **Desktop GUI**, **Interactive Console/TUI/CLI**, **Mobile App**, or **Headless API/SDK** if actors are exclusively external systems). Never assume a headless class library when human actors exist.\n - **Delivery & Deployment Model (`ARCH-INTRO-001` / `CON-*` / `QR-*`)**: Clarify in business terms how the product will be delivered and operated (Cloud SaaS, Self-Hosted/On-Premise, Local Desktop/CLI binary, or Library/SDK package) along with any data-residency or availability requirements.\n - **Modern Aesthetic & Design System Standard (`CON-UI-*` / `ARCH-INTRO-001`)**: Explicitly define a modern, visually attractive styling standard adapted to the chosen presentation modality: (1) **Web UI**: modern responsive layouts using Bootstrap 5 utility classes and components (`card`, `table table-hover`, `badge`, `alert alert-*`, responsive grid) or modern equivalents, (2) **Desktop GUI**: modern clean design (rounded corners, elevated panels, padding, consistent typography) avoiding raw legacy unstyled windows, (3) **Console / TUI**: rich terminal interface with ANSI colors, status badges, formatted tables, and progress indicators (e.g., Spectre.Console, Rich, Ink, or Chalk/Picocolors).\n - **User Journeys (`JRN-*`) to Generate (Plain-Language Elicitation)**: Ask in simple, everyday language which end-to-end user journeys to model, explicitly indicating the 5 pieces of information needed to build each journey properly: (1) protagonist user (`persona` / `ACT-*`) and their main goal, (2) step-by-step stages from start to finish (`stages`), (3) interaction screens/channels at each stage (`touchpoints`), (4) current obstacles or pain points (`pain-points`), and (5) concrete system capabilities/use cases (`related-use-cases` / `UC-*`).\n - Essential MVP capabilities (`UC-*`) vs. future roadmap, ensuring **foundational entity CRUD / master data workflows** are explicitly included in the MVP.\n - Top 3\u20135 quality goals (`QR-*`) and regulatory/technical constraints (`CON-*`).\n3. **Enterprise & Capability Vision**: Create `specs/architecture/ARCH-INTRO-001.md` (`status: draft`, `naf-perspective: "Enterprise & Capability"`) using `templates/architecture/introduction-and-goals.template.md`, explicitly recording the chosen presentation/UI modality.\n4. **ProductShape Baseline**: Derive initial draft artifacts in `specs/product/`:\n - Actors (`ACT-*`), User Journeys (`JRN-*`), Use Cases (`UC-*`), Business Rules (`BR-*`), Functional Requirements (`FR-*` with mandatory `@nominal`, `@boundary`, `@invalid` Gherkin blocks), and Quality Requirements (`QR-*`).\n - **Vertical Slice Completeness Rule**: Every human-triggered `UC-*` in the MVP must specify observable user interaction through the agreed presentation modality and state persistence.\n5. Validate schemas and duplicates via MCP tools `verify_schemas` and `verify_duplicates` (or `npx aisdlc check --fix`).\n6. **Mandatory Upstream UX & MVP Boundary Gate (`agent-expert-user`)**: Invoke [`agent-expert-user`](../agent-expert-user/SKILL.md) in **Design Mode** to stress-test the proposed workflows, enforce strict MVP boundaries, reject any headless/library-only MVP when human actors exist, verify master-data CRUD prerequisites, and separate core MVP `UC-*` from future roadmap backlog.\n\n### Step 3: Shift-Left Cybersecurity & Privacy-by-Design (`agent-threat-modeler` \u2794 `agent-privacy-officer`)\n1. Delegate to or adopt [`agent-threat-modeler`](../agent-threat-modeler/SKILL.md).\n2. Analyze every `UC-*` and `FR-*` using STRIDE and OWASP ASVS to create in `specs/security/`:\n - Threat Actors (`ACT-THREAT-*`), Abuse Cases (`ABUSE-*` targeting `UC-*`), and Security Requirements (`SEC-REQ-*` with `@security @mitigation` negative Gherkin scenarios and `SEC-ENC-*` Zero Trust enclave bindings).\n3. Hand off to [`agent-privacy-officer`](../agent-privacy-officer/SKILL.md) to apply LINDDUN and GDPR/LOPDGDD/ISO 27701 in `specs/privacy/`:\n - Personal Data Assets (`DATA-ASSET-*`), GDPR Art. 30 Records of Processing (`PRIV-ROPA-*`), and Privacy Requirements (`PRIV-REQ-*` with `@privacy @gdpr` Gherkin scenarios).\n4. Run `verify_schemas` and `verify_privacy` (`npx aisdlc verify privacy`).\n\n### Step 4: Modular Systems Architecture (`agent-system-architect`)\n1. Delegate to or adopt [`agent-system-architect`](../agent-system-architect/SKILL.md).\n2. Define building blocks (`CMP-*`), Deployment Topology (`ARCH-DEP-001` translating the delivery model into execution nodes `RES-*` and enclaves `SEC-ENC-*`), and Architectural Decision Records (`ADR-*`) in `specs/architecture/` using `templates/architecture/`, ensuring every `CMP-*` cites `implements-use-cases` (`UC-*`) and `satisfies-requirements` (`FR-*`, `QR-*`, `SEC-REQ-*`, `PRIV-REQ-*`).\n3. Inspect third-party stack choices against `license-policy.yaml` via `verify_licenses` and subprocessors against `privacy-policy.yaml` via `verify_privacy`.\n4. **Technical Security & Privacy Feedback Loop**: If new infrastructure, persistence, LLM, or auth decisions introduce attack vectors or PII flows, return to `agent-threat-modeler` \u2794 `agent-privacy-officer` to add technical mitigations before coding.\n\n### Checkpoint 1 (Inception Design Checkpoint): `agent-auditor` $\\parallel$ `agent-adversary`\n1. Concurrently invoke `agent-auditor` (evaluating YAGNI, architecture bloat, interface contracts) and `agent-adversary` (simulating SPOFs, race conditions, unhandled threat scenarios) in isolated context windows over all Phase 0 deliverables.\n2. Consolidate findings and remediate in authoring agents (max 2 correction rounds), committing and pushing (`git push`) updates to the Draft PR.\n3. **Human Approval Gate**: Mark the Inception Draft PR ready (`gh pr ready`) and present the comprehensive Inception model for Human PO & Tech Lead sign-off.\n\n### Step 5: Release Milestone & Topological Wave SDD Plan (`1 UC-* = 1 CHG-*`)\n1. **Open Release Milestone (`Tier 2: release/v1.0.0` or Streamlined `main`)**: Group approved MVP Use Cases (`UC-001`, `UC-002`, ...) and visualize execution plan.\n2. **Decompose into Topological Waves (DAG Parallelism)**:\n - **Wave 0 \u2014 Foundational Core, Executable Presentation Host & CI/CD (`agent-devops`) (Sequential)**: Scaffold `CHG-001` via [`aisdlc-increment`](../aisdlc-increment/SKILL.md) to establish domain core, shared contracts, auth/config, and the runnable presentation host. Invoke [`agent-devops`](../agent-devops/SKILL.md) to clarify the technical CI/CD & packaging strategy (CI Quality Gates, Docker/GHCR, package registry, or PaaS/Cloud) and scaffold `.github/workflows/` and container manifests without modifying `src/`.\n - **Waves 1..N \u2014 Orthogonal End-to-End Vertical Slices (Parallel Multi-Agent)**: Once Wave 0 contracts are merged, execute independent `CHG-*` increments (`1 UC-* = 1 CHG-*`) in parallel across isolated branches/worktrees (`feat/CHG-002`, `feat/CHG-003`, ...).\n3. **Release Consolidation (`agent-devops`)**: Once all MVP increments are integrated (`sdd_integrate`), run `verify` (`npx aisdlc verify all`), generate SBOM, compute release KPIs (`kpi_release`), regenerate canonical reports and dashboard (`report_quality`, `report_dashboard`), verify release/publishing workflows via `agent-devops`, and open the Release PR for final human approval and SemVer tagging (`v1.0.0`). Individual `feat/CHG-*` PRs must compute reports locally without committing global `reports/` files to avoid merge conflicts.\n\n## Non-Negotiable Guardrails\n- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles in the same conversation context window. Always spawn each specialist in a fresh isolated subagent context that reads state strictly from disk.\n- **2-Checkpoint Quality & Adversarial Protocol**: Quality auditing and adversarial testing are concentrated at the completion of Inception design and Pre-PR implementation, avoiding micro-step overhead.\n- **FORBIDDEN Library-Only MVP for Human-Facing Products**: Whenever a product defines human actors (`ACT-*`), no agent may scope the MVP as headless class libraries without an executable presentation host.\n- **FORBIDDEN Greenfield Monolith (`1 UC-* = 1 CHG-*`)**: Never bundle the entire product or multiple `UC-*` into a single SDD change (`CHG-001`). Parallelism is achieved by running **multiple bounded `CHG-*` concurrently** on separate branches/worktrees.\n- Never invoke `sdd_change_new` or write application code in `src/` on a Greenfield project before `ARCH-INTRO-001`, `agent-expert-user` MVP validation, and at least one `UC-*` and `FR-*` exist.\n- All newly drafted specifications must start with `status: draft`.'
19189
+ body: '## Purpose & Trigger\nUse this skill when starting a **brand-new software project from scratch (Greenfield)** or when `specs/product/` has no canonical baseline yet. It coordinates the sequential execution of AI-SDLC MCP/CLI tools and specialized role agents so no code is written before product vision, security enclaves, privacy-by-design controls, and architecture contracts exist.\n\n## Consolidated Inception Quality & Adversarial Checkpoint\nAcross Phase 0 and Inception, quality auditing and adversarial stress-testing are concentrated at the completion of Inception design (or after product shaping):\n- **Concurrent Inspection**: Concurrently invoke [`agent-auditor`](../agent-auditor/SKILL.md) (evaluating YAGNI, structural debt, and simplification) and [`agent-adversary`](../agent-adversary/SKILL.md) (stress-testing logic traps, SPOFs, attack vectors, or broken invariants) in clean, isolated context windows.\n- **Non-Invasive Review**: Neither auditor nor adversary modifies deliverables directly; both deliver structured reports citing canonical IDs and SHA-256 digests.\n- **Consolidated Remediation**: Consolidate findings and emit the Workflow Handoff back to authoring agents to resolve blocking defects and apply simplifications (max 2 correction rounds).\n- **Anti-Ping-Pong Guardrail**: Bounded strictly to maximum **1 correction round**. If non-blocking advisories remain, proceed to the downstream phase; if blocking defects persist, escalate immediately to the Human Tech Lead.\n\n## End-to-End Execution Playbook\n\n### Step 1: Branch-Before-Change, Pre-Change Draft PR & Repository Initialization\n1. **Branch-Before-Change & Pre-Change Draft PR/MR**: Verify the active branch (`git branch --show-current`). If currently on a protected branch (`main`, `master`, `release/*`), create and switch to an inception branch (e.g., `feat/inception-baseline` or `chore/aisdlc-inception`) **before** modifying or creating any files. Whenever a remote repository is configured (`git remote`), check if an open PR/MR exists for the branch (`gh pr view` / `gh pr list --head <branch>` on GitHub; `glab mr view` / `glab mr list --source-branch <branch>` on GitLab); if none exists, create an empty bootstrap commit (`git commit --allow-empty -m "chore(inception): open draft PR"`), push (`git push -u origin <branch>`), and open a **Draft PR/MR** (`gh pr create --draft` on GitHub; `glab mr create --draft` or `git push -o merge_request.create -o merge_request.draft` on GitLab) before making any changes (if no remote exists, work locally).\n2. If the workspace has not been initialized with AI-SDLC schemas, policies, and templates, run MCP tool `new` (or CLI `npx @aisdlc/cli init`).\n3. Install the Git telemetry hook via `npx aisdlc git hook install` (`pnpm run git:hook:install`).\n4. Verify `quality-policy.yaml`, `license-policy.yaml`, and `privacy-policy.yaml` are present in the repository root.\n5. Commit and push (`git push`) Phase 0 Inception artifacts (`ARCH-INTRO-001`, ProductShape, Threat/Privacy, Architecture) incrementally to the open Draft PR.\n\n### Step 2: Phase 0 Product Inception (`agent-product-analyst`)\n1. Delegate to or adopt [`agent-product-analyst`](../agent-product-analyst/SKILL.md).\n2. **Iterative Discovery Interview (Up to 15 Questions or Until Product Scope is 100% Clear)**: Before generating artifacts, clarify with the human Product Owner in rounds of 3\u20135 questions:\n - Core mission statement and business problem.\n - Primary actors (`ACT-*`) and external systems.\n - **Target Interaction & Presentation Modality (`CON-*` / `ARCH-INTRO-001`)**: Explicitly define at inception how human actors will interact with the MVP (e.g., **Web UI**, **Desktop GUI**, **Interactive Console/TUI/CLI**, **Mobile App**, or **Headless API/SDK** if actors are exclusively external systems). Never assume a headless class library when human actors exist.\n - **Delivery & Deployment Model (`ARCH-INTRO-001` / `CON-*` / `QR-*`)**: Clarify in business terms how the product will be delivered and operated (Cloud SaaS, Self-Hosted/On-Premise, Local Desktop/CLI binary, or Library/SDK package) along with any data-residency or availability requirements.\n - **Modern Aesthetic & Design System Standard (`CON-UI-*` / `ARCH-INTRO-001`)**: Explicitly define a modern, visually attractive styling standard adapted to the chosen presentation modality: (1) **Web UI**: modern responsive layouts using Bootstrap 5 utility classes and components (`card`, `table table-hover`, `badge`, `alert alert-*`, responsive grid) or modern equivalents, (2) **Desktop GUI**: modern clean design (rounded corners, elevated panels, padding, consistent typography) avoiding raw legacy unstyled windows, (3) **Console / TUI**: rich terminal interface with ANSI colors, status badges, formatted tables, and progress indicators (e.g., Spectre.Console, Rich, Ink, or Chalk/Picocolors).\n - **User Journeys (`JRN-*`) to Generate (Plain-Language Elicitation)**: Ask in simple, everyday language which end-to-end user journeys to model, explicitly indicating the 5 pieces of information needed to build each journey properly: (1) protagonist user (`persona` / `ACT-*`) and their main goal, (2) step-by-step stages from start to finish (`stages`), (3) interaction screens/channels at each stage (`touchpoints`), (4) current obstacles or pain points (`pain-points`), and (5) concrete system capabilities/use cases (`related-use-cases` / `UC-*`).\n - Essential MVP capabilities (`UC-*`) vs. future roadmap, ensuring **foundational entity CRUD / master data workflows** are explicitly included in the MVP.\n - Top 3\u20135 quality goals (`QR-*`) and regulatory/technical constraints (`CON-*`).\n3. **Enterprise & Capability Vision**: Create `specs/architecture/ARCH-INTRO-001.md` (`status: draft`, `naf-perspective: "Enterprise & Capability"`) using `templates/architecture/introduction-and-goals.template.md`, explicitly recording the chosen presentation/UI modality.\n4. **ProductShape Baseline**: Derive initial draft artifacts in `specs/product/`:\n - Actors (`ACT-*`), User Journeys (`JRN-*`), Use Cases (`UC-*`), Business Rules (`BR-*`), Functional Requirements (`FR-*` with mandatory `@nominal`, `@boundary`, `@invalid` Gherkin blocks), and Quality Requirements (`QR-*`).\n - **Vertical Slice Completeness Rule**: Every human-triggered `UC-*` in the MVP must specify observable user interaction through the agreed presentation modality and state persistence.\n5. Validate schemas and duplicates via MCP tools `verify_schemas` and `verify_duplicates` (or `npx aisdlc check --fix`).\n6. **Mandatory Upstream UX & MVP Boundary Gate (`agent-expert-user`)**: Invoke [`agent-expert-user`](../agent-expert-user/SKILL.md) in **Design Mode** to stress-test the proposed workflows, enforce strict MVP boundaries, reject any headless/library-only MVP when human actors exist, verify master-data CRUD prerequisites, and separate core MVP `UC-*` from future roadmap backlog.\n\n### Step 3: Shift-Left Cybersecurity & Privacy-by-Design (`agent-threat-modeler` \u2794 `agent-privacy-officer`)\n1. Delegate to or adopt [`agent-threat-modeler`](../agent-threat-modeler/SKILL.md).\n2. Analyze every `UC-*` and `FR-*` using STRIDE and OWASP ASVS to create in `specs/security/`:\n - Threat Actors (`ACT-THREAT-*`), Abuse Cases (`ABUSE-*` targeting `UC-*`), and Security Requirements (`SEC-REQ-*` with `@security @mitigation` negative Gherkin scenarios and `SEC-ENC-*` Zero Trust enclave bindings).\n3. Hand off to [`agent-privacy-officer`](../agent-privacy-officer/SKILL.md) to apply LINDDUN and GDPR/LOPDGDD/ISO 27701 in `specs/privacy/`:\n - Personal Data Assets (`DATA-ASSET-*`), GDPR Art. 30 Records of Processing (`PRIV-ROPA-*`), and Privacy Requirements (`PRIV-REQ-*` with `@privacy @gdpr` Gherkin scenarios).\n4. Run `verify_schemas` and `verify_privacy` (`npx aisdlc verify privacy`).\n\n### Step 4: Modular Systems Architecture (`agent-system-architect`)\n1. Delegate to or adopt [`agent-system-architect`](../agent-system-architect/SKILL.md).\n2. Define building blocks (`CMP-*`), Deployment Topology (`ARCH-DEP-001` translating the delivery model into execution nodes `RES-*` and enclaves `SEC-ENC-*`), and Architectural Decision Records (`ADR-*`) in `specs/architecture/` using `templates/architecture/`, ensuring every `CMP-*` cites `implements-use-cases` (`UC-*`) and `satisfies-requirements` (`FR-*`, `QR-*`, `SEC-REQ-*`, `PRIV-REQ-*`).\n3. Inspect third-party stack choices against `license-policy.yaml` via `verify_licenses` and subprocessors against `privacy-policy.yaml` via `verify_privacy`.\n4. **Technical Security & Privacy Feedback Loop**: If new infrastructure, persistence, LLM, or auth decisions introduce attack vectors or PII flows, return to `agent-threat-modeler` \u2794 `agent-privacy-officer` to add technical mitigations before coding.\n\n### Checkpoint 1 (Inception Design Checkpoint): `agent-auditor` $\\parallel$ `agent-adversary`\n1. Concurrently invoke `agent-auditor` (evaluating YAGNI, architecture bloat, interface contracts) and `agent-adversary` (simulating SPOFs, race conditions, unhandled threat scenarios) in isolated context windows over all Phase 0 deliverables.\n2. Consolidate findings and remediate in authoring agents (max 2 correction rounds), committing and pushing (`git push`) updates to the Draft PR.\n3. **Human Approval Gate**: Mark the Inception Draft PR/MR ready (`gh pr ready` / `glab mr update --ready`) and present the comprehensive Inception model for Human PO & Tech Lead sign-off.\n\n### Step 5: Release Milestone & Topological Wave SDD Plan (`1 UC-* = 1 CHG-*`)\n1. **Open Release Milestone (`Tier 2: release/v1.0.0` or Streamlined `main`)**: Group approved MVP Use Cases (`UC-001`, `UC-002`, ...) and visualize execution plan.\n2. **Decompose into Topological Waves (DAG Parallelism)**:\n - **Wave 0 \u2014 Foundational Core, Executable Presentation Host & CI/CD (`agent-devops`) (Sequential)**: Scaffold `CHG-001` via [`aisdlc-increment`](../aisdlc-increment/SKILL.md) to establish domain core, shared contracts, auth/config, and the runnable presentation host. Invoke [`agent-devops`](../agent-devops/SKILL.md) to clarify the technical CI/CD & packaging strategy (CI Quality Gates, Docker/GHCR, package registry, or PaaS/Cloud) and scaffold `.github/workflows/` and container manifests without modifying `src/`.\n - **Waves 1..N \u2014 Orthogonal End-to-End Vertical Slices (Parallel Multi-Agent)**: Once Wave 0 contracts are merged, execute independent `CHG-*` increments (`1 UC-* = 1 CHG-*`) in parallel across isolated branches/worktrees (`feat/CHG-002`, `feat/CHG-003`, ...).\n3. **Release Consolidation (`agent-devops`)**: Once all MVP increments are integrated (`sdd_integrate`), run `verify` (`npx aisdlc verify all`), generate SBOM, compute release KPIs (`kpi_release`), regenerate canonical reports and dashboard (`report_quality`, `report_dashboard`), verify release/publishing workflows via `agent-devops`, and open the Release PR for final human approval and SemVer tagging (`v1.0.0`). Individual `feat/CHG-*` PRs must compute reports locally without committing global `reports/` files to avoid merge conflicts.\n\n## Non-Negotiable Guardrails\n- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles in the same conversation context window. Always spawn each specialist in a fresh isolated subagent context that reads state strictly from disk.\n- **2-Checkpoint Quality & Adversarial Protocol**: Quality auditing and adversarial testing are concentrated at the completion of Inception design and Pre-PR implementation, avoiding micro-step overhead.\n- **FORBIDDEN Library-Only MVP for Human-Facing Products**: Whenever a product defines human actors (`ACT-*`), no agent may scope the MVP as headless class libraries without an executable presentation host.\n- **FORBIDDEN Greenfield Monolith (`1 UC-* = 1 CHG-*`)**: Never bundle the entire product or multiple `UC-*` into a single SDD change (`CHG-001`). Parallelism is achieved by running **multiple bounded `CHG-*` concurrently** on separate branches/worktrees.\n- Never invoke `sdd_change_new` or write application code in `src/` on a Greenfield project before `ARCH-INTRO-001`, `agent-expert-user` MVP validation, and at least one `UC-*` and `FR-*` exist.\n- All newly drafted specifications must start with `status: draft`.'
19142
19190
  },
19143
19191
  {
19144
19192
  id: "aisdlc-legacy-onboarding",
@@ -19146,7 +19194,7 @@ var LIFECYCLE_SKILL_TEMPLATES = [
19146
19194
  description: "Orchestrate progressive AI-SDLC adoption and Brownfield retro-inception on existing or legacy repositories without breaking production code, reverse-engineering architecture (ARCH-INTRO-*, CMP-*), 2-checkpoint auditor/adversary verification, and establishing baseline quality, security, and license audits before new SDD increments.",
19147
19195
  references: "[`process/02_product_definition.md`](../../process/02_product_definition.md), [`process/05_architecture_arc42_nafv4.md`](../../process/05_architecture_arc42_nafv4.md), [`process/06_spec_driven_development.md`](../../process/06_spec_driven_development.md), [`process/10_quality_management_and_release_gates.md`](../../process/10_quality_management_and_release_gates.md), and [`process/09_agent_protocols.md`](../../process/09_agent_protocols.md).",
19148
19196
  globs: "architecture/**, specs/**, src/**, packages/**",
19149
- body: "## Purpose & Trigger\nUse this skill when onboarding an **existing codebase (Brownfield / Legacy)** that was not built with AI-SDLC. It establishes non-disruptive governance, maps existing code into canonical specifications, inventories debt across all 12 Quality Gates, and creates baseline specifications (`specs/product/`, `specs/architecture/`) before new features or refactorings are introduced.\n\n## Retro-Inception Quality & Adversarial Checkpoint\nAcross Brownfield retro-inception, quality auditing and adversarial stress-testing are concentrated at the completion of retro-inception mapping:\n- **Concurrent Inspection**: Concurrently invoke [`agent-auditor`](../agent-auditor/SKILL.md) (evaluating YAGNI, over-modeling, and debt priorities) and [`agent-adversary`](../agent-adversary/SKILL.md) (uncovering undocumented invariants, hidden failure modes, and security gaps) in clean, isolated context windows.\n- **Non-Invasive Review**: Neither auditor nor adversary modifies deliverables directly; both deliver structured reports citing canonical IDs and SHA-256 digests.\n- **Consolidated Remediation**: Consolidate findings and emit the Workflow Handoff back to authoring agents to resolve blocking defects and apply simplifications (max 2 correction rounds).\n- **Anti-Ping-Pong Guardrail**: Bounded strictly to maximum **1 correction round**. If non-blocking advisories remain, proceed to characterization; if blocking defects persist, escalate to the Human Tech Lead.\n\n## End-to-End Execution Playbook\n\n### Step 1: Branch-Before-Change & Turnkey Repository Scaffolding (Non-Destructive)\n1. **Branch-Before-Change**: Verify the active branch (`git branch --show-current`). If currently on a protected branch (`main`, `master`, `release/*`), create and switch to an onboarding branch (e.g., `chore/aisdlc-onboarding`) **before** modifying or creating any files.\n2. Initialize AI-SDLC configuration without overwriting existing application files using `npx @aisdlc/cli init` (or MCP tool `new`).\n3. Install the Git telemetry hook via `npx aisdlc git hook install` (`pnpm run git:hook:install`).\n4. Invoke [`agent-devops`](../agent-devops/SKILL.md) to audit existing CI/CD workflows and container manifests and integrate `aisdlc verify all` into the pipeline without breaking legacy deployments.\n5. Commit initial AI-SDLC schemas and policies (`.github/`, `schemas/`, `templates/`, `*-policy.yaml`), push (`git push -u origin <branch>`), and open a **Draft PR** (`gh pr create --draft`, with graceful fallback if no remote or CLI auth exists) so subsequent retro-inception and characterization commits are pushed incrementally.\n\n### Step 2: Automated Baseline Audit & Debt Inventory (Read-Only)\nBefore modifying any code or creating SDD changes, run diagnostic verifiers to quantify existing technical, legal, privacy, and security debt:\n1. **License & AST Code Quality Baseline (`agent-auditor`)**: Run MCP tools `verify_licenses` (`npx aisdlc verify licenses`) and `report_quality` (`npx aisdlc report quality`) to identify viral (`GPL`/`AGPL`) or commercial (`BSL`/`SSPL`) dependencies and legacy hotspots exceeding Cyclomatic Complexity ($\\le 10$), Cognitive Complexity ($\\le 15$), or Maintainability Index ($\\ge 50$).\n2. **Shift-Left Security Scan (`agent-adversary`)**: Run MCP tool `verify_security` (`npx aisdlc verify security`) to detect hardcoded secrets (Gate 11) or OWASP SAST vulnerabilities in legacy files.\n3. **Privacy & PII Scan (`agent-privacy-officer`)**: Run MCP tool `verify_privacy` (`npx aisdlc verify privacy`) to detect PII in logs/telemetry or hardcoded real PII in legacy tests/seeds.\n\n### Step 3: Brownfield Retro-Inception (`agent-system-architect` & `agent-product-analyst`)\nInstead of attempting to document 100% of a legacy monolith upfront, apply **bounded retro-inception** focused on the system boundary and the domain areas under active evolution:\n1. **System Vision & Context (`ARCH-INTRO-001`)**: Use [`agent-product-analyst`](../agent-product-analyst/SKILL.md) to document the current system's mission, primary actors (`ACT-*`), and top quality goals (`QR-*`) in `specs/architecture/ARCH-INTRO-001.md`.\n2. **As-Is Component Mapping (`CMP-*` & `ADR-*`)**: Use [`agent-system-architect`](../agent-system-architect/SKILL.md) to map existing core modules/services into `specs/architecture/CMP-*.md` and capture historical architectural constraints (`CON-*`, `ADR-*`).\n3. **Core Use Cases Extraction (`UC-*`, `FR-*`)**: Extract canonical `UC-*` and `FR-*` artifacts in `specs/product/` for the specific bounded context or module that will be modified or extended next, including Gherkin acceptance scenarios reflecting current expected behavior (characterization specs).\n4. **Threat & Privacy Boundary Mapping (`agent-threat-modeler` \u2794 `agent-privacy-officer`)**: Map existing trust zones (`SEC-ENC-*`), active threat vectors (`ACT-THREAT-*`, `ABUSE-*`, `SEC-REQ-*`), and personal data inventories (`DATA-ASSET-*`, `PRIV-ROPA-*`, `PRIV-REQ-*`) on the target module.\n5. **Retro-Inception Checkpoint (`agent-auditor` $\\parallel$ `agent-adversary`)**: Concurrently inspect reverse-engineered artifacts, evaluate fidelity vs. unnecessary modeling overhead, and consolidate fixes.\n\n### Step 4: Characterization Testing & Synchronization\n1. Run MCP tool `sdd_check_fix` (`npx aisdlc check --fix`) to extract `.feature` files and compute canonical SHA-256 digests.\n2. Run `verify_schemas` and `verify_pdac` to confirm the reverse-engineered baseline graph is structurally valid and drift-free.\n3. Run `report_quality` (`npx aisdlc report quality`) and `report_dashboard` (`npx aisdlc report dashboard`) to generate the local baseline quality report and interactive dashboard for inspection (commit global `reports/` only on the onboarding baseline or post-merge on `main`, never on parallel feature PRs).\n4. Push final baseline commits (`git push`) and mark the onboarding Draft PR ready (`gh pr ready`) for human Tech Lead review before merging to `main`.\n\n### Step 5: Transition to Governed SDD Increments (Boy Scout / Strangler Rule)\nOnce the target domain's baseline artifacts (`ARCH-INTRO-*`, `UC-*`, `FR-*`, `CMP-*`) are in place, execute all new features, refactorings, or bugfixes via [`aisdlc-increment`](../aisdlc-increment/SKILL.md).\n\n## Non-Negotiable Guardrails\n- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles in the same conversation context window. Always spawn each specialist in a fresh isolated subagent context that reads state strictly from disk.\n- **2-Checkpoint Quality & Adversarial Protocol**: Concentrated review at the retro-inception boundary and before PR delivery prevents process friction while maintaining rigorous defect interception.\n- **Zero Drive-By Rewrites**: Never mass-refactor untouched legacy modules during onboarding. Apply the Strangler / Boy Scout rule: bring touched functions into compliance with `quality-policy.yaml` incrementally via governed SDD tasks (`TSK-*`).\n- **Characterization First**: Never alter legacy business logic without first capturing its current behavior in an `FR-*` Gherkin specification and a verifiable test suite (`agent-qa-engineer`).\n- **Immediate Secret Remediation**: If Step 2 (`verify_security`) uncovers leaked credentials (exit code 4), halt feature work and remediate/rotate secrets immediately."
19197
+ body: "## Purpose & Trigger\nUse this skill when onboarding an **existing codebase (Brownfield / Legacy)** that was not built with AI-SDLC. It establishes non-disruptive governance, maps existing code into canonical specifications, inventories debt across all 12 Quality Gates, and creates baseline specifications (`specs/product/`, `specs/architecture/`) before new features or refactorings are introduced.\n\n## Retro-Inception Quality & Adversarial Checkpoint\nAcross Brownfield retro-inception, quality auditing and adversarial stress-testing are concentrated at the completion of retro-inception mapping:\n- **Concurrent Inspection**: Concurrently invoke [`agent-auditor`](../agent-auditor/SKILL.md) (evaluating YAGNI, over-modeling, and debt priorities) and [`agent-adversary`](../agent-adversary/SKILL.md) (uncovering undocumented invariants, hidden failure modes, and security gaps) in clean, isolated context windows.\n- **Non-Invasive Review**: Neither auditor nor adversary modifies deliverables directly; both deliver structured reports citing canonical IDs and SHA-256 digests.\n- **Consolidated Remediation**: Consolidate findings and emit the Workflow Handoff back to authoring agents to resolve blocking defects and apply simplifications (max 2 correction rounds).\n- **Anti-Ping-Pong Guardrail**: Bounded strictly to maximum **1 correction round**. If non-blocking advisories remain, proceed to characterization; if blocking defects persist, escalate to the Human Tech Lead.\n\n## End-to-End Execution Playbook\n\n### Step 1: Branch-Before-Change, Pre-Change Draft PR & Turnkey Repository Scaffolding\n1. **Branch-Before-Change & Pre-Change Draft PR/MR**: Verify the active branch (`git branch --show-current`). If currently on a protected branch (`main`, `master`, `release/*`), create and switch to an onboarding branch (e.g., `chore/aisdlc-onboarding`) **before** modifying or creating any files. Whenever a remote repository is configured (`git remote`), check if an open PR/MR exists for the branch (`gh pr view` / `gh pr list --head <branch>` on GitHub; `glab mr view` / `glab mr list --source-branch <branch>` on GitLab); if none exists, create an empty bootstrap commit (`git commit --allow-empty -m \"chore(onboarding): open draft PR\"`), push (`git push -u origin <branch>`), and open a **Draft PR/MR** (`gh pr create --draft` on GitHub; `glab mr create --draft` or `git push -o merge_request.create -o merge_request.draft` on GitLab) before making any changes (if no remote exists, work locally).\n2. Initialize AI-SDLC configuration without overwriting existing application files using `npx @aisdlc/cli init` (or MCP tool `new`).\n3. Install the Git telemetry hook via `npx aisdlc git hook install` (`pnpm run git:hook:install`).\n4. Invoke [`agent-devops`](../agent-devops/SKILL.md) to audit existing CI/CD workflows and container manifests and integrate `aisdlc verify all` into the pipeline without breaking legacy deployments.\n5. Commit initial AI-SDLC schemas and policies (`.github/`, `schemas/`, `templates/`, `*-policy.yaml`) and push (`git push`) to the open Draft PR so subsequent retro-inception and characterization commits are pushed incrementally.\n\n### Step 2: Automated Baseline Audit & Debt Inventory (Read-Only)\nBefore modifying any code or creating SDD changes, run diagnostic verifiers to quantify existing technical, legal, privacy, and security debt:\n1. **License & AST Code Quality Baseline (`agent-auditor`)**: Run MCP tools `verify_licenses` (`npx aisdlc verify licenses`) and `report_quality` (`npx aisdlc report quality`) to identify viral (`GPL`/`AGPL`) or commercial (`BSL`/`SSPL`) dependencies and legacy hotspots exceeding Cyclomatic Complexity ($\\le 10$), Cognitive Complexity ($\\le 15$), or Maintainability Index ($\\ge 50$).\n2. **Shift-Left Security Scan (`agent-adversary`)**: Run MCP tool `verify_security` (`npx aisdlc verify security`) to detect hardcoded secrets (Gate 11) or OWASP SAST vulnerabilities in legacy files.\n3. **Privacy & PII Scan (`agent-privacy-officer`)**: Run MCP tool `verify_privacy` (`npx aisdlc verify privacy`) to detect PII in logs/telemetry or hardcoded real PII in legacy tests/seeds.\n\n### Step 3: Brownfield Retro-Inception (`agent-system-architect` & `agent-product-analyst`)\nInstead of attempting to document 100% of a legacy monolith upfront, apply **bounded retro-inception** focused on the system boundary and the domain areas under active evolution:\n1. **System Vision & Context (`ARCH-INTRO-001`)**: Use [`agent-product-analyst`](../agent-product-analyst/SKILL.md) to document the current system's mission, primary actors (`ACT-*`), and top quality goals (`QR-*`) in `specs/architecture/ARCH-INTRO-001.md`.\n2. **As-Is Component Mapping (`CMP-*` & `ADR-*`)**: Use [`agent-system-architect`](../agent-system-architect/SKILL.md) to map existing core modules/services into `specs/architecture/CMP-*.md` and capture historical architectural constraints (`CON-*`, `ADR-*`).\n3. **Core Use Cases Extraction (`UC-*`, `FR-*`)**: Extract canonical `UC-*` and `FR-*` artifacts in `specs/product/` for the specific bounded context or module that will be modified or extended next, including Gherkin acceptance scenarios reflecting current expected behavior (characterization specs).\n4. **Threat & Privacy Boundary Mapping (`agent-threat-modeler` \u2794 `agent-privacy-officer`)**: Map existing trust zones (`SEC-ENC-*`), active threat vectors (`ACT-THREAT-*`, `ABUSE-*`, `SEC-REQ-*`), and personal data inventories (`DATA-ASSET-*`, `PRIV-ROPA-*`, `PRIV-REQ-*`) on the target module.\n5. **Retro-Inception Checkpoint (`agent-auditor` $\\parallel$ `agent-adversary`)**: Concurrently inspect reverse-engineered artifacts, evaluate fidelity vs. unnecessary modeling overhead, and consolidate fixes.\n\n### Step 4: Characterization Testing & Synchronization\n1. Run MCP tool `sdd_check_fix` (`npx aisdlc check --fix`) to extract `.feature` files and compute canonical SHA-256 digests.\n2. Run `verify_schemas` and `verify_pdac` to confirm the reverse-engineered baseline graph is structurally valid and drift-free.\n3. Run `report_quality` (`npx aisdlc report quality`) and `report_dashboard` (`npx aisdlc report dashboard`) to generate the local baseline quality report and interactive dashboard for inspection (commit global `reports/` only on the onboarding baseline or post-merge on `main`, never on parallel feature PRs).\n4. Push final baseline commits (`git push`) and mark the onboarding Draft PR/MR ready (`gh pr ready` / `glab mr update --ready`) for human Tech Lead review before merging to `main`.\n\n### Step 5: Transition to Governed SDD Increments (Boy Scout / Strangler Rule)\nOnce the target domain's baseline artifacts (`ARCH-INTRO-*`, `UC-*`, `FR-*`, `CMP-*`) are in place, execute all new features, refactorings, or bugfixes via [`aisdlc-increment`](../aisdlc-increment/SKILL.md).\n\n## Non-Negotiable Guardrails\n- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles in the same conversation context window. Always spawn each specialist in a fresh isolated subagent context that reads state strictly from disk.\n- **2-Checkpoint Quality & Adversarial Protocol**: Concentrated review at the retro-inception boundary and before PR delivery prevents process friction while maintaining rigorous defect interception.\n- **Zero Drive-By Rewrites**: Never mass-refactor untouched legacy modules during onboarding. Apply the Strangler / Boy Scout rule: bring touched functions into compliance with `quality-policy.yaml` incrementally via governed SDD tasks (`TSK-*`).\n- **Characterization First**: Never alter legacy business logic without first capturing its current behavior in an `FR-*` Gherkin specification and a verifiable test suite (`agent-qa-engineer`).\n- **Immediate Secret Remediation**: If Step 2 (`verify_security`) uncovers leaked credentials (exit code 4), halt feature work and remediate/rotate secrets immediately."
19150
19198
  },
19151
19199
  {
19152
19200
  id: "aisdlc-increment",
@@ -19154,7 +19202,7 @@ var LIFECYCLE_SKILL_TEMPLATES = [
19154
19202
  description: "Orchestrate the complete Spec-Driven Development (SDD) lifecycle for bounded feature increments, enhancements, and bugfixes (CHG-* / TSK-*), from upstream requirement derivation and streamlined Git branching through Red-Green-Refactor TDD, 2-checkpoint transversal auditor/adversary verification, all 12 Quality Gates, and canonical baseline integration.",
19155
19203
  references: "[`process/06_spec_driven_development.md`](../../process/06_spec_driven_development.md), [`process/08_citation_contract_and_drift.md`](../../process/08_citation_contract_and_drift.md), [`process/10_quality_management_and_release_gates.md`](../../process/10_quality_management_and_release_gates.md), [`process/11_git_branching_and_lifecycle.md`](../../process/11_git_branching_and_lifecycle.md), and [`process/09_agent_protocols.md`](../../process/09_agent_protocols.md).",
19156
19204
  globs: "specs/changes/**, src/**, packages/**, tests/**",
19157
- body: '## Purpose & Trigger\nUse this skill for **every evolutionary increment (new feature, enhancement, refactoring, or bugfix)** on a project that already has an AI-SDLC baseline. It enforces strict 360\xB0 traceability from upstream ProductShape (`UC-*`, `FR-*`) through SDD (`CHG-*`, `HOF-*`, `TSK-*`), TDD implementation, the 12 Quality Gates, and baseline promotion under the **streamlined 2-checkpoint architecture**.\n\n## End-to-End Execution Playbook\n\n### Step 0: Branch-Before-Change, Friction Profile Selection & Scope Triage (`patch | standard | critical`)\n1. **Branch-Before-Change**: Verify the active branch (`git branch --show-current`). If currently on a protected branch (`main`, `master`, `release/*`), create and switch to a dedicated working branch (`feat/<CHG-ID>-<slug>` or `fix/<CHG-ID>-<slug>`) **before** modifying or creating any files.\n2. Before editing any files or running `sdd_change_new`, inspect if the user explicitly specified the friction profile (`patch`, `standard`, or `critical`). If not, analyze the requested scope and ask the user via interactive question (`ask_question`) with the recommended option first (`(Recommended)`):\n - **`patch`**: low-risk isolated bugfixes ($\\le 2$ source files, zero Anti-Bypass paths), typos, or linter fixes on `patch/*` or `fix/*` branches (`npx aisdlc change new "<Title>" --id <chg-id> --profile patch` generates `spec.md` with `profile: patch` and `verification` block only, omitting `design.md`, `tasks.md`, and `handoff.yaml`; fast-track directly to Step 3 -> Step 4 -> Step 5 -> Step 6).\n - **`standard`**: functional increments, new/updated `UC-*` or `FR-*`, or contract changes (`proposal.md`, `spec.md`, `design.md`, `tasks.md`, and `handoff.yaml`).\n - **`critical`**: changes touching security enclaves (`SEC-ENC-*`), sensitive PII (`SPECIAL_CATEGORY` / `DPIA-*`), schemas, or migrations (full `standard` artifacts + `ADR-*` + mandatory STRIDE modeling and dual human approval).\n2. **Anti-Bypass Rule**: Never recommend or allow `patch` when the change touches protected paths (`schemas/`, `specs/security/`, `specs/privacy/`, `packages/security/`, `SEC-ENC-*`, `09_decisions/`, `migrations/`, or `*-policy.yaml`).\n\n### Step 1: Upstream Product, Security & Privacy Delta (`agent-product-analyst`, `agent-threat-modeler` & `agent-privacy-officer`)\n1. Inspect active changes via MCP tool `get_active_handoff` and verify whether the target Use Case (`UC-*`) or Requirement (`FR-*`) already exists in `specs/product/`.\n2. If the increment introduces new behavior or modifies business rules:\n - Use [`agent-product-analyst`](../agent-product-analyst/SKILL.md) to create or update the `UC-*`, `BR-*`, and `FR-*` (with `@nominal`, `@boundary`, `@invalid` Gherkin scenarios).\n - Run MCP tool `verify_duplicates` (`npx aisdlc verify duplicates`) to block lexical or functional collisions early.\n - Use [`agent-threat-modeler`](../agent-threat-modeler/SKILL.md) to model any new `ABUSE-*` and `SEC-REQ-*` mitigations.\n - Hand off to [`agent-privacy-officer`](../agent-privacy-officer/SKILL.md) to model any personal data assets (`DATA-ASSET-*`), GDPR Art. 30 processing activities (`PRIV-ROPA-*`), and privacy requirements (`PRIV-REQ-*`).\n3. Run `sdd_check_fix` (`npx aisdlc check --fix`) to sync Gherkin `.feature` files and validate schemas.\n\n### Step 2: SDD Change Scaffolding & Architectural Design (`agent-system-architect`)\n1. Scaffold the bounded change package and its cryptographic `handoff.yaml` sidecar (`HOF-*`) targeting **a single Use Case (`1 UC-* = 1 CHG-*`)** using MCP tool `sdd_change_new` (or CLI `npx aisdlc change new "<Title>" --from <UC-ID> --profile <patch|standard|critical>`).\n2. Use [`agent-system-architect`](../agent-system-architect/SKILL.md) to complete `specs/changes/active/<chg-id>/design.md` and `specs/architecture/CMP-*.md`:\n - Structure `CMP-*` and `design.md` around **Modular & Hexagonal Architecture (Ports & Adapters)** (Domain/Application Core + Inbound/Outbound Ports) and define **Contract-First** shared interfaces/DTOs/schemas when spanning Frontend and Backend.\n - Map 100% of `handoff.yaml` requirements and components to atomic tasks (`TSK-*`) in `tasks.md` with explicit `autonomy-mode` (`AUTONOMOUS`, `HUMAN_REVIEW_PLAN`, `HIGH_RISK_MANUAL`, `AMBIGUOUS`).\n3. Run `verify_governance` and `verify_friction` to validate task governance, 100% design/handoff scope coverage, and anti-monolith limits (`maxUseCasesPerChange = 1`).\n4. **Open Draft PR from Spec/Scaffolding (Option A)**: Commit the initial SDD scaffolding and specification/design artifacts on the working branch, push to remote (`git push -u origin <branch>`), and open a **Draft PR** (`gh pr create --draft --title "<type>(<CHG-ID>): <Title>" --body "..."`; graceful fallback to local-only commits if no remote or CLI auth exists). For `patch` profile increments, open the Draft PR right after scaffolding `spec.md`.\n\n### Checkpoint 1: Specification & Design Checkpoint (`agent-auditor` $\\parallel$ `agent-adversary`)\n1. Concurrently invoke `agent-auditor` (evaluating YAGNI, interface bloat, and task completeness) and `agent-adversary` (probing contradictions, race conditions, and architecture SPOFs) in clean, isolated context windows over the combined upstream deliverables.\n2. Consolidate findings and remediate any blocking defects (max 2 correction rounds), committing and pushing updates (`git push`) to the open Draft PR.\n3. **Human Approval Gate 1**: Present the specification and architectural design (reviewable directly in the Draft PR) for Human Tech Lead / PO sign-off before proceeding to code.\n\n### Step 3: Streamlined Git Branch Navigation & Multi-Agent Parallelism\n1. Confirm you are on the working branch via `npx aisdlc git checkout <TSK-ID>` (`pnpm run git:checkout <TSK-ID>`).\n - **Default Streamlined Mode**: Ensures the agent is on `feat/<CHG-ID>-<slug>` (already created in Step 0).\n - Granular task traceability is maintained via commit trailers (`Task-ID: TSK-*`, `Parent-Ref: CHG-*`) and commit scopes (`feat(TSK-001): ...`), enabling per-task rework KPIs without branch explosion.\n2. **Parallel Agent Execution Rules (`--parallel`)**:\n - When concurrent multi-agent implementation is configured (e.g. Backend adapter $\\parallel$ Frontend UI), `aisdlc git checkout <TSK-ID> --parallel` creates isolated worktrees (`task/<PARENT-ID>/<TSK-ID>-<slug>`).\n\n### Step 4: Red Phase \u2014 Failing Test Suites (`agent-qa-engineer`)\n1. Delegate to or adopt [`agent-qa-engineer`](../agent-qa-engineer/SKILL.md).\n2. Run `npx aisdlc gherkin extract` (`sdd_check_fix`) to deterministically extract `.feature` files from Markdown specifications, and run `npx aisdlc gherkin scaffold <feature-file> --lang <lang> --fallback` to scaffold RED step definitions in `tests/steps/` (never hand-author `.feature` or step skeletons).\n3. Author FAILING (red) assertions inside the scaffolded step definitions, plus integration/contract tests and mandatory E2E/UI tests (evaluating Happy Path, Sad Path, and Boundary Values for every interactive UI element, plus `UC-*` alternative/exception flows) in `tests/`.\n4. Commit failing test suites with trailer `Task-ID: TSK-YYY` and push (`git push`) to the Draft PR (CI workflows skip heavy checks while the PR is in `draft` state).\n5. Run `npx aisdlc verify gherkin` and `verify_testing` (`npx aisdlc verify testing`) to confirm deterministic Gherkin/step sync and requirement test coverage before writing production code.\n\n### Step 5: Green & Refactor Phase \u2014 Surgical Implementation (`agent-developer` / `agent-devops`)\n1. Delegate application tasks (`src/`, `tests/`) to [`agent-developer`](../agent-developer/SKILL.md). For tasks (`TSK-*`) targeting CI/CD workflows (`.github/workflows/`), `Dockerfile*`, IaC manifests, or support scripts (`scripts/`), delegate to [`agent-devops`](../agent-devops/SKILL.md) under its strict non-invasion guardrail on `src/`.\n2. Execute the **Mandatory 4-Step Implementation Order**:\n - (1) Modular & Hexagonal Architecture (Ports & Adapters) boundaries, (2) Inter-module interfaces/ports first, (3) Concrete component implementation (zero fake-wiring; all 4 UI states `Loading`, `Empty`, `Error`, `Nominal`), (4) Exhaustive per-function unit tests in `tests/unit/` (Happy Path, Sad Path, Boundary, Null/Empty).\n3. Commit implementations with trailer `Task-ID: TSK-YYY` and push (`git push`) incrementally to the Draft PR.\n4. Verify any new dependency against `license-policy.yaml` via `verify_licenses` and PII handling against `privacy-policy.yaml` via `verify_privacy`.\n5. Run `sdd_check_fix` (`npx aisdlc check --fix`) and `verify_quality` (`npx aisdlc verify quality`) until Cyclomatic Complexity $\\le 10$, Cognitive $\\le 15$, Maintainability $\\ge 50$, and Function Length $\\le 40$ lines pass with zero violations.\n6. Run `verify` (`npx aisdlc verify all`) confirming all **12 Quality Gates** pass green.\n\n### Checkpoint 2: Implementation & Pre-PR Checkpoint (`agent-auditor` $\\parallel$ `agent-adversary`)\n1. **Functional Validation (`agent-expert-user`)**: Validate live runtime behavior against `UC-*` and `FR-*` criteria (including `0` browser `console.error`/`pageerror` on UI changes).\n2. Concurrently invoke `agent-auditor` (verifying Clean Code, SOLID, DRY, AST thresholds, and eliminating unnecessary abstractions) and `agent-adversary` (performing conceptual test mutation to verify QA tests catch defects, and attacking boundary inputs with concrete PoC breaks).\n3. Consolidate findings and remediate in `agent-developer` (max 2 correction rounds), committing and pushing (`git push`) fixes to the Draft PR.\n4. Run `npx aisdlc verify all` to confirm final green status, then run `report_quality` (`npx aisdlc report quality`) and `report_dashboard` (`npx aisdlc report dashboard`) to compute local reports and the interactive dashboard for review (**do NOT stage or commit global `reports/*` files on `feat/CHG-*` branches** to prevent merge conflicts across parallel PRs).\n\n### Step 6: Human PR Sign-Off, Baseline Integration & Release Closure\n1. **Ready for Review & Feature Merge (`feat/CHG-*` \u2794 `main` or `release/vX.Y.Z`)**:\n - Update the Draft PR body with the Plan Execution Matrix (`[X]` vs `[O]`), KPI summary (`kpi_pr` including per-task rework metrics), and local verification/report summary (`reports/QUALITY_REPORT.md`, `reports/TRACEABILITY_MATRIX.md`, `reports/dashboard.html` inspected locally, without committing global `reports/*` to the feature PR), then run `gh pr ready` to mark the PR **Ready for Review** (triggering full CI verification) and present it to the human Tech Lead for review and approval (never auto-approve or auto-merge).\n2. **Canonical Baseline Promotion**: Once tasks in `tasks.md` are marked `COMPLETED` and approved, promote the change into the canonical baseline via MCP tool `sdd_integrate` (`npx aisdlc sdd integrate --auto`), which synchronizes the normative text and BDD Gherkin scenarios into `FR-*` / `UC-*` / `SEC-REQ-*` / `PRIV-REQ-*`, bumps minor SemVer when updating active specs, resyncs PDaC SHA-256 digests, promotes `FR-*` to `active`, links `CMP-*`, and archives the change under `specs/changes/completed/` (or `npx aisdlc sdd integrate --all` to consolidate all completed changes).\n3. **Semantic Versioning Promotion**:\n - **Profile-Driven SemVer Mapping**: Bump the version of the software under development according to the increment\'s friction profile:\n - `patch` -> bump **Patch** digit (`x.y.Z`)\n - `standard` -> bump **Minor** digit (`x.Y.0`)\n - `critical` -> bump **Major** digit (`X.0.0`)\n - **Highest-Precedence Consolidation (Multiple Pending Increments)**: When multiple pending increments exist in the active branch or release batch being integrated, apply **ONLY a single version bump corresponding to the highest rank** (`critical` / Major > `standard` / Minor > `patch` / Patch), ignoring unrelated historical directories.\n - Tag the merge with the computed SemVer bump (`patch`, `minor`, `major`) and refresh the interactive dashboard (`report_dashboard`).\n\n## Non-Negotiable Guardrails\n- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles (e.g., `agent-qa-engineer` and `agent-developer`, or `agent-developer` and `agent-adversary`) in the same conversation context window. In subagent-capable IDEs (Antigravity `invoke_subagent`, Claude Code `Task` / `.claude/agents/`, GitHub Copilot `@agent-*`), always spawn each specialist in a fresh isolated subagent context that reads state strictly from disk (`specs/`, `handoff.yaml`, `get_active_handoff`). In chat-based IDEs (Cursor, Windsurf, Aider), persist all artifacts to disk, emit the Workflow Handoff block, and instruct the user to open a **New Chat** (or `/clear`) before running the next specialist.\n- **2-Checkpoint Quality & Adversarial Protocol**: Enforce transversal quality and red-team checks exclusively at **Checkpoint 1 (Specification & Design)** and **Checkpoint 2 (Implementation & Pre-PR)**. Enforce the **Anti-Ping-Pong Guardrail**: maximum 2 correction rounds per checkpoint; if unresolved blocking defects persist, escalate to the Human Tech Lead.\n- **Single-Use-Case Scope (`1 UC-* = 1 CHG-*`)**: Each SDD change (`CHG-*`) must deliver at most 1 Use Case (`UC-*`). Bundling multiple `UC-*` into one `handoff.yaml` is blocked by `verify_governance` (`Greenfield monolith detected`). Scale throughput via parallel `CHG-*` branches/worktrees, not monolithic changes.\n- **100% Design & Handoff Coverage in `tasks.md`**: Every `CMP-*`, `FR-*`, `SEC-REQ-*`, and `PRIV-REQ-*` declared in `design.md` and `handoff.yaml` must be explicitly assigned to at least one `TSK-*` in `tasks.md`.'
19205
+ body: '## Purpose & Trigger\nUse this skill for **every evolutionary increment (new feature, enhancement, refactoring, or bugfix)** on a project that already has an AI-SDLC baseline. It enforces strict 360\xB0 traceability from upstream ProductShape (`UC-*`, `FR-*`) through SDD (`CHG-*`, `HOF-*`, `TSK-*`), TDD implementation, the 12 Quality Gates, and baseline promotion under the **streamlined 2-checkpoint architecture**.\n\n## End-to-End Execution Playbook\n\n### Step 0: Branch-Before-Change, Pre-Change Draft PR & Scope Triage (`patch | standard | critical`)\n1. **Branch-Before-Change & Pre-Change Draft PR/MR**: Verify the active branch (`git branch --show-current`). If currently on a protected branch (`main`, `master`, `release/*`), create and switch to a dedicated working branch (`feat/<CHG-ID>-<slug>` or `fix/<CHG-ID>-<slug>`) **before** modifying or creating any files. Whenever a remote repository is configured (`git remote`), check if an open PR/MR already exists for the branch (`gh pr view` / `gh pr list --head <branch>` on GitHub; `glab mr view` / `glab mr list --source-branch <branch>` on GitLab); if none exists, create an empty bootstrap commit (`git commit --allow-empty -m "chore(<CHG-ID>): open draft PR"`), push (`git push -u origin <branch>`), and open a **Draft PR/MR** (`gh pr create --draft` on GitHub; `glab mr create --draft` or `git push -o merge_request.create -o merge_request.draft` on GitLab) before making any changes (if no remote exists, work locally).\n2. Before editing any files or running `sdd_change_new`, inspect if the user explicitly specified the friction profile (`patch`, `standard`, or `critical`). If not, analyze the requested scope and ask the user via interactive question (`ask_question`) with the recommended option first (`(Recommended)`):\n - **`patch`**: low-risk isolated bugfixes ($\\le 2$ source files, zero Anti-Bypass paths), typos, or linter fixes on `patch/*` or `fix/*` branches (`npx aisdlc change new "<Title>" --id <chg-id> --profile patch` generates `spec.md` with `profile: patch` and `verification` block only, omitting `design.md`, `tasks.md`, and `handoff.yaml`; fast-track directly to Step 3 -> Step 4 -> Step 5 -> Step 6).\n - **`standard`**: functional increments, new/updated `UC-*` or `FR-*`, or contract changes (`proposal.md`, `spec.md`, `design.md`, `tasks.md`, and `handoff.yaml`).\n - **`critical`**: changes touching security enclaves (`SEC-ENC-*`), sensitive PII (`SPECIAL_CATEGORY` / `DPIA-*`), schemas, or migrations (full `standard` artifacts + `ADR-*` + mandatory STRIDE modeling and dual human approval).\n2. **Anti-Bypass Rule**: Never recommend or allow `patch` when the change touches protected paths (`schemas/`, `specs/security/`, `specs/privacy/`, `packages/security/`, `SEC-ENC-*`, `09_decisions/`, `migrations/`, or `*-policy.yaml`).\n\n### Step 1: Upstream Product, Security & Privacy Delta (`agent-product-analyst`, `agent-threat-modeler` & `agent-privacy-officer`)\n1. Inspect active changes via MCP tool `get_active_handoff` and verify whether the target Use Case (`UC-*`) or Requirement (`FR-*`) already exists in `specs/product/`.\n2. If the increment introduces new behavior or modifies business rules:\n - Use [`agent-product-analyst`](../agent-product-analyst/SKILL.md) to create or update the `UC-*`, `BR-*`, and `FR-*` (with `@nominal`, `@boundary`, `@invalid` Gherkin scenarios).\n - Run MCP tool `verify_duplicates` (`npx aisdlc verify duplicates`) to block lexical or functional collisions early.\n - Use [`agent-threat-modeler`](../agent-threat-modeler/SKILL.md) to model any new `ABUSE-*` and `SEC-REQ-*` mitigations.\n - Hand off to [`agent-privacy-officer`](../agent-privacy-officer/SKILL.md) to model any personal data assets (`DATA-ASSET-*`), GDPR Art. 30 processing activities (`PRIV-ROPA-*`), and privacy requirements (`PRIV-REQ-*`).\n3. Run `sdd_check_fix` (`npx aisdlc check --fix`) to sync Gherkin `.feature` files and validate schemas.\n\n### Step 2: SDD Change Scaffolding & Architectural Design (`agent-system-architect`)\n1. Scaffold the bounded change package and its cryptographic `handoff.yaml` sidecar (`HOF-*`) targeting **a single Use Case (`1 UC-* = 1 CHG-*`)** using MCP tool `sdd_change_new` (or CLI `npx aisdlc change new "<Title>" --from <UC-ID> --profile <patch|standard|critical>`).\n2. Use [`agent-system-architect`](../agent-system-architect/SKILL.md) to complete `specs/changes/active/<chg-id>/design.md` and `specs/architecture/CMP-*.md`:\n - Structure `CMP-*` and `design.md` around **Modular & Hexagonal Architecture (Ports & Adapters)** (Domain/Application Core + Inbound/Outbound Ports) and define **Contract-First** shared interfaces/DTOs/schemas when spanning Frontend and Backend.\n - Map 100% of `handoff.yaml` requirements and components to atomic tasks (`TSK-*`) in `tasks.md` with explicit `autonomy-mode` (`AUTONOMOUS`, `HUMAN_REVIEW_PLAN`, `HIGH_RISK_MANUAL`, `AMBIGUOUS`).\n3. Run `verify_governance` and `verify_friction` to validate task governance, 100% design/handoff scope coverage, and anti-monolith limits (`maxUseCasesPerChange = 1`).\n4. Commit the SDD scaffolding and specification/design artifacts on the working branch and push (`git push`) to the open Draft PR.\n\n### Checkpoint 1: Specification & Design Checkpoint (`agent-auditor` $\\parallel$ `agent-adversary`)\n1. Concurrently invoke `agent-auditor` (evaluating YAGNI, interface bloat, and task completeness) and `agent-adversary` (probing contradictions, race conditions, and architecture SPOFs) in clean, isolated context windows over the combined upstream deliverables.\n2. Consolidate findings and remediate any blocking defects (max 2 correction rounds), committing and pushing updates (`git push`) to the open Draft PR.\n3. **Human Approval Gate 1**: Present the specification and architectural design (reviewable directly in the Draft PR) for Human Tech Lead / PO sign-off before proceeding to code.\n\n### Step 3: Streamlined Git Branch Navigation & Multi-Agent Parallelism\n1. Confirm you are on the working branch via `npx aisdlc git checkout <TSK-ID>` (`pnpm run git:checkout <TSK-ID>`).\n - **Default Streamlined Mode**: Ensures the agent is on `feat/<CHG-ID>-<slug>` (already created in Step 0).\n - Granular task traceability is maintained via commit trailers (`Task-ID: TSK-*`, `Parent-Ref: CHG-*`) and commit scopes (`feat(TSK-001): ...`), enabling per-task rework KPIs without branch explosion.\n2. **Parallel Agent Execution Rules (`--parallel`)**:\n - When concurrent multi-agent implementation is configured (e.g. Backend adapter $\\parallel$ Frontend UI), `aisdlc git checkout <TSK-ID> --parallel` creates isolated worktrees (`task/<PARENT-ID>/<TSK-ID>-<slug>`).\n\n### Step 4: Red Phase \u2014 Failing Test Suites (`agent-qa-engineer`)\n1. Delegate to or adopt [`agent-qa-engineer`](../agent-qa-engineer/SKILL.md).\n2. Run `npx aisdlc gherkin extract` (`sdd_check_fix`) to deterministically extract `.feature` files from Markdown specifications, and run `npx aisdlc gherkin scaffold <feature-file> --lang <lang> --fallback` to scaffold RED step definitions in `tests/steps/` (never hand-author `.feature` or step skeletons).\n3. Author FAILING (red) assertions inside the scaffolded step definitions, plus integration/contract tests and mandatory E2E/UI tests (evaluating Happy Path, Sad Path, and Boundary Values for every interactive UI element, plus `UC-*` alternative/exception flows) in `tests/`.\n4. Commit failing test suites with trailer `Task-ID: TSK-YYY` and push (`git push`) to the Draft PR (CI workflows skip heavy checks while the PR is in `draft` state).\n5. Run `npx aisdlc verify gherkin` and `verify_testing` (`npx aisdlc verify testing`) to confirm deterministic Gherkin/step sync and requirement test coverage before writing production code.\n\n### Step 5: Green & Refactor Phase \u2014 Surgical Implementation (`agent-developer` / `agent-devops`)\n1. Delegate application tasks (`src/`, `tests/`) to [`agent-developer`](../agent-developer/SKILL.md). For tasks (`TSK-*`) targeting CI/CD workflows (`.github/workflows/`), `Dockerfile*`, IaC manifests, or support scripts (`scripts/`), delegate to [`agent-devops`](../agent-devops/SKILL.md) under its strict non-invasion guardrail on `src/`.\n2. Execute the **Mandatory 4-Step Implementation Order**:\n - (1) Modular & Hexagonal Architecture (Ports & Adapters) boundaries, (2) Inter-module interfaces/ports first, (3) Concrete component implementation (zero fake-wiring; all 4 UI states `Loading`, `Empty`, `Error`, `Nominal`), (4) Exhaustive per-function unit tests in `tests/unit/` (Happy Path, Sad Path, Boundary, Null/Empty).\n3. Commit implementations with trailer `Task-ID: TSK-YYY` and push (`git push`) incrementally to the Draft PR.\n4. Verify any new dependency against `license-policy.yaml` via `verify_licenses` and PII handling against `privacy-policy.yaml` via `verify_privacy`.\n5. Run `sdd_check_fix` (`npx aisdlc check --fix`) and `verify_quality` (`npx aisdlc verify quality`) until Cyclomatic Complexity $\\le 10$, Cognitive $\\le 15$, Maintainability $\\ge 50$, and Function Length $\\le 40$ lines pass with zero violations.\n6. Run `verify` (`npx aisdlc verify all`) confirming all **12 Quality Gates** pass green.\n\n### Checkpoint 2: Implementation & Pre-PR Checkpoint (`agent-auditor` $\\parallel$ `agent-adversary`)\n1. **Functional Validation (`agent-expert-user`)**: Validate live runtime behavior against `UC-*` and `FR-*` criteria (including `0` browser `console.error`/`pageerror` on UI changes).\n2. Concurrently invoke `agent-auditor` (verifying Clean Code, SOLID, DRY, AST thresholds, and eliminating unnecessary abstractions) and `agent-adversary` (performing conceptual test mutation to verify QA tests catch defects, and attacking boundary inputs with concrete PoC breaks).\n3. Consolidate findings and remediate in `agent-developer` (max 2 correction rounds), committing and pushing (`git push`) fixes to the Draft PR.\n4. Run `npx aisdlc verify all` to confirm final green status, then run `report_quality` (`npx aisdlc report quality`) and `report_dashboard` (`npx aisdlc report dashboard`) to compute local reports and the interactive dashboard for review (**do NOT stage or commit global `reports/*` files on `feat/CHG-*` branches** to prevent merge conflicts across parallel PRs).\n\n### Step 6: Human PR Sign-Off, Baseline Integration & Release Closure\n1. **Ready for Review & Feature Merge (`feat/CHG-*` \u2794 `main` or `release/vX.Y.Z`)**:\n - Update the Draft PR body with the Plan Execution Matrix (`[X]` vs `[O]`), KPI summary (`kpi_pr` including per-task rework metrics), and local verification/report summary (`reports/QUALITY_REPORT.md`, `reports/TRACEABILITY_MATRIX.md`, `reports/dashboard.html` inspected locally, without committing global `reports/*` to the feature PR), then run `gh pr ready` (GitHub) or `glab mr update --ready` (GitLab) to mark the PR/MR **Ready for Review** (triggering full CI verification) and present it to the human Tech Lead for review and approval (never auto-approve or auto-merge).\n2. **Canonical Baseline Promotion**: Once tasks in `tasks.md` are marked `COMPLETED` and approved, promote the change into the canonical baseline via MCP tool `sdd_integrate` (`npx aisdlc sdd integrate --auto`), which synchronizes the normative text and BDD Gherkin scenarios into `FR-*` / `UC-*` / `SEC-REQ-*` / `PRIV-REQ-*`, bumps minor SemVer when updating active specs, resyncs PDaC SHA-256 digests, promotes `FR-*` to `active`, links `CMP-*`, and archives the change under `specs/changes/completed/` (or `npx aisdlc sdd integrate --all` to consolidate all completed changes).\n3. **Semantic Versioning Promotion**:\n - **Profile-Driven SemVer Mapping**: Bump the version of the software under development according to the increment\'s friction profile:\n - `patch` -> bump **Patch** digit (`x.y.Z`)\n - `standard` -> bump **Minor** digit (`x.Y.0`)\n - `critical` -> bump **Major** digit (`X.0.0`)\n - **Highest-Precedence Consolidation (Multiple Pending Increments)**: When multiple pending increments exist in the active branch or release batch being integrated, apply **ONLY a single version bump corresponding to the highest rank** (`critical` / Major > `standard` / Minor > `patch` / Patch), ignoring unrelated historical directories.\n - Tag the merge with the computed SemVer bump (`patch`, `minor`, `major`) and refresh the interactive dashboard (`report_dashboard`).\n\n## Non-Negotiable Guardrails\n- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles (e.g., `agent-qa-engineer` and `agent-developer`, or `agent-developer` and `agent-adversary`) in the same conversation context window. In subagent-capable IDEs (Antigravity `invoke_subagent`, Claude Code `Task` / `.claude/agents/`, GitHub Copilot `@agent-*`), always spawn each specialist in a fresh isolated subagent context that reads state strictly from disk (`specs/`, `handoff.yaml`, `get_active_handoff`). In chat-based IDEs (Cursor, Windsurf, Aider), persist all artifacts to disk, emit the Workflow Handoff block, and instruct the user to open a **New Chat** (or `/clear`) before running the next specialist.\n- **2-Checkpoint Quality & Adversarial Protocol**: Enforce transversal quality and red-team checks exclusively at **Checkpoint 1 (Specification & Design)** and **Checkpoint 2 (Implementation & Pre-PR)**. Enforce the **Anti-Ping-Pong Guardrail**: maximum 2 correction rounds per checkpoint; if unresolved blocking defects persist, escalate to the Human Tech Lead.\n- **Single-Use-Case Scope (`1 UC-* = 1 CHG-*`)**: Each SDD change (`CHG-*`) must deliver at most 1 Use Case (`UC-*`). Bundling multiple `UC-*` into one `handoff.yaml` is blocked by `verify_governance` (`Greenfield monolith detected`). Scale throughput via parallel `CHG-*` branches/worktrees, not monolithic changes.\n- **100% Design & Handoff Coverage in `tasks.md`**: Every `CMP-*`, `FR-*`, `SEC-REQ-*`, and `PRIV-REQ-*` declared in `design.md` and `handoff.yaml` must be explicitly assigned to at least one `TSK-*` in `tasks.md`.'
19158
19206
  }
19159
19207
  ];
19160
19208
  function renderAntigravitySkillFile(skill) {
@@ -20547,7 +20595,7 @@ before_script:\r
20547
20595
  quality-gates:\r
20548
20596
  stage: validate\r
20549
20597
  rules:\r
20550
- - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'\r
20598
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TITLE !~ /^(Draft:|WIP:)/'\r
20551
20599
  - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'\r
20552
20600
  - if: '$CI_COMMIT_BRANCH =~ /^release\\/.*/'\r
20553
20601
  script:\r
@@ -20559,7 +20607,7 @@ quality-gates:\r
20559
20607
  test-and-verify:\r
20560
20608
  stage: test\r
20561
20609
  rules:\r
20562
- - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'\r
20610
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TITLE !~ /^(Draft:|WIP:)/'\r
20563
20611
  - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'\r
20564
20612
  - if: '$CI_COMMIT_BRANCH =~ /^release\\/.*/'\r
20565
20613
  script:\r
@@ -22434,6 +22482,7 @@ function collectArchitectureTemplateFiles(archGranularity) {
22434
22482
  }
22435
22483
  function collectStarterFiles(ciProvider, agentFiles = [], archGranularity = "minimal", stacks = []) {
22436
22484
  const files = [
22485
+ { relPath: AISDLC_MANIFEST_FILENAME, content: JSON.stringify({ version: getAisdlcVersion() }, null, 2) + "\n" },
22437
22486
  ...collectPolicyAndSchemaFiles(),
22438
22487
  ...getCodingRulesFilesForStacks(stacks),
22439
22488
  ...getCiWorkflowFiles(ciProvider),
@@ -23929,6 +23978,62 @@ var SecurityToolsHealthCheck = class {
23929
23978
  }
23930
23979
  }
23931
23980
  };
23981
+ var CATEGORY_TITLE = "AI-SDLC Repository Version (.aisdlc.json)";
23982
+ function makeFinding(id, status, message, details, remediation) {
23983
+ return { id, category: "aisdlc_version", status, message, remediation, details };
23984
+ }
23985
+ function compareManifestVersion(repoVersion, installedVersion) {
23986
+ if (repoVersion === installedVersion) {
23987
+ return makeFinding(
23988
+ "PASS_AISDLC_VERSION_MATCH",
23989
+ "pass",
23990
+ `Repository AI-SDLC version (${repoVersion}) matches installed CLI (${installedVersion}).`,
23991
+ { repoVersion, installedVersion }
23992
+ );
23993
+ }
23994
+ return makeFinding(
23995
+ "WARN_AISDLC_VERSION_MISMATCH",
23996
+ "warn",
23997
+ `Repository AI-SDLC version (${repoVersion}) differs from installed CLI (${installedVersion}).`,
23998
+ { repoVersion, installedVersion },
23999
+ `Run 'aisdlc migrate' to align repository templates/policies with v${installedVersion}, or run with @aisdlc/cli@${repoVersion}.`
24000
+ );
24001
+ }
24002
+ function evaluateVersionFinding(rootDir, installedVersion) {
24003
+ const manifestPath = path14__namespace.join(rootDir, AISDLC_MANIFEST_FILENAME);
24004
+ if (!fs12__namespace.existsSync(manifestPath)) {
24005
+ return makeFinding(
24006
+ "WARN_AISDLC_MANIFEST_MISSING",
24007
+ "warn",
24008
+ `Repository manifest '${AISDLC_MANIFEST_FILENAME}' not found (installed CLI: v${installedVersion}).`,
24009
+ { installedVersion },
24010
+ `Run 'aisdlc migrate' or 'aisdlc init' to record the repository's AI-SDLC version in '${AISDLC_MANIFEST_FILENAME}'.`
24011
+ );
24012
+ }
24013
+ const manifest = readAisdlcManifest(rootDir);
24014
+ if (!manifest) {
24015
+ return makeFinding(
24016
+ "WARN_AISDLC_MANIFEST_INVALID",
24017
+ "warn",
24018
+ `Repository manifest '${AISDLC_MANIFEST_FILENAME}' is missing a valid 'version' field (installed CLI: v${installedVersion}).`,
24019
+ { installedVersion },
24020
+ `Run 'aisdlc migrate' to repair '${AISDLC_MANIFEST_FILENAME}'.`
24021
+ );
24022
+ }
24023
+ return compareManifestVersion(manifest.version, installedVersion);
24024
+ }
24025
+ var AisdlcVersionCheck = class {
24026
+ async inspect(options) {
24027
+ const rootDir = options.rootDir || process.cwd();
24028
+ const finding = evaluateVersionFinding(rootDir, getAisdlcVersion());
24029
+ return {
24030
+ category: "aisdlc_version",
24031
+ title: CATEGORY_TITLE,
24032
+ status: finding.status,
24033
+ findings: [finding]
24034
+ };
24035
+ }
24036
+ };
23932
24037
 
23933
24038
  // src/doctor/reporter.ts
23934
24039
  function formatFinding(f) {
@@ -23986,6 +24091,7 @@ var DoctorOrchestrator = class {
23986
24091
  toolchainCheck = new ToolchainHealthCheck();
23987
24092
  signatureCheck = new SignatureReadinessCheck();
23988
24093
  securityToolsCheck = new SecurityToolsHealthCheck();
24094
+ versionCheck = new AisdlcVersionCheck();
23989
24095
  async runAll(options) {
23990
24096
  const categories = [];
23991
24097
  categories.push(await this.hooksCheck.inspect(options));
@@ -23994,6 +24100,7 @@ var DoctorOrchestrator = class {
23994
24100
  categories.push(await this.toolchainCheck.inspect(options));
23995
24101
  categories.push(await this.signatureCheck.inspect(options));
23996
24102
  categories.push(await this.securityToolsCheck.inspect(options));
24103
+ categories.push(await this.versionCheck.inspect(options));
23997
24104
  return categories;
23998
24105
  }
23999
24106
  };
@@ -24710,15 +24817,27 @@ var MigrationService = class {
24710
24817
  const targets = this.discoverGovernedFiles(root);
24711
24818
  const evaluation = evaluateGovernedTargets(targets, this.orchestrator, options.force);
24712
24819
  if (isDryRun || evaluation.filesToModify.length === 0) {
24713
- const exitCode2 = resolveExitCode2(evaluation.summary);
24714
- return { success: exitCode2 === 0, exitCode: exitCode2, summary: evaluation.summary, details: evaluation.details };
24820
+ return this.buildCompletedResult(root, evaluation, isDryRun);
24715
24821
  }
24716
24822
  const tx = await this.runMutationTransaction(root, evaluation, options.backup ?? true);
24717
24823
  if (!tx.success) {
24718
24824
  return createTransactionFailureResult(evaluation.summary, tx.backupPath, tx.error);
24719
24825
  }
24826
+ return this.buildCompletedResult(root, evaluation, isDryRun, tx.backupPath);
24827
+ }
24828
+ buildCompletedResult(root, evaluation, isDryRun, backupPath) {
24720
24829
  const exitCode = resolveExitCode2(evaluation.summary);
24721
- return { success: exitCode === 0, exitCode, summary: evaluation.summary, backupPath: tx.backupPath, details: evaluation.details };
24830
+ if (!isDryRun && exitCode !== 2) {
24831
+ this.syncManifestVersion(root);
24832
+ }
24833
+ return { success: exitCode === 0, exitCode, summary: evaluation.summary, backupPath, details: evaluation.details };
24834
+ }
24835
+ syncManifestVersion(root) {
24836
+ const installedVersion = getAisdlcVersion();
24837
+ const existing = readAisdlcManifest(root);
24838
+ if (!existing || existing.version !== installedVersion) {
24839
+ writeAisdlcManifest(root, installedVersion);
24840
+ }
24722
24841
  }
24723
24842
  discoverGovernedFiles(root) {
24724
24843
  const items = [];
@@ -24738,8 +24857,10 @@ var MigrationService = class {
24738
24857
  }
24739
24858
  };
24740
24859
 
24860
+ exports.AISDLC_MANIFEST_FILENAME = AISDLC_MANIFEST_FILENAME;
24741
24861
  exports.ALL_ARCHITECTURE_TEMPLATES = ALL_ARCHITECTURE_TEMPLATES;
24742
24862
  exports.ALL_QUALITY_GATES = ALL_QUALITY_GATES;
24863
+ exports.AisdlcVersionCheck = AisdlcVersionCheck;
24743
24864
  exports.BRANCH_PATTERNS = BRANCH_PATTERNS;
24744
24865
  exports.BddStepRegistry = BddStepRegistry;
24745
24866
  exports.BranchSafetyCheck = BranchSafetyCheck;
@@ -25020,6 +25141,7 @@ exports.extractSemanticContent = extractSemanticContent;
25020
25141
  exports.findChangeWorkspaceDir = findChangeWorkspaceDir;
25021
25142
  exports.findLicenseFile = findLicenseFile;
25022
25143
  exports.formatAgentKpisMarkdownSection = formatAgentKpisMarkdownSection;
25144
+ exports.formatAisdlcVersionOutput = formatAisdlcVersionOutput;
25023
25145
  exports.formatCommitTrailers = formatCommitTrailers;
25024
25146
  exports.formatInspectResultMarkdown = formatInspectResultMarkdown;
25025
25147
  exports.formatPrKpiMarkdown = formatPrKpiMarkdown;
@@ -25045,6 +25167,7 @@ exports.generateSuppressionsAuditReport = generateSuppressionsAuditReport;
25045
25167
  exports.generateTestingCoverageReportMarkdown = generateTestingCoverageReportMarkdown;
25046
25168
  exports.generateThirdPartyNotices = generateThirdPartyNotices;
25047
25169
  exports.generateTraceabilityReportMarkdown = generateTraceabilityReportMarkdown;
25170
+ exports.getAisdlcVersion = getAisdlcVersion;
25048
25171
  exports.getArchitectureTemplates = getArchitectureTemplates;
25049
25172
  exports.getCodingRulesFilesForStacks = getCodingRulesFilesForStacks;
25050
25173
  exports.getCytoscapeScript = getCytoscapeScript;
@@ -25127,6 +25250,7 @@ exports.parseTasksFromContent = parseTasksFromContent;
25127
25250
  exports.parseTrivyOutput = parseTrivyOutput;
25128
25251
  exports.parseTrivyVulnerabilities = parseTrivyVulnerabilities;
25129
25252
  exports.processPackageDir = processPackageDir;
25253
+ exports.readAisdlcManifest = readAisdlcManifest;
25130
25254
  exports.readCodeCoverageSummary = readCodeCoverageSummary;
25131
25255
  exports.readFailOnMissingToolFromQualityPolicy = readFailOnMissingToolFromQualityPolicy;
25132
25256
  exports.readNormalizedCoverage = readNormalizedCoverage;
@@ -25223,6 +25347,7 @@ exports.walkMdFiles = walkMdFiles;
25223
25347
  exports.walkProjectFiles = walkProjectFiles;
25224
25348
  exports.walkSourceFiles = walkSourceFiles;
25225
25349
  exports.walkTaskFiles = walkTaskFiles;
25350
+ exports.writeAisdlcManifest = writeAisdlcManifest;
25226
25351
  exports.writeCucumberJsonReport = writeCucumberJsonReport;
25227
25352
  exports.writeCycloneDxSbom = writeCycloneDxSbom;
25228
25353
  exports.writeQualityBaseline = writeQualityBaseline;