🐛 Fix ES module import issues and add comprehensive style guide #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fix critical ES module import errors that prevented the CLI from running, and establish comprehensive style guides to prevent future issues.
Changes
Bug Fixes
capabilities.ts: Add missing .js extension
version.ts: Fix package.json path for compiled code
Style Guide
Added two comprehensive documentation files:
STYLE_GUIDE.md (Full guide)
QUICK_REFERENCE.md (One-page cheat sheet)
Why This Matters
Node.js ES Modules require explicit
.jsextensions for relative imports. TypeScript doesn't add them automatically, so they must be written in source files even though the actual files are.ts.The style guide prevents this and other common issues by documenting:
Testing
npm run buildnpm install -g .hpl version- Shows versionhpl capabilities- Lists capabilitieshpl health- Checks API healthhpl version --json- JSON output worksBreaking Changes
None - all changes are bug fixes and documentation.
Impact
Before: CLI unusable due to ES module errors
After: CLI fully functional + guides to prevent future issues
Time saved: ~2-4 hours per new contributor who would have hit these issues
Related
Checklist
These guides will help future contributors (and AI assistants) avoid the same pitfalls!
Co-authored-by: Sage sage@thehumanpatternlab.com