@aisdlc/core 4.7.0 → 4.7.1

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
@@ -19472,6 +19472,14 @@ var LIFECYCLE_SKILL_TEMPLATES = [
19472
19472
  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).",
19473
19473
  globs: "specs/changes/**, src/**, packages/**, tests/**",
19474
19474
  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`.'
19475
+ },
19476
+ {
19477
+ id: "aisdlc-inspector",
19478
+ title: "360\xB0 Traceability Inspector & Graph Navigator",
19479
+ description: "Interactive technical inspector and graph navigator across AI-SDLC requirements (FR-*, QR-*, SEC-REQ-*, PRIV-REQ-*), architecture components (CMP-*, ADR-*), SDD tasks (TSK-*, CHG-*), test suites, and source code files. Provides concise technical summaries, upstream/downstream traceability mappings, and selectable navigation loops.",
19480
+ 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), and [`process/10_quality_management_and_release_gates.md`](../../process/10_quality_management_and_release_gates.md).",
19481
+ globs: "specs/**, architecture/**, src/**, packages/**, tests/**",
19482
+ body: '## Purpose & Trigger\nUse this skill whenever a user or agent requests to **inspect, explain, trace, or navigate** any element of the system:\n- **Requirements & Product:** `UC-*`, `FR-*`, `QR-*`, `BR-*`, `BC-*`, `ABUSE-*`, `DATA-ASSET-*`, `PRIV-ROPA-*`, `ARCH-INTRO-*`.\n- **Architecture & Decisions:** `CMP-*`, `ADR-*`, `SEC-ENC-*`.\n- **SDD & Tasks:** `TSK-*`, `CHG-*`, `HOF-*`.\n- **Source Code Files:** `src/**/*.ts`, `packages/**/*.ts`, etc.\n- **Verification Suites:** `.feature` BDD files, unit/integration specs.\n\nThis skill provides **impact analysis, context comprehension, and interactive graph exploration** with zero guesswork.\n\n---\n\n## Interactive Execution Playbook\n\n### Step 1: Target Resolution\n1. Extract the target identifier or file path indicated by the user (e.g., `FR-001`, `CMP-CORE`, `src/auth/jwt.ts`, `TSK-001`).\n2. If no target was specified, prompt the user with common anchor options (e.g., primary Use Cases `UC-*`, Core Components `CMP-*`, or an open input).\n\n### Step 2: Deterministic Inspection Engine\nExecute the inspection via MCP or CLI:\n* **Primary (MCP Tool):**\n Invoke MCP tool `inspect_element`:\n ```json\n {\n "query": "<target-id-or-path>"\n }\n ```\n* **Fallback (CLI):**\n Run command:\n ```bash\n npx aisdlc inspect "<target-id-or-path>" --json\n ```\n\n---\n\n### Step 3: Complete Technical Report Delivery (MANDATORY FIRST)\n> [!IMPORTANT]\n> **CRITICAL UX DIRECTIVE (Report First, Question After):**\n> The agent MUST always render and deliver the complete, detailed technical report to the user in visible text **BEFORE** prompting for the next element. Never invoke a blocking dialog or selector on an empty turn without the user having the full inspection visible.\n\nThe rendered response MUST contain:\n1. **Header:** Artifact ID, Title, Type (`requirement`, `component`, `source-file`, `task`), Layer (`product`, `architecture`, `code`, `test`, `governance`), and Status (`COMPLIANT`, `ORPHAN`, `DRIFT`).\n2. **File Location:** Clickable markdown link to the file.\n3. **Technical Summary:** Concise explanation (2\u20134 sentences) of what the element does, its responsibilities, key interfaces, and consolidated evolutionary increments (`### Incremento (CHG-*)`). If a canonical requirement still shows boilerplate text despite completed changes in `specs/changes/`, run `sdd_integrate` with `all: true` (`npx aisdlc sdd integrate --all`) first so canonical requirements reflect the consolidated specification.\n4. **Upstream Relations (Derives from / Mitigates / Governed by):**\n - \u2197\uFE0F List all parent requirements, use cases, business rules, or decisions that justify this element.\n5. **Downstream Relations (Satisfied by / Implemented in / Verified by):**\n - \u2198\uFE0F List all components implementing it, tasks developing it, and test suites validating it.\n6. **Numbered Navigable Items:** Clear, numbered list of connected nodes with their ID, type, and relationship.\n\n---\n\n### Step 4: Subsequent Navigation Formulation & Selector\nOnce the technical report is fully constructed:\n1. Formulate the closing question inviting the user to continue navigating the graph.\n2. If using the interactive selector (`ask_question`), execute it **in conjunction with or immediately following the complete report text**:\n * **Question:** *"\xBFHacia qu\xE9 elemento conectado deseas continuar la exploraci\xF3n?"*\n * **Options:** Formatted list of related elements from `relatedItems`:\n - `(Recommended) <ID-1> (<Type-1> \u2014 <relation-1>)`\n - `<ID-2> (<Type-2> \u2014 <relation-2>)`\n - `<ID-N> (<Type-N> \u2014 <relation-N>)`\n - `Terminar exploraci\xF3n`\n3. **Navigation Loop:**\n - When the user selects or indicates an element (either via UI selector or plain text/number), repeat **Step 2** with the new selection.\n - If the user selects `Terminar exploraci\xF3n`, summarize the traversal journey and conclude.'
19475
19483
  }
19476
19484
  ];
19477
19485
  function renderAntigravitySkillFile(skill) {