# Documentation Audit and Corrections
## Summary
- Fixed incorrect test directory reference in AGENTS.md (`tests-ui/` →
removed)
- Updated outdated timestamps in composables and stores READMEs
- Fixed critical workflow name error in create-frontend-release command
- Removed misleading i18n workflow warnings from release documentation
## Changes Made
### AGENTS.md
- **Line 24**: Removed non-existent `tests-ui/` directory from test file
locations
- Unit/component tests are located in `src/**/*.test.ts` only
- **Line 267**: Removed `tests-ui` from repository navigation guidance
### src/composables/README.md
- **Line 88**: Updated timestamp from "2025-01-30" to "2026-01-30" to
reflect current state
### src/stores/README.md
- **Line 105**: Updated timestamp from "2025-09-01" to "2026-01-29" to
reflect last modification date
### .claude/commands/create-frontend-release.md
- **Line 394**: Fixed critical workflow name error
- Changed `version-bump.yaml` → `release-version-bump.yaml`
- This was causing command failures as the workflow file doesn't exist
- **Lines 446-450**: Removed outdated warning about `update-locales`
workflow adding `[skip ci]`
- No such workflow exists in the repository
- Current i18n workflows are: `i18n-update-core.yaml`,
`i18n-update-custom-nodes.yaml`, `i18n-update-nodes.yaml`
- None of these add `[skip ci]` to commits
- **Lines 464-465**: Removed duplicate critical warning about
non-existent `update-locales` workflow
## Review Notes
### Documentation Accuracy Verification Process
Conducted comprehensive fact-checking of all documentation against the
current codebase:
1. **Configuration Files**: Verified all referenced config files exist
(vite.config.mts, playwright.config.ts, eslint.config.ts, .oxfmtrc.json,
.oxlintrc.json)
2. **Package Scripts**: Validated all npm/pnpm commands referenced in
documentation
3. **Directory Structure**: Confirmed project structure matches
documented layout
4. **Extension Documentation**: Verified TypeScript interface paths and
external resource links
5. **Testing Documentation**: Confirmed test file patterns and framework
references
6. **Command Documentation**: Validated workflow names and GitHub CLI
commands
### Known Documentation Gaps (Not Addressed)
These items were identified but not changed as they represent
aspirational guidance or current migration paths:
1. **docs/guidance/vue-components.md**: Documents Vue 3.5 prop
destructuring pattern (`const { prop } = defineProps<>()`) while
codebase still uses `withDefaults()` in many files
- This is intentional - guidance shows preferred pattern for new code
2. **docs/guidance/playwright.md**: Advises against `waitForTimeout` but
4 test files still use it
- Existing violations are technical debt
3. **AGENTS.md Line 163**: States "Avoid new usage of PrimeVue
components" but some components still use PrimeVue
- Guidance is for new code; existing usage being gradually migrated
4. **docs/guidance/typescript.md**: Discourages `as any` but 11
instances exist in codebase
- Known technical debt
### Additional Findings
- All README files in key directories (composables, stores, services,
extensions, testing) are accurate and comprehensive
- External documentation links (Vue, Tailwind, VueUse, etc.) are valid
- Code examples in documentation are syntactically correct
- i18n structure and paths are correctly documented
## Verification Commands
To verify the fixes:
```bash
# Verify tests-ui directory doesn't exist
ls tests-ui 2>&1 | grep "No such file"
# Verify correct workflow file exists
ls .github/workflows/release-version-bump.yaml
# Verify no workflows add [skip ci]
grep -r "skip ci" .github/workflows/*.yaml || echo "None found (expected)"
# Verify test files are in src/
find src -name "*.test.ts" | wc -l # Should show many test files
```
---------
Co-authored-by: christian-byrne <72887196+christian-byrne@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
13 KiB
Repository Guidelines
See @docs/guidance/*.md for file-type-specific conventions (auto-loaded by glob).
Project Structure & Module Organization
- Source:
src/- Vue 3.5+
- TypeScript
- Tailwind 4
- Key areas:
components/views/stores/(Pinia)composables/services/utils/assets/locales/
- Routing:
src/router.ts, - i18n:
src/i18n.ts, - Entry Point:
src/main.ts. - Tests:
- unit/component in
src/**/*.test.ts - E2E (Playwright) in
browser_tests/**/*.spec.ts
- unit/component in
- Public assets:
public/ - Build output:
dist/ - Configs
vite.config.mtsplaywright.config.tseslint.config.ts.oxfmtrc.json.oxlintrc.json- etc.
Monorepo Architecture
The project uses Nx for build orchestration and task management
Build, Test, and Development Commands
pnpm dev: Start Vite dev server.pnpm dev:electron: Dev server with Electron API mockspnpm build: Type-check then production build todist/pnpm preview: Preview the production build locallypnpm test:unit: Run Vitest unit testspnpm test:browser: Run Playwright E2E tests (browser_tests/)pnpm lint/pnpm lint:fix: Lint (ESLint)pnpm format/pnpm format:check: oxfmtpnpm typecheck: Vue TSC type checkingpnpm storybook: Start Storybook development server
Development Workflow
- Make code changes
- Run relevant tests
- Run
pnpm typecheck,pnpm lint,pnpm format - Check if README updates are needed
- Suggest docs.comfy.org updates for user-facing changes
Git Conventions
- Use
prefix:format:feat:,fix:,test: - Add "Fixes #n" to PR descriptions
- Never mention Claude/AI in commits
Coding Style & Naming Conventions
- Language:
- TypeScript (exclusive, no new JavaScript)
- Vue 3 SFCs (
.vue)- Composition API only
- Tailwind 4 styling
- Avoid
<style>blocks
- Avoid
- Style: (see
.oxfmtrc.json)- Indent 2 spaces
- single quotes
- no trailing semicolons
- width 80
- Imports:
- sorted/grouped by plugin
- run
pnpm formatbefore committing - use separate
import typestatements, not inlinetypein mixed imports- ✅
import type { Foo } from './foo'+import { bar } from './foo' - ❌
import { bar, type Foo } from './foo'
- ✅
- ESLint:
- Vue + TS rules
- no floating promises
- unused imports disallowed
- i18n raw text restrictions in templates
- Naming:
- Vue components in PascalCase (e.g.,
MenuHamburger.vue) - composables
useXyz.ts - Pinia stores
*Store.ts
- Vue components in PascalCase (e.g.,
Commit & Pull Request Guidelines
- PRs:
- Include clear description
- Reference linked issues (e.g.
- Fixes #123) - Keep it extremely concise and information-dense
- Don't use emojis or add excessive headers/sections
- Follow the PR description template in the
.github/folder.
- Quality gates:
pnpm lintpnpm typecheckpnpm knip- Relevant tests must pass
- Never use
--no-verifyto bypass failing tests- Identify the issue and present root cause analysis and possible solutions if you are unable to solve quickly yourself
- Keep PRs focused and small
- If it looks like the current changes will have 300+ lines of non-test code, suggest ways it could be broken into multiple PRs
Security & Configuration Tips
- Secrets: Use
.env(see.env_example); do not commit secrets.
Vue 3 Composition API Best Practices
- Use
<script setup lang="ts">for component logic - Utilize
reffor reactive state - Implement computed properties with computed()
- Use watch and watchEffect for side effects
- Avoid using a
refand awatchif acomputedwould work instead
- Avoid using a
- Implement lifecycle hooks with onMounted, onUpdated, etc.
- Utilize provide/inject for dependency injection
- Do not use dependency injection if a Store or a shared composable would be simpler
- Use Vue 3.5 TypeScript style of default prop declaration
-
Example:
const { nodes, showTotal = true } = defineProps<{ nodes: ApiNodeCost[] showTotal?: boolean }>() -
Prefer reactive props destructuring to
const props = defineProps<...> -
Do not use
withDefaultsor runtime props declaration -
Do not import Vue macros unnecessarily
-
Prefer
defineModelto separately defining a prop and emit for v-model bindings -
Define slots via template usage, not
defineSlots -
Use same-name shorthand for slot prop bindings:
:isExpandedinstead of:is-expanded="isExpanded" -
Derive component types using
vue-component-type-helpers(ComponentProps,ComponentSlots) instead of separate type files -
Be judicious with addition of new refs or other state
- If it's possible to accomplish the design goals with just a prop, don't add a
ref - If it's possible to use the
refor prop directly, don't add acomputed - If it's possible to use a
computedto name and reuse a derived value, don't use awatch
- If it's possible to accomplish the design goals with just a prop, don't add a
-
Development Guidelines
- Leverage VueUse functions for performance-enhancing styles
- Use es-toolkit for utility functions
- Use TypeScript for type safety
- If a complex type definition is inlined in multiple related places, extract and name it for reuse
- In Vue Components, implement proper props and emits definitions
- Utilize Vue 3's Teleport component when needed
- Use Suspense for async components
- Implement proper error handling
- Follow Vue 3 style guide and naming conventions
- Use Vite for fast development and building
- Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json. Use the plurals system in i18n instead of hardcoding pluralization in templates.
- Avoid new usage of PrimeVue components
- Write tests for all changes, especially bug fixes to catch future regressions
- Write code that is expressive and self-documenting to the furthest degree possible. This reduces the need for code comments which can get out of sync with the code itself. Try to avoid comments unless absolutely necessary
- Do not add or retain redundant comments, clean as you go
- Whenever a new piece of code is written, the author should ask themselves 'is there a simpler way to introduce the same functionality?'. If the answer is yes, the simpler course should be chosen
- Refactoring should be used to make complex code simpler
- Try to minimize the surface area (exported values) of each module and composable
- Don't use barrel files, e.g.
/some/package/index.tsto re-export within/src - Keep functions short and functional
- Minimize nesting, e.g.
if () { ... }orfor () { ... } - Avoid mutable state, prefer immutability and assignment at point of declaration
- Favor pure functions (especially testable ones)
- Do not use function expressions if it's possible to use function declarations instead
- Watch out for Code Smells and refactor to avoid them
Testing Guidelines
See @docs/testing/*.md for detailed patterns.
- Frameworks:
- Vitest (unit/component, happy-dom)
- Playwright (E2E)
- Test files:
- Unit/Component:
**/*.test.ts - E2E:
browser_tests/**/*.spec.ts - Litegraph Specific:
src/lib/litegraph/test/
- Unit/Component:
General
- Do not write change detector tests
e.g. a test that just asserts that the defaults are certain values - Do not write tests that are dependent on non-behavioral features like utility classes or styles
- Be parsimonious in testing, do not write redundant tests
See https://tidyfirst.substack.com/p/composable-tests - Don’t Mock What You Don’t Own
Vitest / Unit Tests
- Do not write tests that just test the mocks
Ensure that the tests fail when the code itself would behave in a way that was not expected or desired - For mocking, leverage Vitest's utilities where possible
- Keep your module mocks contained
Do not use global mutable state within the test file
Usevi.hoisted()if necessary to allow for per-test Arrange phase manipulation of deeper mock state - For Component testing, use Vue Test Utils and especially follow the advice about making components easy to test
- Aim for behavioral coverage of critical and new features
Playwright / Browser / E2E Tests
- Follow the Best Practices described in the Playwright documentation
- Do not use waitForTimeout, use Locator actions and retrying assertions
- Tags like
@mobile,@2xare respected by config and should be used for relevant tests
External Resources
- Vue: https://vuejs.org/api/
- Tailwind: https://tailwindcss.com/docs/styling-with-utility-classes
- VueUse: https://vueuse.org/functions.html
- shadcn/vue: https://www.shadcn-vue.com/
- Reka UI: https://reka-ui.com/
- PrimeVue: https://primevue.org
- ComfyUI: https://docs.comfy.org
- Electron: https://www.electronjs.org/docs/latest/
- Wiki: https://deepwiki.com/Comfy-Org/ComfyUI_frontend/1-overview
- Nx: https://nx.dev/docs/reference/nx-commands
- Practical Test Pyramid
Project Philosophy
- Follow good software engineering principles
- YAGNI
- AHA
- DRY
- SOLID
- Clean, stable public APIs
- Domain-driven design
- Thousands of users and extensions
- Prioritize clean interfaces that restrict extension access
Code Review
In doing a code review, you should make sure that:
- The code is well-designed.
- The functionality is good for the users of the code.
- Any UI changes are sensible and look good.
- Any parallel programming is done safely.
- The code isn’t more complex than it needs to be.
- The developer isn’t implementing things they might need in the future but don’t know they need now.
- Code has appropriate unit tests.
- Tests are well-designed.
- The developer used clear names for everything.
- Comments are clear and useful, and mostly explain why instead of what.
- Code is appropriately documented (generally in g3doc).
- The code conforms to our style guides.
Complexity
Is the CL more complex than it should be? Check this at every level of the CL—are individual lines too complex? Are functions too complex? Are classes too complex? “Too complex” usually means “can’t be understood quickly by code readers.” It can also mean “developers are likely to introduce bugs when they try to call or modify this code.”
A particular type of complexity is over-engineering, where developers have made the code more generic than it needs to be, or added functionality that isn’t presently needed by the system. Reviewers should be especially vigilant about over-engineering. Encourage developers to solve the problem they know needs to be solved now, not the problem that the developer speculates might need to be solved in the future. The future problem should be solved once it arrives and you can see its actual shape and requirements in the physical universe.
Repository Navigation
- Check README files in key folders (browser_tests, composables, etc.)
- Prefer running single tests for performance
- Use --help for unfamiliar CLI tools
GitHub Integration
When referencing Comfy-Org repos:
- Check for local copy
- Use GitHub API for branches/PRs/metadata
- Curl GitHub website if needed
Common Pitfalls
- NEVER use
anytype - use proper TypeScript types - NEVER use
as anytype assertions - fix the underlying type issue - NEVER use
--no-verifyflag when committing - NEVER delete or disable tests to make them pass
- NEVER circumvent quality checks
- NEVER use the
dark:tailwind variant- Instead use a semantic value from the
style.csstheme- e.g.
bg-node-component-surface
- e.g.
- Instead use a semantic value from the
- NEVER use
:class="[]"to merge class names- Always use
import { cn } from '@/utils/tailwindUtil'- e.g.
<div :class="cn('text-node-component-header-icon', hasError && 'text-danger')" />
- e.g.
- Use
cn()inline in the template when feasible instead of creating acomputedto hold the value
- Always use
- NEVER use
!importantor the!important prefix for tailwind classes- Find existing
!importantclasses that are interfering with the styling and propose corrections of those instead.
- Find existing
- NEVER use arbitrary percentage values like
w-[80%]when a Tailwind fraction utility exists- Use
w-4/5instead ofw-[80%],w-1/2instead ofw-[50%], etc.
- Use
Agent-only rules
Rules for agent-based coding tasks.
Chrome DevTools MCP
When using take_snapshot to inspect dropdowns, listboxes, or other components with dynamic options:
- Use
verbose: trueto see the full accessibility tree including list items - Non-verbose snapshots often omit nested options in comboboxes/listboxes
Temporary Files
- Put planning documents under
/temp/plans/ - Put scripts used under
/temp/scripts/ - Put summaries of work performed under
/temp/summaries/ - Put TODOs and status updates under
/temp/in_progress/