ALWAYS create a new git commit after completing each feature, fix, or change. This allows easy reverting if needed.
- One commit per logical change (don't bundle unrelated changes)
- Use descriptive commit messages following conventional commits (e.g.,
feat:,fix:,refactor:) - Commit AFTER updating documentation and verifying the build compiles
ALWAYS update the documentation when making any changes to the codebase. This includes:
- README.md - User-facing documentation
- CHANGELOG.md - Version history (add to [Unreleased] section)
- This CLAUDE.md file - Development instructions
- ideas.md - Feature tracking (mark as completed if from ideas list)
Documentation must be 100% accurate and reflect the current state of the code.
Flowditor is a VSCode extension for security auditors to create and manage "flows" - named collections of functions representing execution paths or logical groupings in a codebase.
flowditor/
├── src/
│ ├── extension.ts # Main entry point, activates extension
│ ├── types.ts # TypeScript interfaces (FlowData, FunctionData, FlowItem)
│ ├── storage/
│ │ └── FlowStorage.ts # Persistence layer (.vscode/flowditor.json)
│ ├── providers/
│ │ ├── FlowsTreeProvider.ts # TreeView data provider
│ │ └── FlowCodeLensProvider.ts # CodeLens provider for in-editor annotations
│ ├── commands/
│ │ └── index.ts # All command implementations
│ └── utils/
│ └── symbols.ts # Symbol provider utilities
├── resources/
│ └── flowditor-icon.svg # Activity bar icon
├── package.json # Extension manifest
└── tsconfig.json # TypeScript config
- Reads/writes flows to
.vscode/flowditor.json - Tracks last used flow in workspaceState (for quick add feature)
- Handles export/import to external JSON files
moveFunctionInFlow()- Reorders functions within a flow
- Implements
TreeDataProvider<FlowItem>andTreeDragAndDropController<FlowItem> - Fetches fresh symbol positions when building tree (handles file changes)
- Groups functions by file URI to minimize symbol provider calls
- Supports drag-and-drop reordering of functions within a flow (with confirmation dialog)
- Implements
CodeLensProviderto show flow membership in editor - Displays clickable annotations above functions that belong to flows
- Builds function-to-flow index for efficient lookup
- Refreshes when flows change via
refresh()method
createFlow- Create new empty flowcreateFlowFromFunction- Create flow with initial functionaddFunctionToFlow- Add function via pickerquickAddFunction- Add function at cursor to last used flowrenameFlow,deleteFlow,removeFunction- ManagementgoToFunction- Navigate with 500ms highlightexpandAll- Expand all flows in treeexportFlows,importFlows- JSON export/import
showFunctionPicker()- QuickPick with visible functions prioritizedgetFunctionAtCursor()- Get function containing cursor position- Filters to callable symbols only (Function, Method, Constructor)
interface FlowData {
id: string;
name: string;
functions: FunctionData[];
createdAt: number;
updatedAt: number;
}interface FunctionData {
id: string;
name: string;
uri: string; // File URI as string
range: {
start: { line: number; character: number };
end: { line: number; character: number };
};
kind: SymbolKind;
}- Extends
vscode.TreeItem - Has
itemType: 'flow' | 'function' - Functions have navigation command attached
| Command ID | Description |
|---|---|
flowditor.createFlow |
Create new flow |
flowditor.createFlowFromFunction |
Create flow from function |
flowditor.addFunctionToFlow |
Add function via picker |
flowditor.quickAddFunction |
Add function at cursor |
flowditor.deleteFlow |
Delete a flow |
flowditor.renameFlow |
Rename a flow |
flowditor.removeFunction |
Remove function from flow |
flowditor.goToFunction |
Navigate to function |
flowditor.exportFlows |
Export to JSON file |
flowditor.importFlows |
Import from JSON file |
flowditor.refreshFlows |
Refresh tree view |
flowditor.expandAll |
Expand all flows |
flowditor.revealInFlow |
Reveal function in sidebar (from CodeLens) |
| Key | Command |
|---|---|
Cmd+Shift+A (Mac) / Ctrl+Shift+A (Win/Linux) |
Quick Add Function |
npm run compile # Compile TypeScript
npm run watch # Watch mode
npm run lint # Run ESLint- Press
F5in VSCode to launch Extension Development Host - Set breakpoints in TypeScript files
- Use Debug Console for output
- Add command definition to
package.jsonundercontributes.commands - Add menu entries if needed under
contributes.menus - Register handler in
src/commands/index.ts - Run
npm run compileto verify build - Update README.md with the new command
- Update CHANGELOG.md (add to [Unreleased] section)
- Commit the changes
- Plan the implementation
- Implement the feature
- Run
npm run compileto verify build - Test thoroughly
- Update README.md
- Update CHANGELOG.md (add to [Unreleased] section)
- Update ideas.md (mark as completed if from ideas list)
- Update this CLAUDE.md if architecture changes
- Commit the changes with a descriptive message (e.g.,
feat: Add <feature name>)
- Flows:
.vscode/flowditor.json(visible file, can be committed to git) - Last used flow: VSCode workspaceState (temporary preference)
When making changes, verify:
- Extension compiles without errors (
npm run compile) - New flows can be created
- Functions can be added via picker
- Quick add works (Cmd+Shift+A)
- Navigation works and highlights function
- Line numbers update when file changes
- Export/import works
- Tree view refreshes correctly
- CodeLens annotations appear above functions in flows
- Clicking CodeLens reveals function in sidebar
- Drag-and-drop reordering works within a flow
// Use refreshAll helper in commands/index.ts
refreshAll(provider, codeLensProvider);
// Or individually:
provider.refresh(); // Refreshes tree view
codeLensProvider.refresh(); // Refreshes CodeLens annotationsconst symbols = await vscode.commands.executeCommand<vscode.DocumentSymbol[]>(
'vscode.executeDocumentSymbolProvider',
uri
);vscode.window.showInformationMessage('Success message');
vscode.window.showWarningMessage('Warning message');
vscode.window.showErrorMessage('Error message');See ideas.md for planned features. When implementing:
- Check the box in ideas.md
- Update README.md
- Update CHANGELOG.md (add to [Unreleased] section)
- Update this file if needed
- Move [Unreleased] changes to a new version section in CHANGELOG.md
- Update version in
package.json - Update Release Notes in README.md
- Run
npm run compileto verify build - Create git tag:
git tag v0.x.x - Publish to marketplace:
vsce publish