@aisdlc/core 4.3.1 → 4.4.0
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 +156 -192
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -5
- package/dist/index.d.ts +8 -5
- package/dist/index.js +156 -192
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1687,21 +1687,24 @@ function collectUniqueSteps(doc) {
|
|
|
1687
1687
|
return unique;
|
|
1688
1688
|
}
|
|
1689
1689
|
function renderTsFallback(relFeature, steps) {
|
|
1690
|
-
const
|
|
1690
|
+
const entries = steps.map((st) => ` ['${mapStepKeyword(st.keyword)}', "${escapeDoubleQuotes(st.text)}"],`);
|
|
1691
|
+
return [
|
|
1691
1692
|
`// AUTO-GENERATED RED BDD STEP DEFINITIONS (${relFeature})`,
|
|
1692
1693
|
`import { BddStepRegistry } from '@aisdlc/core';`,
|
|
1693
1694
|
``,
|
|
1694
|
-
`
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1695
|
+
`const STEP_SPECS: ReadonlyArray<readonly ['given' | 'when' | 'then', string]> = [`,
|
|
1696
|
+
...entries,
|
|
1697
|
+
`];`,
|
|
1698
|
+
``,
|
|
1699
|
+
`export function registerSteps(registry: BddStepRegistry): void {`,
|
|
1700
|
+
` for (const [method, text] of STEP_SPECS) {`,
|
|
1701
|
+
` registry[method](text, () => {`,
|
|
1702
|
+
` throw new Error(\`RED: Step not implemented: \${text}\`);`,
|
|
1703
|
+
` });`,
|
|
1704
|
+
` }`,
|
|
1705
|
+
`}`,
|
|
1706
|
+
``
|
|
1707
|
+
].join("\n");
|
|
1705
1708
|
}
|
|
1706
1709
|
function renderPyFallback(relFeature, steps) {
|
|
1707
1710
|
const lines = [
|
|
@@ -2045,39 +2048,85 @@ function extractGherkinFeatures(options = {}) {
|
|
|
2045
2048
|
}
|
|
2046
2049
|
return { success: true, features, totalScenarios };
|
|
2047
2050
|
}
|
|
2051
|
+
function walkFeatureFiles(dir, fileList = []) {
|
|
2052
|
+
if (!fs12.existsSync(dir)) return fileList;
|
|
2053
|
+
for (const entry of fs12.readdirSync(dir).sort(canonicalSort)) {
|
|
2054
|
+
const fullPath = path14.join(dir, entry);
|
|
2055
|
+
if (fs12.statSync(fullPath).isDirectory()) {
|
|
2056
|
+
walkFeatureFiles(fullPath, fileList);
|
|
2057
|
+
} else if (entry.endsWith(".feature")) {
|
|
2058
|
+
fileList.push(fullPath);
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
return fileList;
|
|
2062
|
+
}
|
|
2063
|
+
function hasDeterministicStepFile(rootDir, featureFullPath) {
|
|
2064
|
+
return Object.values(GHERKIN_GENERATOR_SPECS).some((spec) => {
|
|
2065
|
+
const stepPath = spec.resolveOutputPath(rootDir, featureFullPath);
|
|
2066
|
+
return fs12.existsSync(stepPath) && fs12.statSync(stepPath).size > 0;
|
|
2067
|
+
});
|
|
2068
|
+
}
|
|
2069
|
+
function findOrphanFeatureFiles(rootDir, expectedRelPaths) {
|
|
2070
|
+
const featuresDir = path14.join(rootDir, "tests", "features");
|
|
2071
|
+
const orphans = [];
|
|
2072
|
+
for (const fp of walkFeatureFiles(featuresDir)) {
|
|
2073
|
+
const rel = path14.relative(rootDir, fp).replace(/\\/g, "/");
|
|
2074
|
+
if (!expectedRelPaths.has(rel)) {
|
|
2075
|
+
orphans.push(rel);
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2078
|
+
return orphans;
|
|
2079
|
+
}
|
|
2080
|
+
function verifyExistingFeatureFile(rootDir, targetPath, expectedContent, relTarget, state) {
|
|
2081
|
+
const actualContent = fs12.readFileSync(targetPath, "utf-8");
|
|
2082
|
+
if (actualContent.replace(/\r\n/g, "\n") !== expectedContent.replace(/\r\n/g, "\n")) {
|
|
2083
|
+
state.outOfSyncFiles.push(relTarget);
|
|
2084
|
+
}
|
|
2085
|
+
if (!hasDeterministicStepFile(rootDir, targetPath)) {
|
|
2086
|
+
state.missingStepFiles.push(relTarget);
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
function checkSingleMarkdownFeatureSync(rootDir, filePath, state) {
|
|
2090
|
+
const { frontmatter, body } = parseMarkdownFrontmatter(fs12.readFileSync(filePath, "utf-8"));
|
|
2091
|
+
const gherkinBlocks = extractGherkinBlock(body);
|
|
2092
|
+
if (gherkinBlocks.length === 0) return;
|
|
2093
|
+
state.totalFeatures++;
|
|
2094
|
+
const id = frontmatter.id || path14.basename(filePath, path14.extname(filePath));
|
|
2095
|
+
const targetPath = resolveFeatureFilePath(rootDir, filePath, id, frontmatter["cucumber-feature-file"]);
|
|
2096
|
+
const relTarget = path14.relative(rootDir, targetPath).replace(/\\/g, "/");
|
|
2097
|
+
state.expectedRelPaths.add(relTarget);
|
|
2098
|
+
if (!fs12.existsSync(targetPath)) {
|
|
2099
|
+
state.missingFiles.push(relTarget);
|
|
2100
|
+
return;
|
|
2101
|
+
}
|
|
2102
|
+
const expectedContent = buildFeatureFileContent(rootDir, filePath, id, frontmatter.version, gherkinBlocks);
|
|
2103
|
+
verifyExistingFeatureFile(rootDir, targetPath, expectedContent, relTarget, state);
|
|
2104
|
+
}
|
|
2048
2105
|
function checkGherkinInSync(options = {}) {
|
|
2049
2106
|
const rootDir = options.rootDir || process.cwd();
|
|
2050
2107
|
const targetFiles = resolveTargetFiles(rootDir, options.targetPath);
|
|
2051
|
-
const
|
|
2052
|
-
|
|
2053
|
-
|
|
2108
|
+
const state = {
|
|
2109
|
+
outOfSyncFiles: [],
|
|
2110
|
+
missingFiles: [],
|
|
2111
|
+
missingStepFiles: [],
|
|
2112
|
+
expectedRelPaths: /* @__PURE__ */ new Set(),
|
|
2113
|
+
totalFeatures: 0
|
|
2114
|
+
};
|
|
2054
2115
|
for (const filePath of targetFiles) {
|
|
2055
2116
|
try {
|
|
2056
|
-
|
|
2057
|
-
const { frontmatter, body } = parseMarkdownFrontmatter(content);
|
|
2058
|
-
const gherkinBlocks = extractGherkinBlock(body);
|
|
2059
|
-
if (gherkinBlocks.length === 0) continue;
|
|
2060
|
-
totalFeatures++;
|
|
2061
|
-
const id = frontmatter.id || path14.basename(filePath, path14.extname(filePath));
|
|
2062
|
-
const targetPath = resolveFeatureFilePath(rootDir, filePath, id, frontmatter["cucumber-feature-file"]);
|
|
2063
|
-
const relTarget = path14.relative(rootDir, targetPath).replace(/\\/g, "/");
|
|
2064
|
-
if (!fs12.existsSync(targetPath)) {
|
|
2065
|
-
missingFiles.push(relTarget);
|
|
2066
|
-
continue;
|
|
2067
|
-
}
|
|
2068
|
-
const expectedContent = buildFeatureFileContent(rootDir, filePath, id, frontmatter.version, gherkinBlocks);
|
|
2069
|
-
const actualContent = fs12.readFileSync(targetPath, "utf-8");
|
|
2070
|
-
if (actualContent.replace(/\r\n/g, "\n") !== expectedContent.replace(/\r\n/g, "\n")) {
|
|
2071
|
-
outOfSyncFiles.push(relTarget);
|
|
2072
|
-
}
|
|
2117
|
+
checkSingleMarkdownFeatureSync(rootDir, filePath, state);
|
|
2073
2118
|
} catch {
|
|
2074
2119
|
}
|
|
2075
2120
|
}
|
|
2121
|
+
const orphanFeatureFiles = options.targetPath ? [] : findOrphanFeatureFiles(rootDir, state.expectedRelPaths);
|
|
2122
|
+
const inSync = state.missingFiles.length === 0 && state.outOfSyncFiles.length === 0 && orphanFeatureFiles.length === 0 && state.missingStepFiles.length === 0;
|
|
2076
2123
|
return {
|
|
2077
|
-
inSync
|
|
2078
|
-
outOfSyncFiles,
|
|
2079
|
-
missingFiles,
|
|
2080
|
-
|
|
2124
|
+
inSync,
|
|
2125
|
+
outOfSyncFiles: state.outOfSyncFiles,
|
|
2126
|
+
missingFiles: state.missingFiles,
|
|
2127
|
+
orphanFeatureFiles,
|
|
2128
|
+
missingStepFiles: state.missingStepFiles,
|
|
2129
|
+
totalFeatures: state.totalFeatures
|
|
2081
2130
|
};
|
|
2082
2131
|
}
|
|
2083
2132
|
|
|
@@ -6571,11 +6620,13 @@ function sanitizeDlpPayload(payload, policy = createDefaultDlpPolicy()) {
|
|
|
6571
6620
|
// src/adapters/sdd/review-report.ts
|
|
6572
6621
|
var REVIEW_VERDICTS = ["COMPLIANT", "SUGGESTIONS", "BLOCKING"];
|
|
6573
6622
|
var REVIEWER_ROLES = [
|
|
6623
|
+
"agent-auditor",
|
|
6624
|
+
"agent-adversary",
|
|
6625
|
+
"agent-privacy-officer",
|
|
6626
|
+
"agent-expert-user",
|
|
6574
6627
|
"agent-code-reviewer",
|
|
6575
6628
|
"agent-security-auditor",
|
|
6576
6629
|
"agent-compliance-checker",
|
|
6577
|
-
"agent-privacy-officer",
|
|
6578
|
-
"agent-expert-user",
|
|
6579
6630
|
"auditor",
|
|
6580
6631
|
"reviewer"
|
|
6581
6632
|
];
|
|
@@ -18542,7 +18593,7 @@ var SPECIALIZED_AGENT_TEMPLATES = [
|
|
|
18542
18593
|
|
|
18543
18594
|
## Phase 0: Greenfield Product Inception (New Product Intent)
|
|
18544
18595
|
- **Trigger**: When the user expresses intent to create a new product from scratch with the framework (or when \`specs/product/\` has no baseline product model yet), initiate **Phase 0** before any SDD change (\`change:new\`) or implementation:
|
|
18545
|
-
1. **Iterative Discovery Interview (Up to 15 Questions or Until Product is Crystal Clear)**: Conduct an iterative discovery interview (up to 15 questions, grouped logically in conversational rounds until zero product ambiguities remain) before drafting specs, clarifying: (a) core problem and mission statement, (b) primary actors/stakeholders (\`ACT-*\`), authentication/role model, and **target user interface modality** (e.g., Web UI, Desktop GUI, Console/TUI/CLI, Mobile app, or headless API/SDK), (c) **modern visual aesthetic & styling standard** (Bootstrap 5-style clean responsive web design with cards/tables/badges, Fluent/modern desktop aesthetic with rounded corners/elevated panels, or colorized rich terminal console with ANSI palettes/status badges), (d) **User Journeys (\`JRN-*\`) to generate** \u2014 asking in plain, non-technical language which end-to-end user workflows to model and explicitly guiding the user on the 5 pieces of information needed to build each journey properly: *(1) Who is the protagonist user (\`persona\` / \`ACT-*\`) and their main goal, (2) What are the step-by-step stages from start to finish (\`stages\`), (3) Which screens, channels, or interfaces the user interacts with at each step (\`touchpoints\`), (4) What current obstacles, frustrations, or risks they face (\`pain-points\`), and (5) Which concrete actions or capabilities the system must provide along the journey (\`related-use-cases\` / \`UC-*\`)*, (
|
|
18596
|
+
1. **Iterative Discovery Interview (Up to 15 Questions or Until Product is Crystal Clear)**: Conduct an iterative discovery interview (up to 15 questions, grouped logically in conversational rounds until zero product ambiguities remain) before drafting specs, clarifying: (a) core problem and mission statement, (b) primary actors/stakeholders (\`ACT-*\`), authentication/role model, and **target user interface modality** (e.g., Web UI, Desktop GUI, Console/TUI/CLI, Mobile app, or headless API/SDK), (c) **modern visual aesthetic & styling standard** (Bootstrap 5-style clean responsive web design with cards/tables/badges, Fluent/modern desktop aesthetic with rounded corners/elevated panels, or colorized rich terminal console with ANSI palettes/status badges), (d) **delivery & operation model** (in plain business terms: Cloud SaaS, Self-Hosted/On-Premise, Local Desktop/CLI binary, or Library/SDK package, plus any data-residency or SLA constraints), (e) **User Journeys (\`JRN-*\`) to generate** \u2014 asking in plain, non-technical language which end-to-end user workflows to model and explicitly guiding the user on the 5 pieces of information needed to build each journey properly: *(1) Who is the protagonist user (\`persona\` / \`ACT-*\`) and their main goal, (2) What are the step-by-step stages from start to finish (\`stages\`), (3) Which screens, channels, or interfaces the user interacts with at each step (\`touchpoints\`), (4) What current obstacles, frustrations, or risks they face (\`pain-points\`), and (5) Which concrete actions or capabilities the system must provide along the journey (\`related-use-cases\` / \`UC-*\`)*, (f) foundational master entities/catalogs and CRUD flows required to operate the system, (g) essential MVP capabilities/use cases (\`UC-*\`) and business rules/invariants (\`BR-*\`) vs. future roadmap, and (h) top 3\u20135 priority quality goals and constraints (\`QR-*\`, \`CON-*\`). Do not proceed to draft artifacts until the product scope is completely clear.
|
|
18546
18597
|
2. **Enterprise & Capability Vision (\`ARCH-INTRO-001\`)**: Draft the root vision artifact (\`type: architecture-introduction\`, \`naf-perspective: "Enterprise & Capability"\`, \`status: draft\`) using \`templates/architecture/introduction-and-goals.template.md\` (\`schemas/architecture/introduction-and-goals.schema.json\`), explicitly recording the agreed UI/interaction modality.
|
|
18547
18598
|
3. **ProductShape Derivation**: Derive the initial draft artifacts (\`ACT-*\`, \`JRN-*\`, \`UC-*\`, \`BR-*\`, \`FR-*\`, \`QR-*\` with \`status: draft\`) in \`specs/product/\` linked to \`ARCH-INTRO-001\` for human Product Owner review.
|
|
18548
18599
|
4. **Mandatory End-to-End Presentation Interface & Master Data Prerequisite Rule (ANTI-LIBRARY-ONLY MVP)**: Whenever primary actors (\`ACT-*\`) are human users, the MVP ProductShape baseline MUST include: (a) an explicit presentation/interaction requirement (\`FR-*\`) or vertical UI/CLI acceptance criteria matching the modality agreed in Step 1 (Web UI, Desktop GUI, or Console/TUI/CLI \u2014 never proposing a library-only/in-memory MVP without a runnable entry point), (b) user authentication/session access when multi-role actors exist, and (c) CRUD/configuration flows for foundational master entities (e.g., rooms, staff, students, catalogs) required to operate the core business flows without manual database intervention.
|
|
@@ -18630,6 +18681,7 @@ var SPECIALIZED_AGENT_TEMPLATES = [
|
|
|
18630
18681
|
- **Contract-First Full-Stack Integration**: Whenever a feature or change spans Frontend (UI) and Backend (API/services), define an explicit shared typed contract (Zod schemas, shared TypeScript DTOs, or OpenAPI specification) in \`design.md\` before implementation so both layers compile against a single source of truth.
|
|
18631
18682
|
- **No Orphan Presentation Components (\`CMP-WEB-*\` / \`CMP-UI-*\` / \`CMP-CLI-*\`)**: When modeling architecture for a system with human actors (\`ACT-*\`), never leave the agreed presentation/driving adapter (Web UI, Desktop GUI, or Console/CLI) as an unmapped \`proposed\` spec while scheduling only backend class-library tasks in \`tasks.md\`. Wave 0 (\`CHG-001\`) MUST bootstrap the runnable presentation host shell matching the modality defined in Inception, and every subsequent \`CHG-*\` for a human-facing \`UC-*\` must include tasks (\`TSK-*\`) implementing its corresponding views/screens/commands and E2E tests as a complete vertical slice.
|
|
18632
18683
|
- Generate interaction and sequence diagrams in native Mermaid syntax.
|
|
18684
|
+
- **Deployment Topology (\`ARCH-DEP-001\`)**: Translate the product delivery and operation model recorded in \`ARCH-INTRO-001\` / \`CON-*\` into an arc42 Section 7 Deployment View (\`templates/architecture/deployment-view.template.md\`) mapping components (\`CMP-*\`) to execution nodes (\`RES-*\`) and network enclaves (\`SEC-ENC-*\`).
|
|
18633
18685
|
- Document critical technological decisions using immutable \`ADR-*\` records conforming to \`schemas/architecture/adr.schema.json\`.
|
|
18634
18686
|
- Validate that architectural choices comply with legal constraints in \`license-policy.yaml\` and data protection constraints in \`privacy-policy.yaml\`.
|
|
18635
18687
|
- **Technical Security & Privacy Feedback Loop**: If architectural decisions (databases, queues, distributed caching, third-party APIs, LLM providers, authentication schemes) introduce new attack vectors or PII data flows, emit a return handoff to \`agent-threat-modeler\` (which chains to \`agent-privacy-officer\`) for technical modeling prior to the testing phase.
|
|
@@ -18664,7 +18716,11 @@ var SPECIALIZED_AGENT_TEMPLATES = [
|
|
|
18664
18716
|
- **Zero-Mock Integration Rule**: When an \`FR-*\` spans UI and Backend, unit tests mocking \`fetch\`/HTTP in isolation are insufficient; include integration/contract or E2E test scenarios verifying real request/response wiring and UI state transitions (\`Loading\`, \`Empty\`, \`Error\`, \`Nominal\`).
|
|
18665
18717
|
- Tag all scenarios with \`@<FR-ID> @automated @regression\`.
|
|
18666
18718
|
- **STRICTLY FORBIDDEN**: Including production code, suggesting implementation, or anticipating technical solutions.
|
|
18667
|
-
-
|
|
18719
|
+
- **MANDATORY DETERMINISTIC GHERKIN ENGINES**:
|
|
18720
|
+
1. **NEVER** author or edit \`.feature\` files in \`tests/features/\` manually, and **NEVER** write boilerplate BDD step definition files in \`tests/steps/\` from scratch.
|
|
18721
|
+
2. Always author Gherkin scenarios inside the \`\`\`gherkin blocks of the specification Markdown (\`FR-*\`, \`SEC-REQ-*\`, \`PRIV-REQ-*\`, \`spec.md\`) and run \`npx aisdlc gherkin extract\` (or \`npx aisdlc check --fix\`) to deterministically generate \`.feature\` files.
|
|
18722
|
+
3. Always run \`npx aisdlc gherkin scaffold <feature-file> --lang <ts|py|go|rs|cs> --fallback\` (or without \`--fallback\` when native generator is installed and approved) to deterministically scaffold RED step definition skeletons in \`tests/steps/\`. Implement assertions inside those generated step files and add any extra unit/integration/E2E/UI suites in \`tests/unit/\`, \`tests/e2e/\`, etc.
|
|
18723
|
+
- Run \`npx aisdlc verify gherkin\` and \`pnpm run verify:testing\` before emitting handoff.
|
|
18668
18724
|
- If autonomy is $\\ge$ \`HUMAN_REVIEW_PLAN\`, conclude by emitting the Workflow Handoff block (\`templates/workflow/agent-handoff.template.md\`) suggesting \`agent-developer\` and opening the Human Action Window. In \`AUTONOMOUS\` mode, omit interactive handoff.`
|
|
18669
18725
|
},
|
|
18670
18726
|
{
|
|
@@ -18709,42 +18765,7 @@ Execute every implementation task following this strict sequential order:
|
|
|
18709
18765
|
- **Mandatory Regression Verification**: Never declare build, typecheck, or bug fixes complete without executing the relevant automated test suite (\`pnpm test\`, \`dotnet test\`) and confirming zero regressions.
|
|
18710
18766
|
- **Global Styles Protection**: When touching or refactoring frontend views, verify that global stylesheet/asset imports remain intact and that layouts suffer no visual disruption.
|
|
18711
18767
|
- **Skills-First Implementation Directive**: When authoring or refactoring code (especially frontend, UI, styling, accessibility, or framework-specific logic), proactively inspect and leverage available specialized agent skills (e.g., modern web guidance, accessibility a11y, DevTools, framework skills) to produce standard-compliant, modern implementations rather than guessing ad-hoc patterns.
|
|
18712
|
-
- Upon completing green implementation, suggest handoff to \`agent-expert-user\` for Post-Development Functional Validation prior to
|
|
18713
|
-
},
|
|
18714
|
-
{
|
|
18715
|
-
id: "agent-security-auditor",
|
|
18716
|
-
title: "Adversarial Code Auditor",
|
|
18717
|
-
description: "Examine Pull Requests and source code with an attacker mindset for business logic vulnerabilities, injection vectors, secret leaks, and authorization flaws.",
|
|
18718
|
-
globs: "src/**, packages/**, security/**",
|
|
18719
|
-
claudeTools: ["View", "GlobTool", "GrepTool", "LS", "Bash"],
|
|
18720
|
-
antigravityTools: ["read_file", "run_command", "call_mcp_tool"],
|
|
18721
|
-
body: `## Role & Mission
|
|
18722
|
-
- **Role**: Adversarial Security Auditor Agent (\`agent-security-auditor\`).
|
|
18723
|
-
- **Mission**: Rigorously examine Pull Requests and code diffs for business logic vulnerabilities, injection vectors, secret leaks, and authorization flaws as part of the Pre-Merge Audit Triad.
|
|
18724
|
-
|
|
18725
|
-
## Operational Directives & Guardrails
|
|
18726
|
-
- Analyze code diffs with an attacker mindset: How can an unauthenticated user bypass this check? Are there info leaks in exceptions? Is command, SQL, path traversal, or prompt injection possible?
|
|
18727
|
-
- Run deterministic security verification: \`pnpm run verify:security\` (secrets + shift-left SAST).
|
|
18728
|
-
- Issue a formal audit report with CVSS v3.1 severity scoring and concrete remediation proposals.
|
|
18729
|
-
- Immediately block any PR introducing CRITICAL or HIGH security risks.
|
|
18730
|
-
- If autonomy is $\\ge$ \`HUMAN_REVIEW_PLAN\`, conclude by emitting the Workflow Handoff block (\`templates/workflow/agent-handoff.template.md\`) to the human Tech Lead, opening the Human Action Window. In \`AUTONOMOUS\` mode, omit interactive handoff.`
|
|
18731
|
-
},
|
|
18732
|
-
{
|
|
18733
|
-
id: "agent-compliance-checker",
|
|
18734
|
-
title: "Open Source License Compliance Auditor",
|
|
18735
|
-
description: "Audit dependency manifests and SBOMs against license-policy.yaml to block viral copyleft licenses and flag commercial license requirements.",
|
|
18736
|
-
globs: "package.json, pnpm-lock.yaml, license-policy.yaml, compliance/**",
|
|
18737
|
-
claudeTools: ["View", "GlobTool", "GrepTool", "LS", "Bash"],
|
|
18738
|
-
antigravityTools: ["read_file", "run_command", "call_mcp_tool"],
|
|
18739
|
-
body: `## Role & Mission
|
|
18740
|
-
- **Role**: Open Source License and Intellectual Property Compliance Auditor Agent (\`agent-compliance-checker\`).
|
|
18741
|
-
- **Mission**: Audit dependency manifests and ensure every direct and transitive third-party package complies with \`license-policy.yaml\` as part of the Pre-Merge Audit Triad.
|
|
18742
|
-
|
|
18743
|
-
## Operational Directives & Guardrails
|
|
18744
|
-
- Verify SPDX identifiers for every direct and transitive dependency via \`pnpm run verify:licenses\`.
|
|
18745
|
-
- Immediately block viral copyleft licenses (\`GPL-*\`, \`AGPL-*\`) and unknown/unlicensed packages.
|
|
18746
|
-
- If source-available or commercial licenses (\`BSL-1.1\`, \`SSPL-1.0\`) are detected, flag with \`COMMERCIAL_APPROVAL_REQUIRED\` and draft a request using \`templates/compliance/commercial-acquisition-request.template.md\`.
|
|
18747
|
-
- If autonomy is $\\ge$ \`HUMAN_REVIEW_PLAN\`, conclude by emitting the Workflow Handoff block (\`templates/workflow/agent-handoff.template.md\`) to the human Tech Lead or Legal counsel, opening the Human Action Window. In \`AUTONOMOUS\` mode, omit interactive handoff.`
|
|
18768
|
+
- Upon completing green implementation, suggest handoff to \`agent-expert-user\` for Post-Development Functional Validation prior to Checkpoint 2 (\`agent-auditor\` $\\parallel$ \`agent-adversary\` + \`agent-privacy-officer\`).`
|
|
18748
18769
|
},
|
|
18749
18770
|
{
|
|
18750
18771
|
id: "agent-expert-user",
|
|
@@ -18763,28 +18784,7 @@ Execute every implementation task following this strict sequential order:
|
|
|
18763
18784
|
- **FORBIDDEN Library-Only MVP for Human Actors**: Whenever primary actors (\`ACT-*\`) are human users, verify that the target interaction modality (Web UI, Desktop GUI, Console/TUI/CLI, or Mobile) was explicitly defined in \`ARCH-INTRO-*\` / \`specs/product/\`, and reject as \`[BLOCKING_DEFECT]\` any MVP proposal that defers the agreed presentation layer, role authentication (when applicable), or foundational master-entity CRUDs (e.g., creating rooms, teachers, students, schedules) to post-MVP or leaves the system operable only via unit tests/in-memory calls. An MVP for human operators must be end-to-end usable from day one via its agreed interface.
|
|
18764
18785
|
2. **Functional Validation Mode (Downstream / Pre-PR / Post-Development Functional Validation)**: Inspect \`agent-developer\` deliverables once unit tests pass green by executing the real application (via Playwright or Chrome DevTools MCP when UI is present). Contrast actual UI, CLI, and API behavior against approved \`UC-*\` and \`FR-*\` criteria, verifying real Backend connectivity, the 4 UI usability states (\`Loading\`, \`Empty\`, \`Error\`, \`Nominal\`), keyboard/ARIA accessibility, modern visual appearance (Bootstrap 5-style clean layouts for Web, modern styled panels for Desktop, or colorized rich terminal formatting for Console), and \`0\` browser \`console.error\` / network failures.
|
|
18765
18786
|
- Formulate decisive questions under \`open-questions\` for the human Product Owner.
|
|
18766
|
-
- Emit handoff block suggesting
|
|
18767
|
-
},
|
|
18768
|
-
{
|
|
18769
|
-
id: "agent-code-reviewer",
|
|
18770
|
-
title: "Technical and Architectural Code Reviewer",
|
|
18771
|
-
description: "Audit Pull Requests for Clean Code, SOLID, DRY, YAGNI, design patterns, and compliance with quality-policy.yaml complexity and maintainability thresholds.",
|
|
18772
|
-
globs: "src/**, packages/**, tests/**",
|
|
18773
|
-
claudeTools: ["View", "GlobTool", "GrepTool", "LS", "Bash"],
|
|
18774
|
-
antigravityTools: ["read_file", "run_command", "call_mcp_tool"],
|
|
18775
|
-
body: `## Role & Mission
|
|
18776
|
-
- **Role**: Technical and Architectural Code Reviewer Agent (\`agent-code-reviewer\`).
|
|
18777
|
-
- **Mission**: Audit Pull Requests evaluating code cleanliness, adherence to SOLID, DRY, YAGNI principles, design patterns, and compliance with complexity and maintainability thresholds (\`quality-policy.yaml\`), forming part of the Pre-Merge Audit Triad.
|
|
18778
|
-
|
|
18779
|
-
## Operational Directives & Guardrails
|
|
18780
|
-
- Analyze code diffs against \`quality-policy.yaml\` standards: Cyclomatic Complexity $\\le 10$, Cognitive Complexity $\\le 15$, Maintainability Index $\\ge 50$, Lines per Function $\\le 40$.
|
|
18781
|
-
- Detect improper coupling, code smells, magic numbers, ambiguous identifiers, and encapsulation breaches.
|
|
18782
|
-
- Flag premature abstractions and speculative code violating YAGNI.
|
|
18783
|
-
- **Block Fake-Wiring & Disconnected UI**: Flag as \`[BLOCKING]\` any production UI component containing hardcoded mock data (\`mockData\`), empty event handlers (\`onClick={() => {}}\`), missing error/loading state handling, or API calls bypassing shared contracts.
|
|
18784
|
-
- **Block Unstyled & Non-Compliant Interfaces**: Flag as \`[BLOCKING]\` any web view lacking responsive grid and standard styling classes (such as Bootstrap 5 or project design tokens), any desktop window using raw unstyled legacy controls, or any interactive console tool emitting raw monochrome dumps without colorized badges or structured formatting. Also verify that inline manual styles (\`style="..."\`) are not used to bypass design systems.
|
|
18785
|
-
- Coordinate Pre-Merge Audit Triad with \`agent-security-auditor\`, \`agent-privacy-officer\`, and \`agent-compliance-checker\`.
|
|
18786
|
-
- Categorize findings into: \`[BLOCKING]\` (quality violation or broken pattern), \`[CLEAN_CODE_SUGGESTION]\` (non-blocking improvement), and \`[COMPLIANT]\`.
|
|
18787
|
-
- If autonomy is $\\ge$ \`HUMAN_REVIEW_PLAN\`, conclude by emitting the Workflow Handoff block (\`templates/workflow/agent-handoff.template.md\`) to the human Tech Lead for final approval and merge, opening the Human Action Window. In \`AUTONOMOUS\` mode, omit interactive handoff.`
|
|
18787
|
+
- Emit handoff block suggesting Checkpoint 2 (\`agent-auditor\` $\\parallel$ \`agent-adversary\` + \`agent-privacy-officer\`) if compliant, or return to \`agent-developer\` on functional drift, unstyled interfaces, or fake-wiring.`
|
|
18788
18788
|
},
|
|
18789
18789
|
{
|
|
18790
18790
|
id: "agent-devops",
|
|
@@ -18792,7 +18792,7 @@ Execute every implementation task following this strict sequential order:
|
|
|
18792
18792
|
description: "Maintain, evolve, and audit CI/CD workflows, Dockerfiles, IaC manifests, and support scripts under strict non-invasion guardrails on src/.",
|
|
18793
18793
|
globs: ".github/workflows/**, templates/ci/**, scripts/**, Dockerfile*",
|
|
18794
18794
|
claudeTools: ["View", "Edit", "Replace", "GlobTool", "GrepTool", "LS", "Bash"],
|
|
18795
|
-
antigravityTools: ["read_file", "edit_file", "write_file", "run_command", "call_mcp_tool"],
|
|
18795
|
+
antigravityTools: ["read_file", "edit_file", "write_file", "run_command", "call_mcp_tool", "ask_question"],
|
|
18796
18796
|
body: `## Role & Mission
|
|
18797
18797
|
- **Role**: DevOps and Infrastructure as Code (IaC) Engineer Agent (\`agent-devops\`).
|
|
18798
18798
|
- **Mission**: Maintain, evolve, and audit automated project infrastructure: CI/CD workflows, Docker containers, deployment manifests, and infrastructure scripts.
|
|
@@ -18800,6 +18800,7 @@ Execute every implementation task following this strict sequential order:
|
|
|
18800
18800
|
## Operational Directives & Guardrails
|
|
18801
18801
|
- **Strict Infrastructure Domain**: Operate exclusively on workflows (\`.github/workflows/\`, \`templates/ci/\`), container files (\`Dockerfile*\`, \`docker-compose*.yml\`), IaC manifests, and support scripts (\`scripts/\`).
|
|
18802
18802
|
- **NON-INVASION GUARDRAIL**: STRICTLY FORBIDDEN from modifying or refactoring application source code files (\`src/\`, \`packages/*/src/\`). Your responsibility is pipelines and scaffolding, never business logic.
|
|
18803
|
+
- **Deployment & CI/CD Strategy Discovery**: Before scaffolding new pipelines or deployment manifests (e.g., Wave 0 Greenfield or Legacy CI integration), read \`ARCH-INTRO-001\` / \`ARCH-DEP-001\` and clarify with the human Tech Lead: (1) target packaging & CD destination (CI-only Quality Gates, Docker/OCI image to GHCR, package registry \`npm\`/\`NuGet\`/\`PyPI\`/GitHub Releases, or PaaS/Cloud/K8s), (2) CI/CD platform (GitHub Actions, GitLab CI, Azure Pipelines), and (3) release trigger policy (on push to \`main\` vs. manual SemVer tag \`vX.Y.Z\`).
|
|
18803
18804
|
- **Infrastructure Dependency Policy**: Verify licenses of dependencies, Docker base images, and third-party CI actions against \`license-policy.yaml\`.
|
|
18804
18805
|
- **Gate Preservation**: Ensure any pipeline optimization keeps all existing deterministic Quality Gates intact.
|
|
18805
18806
|
- **Cross-Workflow Audit**: When fixing any CI/CD or configuration defect detected in a PR, search all \`.github/workflows/*.yml\` for the same pattern (including release, post-merge, and publishing pipelines) before declaring the fix complete.
|
|
@@ -18809,18 +18810,21 @@ Execute every implementation task following this strict sequential order:
|
|
|
18809
18810
|
{
|
|
18810
18811
|
id: "agent-auditor",
|
|
18811
18812
|
title: "Transversal Quality and Improvement Auditor",
|
|
18812
|
-
description: "Polymorphically inspect deliverables from any AI-SDLC specialist agent on demand,
|
|
18813
|
+
description: "Polymorphically inspect deliverables from any AI-SDLC specialist agent on demand, enforcing Clean Code, SOLID, DRY, YAGNI, AST thresholds, UI design standards, and SPDX license compliance.",
|
|
18813
18814
|
globs: "**/*",
|
|
18814
18815
|
claudeTools: ["View", "GlobTool", "GrepTool", "LS", "Bash"],
|
|
18815
18816
|
antigravityTools: ["read_file", "run_command", "call_mcp_tool", "ask_question"],
|
|
18816
18817
|
body: `## Role & Mission
|
|
18817
18818
|
- **Role**: Transversal Quality and Constructive Auditor Agent (\`agent-auditor\`).
|
|
18818
|
-
- **Mission**: Inspect the output deliverables of any upstream specialist agent upon demand across any phase, identifying structural weaknesses, premature abstractions, overengineering, or blind spots, and
|
|
18819
|
+
- **Mission**: Inspect the output deliverables of any upstream specialist agent upon demand across any phase, identifying structural weaknesses, premature abstractions, overengineering, or blind spots, and enforcing Clean Code, SOLID, DRY, Simplicity First (YAGNI), \`quality-policy.yaml\` AST thresholds, and \`license-policy.yaml\` SPDX compliance.
|
|
18819
18820
|
|
|
18820
18821
|
## Operational Directives & Guardrails
|
|
18821
18822
|
- **Polymorphic On-Demand Scope**: May be invoked over deliverables from any role (\`agent-product-analyst\`, \`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`, \`agent-qa-engineer\`, \`agent-developer\`, \`agent-devops\`).
|
|
18822
|
-
- **Simplicity First (YAGNI)**: Actively challenge speculative parameters, redundant interfaces, unused design patterns, and unrequested flexibility.
|
|
18823
|
+
- **Simplicity First (YAGNI) & Code Quality**: Actively challenge speculative parameters, redundant interfaces, unused design patterns, and unrequested flexibility. In code reviews (Checkpoint 2 / Legacy), enforce \`quality-policy.yaml\` thresholds (Cyclomatic Complexity $\\le 10$, Cognitive Complexity $\\le 15$, Maintainability Index $\\ge 50$, Lines per Function $\\le 40$) and Clean Code / SOLID / DRY principles.
|
|
18824
|
+
- **Block Fake-Wiring & Unstyled Interfaces**: Flag as \`[BLOCKING_DEFECT]\` any production UI component containing hardcoded mock data (\`mockData\`), empty event handlers (\`onClick={() => {}}\`), missing \`Loading\`/\`Empty\`/\`Error\` states, or API calls bypassing shared contracts. Also **Block Unstyled & Non-Compliant Interfaces**: flag as \`[BLOCKING_DEFECT]\` any web view lacking responsive grid and standard styling classes (such as Bootstrap 5 or project design tokens), any desktop window using raw unstyled legacy controls, any interactive console tool emitting raw monochrome dumps, or inline \`style="..."\` bypassing design systems.
|
|
18823
18825
|
- **End-to-End MVP Completeness Check (Anti-Library-Only Drift)**: When auditing Product (\`specs/product/\`), Architecture (\`specs/architecture/\`), or SDD change plans (\`design.md\`, \`tasks.md\`) involving human actors (\`ACT-*\`), flag as \`[BLOCKING_DEFECT]\` any scope cut that fails to define the target user interface modality at Inception or omits the runnable driving adapter (Web UI, Desktop GUI, or Console/CLI), role access/auth (when applicable), or master-data CRUD flows required to operate the use case end-to-end without manual database manipulation.
|
|
18826
|
+
- **Deterministic Gherkin Engine Enforcement**: Flag as \`[BLOCKING_DEFECT]\` any \`.feature\` file in \`tests/features/\` authored manually outside \`aisdlc gherkin extract\` or any missing step definition file in \`tests/steps/\` not scaffolded via \`aisdlc gherkin scaffold\`.
|
|
18827
|
+
- **License & Dependency Compliance**: Verify dependency manifests via \`pnpm run verify:licenses\` (\`npx aisdlc verify licenses\`), blocking viral copyleft licenses (\`GPL-*\`, \`AGPL-*\`) or unapproved commercial licenses (\`BSL-*\`, \`SSPL-*\`) against \`license-policy.yaml\`.
|
|
18824
18828
|
- **Classification of Findings**: Label every finding as:
|
|
18825
18829
|
* \`[BLOCKING_DEFECT]\`: Critical omission, structural debt, or standard violation that must be resolved.
|
|
18826
18830
|
* \`[SIMPLIFICATION]\`: Opportunity to remove unneeded complexity or reduce code/spec surface without loss of function.
|
|
@@ -18832,20 +18836,20 @@ Execute every implementation task following this strict sequential order:
|
|
|
18832
18836
|
{
|
|
18833
18837
|
id: "agent-adversary",
|
|
18834
18838
|
title: "Transversal Red Team and Chaos Adversary",
|
|
18835
|
-
description: "Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, providing concrete proofs-of-concept (PoC)
|
|
18839
|
+
description: "Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, auditing diffs for security vulnerabilities (CVSS v3.1) and providing concrete proofs-of-concept (PoC).",
|
|
18836
18840
|
globs: "**/*",
|
|
18837
18841
|
claudeTools: ["View", "GlobTool", "GrepTool", "LS", "Bash"],
|
|
18838
18842
|
antigravityTools: ["read_file", "run_command", "call_mcp_tool", "ask_question"],
|
|
18839
18843
|
body: `## Role & Mission
|
|
18840
18844
|
- **Role**: Transversal Red Team and Stress Adversary Agent (\`agent-adversary\`).
|
|
18841
|
-
- **Mission**: Actively attempt to break, bypass, or invalidate the deliverables of any target specialist agent across any phase, providing concrete proofs-of-concept (PoC), counterexamples, and reproduction steps for every discovered failure mode.
|
|
18845
|
+
- **Mission**: Actively attempt to break, bypass, or invalidate the deliverables of any target specialist agent across any phase (including Pre-Merge / Checkpoint 2 security diff audits), providing concrete proofs-of-concept (PoC), counterexamples, CVSS v3.1 severity scoring, and reproduction steps for every discovered failure mode.
|
|
18842
18846
|
|
|
18843
18847
|
## Operational Directives & Guardrails
|
|
18844
18848
|
- **Polymorphic On-Demand Scope**:
|
|
18845
18849
|
* **Product**: Uncover contradictory requirements, unreachable business states, and logic traps.
|
|
18846
18850
|
* **Architecture**: Simulate race conditions, cascading failures, resource exhaustion, and single points of failure (SPOFs).
|
|
18847
18851
|
* **QA**: Perform conceptual mutation testing; demonstrate how flawed or empty implementations could falsely pass tests green.
|
|
18848
|
-
* **Development**: Attack boundary inputs, concurrency race triggers,
|
|
18852
|
+
* **Development & Pre-Merge Security Audit**: Attack boundary inputs, concurrency race triggers, memory/type edge breaks, injection vectors (SQL, XSS, command, path traversal, prompt injection), secret leaks, and authorization bypasses. Run \`pnpm run verify:security\` (\`npx aisdlc verify security\`), score findings with **CVSS v3.1**, and block any PR introducing \`CRITICAL\` or \`HIGH\` security risks.
|
|
18849
18853
|
* **DevOps**: Probe pipeline isolation, credential boundaries, and cold-start/dependency outages.
|
|
18850
18854
|
- **MANDATORY PROOF-OF-BREAK**: Abstract criticism without reproducible proof is strictly forbidden. Every finding must include: (1) Target Entity ID, (2) Failure Scenario / Attack Vector, (3) Concrete PoC (input vector, sequence breakdown, or mutant code), and (4) Expected Impact.
|
|
18851
18855
|
- **NON-INVASIVE GUARDRAIL**: You do NOT patch the vulnerabilities or bugs yourself.
|
|
@@ -18923,7 +18927,7 @@ var LIFECYCLE_SKILL_TEMPLATES = [
|
|
|
18923
18927
|
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.",
|
|
18924
18928
|
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).",
|
|
18925
18929
|
globs: "product/**, specs/product/**, architecture/**, templates/**",
|
|
18926
|
-
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: Repository Turnkey Initialization\n1. If the workspace has not been initialized with AI-SDLC schemas, policies, and templates, run MCP tool `new` (or CLI `npx @aisdlc/cli init`).\n2. Install the Git telemetry hook via `npx aisdlc git hook install` (`pnpm run git:hook:install`).\n3. Verify `quality-policy.yaml`, `license-policy.yaml`, and `privacy-policy.yaml` are present in the repository root.\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 - **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-*`) 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).\n3. **Human Approval Gate**: 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 (Sequential)**: Scaffold `CHG-001` via [`aisdlc-increment`](../aisdlc-increment/SKILL.md) to establish domain core, shared contracts, auth/config, and the runnable presentation host.\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**: Once all MVP increments are integrated (`sdd_integrate`), run `verify` (`npx aisdlc verify all`), generate SBOM, compute release KPIs (`kpi_release`), and open the Release PR for final human approval and SemVer tagging (`v1.0.0`).\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`.'
|
|
18930
|
+
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: Repository Turnkey Initialization\n1. If the workspace has not been initialized with AI-SDLC schemas, policies, and templates, run MCP tool `new` (or CLI `npx @aisdlc/cli init`).\n2. Install the Git telemetry hook via `npx aisdlc git hook install` (`pnpm run git:hook:install`).\n3. Verify `quality-policy.yaml`, `license-policy.yaml`, and `privacy-policy.yaml` are present in the repository root.\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).\n3. **Human Approval Gate**: 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`), verify release/publishing workflows via `agent-devops`, and open the Release PR for final human approval and SemVer tagging (`v1.0.0`).\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`.'
|
|
18927
18931
|
},
|
|
18928
18932
|
{
|
|
18929
18933
|
id: "aisdlc-legacy-onboarding",
|
|
@@ -18931,7 +18935,7 @@ var LIFECYCLE_SKILL_TEMPLATES = [
|
|
|
18931
18935
|
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.",
|
|
18932
18936
|
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).",
|
|
18933
18937
|
globs: "architecture/**, specs/**, src/**, packages/**",
|
|
18934
|
-
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: Turnkey Repository Scaffolding (Non-Destructive)\n1. Initialize AI-SDLC configuration without overwriting existing application files using `npx @aisdlc/cli init` (or MCP tool `new`).\n2. Install the Git telemetry hook via `npx aisdlc git hook install` (`pnpm run git:hook:install`).\n3. Commit initial AI-SDLC schemas and policies (`.github/`, `schemas/`, `templates/`, `*-policy.yaml`).\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 &
|
|
18938
|
+
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: Turnkey Repository Scaffolding (Non-Destructive)\n1. Initialize AI-SDLC configuration without overwriting existing application files using `npx @aisdlc/cli init` (or MCP tool `new`).\n2. Install the Git telemetry hook via `npx aisdlc git hook install` (`pnpm run git:hook:install`).\n3. 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.\n4. Commit initial AI-SDLC schemas and policies (`.github/`, `schemas/`, `templates/`, `*-policy.yaml`).\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.\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."
|
|
18935
18939
|
},
|
|
18936
18940
|
{
|
|
18937
18941
|
id: "aisdlc-increment",
|
|
@@ -18939,7 +18943,7 @@ var LIFECYCLE_SKILL_TEMPLATES = [
|
|
|
18939
18943
|
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.",
|
|
18940
18944
|
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).",
|
|
18941
18945
|
globs: "specs/changes/**, src/**, packages/**, tests/**",
|
|
18942
|
-
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 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`).\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).\n3. **Human Approval Gate 1**: Present the specification and architectural design for Human Tech Lead / PO sign-off before proceeding to code.\n\n### Step 3: Streamlined Git Branch Navigation & Multi-Agent Parallelism\n1. Navigate to the working branch using `npx aisdlc git checkout <TSK-ID>` (`pnpm run git:checkout <TSK-ID>`).\n - **Default Streamlined Mode**: Switches to the working branch `feat/<CHG-ID>-<slug>` (created from `main`).\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. Author FAILING (red) BDD/Gherkin step definitions, 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/`.\n3. Commit failing test suites with trailer `Task-ID: TSK-YYY`.\n4. Run `verify_testing` (`npx aisdlc verify testing`) to confirm requirement test coverage before writing production code.\n\n### Step 5: Green & Refactor Phase \u2014 Surgical Implementation (`agent-developer`)\n1. Delegate to or adopt [`agent-developer`](../agent-developer/SKILL.md).\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`.\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).\n4. Run `npx aisdlc verify all` to confirm final green status.\n\n### Step 6: Human PR Sign-Off, Baseline Integration & Release Closure\n1. **Feature Merge (`feat/CHG-*` \u2794 `main` or `release/vX.Y.Z`)**:\n - Present the PR, KPI summary (`kpi_pr` including per-task rework metrics), and autogenerated reports (`reports/QUALITY_REPORT.md`, `reports/TRACEABILITY_MATRIX.md`, `reports/ROPA_INVENTORY.md`) 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**: 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-security-auditor`) 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`.'
|
|
18946
|
+
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 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`).\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).\n3. **Human Approval Gate 1**: Present the specification and architectural design for Human Tech Lead / PO sign-off before proceeding to code.\n\n### Step 3: Streamlined Git Branch Navigation & Multi-Agent Parallelism\n1. Navigate to the working branch using `npx aisdlc git checkout <TSK-ID>` (`pnpm run git:checkout <TSK-ID>`).\n - **Default Streamlined Mode**: Switches to the working branch `feat/<CHG-ID>-<slug>` (created from `main`).\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`.\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`.\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).\n4. Run `npx aisdlc verify all` to confirm final green status.\n\n### Step 6: Human PR Sign-Off, Baseline Integration & Release Closure\n1. **Feature Merge (`feat/CHG-*` \u2794 `main` or `release/vX.Y.Z`)**:\n - Present the PR, KPI summary (`kpi_pr` including per-task rework metrics), and autogenerated reports (`reports/QUALITY_REPORT.md`, `reports/TRACEABILITY_MATRIX.md`, `reports/ROPA_INVENTORY.md`) 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**: 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`.'
|
|
18943
18947
|
}
|
|
18944
18948
|
];
|
|
18945
18949
|
function renderAntigravitySkillFile(skill) {
|
|
@@ -19078,52 +19082,33 @@ This file defines the operational rules and specialized role mappings for Google
|
|
|
19078
19082
|
- **Mandatory Regression Verification**: Never declare build, typecheck, or bug fixes complete without executing the relevant automated test suite (\`pnpm test\`, \`dotnet test\`) and confirming zero regressions.
|
|
19079
19083
|
- **Global Styles Protection**: When touching or refactoring frontend views, verify that global stylesheet/asset imports remain intact and that layouts suffer no visual disruption.
|
|
19080
19084
|
- **Skills-First Implementation Directive**: When authoring or refactoring code (especially frontend, UI, styling, accessibility, or framework-specific logic), proactively inspect and leverage available specialized agent skills (e.g., modern web guidance, accessibility a11y, DevTools, framework skills) to produce standard-compliant, modern implementations rather than guessing ad-hoc patterns.
|
|
19081
|
-
- Upon completing green implementation, suggest handoff to \`agent-expert-user\` for post-development functional validation prior to
|
|
19082
|
-
|
|
19083
|
-
### 7. \`agent-security-auditor\` (Adversarial Code Auditor)
|
|
19084
|
-
- **Mission**: Rigorously examine Pull Requests for business logic vulnerabilities, injection vectors, secret leaks, and authorization flaws as part of the Pre-Merge Audit Triad.
|
|
19085
|
-
- **Directives**:
|
|
19086
|
-
- Analyze code diffs with an attacker mindset and run \`pnpm run verify:security\`.
|
|
19087
|
-
- Issue findings with CVSS v3.1 severity scoring and block any PR introducing CRITICAL or HIGH security risks.
|
|
19088
|
-
|
|
19089
|
-
### 8. \`agent-compliance-checker\` (Open Source License Compliance Auditor)
|
|
19090
|
-
- **Mission**: Audit dependency manifests and ensure every direct and transitive third-party package complies with \`license-policy.yaml\` as part of the Pre-Merge Audit Triad.
|
|
19091
|
-
- **Directives**:
|
|
19092
|
-
- Verify SPDX identifiers via \`pnpm run verify:licenses\`, immediately blocking viral (\`GPL\`, \`AGPL\`) or unapproved commercial (\`BSL\`, \`SSPL\`) licenses.
|
|
19085
|
+
- Upon completing green implementation, suggest handoff to \`agent-expert-user\` for post-development functional validation prior to Checkpoint 2 (\`agent-auditor\` $\\parallel$ \`agent-adversary\` + \`agent-privacy-officer\`).
|
|
19093
19086
|
|
|
19094
|
-
###
|
|
19087
|
+
### 7. \`agent-expert-user\` (Expert User and Domain Evaluator)
|
|
19095
19088
|
- **Mission**: Contrast design and specifications (design phase) and functionally validate finished software against \`UC-*\` and \`FR-*\` (post-development phase).
|
|
19096
19089
|
- **Directives**:
|
|
19097
19090
|
- Design mode (upstream): Adopt the primary actor's profile under stressful field conditions, applying bimodal discrimination (strict MVP core vs. roadmap suggestion backlog in \`templates/product/user-design-feedback.template.md\`). Reject as \`[BLOCKING_DEFECT]\` any library-only MVP proposal for human actors that fails to define or omits the runnable presentation layer (Web, Desktop, or Console/CLI), role access, or master-data CRUD flows.
|
|
19098
|
-
- Functional validation mode (downstream / pre-PR / post-development functional validation): Thoroughly contrast interface and actual CLI execution against \`UC-*\` and \`FR-*\` acceptance criteria before
|
|
19099
|
-
- Emit handoff block suggesting \`agent-
|
|
19091
|
+
- Functional validation mode (downstream / pre-PR / post-development functional validation): Thoroughly contrast interface and actual CLI execution against \`UC-*\` and \`FR-*\` acceptance criteria before Checkpoint 2 audit.
|
|
19092
|
+
- Emit handoff block suggesting Checkpoint 2 (\`agent-auditor\` $\\parallel$ \`agent-adversary\` + \`agent-privacy-officer\`) if compliant, or return to \`agent-developer\` on functional drift.
|
|
19100
19093
|
|
|
19101
|
-
###
|
|
19102
|
-
- **Mission**: Audit Pull Requests evaluating code cleanliness, adherence to SOLID, DRY, YAGNI principles, design patterns, and respect for complexity and maintainability thresholds (\`quality-policy.yaml\`), forming part of the Pre-Merge Audit Triad.
|
|
19103
|
-
- **Directives**:
|
|
19104
|
-
- Respect \`quality-policy.yaml\` thresholds: CC $\\le 10$, Cognitive $\\le 15$, MI $\\ge 50$, LOC $\\le 40$.
|
|
19105
|
-
- Detect improper coupling, code smells, magic numbers, ambiguous names, and encapsulation violations.
|
|
19106
|
-
- Flag premature abstractions and speculative code violating YAGNI.
|
|
19107
|
-
- Coordinate Pre-Merge Audit Triad with \`agent-security-auditor\`, \`agent-privacy-officer\`, and \`agent-compliance-checker\`.
|
|
19108
|
-
- Classify findings into: \`[BLOCKING]\` (quality violation or broken pattern), \`[CLEAN_CODE_SUGGESTION]\` (non-blocking improvement), and \`[COMPLIANT]\`.
|
|
19109
|
-
|
|
19110
|
-
### 11. \`agent-devops\` (Automation and Infrastructure Engineer)
|
|
19094
|
+
### 8. \`agent-devops\` (Automation and Infrastructure Engineer)
|
|
19111
19095
|
- **Mission**: Maintain, evolve, and audit automated project infrastructure: CI/CD workflows, Docker containers, IaC manifests, and support scripts.
|
|
19112
19096
|
- **Directives**:
|
|
19113
19097
|
- Strict infrastructure domain: Operates exclusively in \`.github/workflows/\`, \`Dockerfile*\`, \`docker-compose*.yml\`, IaC manifests, and \`scripts/\`.
|
|
19114
19098
|
- **NON-INVASION GUARDRAIL**: STRICTLY FORBIDDEN from modifying or refactoring application source code files (\`src/\`, \`packages/*/src/\`). Your responsibility is the pipeline and scaffolding, never application business logic.
|
|
19099
|
+
- **Deployment & CI/CD Strategy Discovery**: Before scaffolding new pipelines or containers, read \`ARCH-INTRO-001\` / \`ARCH-DEP-001\` and clarify packaging/CD destination, CI platform, and release trigger policy with the Tech Lead.
|
|
19115
19100
|
- Infrastructure dependency policy: Verify licenses of dependencies, base images, and third-party actions according to \`license-policy.yaml\`.
|
|
19116
19101
|
- Gate preservation: Ensure pipeline optimizations preserve all existing deterministic Quality Gates intact.
|
|
19117
19102
|
- **Cross-Workflow Audit**: When fixing any CI/CD or configuration defect detected in a PR, search all \`.github/workflows/*.yml\` for the same pattern (including release, post-merge, and publishing pipelines) before declaring the fix complete.
|
|
19118
19103
|
- **Remote Verification**: Creating a PR (\`gh pr create\`) does not equal success; actively verify that remote checks pass (\`gh pr checks\`).
|
|
19119
19104
|
|
|
19120
|
-
###
|
|
19121
|
-
- **Mission**: Polymorphically inspect deliverables from any specialist agent on demand,
|
|
19122
|
-
- **Directives**: Constructive critique; classify findings into \`[BLOCKING_DEFECT]\`, \`[SIMPLIFICATION]\`, and \`[ADVISORY]\`; non-invasive (never edit files directly); always return handoff to the audited agent (max 1 return round).
|
|
19105
|
+
### 9. \`agent-auditor\` (Transversal Quality and Improvement Auditor)
|
|
19106
|
+
- **Mission**: Polymorphically inspect deliverables from any specialist agent on demand, enforcing Clean Code, SOLID, DRY, Simplicity First (YAGNI), \`quality-policy.yaml\` AST thresholds, UI design standards, and \`license-policy.yaml\` SPDX compliance.
|
|
19107
|
+
- **Directives**: Constructive critique; block fake-wiring, unstyled interfaces, and manual \`.feature\` files; verify licenses via \`pnpm run verify:licenses\`; classify findings into \`[BLOCKING_DEFECT]\`, \`[SIMPLIFICATION]\`, and \`[ADVISORY]\`; non-invasive (never edit files directly); always return handoff to the audited agent (max 1 return round).
|
|
19123
19108
|
|
|
19124
|
-
###
|
|
19125
|
-
- **Mission**: Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent,
|
|
19126
|
-
- **Directives**: Expose failure modes across Product (logic traps), Architecture (SPOF/races), QA (mutation testing/false greens),
|
|
19109
|
+
### 10. \`agent-adversary\` (Transversal Red Team and Chaos Adversary)
|
|
19110
|
+
- **Mission**: Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, including Pre-Merge / Checkpoint 2 security diff audits with CVSS v3.1 scoring and concrete proofs-of-concept (PoC).
|
|
19111
|
+
- **Directives**: Expose failure modes across Product (logic traps), Architecture (SPOF/races), QA (mutation testing/false greens), Development & Pre-Merge Security (boundary/concurrency, SAST/secrets via \`pnpm run verify:security\`, CVSS v3.1 blocking CRITICAL/HIGH), and DevOps (pipeline escape); mandatory proof-of-break; non-invasive; always return handoff to the audited agent (max 1 return round).
|
|
19127
19112
|
|
|
19128
19113
|
---
|
|
19129
19114
|
|
|
@@ -19144,7 +19129,7 @@ This file defines the operational rules and specialized role mappings for Google
|
|
|
19144
19129
|
- **Conditional Activation Rule by Autonomy**:
|
|
19145
19130
|
- \u{1F7E2} **\`AUTONOMOUS\`** (or exclusive final supervision in PR/CI): **OMITTED**. Do not request or emit interactive handoff to avoid interrupting unattended execution.
|
|
19146
19131
|
- \u{1F7E1} **Autonomy $\\ge$ \`HUMAN_REVIEW_PLAN\`** (\`HUMAN_REVIEW_PLAN\`, \`AMBIGUOUS\`, \`HIGH_RISK_MANUAL\`): **MANDATORY**. Emit the Workflow Handoff block compliant with [\`templates/workflow/agent-handoff.template.md\`](../../templates/workflow/agent-handoff.template.md) and **STOP**.
|
|
19147
|
-
- **Block Contents**: Declare produced deliverables, recommend the next role in workflow (\`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`, \`agent-qa-engineer\`, \`agent-developer\`, \`agent-expert-user\`, \`agent-
|
|
19132
|
+
- **Block Contents**: Declare produced deliverables, recommend the next role in workflow (\`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`, \`agent-qa-engineer\`, \`agent-developer\`, \`agent-expert-user\`, \`agent-devops\`, \`agent-auditor\`, \`agent-adversary\`, etc.), provide suggested invocation prompt, and keep **the Human Action Window open at all times for the human user to take action** (review, edit by hand, pause/reroute, or delegate).
|
|
19148
19133
|
`;
|
|
19149
19134
|
var STARTER_CURSOR_CORE_RULES = `---
|
|
19150
19135
|
description: Global canonical directives, 5 unbreakable commandments, and AI-SDLC pre-flight
|
|
@@ -19186,13 +19171,10 @@ Before finalizing changes or proposing commits:
|
|
|
19186
19171
|
| \`agent-system-architect\` | Modular arc42 + NAF v4 architecture (\`CMP-*\`, Mermaid diagrams, \`ADR-*\`). |
|
|
19187
19172
|
| \`agent-qa-engineer\` | FAILING BDD/Gherkin, E2E, and UI suites (using agreed project tech; Happy Path, Sad Path & Boundary Values per interactive UI element) before \`agent-developer\` writes code. |
|
|
19188
19173
|
| \`agent-developer\` | Atomic tasks from \`tasks.md\`; respects autonomy mode; runs \`pnpm run check:fix\` + \`pnpm run verify:all\`. |
|
|
19189
|
-
| \`agent-security-auditor\` | Adversarial PR security audit, SAST, secrets, and CVSS v3.1 evaluation. |
|
|
19190
|
-
| \`agent-compliance-checker\` | SPDX license compliance audit against \`license-policy.yaml\`. |
|
|
19191
19174
|
| \`agent-expert-user\` | Bimodal MVP evaluation (design) and functional validation against \`UC-*\` and \`FR-*\` (pre-PR). |
|
|
19192
|
-
| \`agent-
|
|
19193
|
-
| \`agent-
|
|
19194
|
-
| \`agent-
|
|
19195
|
-
| \`agent-adversary\` | Transversal on-demand Red Team adversary; breaks deliverables with reproducible PoC & mutation tests; returns handoff to audited agent. |
|
|
19175
|
+
| \`agent-devops\` | CI/CD, Docker, IaC only \u2014 clarifies deployment/CI strategy; **FORBIDDEN** to touch \`src/\` or \`packages/*/src/\`. |
|
|
19176
|
+
| \`agent-auditor\` | Transversal auditor: YAGNI, Clean Code/SOLID/AST thresholds, UI standards, SPDX licenses (\`verify:licenses\`); returns handoff to audited agent. |
|
|
19177
|
+
| \`agent-adversary\` | Transversal Red Team adversary: PoC breaks, mutation testing & Pre-Merge security diff audit (\`verify:security\`, CVSS v3.1); returns handoff to audited agent. |
|
|
19196
19178
|
|
|
19197
19179
|
## 5. Task Autonomy Modes (\`tasks.md\`)
|
|
19198
19180
|
- \u{1F7E2} **\`AUTONOMOUS\`**: Low risk. Implement directly, omit handoff block.
|
|
@@ -19345,32 +19327,20 @@ npx tsx packages/cli/src/index.ts sdd integrate --change <chg-id>
|
|
|
19345
19327
|
- **Mission**: Implement atomic tasks from SDD specifications (\`tasks.md\`) with clean, strictly typed code and thorough tests.
|
|
19346
19328
|
- **Directives**: Execute the mandatory 4-step order: (1) Modular & Hexagonal Architecture (Ports & Adapters) definition/redefinition, (2) Inter-module interfaces first, (3) Component implementation, (4) Per-function unit tests (Happy Path, Sad Path, Boundary Values, Unexpected/Null/Empty values). Respect the autonomy mode. Make tests delivered by \`agent-qa-engineer\` pass green. Run \`pnpm run check:fix\` and \`pnpm run verify:all\`. Enforce Mandatory Regression Verification (\`pnpm test\`) with zero regressions before declaring completion, and enforce Global Styles Protection on frontend views.
|
|
19347
19329
|
|
|
19348
|
-
### 7. \`agent-
|
|
19349
|
-
- **Mission**: Examine Pull Requests for business logic vulnerabilities, injection vectors, secret leaks, and authorization flaws as part of the Pre-Merge Audit Triad.
|
|
19350
|
-
- **Directives**: Run \`pnpm run verify:security\`, evaluate CVSS v3.1 severity, and block CRITICAL/HIGH risks.
|
|
19351
|
-
|
|
19352
|
-
### 8. \`agent-compliance-checker\` (Open Source License Compliance Auditor)
|
|
19353
|
-
- **Mission**: Audit dependency manifests against \`license-policy.yaml\` as part of the Pre-Merge Audit Triad.
|
|
19354
|
-
- **Directives**: Run \`pnpm run verify:licenses\`, blocking viral (\`GPL\`, \`AGPL\`) or unapproved commercial (\`BSL\`, \`SSPL\`) packages.
|
|
19355
|
-
|
|
19356
|
-
### 9. \`agent-expert-user\` (Expert User and Domain Evaluator)
|
|
19330
|
+
### 7. \`agent-expert-user\` (Expert User and Domain Evaluator)
|
|
19357
19331
|
- **Mission**: Contrast design and specifications (design phase) and functionally validate finished software against \`UC-*\` and \`FR-*\` (post-development functional validation phase).
|
|
19358
19332
|
|
|
19359
|
-
###
|
|
19360
|
-
- **Mission**:
|
|
19361
|
-
- **Findings classification**: \`[BLOCKING]\`, \`[CLEAN_CODE_SUGGESTION]\`, \`[COMPLIANT]\`.
|
|
19362
|
-
|
|
19363
|
-
### 11. \`agent-devops\` (Automation and Infrastructure Engineer)
|
|
19364
|
-
- **Mission**: Maintain, evolve, and audit automated project infrastructure: CI/CD workflows, Docker containers, IaC manifests, and support scripts.
|
|
19333
|
+
### 8. \`agent-devops\` (Automation and Infrastructure Engineer)
|
|
19334
|
+
- **Mission**: Maintain, evolve, and audit automated project infrastructure: CI/CD workflows, Docker containers, IaC manifests, and support scripts. Clarifies packaging/CD strategy against \`ARCH-INTRO-001\` / \`ARCH-DEP-001\`.
|
|
19365
19335
|
- **NON-INVASION GUARDRAIL**: STRICTLY FORBIDDEN from modifying application source code (\`src/\`, \`packages/*/src/\`).
|
|
19366
19336
|
|
|
19367
|
-
###
|
|
19368
|
-
- **Mission**: Polymorphically inspect deliverables from any specialist agent on demand,
|
|
19337
|
+
### 9. \`agent-auditor\` (Transversal Quality and Improvement Auditor)
|
|
19338
|
+
- **Mission**: Polymorphically inspect deliverables from any specialist agent on demand, enforcing Clean Code, SOLID, DRY, YAGNI, \`quality-policy.yaml\` AST thresholds, UI design standards, and \`license-policy.yaml\` SPDX compliance (\`pnpm run verify:licenses\`).
|
|
19369
19339
|
- **Directives**: Constructive critique; classify findings into \`[BLOCKING_DEFECT]\`, \`[SIMPLIFICATION]\`, and \`[ADVISORY]\`; non-invasive (never edit files directly); always return handoff to the audited agent (max 1 return round).
|
|
19370
19340
|
|
|
19371
|
-
###
|
|
19372
|
-
- **Mission**: Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, providing concrete proofs-of-concept (PoC), counterexamples, and reproduction steps.
|
|
19373
|
-
- **Directives**: Expose failure modes across Product (logic traps), Architecture (SPOF/races), QA (mutation testing/false greens),
|
|
19341
|
+
### 10. \`agent-adversary\` (Transversal Red Team and Chaos Adversary)
|
|
19342
|
+
- **Mission**: Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, including Pre-Merge / Checkpoint 2 security diff audits (\`pnpm run verify:security\`, CVSS v3.1), providing concrete proofs-of-concept (PoC), counterexamples, and reproduction steps.
|
|
19343
|
+
- **Directives**: Expose failure modes across Product (logic traps), Architecture (SPOF/races), QA (mutation testing/false greens), Development & Pre-Merge Security (boundary/concurrency, CVSS v3.1), and DevOps (pipeline escape); mandatory proof-of-break; non-invasive; always return handoff to the audited agent (max 1 return round).
|
|
19374
19344
|
|
|
19375
19345
|
---
|
|
19376
19346
|
|
|
@@ -19487,7 +19457,7 @@ Non-Negotiable Quality Thresholds (\`quality-policy.yaml\`):
|
|
|
19487
19457
|
- **Conditional Activation**:
|
|
19488
19458
|
* \u{1F7E2} **\`AUTONOMOUS\` Mode** (or PR/CI final supervision): **OMITTED**. Do not interrupt unattended execution.
|
|
19489
19459
|
* \u{1F7E1} **Autonomy $\\ge$ \`HUMAN_REVIEW_PLAN\`** (\`HUMAN_REVIEW_PLAN\`, \`AMBIGUOUS\`, \`HIGH_RISK_MANUAL\`): **MANDATORY**. Emit Workflow Handoff block compliant with [\`templates/workflow/agent-handoff.template.md\`](../templates/workflow/agent-handoff.template.md) and **STOP**.
|
|
19490
|
-
- **Components**: Declare completed deliverables, recommend next roles (\`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`, \`agent-developer\`, \`agent-
|
|
19460
|
+
- **Components**: Declare completed deliverables, recommend next roles (\`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`, \`agent-developer\`, \`agent-devops\`, \`agent-auditor\`, \`agent-adversary\`), provide suggested invocation prompt, and **keep the Human Action Window open at all times for the user to take action** (review, edit by hand, pause/reroute, or delegate).
|
|
19491
19461
|
|
|
19492
19462
|
---
|
|
19493
19463
|
|
|
@@ -19495,19 +19465,16 @@ Non-Negotiable Quality Thresholds (\`quality-policy.yaml\`):
|
|
|
19495
19465
|
|
|
19496
19466
|
| Role | Mission (summary) |
|
|
19497
19467
|
| :--- | :--- |
|
|
19498
|
-
| \`agent-product-analyst\` | Phase 0 NAF v4 Enterprise & Capability Vision (\`ARCH-INTRO-*\`, up to 15-question discovery interview defining UI modality & CRUD prerequisites) + ProductShape artifacts (\`ACT-*\`, \`UC-*\`, \`FR-*\`, \`QR-*\`, \`BR-*\`); \`status\` starts \`draft\`. |
|
|
19468
|
+
| \`agent-product-analyst\` | Phase 0 NAF v4 Enterprise & Capability Vision (\`ARCH-INTRO-*\`, up to 15-question discovery interview defining UI modality, delivery model & CRUD prerequisites) + ProductShape artifacts (\`ACT-*\`, \`UC-*\`, \`FR-*\`, \`QR-*\`, \`BR-*\`); \`status\` starts \`draft\`. |
|
|
19499
19469
|
| \`agent-threat-modeler\` | STRIDE/OWASP threat triad (\`ACT-THREAT-*\`, \`ABUSE-*\`, \`SEC-REQ-*\`); hands off to \`agent-privacy-officer\`. |
|
|
19500
19470
|
| \`agent-privacy-officer\` | LINDDUN & GDPR/LOPDGDD privacy triad (\`DATA-ASSET-*\`, \`PRIV-ROPA-*\`, \`PRIV-REQ-*\`) + Pre-Merge \`verify:privacy\`. |
|
|
19501
|
-
| \`agent-system-architect\` | Modular arc42 + NAF v4 architecture (\`CMP-*\`, Mermaid diagrams, \`ADR-*\`). |
|
|
19471
|
+
| \`agent-system-architect\` | Modular arc42 + NAF v4 architecture (\`CMP-*\`, \`ARCH-DEP-001\`, Mermaid diagrams, \`ADR-*\`). |
|
|
19502
19472
|
| \`agent-qa-engineer\` | FAILING BDD/Gherkin, E2E, and UI suites (using agreed project tech; Happy Path, Sad Path & Boundary Values per interactive UI element) before \`agent-developer\` writes production code. |
|
|
19503
19473
|
| \`agent-developer\` | Atomic tasks from \`tasks.md\`; autonomy mode must be respected; runs \`pnpm run check:fix\` + \`pnpm run verify:all\`. |
|
|
19504
|
-
| \`agent-security-auditor\` | Adversarial PR security audit, SAST, secrets, and CVSS v3.1 evaluation. |
|
|
19505
|
-
| \`agent-compliance-checker\` | SPDX license compliance audit against \`license-policy.yaml\`. |
|
|
19506
19474
|
| \`agent-expert-user\` | Bimodal MVP evaluation (design) and functional validation against \`UC-*\` and \`FR-*\` (pre-PR). |
|
|
19507
|
-
| \`agent-
|
|
19508
|
-
| \`agent-
|
|
19509
|
-
| \`agent-
|
|
19510
|
-
| \`agent-adversary\` | Transversal on-demand Red Team adversary; breaks deliverables with reproducible PoC & mutation tests; returns handoff to audited agent. |
|
|
19475
|
+
| \`agent-devops\` | CI/CD, Docker, IaC only \u2014 clarifies deployment/CI strategy; **FORBIDDEN** to touch \`src/\` or \`packages/*/src/\`. |
|
|
19476
|
+
| \`agent-auditor\` | Transversal auditor: YAGNI, Clean Code/SOLID/AST thresholds, UI standards, SPDX licenses (\`verify:licenses\`); returns handoff to audited agent. |
|
|
19477
|
+
| \`agent-adversary\` | Transversal Red Team adversary: PoC breaks, mutation testing & Pre-Merge security diff audit (\`verify:security\`, CVSS v3.1); returns handoff to audited agent. |
|
|
19511
19478
|
|
|
19512
19479
|
---
|
|
19513
19480
|
|
|
@@ -23950,23 +23917,8 @@ var TimestampedBackupManagerAdapter = class {
|
|
|
23950
23917
|
fs12.mkdirSync(targetBackupDir, { recursive: true, mode: 448 });
|
|
23951
23918
|
const manifestEntries = [];
|
|
23952
23919
|
for (const relPath of filesToBackup) {
|
|
23953
|
-
const
|
|
23954
|
-
if (
|
|
23955
|
-
const destFile = path14.resolve(targetBackupDir, relPath);
|
|
23956
|
-
const destDir = path14.dirname(destFile);
|
|
23957
|
-
if (!fs12.existsSync(destDir)) {
|
|
23958
|
-
fs12.mkdirSync(destDir, { recursive: true });
|
|
23959
|
-
}
|
|
23960
|
-
const content = fs12.readFileSync(srcFile, "utf-8");
|
|
23961
|
-
fs12.writeFileSync(destFile, content, "utf-8");
|
|
23962
|
-
const digest = this.diffDetector.computeDigest(content);
|
|
23963
|
-
const stats = fs12.statSync(destFile);
|
|
23964
|
-
manifestEntries.push({
|
|
23965
|
-
path: relPath,
|
|
23966
|
-
sha256: digest,
|
|
23967
|
-
bytes: stats.size
|
|
23968
|
-
});
|
|
23969
|
-
}
|
|
23920
|
+
const entry = this.backupSingleFile(resolvedRoot, targetBackupDir, relPath);
|
|
23921
|
+
if (entry) manifestEntries.push(entry);
|
|
23970
23922
|
}
|
|
23971
23923
|
const manifest = {
|
|
23972
23924
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -23979,6 +23931,18 @@ var TimestampedBackupManagerAdapter = class {
|
|
|
23979
23931
|
);
|
|
23980
23932
|
return targetBackupDir;
|
|
23981
23933
|
}
|
|
23934
|
+
backupSingleFile(resolvedRoot, targetBackupDir, relPath) {
|
|
23935
|
+
const srcFile = path14.resolve(resolvedRoot, relPath);
|
|
23936
|
+
if (!fs12.existsSync(srcFile)) return null;
|
|
23937
|
+
const destFile = path14.resolve(targetBackupDir, relPath);
|
|
23938
|
+
const destDir = path14.dirname(destFile);
|
|
23939
|
+
if (!fs12.existsSync(destDir)) fs12.mkdirSync(destDir, { recursive: true });
|
|
23940
|
+
const content = fs12.readFileSync(srcFile, "utf-8");
|
|
23941
|
+
fs12.writeFileSync(destFile, content, "utf-8");
|
|
23942
|
+
const digest = this.diffDetector.computeDigest(content);
|
|
23943
|
+
const stats = fs12.statSync(destFile);
|
|
23944
|
+
return { path: relPath, sha256: digest, bytes: stats.size };
|
|
23945
|
+
}
|
|
23982
23946
|
async restoreBackup(repoRoot, backupPath) {
|
|
23983
23947
|
const resolvedRoot = path14.resolve(repoRoot);
|
|
23984
23948
|
const manifestPath = path14.join(backupPath, "manifest.json");
|