Skip to content

Instantly share code, notes, and snippets.

View yuvalbl's full-sized avatar

Yuval yuvalbl

  • Earth
View GitHub Profile

Phase 4: Defining AI Memory Bank Interaction Rules (.cursor/rules/memory-bank.mdc)

Goal: To create a dedicated rules file (memory-bank.mdc) that instructs AI assistants (like yourself) on how to effectively utilize and interact with the project's memory bank, which exclusively uses embedded Mermaid diagrams.

  1. Propose Content for memory-bank.mdc:
    • Based on our established memory bank structure (with only embedded diagrams), content guidelines, and the principles of AI interaction discussed, propose the full content for a new file named memory-bank.mdc. This file will reside in the project's .cursor/rules/ directory.
    • The content should be in Markdown format and include:
      • Preamble: A clear statement about the AI's absolute reliance on this memory bank for project context, especially after a "memory reset."
      • Memory Bank Structure Overview:
  • A brief explanation of the memory-bank/ directory.

Objective: To collaboratively create and establish rules for a comprehensive, modular, and maintainable "memory bank" for a large software project. This memory bank will serve as the primary source of structured, persistent context for AI assistants (like yourself) working on this project, ensuring consistent understanding, efficient navigation, effective collaboration, and clear visual explanations where needed.

Phase 0: Prerequisites and Assumptions

Goal: To ensure all necessary conditions and understandings are in place before commencing the memory bank creation process.

Prerequisites for You (AI Assistant):

  • You have read-only access to the project's entire codebase (all relevant repositories, modules, and services). If not, I will provide comprehensive descriptions.
  • You have the capability to understand and analyze code structure, dependencies, and common programming patterns across various languages and frameworks relevant to this project.
  • You can create directories and Markdown
@yuvalbl
yuvalbl / Button.tsx
Last active October 22, 2022 08:32
React and the Missing Children
// Button.tsx
interface Props {
onClick: (event: MouseEvent<HTMLButtonElement>) => void;
children: string;
}
export const Button: FC<Props> = ({ onClick, children }) => {
return (
<button onClick={onClick}>
{children}
</button>
@yuvalbl
yuvalbl / 1_react_docs_spread.jsx
Last active June 22, 2021 19:18
react_spread_attributes
function App1() {
return <Greeting firstName="Ben" lastName="Hector" />;
}
function App2() {
const props = { firstName: 'Ben', lastName: 'Hector' };
return <Greeting {...props} />;
}
@yuvalbl
yuvalbl / 1_apollo_v3_usequery.jsx
Last active November 21, 2020 19:55
Apollo ClientV3 power ups
import { gql, useQuery } from '@apollo/client';
const GET_DOGS = gql`
query GetDogs {
dogs {
id
breed
}
}
`;
@yuvalbl
yuvalbl / text_dnd1.html
Last active October 19, 2020 08:55
Text drag and drop
<div ondragover="allowDrop(event)">
Drop here
</div>
<script>
function allowDrop(ev) {
ev.preventDefault();
}
</script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://unpkg.com/@reactivex/[email protected]/dist/global/Rx.js"></script>
<script src="script.js"></script>
@yuvalbl
yuvalbl / findInFiles.js
Created October 16, 2017 15:51
find in files
const findInFiles = require('find-in-files');
const fs = require('fs');
findInFiles.find('import', 'src', '.ts$')
.then(results => {
const files = Object.keys(results);
files.forEach((file) => {
let result = fs.readFileSync(file, 'utf8');
console.log(result);
@yuvalbl
yuvalbl / test_v8.js
Last active September 30, 2018 06:00
Test cases on v8
// run with :
// node --trace_deopt --allow-natives-syntax FILENAME
function adder(a, b) {
return new Function('a', 'b', 'return b%2 ? a + b : b%3 ? a - b : b%5 ? b / a : a * b')(a, b);
}
function addereval(a, b) {
return eval('b%2 ? a + b : b%3 ? a - b : b%5 ? b / a : a * b');
}