RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/johnpeterman72/CursorRIPER.sigma

Cursor rule

.cursor/rules/codeprotection.mdc

[object Object]

Cursor rules

Quality

55/100

Scores the file, not the repository.

Length

983 words

8 headings · 0 code blocks

Repository

206

— · pushed 397 days ago

Last changed

3 days ago

First indexed 3 days ago.
johnpeterman72/CursorRIPER.sigma/.cursor/rules/codeprotection.mdcRawGitHub
1---
2description:
3globs:
4alwaysApply: true
5---
6 
7# CursorRIPER♦Ψ 1.0.1
8 
9## 🛡️ Protection Syntax
10 
11Ψ_syntax = {
12 PROTECTED: "PROTECTED - DO NOT MODIFY",
13 GUARDED: "GUARDED - ASK BEFORE MODIFYING",
14 INFO: "INFO - CONTEXT NOTE",
15 DEBUG: "DEBUG - DEBUGGING CODE",
16 TEST: "TEST - TESTING CODE",
17 CRITICAL: "CRITICAL - BUSINESS LOGIC",
18
19 // End markers
20 END_PROTECTED: "END-P - PROTECTED REGION END",
21 END_GUARDED: "END-G - GUARDED REGION END",
22 END_INFO: "END-I - INFO REGION END",
23 END_DEBUG: "END-D - DEBUG REGION END",
24 END_TEST: "END-T - TEST REGION END",
25 END_CRITICAL: "END-C - CRITICAL REGION END"
26}
27 
28## 💬 Language Comment Formats
29 
30Ψ_language_syntax = {
31 js: {prefix: "// ", suffix: ""},
32 ts: {prefix: "// ", suffix: ""},
33 jsx: {prefix: "// ", suffix: ""},
34 tsx: {prefix: "// ", suffix: ""},
35 py: {prefix: "# ", suffix: ""},
36 html: {prefix: "<!-- ", suffix: " -->"},
37 php: {prefix: "// ", suffix: ""},
38 css: {prefix: "/* ", suffix: " */"},
39 scss: {prefix: "/* ", suffix: " */"},
40 java: {prefix: "// ", suffix: ""},
41 rb: {prefix: "# ", suffix: ""},
42 go: {prefix: "// ", suffix: ""},
43 rs: {prefix: "// ", suffix: ""},
44 c: {prefix: "// ", suffix: ""},
45 cpp: {prefix: "// ", suffix: ""},
46 cs: {prefix: "// ", suffix: ""},
47 swift: {prefix: "// ", suffix: ""},
48 kt: {prefix: "// ", suffix: ""},
49 dart: {prefix: "// ", suffix: ""},
50 md: {prefix: "<!-- ", suffix: " -->"},
51 xml: {prefix: "<!-- ", suffix: " -->"},
52 sh: {prefix: "# ", suffix: ""},
53 bash: {prefix: "# ", suffix: ""},
54 sql: {prefix: "-- ", suffix: ""}
55}
56 
57## ⌨️ Command Shortcuts
58 
59Ψ_shorthand = {
60 "!cp": apply_protection(PROTECTED),
61 "!cg": apply_protection(GUARDED),
62 "!ci": apply_protection(INFO),
63 "!cd": apply_protection(DEBUG),
64 "!ct": apply_protection(TEST),
65 "!cc": apply_protection(CRITICAL)
66}
67 
68apply_protection(type) = {
69 detect_language(current_file) ⟶ lang,
70 get_comment_syntax(lang) ⟶ {prefix, suffix},
71 selection = get_editor_selection(),
72
73 // Insert opening marker
74 insert_at_selection_start(prefix + Ψ_syntax[type] + suffix),
75
76 // Insert end marker
77 end_marker = Ψ_syntax["END_" + type],
78 insert_at_selection_end(prefix + end_marker + suffix),
79
80 // Update protection registry
81 Ψ_manage.add(current_file, selection.start_line, selection.end_line, type, "User-added protection")
82}
83 
84## 🔄 Protection Behaviors
85 
86Ψ_behaviors = {
87 PROTECTED: {
88 Ω₁: acknowledge ∧ document,
89 Ω₂: respect_boundaries ∧ alternate_approaches,
90 Ω₃: plan_around ∧ never_include,
91 Ω₄: refuse_modification ∧ report_attempts,
92 Ω₅: verify_untouched ∧ validate
93 },
94 GUARDED: {
95 Ω₁: acknowledge ∧ document,
96 Ω₂: consider_changes ∧ document_rationale,
97 Ω₃: plan_with_permission ∧ alternatives,
98 Ω₄: request_explicit_permission ∧ detail_changes,
99 Ω₅: document_changes ∧ justify
100 },
101 INFO: {
102 Ω₁: acknowledge ∧ use_context,
103 Ω₂: incorporate_context ∧ respect_intent,
104 Ω₃: plan_with_awareness,
105 Ω₄: careful_modification ∧ preserve_intent,
106 Ω₅: verify_context_preserved
107 },
108 DEBUG: {
109 Ω₁: note_debug_purpose,
110 Ω₂: preserve_during_innovation,
111 Ω₃: include_in_development_plan,
112 Ω₄: maintain_during_dev ∧ consider_cleanup,
113 Ω₅: evaluate_necessity
114 },
115 TEST: {
116 Ω₁: document_test_coverage,
117 Ω₂: maintain_test_integrity,
118 Ω₃: ensure_test_coverage,
119 Ω₄: update_with_implementation,
120 Ω₅: verify_test_coverage
121 },
122 CRITICAL: {
123 Ω₁: document_thoroughly,
124 Ω₂: design_with_extreme_care,
125 Ω₃: plan_impact_analysis,
126 Ω₄: comprehensive_review ∧ careful_change,
127 Ω₅: rigorous_validation
128 }
129}
130 
131## 🔍 Protection Scanner
132 
133Ψ_scan = {
134 patterns: {
135 auth: ["login", "authenticate", "credentials", "password", "token"],
136 payment: ["payment", "transaction", "credit", "billing", "invoice"],
137 security: ["encrypt", "decrypt", "hash", "salt", "secure"],
138 core: ["critical", "essential", "main", "primary", "core"],
139 api: ["api", "endpoint", "request", "response", "service"],
140 data: ["database", "query", "record", "store", "retrieve"]
141 },
142
143 detect(file) = {
144 lang = detect_language(file),
145 code = read_file(file),
146 segments = parse(code, lang),
147 analysis = []
148
149 // Track open markers and match with end markers
150 open_markers = []
151
152 for segment in segments:
153 // Check if this is an end marker
154 end_marker_match = match_end_marker(segment)
155 if end_marker_match:
156 if open_markers.length > 0:
157 // Close the most recent matching open marker
158 close_marker(open_markers, end_marker_match, analysis)
159 continue
160
161 // Check if this is an opening marker
162 marker_type = match_protection_marker(segment)
163 if marker_type:
164 open_markers.push({
165 type: marker_type,
166 line: segment.line_number,
167 content: segment
168 })
169 continue
170
171 // Regular code segment - check patterns if not in a marker
172 if open_markers.length == 0:
173 pattern_matches = match_patterns(segment, Ψ_scan.patterns)
174 if pattern_matches:
175 analysis.push({
176 segment: segment,
177 matches: pattern_matches,
178 suggested_level: determine_level(pattern_matches)
179 })
180
181 // Report any unclosed markers
182 for marker in open_markers:
183 analysis.push({
184 segment: marker.content,
185 warning: "Unclosed protection marker",
186 suggested_action: "Add appropriate end marker"
187 })
188
189 return analysis
190 },
191
192 determine_level(matches) = {
193 if matches.intersect(["security", "payment", "auth"]).length > 0:
194 return "PROTECTED"
195 else if matches.intersect(["core", "api"]).length > 0:
196 return "CRITICAL"
197 else if matches.intersect(["data"]).length > 0:
198 return "GUARDED"
199 else:
200 return "INFO"
201 },
202
203 match_end_marker(segment) = {
204 for type in [PROTECTED, GUARDED, INFO, DEBUG, TEST, CRITICAL]:
205 end_marker = "END-" + type.substr(0,1)
206 if segment.includes(end_marker):
207 return type
208 return null
209 },
210
211 close_marker(open_markers, end_type, analysis) = {
212 // Find matching open marker
213 matched_idx = -1
214 for i = open_markers.length - 1; i >= 0; i--:
215 if open_markers[i].type === end_type:
216 matched_idx = i
217 break
218
219 if matched_idx >= 0:
220 // Remove the marker from the open list
221 marker = open_markers.splice(matched_idx, 1)[0]
222 // Process the protection block if needed
223 // (no analysis needed for properly marked protection blocks)
224 else:
225 analysis.push({
226 warning: "Unmatched end marker for " + end_type,
227 suggested_action: "Add appropriate start marker"
228 })
229 }
230}
231 
232## 📊 Protection Management
233 
234Ψ_manage = {
235 add(file, start_line, end_line, level, rationale) = {
236 entry = {
237 file: file,
238 start_line: start_line,
239 end_line: end_line,
240 level: level,
241 added_date: now(),
242 rationale: rationale
243 },
244 update(σ₆.protected_regions, entry)
245 },
246
247 approve(file, start_line, end_line, changes) = {
248 approval = {
249 file: file,
250 start_line: start_line,
251 end_line: end_line,
252 requested_date: now(),
253 approved_date: now(),
254 changes: changes
255 },
256 update(σ₆.guarded_approvals, approval)
257 },
258
259 scan_project() = {
260 results = [],
261 files = list_project_files(),
262
263 for file in files:
264 if is_code_file(file):
265 scan_result = Ψ_scan.detect(file)
266 if scan_result.length > 0:
267 results.push({
268 file: file,
269 findings: scan_result
270 })
271
272 update(σ₆.scan_history, {
273 date: now(),
274 files_scanned: files.length,
275 protections_found: results.length
276 })
277
278 return results
279 }
280}
281 
282## 🔄 Protection Commands
283 
284Ψ_commands = {
285 "/protect-scan": Ψ_manage.scan_project,
286 "/protect-status": report_protection_status,
287 "/protect-add": add_protection_to_selection,
288 "/protect-remove": remove_protection_with_confirmation,
289 "/protect-approve": approve_guarded_modification
290}
291 
292report_protection_status() = {
293 regions = read(σ₆.protected_regions),
294 summary = summarize(regions),
295 return format_report(summary)
296}
297 
298add_protection_to_selection(level) = {
299 selection = get_editor_selection(),
300 file = get_current_file(),
301 lang = detect_language(file),
302 syntax = Ψ_language_syntax[lang],
303
304 // Add start marker
305 start_comment = syntax.prefix + Ψ_syntax[level] + syntax.suffix,
306 insert_at_selection_start(start_comment),
307
308 // Add end marker
309 end_comment = syntax.prefix + Ψ_syntax["END_" + level] + syntax.suffix,
310 insert_at_selection_end(end_comment),
311
312 // Register the protected region
313 Ψ_manage.add(file, selection.start_line, selection.end_line, level, "User-added protection")
314}
315 
316remove_protection_with_confirmation(region_id) = {
317 region = find_region_by_id(region_id),
318 confirm("Are you sure you want to remove protection from this code?"),
319 if confirmed:
320 // Remove both the start and end markers
321 remove_protection_comment(region.file, region.start_line),
322 remove_protection_comment(region.file, region.end_line),
323 remove_from_registry(region_id)
324}
325 
326approve_guarded_modification(region_id, changes) = {
327 region = find_region_by_id(region_id),
328 if region.level != "GUARDED":
329 return error("Only GUARDED code can be approved for modification")
330 else:
331 Ψ_manage.approve(region.file, region.start_line, region.end_line, changes)
332}
333 

