client-handover 1.0.0

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.
package/README.md ADDED
@@ -0,0 +1,114 @@
1
+ # handover-cli
2
+
3
+ AI-powered handover document generator for frontend developers handing off websites to clients.
4
+
5
+ Run one command. Get a professional handover document in Markdown, plain text, and HTML — written for both your client and the next developer.
6
+
7
+ ---
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install -g client-handover
13
+ ```
14
+
15
+ Set your Anthropic API key:
16
+
17
+ ```bash
18
+ export ANTHROPIC_API_KEY=your_key_here
19
+ ```
20
+
21
+ Get a free API key at [console.anthropic.com](https://console.anthropic.com)
22
+
23
+ ---
24
+
25
+ ## Commands
26
+
27
+ | Command | Description |
28
+ |---------|-------------|
29
+ | `/handover` | Full handover document (all sections) |
30
+ | `/setup` | Project setup & dependencies |
31
+ | `/deploy` | Deployment & hosting info |
32
+ | `/credentials` | Logins & API keys template |
33
+ | `/license` | Licensing & attribution |
34
+
35
+ ---
36
+
37
+ ## Usage
38
+
39
+ ### Quick start (placeholder content)
40
+ ```bash
41
+ handover /handover
42
+ ```
43
+
44
+ ### With your project notes
45
+ Create a plain text file with your project details:
46
+
47
+ ```
48
+ project-info.txt
49
+ ----------------
50
+ Project: Acme Corp website
51
+ Stack: Vue 3, Vite, Netlify
52
+ Repo: https://github.com/you/acme
53
+ Live URL: https://acmecorp.com
54
+ Hosting: Netlify (free tier)
55
+ Domain: Namecheap, auto-renews Jan 2026
56
+ CMS: Netlify CMS
57
+ Analytics: Google Analytics 4
58
+ APIs: Mailchimp (newsletter), Stripe (payments)
59
+ ```
60
+
61
+ Then run:
62
+ ```bash
63
+ handover /handover project-info.txt acme-handover
64
+ ```
65
+
66
+ This generates:
67
+ ```
68
+ output/
69
+ ├── acme-handover.md
70
+ ├── acme-handover.txt
71
+ └── acme-handover.html
72
+ ```
73
+
74
+ ### Individual sections
75
+ ```bash
76
+ handover /setup project-info.txt
77
+ handover /deploy project-info.txt
78
+ handover /credentials project-info.txt
79
+ handover /license project-info.txt
80
+ ```
81
+
82
+ ---
83
+
84
+ ## Output formats
85
+
86
+ All commands produce three files:
87
+
88
+ - **`.md`** — Markdown, ready to paste into Notion, GitHub, or a README
89
+ - **`.txt`** — Plain text, clean for email or printing
90
+ - **`.html`** — Styled HTML, ready to send directly to a client
91
+
92
+ ---
93
+
94
+ ## Use as a library
95
+
96
+ ```js
97
+ import { handover, setup, generateDoc } from 'client-handover'
98
+
99
+ const prompt = handover('Vue 3 project hosted on Vercel...')
100
+ await generateDoc(prompt, 'my-client', './docs')
101
+ ```
102
+
103
+ ---
104
+
105
+ ## Requirements
106
+
107
+ - Node.js 18+
108
+ - An [Anthropic API key](https://console.anthropic.com) (free tier available)
109
+
110
+ ---
111
+
112
+ ## License
113
+
114
+ MIT
package/cli.js ADDED
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { setup } from './setup.js'
4
+ import { deploy } from './deploy.js'
5
+ import { credentials } from './credentials.js'
6
+ import { handover } from './handover.js'
7
+ import { license } from './license.js'
8
+ import { generateDoc } from './generator.js'
9
+ import chalk from 'chalk'
10
+ import fs from 'fs'
11
+
12
+ const COMMANDS = {
13
+ '/setup': { fn: setup, label: 'Project Setup & Dependencies' },
14
+ '/deploy': { fn: deploy, label: 'Deployment & Hosting' },
15
+ '/credentials': { fn: credentials, label: 'Credentials & Access' },
16
+ '/handover': { fn: handover, label: 'Full Handover Document' },
17
+ '/license': { fn: license, label: 'Licensing & Attribution' },
18
+ }
19
+
20
+ function printHelp() {
21
+ console.log(chalk.bold('\n🚀 handover-cli — Frontend Website Handover Document Generator\n'))
22
+ console.log(chalk.dim('Usage:'))
23
+ console.log(' handover <command> [project-info-file] [output-name]\n')
24
+ console.log(chalk.dim('Commands:'))
25
+ Object.entries(COMMANDS).forEach(([cmd, { label }]) => {
26
+ console.log(` ${chalk.cyan(cmd.padEnd(16))} ${label}`)
27
+ })
28
+ console.log('\n' + chalk.dim('Examples:'))
29
+ console.log(' handover /handover # Full doc with placeholders')
30
+ console.log(' handover /setup project-info.txt # Setup section using your notes')
31
+ console.log(' handover /handover project-info.txt my-client # Full doc, custom filename')
32
+ console.log()
33
+ }
34
+
35
+ async function main() {
36
+ const [,, command, infoFile, outputName] = process.argv
37
+
38
+ if (!command || command === '--help' || command === '-h') {
39
+ printHelp()
40
+ process.exit(0)
41
+ }
42
+
43
+ const entry = COMMANDS[command]
44
+ if (!entry) {
45
+ console.error(chalk.red(`\n❌ Unknown command: ${command}\n`))
46
+ printHelp()
47
+ process.exit(1)
48
+ }
49
+
50
+ // Read optional project info file
51
+ let projectInfo = ''
52
+ if (infoFile) {
53
+ if (!fs.existsSync(infoFile)) {
54
+ console.error(chalk.red(`\n❌ File not found: ${infoFile}\n`))
55
+ process.exit(1)
56
+ }
57
+ projectInfo = fs.readFileSync(infoFile, 'utf-8')
58
+ console.log(chalk.green(`\n📄 Loaded project info from: ${infoFile}`))
59
+ }
60
+
61
+ const docName = outputName || command.replace('/', '')
62
+ const prompt = entry.fn(projectInfo)
63
+
64
+ console.log(chalk.bold(`\n📝 Generating: ${entry.label}`))
65
+ console.log(chalk.dim(` Output: ./output/${docName}.{md,txt,html}\n`))
66
+
67
+ try {
68
+ await generateDoc(prompt, docName, './output')
69
+ } catch (err) {
70
+ if (err.status === 401) {
71
+ console.error(chalk.red('\n❌ Invalid API key. Set your ANTHROPIC_API_KEY environment variable.\n'))
72
+ } else {
73
+ console.error(chalk.red(`\n❌ Error: ${err.message}\n`))
74
+ }
75
+ process.exit(1)
76
+ }
77
+ }
78
+
79
+ main()
package/credentials.js ADDED
@@ -0,0 +1,50 @@
1
+ export function credentials(projectInfo = '') {
2
+ return `
3
+ You are a technical documentation writer creating a CREDENTIALS section for a frontend website handover document.
4
+
5
+ ⚠️ IMPORTANT: Never include real passwords, keys, or secrets. All sensitive values must use placeholder format: YOUR_VALUE_HERE or [REPLACE_WITH_ACTUAL_VALUE]
6
+
7
+ Using the following project information:
8
+ ${projectInfo || '[No project info provided — use placeholder examples]'}
9
+
10
+ Generate a CREDENTIALS & ACCESS section that includes:
11
+
12
+ ## Credentials & Access
13
+
14
+ ### For the Client (Plain English)
15
+ - What accounts exist and what each one is for
16
+ - Who currently has admin access
17
+ - How to reset a password if they get locked out
18
+ - Reminder to store credentials in a password manager (suggest 1Password, Bitwarden, etc.)
19
+ - What NOT to share over email
20
+
21
+ ### For the Developer (Technical)
22
+ Generate a credentials table template with these categories (use placeholders for all values):
23
+
24
+ | Service | Purpose | URL | Username/Email | Notes |
25
+ |---------|---------|-----|----------------|-------|
26
+
27
+ Include rows for:
28
+ - Hosting provider (e.g. Vercel, Netlify, cPanel)
29
+ - Domain registrar
30
+ - CMS or admin panel (if applicable)
31
+ - Database access (if applicable)
32
+ - Third-party APIs (list each one)
33
+ - Email/SMTP service
34
+ - Analytics (e.g. Google Analytics)
35
+ - Version control (GitHub/GitLab repo URL)
36
+ - Any other relevant service
37
+
38
+ ### API Keys & Environment Variables
39
+ List all .env variables used with placeholder values and a description of each.
40
+
41
+ ### Access Transfer Checklist
42
+ - [ ] Client has been added as admin to hosting
43
+ - [ ] Client has been added to domain registrar
44
+ - [ ] Developer has been removed or downgraded after handover
45
+ - [ ] 2FA has been set up for client accounts
46
+ - [ ] All credentials have been shared via secure method (not email)
47
+
48
+ Format as clean Markdown with tables.
49
+ `.trim()
50
+ }
package/deploy.js ADDED
@@ -0,0 +1,34 @@
1
+ export function deploy(projectInfo = '') {
2
+ return `
3
+ You are a technical documentation writer creating a DEPLOYMENT section for a frontend website handover document.
4
+
5
+ The audience is TWO types of readers:
6
+ 1. A NON-TECHNICAL CLIENT — plain English, no jargon
7
+ 2. A DEVELOPER — exact technical steps
8
+
9
+ Using the following project information:
10
+ ${projectInfo || '[No project info provided — use placeholder examples]'}
11
+
12
+ Generate a DEPLOYMENT section that includes:
13
+
14
+ ## Deployment & Hosting
15
+
16
+ ### For the Client (Plain English)
17
+ - Where the website is hosted and what that means
18
+ - How updates get published (automatic or manual?)
19
+ - What happens if the site goes down — who to call, what to check
20
+ - Estimated monthly/yearly hosting costs if known
21
+
22
+ ### For the Developer (Technical)
23
+ - Hosting provider and account details (use placeholders for sensitive info)
24
+ - Deployment method (e.g. Vercel push-to-deploy, FTP, CI/CD pipeline)
25
+ - Step-by-step deploy process with exact commands
26
+ - Domain/DNS setup and where it's managed
27
+ - SSL certificate info
28
+ - Build command and output directory
29
+ - Any environment-specific configs (staging vs production)
30
+ - Rollback procedure if a deployment fails
31
+
32
+ Format as clean Markdown. Use code blocks for terminal commands.
33
+ `.trim()
34
+ }
package/generator.js ADDED
@@ -0,0 +1,127 @@
1
+ import Anthropic from '@anthropic-ai/sdk'
2
+ import { marked } from 'marked'
3
+ import fs from 'fs'
4
+ import path from 'path'
5
+
6
+ const client = new Anthropic()
7
+
8
+ /**
9
+ * Generate a handover document using the Claude API
10
+ * @param {string} prompt - The command prompt to send
11
+ * @param {string} outputName - Base filename (without extension)
12
+ * @param {string} outputDir - Directory to save files
13
+ */
14
+ export async function generateDoc(prompt, outputName = 'handover', outputDir = './output') {
15
+ console.log('⏳ Generating document with Claude...\n')
16
+
17
+ // Call Claude API
18
+ const message = await client.messages.create({
19
+ model: 'claude-sonnet-4-20250514',
20
+ max_tokens: 4096,
21
+ messages: [{ role: 'user', content: prompt }]
22
+ })
23
+
24
+ const markdown = message.content[0].text
25
+
26
+ // Ensure output directory exists
27
+ if (!fs.existsSync(outputDir)) {
28
+ fs.mkdirSync(outputDir, { recursive: true })
29
+ }
30
+
31
+ const basePath = path.join(outputDir, outputName)
32
+
33
+ // --- 1. Save as Markdown ---
34
+ const mdPath = `${basePath}.md`
35
+ fs.writeFileSync(mdPath, markdown, 'utf-8')
36
+ console.log(`✅ Markdown saved: ${mdPath}`)
37
+
38
+ // --- 2. Save as Plain Text ---
39
+ const plainText = markdown
40
+ .replace(/#{1,6}\s+/g, '') // Remove headings
41
+ .replace(/\*\*(.*?)\*\*/g, '$1') // Remove bold
42
+ .replace(/\*(.*?)\*/g, '$1') // Remove italic
43
+ .replace(/`{1,3}[^`]*`{1,3}/g, (m) => m.replace(/`/g, '')) // Remove code ticks
44
+ .replace(/\[([^\]]+)\]\([^)]+\)/g, '$1') // Remove links, keep text
45
+ .replace(/[-*+] /g, '• ') // Convert bullets
46
+ .replace(/\n{3,}/g, '\n\n') // Clean extra blank lines
47
+ .trim()
48
+
49
+ const txtPath = `${basePath}.txt`
50
+ fs.writeFileSync(txtPath, plainText, 'utf-8')
51
+ console.log(`✅ Plain text saved: ${txtPath}`)
52
+
53
+ // --- 3. Save as HTML ---
54
+ const htmlBody = marked(markdown)
55
+ const html = `<!DOCTYPE html>
56
+ <html lang="en">
57
+ <head>
58
+ <meta charset="UTF-8" />
59
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
60
+ <title>Handover Document</title>
61
+ <style>
62
+ body {
63
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
64
+ max-width: 860px;
65
+ margin: 0 auto;
66
+ padding: 2rem;
67
+ color: #1a1a1a;
68
+ line-height: 1.7;
69
+ }
70
+ h1 { border-bottom: 2px solid #e0e0e0; padding-bottom: 0.5rem; }
71
+ h2 { margin-top: 2.5rem; color: #2c2c2c; }
72
+ h3 { color: #444; }
73
+ code {
74
+ background: #f4f4f4;
75
+ padding: 0.2em 0.4em;
76
+ border-radius: 4px;
77
+ font-size: 0.9em;
78
+ }
79
+ pre {
80
+ background: #f4f4f4;
81
+ padding: 1rem;
82
+ border-radius: 6px;
83
+ overflow-x: auto;
84
+ }
85
+ pre code { background: none; padding: 0; }
86
+ table {
87
+ width: 100%;
88
+ border-collapse: collapse;
89
+ margin: 1rem 0;
90
+ }
91
+ th, td {
92
+ border: 1px solid #ddd;
93
+ padding: 0.6rem 0.8rem;
94
+ text-align: left;
95
+ }
96
+ th { background: #f0f0f0; font-weight: 600; }
97
+ blockquote {
98
+ border-left: 4px solid #ccc;
99
+ margin: 0;
100
+ padding-left: 1rem;
101
+ color: #555;
102
+ }
103
+ .badge {
104
+ display: inline-block;
105
+ background: #e8f4fd;
106
+ color: #0969da;
107
+ padding: 0.2em 0.6em;
108
+ border-radius: 4px;
109
+ font-size: 0.8em;
110
+ font-weight: 600;
111
+ }
112
+ input[type="checkbox"] { margin-right: 0.4rem; }
113
+ </style>
114
+ </head>
115
+ <body>
116
+ ${htmlBody}
117
+ </body>
118
+ </html>`
119
+
120
+ const htmlPath = `${basePath}.html`
121
+ fs.writeFileSync(htmlPath, html, 'utf-8')
122
+ console.log(`✅ HTML saved: ${htmlPath}`)
123
+
124
+ console.log('\n🎉 All formats generated successfully!\n')
125
+
126
+ return { markdown, plainText, html }
127
+ }
package/handover.js ADDED
@@ -0,0 +1,96 @@
1
+ export function handover(projectInfo = '') {
2
+ return `
3
+ You are an expert technical writer generating a COMPLETE CLIENT WEBSITE HANDOVER DOCUMENT.
4
+
5
+ This document is for TWO audiences:
6
+ 1. NON-TECHNICAL CLIENT — plain English, reassuring tone, no jargon. They need to feel confident owning this site.
7
+ 2. DEVELOPER (future maintainer) — precise, technical, complete. They need to be able to pick this up cold.
8
+
9
+ Using the following project information from the developer:
10
+ ${projectInfo || '[No project info provided — use placeholder examples throughout]'}
11
+
12
+ Generate a full handover document with ALL of the following sections:
13
+
14
+ ---
15
+
16
+ # [Project Name] — Website Handover Document
17
+ **Prepared by:** [Developer Name]
18
+ **Handover Date:** [Date]
19
+ **Project URL:** [Live URL]
20
+ **Repository:** [Repo URL]
21
+
22
+ ---
23
+
24
+ ## 1. Project Overview
25
+ - What the site does (1 paragraph, plain English)
26
+ - Tech stack summary (with one-line plain English explanation of each)
27
+ - Key contacts (developer, hosting support, etc.)
28
+
29
+ ## 2. Project Setup & Dependencies
30
+ *(Follow the dual-audience format: client section + developer section)*
31
+ - Prerequisites, install steps, local dev commands, environment variables
32
+
33
+ ## 3. Deployment & Hosting
34
+ *(Dual-audience format)*
35
+ - Hosting provider, deploy method, domain/DNS, SSL, build config, rollback steps
36
+
37
+ ## 4. Credentials & Access
38
+ *(Dual-audience format)*
39
+ - All accounts, credentials table with placeholders, .env variables, access transfer checklist
40
+
41
+ ## 5. Site Structure & Content Management
42
+ ### For the Client
43
+ - How to update content (CMS, direct file edits, or contact developer)
44
+ - What they should NEVER touch without developer help
45
+ - How to add new pages or blog posts (if applicable)
46
+
47
+ ### For the Developer
48
+ - Folder structure overview
49
+ - Where key config files live
50
+ - Component/template structure
51
+ - Any custom hooks, stores, or utilities worth knowing about
52
+
53
+ ## 6. Maintenance & Updates
54
+ ### For the Client
55
+ - What needs renewing and when (domain, hosting, licences)
56
+ - How to know if something is broken
57
+ - Recommended monthly/yearly maintenance tasks
58
+
59
+ ### For the Developer
60
+ - How to update npm dependencies safely
61
+ - Any known technical debt or TODO items
62
+ - Performance and SEO considerations
63
+
64
+ ## 7. Licensing & Attribution
65
+ *(Dual-audience format)*
66
+ - Ownership summary, third-party licences table, attribution requirements, portfolio rights
67
+
68
+ ## 8. Handover Checklist
69
+ A final sign-off checklist for both parties:
70
+
71
+ ### Developer Checklist (before handover)
72
+ - [ ] All credentials transferred securely
73
+ - [ ] Client added to hosting & domain accounts
74
+ - [ ] Repository access transferred or shared
75
+ - [ ] Live site tested across browsers and devices
76
+ - [ ] Analytics verified working
77
+ - [ ] All placeholder content replaced
78
+ - [ ] .env.example file committed to repo
79
+ - [ ] README updated
80
+ - [ ] Handover document reviewed with client
81
+
82
+ ### Client Acknowledgement
83
+ - [ ] I have received all login credentials
84
+ - [ ] I understand how to update content
85
+ - [ ] I know who to contact for technical support
86
+ - [ ] I have been shown the live site and approve it
87
+
88
+ ---
89
+
90
+ Format the entire document in clean, well-structured Markdown.
91
+ Use code blocks for all terminal commands.
92
+ Use tables where appropriate.
93
+ Keep client sections warm, clear, and jargon-free.
94
+ Keep developer sections precise and thorough.
95
+ `.trim()
96
+ }
package/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export { generateDoc } from './generator.js'
2
+ export { handover } from './handover.js'
3
+ export { setup } from './setup.js'
4
+ export { deploy } from './deploy.js'
5
+ export { credentials } from './credentials.js'
6
+ export { license } from './license.js'
package/license.js ADDED
@@ -0,0 +1,50 @@
1
+ export function license(projectInfo = '') {
2
+ return `
3
+ You are a technical documentation writer creating a LICENSING & ATTRIBUTION section for a frontend website handover document.
4
+
5
+ Using the following project information:
6
+ ${projectInfo || '[No project info provided — use placeholder examples]'}
7
+
8
+ Generate a LICENSING & ATTRIBUTION section that includes:
9
+
10
+ ## Licensing & Attribution
11
+
12
+ ### For the Client (Plain English)
13
+ - What they legally own after handover (code, design, content)
14
+ - What they do NOT own and must continue to pay for (fonts, stock images, plugins, themes)
15
+ - Any content they must credit or attribute publicly
16
+ - Whether the developer retains any rights to show the work in their portfolio
17
+ - Plain-English summary of what they can and cannot do with the site
18
+
19
+ ### For the Developer (Technical)
20
+
21
+ #### Project License
22
+ - License type for the custom code written (e.g. MIT, proprietary, client-owned)
23
+ - Copyright notice template
24
+
25
+ #### Third-Party Licenses
26
+ Generate a table of all third-party assets and their licenses:
27
+
28
+ | Asset / Library | Type | License | Requires Attribution? | Renewal Required? |
29
+ |----------------|------|---------|----------------------|-------------------|
30
+
31
+ Include rows for:
32
+ - npm packages (key ones, not all)
33
+ - Fonts (Google Fonts, Adobe, licensed)
34
+ - Stock images or icons
35
+ - UI component libraries
36
+ - Paid plugins or themes
37
+ - Any SaaS tools baked into the site
38
+
39
+ #### Attribution Requirements
40
+ List any assets that require visible credit on the site (e.g. Unsplash photo credits, open source notices)
41
+
42
+ #### Developer Portfolio Rights
43
+ Confirm whether the developer has permission to:
44
+ - [ ] Show the site in their portfolio
45
+ - [ ] Use screenshots in case studies
46
+ - [ ] Reference the client by name publicly
47
+
48
+ Format as clean Markdown with tables.
49
+ `.trim()
50
+ }
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "client-handover",
3
+ "version": "1.0.0",
4
+ "description": "AI-powered handover document generator for frontend developers handing off client websites",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "bin": {
8
+ "handover": "cli.js"
9
+ },
10
+ "files": [
11
+ "cli.js",
12
+ "index.js",
13
+ "generator.js",
14
+ "handover.js",
15
+ "setup.js",
16
+ "deploy.js",
17
+ "credentials.js",
18
+ "license.js",
19
+ "README.md"
20
+ ],
21
+ "scripts": {
22
+ "test": "node test.js"
23
+ },
24
+ "keywords": [
25
+ "handover",
26
+ "frontend",
27
+ "client",
28
+ "documentation",
29
+ "developer",
30
+ "claude",
31
+ "ai"
32
+ ],
33
+ "author": "sabrkei",
34
+ "license": "MIT",
35
+ "engines": {
36
+ "node": ">=18"
37
+ },
38
+ "dependencies": {
39
+ "@anthropic-ai/sdk": "^0.39.0",
40
+ "chalk": "^5.3.0",
41
+ "marked": "^12.0.0"
42
+ }
43
+ }
package/setup.js ADDED
@@ -0,0 +1,31 @@
1
+ export function setup(projectInfo = '') {
2
+ return `
3
+ You are a technical documentation writer creating a SETUP section for a frontend website handover document.
4
+
5
+ The audience is TWO types of readers:
6
+ 1. A NON-TECHNICAL CLIENT — who needs plain-English explanations of what everything is and why it matters
7
+ 2. A DEVELOPER — who needs exact commands, file paths, and technical detail
8
+
9
+ Using the following project information provided by the developer:
10
+ ${projectInfo || '[No project info provided — use placeholder examples]'}
11
+
12
+ Generate a SETUP section that includes:
13
+
14
+ ## Project Setup & Dependencies
15
+
16
+ ### For the Client (Plain English)
17
+ - What tech stack is used and a simple one-line explanation of each part
18
+ - What they'll need to pay for or maintain (hosting, domain, licences)
19
+ - Who to contact if something breaks
20
+
21
+ ### For the Developer (Technical)
22
+ - Prerequisites (Node version, package manager, etc.)
23
+ - Step-by-step install instructions with exact terminal commands
24
+ - Environment variables needed (use placeholder values like YOUR_VALUE_HERE)
25
+ - How to run locally (dev server command, expected URL)
26
+ - Any known gotchas or first-time setup issues
27
+
28
+ Format this as clean, well-structured Markdown with clear headings.
29
+ Keep the client section jargon-free. Keep the developer section precise.
30
+ `.trim()
31
+ }