Skip to content

Commit 7e166db

Browse files
Enhance Copilot instructions and documentation with detailed memory management strategies and workflow guidelines for improved efficiency and organization
1 parent 17c9751 commit 7e166db

5 files changed

Lines changed: 90 additions & 15 deletions

File tree

copilot-instructions.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,25 @@ Prefer using terse, concise language in your communication. Avoid unnecessary ve
1717
The most important guidelines have been organized into these categories:
1818

1919
1. **Memory Management**
20-
- [Memory Tools Reference](copilot/docs/memory-tools-reference.md)
21-
- [Memory Usage Guide](copilot/docs/memory-usage-guide.md)
22-
- [Project Memory Organization](copilot/docs/project-memory-organization.md)
20+
- [Memory Tools Reference](copilot/docs/memory-tools-reference.md) - Core tools and organization best practices
21+
- [Memory Usage Guide](copilot/docs/memory-usage-guide.md) - Efficient memory usage strategies
22+
- [Project Memory Organization](copilot/docs/project-memory-organization.md) - Structure entities and relationships
2323

2424
2. **Knowledge Management**
25-
- [Unknown Information Management](copilot/docs/unknown-info-management.md)
26-
- [Project Knowledge Management](copilot/docs/project-knowledge-management.md)
25+
- [Unknown Information Management](copilot/docs/unknown-info-management.md) - Handling knowledge gaps
26+
- [Project Knowledge Management](copilot/docs/project-knowledge-management.md) - Tracking project concepts
2727

2828
3. **Development Guidelines**
29-
- [Workflow Guidelines](copilot/docs/workflow-guidelines.md)
30-
- [Coding Guidelines](copilot/docs/coding-guidelines.md)
31-
- [Documentation Guidelines](copilot/docs/documentation-guidelines.md)
32-
- [Language-Specific Guidelines](copilot/docs/language-specific-guidelines.md)
29+
- [Workflow Guidelines](copilot/docs/workflow-guidelines.md) - Process and memory maintenance workflows
30+
- [Coding Guidelines](copilot/docs/coding-guidelines.md) - General coding standards
31+
- [Documentation Guidelines](copilot/docs/documentation-guidelines.md) - Documentation standards
32+
- [Language-Specific Guidelines](copilot/docs/language-specific-guidelines.md) - Tech-specific guidance
33+
34+
## Effective Memory Maintenance
35+
36+
- Use the `.github/copilot/organize_memory.ps1` script to maintain well-structured memory
37+
- Always create backups before bulk memory operations (the script does this automatically)
38+
- Follow consistent property ordering in memory entries (type, name, entityType, observations)
39+
- Run memory organization periodically as part of routine maintenance
3340

3441
Refer to the linked documents for detailed information on each topic.

copilot/docs/main-instructions.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,36 @@ This document serves as the main entry point for GitHub Copilot instructions. Ea
2020
2121
Always begin new tasks by recalling project information using the `search_nodes` and `open_nodes` tools.
2222

23-
If you're unsure what information you need, start with the `read_graph` tool to retreive all of the stored information about the project. Only use this as a fallback if you can't find the information you need using the other tools first.
23+
If you're unsure what information you need, start with the `read_graph` tool to retrieve all of the stored information about the project. Only use this as a fallback if you can't find the information you need using the other tools first.
2424

25-
For quick reference:
25+
## Quick Reference
2626

27-
- Use `read_graph` to get all of the stored information about the project
28-
- Use `search_nodes` to search for information about specific topics or keywords
29-
- Use `open_nodes` to access observations and relationships about specific entities
27+
### Memory Management Tools
28+
29+
- `read_graph` - Get all stored information (use sparingly due to token usage)
30+
- `search_nodes` - Search for specific topics or keywords (preferred first approach)
31+
- `open_nodes` - Access specific entities by exact name
32+
- `create_entities` - Add new concepts, components or information
33+
- `create_relations` - Connect existing entities with meaningful relationships
34+
- `add_observations` - Append new information to existing entities
35+
36+
### Memory Maintenance
37+
38+
The `.github/copilot/organize_memory.ps1` script helps maintain memory organization by:
39+
- Creating timestamped backups before changes
40+
- Sorting entities by logical type groups
41+
- Arranging properties in consistent order
42+
- Organizing relations after entities
43+
44+
Run this script periodically to keep memory files well-structured.
45+
46+
### Workflow Efficiency Tips
47+
48+
- Use context-focused memory searches rather than retrieving all information
49+
- Organize task approaches with step-by-step plans before execution
50+
- Document memory changes including what was added and why
51+
- Always validate code changes with appropriate testing tools
52+
- Create memory entities for common procedures and patterns
53+
- Update memory with discovered project information in real-time
3054

