🗑️ Remove unused and archived files across multiple directories and update project dependencies in package files
This commit is contained in:
254
.github/copilot-instructions.md
vendored
254
.github/copilot-instructions.md
vendored
@@ -2,24 +2,43 @@
|
||||
|
||||
## Project Overview
|
||||
|
||||
This is a hybrid workspace combining:
|
||||
Hybrid workspace combining Obsidian-style knowledge management with code development. Uses Obsidian MD for VSCode extension (wiki-links, backlinks, graph view) alongside JavaScript/Python development tools.
|
||||
|
||||
- **Documentation**: Obsidian-style knowledge management with wiki-links, backlinks, and graph view
|
||||
- **Code Development**: Bookmarklets, scratchpad code, and project prototypes
|
||||
**Architecture**: Documentation lives in `/docs`, code in `/code`. GitDoc auto-commits on save (1s delay), auto-pushes after commit.
|
||||
|
||||
**Obsidian MD**: This workspace uses the Obsidian MD for VSCode extension, which provides Obsidian features inside VS Code including graph view, backlinks, and Obsidian command palette integration.
|
||||
**Dual Obsidian Vaults**: Both `/docs/projects/memorypalace/` and `/docs/projects/pokemon-professor/` are independent Obsidian vaults edited in both native Obsidian and VS Code. These contain rich project-specific knowledge that can inform code implementations and provide context for related development work.
|
||||
|
||||
## Documentation Guidelines
|
||||
## Critical Workflows
|
||||
|
||||
### Writing Style
|
||||
### Bookmarklet Development
|
||||
|
||||
- Use clear, concise markdown
|
||||
- Employ wiki-style `[[links]]` for connecting notes
|
||||
- Include frontmatter metadata in notes (date, type, tags)
|
||||
- Keep daily notes in `/docs/daily/` with format `daily-YYYY-MM-DD.md`
|
||||
- Place evergreen concept notes in `/docs/concepts/`
|
||||
**Never use CommonJS or require()** - this project uses ES modules exclusively.
|
||||
|
||||
### Note Structure
|
||||
1. Write bookmarklets as **regular, readable JavaScript** in `/code/bookmarklets/`
|
||||
2. Include JSDoc comments (they're stripped during generation)
|
||||
3. Run: `npm run bookmarklet -- code/bookmarklets/your-file.js`
|
||||
4. Generator ([code/utils/bookmarkletMaker.js](../code/utils/bookmarkletMaker.js)) handles:
|
||||
- Comment removal (single/multi-line)
|
||||
- Code minification
|
||||
- IIFE wrapping: `javascript:(function(){...})();`
|
||||
- Clipboard copying
|
||||
|
||||
Example bookmarklet structure:
|
||||
|
||||
```javascript
|
||||
/**
|
||||
* My Bookmarklet - Description
|
||||
*/
|
||||
const elements = document.querySelectorAll('a');
|
||||
elements.forEach(el => {
|
||||
el.style.backgroundColor = 'yellow';
|
||||
});
|
||||
alert(`Found ${elements.length} links!`);
|
||||
```
|
||||
|
||||
### Documentation Workflow
|
||||
|
||||
Notes use Obsidian frontmatter and wiki-linking:
|
||||
|
||||
```markdown
|
||||
---
|
||||
@@ -29,163 +48,92 @@ tags: []
|
||||
---
|
||||
|
||||
# Title
|
||||
|
||||
## Overview
|
||||
|
||||
Brief summary
|
||||
|
||||
## Content
|
||||
|
||||
Main content with [[links]]
|
||||
|
||||
## Related
|
||||
|
||||
- [[other-note]]
|
||||
Content with [[wiki-links]]
|
||||
```
|
||||
|
||||
## Code Development Guidelines
|
||||
**File locations by type**:
|
||||
- Quick captures → `/docs/fleeting/`
|
||||
- Refined concepts → `/docs/concepts/`
|
||||
- Project docs → `/docs/projects/`
|
||||
- Daily notes → `/docs/daily/` (format: `daily-YYYY-MM-DD.md`)
|
||||
|
||||
### Bookmarklets (`/code/bookmarklets/`)
|
||||
### Module System (CRITICAL)
|
||||
|
||||
- Write as regular Node.js-compatible JavaScript files
|
||||
- Use modern ES6+ syntax, let/const, etc. (will be minified)
|
||||
- Include JSDoc comments for documentation (removed in final bookmarklet)
|
||||
- Write clear, readable code - the generator handles minification
|
||||
- Use descriptive variable and function names
|
||||
- Test logic in Node.js if possible before converting
|
||||
**ES modules only** - `package.json` has `"type": "module"`:
|
||||
|
||||
**Conversion Process:**
|
||||
```javascript
|
||||
// ✅ Correct
|
||||
import fs from 'fs';
|
||||
import { fileURLToPath } from 'url';
|
||||
export default myFunction;
|
||||
export { helperFunction };
|
||||
|
||||
1. Write bookmarklet as normal `.js` file in `/code/bookmarklets/`
|
||||
2. Run: `npm run bookmarklet -- code/bookmarklets/your-file.js`
|
||||
3. Generator automatically:
|
||||
- Removes all comments
|
||||
- Minifies code
|
||||
- Wraps in IIFE: `javascript:(function(){...})();`
|
||||
- Copies to clipboard
|
||||
4. Paste into browser bookmark URL field
|
||||
// ❌ Never use
|
||||
const fs = require('fs');
|
||||
module.exports = myFunction;
|
||||
```
|
||||
|
||||
### Scratchpad Code (`/code/scratchpad/`)
|
||||
## Project-Specific Conventions
|
||||
|
||||
- This is experimental space - be creative
|
||||
- Add `TODO:` comments for work in progress
|
||||
- Use descriptive variable names
|
||||
- Include usage examples
|
||||
- Python: Follow PEP 8 style
|
||||
- JavaScript/TypeScript: Use modern ES6+ syntax
|
||||
### File Naming
|
||||
- Markdown: `kebab-case.md`
|
||||
- JavaScript: `kebab-case.js`
|
||||
- Python: `snake_case.py`
|
||||
- Templates in `/code/templates/` show module patterns
|
||||
|
||||
### Code Style
|
||||
### Git Commits
|
||||
GitDoc auto-commits, but for manual commits use conventional format:
|
||||
- `docs:` - Documentation changes
|
||||
- `feat:` - New features
|
||||
- `fix:` - Bug fixes
|
||||
- `refactor:` - Code restructuring
|
||||
- `chore:` - Maintenance
|
||||
|
||||
- **Python**: PEP 8, type hints preferred
|
||||
- **JavaScript**: Modern ES6+, const/let over var, **ES modules (import/export)**
|
||||
- **TypeScript**: Explicit types, interfaces over types
|
||||
- Comments: Explain _why_, not _what_
|
||||
- Functions: Single responsibility, descriptive names
|
||||
### Code Organization
|
||||
- `/code/bookmarklets/` - Browser utilities (final destination)
|
||||
- `/code/scratchpad/` - Experiments, organized by language
|
||||
- `/code/junk-drawer/` - WIP items, miscellaneous scripts
|
||||
- `/code/templates/` - Reusable patterns (ES module examples)
|
||||
- `/code/utils/` - Build tools (bookmarklet generator, README updater)
|
||||
|
||||
### Module System
|
||||
### README Synchronization
|
||||
**Update READMEs when changing structure** - multiple READMEs mirror folder organization:
|
||||
- `/README.md` - Main overview
|
||||
- `/docs/README.md` - Documentation guide
|
||||
- `/code/README.md` - Code overview
|
||||
- `/code/bookmarklets/README.md` - Bookmarklet guide
|
||||
|
||||
**This project uses ES modules (import/export), not CommonJS (require).**
|
||||
## Extensions & Tools Context
|
||||
|
||||
- Use `import` for dependencies: `import fs from 'fs';`
|
||||
- Use `export` for exporting: `export default myFunction;` or `export { myFunction };`
|
||||
- Package.json is configured with `"type": "module"`
|
||||
- Use `.js` extension for ES modules
|
||||
- For Node.js built-ins requiring special handling: `import { fileURLToPath } from 'url';`
|
||||
Workspace configured for:
|
||||
- Obsidian MD for VSCode - wiki-links, graph view, daily notes
|
||||
- Code Runner - Execute Python/JS/TS directly (`runInTerminal: true`)
|
||||
- Todo Tree - Tracks TODO, FIXME, NOTE, IDEA, HACK, QUESTION tags
|
||||
- GitDoc - Auto-commit delay 1000ms, pulls on open
|
||||
- Settings in `.vscode/settings.json` override defaults
|
||||
|
||||
## File Organization
|
||||
## Key Implementation Details
|
||||
|
||||
### When to Create Files
|
||||
### Auto-Save & GitDoc
|
||||
Files auto-save after 1s (`files.autoSaveDelay: 1000`), GitDoc commits 1s after save. **Changes are pushed automatically** - no manual git commands needed during normal workflow.
|
||||
|
||||
- **Fleeting notes**: Quick captures, temporary thoughts → `/docs/fleeting/`
|
||||
- **Concept notes**: Refined ideas, evergreen content → `/docs/concepts/`
|
||||
- **Project docs**: Specific project documentation → `/docs/projects/`
|
||||
- **Bookmarklets**: Browser utilities → `/code/bookmarklets/`
|
||||
- **Experiments**: Testing/learning → `/code/scratchpad/`
|
||||
### Code Execution
|
||||
Code Runner configured with:
|
||||
- JavaScript: `node` (ES module compatible)
|
||||
- Python: `python3`
|
||||
- TypeScript: `ts-node`
|
||||
- Always saves file before running
|
||||
|
||||
### Naming Conventions
|
||||
### Obsidian Configuration
|
||||
- Vault path: root workspace directory
|
||||
- Daily notes: `docs/daily/daily-YYYY-MM-DD.md`
|
||||
- New notes: `docs/` by default
|
||||
- Attachments: `docs/assets/`
|
||||
|
||||
- Documentation: `kebab-case.md` (e.g., `my-note.md`)
|
||||
- JavaScript: `kebab-case.js` (e.g., `my-bookmarklet.js`)
|
||||
- Python: `snake_case.py` (e.g., `my_script.py`)
|
||||
- TypeScript: `kebab-case.ts` (e.g., `my-module.ts`)
|
||||
## Development Preferences
|
||||
|
||||
## Git Commit Practices
|
||||
|
||||
GitDoc auto-commits on save. For manual commits:
|
||||
|
||||
- Use conventional commits: `type: description`
|
||||
- Types: `docs:`, `feat:`, `fix:`, `refactor:`, `chore:`
|
||||
- Examples:
|
||||
- `docs: add note on memory techniques`
|
||||
- `feat: create bookmark highlighter bookmarklet`
|
||||
- `fix: correct regex in search bookmarklet`
|
||||
|
||||
## Special Considerations
|
||||
|
||||
### Cross-Linking
|
||||
|
||||
When suggesting note connections:
|
||||
|
||||
- Look for conceptual relationships
|
||||
- Suggest bidirectional links
|
||||
- Consider creating index notes for related topics
|
||||
|
||||
### Code Reusability
|
||||
|
||||
- Create templates in `/code/templates/` for common patterns
|
||||
- Extract reusable functions into utility modules
|
||||
- Document APIs and interfaces
|
||||
|
||||
### Search & Discovery
|
||||
|
||||
- Use descriptive titles and headers
|
||||
- Include relevant tags in frontmatter
|
||||
- Add aliases for alternative terms
|
||||
- Consider TODO tags: `TODO:`, `FIXME:`, `NOTE:`, `IDEA:`
|
||||
|
||||
## Preferences
|
||||
|
||||
- **Brevity**: Favor concise, clear explanations
|
||||
- **Examples**: Include practical examples in code
|
||||
- **Context**: Assume this is a personal knowledge workspace
|
||||
- **Flexibility**: This is a scratchpad - prioritize exploration over perfection
|
||||
- **Learning**: Explain concepts when introducing new patterns or techniques
|
||||
|
||||
## README Maintenance
|
||||
|
||||
**IMPORTANT**: Keep README files synchronized with project structure changes.
|
||||
|
||||
### When to Update READMEs
|
||||
|
||||
Update relevant README.md files whenever you:
|
||||
|
||||
- Add or remove folders
|
||||
- Change file organization
|
||||
- Add new tools or utilities
|
||||
- Modify workflows or conventions
|
||||
- Add new features or capabilities
|
||||
|
||||
### README Locations
|
||||
|
||||
- `/README.md` - Main project overview and quick start
|
||||
- `/docs/README.md` - Documentation hub and note-taking guide
|
||||
- `/code/README.md` - Code section overview
|
||||
- `/code/bookmarklets/README.md` - Bookmarklet creation guide
|
||||
- `/.github/README.md` - GitHub templates and structure
|
||||
|
||||
### Update Guidelines
|
||||
|
||||
- Keep structure diagrams accurate
|
||||
- Update examples to reflect current patterns
|
||||
- Maintain consistency across all READMEs
|
||||
- Add new sections before implementation when adding major features
|
||||
- Remove outdated information immediately
|
||||
|
||||
## Tools & Extensions Available
|
||||
|
||||
- Obsidian MD for VSCode (wiki-links, backlinks, graph view, daily notes, Obsidian integration)
|
||||
- Code Runner (quick code execution)
|
||||
- Todo Tree (tracks TODO comments)
|
||||
- Bookmarks (mark important code locations)
|
||||
- ESLint (JavaScript linting)
|
||||
- GitDoc (auto-commit on save)
|
||||
- **Exploration over perfection** - This is a personal scratchpad
|
||||
- **Document why, not what** - Code should be self-explanatory
|
||||
- **Practical examples** - Include usage examples in code
|
||||
- **Cross-link liberally** - Wiki-links create knowledge connections
|
||||
- **Track todos inline** - Use TODO/FIXME/NOTE comments (Todo Tree finds them)
|
||||
|
||||
Reference in New Issue
Block a user