Skip to content

Conversation

@fletchgqc
Copy link
Contributor

Summary

Adds guidelines to prevent JSDoc inconsistencies between fixture test file pairs (.input.ts and .expected.ts).

Background

While working on fixture tests for issue #73 (name conflict detection), Claude made an error by using incorrect line numbers in the JSDoc @command annotations of .expected.ts files, causing the documentation to reference wrong coordinates compared to the .input.ts files.

Design Decision: Maintain JSDoc Repetition

Although this violates DRY principles, we decided to keep identical JSDoc in both fixture files because the repetition provides significant value to AI agents - each file is self-documenting and can be understood in isolation without requiring cross-file references, which is especially important given RefakTS is built "by AI agents, for AI agents."

Implementation Approach

The easiest immediate solution is adding clear guidelines to guides/COMMAND_IMPLEMENTATION.md. Future automation options could include linting rules to validate JSDoc consistency, pre-commit hooks to check fixture pairs, or programmatic generation of .expected.ts files from .input.ts + transformation results.

Changes

  • Added concise guidelines under "Fixture Test JSDoc Consistency" section
  • Emphasizes copying JSDoc exactly from input to expected files
  • Specifies that @command coordinates must always reference the input file location

- Add guidance to maintain identical JSDoc between .input.ts and .expected.ts files
- Emphasize keeping @command coordinates referencing input file location
- Prevents inconsistency errors during fixture test creation
@devill devill merged commit 0a30009 into devill:main Aug 11, 2025
2 checks passed
@devill
Copy link
Owner

devill commented Aug 11, 2025

Thanks for the PR! Reviewed and merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants