Markdown Converter
Agent skill for markdown-converter
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Be honest and objective: Evaluate all suggestions, ideas, and feedback on their technical merits. Don't be overly complimentary or sycophantic. If something doesn't make sense, doesn't align with best practices, or could be improved, say so directly and constructively. Technical accuracy and project quality take precedence over being agreeable.
Foam is a personal knowledge management and sharing system, built on Visual Studio Code and GitHub. It allows users to organize research, keep re-discoverable notes, write long-form content, and optionally publish it to the web. The main goals are to help users create relationships between thoughts and information, supporting practices like building a "Second Brain" or a "Zettelkasten". Foam is free, open-source, and extensible, giving users ownership and control over their information. The target audience includes individuals interested in personal knowledge management, note-taking, and content creation, particularly those familiar with VS Code and GitHub.
All the following commands are to be executed from the
packages/foam-vscode directory
yarn install - Install dependenciesyarn build - Build all packagesyarn watch - Watch mode for developmentyarn clean - Clean build outputsyarn reset - Full clean, install, and buildyarn test - Run all tests (unit + integration)yarn test:unit - Run unit tests (*.test.ts files and the .spec.ts files marked a vscode-mock friendly)yarn test:e2e - Run only integration tests (*.spec.ts files)yarn lint - Run lintingyarn test-reset-workspace to clean test workspaceUnit tests run in Node.js environment using Jest Integration tests require VS Code extension host When running tests, do not provide additional parameters, they are ignored by the custom runner script. You cannot run just a test, you have to run the whole suite.
Unit tests are named
*.test.ts and integration tests are *.spec.ts. These test files live alongside the code in the src directory. An integration test is one that has a direct or indirect dependency on vscode module.
There is a mock vscode module that can be used to run most integration tests without starting VS Code. Tests that can use this mock are start with the line /* @unit-ready */.
*.test.ts file, run yarn test:unit or inside a *.spec.ts file that starts with /* @unit-ready */ run yarn test:unit*.spec.ts file that does not include /* @unit-ready */ run yarn testWhile in development we mostly want to use
yarn test:unit.
When multiple tests are failing, look at all of them, but only focus on fixing the first one. Once that is fixed, run the test suite again and repeat the process.
When writing tests keep mocking to a bare minimum. Code should be written in a way that is easily testable and if I/O is necessary, it should be done in appropriate temporary directories. Never mock anything that is inside
packages/foam-vscode/src/core/.
Use the utility functions from
test-utils.ts and test-utils-vscode.ts and test-datastore.ts.
To improve readability of the tests, set up the test and tear it down within the test case (as opposed to use other functions like
beforeEach unless it's much better to do it that way)
Never fix a test by adjusting the expectation if the expectation is correct, test must be fixed by addressing the issue with the code.
This is a monorepo using Yarn workspaces with the main VS Code extension in
packages/foam-vscode/.
packages/foam-vscode/src/core/ - Platform-agnostic business logic (NO vscode dependencies)packages/foam-vscode/src/features/ - VS Code-specific features and UIpackages/foam-vscode/src/services/ - service implementations, might have VS Code dependency, but we try keep that to a minimumpackages/foam-vscode/src/test/ - Test utilities and mocksdocs/ - Documentation and user guidesTest files follow
*.test.ts for unit tests and *.spec.ts for integration tests, living alongside the code in src. An integration test is one that has a direct or indirect dependency on vscode package.
Code in
packages/foam-vscode/src/core/ MUST NOT depend on the vscode library or any files outside the core directory. This maintains platform independence.
FoamWorkspace - Central repository managing all resources (notes, attachments)
FoamGraph - Manages relationship graph between resources
ResourceProvider Pattern - Pluggable architecture for different file types
MarkdownProvider for .md filesAttachmentProvider for other file typesDataStore Interface - Abstract file system operations
Features are registered as functions receiving:
(context: ExtensionContext, foamPromise: Promise<Foam>) => void
This allows features to:
*.test.ts - Unit tests using Jest*.spec.ts - Integration tests requiring VS Code extension hostsrc/We build production code together. I handle implementation details while you guide architecture and catch complexity early. When working on an issue, check if a
.agent/tasks/<issue-id>-<sanitized-title>.md exists. If not, suggest whether we should start by doing a research on it (using the /research-issue <issue-id>) command.
Whenever we work together on a task, feel free to challenge my assumptions and ideas and be critical if useful.
Start every feature with: "Let me research the codebase and create a plan before implementing."
/.agent/current-plan.md, before getting started with code changes. Update this file as the work progresses.src/features/ directorysrc/features/index.tspackage.json if neededsrc/core/ (ensure no vscode dependencies)The extension uses VS Code's configuration system with the
foam.* namespace.
You can find all the settings in /packages/foam-vscode/package.json
When adding to
src/core/:
The extension supports both Node.js and browser environments via separate build targets.
docs/user/)Documentation in
docs/user/ must be written for non-technical users. The goal is to help novice users quickly start using features, not to explain technical implementation details.
Writing Guidelines:
To interact with the github repo we will be using the
gh command.
ALWAYS ask before performing a write operation on Github.
# List all issues gh issue list # Filter issues by milestone gh issue list --milestone "v1.0.0" # Filter issues by assignee gh issue list --assignee @me gh issue list --assignee username # Filter issues by label gh issue list --label "bug" gh issue list --label "enhancement,priority-high" # Filter issues by state gh issue list --state open gh issue list --state closed gh issue list --state all # Combine filters gh issue list --milestone "v1.0.0" --label "bug" --assignee @me # View specific issue gh issue view 123 # Create issue gh issue create --title "Bug fix" --body "Description" # Add comment to issue gh issue comment 123 --body "Update comment"
# List all PRs gh pr list # Filter PRs the same way as for filters (for example, here is by milestone) gh pr list --milestone "v1.0.0" # View PR details gh pr view 456 # Create PR gh pr create --title "Feature" --body "Description" # Check out PR locally gh pr checkout 456 # Add review comment gh pr comment 456 --body "LGTM"