@aisdlc/core 3.2.0 → 3.3.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 +1041 -196
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +74 -6
- package/dist/index.d.ts +74 -6
- package/dist/index.js +1017 -197
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5057,6 +5057,256 @@ function emitCiOutput(key, value, env = process.env) {
|
|
|
5057
5057
|
writeEnvOutputFile(envOutputFile, key, value);
|
|
5058
5058
|
}
|
|
5059
5059
|
}
|
|
5060
|
+
var DEFAULT_DLP_RULES = [
|
|
5061
|
+
{
|
|
5062
|
+
id: "DLP-001-PRIVATE-KEY",
|
|
5063
|
+
description: "PEM / RSA / EC / OPENSSH Private Key Block",
|
|
5064
|
+
pattern: "-----BEGIN (?:[A-Z0-9_-]+ )?PRIVATE KEY-----[\\s\\S]*?-----END (?:[A-Z0-9_-]+ )?PRIVATE KEY-----",
|
|
5065
|
+
replacement: "[REDACTED:PRIVATE_KEY]",
|
|
5066
|
+
enabled: true
|
|
5067
|
+
},
|
|
5068
|
+
{
|
|
5069
|
+
id: "DLP-002-API-TOKEN",
|
|
5070
|
+
description: "Cloud, GitHub, Slack, OpenAI, Stripe, and AWS Access Tokens",
|
|
5071
|
+
pattern: "\\b(?:gh[pousr]_[A-Za-z0-9_]{36,255}|github_pat_[0-9a-zA-Z_]{82}|sk-(?:proj-|live-)?[a-zA-Z0-9_-]{32,}|AKIA[0-9A-Z]{16}|xox[baprs]-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*|(?:sk|rk)_(?:live|test)_[0-9a-zA-Z]{24,99})\\b",
|
|
5072
|
+
replacement: "[REDACTED:API_TOKEN]",
|
|
5073
|
+
enabled: true
|
|
5074
|
+
},
|
|
5075
|
+
{
|
|
5076
|
+
id: "DLP-003-JWT",
|
|
5077
|
+
description: "Plaintext JSON Web Token (JWT)",
|
|
5078
|
+
pattern: "\\beyJ[A-Za-z0-9_-]{10,}\\.eyJ[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,}\\b",
|
|
5079
|
+
replacement: "[REDACTED:JWT_TOKEN]",
|
|
5080
|
+
enabled: true
|
|
5081
|
+
},
|
|
5082
|
+
{
|
|
5083
|
+
id: "DLP-004-CREDIT-CARD",
|
|
5084
|
+
description: "Payment Card Number (13-19 digits formatted)",
|
|
5085
|
+
pattern: "\\b(?:\\d{4}[- ]\\d{4}[- ]\\d{4}[- ]\\d{4}|\\d{16})\\b",
|
|
5086
|
+
replacement: "[REDACTED:CREDIT_CARD]",
|
|
5087
|
+
enabled: true
|
|
5088
|
+
},
|
|
5089
|
+
{
|
|
5090
|
+
id: "DLP-005-EMAIL",
|
|
5091
|
+
description: "Personal or Corporate Email Address",
|
|
5092
|
+
pattern: "\\b[A-Za-z0-9._%+-]+@(?!example\\.com|localhost|test\\.local)[A-Za-z0-9.-]+\\.[A-Za-z]{2,}\\b",
|
|
5093
|
+
replacement: "[REDACTED:EMAIL]",
|
|
5094
|
+
enabled: true
|
|
5095
|
+
},
|
|
5096
|
+
{
|
|
5097
|
+
id: "DLP-006-INTERNAL-URL",
|
|
5098
|
+
description: "Internal Intranet / Corp Service URL",
|
|
5099
|
+
pattern: "https?://(?:[A-Za-z0-9._-]+:[A-Za-z0-9._-]+@|[A-Za-z0-9.-]+\\.(?:internal|corp|intranet|local)\\b)[^\\s\"'`<>]*",
|
|
5100
|
+
replacement: "[REDACTED:INTERNAL_URL]",
|
|
5101
|
+
enabled: true
|
|
5102
|
+
}
|
|
5103
|
+
];
|
|
5104
|
+
function createDefaultDlpPolicy() {
|
|
5105
|
+
return {
|
|
5106
|
+
version: "1.0",
|
|
5107
|
+
enabled: true,
|
|
5108
|
+
zero_data_retention_required: true,
|
|
5109
|
+
rules: [...DEFAULT_DLP_RULES]
|
|
5110
|
+
};
|
|
5111
|
+
}
|
|
5112
|
+
function normalizeParsedRule(raw, idx) {
|
|
5113
|
+
if (typeof raw.pattern !== "string" || !raw.pattern) return null;
|
|
5114
|
+
return {
|
|
5115
|
+
id: typeof raw.id === "string" ? raw.id : `DLP-CUSTOM-${idx + 1}`,
|
|
5116
|
+
description: typeof raw.description === "string" ? raw.description : "Custom DLP rule",
|
|
5117
|
+
pattern: raw.pattern,
|
|
5118
|
+
replacement: typeof raw.replacement === "string" ? raw.replacement : "[REDACTED]",
|
|
5119
|
+
enabled: raw.enabled !== false
|
|
5120
|
+
};
|
|
5121
|
+
}
|
|
5122
|
+
function parseDlpDoc(yamlContent) {
|
|
5123
|
+
let doc;
|
|
5124
|
+
try {
|
|
5125
|
+
doc = yaml3.load(yamlContent);
|
|
5126
|
+
} catch (err) {
|
|
5127
|
+
throw new Error(`[AI-SDLC Fail-Closed] Invalid YAML in dlp-policy: ${err instanceof Error ? err.message : String(err)}`);
|
|
5128
|
+
}
|
|
5129
|
+
if (!doc || typeof doc !== "object" || Array.isArray(doc)) {
|
|
5130
|
+
throw new Error(`[AI-SDLC Fail-Closed] Invalid dlp-policy structure: root must be a YAML mapping`);
|
|
5131
|
+
}
|
|
5132
|
+
const record = doc;
|
|
5133
|
+
if (record.rules !== void 0 && !Array.isArray(record.rules)) {
|
|
5134
|
+
throw new Error(`[AI-SDLC Fail-Closed] Invalid dlp-policy: rules must be an array`);
|
|
5135
|
+
}
|
|
5136
|
+
return record;
|
|
5137
|
+
}
|
|
5138
|
+
function parseDlpPolicy(yamlContent) {
|
|
5139
|
+
const fallback = createDefaultDlpPolicy();
|
|
5140
|
+
if (!yamlContent || !yamlContent.trim()) return fallback;
|
|
5141
|
+
const record = parseDlpDoc(yamlContent);
|
|
5142
|
+
const rawRules = Array.isArray(record.rules) ? record.rules : [];
|
|
5143
|
+
const parsedRules = rawRules.map((r, i) => normalizeParsedRule(r, i)).filter((r) => r !== null);
|
|
5144
|
+
return {
|
|
5145
|
+
version: typeof record.version === "string" ? record.version : "1.0",
|
|
5146
|
+
enabled: record.enabled !== false,
|
|
5147
|
+
zero_data_retention_required: Boolean(record.zero_data_retention_required ?? true),
|
|
5148
|
+
rules: parsedRules.length > 0 ? parsedRules : fallback.rules
|
|
5149
|
+
};
|
|
5150
|
+
}
|
|
5151
|
+
function loadDlpPolicy(rootDir, customPolicyPath) {
|
|
5152
|
+
const base = rootDir || process.cwd();
|
|
5153
|
+
const filePath = customPolicyPath ? path5.isAbsolute(customPolicyPath) ? customPolicyPath : path5.join(base, customPolicyPath) : path5.join(base, "dlp-policy.yaml");
|
|
5154
|
+
if (!fs8.existsSync(filePath)) return createDefaultDlpPolicy();
|
|
5155
|
+
return parseDlpPolicy(fs8.readFileSync(filePath, "utf-8"));
|
|
5156
|
+
}
|
|
5157
|
+
function applySingleDlpRule(text, rule) {
|
|
5158
|
+
if (rule.enabled === false) return { output: text, matches: 0 };
|
|
5159
|
+
try {
|
|
5160
|
+
const regex = new RegExp(rule.pattern, "g");
|
|
5161
|
+
let matches = 0;
|
|
5162
|
+
const output = text.replace(regex, () => {
|
|
5163
|
+
matches++;
|
|
5164
|
+
return rule.replacement;
|
|
5165
|
+
});
|
|
5166
|
+
return { output, matches };
|
|
5167
|
+
} catch {
|
|
5168
|
+
return { output: text, matches: 0 };
|
|
5169
|
+
}
|
|
5170
|
+
}
|
|
5171
|
+
function sanitizeDlpText(text, policy = createDefaultDlpPolicy()) {
|
|
5172
|
+
if (!policy.enabled || !text) {
|
|
5173
|
+
return { sanitizedText: text, redactionCount: 0, triggeredRuleIds: [] };
|
|
5174
|
+
}
|
|
5175
|
+
let current = text;
|
|
5176
|
+
let totalRedactions = 0;
|
|
5177
|
+
const triggered = [];
|
|
5178
|
+
for (const rule of policy.rules) {
|
|
5179
|
+
const res = applySingleDlpRule(current, rule);
|
|
5180
|
+
if (res.matches > 0) {
|
|
5181
|
+
current = res.output;
|
|
5182
|
+
totalRedactions += res.matches;
|
|
5183
|
+
triggered.push(rule.id);
|
|
5184
|
+
}
|
|
5185
|
+
}
|
|
5186
|
+
return {
|
|
5187
|
+
sanitizedText: current,
|
|
5188
|
+
redactionCount: totalRedactions,
|
|
5189
|
+
triggeredRuleIds: triggered
|
|
5190
|
+
};
|
|
5191
|
+
}
|
|
5192
|
+
function sanitizeDlpPayload(payload, policy = createDefaultDlpPolicy()) {
|
|
5193
|
+
if (!policy.enabled || payload === null || payload === void 0) return payload;
|
|
5194
|
+
if (typeof payload === "string") {
|
|
5195
|
+
return sanitizeDlpText(payload, policy).sanitizedText;
|
|
5196
|
+
}
|
|
5197
|
+
const serialized = JSON.stringify(payload);
|
|
5198
|
+
const { sanitizedText } = sanitizeDlpText(serialized, policy);
|
|
5199
|
+
try {
|
|
5200
|
+
return JSON.parse(sanitizedText);
|
|
5201
|
+
} catch {
|
|
5202
|
+
return payload;
|
|
5203
|
+
}
|
|
5204
|
+
}
|
|
5205
|
+
|
|
5206
|
+
// src/adapters/sdd/review-report.ts
|
|
5207
|
+
var REVIEW_VERDICTS = ["COMPLIANT", "SUGGESTIONS", "BLOCKING"];
|
|
5208
|
+
var REVIEWER_ROLES = [
|
|
5209
|
+
"agent-code-reviewer",
|
|
5210
|
+
"agent-security-auditor",
|
|
5211
|
+
"agent-compliance-checker",
|
|
5212
|
+
"agent-privacy-officer",
|
|
5213
|
+
"agent-expert-user",
|
|
5214
|
+
"auditor",
|
|
5215
|
+
"reviewer"
|
|
5216
|
+
];
|
|
5217
|
+
function isReviewerRole(role) {
|
|
5218
|
+
if (!role || typeof role !== "string") return false;
|
|
5219
|
+
const normalized = role.toLowerCase().trim();
|
|
5220
|
+
return REVIEWER_ROLES.includes(normalized);
|
|
5221
|
+
}
|
|
5222
|
+
function validateChangeId(changeId, rootDir) {
|
|
5223
|
+
if (!changeId || typeof changeId !== "string") {
|
|
5224
|
+
return { ok: false, error: "Missing changeId for review report submission" };
|
|
5225
|
+
}
|
|
5226
|
+
const rawChange = changeId.trim();
|
|
5227
|
+
if (rawChange.includes("..") || rawChange.includes("/") || rawChange.includes("\\") || !/^[a-zA-Z0-9_\-.]+$/.test(rawChange)) {
|
|
5228
|
+
return { ok: false, error: `Invalid changeId: path traversal or invalid characters detected '${rawChange}'` };
|
|
5229
|
+
}
|
|
5230
|
+
const activeChangeDir = path5.join(rootDir, "specs", "changes", "active", rawChange);
|
|
5231
|
+
if (!fs8.existsSync(activeChangeDir)) {
|
|
5232
|
+
return { ok: false, error: `Active change not found in specs/changes/active: '${rawChange}'` };
|
|
5233
|
+
}
|
|
5234
|
+
return { ok: true, changeDir: activeChangeDir, rawChange };
|
|
5235
|
+
}
|
|
5236
|
+
function validateReviewer(reviewer) {
|
|
5237
|
+
if (!reviewer || typeof reviewer !== "string") {
|
|
5238
|
+
return { ok: false, error: "Reviewer role is required" };
|
|
5239
|
+
}
|
|
5240
|
+
const rawReviewer = reviewer.trim().toLowerCase();
|
|
5241
|
+
if (rawReviewer.includes("..") || rawReviewer.includes("/") || rawReviewer.includes("\\")) {
|
|
5242
|
+
return { ok: false, error: `Invalid reviewer name: path traversal detected '${rawReviewer}'` };
|
|
5243
|
+
}
|
|
5244
|
+
if (!isReviewerRole(rawReviewer)) {
|
|
5245
|
+
return {
|
|
5246
|
+
ok: false,
|
|
5247
|
+
error: `Role '${reviewer}' is not an authorized reviewer role. Authorized roles: ${REVIEWER_ROLES.join(", ")}`
|
|
5248
|
+
};
|
|
5249
|
+
}
|
|
5250
|
+
return { ok: true, rawReviewer };
|
|
5251
|
+
}
|
|
5252
|
+
function validateVerdictAndBody(verdict, body) {
|
|
5253
|
+
if (!verdict || !REVIEW_VERDICTS.includes(verdict)) {
|
|
5254
|
+
return {
|
|
5255
|
+
ok: false,
|
|
5256
|
+
error: `Invalid verdict '${verdict}'. Allowed verdicts: ${REVIEW_VERDICTS.join(", ")}`
|
|
5257
|
+
};
|
|
5258
|
+
}
|
|
5259
|
+
if (!body || typeof body !== "string" || !body.trim()) {
|
|
5260
|
+
return { ok: false, error: "Review report body cannot be empty" };
|
|
5261
|
+
}
|
|
5262
|
+
return { ok: true };
|
|
5263
|
+
}
|
|
5264
|
+
function buildReportMarkdown(change, reviewer, verdict, body, date) {
|
|
5265
|
+
return [
|
|
5266
|
+
`# Review Report: ${reviewer}`,
|
|
5267
|
+
"",
|
|
5268
|
+
`- change: ${change}`,
|
|
5269
|
+
`- reviewer: ${reviewer}`,
|
|
5270
|
+
`- verdict: ${verdict}`,
|
|
5271
|
+
`- date: ${date}`,
|
|
5272
|
+
"",
|
|
5273
|
+
"## Findings",
|
|
5274
|
+
"",
|
|
5275
|
+
body,
|
|
5276
|
+
""
|
|
5277
|
+
].join("\n");
|
|
5278
|
+
}
|
|
5279
|
+
function persistReportFile(changeDir, rawReviewer, content) {
|
|
5280
|
+
const reviewsDir = path5.join(changeDir, "reviews");
|
|
5281
|
+
if (!fs8.existsSync(reviewsDir)) {
|
|
5282
|
+
fs8.mkdirSync(reviewsDir, { recursive: true });
|
|
5283
|
+
}
|
|
5284
|
+
const reportFileName = `${rawReviewer}.md`;
|
|
5285
|
+
fs8.writeFileSync(path5.join(reviewsDir, reportFileName), content, "utf-8");
|
|
5286
|
+
return crypto3.createHash("sha256").update(content.replace(/\r\n/g, "\n")).digest("hex");
|
|
5287
|
+
}
|
|
5288
|
+
function submitReviewReport(options) {
|
|
5289
|
+
const root = options.rootDir || process.cwd();
|
|
5290
|
+
const changeCheck = validateChangeId(options.changeId, root);
|
|
5291
|
+
if (!changeCheck.ok) return { success: false, error: changeCheck.error };
|
|
5292
|
+
const reviewerCheck = validateReviewer(options.reviewer);
|
|
5293
|
+
if (!reviewerCheck.ok) return { success: false, error: reviewerCheck.error };
|
|
5294
|
+
const contentCheck = validateVerdictAndBody(options.verdict, options.body);
|
|
5295
|
+
if (!contentCheck.ok) return { success: false, error: contentCheck.error };
|
|
5296
|
+
const rawChange = changeCheck.rawChange;
|
|
5297
|
+
const rawReviewer = reviewerCheck.rawReviewer;
|
|
5298
|
+
const dlpPolicy = loadDlpPolicy(root);
|
|
5299
|
+
const sanitizedBody = sanitizeDlpText(options.body.trim(), dlpPolicy).sanitizedText;
|
|
5300
|
+
const date = options.date || (/* @__PURE__ */ new Date()).toISOString();
|
|
5301
|
+
const reportContent = buildReportMarkdown(rawChange, rawReviewer, options.verdict, sanitizedBody, date);
|
|
5302
|
+
const digest = persistReportFile(changeCheck.changeDir, rawReviewer, reportContent);
|
|
5303
|
+
return {
|
|
5304
|
+
success: true,
|
|
5305
|
+
reportPath: `specs/changes/active/${rawChange}/reviews/${rawReviewer}.md`,
|
|
5306
|
+
digest,
|
|
5307
|
+
verdict: options.verdict
|
|
5308
|
+
};
|
|
5309
|
+
}
|
|
5060
5310
|
|
|
5061
5311
|
// src/adapters/sdd/index.ts
|
|
5062
5312
|
function getSddAdapter(framework) {
|
|
@@ -7358,6 +7608,46 @@ function verifyLicenses(options = {}) {
|
|
|
7358
7608
|
const reportMarkdown = generateLicenseReportMarkdown(dependencies, violations, policy, artifacts.sbomPath);
|
|
7359
7609
|
return assembleDynamicLicenseResult(dependencies, permittedCount, violations, reportMarkdown, artifacts, vulnData);
|
|
7360
7610
|
}
|
|
7611
|
+
var IGNORED_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "bin", "obj", "dist", "build", "target", "reports", "templates"]);
|
|
7612
|
+
var MSBUILD_WEAKENING = [
|
|
7613
|
+
/<TreatWarningsAsErrors>\s*false\s*<\/TreatWarningsAsErrors>/i,
|
|
7614
|
+
/<Nullable>\s*disable\s*<\/Nullable>/i,
|
|
7615
|
+
/<RunAnalyzers>\s*false\s*<\/RunAnalyzers>/i
|
|
7616
|
+
];
|
|
7617
|
+
var TSCONFIG_WEAKENING = [/"strict"\s*:\s*false/, /"noImplicitAny"\s*:\s*false/, /"strictNullChecks"\s*:\s*false/];
|
|
7618
|
+
function walkFiles(dir, rootDir, out) {
|
|
7619
|
+
for (const entry of fs8.readdirSync(dir, { withFileTypes: true })) {
|
|
7620
|
+
if (entry.isDirectory() && !IGNORED_DIRS.has(entry.name)) walkFiles(path5.join(dir, entry.name), rootDir, out);
|
|
7621
|
+
else if (entry.isFile()) out.push(path5.relative(rootDir, path5.join(dir, entry.name)).replace(/\\/g, "/"));
|
|
7622
|
+
}
|
|
7623
|
+
return out;
|
|
7624
|
+
}
|
|
7625
|
+
function matchWeakening(rel, content, patterns) {
|
|
7626
|
+
return patterns.filter((p) => p.test(content)).map((p) => `[CODING-RULES-BYPASS] '${rel}' weakens the strict coding rules (${p.source}).`);
|
|
7627
|
+
}
|
|
7628
|
+
function checkMsBuildFile(rel, content) {
|
|
7629
|
+
const issues = matchWeakening(rel, content, MSBUILD_WEAKENING);
|
|
7630
|
+
const isNestedBuildProps = /(^|\/)Directory\.Build\.props$/.test(rel) && rel !== "Directory.Build.props";
|
|
7631
|
+
if (isNestedBuildProps && !content.includes("GetPathOfFileAbove")) {
|
|
7632
|
+
issues.push(`[CODING-RULES-BYPASS] Nested '${rel}' does not import the parent Directory.Build.props (GetPathOfFileAbove), silently dropping root rules.`);
|
|
7633
|
+
}
|
|
7634
|
+
return issues;
|
|
7635
|
+
}
|
|
7636
|
+
function checkFile(rel, content, hasDotnetRules, hasTsRules) {
|
|
7637
|
+
if (hasDotnetRules && /\.(csproj|props|targets)$/.test(rel)) return checkMsBuildFile(rel, content);
|
|
7638
|
+
if (hasTsRules && /(^|\/)tsconfig[^/]*\.json$/.test(rel) && !rel.endsWith("tsconfig.strict.json")) {
|
|
7639
|
+
return matchWeakening(rel, content, TSCONFIG_WEAKENING);
|
|
7640
|
+
}
|
|
7641
|
+
return [];
|
|
7642
|
+
}
|
|
7643
|
+
function collectCodingRulesBypassViolations(rootDir) {
|
|
7644
|
+
const hasDotnetRules = fs8.existsSync(path5.join(rootDir, "Directory.Build.props"));
|
|
7645
|
+
const hasTsRules = fs8.existsSync(path5.join(rootDir, "tsconfig.strict.json"));
|
|
7646
|
+
if (!hasDotnetRules && !hasTsRules) return [];
|
|
7647
|
+
return walkFiles(rootDir, rootDir, []).flatMap(
|
|
7648
|
+
(rel) => checkFile(rel, fs8.readFileSync(path5.join(rootDir, rel), "utf-8"), hasDotnetRules, hasTsRules)
|
|
7649
|
+
);
|
|
7650
|
+
}
|
|
7361
7651
|
var PROTECTED_BYPASS_PATTERNS = [
|
|
7362
7652
|
/^schemas[\\/]/i,
|
|
7363
7653
|
/^examples[\\/]security[\\/]/i,
|
|
@@ -7368,7 +7658,8 @@ var PROTECTED_BYPASS_PATTERNS = [
|
|
|
7368
7658
|
/license-policy\.ya?ml$/i,
|
|
7369
7659
|
/08_security_concept\.md$/i,
|
|
7370
7660
|
/09_decisions[\\/]/i,
|
|
7371
|
-
/migrations?[\\/]/i
|
|
7661
|
+
/migrations?[\\/]/i,
|
|
7662
|
+
/^\.github[\\/]CODEOWNERS$/i
|
|
7372
7663
|
];
|
|
7373
7664
|
function detectProfileFromChange(changeDir) {
|
|
7374
7665
|
if (!fs8.existsSync(changeDir)) return "standard";
|
|
@@ -7504,7 +7795,10 @@ function verifyProgressiveFriction(options = {}) {
|
|
|
7504
7795
|
const changeDir = resolveChangeDirectory(rootDir, options);
|
|
7505
7796
|
const profile = changeDir ? detectProfileFromChange(changeDir) : "standard";
|
|
7506
7797
|
const modifiedFiles = options.diffFiles || options.modifiedFiles || (profile === "patch" ? detectGitDiffFiles(rootDir) : []);
|
|
7507
|
-
const violations =
|
|
7798
|
+
const violations = [
|
|
7799
|
+
...profile === "patch" ? collectPatchViolations(rootDir, modifiedFiles) : [],
|
|
7800
|
+
...collectCodingRulesBypassViolations(rootDir)
|
|
7801
|
+
];
|
|
7508
7802
|
const bypassed = violations.length > 0;
|
|
7509
7803
|
const success = !bypassed;
|
|
7510
7804
|
return {
|
|
@@ -10490,6 +10784,24 @@ if echo "$CURRENT_BRANCH" | grep -qE "^(main|master|release/.*)$"; then
|
|
|
10490
10784
|
exit 1
|
|
10491
10785
|
fi
|
|
10492
10786
|
|
|
10787
|
+
# Immutable Coding Rules Guard: block AI agents from adding, modifying or deleting coding rules files
|
|
10788
|
+
IS_AGENT=0
|
|
10789
|
+
if [ -n "$AI_MODEL" ] || [ -n "$AI_AGENT_NAME" ] || [ -n "$ANTIGRAVITY_AGENT" ] || [ -n "$ANTIGRAVITY_AGENT_ID" ] || [ -n "$ANTIGRAVITY_CONVERSATION_ID" ] || [ -n "$CLAUDE_CODE" ] || [ -n "$CURSOR_AGENT" ] || [ -n "$WINDSURF_AGENT" ] || [ -n "$AIDER_MODEL" ] || [ -f ".ai-sdlc/session-telemetry.json" ]; then
|
|
10790
|
+
IS_AGENT=1
|
|
10791
|
+
fi
|
|
10792
|
+
|
|
10793
|
+
if [ "$IS_AGENT" = "1" ]; then
|
|
10794
|
+
TAMPERED_RULES=$(git diff --cached --diff-filter=AMDR --name-only 2>/dev/null | grep -E "(^|/)(Directory\\.Build\\.props|tsconfig\\.strict\\.json|eslint\\.config\\.mjs|gradle/init\\.d/aisdlc-strict\\.init\\.gradle\\.kts|config/pmd/aisdlc-ruleset\\.xml|config/detekt/detekt\\.yml|\\.cargo/config\\.toml|\\.clippy\\.toml|\\.golangci\\.yml|\\.clang-tidy|cmake/AisdlcStrictCompiler\\.cmake|\\.github/CODEOWNERS|templates/coding-rules/.+)$" || echo "")
|
|
10795
|
+
if [ -n "$TAMPERED_RULES" ]; then
|
|
10796
|
+
echo "" >&2
|
|
10797
|
+
echo "\u274C [AI-SDLC Immutable Coding Rules Guard] BLOCKED: AI agents are forbidden from adding, modifying or deleting coding rules files:" >&2
|
|
10798
|
+
echo "$TAMPERED_RULES" >&2
|
|
10799
|
+
echo "Fix the source or test code to comply with the compiler/linter rules instead of altering the rule configuration." >&2
|
|
10800
|
+
echo "" >&2
|
|
10801
|
+
exit 1
|
|
10802
|
+
fi
|
|
10803
|
+
fi
|
|
10804
|
+
|
|
10493
10805
|
exit 0
|
|
10494
10806
|
`;
|
|
10495
10807
|
var PREPARE_COMMIT_MSG_SCRIPT = `#!/usr/bin/env bash
|
|
@@ -10607,7 +10919,7 @@ function installGitHooks(rootDir = process.cwd()) {
|
|
|
10607
10919
|
fs8.mkdirSync(hooksDir, { recursive: true });
|
|
10608
10920
|
}
|
|
10609
10921
|
const prepareCommitMsgPath = path5.join(hooksDir, "prepare-commit-msg");
|
|
10610
|
-
const preCommitPath = path5.join(
|
|
10922
|
+
const preCommitPath = path5.join(gitDir, "hooks", "pre-commit");
|
|
10611
10923
|
try {
|
|
10612
10924
|
fs8.writeFileSync(prepareCommitMsgPath, PREPARE_COMMIT_MSG_SCRIPT, { encoding: "utf-8", mode: 493 });
|
|
10613
10925
|
fs8.writeFileSync(preCommitPath, PRE_COMMIT_SCRIPT, { encoding: "utf-8", mode: 493 });
|
|
@@ -14061,6 +14373,51 @@ Execute every implementation task following this strict sequential order:
|
|
|
14061
14373
|
- **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.
|
|
14062
14374
|
- **Remote Verification**: Creating a PR (\`gh pr create\`) does not equal success; actively verify that remote checks pass (\`gh pr checks\`).
|
|
14063
14375
|
- 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 Release Manager, opening the Human Action Window. In \`AUTONOMOUS\` mode, omit interactive handoff.`
|
|
14376
|
+
},
|
|
14377
|
+
{
|
|
14378
|
+
id: "agent-auditor",
|
|
14379
|
+
title: "Transversal Quality and Improvement Auditor",
|
|
14380
|
+
description: "Polymorphically inspect deliverables from any AI-SDLC specialist agent on demand, identifying structural weaknesses, overengineering, or blind spots, and proposing concrete, minimal solutions adhering strictly to YAGNI.",
|
|
14381
|
+
globs: "**/*",
|
|
14382
|
+
claudeTools: ["View", "GlobTool", "GrepTool", "LS", "Bash"],
|
|
14383
|
+
antigravityTools: ["read_file", "run_command", "call_mcp_tool", "ask_question"],
|
|
14384
|
+
body: `## Role & Mission
|
|
14385
|
+
- **Role**: Transversal Quality and Constructive Auditor Agent (\`agent-auditor\`).
|
|
14386
|
+
- **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 proposing concrete, minimal, and standard solutions adhering strictly to Simplicity First (YAGNI).
|
|
14387
|
+
|
|
14388
|
+
## Operational Directives & Guardrails
|
|
14389
|
+
- **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\`).
|
|
14390
|
+
- **Simplicity First (YAGNI)**: Actively challenge speculative parameters, redundant interfaces, unused design patterns, and unrequested flexibility.
|
|
14391
|
+
- **Classification of Findings**: Label every finding as:
|
|
14392
|
+
* \`[BLOCKING_DEFECT]\`: Critical omission, structural debt, or standard violation that must be resolved.
|
|
14393
|
+
* \`[SIMPLIFICATION]\`: Opportunity to remove unneeded complexity or reduce code/spec surface without loss of function.
|
|
14394
|
+
* \`[ADVISORY]\`: Non-blocking observation or suggestion.
|
|
14395
|
+
- **NON-INVASIVE GUARDRAIL**: You do NOT modify upstream files or specifications directly.
|
|
14396
|
+
- **Mandatory Return Handoff**: Emit a structured report citing canonical IDs and SHA-256 digests, concluding with the canonical Workflow Handoff block (\`templates/workflow/agent-handoff.template.md\`) directed back to the audited specialist agent.
|
|
14397
|
+
- **ANTI-PING-PONG GUARDRAIL**: Enforce maximum 1 audit return round per increment unless blocking defects persist.`
|
|
14398
|
+
},
|
|
14399
|
+
{
|
|
14400
|
+
id: "agent-adversary",
|
|
14401
|
+
title: "Transversal Red Team and Chaos Adversary",
|
|
14402
|
+
description: "Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, providing concrete proofs-of-concept (PoC), counterexamples, and reproduction steps for every discovered failure mode.",
|
|
14403
|
+
globs: "**/*",
|
|
14404
|
+
claudeTools: ["View", "GlobTool", "GrepTool", "LS", "Bash"],
|
|
14405
|
+
antigravityTools: ["read_file", "run_command", "call_mcp_tool", "ask_question"],
|
|
14406
|
+
body: `## Role & Mission
|
|
14407
|
+
- **Role**: Transversal Red Team and Stress Adversary Agent (\`agent-adversary\`).
|
|
14408
|
+
- **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.
|
|
14409
|
+
|
|
14410
|
+
## Operational Directives & Guardrails
|
|
14411
|
+
- **Polymorphic On-Demand Scope**:
|
|
14412
|
+
* **Product**: Uncover contradictory requirements, unreachable business states, and logic traps.
|
|
14413
|
+
* **Architecture**: Simulate race conditions, cascading failures, resource exhaustion, and single points of failure (SPOFs).
|
|
14414
|
+
* **QA**: Perform conceptual mutation testing; demonstrate how flawed or empty implementations could falsely pass tests green.
|
|
14415
|
+
* **Development**: Attack boundary inputs, concurrency race triggers, and memory/type edge breaks.
|
|
14416
|
+
* **DevOps**: Probe pipeline isolation, credential boundaries, and cold-start/dependency outages.
|
|
14417
|
+
- **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.
|
|
14418
|
+
- **NON-INVASIVE GUARDRAIL**: You do NOT patch the vulnerabilities or bugs yourself.
|
|
14419
|
+
- **Mandatory Return Handoff**: Emit the canonical Workflow Handoff block (\`templates/workflow/agent-handoff.template.md\`) addressing the audited agent, demanding verified mitigation before downstream promotion.
|
|
14420
|
+
- **ANTI-PING-PONG GUARDRAIL**: Enforce maximum 1 adversarial return round per increment.`
|
|
14064
14421
|
}
|
|
14065
14422
|
];
|
|
14066
14423
|
function renderAntigravityAgentFile(agent) {
|
|
@@ -14130,12 +14487,20 @@ var LIFECYCLE_SKILL_TEMPLATES = [
|
|
|
14130
14487
|
{
|
|
14131
14488
|
id: "aisdlc-greenfield",
|
|
14132
14489
|
title: "Greenfield Project Inception & Delivery Playbook",
|
|
14133
|
-
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, and initial SDD increment delivery.",
|
|
14490
|
+
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, transversal auditor/adversary verification loops, and initial SDD increment delivery.",
|
|
14134
14491
|
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).",
|
|
14135
14492
|
globs: "product/**, specs/product/**, architecture/**, templates/**",
|
|
14136
14493
|
body: `## Purpose & Trigger
|
|
14137
14494
|
Use 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.
|
|
14138
14495
|
|
|
14496
|
+
## Mandatory Transversal Quality & Adversarial Protocol
|
|
14497
|
+
Every authoring agent deliverable across Phase 0 and Inception undergoes mandatory quality auditing and adversarial stress-testing before downstream progression:
|
|
14498
|
+
- **Concurrent Inspection**: Immediately following the execution of any authoring agent (\`agent-product-analyst\`, \`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`), 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) **concurrently** in clean, isolated context windows.
|
|
14499
|
+
- **Non-Invasive Review**: Neither auditor nor adversary modifies deliverables directly; both deliver structured reports citing canonical IDs and SHA-256 digests.
|
|
14500
|
+
- **Consolidated Remediation Re-Execution**: Consolidate findings and emit the Workflow Handoff back to the authoring agent, who is re-executed to resolve blocking defects and apply simplifications.
|
|
14501
|
+
- **Anti-Ping-Pong Guardrail (Max 2 Rounds)**: Bounded strictly to a maximum of **2 correction rounds** per phase/deliverable. If non-blocking advisories remain after round 2, proceed to the downstream phase; if blocking defects persist after round 2, escalate immediately to the Human Tech Lead.
|
|
14502
|
+
- **Exclusion of Downstream Review & Validation Roles**: Review and validation agents (\`agent-expert-user\`, \`agent-code-reviewer\`, \`agent-security-auditor\`, \`agent-compliance-checker\`) evaluate finished deliverables and are excluded from being audited by this loop.
|
|
14503
|
+
|
|
14139
14504
|
## End-to-End Execution Playbook
|
|
14140
14505
|
|
|
14141
14506
|
### Step 1: Repository Turnkey Initialization
|
|
@@ -14155,6 +14520,9 @@ Use this skill when starting a **brand-new software project from scratch (Greenf
|
|
|
14155
14520
|
- Actors (\`ACT-*\`), Use Cases (\`UC-*\`), Business Rules (\`BR-*\`), Functional Requirements (\`FR-*\` with mandatory \`@nominal\`, \`@boundary\`, \`@invalid\` Gherkin blocks), and Quality Requirements (\`QR-*\`).
|
|
14156
14521
|
5. Validate schemas and duplicates via MCP tools \`verify_schemas\` and \`verify_duplicates\` (or \`npx aisdlc check --fix\`).
|
|
14157
14522
|
6. **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, and separate core MVP \`UC-*\` from future roadmap backlog (\`templates/product/user-design-feedback.template.md\`).
|
|
14523
|
+
7. **Transversal Quality & Adversarial Loop (\`agent-product-analyst\`)**:
|
|
14524
|
+
- Concurrently invoke \`agent-auditor\` and \`agent-adversary\` on the draft product artifacts in isolated context windows.
|
|
14525
|
+
- Consolidate findings and hand off back to \`agent-product-analyst\` to re-execute and remediate issues (max 2 correction rounds).
|
|
14158
14526
|
|
|
14159
14527
|
### Step 3: Shift-Left Cybersecurity & Privacy-by-Design (\`agent-threat-modeler\` \u2794 \`agent-privacy-officer\`)
|
|
14160
14528
|
1. Delegate to or adopt [\`agent-threat-modeler\`](../agent-threat-modeler/SKILL.md).
|
|
@@ -14162,15 +14530,24 @@ Use this skill when starting a **brand-new software project from scratch (Greenf
|
|
|
14162
14530
|
- Threat Actors (\`ACT-THREAT-*\`)
|
|
14163
14531
|
- Abuse Cases (\`ABUSE-*\` targeting \`UC-*\`)
|
|
14164
14532
|
- Security Requirements (\`SEC-REQ-*\` with \`@security @mitigation\` negative Gherkin scenarios and \`SEC-ENC-*\` Zero Trust enclave bindings).
|
|
14165
|
-
3.
|
|
14533
|
+
3. **Transversal Quality & Adversarial Loop (\`agent-threat-modeler\`)**:
|
|
14534
|
+
- Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over the security threat models.
|
|
14535
|
+
- Consolidate findings and return handoff to \`agent-threat-modeler\` to re-execute and remediate (max 2 correction rounds).
|
|
14536
|
+
4. Hand off to [\`agent-privacy-officer\`](../agent-privacy-officer/SKILL.md) to apply LINDDUN and GDPR/LOPDGDD/ISO 27701 in \`specs/privacy/\`:
|
|
14166
14537
|
- Personal Data Assets (\`DATA-ASSET-*\`), GDPR Art. 30 Records of Processing (\`PRIV-ROPA-*\`), and Privacy Requirements (\`PRIV-REQ-*\` with \`@privacy @gdpr\` Gherkin scenarios).
|
|
14167
|
-
|
|
14538
|
+
5. **Transversal Quality & Adversarial Loop (\`agent-privacy-officer\`)**:
|
|
14539
|
+
- Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over the privacy records and requirements.
|
|
14540
|
+
- Consolidate findings and return handoff to \`agent-privacy-officer\` to re-execute and remediate (max 2 correction rounds).
|
|
14541
|
+
6. Run \`verify_schemas\` and \`verify_privacy\` (\`npx aisdlc verify privacy\`).
|
|
14168
14542
|
|
|
14169
14543
|
### Step 4: Modular Systems Architecture (\`agent-system-architect\`)
|
|
14170
14544
|
1. Delegate to or adopt [\`agent-system-architect\`](../agent-system-architect/SKILL.md).
|
|
14171
14545
|
2. 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-*\`).
|
|
14172
14546
|
3. Inspect third-party stack choices against \`license-policy.yaml\` via \`verify_licenses\` and subprocessors against \`privacy-policy.yaml\` via \`verify_privacy\`.
|
|
14173
14547
|
4. **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 \`SEC-REQ-*\` and \`PRIV-REQ-*\` mitigations before coding.
|
|
14548
|
+
5. **Transversal Quality & Adversarial Loop (\`agent-system-architect\`)**:
|
|
14549
|
+
- Concurrently invoke \`agent-auditor\` (evaluating YAGNI, architecture bloat, Ports & Adapters interfaces) and \`agent-adversary\` (simulating SPOFs, race conditions, cascading outages) in isolated context windows.
|
|
14550
|
+
- Consolidate findings and return handoff to \`agent-system-architect\` to re-execute and remediate (max 2 correction rounds).
|
|
14174
14551
|
|
|
14175
14552
|
### Step 5: Release Milestone & Topological Wave SDD Plan (\`1 UC-* = 1 CHG-*\`)
|
|
14176
14553
|
1. **Open Release Milestone (\`Tier 2: release/v1.0.0\`)**: Group the approved MVP Use Cases (\`UC-001\`, \`UC-002\`, ...) under the initial release milestone (\`release/v1.0.0\`) and visualize the branch hierarchy via \`npx aisdlc git plan\`.
|
|
@@ -14181,6 +14558,7 @@ Use this skill when starting a **brand-new software project from scratch (Greenf
|
|
|
14181
14558
|
|
|
14182
14559
|
## Non-Negotiable Guardrails
|
|
14183
14560
|
- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles 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.
|
|
14561
|
+
- **Mandatory Transversal Quality & Adversarial Loop**: Every authoring agent deliverable must undergo concurrent inspection by \`agent-auditor\` and \`agent-adversary\` in isolated context windows, followed by a re-execution of the authoring agent to remediate findings. To prevent infinite cycles, enforce the **Anti-Ping-Pong Guardrail**: maximum 2 correction rounds per phase; if unresolved blocking defects persist after round 2, escalate to the Human Tech Lead.
|
|
14184
14562
|
- **FORBIDDEN Greenfield Monolith (\`1 UC-* = 1 CHG-*\`)**: Never bundle the entire product or multiple \`UC-*\` into a single SDD change (\`CHG-001\`). Deterministic Gate 3 (\`verify_governance\`) blocks any \`handoff.yaml\` containing $> 1$ Use Case (\`Greenfield monolith detected\`). Parallelism is achieved by running **multiple bounded \`CHG-*\` concurrently** on separate branches/worktrees, never by stuffing multiple \`UC-*\` into one \`CHG-*\`.
|
|
14185
14563
|
- 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.
|
|
14186
14564
|
- All newly drafted specifications must start with \`status: draft\`.
|
|
@@ -14189,12 +14567,20 @@ Use this skill when starting a **brand-new software project from scratch (Greenf
|
|
|
14189
14567
|
{
|
|
14190
14568
|
id: "aisdlc-legacy-onboarding",
|
|
14191
14569
|
title: "Legacy / Brownfield Retro-Inception Playbook",
|
|
14192
|
-
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-*) and establishing baseline quality, security, and license audits before new SDD increments.",
|
|
14570
|
+
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-*), transversal auditor/adversary verification loops, and establishing baseline quality, security, and license audits before new SDD increments.",
|
|
14193
14571
|
references: "[`process/02_product_definition.md`](../../process/02_product_definition.md), [`process/04_open_source_license_compliance.md`](../../process/04_open_source_license_compliance.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/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).",
|
|
14194
14572
|
globs: "architecture/**, specs/**, src/**, packages/**",
|
|
14195
14573
|
body: `## Purpose & Trigger
|
|
14196
14574
|
Use this skill when **adopting AI-SDLC in an existing or legacy codebase (Brownfield)** that already has production source code (\`src/\`, \`packages/\`, etc.) but lacks canonical PDaC specifications, arc42 architecture views, or deterministic quality/license/privacy gates.
|
|
14197
14575
|
|
|
14576
|
+
## Mandatory Transversal Quality & Adversarial Protocol
|
|
14577
|
+
Every authoring agent deliverable during Brownfield retro-inception undergoes mandatory quality auditing and adversarial stress-testing before downstream progression:
|
|
14578
|
+
- **Concurrent Inspection**: Immediately following the execution of any authoring agent (\`agent-product-analyst\`, \`agent-system-architect\`, \`agent-threat-modeler\`, \`agent-privacy-officer\`), invoke [\`agent-auditor\`](../agent-auditor/SKILL.md) (evaluating YAGNI, over-specification, and structural clarity) and [\`agent-adversary\`](../agent-adversary/SKILL.md) (uncovering hidden assumptions, boundary breaks, and contradictory legacy rules) **concurrently** in clean, isolated context windows.
|
|
14579
|
+
- **Non-Invasive Review**: Neither auditor nor adversary modifies deliverables directly; both deliver structured reports citing canonical IDs and SHA-256 digests.
|
|
14580
|
+
- **Consolidated Remediation Re-Execution**: Consolidate findings and emit the Workflow Handoff back to the authoring agent, who is re-executed to resolve blocking defects and apply simplifications.
|
|
14581
|
+
- **Anti-Ping-Pong Guardrail (Max 2 Rounds)**: Bounded strictly to a maximum of **2 correction rounds** per phase/deliverable. If non-blocking advisories remain after round 2, proceed to the downstream phase; if blocking defects persist after round 2, escalate immediately to the Human Tech Lead.
|
|
14582
|
+
- **Exclusion of Diagnostic/Review Roles**: Read-only baseline verifiers and diagnostic review roles (\`agent-compliance-checker\`, \`agent-security-auditor\`, \`agent-code-reviewer\`) assess pre-existing code and are excluded from being audited by this loop.
|
|
14583
|
+
|
|
14198
14584
|
## End-to-End Execution Playbook
|
|
14199
14585
|
|
|
14200
14586
|
### Step 1: Non-Destructive Framework Scaffolding
|
|
@@ -14212,9 +14598,13 @@ Before modifying any code or creating SDD changes, run diagnostic verifiers to q
|
|
|
14212
14598
|
### Step 3: Brownfield Retro-Inception (\`agent-system-architect\` & \`agent-product-analyst\`)
|
|
14213
14599
|
Instead 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:
|
|
14214
14600
|
1. **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\`.
|
|
14601
|
+
- **Transversal Loop**: Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over \`ARCH-INTRO-001\`. Consolidate findings and return handoff to \`agent-product-analyst\` to re-execute and remediate (max 2 correction rounds).
|
|
14215
14602
|
2. **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-*\`).
|
|
14603
|
+
- **Transversal Loop**: Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over component models. Consolidate findings and return handoff to \`agent-system-architect\` to re-execute and remediate (max 2 correction rounds).
|
|
14216
14604
|
3. **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).
|
|
14605
|
+
- **Transversal Loop**: Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over extracted \`UC-*\`/\`FR-*\`. Consolidate findings and return handoff to \`agent-product-analyst\` to re-execute and remediate (max 2 correction rounds).
|
|
14217
14606
|
4. **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.
|
|
14607
|
+
- **Transversal Loop**: Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over threat and privacy models. Consolidate findings and return handoff to \`agent-threat-modeler\` and \`agent-privacy-officer\` to re-execute and remediate (max 2 correction rounds).
|
|
14218
14608
|
|
|
14219
14609
|
### Step 4: Characterization Testing & Synchronization
|
|
14220
14610
|
1. Run MCP tool \`sdd_check_fix\` (\`npx aisdlc check --fix\`) to extract \`.feature\` files and compute canonical SHA-256 digests.
|
|
@@ -14225,6 +14615,7 @@ Once the target domain's baseline artifacts (\`ARCH-INTRO-*\`, \`UC-*\`, \`FR-*\
|
|
|
14225
14615
|
|
|
14226
14616
|
## Non-Negotiable Guardrails
|
|
14227
14617
|
- **Clean Context Window Isolation per Specialist Agent (Cross-IDE)**: Never execute two distinct specialist roles 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.
|
|
14618
|
+
- **Mandatory Transversal Quality & Adversarial Loop**: Every authoring agent deliverable must undergo concurrent inspection by \`agent-auditor\` and \`agent-adversary\` in isolated context windows, followed by a re-execution of the authoring agent to remediate findings. To prevent infinite cycles, enforce the **Anti-Ping-Pong Guardrail**: maximum 2 correction rounds per phase; if unresolved blocking defects persist after round 2, escalate to the Human Tech Lead.
|
|
14228
14619
|
- **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-*\`).
|
|
14229
14620
|
- **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\`).
|
|
14230
14621
|
- **Immediate Secret Remediation**: If Step 2 (\`verify_security\`) uncovers leaked credentials (exit code 4), halt feature work and remediate/rotate secrets immediately.`
|
|
@@ -14232,7 +14623,7 @@ Once the target domain's baseline artifacts (\`ARCH-INTRO-*\`, \`UC-*\`, \`FR-*\
|
|
|
14232
14623
|
{
|
|
14233
14624
|
id: "aisdlc-increment",
|
|
14234
14625
|
title: "Bounded SDD Feature & Bugfix Delivery Playbook",
|
|
14235
|
-
description: "Orchestrate the complete Spec-Driven Development (SDD) lifecycle for bounded feature increments, enhancements, and bugfixes (CHG-* / TSK-*), from upstream requirement derivation and 4-tier Git branching through Red-Green-Refactor TDD, Pre-Merge Audit Triad, all 11 Quality Gates, and canonical baseline integration.",
|
|
14626
|
+
description: "Orchestrate the complete Spec-Driven Development (SDD) lifecycle for bounded feature increments, enhancements, and bugfixes (CHG-* / TSK-*), from upstream requirement derivation and 4-tier Git branching through Red-Green-Refactor TDD, transversal auditor/adversary verification loops, Pre-Merge Audit Triad, all 11 Quality Gates, and canonical baseline integration.",
|
|
14236
14627
|
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).",
|
|
14237
14628
|
globs: "specs/changes/**, src/**, packages/**, tests/**",
|
|
14238
14629
|
body: `## Purpose & Trigger
|
|
@@ -14244,9 +14635,12 @@ Use this skill for **every evolutionary increment (new feature, enhancement, ref
|
|
|
14244
14635
|
1. 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/\`.
|
|
14245
14636
|
2. If the increment introduces new behavior or modifies business rules:
|
|
14246
14637
|
- Use [\`agent-product-analyst\`](../agent-product-analyst/SKILL.md) to create or update the \`UC-*\`, \`BR-*\`, and \`FR-*\` (with \`@nominal\`, \`@boundary\`, \`@invalid\` Gherkin scenarios).
|
|
14638
|
+
- **Transversal Loop (\`agent-product-analyst\`)**: Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over updated specs. Consolidate findings and return handoff to \`agent-product-analyst\` to re-execute and remediate (max 2 correction rounds).
|
|
14247
14639
|
- Run MCP tool \`verify_duplicates\` (\`npx aisdlc verify duplicates\`) to block lexical or functional collisions early.
|
|
14248
14640
|
- Use [\`agent-threat-modeler\`](../agent-threat-modeler/SKILL.md) to model any new \`ABUSE-*\` and \`SEC-REQ-*\` mitigations.
|
|
14641
|
+
- **Transversal Loop (\`agent-threat-modeler\`)**: Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over security models. Consolidate findings and return handoff to \`agent-threat-modeler\` to re-execute and remediate (max 2 correction rounds).
|
|
14249
14642
|
- 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-*\`).
|
|
14643
|
+
- **Transversal Loop (\`agent-privacy-officer\`)**: Concurrently invoke \`agent-auditor\` and \`agent-adversary\` over privacy models. Consolidate findings and return handoff to \`agent-privacy-officer\` to re-execute and remediate (max 2 correction rounds).
|
|
14250
14644
|
3. Run \`sdd_check_fix\` (\`npx aisdlc check --fix\`) to sync Gherkin \`.feature\` files and validate schemas.
|
|
14251
14645
|
|
|
14252
14646
|
### Step 2: SDD Change Scaffolding & Architectural Design (\`agent-system-architect\`)
|
|
@@ -14254,7 +14648,10 @@ Use this skill for **every evolutionary increment (new feature, enhancement, ref
|
|
|
14254
14648
|
2. Use [\`agent-system-architect\`](../agent-system-architect/SKILL.md) to complete \`specs/changes/active/<chg-id>/design.md\` and \`specs/architecture/CMP-*.md\`:
|
|
14255
14649
|
- 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.
|
|
14256
14650
|
- 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\`).
|
|
14257
|
-
3.
|
|
14651
|
+
3. **Transversal Loop (\`agent-system-architect\`)**:
|
|
14652
|
+
- Concurrently invoke \`agent-auditor\` (evaluating YAGNI, interface bloat, task completeness) and \`agent-adversary\` (probing race conditions, contract drift, SPOFs) in isolated context windows.
|
|
14653
|
+
- Consolidate findings and return handoff to \`agent-system-architect\` to re-execute and remediate (max 2 correction rounds).
|
|
14654
|
+
4. Run \`verify_governance\` and \`verify_friction\` to validate task governance, 100% design/handoff scope coverage, and anti-monolith limits (\`maxUseCasesPerChange = 1\`).
|
|
14258
14655
|
|
|
14259
14656
|
### Step 3: 4-Tier Git Branch Navigation & Multi-Agent Parallelism
|
|
14260
14657
|
1. Navigate to the task branch using \`npx aisdlc git checkout <TSK-ID>\` (\`pnpm run git:checkout <TSK-ID>\`), which cascade-creates:
|
|
@@ -14267,7 +14664,10 @@ Use this skill for **every evolutionary increment (new feature, enhancement, ref
|
|
|
14267
14664
|
### Step 4: Red Phase \u2014 Failing Test Suites (\`agent-qa-engineer\`)
|
|
14268
14665
|
1. Delegate to or adopt [\`agent-qa-engineer\`](../agent-qa-engineer/SKILL.md).
|
|
14269
14666
|
2. 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/\`.
|
|
14270
|
-
3.
|
|
14667
|
+
3. **Transversal Loop (\`agent-qa-engineer\`)**:
|
|
14668
|
+
- Concurrently invoke \`agent-auditor\` (checking test overengineering, brittle assertions) and \`agent-adversary\` (running conceptual mutation testing to prove whether trivial or empty implementations could falsely pass tests green) in isolated context windows.
|
|
14669
|
+
- Consolidate findings and return handoff to \`agent-qa-engineer\` to re-execute and harden test suites (max 2 correction rounds).
|
|
14670
|
+
4. Run \`verify_testing\` (\`npx aisdlc verify testing\`) to confirm requirement test coverage before writing production code.
|
|
14271
14671
|
|
|
14272
14672
|
### Step 5: Green & Refactor Phase \u2014 Surgical Implementation (\`agent-developer\`)
|
|
14273
14673
|
1. Delegate to or adopt [\`agent-developer\`](../agent-developer/SKILL.md).
|
|
@@ -14275,6 +14675,19 @@ Use this skill for **every evolutionary increment (new feature, enhancement, ref
|
|
|
14275
14675
|
- (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).
|
|
14276
14676
|
3. Verify any new dependency against \`license-policy.yaml\` via \`verify_licenses\` and PII handling against \`privacy-policy.yaml\` via \`verify_privacy\`.
|
|
14277
14677
|
4. 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.
|
|
14678
|
+
5. **Transversal Loop (\`agent-developer\`)**:
|
|
14679
|
+
- Concurrently invoke \`agent-auditor\` (detecting overengineering, speculative parameters, AST complexity) and \`agent-adversary\` (attacking boundary inputs, concurrency races, type edge breaks with concrete PoCs) in isolated context windows.
|
|
14680
|
+
- Consolidate findings and return handoff to \`agent-developer\` to re-execute and remediate (max 2 correction rounds).
|
|
14681
|
+
|
|
14682
|
+
### Mandatory Transversal Quality & Adversarial Protocol
|
|
14683
|
+
- **Systematic Post-Agent Execution**: Immediately following the execution of any authoring agent (\`agent-product-analyst\`, \`agent-threat-modeler\`, \`agent-privacy-officer\`, \`agent-system-architect\`, \`agent-qa-engineer\`, \`agent-developer\`, \`agent-devops\`), invoke \`agent-auditor\` and \`agent-adversary\` concurrently in clean, isolated context windows over that agent's deliverables.
|
|
14684
|
+
- **Concurrent Inspection**:
|
|
14685
|
+
* [\`agent-auditor\`](../agent-auditor/SKILL.md) inspects deliverables for structural debt, premature generalizations, or unneeded complexity (YAGNI).
|
|
14686
|
+
* [\`agent-adversary\`](../agent-adversary/SKILL.md) actively stress-tests deliverables: uncovers requirement contradictions, simulates architectural race conditions/SPOFs, conducts conceptual mutation testing on QA suites, or crafts breaking boundary payloads for code with mandatory proof-of-break.
|
|
14687
|
+
- **Non-Invasive Guardrail**: Neither auditor nor adversary edits files directly. Both emit structured findings citing canonical IDs and SHA-256 hashes.
|
|
14688
|
+
- **Consolidated Handoff & Remediation Re-Execution**: Consolidate findings and emit the Workflow Handoff back to the audited authoring agent, who is re-executed to resolve the findings.
|
|
14689
|
+
- **Anti-Ping-Pong Guardrail (Max 2 Rounds)**: Enforce a strict boundary of maximum **2 correction rounds** per phase/deliverable. If non-blocking advisories remain after round 2, proceed downstream; if blocking defects persist after round 2, escalate to the Human Tech Lead.
|
|
14690
|
+
- **Exclusion of Downstream Review & Validation Roles**: Pre-merge review agents (\`agent-code-reviewer\`, \`agent-security-auditor\`, \`agent-compliance-checker\`) and validation agents (\`agent-expert-user\`) evaluate finished deliverables and are excluded from being audited by this loop.
|
|
14278
14691
|
|
|
14279
14692
|
### Step 6: Post-Development Functional Validation & Pre-Merge Audit Triad
|
|
14280
14693
|
1. **Functional Validation (\`agent-expert-user\`)**: Validate live runtime behavior against \`UC-*\` and \`FR-*\` criteria (including \`0\` browser \`console.error\`/\`pageerror\` on UI changes).
|
|
@@ -14294,6 +14707,7 @@ Use this skill for **every evolutionary increment (new feature, enhancement, ref
|
|
|
14294
14707
|
|
|
14295
14708
|
## Non-Negotiable Guardrails
|
|
14296
14709
|
- **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.
|
|
14710
|
+
- **Mandatory Transversal Quality & Adversarial Loop**: Every authoring agent deliverable must undergo concurrent inspection by \`agent-auditor\` and \`agent-adversary\` in isolated context windows, followed by a re-execution of the authoring agent to remediate findings. To prevent infinite cycles, enforce the **Anti-Ping-Pong Guardrail**: maximum 2 correction rounds per phase; if unresolved blocking defects persist after round 2, escalate to the Human Tech Lead.
|
|
14297
14711
|
- **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.
|
|
14298
14712
|
- **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\`.`
|
|
14299
14713
|
}
|
|
@@ -14470,6 +14884,14 @@ This file defines the operational rules and specialized role mappings for Google
|
|
|
14470
14884
|
- **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.
|
|
14471
14885
|
- **Remote Verification**: Creating a PR (\`gh pr create\`) does not equal success; actively verify that remote checks pass (\`gh pr checks\`).
|
|
14472
14886
|
|
|
14887
|
+
### 12. \`agent-auditor\` (Transversal Quality and Improvement Auditor)
|
|
14888
|
+
- **Mission**: Polymorphically inspect deliverables from any specialist agent on demand, identifying structural weaknesses, overengineering, or blind spots, and proposing minimal solutions adhering strictly to YAGNI.
|
|
14889
|
+
- **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).
|
|
14890
|
+
|
|
14891
|
+
### 13. \`agent-adversary\` (Transversal Red Team and Chaos Adversary)
|
|
14892
|
+
- **Mission**: Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, providing concrete proofs-of-concept (PoC), counterexamples, and reproduction steps.
|
|
14893
|
+
- **Directives**: Expose failure modes across Product (logic traps), Architecture (SPOF/races), QA (mutation testing/false greens), Code (boundary/concurrency), and DevOps (pipeline escape); mandatory proof-of-break; non-invasive; always return handoff to the audited agent (max 1 return round).
|
|
14894
|
+
|
|
14473
14895
|
---
|
|
14474
14896
|
|
|
14475
14897
|
## 3. Git 4-Tier Hierarchy and Commit Conventions
|
|
@@ -14489,7 +14911,7 @@ This file defines the operational rules and specialized role mappings for Google
|
|
|
14489
14911
|
- **Conditional Activation Rule by Autonomy**:
|
|
14490
14912
|
- \u{1F7E2} **\`AUTONOMOUS\`** (or exclusive final supervision in PR/CI): **OMITTED**. Do not request or emit interactive handoff to avoid interrupting unattended execution.
|
|
14491
14913
|
- \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**.
|
|
14492
|
-
- **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-code-reviewer\`, \`agent-security-auditor\`, \`agent-compliance-checker\`, \`agent-devops\`, 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).
|
|
14914
|
+
- **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-code-reviewer\`, \`agent-security-auditor\`, \`agent-compliance-checker\`, \`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).
|
|
14493
14915
|
`;
|
|
14494
14916
|
var STARTER_CURSOR_CORE_RULES = `---
|
|
14495
14917
|
description: Global canonical directives, 5 unbreakable commandments, and AI-SDLC pre-flight
|
|
@@ -14536,6 +14958,8 @@ Before finalizing changes or proposing commits:
|
|
|
14536
14958
|
| \`agent-expert-user\` | Bimodal MVP evaluation (design) and functional validation against \`UC-*\` and \`FR-*\` (pre-PR). |
|
|
14537
14959
|
| \`agent-code-reviewer\` | PR audit (SOLID, DRY, YAGNI): \`[BLOCKING]\` / \`[CLEAN_CODE_SUGGESTION]\` / \`[COMPLIANT]\`. |
|
|
14538
14960
|
| \`agent-devops\` | CI/CD, Docker, IaC only \u2014 **FORBIDDEN** to touch \`src/\` or \`packages/*/src/\`. |
|
|
14961
|
+
| \`agent-auditor\` | Transversal on-demand constructive auditor; identifies overengineering, blind spots & YAGNI simplifications; returns handoff to audited agent. |
|
|
14962
|
+
| \`agent-adversary\` | Transversal on-demand Red Team adversary; breaks deliverables with reproducible PoC & mutation tests; returns handoff to audited agent. |
|
|
14539
14963
|
|
|
14540
14964
|
## 5. Task Autonomy Modes (\`tasks.md\`)
|
|
14541
14965
|
- \u{1F7E2} **\`AUTONOMOUS\`**: Low risk. Implement directly, omit handoff block.
|
|
@@ -14706,6 +15130,14 @@ npx tsx packages/cli/src/index.ts sdd integrate --change <chg-id>
|
|
|
14706
15130
|
- **Mission**: Maintain, evolve, and audit automated project infrastructure: CI/CD workflows, Docker containers, IaC manifests, and support scripts.
|
|
14707
15131
|
- **NON-INVASION GUARDRAIL**: STRICTLY FORBIDDEN from modifying application source code (\`src/\`, \`packages/*/src/\`).
|
|
14708
15132
|
|
|
15133
|
+
### 12. \`agent-auditor\` (Transversal Quality and Improvement Auditor)
|
|
15134
|
+
- **Mission**: Polymorphically inspect deliverables from any specialist agent on demand, identifying structural weaknesses, overengineering, or blind spots, and proposing minimal solutions adhering strictly to YAGNI.
|
|
15135
|
+
- **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).
|
|
15136
|
+
|
|
15137
|
+
### 13. \`agent-adversary\` (Transversal Red Team and Chaos Adversary)
|
|
15138
|
+
- **Mission**: Actively attempt to break, bypass, or invalidate deliverables from any target specialist agent, providing concrete proofs-of-concept (PoC), counterexamples, and reproduction steps.
|
|
15139
|
+
- **Directives**: Expose failure modes across Product (logic traps), Architecture (SPOF/races), QA (mutation testing/false greens), Code (boundary/concurrency), and DevOps (pipeline escape); mandatory proof-of-break; non-invasive; always return handoff to the audited agent (max 1 return round).
|
|
15140
|
+
|
|
14709
15141
|
---
|
|
14710
15142
|
|
|
14711
15143
|
## 4. Task Autonomy Modes (\`tasks.md\`)
|
|
@@ -14840,6 +15272,8 @@ Non-Negotiable Quality Thresholds (\`quality-policy.yaml\`):
|
|
|
14840
15272
|
| \`agent-expert-user\` | Bimodal MVP evaluation (design) and functional validation against \`UC-*\` and \`FR-*\` (pre-PR). |
|
|
14841
15273
|
| \`agent-code-reviewer\` | PR audit (SOLID, DRY, YAGNI): \`[BLOCKING]\` / \`[CLEAN_CODE_SUGGESTION]\` / \`[COMPLIANT]\`. |
|
|
14842
15274
|
| \`agent-devops\` | CI/CD, Docker, IaC only \u2014 **FORBIDDEN** to touch \`src/\` or \`packages/*/src/\`. |
|
|
15275
|
+
| \`agent-auditor\` | Transversal on-demand constructive auditor; identifies overengineering, blind spots & YAGNI simplifications; returns handoff to audited agent. |
|
|
15276
|
+
| \`agent-adversary\` | Transversal on-demand Red Team adversary; breaks deliverables with reproducible PoC & mutation tests; returns handoff to audited agent. |
|
|
14843
15277
|
|
|
14844
15278
|
---
|
|
14845
15279
|
|
|
@@ -16001,6 +16435,522 @@ var STARTER_BASE_TEMPLATES = [
|
|
|
16001
16435
|
{ relPath: "process/README.md", content: STARTER_PROCESS_README },
|
|
16002
16436
|
{ relPath: "compliance/license-manifest.yaml", content: STARTER_COMPLIANCE_LICENSE_MANIFEST_YAML }
|
|
16003
16437
|
];
|
|
16438
|
+
var VALID_CODING_RULE_STACKS = [
|
|
16439
|
+
"dotnet",
|
|
16440
|
+
"typescript",
|
|
16441
|
+
"javascript",
|
|
16442
|
+
"angular",
|
|
16443
|
+
"java",
|
|
16444
|
+
"kotlin",
|
|
16445
|
+
"rust",
|
|
16446
|
+
"go",
|
|
16447
|
+
"c",
|
|
16448
|
+
"cpp"
|
|
16449
|
+
];
|
|
16450
|
+
var PROTECTED_CODING_RULES_FILES = [
|
|
16451
|
+
"Directory.Build.props",
|
|
16452
|
+
"tsconfig.strict.json",
|
|
16453
|
+
"eslint.config.mjs",
|
|
16454
|
+
"gradle/init.d/aisdlc-strict.init.gradle.kts",
|
|
16455
|
+
"config/pmd/aisdlc-ruleset.xml",
|
|
16456
|
+
"config/detekt/detekt.yml",
|
|
16457
|
+
".cargo/config.toml",
|
|
16458
|
+
".clippy.toml",
|
|
16459
|
+
".golangci.yml",
|
|
16460
|
+
".clang-tidy",
|
|
16461
|
+
"cmake/AisdlcStrictCompiler.cmake",
|
|
16462
|
+
".github/CODEOWNERS"
|
|
16463
|
+
];
|
|
16464
|
+
var DOTNET_DIRECTORY_BUILD_PROPS = `<Project>
|
|
16465
|
+
<!-- 1. Global strict compiler and analyzer rules for all projects (src and tests) -->
|
|
16466
|
+
<PropertyGroup>
|
|
16467
|
+
<Nullable>enable</Nullable>
|
|
16468
|
+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
|
16469
|
+
<AnalysisLevel>latest-recommended</AnalysisLevel>
|
|
16470
|
+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
|
16471
|
+
</PropertyGroup>
|
|
16472
|
+
|
|
16473
|
+
<!-- 2. Strict unit/E2E test guardrails (xUnit, MSTest, NUnit) -->
|
|
16474
|
+
<PropertyGroup Condition="'$(IsTestProject)' == 'true' or $(MSBuildProjectName.EndsWith('Tests')) or $(MSBuildProjectName.EndsWith('Test'))">
|
|
16475
|
+
<IsTestProject>true</IsTestProject>
|
|
16476
|
+
<NoWarn>$(NoWarn);CA1707;CA2007</NoWarn>
|
|
16477
|
+
<MSTestAnalysisMode>Recommended</MSTestAnalysisMode>
|
|
16478
|
+
<WarningsAsErrors>$(WarningsAsErrors);S2699;S1607;MSTEST0006;MSTEST0014;MSTEST0015;MSTEST0017;MSTEST0032;xUnit1026;xUnit1013</WarningsAsErrors>
|
|
16479
|
+
</PropertyGroup>
|
|
16480
|
+
|
|
16481
|
+
<ItemGroup Condition="'$(IsTestProject)' == 'true' or $(MSBuildProjectName.EndsWith('Tests')) or $(MSBuildProjectName.EndsWith('Test'))">
|
|
16482
|
+
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.*">
|
|
16483
|
+
<PrivateAssets>all</PrivateAssets>
|
|
16484
|
+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
16485
|
+
</PackageReference>
|
|
16486
|
+
</ItemGroup>
|
|
16487
|
+
</Project>
|
|
16488
|
+
`;
|
|
16489
|
+
var TS_STRICT_TSCONFIG = `{
|
|
16490
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
16491
|
+
"compilerOptions": {
|
|
16492
|
+
"strict": true,
|
|
16493
|
+
"allowJs": true,
|
|
16494
|
+
"checkJs": true,
|
|
16495
|
+
"noImplicitOverride": true,
|
|
16496
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
16497
|
+
"noImplicitReturns": true,
|
|
16498
|
+
"noFallthroughCasesInSwitch": true,
|
|
16499
|
+
"noUnusedLocals": true,
|
|
16500
|
+
"noUnusedParameters": true,
|
|
16501
|
+
"noUncheckedIndexedAccess": true,
|
|
16502
|
+
"exactOptionalPropertyTypes": true,
|
|
16503
|
+
"forceConsistentCasingInFileNames": true
|
|
16504
|
+
},
|
|
16505
|
+
"angularCompilerOptions": {
|
|
16506
|
+
"strictInjectionParameters": true,
|
|
16507
|
+
"strictInputAccessModifiers": true,
|
|
16508
|
+
"strictTemplates": true,
|
|
16509
|
+
"strictStandalone": true,
|
|
16510
|
+
"extendedDiagnostics": {
|
|
16511
|
+
"defaultCategory": "error"
|
|
16512
|
+
}
|
|
16513
|
+
}
|
|
16514
|
+
}
|
|
16515
|
+
`;
|
|
16516
|
+
var TS_ESLINT_CONFIG_MJS = `// AI-SDLC: Immutable Strict Coding & Test Rules for TypeScript / JavaScript / Angular
|
|
16517
|
+
import tseslint from "typescript-eslint";
|
|
16518
|
+
|
|
16519
|
+
export default tseslint.config(
|
|
16520
|
+
{
|
|
16521
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
|
|
16522
|
+
extends: [...tseslint.configs.strictTypeChecked],
|
|
16523
|
+
languageOptions: {
|
|
16524
|
+
parserOptions: {
|
|
16525
|
+
projectService: true,
|
|
16526
|
+
},
|
|
16527
|
+
},
|
|
16528
|
+
rules: {
|
|
16529
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
16530
|
+
"@typescript-eslint/ban-ts-comment": "error",
|
|
16531
|
+
"@typescript-eslint/no-floating-promises": "error",
|
|
16532
|
+
"@typescript-eslint/await-thenable": "error",
|
|
16533
|
+
"@typescript-eslint/no-misused-promises": "error",
|
|
16534
|
+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
|
|
16535
|
+
},
|
|
16536
|
+
},
|
|
16537
|
+
{
|
|
16538
|
+
files: ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.js", "**/*.test.js"],
|
|
16539
|
+
rules: {
|
|
16540
|
+
"no-restricted-globals": [
|
|
16541
|
+
"error",
|
|
16542
|
+
{ "name": "fit", "message": "Focused tests (fit) are forbidden by AI-SDLC." },
|
|
16543
|
+
{ "name": "fdescribe", "message": "Focused suites (fdescribe) are forbidden by AI-SDLC." },
|
|
16544
|
+
{ "name": "xit", "message": "Skipped tests (xit) are forbidden by AI-SDLC." },
|
|
16545
|
+
{ "name": "xdescribe", "message": "Skipped suites (xdescribe) are forbidden by AI-SDLC." }
|
|
16546
|
+
]
|
|
16547
|
+
}
|
|
16548
|
+
}
|
|
16549
|
+
);
|
|
16550
|
+
`;
|
|
16551
|
+
var GRADLE_STRICT_INIT_KTS = `// AI-SDLC: Immutable Gradle Strict Compiler & Test Guardrails (Java & Kotlin)
|
|
16552
|
+
allprojects {
|
|
16553
|
+
tasks.withType<JavaCompile>().configureEach {
|
|
16554
|
+
options.compilerArgs.addAll(listOf("-Werror", "-Xlint:all", "-Xlint:-processing"))
|
|
16555
|
+
}
|
|
16556
|
+
tasks.withType<Test>().configureEach {
|
|
16557
|
+
useJUnitPlatform()
|
|
16558
|
+
failOnNoDiscoveredTests.set(true)
|
|
16559
|
+
}
|
|
16560
|
+
}
|
|
16561
|
+
`;
|
|
16562
|
+
var JAVA_PMD_RULESET_XML = `<?xml version="1.0" encoding="UTF-8"?>
|
|
16563
|
+
<ruleset name="AI-SDLC Strict Java & JUnit Rules"
|
|
16564
|
+
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
|
16565
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
16566
|
+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.github.io/schema/ruleset_2_0_0.xsd">
|
|
16567
|
+
<description>AI-SDLC Mandatory Java & Unit Test Verification Rules</description>
|
|
16568
|
+
<rule ref="category/java/bestpractices.xml/JUnitTestsShouldIncludeAssert" />
|
|
16569
|
+
<rule ref="category/java/bestpractices.xml/UnusedLocalVariable" />
|
|
16570
|
+
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod" />
|
|
16571
|
+
<rule ref="category/java/errorprone.xml/EmptyCatchBlock" />
|
|
16572
|
+
</ruleset>
|
|
16573
|
+
`;
|
|
16574
|
+
var KOTLIN_DETEKT_YML = `# AI-SDLC: Immutable Detekt Rules for Kotlin & Unit Tests
|
|
16575
|
+
build:
|
|
16576
|
+
maxIssues: 0
|
|
16577
|
+
|
|
16578
|
+
potential-bugs:
|
|
16579
|
+
active: true
|
|
16580
|
+
IgnoredReturnValue:
|
|
16581
|
+
active: true
|
|
16582
|
+
UnreachableCode:
|
|
16583
|
+
active: true
|
|
16584
|
+
|
|
16585
|
+
exceptions:
|
|
16586
|
+
active: true
|
|
16587
|
+
SwallowedException:
|
|
16588
|
+
active: true
|
|
16589
|
+
EmptyCatchBlock:
|
|
16590
|
+
active: true
|
|
16591
|
+
|
|
16592
|
+
style:
|
|
16593
|
+
active: true
|
|
16594
|
+
ForbiddenAnnotation:
|
|
16595
|
+
active: true
|
|
16596
|
+
annotations:
|
|
16597
|
+
- 'org.junit.jupiter.api.Disabled'
|
|
16598
|
+
- 'org.junit.Ignore'
|
|
16599
|
+
- 'kotlin.test.Ignore'
|
|
16600
|
+
`;
|
|
16601
|
+
var RUST_CARGO_CONFIG_TOML = `# AI-SDLC: Immutable Rust Compiler & Clippy Guardrails
|
|
16602
|
+
[build]
|
|
16603
|
+
rustflags = [
|
|
16604
|
+
"-D", "warnings",
|
|
16605
|
+
"-D", "unused-must-use",
|
|
16606
|
+
"-D", "dead-code",
|
|
16607
|
+
"-D", "clippy::all",
|
|
16608
|
+
"-D", "clippy::unwrap_used",
|
|
16609
|
+
"-D", "clippy::todo",
|
|
16610
|
+
"-D", "clippy::unimplemented",
|
|
16611
|
+
"-D", "clippy::ignore_without_reason",
|
|
16612
|
+
"-D", "clippy::assertions_on_constants"
|
|
16613
|
+
]
|
|
16614
|
+
`;
|
|
16615
|
+
var RUST_CLIPPY_TOML = `# AI-SDLC: Clippy configuration
|
|
16616
|
+
allow-unwrap-in-tests = true
|
|
16617
|
+
`;
|
|
16618
|
+
var GO_GOLANGCI_YML = `# AI-SDLC: Immutable Go & Testing Linter Guardrails
|
|
16619
|
+
run:
|
|
16620
|
+
tests: true
|
|
16621
|
+
|
|
16622
|
+
issues:
|
|
16623
|
+
max-issues-per-linter: 0
|
|
16624
|
+
max-same-issues: 0
|
|
16625
|
+
|
|
16626
|
+
linters:
|
|
16627
|
+
enable:
|
|
16628
|
+
- errcheck
|
|
16629
|
+
- govet
|
|
16630
|
+
- staticcheck
|
|
16631
|
+
- unused
|
|
16632
|
+
- ineffassign
|
|
16633
|
+
- testifylint
|
|
16634
|
+
- thelper
|
|
16635
|
+
- forbidigo
|
|
16636
|
+
|
|
16637
|
+
linters-settings:
|
|
16638
|
+
testifylint:
|
|
16639
|
+
enable-all: true
|
|
16640
|
+
forbidigo:
|
|
16641
|
+
analyze-types: true
|
|
16642
|
+
forbid:
|
|
16643
|
+
- p: ^testing\\.T\\.Skip.*$
|
|
16644
|
+
msg: "Skipping unit tests with t.Skip() is forbidden by AI-SDLC."
|
|
16645
|
+
`;
|
|
16646
|
+
var CPP_CLANG_TIDY = `# AI-SDLC: Immutable C/C++ Clang-Tidy Guardrails
|
|
16647
|
+
Checks: >
|
|
16648
|
+
-*,
|
|
16649
|
+
bugprone-*,
|
|
16650
|
+
cert-*,
|
|
16651
|
+
clang-analyzer-*,
|
|
16652
|
+
cppcoreguidelines-*,
|
|
16653
|
+
modernize-*,
|
|
16654
|
+
performance-*,
|
|
16655
|
+
readability-*
|
|
16656
|
+
WarningsAsErrors: '*'
|
|
16657
|
+
`;
|
|
16658
|
+
var CPP_CMAKE_STRICT = `# AI-SDLC: Immutable C/C++ Compiler & CTest Guardrails
|
|
16659
|
+
if(MSVC)
|
|
16660
|
+
add_compile_options(/W4 /WX /permissive-)
|
|
16661
|
+
else()
|
|
16662
|
+
add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wnull-dereference -Wunused-result)
|
|
16663
|
+
endif()
|
|
16664
|
+
|
|
16665
|
+
set(CMAKE_CXX_CLANG_TIDY "clang-tidy")
|
|
16666
|
+
set(CMAKE_C_CLANG_TIDY "clang-tidy")
|
|
16667
|
+
`;
|
|
16668
|
+
var STARTER_ANTIGRAVITY_HOOKS_JSON = `{
|
|
16669
|
+
"branch-guard": {
|
|
16670
|
+
"enabled": true,
|
|
16671
|
+
"PreToolUse": [
|
|
16672
|
+
{
|
|
16673
|
+
"matcher": "edit_file|write_file",
|
|
16674
|
+
"hooks": [
|
|
16675
|
+
{
|
|
16676
|
+
"type": "command",
|
|
16677
|
+
"command": "node scripts/guard-branch.cjs",
|
|
16678
|
+
"timeout": 10
|
|
16679
|
+
}
|
|
16680
|
+
]
|
|
16681
|
+
}
|
|
16682
|
+
]
|
|
16683
|
+
}
|
|
16684
|
+
}
|
|
16685
|
+
`;
|
|
16686
|
+
var STARTER_AGENT_GUARD_WRAPPER_CJS = `#!/usr/bin/env node
|
|
16687
|
+
// Forwarding wrapper or direct execution from .agent
|
|
16688
|
+
require('../../scripts/guard-branch.cjs');
|
|
16689
|
+
`;
|
|
16690
|
+
var STARTER_GUARD_BRANCH_CJS = `#!/usr/bin/env node
|
|
16691
|
+
/**
|
|
16692
|
+
* AI-SDLC: Antigravity PreToolUse Branch & Immutable Coding Rules Guard Hook
|
|
16693
|
+
* 1. Prevents AI agents from modifying or writing files directly on protected branches (main, master, release/*).
|
|
16694
|
+
* 2. Prevents AI agents from modifying or weakening deployed coding rules files once created.
|
|
16695
|
+
*/
|
|
16696
|
+
|
|
16697
|
+
const { execSync } = require('child_process');
|
|
16698
|
+
const path = require('path');
|
|
16699
|
+
|
|
16700
|
+
const PROTECTED_CODING_RULES_FILES = [
|
|
16701
|
+
'Directory.Build.props',
|
|
16702
|
+
'tsconfig.strict.json',
|
|
16703
|
+
'eslint.config.mjs',
|
|
16704
|
+
'gradle/init.d/aisdlc-strict.init.gradle.kts',
|
|
16705
|
+
'config/pmd/aisdlc-ruleset.xml',
|
|
16706
|
+
'config/detekt/detekt.yml',
|
|
16707
|
+
'.cargo/config.toml',
|
|
16708
|
+
'.clippy.toml',
|
|
16709
|
+
'.golangci.yml',
|
|
16710
|
+
'.clang-tidy',
|
|
16711
|
+
'cmake/AisdlcStrictCompiler.cmake',
|
|
16712
|
+
'.github/CODEOWNERS',
|
|
16713
|
+
];
|
|
16714
|
+
|
|
16715
|
+
function getWorkingBranch(cwd) {
|
|
16716
|
+
try {
|
|
16717
|
+
const sym = execSync('git symbolic-ref --short HEAD', {
|
|
16718
|
+
cwd,
|
|
16719
|
+
encoding: 'utf-8',
|
|
16720
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
16721
|
+
}).trim();
|
|
16722
|
+
if (sym) return sym;
|
|
16723
|
+
} catch {}
|
|
16724
|
+
|
|
16725
|
+
try {
|
|
16726
|
+
return execSync('git rev-parse --abbrev-ref HEAD', {
|
|
16727
|
+
cwd,
|
|
16728
|
+
encoding: 'utf-8',
|
|
16729
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
16730
|
+
}).trim();
|
|
16731
|
+
} catch {}
|
|
16732
|
+
|
|
16733
|
+
return '';
|
|
16734
|
+
}
|
|
16735
|
+
|
|
16736
|
+
function isProtectedCodingRulesTarget(targetPath, cwd) {
|
|
16737
|
+
if (!targetPath) return false;
|
|
16738
|
+
const resolved = path.resolve(cwd, targetPath);
|
|
16739
|
+
|
|
16740
|
+
const norm = resolved.replace(/\\\\/g, '/');
|
|
16741
|
+
const rel = path.relative(cwd, resolved).replace(/\\\\/g, '/');
|
|
16742
|
+
return PROTECTED_CODING_RULES_FILES.some(
|
|
16743
|
+
(ruleFile) => rel === ruleFile || norm.endsWith('/' + ruleFile)
|
|
16744
|
+
) || rel.startsWith('templates/coding-rules/');
|
|
16745
|
+
}
|
|
16746
|
+
|
|
16747
|
+
function evaluateGuardDecision(payload) {
|
|
16748
|
+
const targetPath = payload.toolCall?.args?.Path || '';
|
|
16749
|
+
const workspacePaths = payload.workspacePaths || [];
|
|
16750
|
+
const cwd = workspacePaths[0] || process.cwd();
|
|
16751
|
+
const resolvedPath = targetPath ? path.resolve(cwd, targetPath) : '';
|
|
16752
|
+
const normPath = resolvedPath.replace(/\\\\/g, '/');
|
|
16753
|
+
|
|
16754
|
+
if (isProtectedCodingRulesTarget(resolvedPath, cwd)) {
|
|
16755
|
+
return {
|
|
16756
|
+
decision: 'deny',
|
|
16757
|
+
reason: \`\u274C [AI-SDLC Immutable Coding Rules Guard] BLOCKED: AI agents are forbidden from modifying protected coding rules file '\${path.basename(targetPath)}'. Fix the source or test code to satisfy the compiler/linter rules instead of altering the rule configuration.\`,
|
|
16758
|
+
};
|
|
16759
|
+
}
|
|
16760
|
+
|
|
16761
|
+
if (
|
|
16762
|
+
normPath.includes('/.gemini/') ||
|
|
16763
|
+
normPath.includes('/brain/') ||
|
|
16764
|
+
normPath.includes('/scratch/')
|
|
16765
|
+
) {
|
|
16766
|
+
return { decision: 'allow' };
|
|
16767
|
+
}
|
|
16768
|
+
|
|
16769
|
+
const branch = getWorkingBranch(cwd);
|
|
16770
|
+
if (/^(main|master|release\\/.*)$/.test(branch)) {
|
|
16771
|
+
return {
|
|
16772
|
+
decision: 'deny',
|
|
16773
|
+
reason: \`\u274C [AI-SDLC Security Guard] BLOCKED: Direct file modifications on protected branch '\${branch}' are forbidden. You must create and checkout a new working branch first before editing files (e.g. 'git checkout -b feat/<CHG-ID>-<slug>' or 'git checkout -b task/<PARENT-ID>/<TSK-ID>-<slug>').\`,
|
|
16774
|
+
};
|
|
16775
|
+
}
|
|
16776
|
+
|
|
16777
|
+
return { decision: 'allow' };
|
|
16778
|
+
}
|
|
16779
|
+
|
|
16780
|
+
function main() {
|
|
16781
|
+
let input = '';
|
|
16782
|
+
process.stdin.setEncoding('utf-8');
|
|
16783
|
+
process.stdin.on('data', (chunk) => {
|
|
16784
|
+
input += chunk;
|
|
16785
|
+
});
|
|
16786
|
+
process.stdin.on('end', () => {
|
|
16787
|
+
try {
|
|
16788
|
+
const payload = input.trim() ? JSON.parse(input) : {};
|
|
16789
|
+
console.log(JSON.stringify(evaluateGuardDecision(payload)));
|
|
16790
|
+
} catch {
|
|
16791
|
+
console.log(JSON.stringify({ decision: 'allow' }));
|
|
16792
|
+
}
|
|
16793
|
+
});
|
|
16794
|
+
}
|
|
16795
|
+
|
|
16796
|
+
main();
|
|
16797
|
+
`;
|
|
16798
|
+
var STACK_FILE_MAP = {
|
|
16799
|
+
dotnet: [{ relPath: "Directory.Build.props", content: DOTNET_DIRECTORY_BUILD_PROPS }],
|
|
16800
|
+
typescript: [
|
|
16801
|
+
{ relPath: "tsconfig.strict.json", content: TS_STRICT_TSCONFIG },
|
|
16802
|
+
{ relPath: "eslint.config.mjs", content: TS_ESLINT_CONFIG_MJS }
|
|
16803
|
+
],
|
|
16804
|
+
javascript: [
|
|
16805
|
+
{ relPath: "tsconfig.strict.json", content: TS_STRICT_TSCONFIG },
|
|
16806
|
+
{ relPath: "eslint.config.mjs", content: TS_ESLINT_CONFIG_MJS }
|
|
16807
|
+
],
|
|
16808
|
+
angular: [
|
|
16809
|
+
{ relPath: "tsconfig.strict.json", content: TS_STRICT_TSCONFIG },
|
|
16810
|
+
{ relPath: "eslint.config.mjs", content: TS_ESLINT_CONFIG_MJS }
|
|
16811
|
+
],
|
|
16812
|
+
java: [
|
|
16813
|
+
{ relPath: "gradle/init.d/aisdlc-strict.init.gradle.kts", content: GRADLE_STRICT_INIT_KTS },
|
|
16814
|
+
{ relPath: "config/pmd/aisdlc-ruleset.xml", content: JAVA_PMD_RULESET_XML }
|
|
16815
|
+
],
|
|
16816
|
+
kotlin: [
|
|
16817
|
+
{ relPath: "gradle/init.d/aisdlc-strict.init.gradle.kts", content: GRADLE_STRICT_INIT_KTS },
|
|
16818
|
+
{ relPath: "config/detekt/detekt.yml", content: KOTLIN_DETEKT_YML }
|
|
16819
|
+
],
|
|
16820
|
+
rust: [
|
|
16821
|
+
{ relPath: ".cargo/config.toml", content: RUST_CARGO_CONFIG_TOML },
|
|
16822
|
+
{ relPath: ".clippy.toml", content: RUST_CLIPPY_TOML }
|
|
16823
|
+
],
|
|
16824
|
+
go: [{ relPath: ".golangci.yml", content: GO_GOLANGCI_YML }],
|
|
16825
|
+
c: [
|
|
16826
|
+
{ relPath: ".clang-tidy", content: CPP_CLANG_TIDY },
|
|
16827
|
+
{ relPath: "cmake/AisdlcStrictCompiler.cmake", content: CPP_CMAKE_STRICT }
|
|
16828
|
+
],
|
|
16829
|
+
cpp: [
|
|
16830
|
+
{ relPath: ".clang-tidy", content: CPP_CLANG_TIDY },
|
|
16831
|
+
{ relPath: "cmake/AisdlcStrictCompiler.cmake", content: CPP_CMAKE_STRICT }
|
|
16832
|
+
]
|
|
16833
|
+
};
|
|
16834
|
+
function getReferenceCodingRulesTemplates() {
|
|
16835
|
+
return [
|
|
16836
|
+
{ relPath: "templates/coding-rules/dotnet/Directory.Build.props", content: DOTNET_DIRECTORY_BUILD_PROPS },
|
|
16837
|
+
{ relPath: "templates/coding-rules/typescript/tsconfig.strict.json", content: TS_STRICT_TSCONFIG },
|
|
16838
|
+
{ relPath: "templates/coding-rules/typescript/eslint.config.mjs", content: TS_ESLINT_CONFIG_MJS },
|
|
16839
|
+
{ relPath: "templates/coding-rules/jvm/aisdlc-strict.init.gradle.kts", content: GRADLE_STRICT_INIT_KTS },
|
|
16840
|
+
{ relPath: "templates/coding-rules/java/aisdlc-ruleset.xml", content: JAVA_PMD_RULESET_XML },
|
|
16841
|
+
{ relPath: "templates/coding-rules/kotlin/detekt.yml", content: KOTLIN_DETEKT_YML },
|
|
16842
|
+
{ relPath: "templates/coding-rules/rust/config.toml", content: RUST_CARGO_CONFIG_TOML },
|
|
16843
|
+
{ relPath: "templates/coding-rules/rust/.clippy.toml", content: RUST_CLIPPY_TOML },
|
|
16844
|
+
{ relPath: "templates/coding-rules/go/.golangci.yml", content: GO_GOLANGCI_YML },
|
|
16845
|
+
{ relPath: "templates/coding-rules/cpp/.clang-tidy", content: CPP_CLANG_TIDY },
|
|
16846
|
+
{ relPath: "templates/coding-rules/cpp/AisdlcStrictCompiler.cmake", content: CPP_CMAKE_STRICT }
|
|
16847
|
+
];
|
|
16848
|
+
}
|
|
16849
|
+
function hasFileMatching(entries, suffixOrName) {
|
|
16850
|
+
return entries.some((e) => e === suffixOrName || e.endsWith(suffixOrName));
|
|
16851
|
+
}
|
|
16852
|
+
function detectJvmAndNativeStacks(entries, detected) {
|
|
16853
|
+
if (hasFileMatching(entries, "pom.xml") || hasFileMatching(entries, "build.gradle")) {
|
|
16854
|
+
detected.add("java");
|
|
16855
|
+
}
|
|
16856
|
+
if (hasFileMatching(entries, "build.gradle.kts")) {
|
|
16857
|
+
detected.add("java");
|
|
16858
|
+
detected.add("kotlin");
|
|
16859
|
+
}
|
|
16860
|
+
if (hasFileMatching(entries, "Cargo.toml")) detected.add("rust");
|
|
16861
|
+
if (hasFileMatching(entries, "go.mod")) detected.add("go");
|
|
16862
|
+
if (hasFileMatching(entries, "CMakeLists.txt") || hasFileMatching(entries, "Makefile")) {
|
|
16863
|
+
detected.add("cpp");
|
|
16864
|
+
}
|
|
16865
|
+
}
|
|
16866
|
+
function detectProjectStacks(targetDir) {
|
|
16867
|
+
if (!fs8.existsSync(targetDir)) return [];
|
|
16868
|
+
let entries = [];
|
|
16869
|
+
try {
|
|
16870
|
+
entries = fs8.readdirSync(targetDir);
|
|
16871
|
+
} catch {
|
|
16872
|
+
return [];
|
|
16873
|
+
}
|
|
16874
|
+
const detected = /* @__PURE__ */ new Set();
|
|
16875
|
+
if (hasFileMatching(entries, ".sln") || hasFileMatching(entries, ".slnx") || hasFileMatching(entries, ".csproj")) {
|
|
16876
|
+
detected.add("dotnet");
|
|
16877
|
+
}
|
|
16878
|
+
if (hasFileMatching(entries, "angular.json")) detected.add("angular");
|
|
16879
|
+
else if (hasFileMatching(entries, "tsconfig.json")) detected.add("typescript");
|
|
16880
|
+
else if (hasFileMatching(entries, "package.json")) detected.add("javascript");
|
|
16881
|
+
detectJvmAndNativeStacks(entries, detected);
|
|
16882
|
+
return Array.from(detected);
|
|
16883
|
+
}
|
|
16884
|
+
var STACK_ALIASES = {
|
|
16885
|
+
"c#": "dotnet",
|
|
16886
|
+
csharp: "dotnet",
|
|
16887
|
+
cs: "dotnet",
|
|
16888
|
+
net: "dotnet",
|
|
16889
|
+
".net": "dotnet",
|
|
16890
|
+
ts: "typescript",
|
|
16891
|
+
js: "javascript",
|
|
16892
|
+
ng: "angular",
|
|
16893
|
+
kt: "kotlin",
|
|
16894
|
+
rs: "rust",
|
|
16895
|
+
golang: "go",
|
|
16896
|
+
"c++": "cpp",
|
|
16897
|
+
cxx: "cpp"
|
|
16898
|
+
};
|
|
16899
|
+
function parseSingleStackToken(token, out) {
|
|
16900
|
+
if (token === "all") {
|
|
16901
|
+
VALID_CODING_RULE_STACKS.forEach((s) => out.add(s));
|
|
16902
|
+
return true;
|
|
16903
|
+
}
|
|
16904
|
+
const mapped = STACK_ALIASES[token] || token;
|
|
16905
|
+
if (VALID_CODING_RULE_STACKS.includes(mapped)) {
|
|
16906
|
+
out.add(mapped);
|
|
16907
|
+
return true;
|
|
16908
|
+
}
|
|
16909
|
+
return false;
|
|
16910
|
+
}
|
|
16911
|
+
function resolveCodingRuleStacks(stackOption, targetDir) {
|
|
16912
|
+
if (stackOption === void 0 || stackOption === null || stackOption === "") {
|
|
16913
|
+
return { valid: true, stacks: detectProjectStacks(targetDir) };
|
|
16914
|
+
}
|
|
16915
|
+
const rawList = Array.isArray(stackOption) ? stackOption : String(stackOption).split(",");
|
|
16916
|
+
const resolved = /* @__PURE__ */ new Set();
|
|
16917
|
+
for (const raw of rawList) {
|
|
16918
|
+
const token = raw.trim().toLowerCase();
|
|
16919
|
+
if (!token || token === "none" || token === "false") continue;
|
|
16920
|
+
if (!parseSingleStackToken(token, resolved)) {
|
|
16921
|
+
return {
|
|
16922
|
+
valid: false,
|
|
16923
|
+
stacks: [],
|
|
16924
|
+
error: `Unrecognized technology stack: '${raw.trim()}'. Valid options: ${VALID_CODING_RULE_STACKS.join(", ")}, all, none.`
|
|
16925
|
+
};
|
|
16926
|
+
}
|
|
16927
|
+
}
|
|
16928
|
+
return { valid: true, stacks: Array.from(resolved) };
|
|
16929
|
+
}
|
|
16930
|
+
function getCodingRulesFilesForStacks(stacks) {
|
|
16931
|
+
const seen = /* @__PURE__ */ new Set();
|
|
16932
|
+
const files = [];
|
|
16933
|
+
for (const stack of stacks) {
|
|
16934
|
+
const entries = STACK_FILE_MAP[stack] || [];
|
|
16935
|
+
for (const entry of entries) {
|
|
16936
|
+
if (!seen.has(entry.relPath)) {
|
|
16937
|
+
seen.add(entry.relPath);
|
|
16938
|
+
files.push(entry);
|
|
16939
|
+
}
|
|
16940
|
+
}
|
|
16941
|
+
}
|
|
16942
|
+
return files;
|
|
16943
|
+
}
|
|
16944
|
+
function isProtectedCodingRulesFile(filePath, rootDir) {
|
|
16945
|
+
const norm = filePath.replace(/\\/g, "/").replace(/^\.\//, "");
|
|
16946
|
+
const rel = rootDir ? path5.relative(rootDir, path5.resolve(rootDir, filePath)).replace(/\\/g, "/") : norm;
|
|
16947
|
+
if (rel.startsWith("templates/coding-rules/") || norm.includes("/templates/coding-rules/")) {
|
|
16948
|
+
return true;
|
|
16949
|
+
}
|
|
16950
|
+
return PROTECTED_CODING_RULES_FILES.some(
|
|
16951
|
+
(protectedRel) => rel === protectedRel || norm === protectedRel || norm.endsWith("/" + protectedRel)
|
|
16952
|
+
);
|
|
16953
|
+
}
|
|
16004
16954
|
|
|
16005
16955
|
// src/init/index.ts
|
|
16006
16956
|
var VALID_CI_PROVIDERS = ["github", "gitlab", "azure", "bitbucket"];
|
|
@@ -16710,7 +17660,12 @@ function resolveAgentTargets(agents) {
|
|
|
16710
17660
|
}
|
|
16711
17661
|
function appendAntigravityFiles(dirs, files) {
|
|
16712
17662
|
dirs.push(".agent/rules", ".agent/agents", ".agent/skills");
|
|
16713
|
-
files.push(
|
|
17663
|
+
files.push(
|
|
17664
|
+
{ relPath: ".agent/rules/ai-sdlc.md", content: STARTER_ANTIGRAVITY_RULES },
|
|
17665
|
+
{ relPath: ".agent/hooks.json", content: STARTER_ANTIGRAVITY_HOOKS_JSON },
|
|
17666
|
+
{ relPath: ".agent/scripts/guard-branch.cjs", content: STARTER_AGENT_GUARD_WRAPPER_CJS },
|
|
17667
|
+
{ relPath: "scripts/guard-branch.cjs", content: STARTER_GUARD_BRANCH_CJS }
|
|
17668
|
+
);
|
|
16714
17669
|
for (const agent of SPECIALIZED_AGENT_TEMPLATES) {
|
|
16715
17670
|
const content = renderAntigravityAgentFile(agent);
|
|
16716
17671
|
files.push({ relPath: `.agent/agents/${agent.id}.md`, content });
|
|
@@ -16781,24 +17736,25 @@ function collectAgentFiles(targets) {
|
|
|
16781
17736
|
appendMcpFiles(dirs, files);
|
|
16782
17737
|
return { dirs, files };
|
|
16783
17738
|
}
|
|
17739
|
+
function recordDryRunFile(exists, canOverwrite, relPath, results) {
|
|
17740
|
+
if (exists && canOverwrite) results.filesUpdated.push(relPath);
|
|
17741
|
+
else if (!exists) results.filesCreated.push(relPath);
|
|
17742
|
+
}
|
|
17743
|
+
function persistFileToDisk(fullFilePath, content, exists, relPath, results) {
|
|
17744
|
+
const parentDir = path5.dirname(fullFilePath);
|
|
17745
|
+
if (!fs8.existsSync(parentDir)) fs8.mkdirSync(parentDir, { recursive: true });
|
|
17746
|
+
fs8.writeFileSync(fullFilePath, content, "utf-8");
|
|
17747
|
+
if (exists) results.filesUpdated.push(relPath);
|
|
17748
|
+
else results.filesCreated.push(relPath);
|
|
17749
|
+
}
|
|
16784
17750
|
function writeSingleFile(fullFilePath, content, relPath, opts, results) {
|
|
16785
17751
|
const exists = fs8.existsSync(fullFilePath);
|
|
17752
|
+
const canOverwrite = Boolean(opts.force && !PROTECTED_CODING_RULES_FILES.includes(relPath));
|
|
16786
17753
|
if (opts.dryRun) {
|
|
16787
|
-
|
|
16788
|
-
else if (!exists) results.filesCreated.push(relPath);
|
|
17754
|
+
recordDryRunFile(exists, canOverwrite, relPath, results);
|
|
16789
17755
|
return;
|
|
16790
17756
|
}
|
|
16791
|
-
|
|
16792
|
-
if (!fs8.existsSync(parentDir)) {
|
|
16793
|
-
fs8.mkdirSync(parentDir, { recursive: true });
|
|
16794
|
-
}
|
|
16795
|
-
if (!exists) {
|
|
16796
|
-
fs8.writeFileSync(fullFilePath, content, "utf-8");
|
|
16797
|
-
results.filesCreated.push(relPath);
|
|
16798
|
-
} else if (opts.force) {
|
|
16799
|
-
fs8.writeFileSync(fullFilePath, content, "utf-8");
|
|
16800
|
-
results.filesUpdated.push(relPath);
|
|
16801
|
-
}
|
|
17757
|
+
if (!exists || canOverwrite) persistFileToDisk(fullFilePath, content, exists, relPath, results);
|
|
16802
17758
|
}
|
|
16803
17759
|
function writeProjectFiles(destDir, files, dryRun, force) {
|
|
16804
17760
|
const results = { filesCreated: [], filesUpdated: [] };
|
|
@@ -16854,6 +17810,7 @@ var BASE_DIRECTORIES = [
|
|
|
16854
17810
|
"templates/sdd",
|
|
16855
17811
|
"templates/manuals",
|
|
16856
17812
|
"templates/ci",
|
|
17813
|
+
"templates/coding-rules",
|
|
16857
17814
|
"templates/workflow",
|
|
16858
17815
|
"specs",
|
|
16859
17816
|
"reports",
|
|
@@ -16888,25 +17845,32 @@ function createDirectoriesOnDisk(destDir, directories, dryRun) {
|
|
|
16888
17845
|
}
|
|
16889
17846
|
return created;
|
|
16890
17847
|
}
|
|
16891
|
-
function
|
|
16892
|
-
|
|
17848
|
+
function collectPolicyAndSchemaFiles() {
|
|
17849
|
+
return [
|
|
16893
17850
|
{ relPath: "quality-policy.yaml", content: STARTER_QUALITY_POLICY },
|
|
16894
17851
|
{ relPath: "license-policy.yaml", content: STARTER_LICENSE_POLICY },
|
|
16895
17852
|
{ relPath: "privacy-policy.yaml", content: STARTER_PRIVACY_POLICY },
|
|
16896
17853
|
...STARTER_BASE_TEMPLATES,
|
|
16897
17854
|
...STARTER_SCHEMAS.map((s) => ({ relPath: s.relPath, content: s.content })),
|
|
17855
|
+
...getReferenceCodingRulesTemplates()
|
|
17856
|
+
];
|
|
17857
|
+
}
|
|
17858
|
+
function collectArchitectureTemplateFiles(archGranularity) {
|
|
17859
|
+
return getArchitectureTemplates(archGranularity).map((t) => ({
|
|
17860
|
+
relPath: path5.join("templates", "architecture", t.filename).replace(/\\/g, "/"),
|
|
17861
|
+
content: t.content
|
|
17862
|
+
}));
|
|
17863
|
+
}
|
|
17864
|
+
function collectStarterFiles(ciProvider, agentFiles = [], archGranularity = "minimal", stacks = []) {
|
|
17865
|
+
const files = [
|
|
17866
|
+
...collectPolicyAndSchemaFiles(),
|
|
17867
|
+
...getCodingRulesFilesForStacks(stacks),
|
|
16898
17868
|
...getCiWorkflowFiles(ciProvider),
|
|
16899
17869
|
...agentFiles,
|
|
16900
|
-
...
|
|
16901
|
-
relPath: path5.join("templates", "architecture", t.filename).replace(/\\/g, "/"),
|
|
16902
|
-
content: t.content
|
|
16903
|
-
}))
|
|
17870
|
+
...collectArchitectureTemplateFiles(archGranularity)
|
|
16904
17871
|
];
|
|
16905
17872
|
if (ciProvider === "github" || !ciProvider) {
|
|
16906
|
-
files.push({
|
|
16907
|
-
relPath: ".github/PULL_REQUEST_TEMPLATE.md",
|
|
16908
|
-
content: STARTER_GITHUB_PULL_REQUEST_TEMPLATE
|
|
16909
|
-
});
|
|
17873
|
+
files.push({ relPath: ".github/PULL_REQUEST_TEMPLATE.md", content: STARTER_GITHUB_PULL_REQUEST_TEMPLATE });
|
|
16910
17874
|
}
|
|
16911
17875
|
return files;
|
|
16912
17876
|
}
|
|
@@ -16974,7 +17938,7 @@ function mergeDirectories(base, extra) {
|
|
|
16974
17938
|
}
|
|
16975
17939
|
return result;
|
|
16976
17940
|
}
|
|
16977
|
-
function buildInitSuccessResult(destDir, directoriesCreated, filesCreated, filesUpdated, ciProvider, agentsConfigured, architectureGranularity, gitHookInstalled) {
|
|
17941
|
+
function buildInitSuccessResult(destDir, directoriesCreated, filesCreated, filesUpdated, ciProvider, agentsConfigured, architectureGranularity, stacksConfigured, gitHookInstalled) {
|
|
16978
17942
|
return {
|
|
16979
17943
|
success: true,
|
|
16980
17944
|
targetDir: destDir,
|
|
@@ -16984,6 +17948,7 @@ function buildInitSuccessResult(destDir, directoriesCreated, filesCreated, files
|
|
|
16984
17948
|
ciProvider,
|
|
16985
17949
|
agentsConfigured,
|
|
16986
17950
|
architectureGranularity,
|
|
17951
|
+
stacksConfigured,
|
|
16987
17952
|
gitHookInstalled
|
|
16988
17953
|
};
|
|
16989
17954
|
}
|
|
@@ -16994,182 +17959,37 @@ function validateInitOptions(options) {
|
|
|
16994
17959
|
if (!archRes.valid) return { valid: false, archGranularity: "minimal", error: archRes.error };
|
|
16995
17960
|
return { valid: true, ciProvider: ciRes.provider, archGranularity: archRes.granularity };
|
|
16996
17961
|
}
|
|
16997
|
-
function assembleScaffoldingPlan(ciProvider, agents, archGranularity) {
|
|
17962
|
+
function assembleScaffoldingPlan(ciProvider, agents, archGranularity, stacks = []) {
|
|
16998
17963
|
const agentTargets = resolveAgentTargets(agents);
|
|
16999
17964
|
const { dirs: agentDirs, files: agentFiles } = collectAgentFiles(agentTargets);
|
|
17000
17965
|
const directories = mergeDirectories(getBaseDirectories(ciProvider), agentDirs);
|
|
17001
|
-
const starterFiles = collectStarterFiles(ciProvider, agentFiles, archGranularity);
|
|
17966
|
+
const starterFiles = collectStarterFiles(ciProvider, agentFiles, archGranularity, stacks);
|
|
17002
17967
|
return { agentTargets, directories, starterFiles };
|
|
17003
17968
|
}
|
|
17004
|
-
function
|
|
17005
|
-
const
|
|
17006
|
-
const validated = validateInitOptions(options);
|
|
17007
|
-
if (!validated.valid) return buildInitError(destDir, validated.error);
|
|
17008
|
-
const { agentTargets, directories, starterFiles } = assembleScaffoldingPlan(
|
|
17009
|
-
validated.ciProvider,
|
|
17010
|
-
options.agents,
|
|
17011
|
-
validated.archGranularity
|
|
17012
|
-
);
|
|
17969
|
+
function executeScaffoldingOnDisk(destDir, options, ciProvider, archGranularity, stacks) {
|
|
17970
|
+
const { agentTargets, directories, starterFiles } = assembleScaffoldingPlan(ciProvider, options.agents, archGranularity, stacks);
|
|
17013
17971
|
const dirsCreated = createDirectoriesOnDisk(destDir, directories, options.dryRun);
|
|
17014
17972
|
const { filesCreated, filesUpdated } = writeProjectFiles(destDir, starterFiles, options.dryRun, options.force);
|
|
17015
|
-
if (updateConsumerPackageJson(destDir, options.dryRun))
|
|
17016
|
-
filesCreated.push("package.json");
|
|
17017
|
-
}
|
|
17973
|
+
if (updateConsumerPackageJson(destDir, options.dryRun)) filesCreated.push("package.json");
|
|
17018
17974
|
return buildInitSuccessResult(
|
|
17019
17975
|
destDir,
|
|
17020
17976
|
dirsCreated,
|
|
17021
17977
|
filesCreated,
|
|
17022
17978
|
filesUpdated,
|
|
17023
|
-
|
|
17979
|
+
ciProvider,
|
|
17024
17980
|
formatAgentsConfigured(agentTargets),
|
|
17025
|
-
|
|
17981
|
+
archGranularity,
|
|
17982
|
+
stacks,
|
|
17026
17983
|
tryInstallGitHook(destDir, options.dryRun)
|
|
17027
17984
|
);
|
|
17028
17985
|
}
|
|
17029
|
-
|
|
17030
|
-
|
|
17031
|
-
|
|
17032
|
-
|
|
17033
|
-
|
|
17034
|
-
|
|
17035
|
-
|
|
17036
|
-
},
|
|
17037
|
-
{
|
|
17038
|
-
id: "DLP-002-API-TOKEN",
|
|
17039
|
-
description: "Cloud, GitHub, Slack, OpenAI, Stripe, and AWS Access Tokens",
|
|
17040
|
-
pattern: "\\b(?:gh[pousr]_[A-Za-z0-9_]{36,255}|github_pat_[0-9a-zA-Z_]{82}|sk-(?:proj-|live-)?[a-zA-Z0-9_-]{32,}|AKIA[0-9A-Z]{16}|xox[baprs]-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*|(?:sk|rk)_(?:live|test)_[0-9a-zA-Z]{24,99})\\b",
|
|
17041
|
-
replacement: "[REDACTED:API_TOKEN]",
|
|
17042
|
-
enabled: true
|
|
17043
|
-
},
|
|
17044
|
-
{
|
|
17045
|
-
id: "DLP-003-JWT",
|
|
17046
|
-
description: "Plaintext JSON Web Token (JWT)",
|
|
17047
|
-
pattern: "\\beyJ[A-Za-z0-9_-]{10,}\\.eyJ[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,}\\b",
|
|
17048
|
-
replacement: "[REDACTED:JWT_TOKEN]",
|
|
17049
|
-
enabled: true
|
|
17050
|
-
},
|
|
17051
|
-
{
|
|
17052
|
-
id: "DLP-004-CREDIT-CARD",
|
|
17053
|
-
description: "Payment Card Number (13-19 digits formatted)",
|
|
17054
|
-
pattern: "\\b(?:\\d{4}[- ]\\d{4}[- ]\\d{4}[- ]\\d{4}|\\d{16})\\b",
|
|
17055
|
-
replacement: "[REDACTED:CREDIT_CARD]",
|
|
17056
|
-
enabled: true
|
|
17057
|
-
},
|
|
17058
|
-
{
|
|
17059
|
-
id: "DLP-005-EMAIL",
|
|
17060
|
-
description: "Personal or Corporate Email Address",
|
|
17061
|
-
pattern: "\\b[A-Za-z0-9._%+-]+@(?!example\\.com|localhost|test\\.local)[A-Za-z0-9.-]+\\.[A-Za-z]{2,}\\b",
|
|
17062
|
-
replacement: "[REDACTED:EMAIL]",
|
|
17063
|
-
enabled: true
|
|
17064
|
-
},
|
|
17065
|
-
{
|
|
17066
|
-
id: "DLP-006-INTERNAL-URL",
|
|
17067
|
-
description: "Internal Intranet / Corp Service URL",
|
|
17068
|
-
pattern: "https?://(?:[A-Za-z0-9._-]+:[A-Za-z0-9._-]+@|[A-Za-z0-9.-]+\\.(?:internal|corp|intranet|local)\\b)[^\\s\"'`<>]*",
|
|
17069
|
-
replacement: "[REDACTED:INTERNAL_URL]",
|
|
17070
|
-
enabled: true
|
|
17071
|
-
}
|
|
17072
|
-
];
|
|
17073
|
-
function createDefaultDlpPolicy() {
|
|
17074
|
-
return {
|
|
17075
|
-
version: "1.0",
|
|
17076
|
-
enabled: true,
|
|
17077
|
-
zero_data_retention_required: true,
|
|
17078
|
-
rules: [...DEFAULT_DLP_RULES]
|
|
17079
|
-
};
|
|
17080
|
-
}
|
|
17081
|
-
function normalizeParsedRule(raw, idx) {
|
|
17082
|
-
if (typeof raw.pattern !== "string" || !raw.pattern) return null;
|
|
17083
|
-
return {
|
|
17084
|
-
id: typeof raw.id === "string" ? raw.id : `DLP-CUSTOM-${idx + 1}`,
|
|
17085
|
-
description: typeof raw.description === "string" ? raw.description : "Custom DLP rule",
|
|
17086
|
-
pattern: raw.pattern,
|
|
17087
|
-
replacement: typeof raw.replacement === "string" ? raw.replacement : "[REDACTED]",
|
|
17088
|
-
enabled: raw.enabled !== false
|
|
17089
|
-
};
|
|
17090
|
-
}
|
|
17091
|
-
function parseDlpDoc(yamlContent) {
|
|
17092
|
-
let doc;
|
|
17093
|
-
try {
|
|
17094
|
-
doc = yaml3.load(yamlContent);
|
|
17095
|
-
} catch (err) {
|
|
17096
|
-
throw new Error(`[AI-SDLC Fail-Closed] Invalid YAML in dlp-policy: ${err instanceof Error ? err.message : String(err)}`);
|
|
17097
|
-
}
|
|
17098
|
-
if (!doc || typeof doc !== "object" || Array.isArray(doc)) {
|
|
17099
|
-
throw new Error(`[AI-SDLC Fail-Closed] Invalid dlp-policy structure: root must be a YAML mapping`);
|
|
17100
|
-
}
|
|
17101
|
-
const record = doc;
|
|
17102
|
-
if (record.rules !== void 0 && !Array.isArray(record.rules)) {
|
|
17103
|
-
throw new Error(`[AI-SDLC Fail-Closed] Invalid dlp-policy: rules must be an array`);
|
|
17104
|
-
}
|
|
17105
|
-
return record;
|
|
17106
|
-
}
|
|
17107
|
-
function parseDlpPolicy(yamlContent) {
|
|
17108
|
-
const fallback = createDefaultDlpPolicy();
|
|
17109
|
-
if (!yamlContent || !yamlContent.trim()) return fallback;
|
|
17110
|
-
const record = parseDlpDoc(yamlContent);
|
|
17111
|
-
const rawRules = Array.isArray(record.rules) ? record.rules : [];
|
|
17112
|
-
const parsedRules = rawRules.map((r, i) => normalizeParsedRule(r, i)).filter((r) => r !== null);
|
|
17113
|
-
return {
|
|
17114
|
-
version: typeof record.version === "string" ? record.version : "1.0",
|
|
17115
|
-
enabled: record.enabled !== false,
|
|
17116
|
-
zero_data_retention_required: Boolean(record.zero_data_retention_required ?? true),
|
|
17117
|
-
rules: parsedRules.length > 0 ? parsedRules : fallback.rules
|
|
17118
|
-
};
|
|
17119
|
-
}
|
|
17120
|
-
function loadDlpPolicy(rootDir, customPolicyPath) {
|
|
17121
|
-
const base = rootDir || process.cwd();
|
|
17122
|
-
const filePath = customPolicyPath ? path5.isAbsolute(customPolicyPath) ? customPolicyPath : path5.join(base, customPolicyPath) : path5.join(base, "dlp-policy.yaml");
|
|
17123
|
-
if (!fs8.existsSync(filePath)) return createDefaultDlpPolicy();
|
|
17124
|
-
return parseDlpPolicy(fs8.readFileSync(filePath, "utf-8"));
|
|
17125
|
-
}
|
|
17126
|
-
function applySingleDlpRule(text, rule) {
|
|
17127
|
-
if (rule.enabled === false) return { output: text, matches: 0 };
|
|
17128
|
-
try {
|
|
17129
|
-
const regex = new RegExp(rule.pattern, "g");
|
|
17130
|
-
let matches = 0;
|
|
17131
|
-
const output = text.replace(regex, () => {
|
|
17132
|
-
matches++;
|
|
17133
|
-
return rule.replacement;
|
|
17134
|
-
});
|
|
17135
|
-
return { output, matches };
|
|
17136
|
-
} catch {
|
|
17137
|
-
return { output: text, matches: 0 };
|
|
17138
|
-
}
|
|
17139
|
-
}
|
|
17140
|
-
function sanitizeDlpText(text, policy = createDefaultDlpPolicy()) {
|
|
17141
|
-
if (!policy.enabled || !text) {
|
|
17142
|
-
return { sanitizedText: text, redactionCount: 0, triggeredRuleIds: [] };
|
|
17143
|
-
}
|
|
17144
|
-
let current = text;
|
|
17145
|
-
let totalRedactions = 0;
|
|
17146
|
-
const triggered = [];
|
|
17147
|
-
for (const rule of policy.rules) {
|
|
17148
|
-
const res = applySingleDlpRule(current, rule);
|
|
17149
|
-
if (res.matches > 0) {
|
|
17150
|
-
current = res.output;
|
|
17151
|
-
totalRedactions += res.matches;
|
|
17152
|
-
triggered.push(rule.id);
|
|
17153
|
-
}
|
|
17154
|
-
}
|
|
17155
|
-
return {
|
|
17156
|
-
sanitizedText: current,
|
|
17157
|
-
redactionCount: totalRedactions,
|
|
17158
|
-
triggeredRuleIds: triggered
|
|
17159
|
-
};
|
|
17160
|
-
}
|
|
17161
|
-
function sanitizeDlpPayload(payload, policy = createDefaultDlpPolicy()) {
|
|
17162
|
-
if (!policy.enabled || payload === null || payload === void 0) return payload;
|
|
17163
|
-
if (typeof payload === "string") {
|
|
17164
|
-
return sanitizeDlpText(payload, policy).sanitizedText;
|
|
17165
|
-
}
|
|
17166
|
-
const serialized = JSON.stringify(payload);
|
|
17167
|
-
const { sanitizedText } = sanitizeDlpText(serialized, policy);
|
|
17168
|
-
try {
|
|
17169
|
-
return JSON.parse(sanitizedText);
|
|
17170
|
-
} catch {
|
|
17171
|
-
return payload;
|
|
17172
|
-
}
|
|
17986
|
+
function initProject(options = {}) {
|
|
17987
|
+
const destDir = path5.resolve(options.rootDir || process.cwd(), options.targetDir || ".");
|
|
17988
|
+
const validated = validateInitOptions(options);
|
|
17989
|
+
if (!validated.valid) return buildInitError(destDir, validated.error);
|
|
17990
|
+
const stackRes = resolveCodingRuleStacks(options.stack, destDir);
|
|
17991
|
+
if (!stackRes.valid) return buildInitError(destDir, stackRes.error);
|
|
17992
|
+
return executeScaffoldingOnDisk(destDir, options, validated.ciProvider, validated.archGranularity, stackRes.stacks);
|
|
17173
17993
|
}
|
|
17174
17994
|
var CITATION_REGEX = /\b(ARCH-INTRO|JRN|ACT-THREAT|ACT|UC|BR|BC|ABUSE|DATA-ASSET|PRIV-ROPA|HAZ|SEC-ENC|CMP|ADR|SEC-REQ|PRIV-REQ|FR|QR|CHG|TSK|HOF)-[A-Z0-9_-]+/g;
|
|
17175
17995
|
function parseTasksFromDir(changeDirPath, rootDir) {
|
|
@@ -17634,6 +18454,6 @@ function formatInspectResultMarkdown(result) {
|
|
|
17634
18454
|
return lines.join("\n");
|
|
17635
18455
|
}
|
|
17636
18456
|
|
|
17637
|
-
export { ALL_ARCHITECTURE_TEMPLATES, BRANCH_PATTERNS, BddStepRegistry, DEFAULT_DLP_RULES, DEFAULT_EXCLUDED_PATTERNS, DEFAULT_EXCLUDES, DEFAULT_EXTENSIONS, DEFAULT_PRIVACY_POLICY, DEFAULT_SAST_EXCLUDES, GENERAL_SOURCE_EXTENSIONS, KPI_SUMMARY_END_TAG, KPI_SUMMARY_START_TAG, LIFECYCLE_SKILL_TEMPLATES, OpenSpecAdapter, PII_SAST_RULES, PREPARE_COMMIT_MSG_SCRIPT, PRE_COMMIT_SCRIPT, PROMPT_INJECTION_SIGNATURES, PROTECTED_BYPASS_PATTERNS, SARIF_SCHEMA_2_1_0, SARIF_VERSION, SAST_RULES, SCHEMA_SCHEMAS_ARCHITECTURE_ADR_SCHEMA_JSON, SCHEMA_SCHEMAS_ARCHITECTURE_COMPONENT_SCHEMA_JSON, SCHEMA_SCHEMAS_ARCHITECTURE_INTRODUCTION_AND_GOALS_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_MANIFEST_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_QUALITY_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_IDE_MCP_CONFIG_SCHEMA_JSON, SCHEMA_SCHEMAS_MANUALS_PRODUCTION_MANUAL_SCHEMA_JSON, SCHEMA_SCHEMAS_MANUALS_USER_MANUAL_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_DATA_ASSET_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_ROPA_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_ACTOR_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_BOUNDED_CONTEXT_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_BUSINESS_RULE_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_JOURNEY_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_REQUIREMENT_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_TERM_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_USE_CASE_SCHEMA_JSON, SCHEMA_SCHEMAS_SAFETY_HAZARD_SCHEMA_JSON, SCHEMA_SCHEMAS_SAFETY_SAFETY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_DESIGN_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_HANDOFF_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_PROPOSAL_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_RELEASE_KPIS_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_SESSION_TELEMETRY_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_SPEC_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_TASKS_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_ABUSE_CASE_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_ENCLAVE_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_SECURITY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_THREAT_ACTOR_SCHEMA_JSON, SCHEMA_SCHEMAS_WORKFLOW_AGENT_HANDOFF_SCHEMA_JSON, SECRET_RULES, SPECIALIZED_AGENT_TEMPLATES, STARTER_ANTIGRAVITY_MCP, STARTER_ANTIGRAVITY_RULES, STARTER_ARCH_ADR, STARTER_ARCH_ARCHITECTURE_CONSTRAINTS, STARTER_ARCH_COMPONENT, STARTER_ARCH_CONTEXT_AND_SCOPE, STARTER_ARCH_CROSS_CUTTING_CONCEPTS, STARTER_ARCH_DEPLOYMENT_VIEW, STARTER_ARCH_GLOSSARY, STARTER_ARCH_INTRODUCTION_AND_GOALS, STARTER_ARCH_LEVEL_1_WHITEBOX, STARTER_ARCH_QUALITY_REQUIREMENTS, STARTER_ARCH_RISKS_AND_TECHNICAL_DEBT, STARTER_ARCH_RUNTIME_VIEW, STARTER_ARCH_SOLUTION_STRATEGY, STARTER_AZURE_PIPELINES, STARTER_BASE_TEMPLATES, STARTER_BITBUCKET_PIPELINES, STARTER_CLAUDE_RULES, STARTER_COMPLIANCE_LICENSE_MANIFEST_YAML, STARTER_COPILOT_RULES, STARTER_CURSOR_CORE_RULES, STARTER_CURSOR_MCP, STARTER_CURSOR_PRODUCT_RULES, STARTER_CURSOR_QUALITY_RULES, STARTER_GITHUB_CI, STARTER_GITHUB_DEPLOY_DASHBOARD, STARTER_GITHUB_PR_KPI, STARTER_GITHUB_PULL_REQUEST_TEMPLATE, STARTER_GITHUB_SDD_INTEGRATE, STARTER_GITLAB_CI, STARTER_LICENSE_POLICY, STARTER_PRIVACY_POLICY, STARTER_PROCESS_README, STARTER_PULL_REQUEST_TEMPLATE, STARTER_QUALITY_POLICY, STARTER_REQUIREMENT_TEMPLATE, STARTER_SCHEMAS, STARTER_SCHEMAS_MAP, STARTER_TASK_TEMPLATE, STARTER_TEMPLATES_CI_AZURE_PIPELINES_YML, STARTER_TEMPLATES_CI_BITBUCKET_PIPELINES_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_CI_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_DEPLOY_DASHBOARD_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_PR_KPI_SUMMARY_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_SDD_INTEGRATE_ON_MERGE_YML, STARTER_TEMPLATES_CI__GITLAB_CI_YML, STARTER_TEMPLATES_COMPLIANCE_COMMERCIAL_ACQUISITION_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_MANUALS_PRODUCTION_MANUAL_TEMPLATE_MD, STARTER_TEMPLATES_MANUALS_USER_MANUAL_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_DATA_ASSET_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_DPIA_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_PRIVACY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_PRIVACY_ROPA_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_ACTOR_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_BOUNDED_CONTEXT_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_BUSINESS_RULE_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_JOURNEY_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_REQUIREMENT_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_TERM_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_USER_DESIGN_FEEDBACK_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_USE_CASE_TEMPLATE_MD, STARTER_TEMPLATES_SAFETY_HAZARD_TEMPLATE_MD, STARTER_TEMPLATES_SAFETY_SAFETY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_SDD_DESIGN_TEMPLATE_MD, STARTER_TEMPLATES_SDD_HANDOFF_TEMPLATE_YAML, STARTER_TEMPLATES_SDD_PROPOSAL_TEMPLATE_MD, STARTER_TEMPLATES_SDD_PULL_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_SDD_SPEC_TEMPLATE_MD, STARTER_TEMPLATES_SDD_TASKS_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_ABUSE_CASE_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_ENCLAVE_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_SECURITY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_THREAT_ACTOR_TEMPLATE_MD, STARTER_TEMPLATES_WORKFLOW_AGENT_HANDOFF_TEMPLATE_MD, STARTER_VSCODE_MCP, STARTER_WORKFLOW_HANDOFF_TEMPLATE, STARTER__GITHUB_PULL_REQUEST_TEMPLATE_MD, SpecKitAdapter, TYPE_TO_SCHEMA_MAP, UNIT_TEST_SUFFIXES, VALID_AGENT_TARGETS, VALID_ARCHITECTURE_GRANULARITIES, VALID_AUTONOMY_MODES, VALID_CHANGE_PROFILES, VALID_CI_PROVIDERS, aggregateCommitKpiRecords, aggregatePrKpis, aggregateReleaseKpis, analyzeBddVariantsForRequirement, appendRevisionHistoryRow, applyRatchetMode, buildCycloneDxComponent, buildCycloneDxVulnerabilities, buildFeatureFileContent, buildGraphElements, calculateJaccardSimilarity, calculateMetrics, calculateRating, calculateShannonEntropy, canonicalSort, checkGherkinInSync, checkoutTaskBranch, classifyBranch, classifyMetricFromMessage, collectAgentFiles, collectDashboardMetrics, collectHistoricalKpis, computeCanonicalSha256, computeRawSha256, computeSha256, computeViolationSignature, createDefaultDlpPolicy, createDefaultQualityPolicy, depositProductHandoffSidecar, detectActiveChangeForIntegration, detectAuthorIdentity, detectLanguage, detectProfileFromChange, detectPromptInjection, emitCiOutput, evaluateCompoundLicense, evaluateSingleDependency, evaluateVulnerabilityThresholds, executeBddFeature, extractBaselineEntriesFromResults, extractCitations, extractCommitKpisFromRange, extractDirectDepNames, extractFeatureTags, extractFrontmatter, extractFunctions, extractFunctionsBraceLanguages, extractFunctionsPolyglot, extractFunctionsPython, extractFunctionsPythonAst, extractFunctionsTypeScriptAst, extractGherkinBlock, extractGherkinFeatures, extractNormativeText, extractPythonFunctionsPolyglot, extractSemanticContent, findChangeWorkspaceDir, findLicenseFile, formatCommitTrailers, formatInspectResultMarkdown, formatPrKpiMarkdown, formatReleaseKpiMarkdown, generateBranchHierarchyPlan, generateCycloneDxSbom, generateDashboardReport, generateDeterministicUuidV5, generateDuplicatesReportMarkdown, generateGovernanceReportMarkdown, generateLicenseReportMarkdown, generatePdacReportMarkdown, generatePrivacyReportMarkdown, generateQualityReport, generateRopaInventoryMarkdown, generateSastReportMarkdown, generateSecretsReportMarkdown, generateSecuritySarifReport, generateSuppressionsAuditReport, generateTestingCoverageReportMarkdown, generateThirdPartyNotices, generateTraceabilityReportMarkdown, getArchitectureTemplates, getCytoscapeScript, getGitDiffLines, getNextCorrelativeNumber, getSddAdapter, inferArtifactTypeFromId, inferMissingTrailers, initProject, injectKpisIntoPrBody, inspectElement, installGitHooks, integrateSddChange, isCliInstalled, isFunctionReferencedInTests, isGitleaksInstalled, isMetricWorsened, isPathProtectedFromPatch, isPlaceholderOrIgnored, isReportContentSemanticallyEqual, isRequirementArtifact2 as isRequirementArtifact, isSemgrepInstalled, isToolAvailable, loadDlpPolicy, loadPrivacyPolicy, loadProductHandoffSidecar, loadQualityBaseline, locateTaskInActiveChanges, mapSastSeverityToSarifLevel, maskSecret, normalizePath, normalizeSpdxLicense, normalizeUri, orchestrateNativeAstAnalysis, parseCommitTrailers, parseDlpPolicy, parseFeatureDocument, parseFrontmatter, parseFrontmatterId, parseGenericDoc, parseLicensePolicy, parseMarkdownFrontmatter, parseQualityPolicy, parseRequirementFile, parseSecuritySuppression, parseSpecCatalogScope, parseTasksDoc, parseTasksFromContent, parseTrivyVulnerabilities, processPackageDir, readCodeCoverageSummary, readPackageJson, renderAntigravityAgentFile, renderAntigravitySkillFile, renderAutonomyModeSection, renderClaudeAgentFile, renderClaudeSkillFile, renderCopilotAgentFile, renderCopilotSkillFile, renderCursorAgentFile, renderCursorSkillFile, renderDashboardHtml, renderManualsTab, resolveAgentTargets, resolveBranchHierarchy, resolveCiEnvironment, resolveCytoscapePath, resolveDefaultBranchBase, resolveDeterministicDate, resolveFeatureFilePath, resolveGitRef, resolveLicenseFromFile, resolveReleaseBaseBranch, resolveSastCwe, resolveSastOwasp, resolveSchemaForArtifact, resolveTargetFiles, runGitleaksCli, runSemgrepCli, sanitizeDlpPayload, sanitizeDlpText, sanitizeTestCorpus, scaffoldSddChange, scanAllProductHandoffs, scanAllTestArtifacts, scanContentForSecrets, scanFileForPrivacyViolations, scanFileForSast, scanGoDependencies, scanInstalledLicenses, scanManualsInWorkspace, scanMavenDependencies, scanPnpmStore, scanPythonDependencies, scanRustDependencies, scanSubdirectories, scanWithNativeFs, scanWithSyft, scanWithTrivy, serializeSarifDocument, slugify2 as slugify, stripVolatileReportMetadata, syncPdacDigests, tokenizeTitle, updateCitationsInContent, validateAgainstSchema, validateAnchorExistence, validateArtifactSchema, verifyArtifactDuplicates, verifyArtifactsSchemas, verifyLicenses, verifyManuals, verifyPdacGraph, verifyPrivacy, verifyProgressiveFriction, verifyQualityGate, verifySast, verifySddIntegration, verifySecrets, verifyTasksGovernance, verifyTestingCoverage, verifyTraceability, walkDir, walkMdFiles, walkProjectFiles, walkSourceFiles, walkTaskFiles, writeCucumberJsonReport, writeCycloneDxSbom, writeQualityBaseline, writeReleaseKpiReport, writeReportFileIfChanged, writeSecuritySarifReport, writeThirdPartyNotices };
|
|
18457
|
+
export { ALL_ARCHITECTURE_TEMPLATES, BRANCH_PATTERNS, BddStepRegistry, CPP_CLANG_TIDY, CPP_CMAKE_STRICT, DEFAULT_DLP_RULES, DEFAULT_EXCLUDED_PATTERNS, DEFAULT_EXCLUDES, DEFAULT_EXTENSIONS, DEFAULT_PRIVACY_POLICY, DEFAULT_SAST_EXCLUDES, DOTNET_DIRECTORY_BUILD_PROPS, GENERAL_SOURCE_EXTENSIONS, GO_GOLANGCI_YML, GRADLE_STRICT_INIT_KTS, JAVA_PMD_RULESET_XML, KOTLIN_DETEKT_YML, KPI_SUMMARY_END_TAG, KPI_SUMMARY_START_TAG, LIFECYCLE_SKILL_TEMPLATES, OpenSpecAdapter, PII_SAST_RULES, PREPARE_COMMIT_MSG_SCRIPT, PRE_COMMIT_SCRIPT, PROMPT_INJECTION_SIGNATURES, PROTECTED_BYPASS_PATTERNS, PROTECTED_CODING_RULES_FILES, REVIEWER_ROLES, REVIEW_VERDICTS, RUST_CARGO_CONFIG_TOML, RUST_CLIPPY_TOML, SARIF_SCHEMA_2_1_0, SARIF_VERSION, SAST_RULES, SCHEMA_SCHEMAS_ARCHITECTURE_ADR_SCHEMA_JSON, SCHEMA_SCHEMAS_ARCHITECTURE_COMPONENT_SCHEMA_JSON, SCHEMA_SCHEMAS_ARCHITECTURE_INTRODUCTION_AND_GOALS_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_MANIFEST_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_LICENSE_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_COMPLIANCE_QUALITY_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_IDE_MCP_CONFIG_SCHEMA_JSON, SCHEMA_SCHEMAS_MANUALS_PRODUCTION_MANUAL_SCHEMA_JSON, SCHEMA_SCHEMAS_MANUALS_USER_MANUAL_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_DATA_ASSET_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_POLICY_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_PRIVACY_PRIVACY_ROPA_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_ACTOR_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_BOUNDED_CONTEXT_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_BUSINESS_RULE_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_JOURNEY_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_REQUIREMENT_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_TERM_SCHEMA_JSON, SCHEMA_SCHEMAS_PRODUCT_USE_CASE_SCHEMA_JSON, SCHEMA_SCHEMAS_SAFETY_HAZARD_SCHEMA_JSON, SCHEMA_SCHEMAS_SAFETY_SAFETY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_DESIGN_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_HANDOFF_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_PROPOSAL_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_RELEASE_KPIS_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_SESSION_TELEMETRY_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_SPEC_SCHEMA_JSON, SCHEMA_SCHEMAS_SDD_TASKS_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_ABUSE_CASE_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_ENCLAVE_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_SECURITY_REQ_SCHEMA_JSON, SCHEMA_SCHEMAS_SECURITY_THREAT_ACTOR_SCHEMA_JSON, SCHEMA_SCHEMAS_WORKFLOW_AGENT_HANDOFF_SCHEMA_JSON, SECRET_RULES, SPECIALIZED_AGENT_TEMPLATES, STARTER_AGENT_GUARD_WRAPPER_CJS, STARTER_ANTIGRAVITY_HOOKS_JSON, STARTER_ANTIGRAVITY_MCP, STARTER_ANTIGRAVITY_RULES, STARTER_ARCH_ADR, STARTER_ARCH_ARCHITECTURE_CONSTRAINTS, STARTER_ARCH_COMPONENT, STARTER_ARCH_CONTEXT_AND_SCOPE, STARTER_ARCH_CROSS_CUTTING_CONCEPTS, STARTER_ARCH_DEPLOYMENT_VIEW, STARTER_ARCH_GLOSSARY, STARTER_ARCH_INTRODUCTION_AND_GOALS, STARTER_ARCH_LEVEL_1_WHITEBOX, STARTER_ARCH_QUALITY_REQUIREMENTS, STARTER_ARCH_RISKS_AND_TECHNICAL_DEBT, STARTER_ARCH_RUNTIME_VIEW, STARTER_ARCH_SOLUTION_STRATEGY, STARTER_AZURE_PIPELINES, STARTER_BASE_TEMPLATES, STARTER_BITBUCKET_PIPELINES, STARTER_CLAUDE_RULES, STARTER_COMPLIANCE_LICENSE_MANIFEST_YAML, STARTER_COPILOT_RULES, STARTER_CURSOR_CORE_RULES, STARTER_CURSOR_MCP, STARTER_CURSOR_PRODUCT_RULES, STARTER_CURSOR_QUALITY_RULES, STARTER_GITHUB_CI, STARTER_GITHUB_DEPLOY_DASHBOARD, STARTER_GITHUB_PR_KPI, STARTER_GITHUB_PULL_REQUEST_TEMPLATE, STARTER_GITHUB_SDD_INTEGRATE, STARTER_GITLAB_CI, STARTER_GUARD_BRANCH_CJS, STARTER_LICENSE_POLICY, STARTER_PRIVACY_POLICY, STARTER_PROCESS_README, STARTER_PULL_REQUEST_TEMPLATE, STARTER_QUALITY_POLICY, STARTER_REQUIREMENT_TEMPLATE, STARTER_SCHEMAS, STARTER_SCHEMAS_MAP, STARTER_TASK_TEMPLATE, STARTER_TEMPLATES_CI_AZURE_PIPELINES_YML, STARTER_TEMPLATES_CI_BITBUCKET_PIPELINES_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_CI_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_DEPLOY_DASHBOARD_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_PR_KPI_SUMMARY_YML, STARTER_TEMPLATES_CI_GITHUB_WORKFLOWS_SDD_INTEGRATE_ON_MERGE_YML, STARTER_TEMPLATES_CI__GITLAB_CI_YML, STARTER_TEMPLATES_COMPLIANCE_COMMERCIAL_ACQUISITION_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_MANUALS_PRODUCTION_MANUAL_TEMPLATE_MD, STARTER_TEMPLATES_MANUALS_USER_MANUAL_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_DATA_ASSET_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_DPIA_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_PRIVACY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_PRIVACY_PRIVACY_ROPA_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_ACTOR_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_BOUNDED_CONTEXT_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_BUSINESS_RULE_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_JOURNEY_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_REQUIREMENT_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_TERM_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_USER_DESIGN_FEEDBACK_TEMPLATE_MD, STARTER_TEMPLATES_PRODUCT_USE_CASE_TEMPLATE_MD, STARTER_TEMPLATES_SAFETY_HAZARD_TEMPLATE_MD, STARTER_TEMPLATES_SAFETY_SAFETY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_SDD_DESIGN_TEMPLATE_MD, STARTER_TEMPLATES_SDD_HANDOFF_TEMPLATE_YAML, STARTER_TEMPLATES_SDD_PROPOSAL_TEMPLATE_MD, STARTER_TEMPLATES_SDD_PULL_REQUEST_TEMPLATE_MD, STARTER_TEMPLATES_SDD_SPEC_TEMPLATE_MD, STARTER_TEMPLATES_SDD_TASKS_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_ABUSE_CASE_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_ENCLAVE_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_SECURITY_REQ_TEMPLATE_MD, STARTER_TEMPLATES_SECURITY_THREAT_ACTOR_TEMPLATE_MD, STARTER_TEMPLATES_WORKFLOW_AGENT_HANDOFF_TEMPLATE_MD, STARTER_VSCODE_MCP, STARTER_WORKFLOW_HANDOFF_TEMPLATE, STARTER__GITHUB_PULL_REQUEST_TEMPLATE_MD, SpecKitAdapter, TS_ESLINT_CONFIG_MJS, TS_STRICT_TSCONFIG, TYPE_TO_SCHEMA_MAP, UNIT_TEST_SUFFIXES, VALID_AGENT_TARGETS, VALID_ARCHITECTURE_GRANULARITIES, VALID_AUTONOMY_MODES, VALID_CHANGE_PROFILES, VALID_CI_PROVIDERS, VALID_CODING_RULE_STACKS, aggregateCommitKpiRecords, aggregatePrKpis, aggregateReleaseKpis, analyzeBddVariantsForRequirement, appendRevisionHistoryRow, applyRatchetMode, buildCycloneDxComponent, buildCycloneDxVulnerabilities, buildFeatureFileContent, buildGraphElements, calculateJaccardSimilarity, calculateMetrics, calculateRating, calculateShannonEntropy, canonicalSort, checkGherkinInSync, checkoutTaskBranch, classifyBranch, classifyMetricFromMessage, collectAgentFiles, collectDashboardMetrics, collectHistoricalKpis, computeCanonicalSha256, computeRawSha256, computeSha256, computeViolationSignature, createDefaultDlpPolicy, createDefaultQualityPolicy, depositProductHandoffSidecar, detectActiveChangeForIntegration, detectAuthorIdentity, detectLanguage, detectProfileFromChange, detectProjectStacks, detectPromptInjection, emitCiOutput, evaluateCompoundLicense, evaluateSingleDependency, evaluateVulnerabilityThresholds, executeBddFeature, extractBaselineEntriesFromResults, extractCitations, extractCommitKpisFromRange, extractDirectDepNames, extractFeatureTags, extractFrontmatter, extractFunctions, extractFunctionsBraceLanguages, extractFunctionsPolyglot, extractFunctionsPython, extractFunctionsPythonAst, extractFunctionsTypeScriptAst, extractGherkinBlock, extractGherkinFeatures, extractNormativeText, extractPythonFunctionsPolyglot, extractSemanticContent, findChangeWorkspaceDir, findLicenseFile, formatCommitTrailers, formatInspectResultMarkdown, formatPrKpiMarkdown, formatReleaseKpiMarkdown, generateBranchHierarchyPlan, generateCycloneDxSbom, generateDashboardReport, generateDeterministicUuidV5, generateDuplicatesReportMarkdown, generateGovernanceReportMarkdown, generateLicenseReportMarkdown, generatePdacReportMarkdown, generatePrivacyReportMarkdown, generateQualityReport, generateRopaInventoryMarkdown, generateSastReportMarkdown, generateSecretsReportMarkdown, generateSecuritySarifReport, generateSuppressionsAuditReport, generateTestingCoverageReportMarkdown, generateThirdPartyNotices, generateTraceabilityReportMarkdown, getArchitectureTemplates, getCodingRulesFilesForStacks, getCytoscapeScript, getGitDiffLines, getNextCorrelativeNumber, getReferenceCodingRulesTemplates, getSddAdapter, inferArtifactTypeFromId, inferMissingTrailers, initProject, injectKpisIntoPrBody, inspectElement, installGitHooks, integrateSddChange, isCliInstalled, isFunctionReferencedInTests, isGitleaksInstalled, isMetricWorsened, isPathProtectedFromPatch, isPlaceholderOrIgnored, isProtectedCodingRulesFile, isReportContentSemanticallyEqual, isRequirementArtifact2 as isRequirementArtifact, isReviewerRole, isSemgrepInstalled, isToolAvailable, loadDlpPolicy, loadPrivacyPolicy, loadProductHandoffSidecar, loadQualityBaseline, locateTaskInActiveChanges, mapSastSeverityToSarifLevel, maskSecret, normalizePath, normalizeSpdxLicense, normalizeUri, orchestrateNativeAstAnalysis, parseCommitTrailers, parseDlpPolicy, parseFeatureDocument, parseFrontmatter, parseFrontmatterId, parseGenericDoc, parseLicensePolicy, parseMarkdownFrontmatter, parseQualityPolicy, parseRequirementFile, parseSecuritySuppression, parseSpecCatalogScope, parseTasksDoc, parseTasksFromContent, parseTrivyVulnerabilities, processPackageDir, readCodeCoverageSummary, readPackageJson, renderAntigravityAgentFile, renderAntigravitySkillFile, renderAutonomyModeSection, renderClaudeAgentFile, renderClaudeSkillFile, renderCopilotAgentFile, renderCopilotSkillFile, renderCursorAgentFile, renderCursorSkillFile, renderDashboardHtml, renderManualsTab, resolveAgentTargets, resolveBranchHierarchy, resolveCiEnvironment, resolveCodingRuleStacks, resolveCytoscapePath, resolveDefaultBranchBase, resolveDeterministicDate, resolveFeatureFilePath, resolveGitRef, resolveLicenseFromFile, resolveReleaseBaseBranch, resolveSastCwe, resolveSastOwasp, resolveSchemaForArtifact, resolveTargetFiles, runGitleaksCli, runSemgrepCli, sanitizeDlpPayload, sanitizeDlpText, sanitizeTestCorpus, scaffoldSddChange, scanAllProductHandoffs, scanAllTestArtifacts, scanContentForSecrets, scanFileForPrivacyViolations, scanFileForSast, scanGoDependencies, scanInstalledLicenses, scanManualsInWorkspace, scanMavenDependencies, scanPnpmStore, scanPythonDependencies, scanRustDependencies, scanSubdirectories, scanWithNativeFs, scanWithSyft, scanWithTrivy, serializeSarifDocument, slugify2 as slugify, stripVolatileReportMetadata, submitReviewReport, syncPdacDigests, tokenizeTitle, updateCitationsInContent, validateAgainstSchema, validateAnchorExistence, validateArtifactSchema, verifyArtifactDuplicates, verifyArtifactsSchemas, verifyLicenses, verifyManuals, verifyPdacGraph, verifyPrivacy, verifyProgressiveFriction, verifyQualityGate, verifySast, verifySddIntegration, verifySecrets, verifyTasksGovernance, verifyTestingCoverage, verifyTraceability, walkDir, walkMdFiles, walkProjectFiles, walkSourceFiles, walkTaskFiles, writeCucumberJsonReport, writeCycloneDxSbom, writeQualityBaseline, writeReleaseKpiReport, writeReportFileIfChanged, writeSecuritySarifReport, writeThirdPartyNotices };
|
|
17638
18458
|
//# sourceMappingURL=index.js.map
|
|
17639
18459
|
//# sourceMappingURL=index.js.map
|