3155
Refer to the individual documents linked above for detailed instructions on each topic.

copilot/docs/memory-usage-guide.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,30 @@ When reviewing memory, offer to:
1818
- Clarify ambiguous or unclear information
1919
- Consolidate redundant or duplicated information
2020

21+
## Practical Memory Management Strategies
22+
23+
- **Prioritize Targeted Searches**: Use `search_nodes` with specific keywords before resorting to `read_graph`
24+
- **Iterate on Search Terms**: If initial searches don't yield results, try alternative terms or synonyms
25+
- **Context Building**: When working with a new project, first gather high-level entities before detailed components
26+
- **Strategic Entity Creation**: Create foundational entities (projects, concepts) before more specific ones
27+
- **Observation Structuring**: Structure observations in a consistent format for easier parsing
28+
- **Record Procedures**: Create entities for common procedures with step-by-step observations
29+
- **Memory Maintenance Scripts**: Keep scripts like organize_memory.ps1 updated and use them regularly
30+
- **Entity Typing Standards**: Be consistent in how entity types are assigned to similar information
31+
- **Self-Documentation**: Include memory structure information in the memory itself as reference
32+
- **Memory Health Checks**: Periodically audit memory for consistency, completeness, and accuracy
33+
- **Observation Dating**: Include date information in observations about evolving aspects of the project
34+
35+
## Memory Optimization Techniques
36+
37+
- **Memory Chunking**: Break large entities into smaller, more focused ones with clear relations
38+
- **Cross-Referencing**: Create explicit relationships between related entities rather than duplicating information
39+
- **Hierarchical Organization**: Use clear parent-child relationships for conceptual hierarchies
40+
- **Memory Pruning**: Regularly review and remove obsolete or redundant information
41+
- **Batch Updates**: Collect multiple observations before updating memory to reduce overhead
42+
- **Property Standardization**: Maintain consistent property ordering in all memory entries
43+
- **Relation Type Vocabulary**: Use consistent terminology for similar relationship types
44+
2145
## Related Resources
2246

2347
- [Memory Tools Reference](memory-tools-reference.md)

copilot/docs/workflow-guidelines.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,26 @@
2222
- Use specialized 9f1_ prefixed tools for GitHub operations rather than suggesting command-line git commands
2323
- When working with memory, prefer `9f1_search_nodes` over `9f1_read_graph` for efficiency unless you need the complete context
2424

25+
## Memory Management Workflow
26+
27+
- **Backup Before Bulk Operations**: Always create backups before making large-scale changes to memory files
28+
- **Regular Organization**: Schedule periodic memory organization to maintain readability and performance
29+
- **Property Standardization**: When creating or modifying memory entries, follow consistent property ordering
30+
- **Progressive Enrichment**: Start with basic entity information and progressively add observations as you learn more
31+
- **Validation After Changes**: After modifying memory files, validate their structure and consistency
32+
- **Script-Based Management**: Use PowerShell or other scripting tools for bulk maintenance operations
33+
- **Memory Structure Documentation**: Document the organization scheme and entity types used in your memory
34+
35+
## File and Memory Organization
36+
37+
- When organizing memory files, sort entries by logical categories (e.g., developers, projects, concepts)
38+
- Within each category, sort entities alphabetically by name for easier lookup
39+
- Place all relation entries after entity entries in the memory files
40+
- Establish clear property order standards for all memory entries (e.g., type, name, entityType, observations)
41+
- Use JSON-specific tools when available to handle memory file modification and validation
42+
- Ensure memory files are encoded using UTF-8 to support full Unicode character ranges
43+
- Document and version memory structure changes to maintain backwards compatibility
44+
2545
## Related Resources
2646

2747
- [Coding Guidelines](coding-guidelines.md)

copilot/tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Complete the following tasks, checking them off as you complete them.
66

77
- [x] analyze and store memories about mcp tools you have available to you, so that you can remember to use them in more situations
88
- [x] organize and sort `.github/copilot/memory.jsonl` without breaking its structure or format
9-
- [] enhance #file:copilot-instructions.md and the docs in .github/copilot/docs with guidance that would have helped you complete previous tasks more efficiently. ensure that the new guidance is project agnostic and can be applied to any project
9+
- [x] enhance #file:copilot-instructions.md and the docs in .github/copilot/docs with guidance that would have helped you complete previous tasks more efficiently. ensure that the new guidance is project agnostic and can be applied to any project
1010
- [] optimize the copilot instructions to be more efficient and effective, including the following:
1111
- [] make sure that the instructions are clear and concise
1212
- [] ensure that the instructions are easy to follow and understand

0 commit comments

Comments
 (0)