Skip to content

Commit 941461a

Browse files
authored
feat: [AG-22] Create Initial MCP Smart Apply Rule (#671)
1 parent 07fe8b4 commit 941461a

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed
File renamed without changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
alwaysApply: false
3+
description: BEFORE declaring task complete and IF there are significant code changes: ensure best security practices are met
4+
---
5+
6+
# Project security best practices
7+
8+
9+
- BEFORE declaring task complete: Run snyk_code_scan tool when a significant change has been made in first party code.
10+
- This shoule only apply for Snyk-supported coding language
11+
- If any security issues are found based on newly introduced or modified code or dependencies, attempt to fix the issues using the results context from Snyk.
12+
- Rescan the code after fixing the issues to ensure that the issues were fixed and that there are no newly introduced issues.
13+
- Repeat this process until no new issues are found.

src/snyk/cli/mcp/mcp.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,10 @@ async function ensureMcpServerInJson(
218218
}
219219

220220
async function readBundledRules(vsCodeContext: vscode.ExtensionContext): Promise<string> {
221-
return await fs.promises.readFile(path.join(vsCodeContext.extensionPath, 'out', 'assets', 'snyk_rules.md'), 'utf8');
221+
return await fs.promises.readFile(
222+
path.join(vsCodeContext.extensionPath, 'out', 'assets', 'snyk_rules_always_apply.md'),
223+
'utf8',
224+
);
222225
}
223226

224227
async function writeLocalRulesForIde(relativeRulesPath: string, rulesContent: string): Promise<void> {

0 commit comments

Comments
 (0)