feat: initialize wiki-referencify prototype CLI tool#2
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #1
Implements the core functionality of the globally installable npm CLI tool `wiki-referencify` that covers concepts/terms in markdown documents with Wikipedia links. Key features: - Wikipedia API integration with file-based caching - Longest-match algorithm (prefers longer phrases over single words) - Disambiguation page support (links to disambiguation pages per spec) - --auto-disambiguation flag to auto-resolve ambiguous terms - Markdown-aware processing (skips headers, existing links, code blocks) - Stopword filtering to avoid linking trivial words - stdin/file input modes - lino-arguments for CLI option parsing with env var support Fixes #1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
wiki-referencifyAll scripts had the template placeholder 'my-package' which caused the changeset validation CI step to fail. Updated to 'wiki-referencify' to match the actual package name in package.json. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deno requires 'node:' prefix for Node.js built-in modules (crypto, fs, path, os). Without this prefix, Deno's type checker fails with TS2307 errors. This fixes the Deno test failures in CI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deno requires --allow-env to access environment variables like TMPDIR. Using tmpdir() at module load time (top-level const) caused Deno tests to fail with NotCapable errors even without caching being exercised. Changed to a lazy getCacheDir() function called only when actually caching API results, so importing the module doesn't require env access. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit a0b8840.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart 1/3Detected uncommitted changes from previous run. Starting new session to review and commit them. Uncommitted files: Auto-restart will stop after changes are committed or after 2 more iterations. Please wait until working session will end and give your feedback. |
🔄 Auto-restart 1/3 LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Summary
Implements the prototype of the globally installable npm CLI tool
wiki-referencifythat covers most concepts/terms in a markdown document with Wikipedia links.Fixes #1
What was implemented
Core algorithm
Atlas_(disambiguation)), links to the disambiguation page first — per spec--auto-disambiguationflag, collects contexts from exactly matched articles and skips disambiguation pages for a cleaner outputWikipedia API integration
https://en.wikipedia.org/w/api.php) to check if phrases exist as articlesMarkdown-aware processing
#style and setext===/---style)```, inline`, and indented)**, italic*— prevents phrases from spanning across formatting boundaries)Filtering
CLI tool
npm install -g wiki-referencifywiki-referencify [options] [file]lino-argumentsfor option parsing with environment variable supportExample
Input:
# Introduction to Machine Learning Machine learning is a branch of artificial intelligence. Python is a popular programming language for machine learning.Output:
Architecture
Testing
Test plan
npm test— all 26 tests passnpm run check— lint, format, duplication all passecho "# Test\n\nPython is a programming language." | wiki-referencifywiki-referencify examples/basic-usage.js🤖 Generated with Claude Code