hookmod-assist
v1.0.1
Published
CLI to generate AI prompts for HookMod projects
Readme
HookMod-Assist: CLI Tool for HookMod Development
HookMod-Assist is a zero-dependency Node.js CLI companion for HookMod, a lightweight modular JavaScript framework. It simplifies project setup, template management, and AI-assisted workflows by generating starter projects, exporting templates from existing setups, and creating optimized prompts for language models (e.g., Grok, ChatGPT) to generate or refine HookMod modules.
Designed for developers building hierarchical, reusable web apps with HookMod, it enforces best practices like 'man' folder documentation for AI maintainability. No external dependencies—uses only Node.js built-ins (fs/promises, path).
Features
- Project Initialization: Create ready-to-run HookMod projects with server extensions (e.g., Express for static serving, auto-watcher for bundling).
- Template Creation: Scan a project directory to export a JSON template, excluding generated files (e.g., hookmod_out.js and .map via content/name checks).
- AI Prompt Generation: Build self-contained Markdown prompts with HookMod guide, source files, project context, and user queries for LLM module generation/debugging.
- Priming Mode: Send initial context to LLMs for understanding verification before tasks.
- Modular and Extensible: Commands in /commands/ for easy additions; customizable via flags (e.g., --output for prompts).
Installation
Install globally for CLI access:
npm install -g hookmod-assistOr locally in a project:
npm install hookmod-assist
npx hookmod-assist [command]Requires Node.js >=14. No other deps.
Usage
Run hookmod-assist --help for quick reference. Commands assume you're in a project directory (with package.json for some).
1. Initialize a Project
Creates a starter HookMod project with server (Serve-like via extensions), modules, and bundling watcher.
hookmod-assist init [kind]- [kind]: Optional template (default: 'default' – basic with Express, Bootstrap, Start module).
- Example:
hookmod-assist init– Generates /run.js, /private/extensions/ (hookmod.js, server.js, router.js), /public/ (index.html, js/start.js, modules/Start/main.js with man/). - Then:
npm install && npm start– Runs server at port 39232; auto-bundles on changes.
2. Create a Template from Project
Scans current project to export JSON template (excludes node_modules, generated hookmod_out.js/.map via signatures like SHARE).
hookmod-assist create-template <name>- : Template name (outputs to /templates/.json in assist install dir).
- Example:
hookmod-assist create-template myproj– Scans dir, skips generated, logs "Template created: .../templates/myproj.json". - Use for custom kinds in init (e.g., hookmod-assist init myproj).
3. Generate AI Prompt
Creates Markdown prompt with HookMod guide/sources, project files (excluding generated), and query for LLM pasting (e.g., Grok).
hookmod-assist prompt "Your query here" [--output file.md]- "query": Task (e.g., "Add auth module with login template").
- --output: Custom MD filename (default: hookmod-prompt.md).
- Example:
hookmod-assist prompt "Refine Start module"– Outputs MD with system rules, HookMod README/sources, project code, query.
4. Prime LLM with Context
Variant of prompt for initial priming (default query: Summarize project, prove understanding).
hookmod-assist prime [optional query]- Example:
hookmod-assist prime– Generates priming MD; paste to LLM for alignment before tasks.
Contributing
Fork on GitHub: https://github.com/s-p-n/hookmod-assist (assuming repo; create if needed). Submit PRs for new commands/templates. Test: npm test (runs init).
Issues: Report bugs/features on GitHub issues.
License
MIT License. See LICENSE file or MIT details.
Author: Spencer A. Lockhart.
For HookMod framework docs, see NPM or GitHub. Feedback welcome!
