agent-md-generator 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +84 -119
  2. package/dist/cli.js +1541 -0
  3. package/package.json +15 -40
  4. package/dist/cli.mjs +0 -456
package/README.md CHANGED
@@ -1,152 +1,117 @@
1
- # agent.md generator
1
+ # agent-md-generator
2
2
 
3
- > Twelve questions. Four minutes. A production-grade AGENT.md your AI assistants will read before every keystroke.
3
+ An interactive command-line interface (CLI) terminal wizard designed to generate production-grade developer profile configurations, including AGENT.md (Kiro), CLAUDE.md (Claude Code), .cursorrules (Cursor), .windsurfrules (Windsurf), and copilot-instructions.md (GitHub Copilot).
4
4
 
5
- ![Agent.md Generator Hero](public/screenshots/hero.png)
6
-
7
- A focused web app that guides you through a 4-step editorial flow and generates a complete, project-specific `AGENT.md` (or `CLAUDE.md`) powered by DeepSeek.
8
-
9
- **[Live demo](https://agent-md-generator.edwinfom.dev)** · **Built by [Edwin Fom](https://github.com/Edwinfom00)**
5
+ It automatically scans your project, builds a recursive directory tree, auto-detects your primary technology stack, prompts you with tailored architectural questions, and streams highly optimized AI instructions in real-time.
10
6
 
11
7
  ---
12
8
 
13
- ## What it does
14
-
15
- Most developers use AI coding assistants without giving them any context about the project. The result: the AI writes code that doesn't match your conventions, introduces dependencies you didn't want, and ignores constraints you care about.
16
-
17
- `AGENT.md` is a spec file you place at the root of your repo. AI assistants like Kiro, Cursor, Claude, and Copilot read it before every response. This app generates one for you in under 5 minutes.
18
-
19
- ---
20
-
21
- ## The flow
22
-
23
- ```
24
- Step 01 · Identity → project name, type, description
25
- Step 02 · Tech Stack → languages, frameworks, AI providers
26
- Step 03 · Architecture → folder structure, coding conventions, UI style
27
- Step 04 · Constraints → hard rules, development philosophy, extra context
28
-
29
- Review → Generate → Download
30
- ```
31
-
32
- Each step has a live preview pane on the right that shows the AGENT.md being built in real time.
9
+ ## Why agent-md-generator?
33
10
 
34
- ---
11
+ Most developers use AI coding assistants without supplying them with the structural context of their project. Consequently, AI models frequently generate code that violates coding conventions, introduces unwanted dependencies, and ignores structural constraints.
35
12
 
36
- ## Tech stack
37
-
38
- - **Next.js 16** — App Router, server components
39
- - **TypeScript** — strict mode
40
- - **Tailwind CSS v4** — utility-first, custom design tokens
41
- - **Vercel AI SDK** — `generateText` for the generation call
42
- - **DeepSeek** (`deepseek-chat`) — the LLM that writes the spec
43
- - **react-icons** — icon set (Remix Icons)
44
- - **Instrument Serif** + **Geist** + **JetBrains Mono** — typography
13
+ The AGENT.md (or CLAUDE.md) file acts as a local specification profile placed at the root of your project. Modern AI coding assistants read this file before formulating any response, ensuring they adapt perfectly to your architecture. This CLI generates a complete, tailored spec file for you in under 3 minutes.
45
14
 
46
15
  ---
47
16
 
48
- ## Getting started
49
-
50
- ### Prerequisites
17
+ ## Installation and Quick Start
51
18
 
52
- - Node.js >= 20
53
- - A [DeepSeek API key](https://platform.deepseek.com/)
54
-
55
- ### Install
19
+ You can run the generator instantly without global installation using npx, or install it globally on your system.
56
20
 
21
+ ### Option 1: Run instantly with npx (Recommended)
57
22
  ```bash
58
- cd apps/agent-md-generator
59
- npm install
23
+ npx agent-md-generator
60
24
  ```
61
25
 
62
- ### Configure
63
-
26
+ ### Option 2: Install globally via npm
64
27
  ```bash
65
- cp .env.local.example .env.local
28
+ npm install -g agent-md-generator
66
29
  ```
67
-
68
- Edit `.env.local`:
69
-
70
- ```env
71
- DEEPSEEK_API_KEY=sk-your-key-here
72
- ```
73
-
74
- ### Run
75
-
30
+ Once installed globally, you can invoke the wizard anywhere by running:
76
31
  ```bash
77
- npm run dev
32
+ agent-md-generator
78
33
  ```
79
34
 
80
- Open [http://localhost:3000](http://localhost:3000).
81
-
82
35
  ---
83
36
 
84
- ## Project structure
37
+ ## Command Line Arguments and Options
85
38
 
86
- ```
87
- src/
88
- app/
89
- page.tsx ← entry point (renders WizardShell)
90
- layout.tsx ← root layout, fonts
91
- globals.css ← Tailwind v4 + design tokens
92
- api/
93
- generate/route.ts ← POST /api/generate — calls DeepSeek
94
- components/
95
- ui/
96
- AppHeader.tsx ← top navigation bar
97
- AppFooter.tsx ← step navigation (back / continue)
98
- StepRail.tsx ← 4-step progress indicator
99
- PreviewPane.tsx ← live AGENT.md preview (right column)
100
- wizard/
101
- WizardShell.tsx ← main state machine (questions → review → output)
102
- QuestionField.tsx ← renders text / textarea / select / multiselect
103
- ReviewStep.tsx ← summary of all answers before generation
104
- GeneratingScreen.tsx ← loading state during DeepSeek call
105
- output/
106
- ResultScreen.tsx ← generated file viewer + download buttons
107
- lib/
108
- cn.ts ← clsx + tailwind-merge utility
109
- questions.ts ← all 12 questions, options, dependency rules
110
- buildPrompt.ts ← constructs the DeepSeek prompt from answers
111
- types/
112
- index.ts ← shared TypeScript types
113
- ```
114
-
115
- ---
39
+ Customize the terminal wizard execution using these arguments:
116
40
 
117
- ## Design system
41
+ | Flag | Description |
42
+ |------|-------------|
43
+ | `--init` | Enters Automatic Initialization Mode. Runs the generator in a completely non-interactive flow. It automatically scans your directory, auto-detects parameters, selects a model based on your environment keys, generates the profile, and writes `AGENT.md` and `CLAUDE.md` directly. |
44
+ | `--template <id>` | Bypasses the interactive wizard questions entirely by applying a preset technology template and proceeds directly to model selection and generation. See the list of accurate template IDs below. |
45
+ | `--update` | Enters Update Mode. Scans the directory for an existing `AGENT.md`, loads its content, prompts you to describe a change (e.g. "Add Jest testing conventions"), selects a model, and streams the updated profile. |
46
+ | `--history` | Enters History Mode. Displays the list of the last 5 generated profiles with their timestamps and models, letting you inspect or view the last generated content. |
47
+ | `--yes` | Confirms default choices automatically where applicable. |
118
48
 
119
- The design follows an editorial aesthetic inspired by the `_prototype/` folder:
49
+ ### Available Template Presets (`--template <id>`)
50
+ You can use the `--template` flag followed by one of the exact IDs listed below to apply pre-configured questions and tech stack presets:
120
51
 
121
- | Token | Value |
122
- |---|---|
123
- | `--color-paper` | `#F1ECE2` warm off-white background |
124
- | `--color-ink` | `#141413` near-black text |
125
- | `--color-cobalt` | `#2536D6` primary accent (blue) |
126
- | `--color-ink-mute` | `#6B665B` — secondary text |
127
- | `--font-serif` | Instrument Serif — headings, titles |
128
- | `--font-mono` | JetBrains Mono — labels, code, metadata |
129
- | `--font-sans` | Geist — body text, UI |
52
+ - `nextjs_saas`: Pre-fills presets for a Next.js SaaS Web Application using TypeScript, React, Next.js, Tailwind, Prisma, and Supabase.
53
+ - `api_backend`: Pre-fills presets for a Node.js API Backend using TypeScript, Node.js, and Zod.
54
+ - `mobile_rn`: Pre-fills presets for a Mobile Application using TypeScript, React Native, and Expo.
55
+ - `fullstack_monorepo`: Pre-fills presets for a Full-Stack Monorepo using TypeScript, React, Next.js, Node.js, and Prisma.
56
+ - `cli_tool`: Pre-fills presets for an NPM CLI Tool using TypeScript, Node.js, and Zod.
130
57
 
131
- ---
132
-
133
- ## Output
134
-
135
- The generator produces two downloadable files with identical content:
136
-
137
- - `AGENT.md` — for Kiro, Cursor, and most AI coding assistants
138
- - `CLAUDE.md` — for Claude (Anthropic's naming convention)
139
-
140
- Place either file at the root of your project repository.
58
+ #### Example: Running with a specific template preset
59
+ ```bash
60
+ npx agent-md-generator --template nextjs_saas
61
+ ```
141
62
 
142
63
  ---
143
64
 
144
- ## No data stored
145
-
146
- All answers stay in the browser. The only network call is the DeepSeek API request from the server route — your answers are sent to DeepSeek to generate the spec, then discarded. Nothing is logged or persisted.
65
+ ## Detailed Feature Walkthrough
66
+
67
+ ### 1. Automatic Project Context Discovery
68
+ When you launch the CLI, it immediately analyzes your current directory to understand the project structure:
69
+ - **Manifest File Scan**: Looks for package managers and project configurations (package.json, Cargo.toml, go.mod, pyproject.toml, requirements.txt) to identify the project name, description, and language.
70
+ - **Dependency Parser**: Auto-extracts dependencies to automatically pre-fill your primary tech stack.
71
+ - **Directory Tree Generation**: Recursively maps your project directory structure up to 6 levels deep, outputting a clean layout map for prompt injection.
72
+ - **Smart Directory Filtering**: The scanner strictly ignores binary extensions (.png, .zip, .pdf, .wasm, etc.), lockfiles (package-lock.json, bun.lockb, Cargo.lock, etc.), and build outputs (node_modules, .git, .next, dist, target, vendor) to prevent bloating the prompt context.
73
+ - **Empty Folder Fallback**: If run in an empty directory, the CLI will alert you and prompt you to input the relative or absolute path to your active project.
74
+
75
+ ### 2. Multi-Model AI Providers
76
+ Connects natively to top-tier commercial and open-source models:
77
+ - **DeepSeek**: deepseek-chat, deepseek-reasoner (R1)
78
+ - **Google Gemini**: gemini-2.0-flash, gemini-1.5-pro
79
+ - **xAI**: grok-beta, grok-3-mini
80
+ - **Ollama**: Run completely offline and free using locally served models like llama3.2 and mistral.
81
+ - **Credential Storage**: Reads API keys from your environment or .env.local file. If a required key is missing, the CLI prompts you to enter it securely and offers to save it to your local .env.local file for future runs.
82
+
83
+ ### 3. Real-Time Streaming and Output Validation
84
+ - **Chunk-by-Chunk Output**: Watch the AGENT.md content compile and stream directly onto your terminal stdout.
85
+ - **Automated Score Verification**: Grades the generated content against structural standards. It alerts you if mandatory sections (e.g., Overview, Tech Stack, Coding Conventions, Hard Constraints) are missing, supplying an audit check before saving.
86
+
87
+ ### 4. Multi-File Exporters
88
+ Select which developer profiles you want to generate in a single run:
89
+ - **AGENT.md**: Standard conventions profile for Kiro, Cursor, and general assistants.
90
+ - **CLAUDE.md**: Developer instruction profile optimized for Claude Code.
91
+ - **.cursorrules**: Direct configuration settings for Cursor IDE.
92
+ - **.windsurfrules**: Configuration settings for Windsurf IDE.
93
+ - **copilot-instructions.md**: Custom instructions for GitHub Copilot.
94
+ - **Roadmaps and Prompts**: Option to split output to generate ROADMAP.md (a technical execution plan) and PROMPTS.md (optimized LLM blueprints).
147
95
 
148
96
  ---
149
97
 
150
- ## License
151
-
152
- MIT © [Edwin Fom](https://github.com/Edwinfom00)
98
+ ## Changelog: What is new in V2?
99
+
100
+ The V2 release marks a major evolution, transitioning the project from a single web utility to a comprehensive, multi-platform monorepo architecture.
101
+
102
+ ### What was in V1:
103
+ - A standalone Next.js web application.
104
+ - Basic form questions requiring manual input.
105
+ - Limited generation formats (only AGENT.md / CLAUDE.md).
106
+ - Strict dependency on DeepSeek APIs on the web server.
107
+ - No terminal execution, no offline capabilities, and no project scanning.
108
+
109
+ ### What is new in V2 (This Release):
110
+ - **Bun Workspaces Monorepo**: Re-engineered from scratch into a highly optimized, three-tier monorepo structure (@agent-md/shared, @agent-md/web, and @agent-md/cli) powered by Bun.
111
+ - **Global Terminal CLI**: Published globally to npm, enabling developers to run the tool instantly anywhere via npx or global npm install.
112
+ - **New --init Command**: A fully automated, non-interactive initialization flag that sets up your project files in a single run.
113
+ - **Automatic Project Scanning**: Real-time filesystem analyzer that detects directories, parses manifests, and reads dependencies to eliminate manual data entry.
114
+ - **Expanded AI Provider Support**: Native integration with Google Gemini, xAI (Grok), and local Ollama models (enabling 100% free and offline local generation).
115
+ - **New Target Formats**: Ability to generate .cursorrules, .windsurfrules, copilot-instructions.md, ROADMAP.md, and PROMPTS.md files simultaneously.
116
+ - **Interactive Update Mode**: A dedicated command-line flag (`--update`) to modify existing AGENT.md profiles via simple text instructions.
117
+ - **Local Generation History**: Home directory logging that tracks the last 5 successful runs, complete with local preview capabilities.