Instruction file imported from BjornFrierPedersen/it_sikkerhed_notes (
.cursor/rules/update-index.mdc). Copyright stays with the author.
Update Index Rule
- Match Pattern: When a user writes "update the index" or "update project index" or "update index"
Instructions
IMPORTANT: When this rule is triggered, you MUST start your response by stating: "I'm updating the project index to reflect the current state of the vault." This acknowledgment is required before proceeding with any research or response.
When a user requests to update the index, follow these steps:
- First read the .gitignore file to identify excluded patterns and directories
- Check the current project structure using list_dir on key directories, excluding .gitignore patterns
- Compare the found structure with what's currently in _content/project_index.md
- Identify any new files, directories, or content areas that should be included
- Update the project_index.md file to reflect the current state of the vault
- Provide a summary of the changes made to the index
Process
Initial Setup
- Read the .gitignore file to create a list of excluded patterns
- Ensure that no excluded files or directories are processed
- Handle common ignore patterns like:
- Build directories
- Temporary files
- System files (e.g., .DS_Store)
- IDE configuration files
Project Structure Analysis
- Explore the project structure using list_dir to catalog all content areas
- Start with the root directory
- Examine key directories: Notes, Articles, OWASP Cheatsheets, _content
- Check for any new directories or patterns of content
- Skip any directories or files matching .gitignore patterns
- Read the current project_index.md file
- Identify differences between the actual project structure and the index
Index Update
- Update the index to include:
- New content areas
- New directories or files that represent important topics
- Updated statistics (if applicable)
- Any structural changes
- Maintain the existing organization and formatting of the index
- Ensure no ignored files or directories are included in the index
- Provide a concise summary of what was added or changed
Quality Checks
- Verify that no .gitignore patterns were accidentally included
- Ensure all paths in the index are valid and accessible
- Check that the index maintains its hierarchical structure
- Validate all links and references
Example
Query: "update the index"
Expected Response:
"I'm updating the project index to reflect the current state of the vault."
-
First, I'll check the .gitignore patterns:
Reading .gitignore... Identified excluded patterns... -
Then analyze the project structure:
Scanning directories... Found new content in... -
Finally, update the index:
Updated sections... Added new content areas... Verified against .gitignore...
Followed by a summary of how the index was updated, what new content areas were added, and confirmation of successful update.