Sections

  • CursorRIPER♦Ψ 1.0.1
  • 🛡️ Protection Syntax
  • 💬 Language Comment Formats
  • ⌨️ Command Shortcuts
  • 🔄 Protection Behaviors
  • 🔍 Protection Scanner
  • 📊 Protection Management
  • 🔄 Protection Commands

What it covers

do-notagent-behaviour

Glob targeting

  • [object Object]

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
johnpeterman72
Language
—
License
—
Archived
no

All configs in this repo

Also in johnpeterman72/CursorRIPER.sigma

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
johnpeterman72/CursorRIPER.sigma.cursor/rules/enterprise.mdc · 206Cursor rulesunclassifiedsecuritydeploymentdocs54/1003 days ago
johnpeterman72/CursorRIPER.sigma.cursor/rules/bmad-roles.mdc · 206Cursor rulesunclassifiedsecuritydeployment54/1003 days ago
johnpeterman72/CursorRIPER.sigma.cursor/rules/cursorriper-sigma-mcp.mdc · 206Cursor rulesunclassifiedsetuptestapideployment+276/1003 days ago
johnpeterman72/CursorRIPER.sigma.cursor/rules/mcp-docker.mdc · 206Cursor rulesunclassifiedsecuritydeployment54/1003 days ago
johnpeterman72/CursorRIPER.sigma.cursor/rules/mcp-filesystem.mdc · 206Cursor rulesunclassifiedperformance48/1003 days ago
johnpeterman72/CursorRIPER.sigma.cursor/rules/mcp-github.mdc · 206Cursor rulesunclassifiedsetupgitdeployment50/1003 days ago
johnpeterman72/CursorRIPER.sigma.cursor/rules/mcp-puppeteer.mdc · 206Cursor rulesunclassifiedtestdeployment66/1003 days ago
johnpeterman72/CursorRIPER.sigma.cursor/rules/mcp-websearch.mdc · 206Cursor rulesunclassifieddeploymentdo-not61/1003 days ago
johnpeterman72/CursorRIPER.sigma.cursor/rules/prd-system.mdc · 206Cursor rulesunclassifiedarchdatabaseperformancedeployment58/1003 days ago
johnpeterman72/CursorRIPER.sigma.cursor/rules/quality-gates.mdc · 206Cursor rulesunclassifieddeployment54/1003 days ago
johnpeterman72/CursorRIPER.sigma.cursor/rules/ripersigma-mcp.mdc · 206Cursor rulesunclassifiedsetuptestdatabaseapi+355/1003 days ago
johnpeterman72/CursorRIPER.sigma.cursor/rules/ripersigma1.mdc · 206Cursor rulesunclassifiedperformance48/1003 days ago
johnpeterman72/CursorRIPER.sigma.cursor/rules/ripersigma101codeprotect.mdc · 206Cursor rulesunclassifiedperformance48/1003 days ago
johnpeterman72/CursorRIPER.sigma.cursor/rules/ripersigma102.mdc · 206Cursor rulesunclassifiedperformance48/1003 days ago
johnpeterman72/CursorRIPER.sigma.cursor/rules/ripersigma103.mdc · 206Cursor rulesunclassifiedsecurityperformance40/1003 days ago
johnpeterman72/CursorRIPER.sigma.cursor/rules/ripersigma104.mdc · 206Cursor rulesunclassifiedsecurityperformance40/1003 days ago
johnpeterman72/CursorRIPER.sigma.cursor/rules/ripersigma105.mdc · 206Cursor rulesunclassifiedsecurityperformance40/1003 days ago
Diff against .cursor/rules/enterprise.mdc Diff against .cursor/rules/bmad-roles.mdc Diff against .cursor/rules/cursorriper-sigma-mcp.mdc Diff against .cursor/rules/mcp-docker.mdc Diff against .cursor/rules/mcp-filesystem.mdc Diff against .cursor/rules/mcp-github.mdc Diff against .cursor/rules/mcp-puppeteer.mdc Diff against .cursor/rules/mcp-websearch.mdc Diff against .cursor/rules/prd-system.mdc Diff against .cursor/rules/quality-gates.mdc Diff against .cursor/rules/ripersigma-mcp.mdc Diff against .cursor/rules/ripersigma1.mdc Diff against .cursor/rules/ripersigma101codeprotect.mdc Diff against .cursor/rules/ripersigma102.mdc Diff against .cursor/rules/ripersigma103.mdc Diff against .cursor/rules/ripersigma104.mdc Diff against .cursor/rules/ripersigma105.mdc
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack