axis-crm 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.
Files changed (55) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +122 -0
  3. package/cli/index.js +106 -0
  4. package/package.json +36 -0
  5. package/template/CLAUDE.md +38 -0
  6. package/template/CRM Dashboard.md +53 -0
  7. package/template/automations/README.md +62 -0
  8. package/template/automations/client-research.json +383 -0
  9. package/template/automations/fireflies-to-crm.json +306 -0
  10. package/template/clients/acme-consulting/README.md +43 -0
  11. package/template/clients/acme-consulting/communication/2026-03-01-cena-dohodnuta.md +24 -0
  12. package/template/clients/acme-consulting/contacts/jana-novakova.md +17 -0
  13. package/template/clients/acme-consulting/contacts/tomas-dvorak.md +16 -0
  14. package/template/clients/acme-consulting/files/faktury/.gitkeep +0 -0
  15. package/template/clients/acme-consulting/files/nabidky/.gitkeep +0 -0
  16. package/template/clients/acme-consulting/files/smlouvy/.gitkeep +0 -0
  17. package/template/clients/acme-consulting/meetings/2026-02-10-kickoff.md +25 -0
  18. package/template/clients/acme-consulting/meetings/2026-03-15-progress-review.md +25 -0
  19. package/template/clients/acme-consulting/projects/web-redesign/README.md +53 -0
  20. package/template/clients/acme-consulting/projects/web-redesign/deliverables/.gitkeep +0 -0
  21. package/template/clients/acme-consulting/projects/web-redesign/notes/.gitkeep +0 -0
  22. package/template/clients/acme-consulting/projects/web-redesign/zadani.md +33 -0
  23. package/template/dashboards/client-overview.md +25 -0
  24. package/template/dashboards/hot-leads.md +23 -0
  25. package/template/dashboards/pipeline.md +52 -0
  26. package/template/leads/bytovy-architekt-kovar.md +22 -0
  27. package/template/leads/green-energy-as.md +22 -0
  28. package/template/leads/nova-digital-sro.md +22 -0
  29. package/template/leads/restaurace-u-zlateho-lva.md +23 -0
  30. package/template/leads/techpro-solutions.md +23 -0
  31. package/template/rules/fields.md +45 -0
  32. package/template/rules/lifecycle.md +51 -0
  33. package/template/rules/scoring.md +43 -0
  34. package/template/rules/structure.md +82 -0
  35. package/template/scripts/convert-to-client.sh +133 -0
  36. package/template/scripts/new-lead.sh +68 -0
  37. package/template/scripts/new-project.sh +69 -0
  38. package/template/scripts/validate.sh +149 -0
  39. package/template/templates/client/README.md +31 -0
  40. package/template/templates/client/communication/.gitkeep +0 -0
  41. package/template/templates/client/contacts/.gitkeep +0 -0
  42. package/template/templates/client/files/.gitkeep +0 -0
  43. package/template/templates/client/files/faktury/.gitkeep +0 -0
  44. package/template/templates/client/files/nabidky/.gitkeep +0 -0
  45. package/template/templates/client/files/smlouvy/.gitkeep +0 -0
  46. package/template/templates/client/meetings/.gitkeep +0 -0
  47. package/template/templates/client/projects/.gitkeep +0 -0
  48. package/template/templates/communication.md +17 -0
  49. package/template/templates/contact.md +14 -0
  50. package/template/templates/lead.md +20 -0
  51. package/template/templates/meeting.md +17 -0
  52. package/template/templates/project/README.md +34 -0
  53. package/template/templates/project/deliverables/.gitkeep +0 -0
  54. package/template/templates/project/notes/.gitkeep +0 -0
  55. package/template/templates/project/zadani.md +19 -0
@@ -0,0 +1,22 @@
1
+ ---
2
+ title: 'Bytovy architekt Kovar'
3
+ created: '2026-03-15'
4
+ tags: [lead]
5
+ type: lead
6
+ status: 'qualified'
7
+ priority: 'medium'
8
+ city: 'Praha'
9
+ size: 'micro'
10
+ industry: 'architektura'
11
+ source: 'referral'
12
+ email: 'info@architekt-kovar.cz'
13
+ phone: '+420 733 444 555'
14
+ ico: '11223344'
15
+ web: 'https://architekt-kovar.cz'
16
+ score: 55
17
+ first_contact: ''
18
+ ---
19
+
20
+ ## Notes
21
+
22
+ Referral from a mutual contact. Interior architect looking for a website + portfolio system. Currently on Wix, wants something more professional. Score 55 — ready for outreach.
@@ -0,0 +1,22 @@
1
+ ---
2
+ title: 'Green Energy a.s.'
3
+ created: '2026-03-20'
4
+ tags: [lead]
5
+ type: lead
6
+ status: 'enriched'
7
+ priority: ''
8
+ city: 'Brno'
9
+ size: '50-200'
10
+ industry: 'energetika'
11
+ source: 'apify'
12
+ email: 'info@green-energy.cz'
13
+ phone: '+420 511 222 333'
14
+ ico: '87654321'
15
+ web: 'https://green-energy.cz'
16
+ score: 35
17
+ first_contact: ''
18
+ ---
19
+
20
+ ## Notes
21
+
22
+ Energy company from Brno. Website looks outdated — opportunity for redesign. ARES verified, ICO valid. Awaiting qualification (score currently 35).
@@ -0,0 +1,22 @@
1
+ ---
2
+ title: 'Nova Digital s.r.o.'
3
+ created: '2026-04-01'
4
+ tags: [lead]
5
+ type: lead
6
+ status: 'new'
7
+ priority: ''
8
+ city: ''
9
+ size: ''
10
+ industry: ''
11
+ source: 'firmy-cz'
12
+ email: ''
13
+ phone: ''
14
+ ico: ''
15
+ web: ''
16
+ score: 0
17
+ first_contact: ''
18
+ ---
19
+
20
+ ## Notes
21
+
22
+ Found via firmy.cz scrape. No additional information yet.
@@ -0,0 +1,23 @@
1
+ ---
2
+ title: 'Restaurace U Zlateho Lva'
3
+ created: '2026-02-28'
4
+ tags: [lead]
5
+ type: lead
6
+ status: 'opportunity'
7
+ priority: 'high'
8
+ city: 'Plzen'
9
+ size: 'micro'
10
+ industry: 'gastronomie'
11
+ source: 'manual'
12
+ email: 'majitel@uzlateholva.cz'
13
+ phone: '+420 377 111 222'
14
+ ico: '99887766'
15
+ web: 'https://uzlateholva.cz'
16
+ score: 82
17
+ first_contact: '2026-03-05'
18
+ campaign: 'cold-outreach-q1-2026'
19
+ ---
20
+
21
+ ## Notes
22
+
23
+ Owner responded enthusiastically to cold email. Wants a full website + online reservations + Google Business profile. Meeting scheduled for 10.04. Hot lead — conversion to client expected after the meeting.
@@ -0,0 +1,23 @@
1
+ ---
2
+ title: 'TechPro Solutions s.r.o.'
3
+ created: '2026-03-10'
4
+ tags: [lead]
5
+ type: lead
6
+ status: 'contacted'
7
+ priority: 'high'
8
+ city: 'Ostrava'
9
+ size: '10-50'
10
+ industry: 'it-services'
11
+ source: 'apify'
12
+ email: 'obchod@techpro.cz'
13
+ phone: '+420 599 888 777'
14
+ ico: '55667788'
15
+ web: 'https://techpro.cz'
16
+ score: 65
17
+ first_contact: '2026-03-25'
18
+ campaign: 'cold-outreach-q1-2026'
19
+ ---
20
+
21
+ ## Notes
22
+
23
+ IT company from Ostrava, offering managed services and cloud. Email sent on 25.03., awaiting response. Website is solid but lacks modern design — they might be interested in a refresh.
@@ -0,0 +1,45 @@
1
+ ---
2
+ title: Required Fields by Stage
3
+ type: rules
4
+ ---
5
+
6
+ # Required fields by stage
7
+
8
+ ## Lead
9
+
10
+ | Field | new | enriched | qualified | contacted | responded | opportunity |
11
+ | ------------- | --- | -------- | --------- | --------- | --------- | ----------- |
12
+ | title | x | x | x | x | x | x |
13
+ | created | x | x | x | x | x | x |
14
+ | source | x | x | x | x | x | x |
15
+ | city | | x | x | x | x | x |
16
+ | industry | | x | x | x | x | x |
17
+ | ico | | x | x | x | x | x |
18
+ | web | | x | x | x | x | x |
19
+ | email | | x | x | x | x | x |
20
+ | score | | | x | x | x | x |
21
+ | campaign | | | | x | x | x |
22
+ | first_contact | | | | x | x | x |
23
+ | priority | | | | | | x |
24
+
25
+ ## Client (README.md)
26
+
27
+ All lead fields plus:
28
+
29
+ - `converted_from_lead` — reference to original lead (git history)
30
+ - `status` — active, in-progress, paused, closed, not-actual
31
+
32
+ ## Contact
33
+
34
+ Always required: `title`, `email`
35
+ Recommended: `role`, `phone`, `linkedin`
36
+
37
+ ## Meeting
38
+
39
+ Always required: `title`, `date`, `attendees`
40
+ Recommended: `duration`, `next_steps`
41
+
42
+ ## Project
43
+
44
+ Always required: `title`, `status`
45
+ Recommended: `start`, `deadline`, `value`
@@ -0,0 +1,51 @@
1
+ ---
2
+ title: Lead Lifecycle Rules
3
+ type: rules
4
+ ---
5
+
6
+ # Lead Lifecycle
7
+
8
+ ## Stages
9
+
10
+ | Status | Location | Description |
11
+ | ------------- | ------------------------ | ------------------------------------------ |
12
+ | `new` | `leads/` | Just created, no data beyond source |
13
+ | `enriched` | `leads/` | Enriched (ICO, web, email, industry) |
14
+ | `qualified` | `leads/` | Score > 40, ready for outreach |
15
+ | `contacted` | `leads/` | Email sent, awaiting response |
16
+ | `responded` | `leads/` | Responded — positive or negative |
17
+ | `opportunity` | `leads/` | Confirmed interest, meeting scheduled |
18
+ | `client` | `clients/company/` | Converted — folder created |
19
+ | `not-actual` | `leads/` or `clients/` | Closed, not relevant |
20
+
21
+ ## Transitions
22
+
23
+ ```
24
+ new → enriched Trigger: ARES/web scrape completed
25
+ enriched → qualified Trigger: score > 40
26
+ qualified → contacted Trigger: email sent (campaign assigned)
27
+ contacted → responded Trigger: response received
28
+ responded → opportunity Trigger: positive response, meeting scheduled
29
+ opportunity → client Trigger: contract/agreement, convert-to-client.sh
30
+ * → not-actual Trigger: manual decision
31
+ ```
32
+
33
+ ## Lead to client conversion
34
+
35
+ When: lead reaches the `opportunity` or `client` stage.
36
+
37
+ Process:
38
+
39
+ 1. Run `scripts/convert-to-client.sh company-slug`
40
+ 2. Script creates `clients/company-slug/` from template
41
+ 3. Frontmatter data is copied into `README.md`
42
+ 4. Contacts are moved to `clients/company-slug/contacts/`
43
+ 5. Old `leads/company-slug.md` is deleted (history preserved in git)
44
+ 6. Status is set to `active`
45
+
46
+ ## Rules
47
+
48
+ - A lead NEVER has a folder — always a single file
49
+ - A client ALWAYS has a folder — even if it's empty
50
+ - Deleted lead = git history, not a trash bin
51
+ - Conversion is one-way (client → lead does not exist)
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: Lead Scoring Rules
3
+ type: rules
4
+ ---
5
+
6
+ # Lead Scoring
7
+
8
+ Score 0-100. The higher the score, the better the lead.
9
+
10
+ ## Criteria
11
+
12
+ | Criterion | Points | Description |
13
+ | ---------------------- | ------ | -------------------------------------------- |
14
+ | Has email | +10 | Contact email found |
15
+ | Has phone | +5 | Phone number found |
16
+ | Has website | +5 | Website exists |
17
+ | Has ICO (ARES verified)| +10 | Verified in ARES |
18
+ | Industry match | +15 | Industry matches our target segment |
19
+ | City match | +10 | Location in our region |
20
+ | Web quality | +10 | Website looks outdated/weak = opportunity |
21
+ | Revenue (ARES) | +10 | Revenue > 2M CZK/year |
22
+ | Employee count | +5 | 2-50 employees (SMB sweet spot) |
23
+ | Social presence | +5 | Company LinkedIn/FB profile |
24
+ | Responded to outreach | +15 | Responded to email |
25
+
26
+ ## Thresholds
27
+
28
+ | Score | Action |
29
+ | ------ | ------------------------------------- |
30
+ | 0-20 | New, not enriched |
31
+ | 21-40 | Enriched, awaiting qualification |
32
+ | 41-60 | Qualified, ready for outreach |
33
+ | 61-80 | Strong lead, priority outreach |
34
+ | 81-100 | Hot lead, immediate action |
35
+
36
+ ## Automatic updates
37
+
38
+ Score is recalculated when:
39
+
40
+ - Enrichment (ARES data received)
41
+ - Web scrape completed
42
+ - Email response received
43
+ - Manual update
@@ -0,0 +1,82 @@
1
+ ---
2
+ title: Client Folder Structure
3
+ type: rules
4
+ ---
5
+
6
+ # Client folder structure
7
+
8
+ Every client in `clients/` follows this structure:
9
+
10
+ ```
11
+ clients/company-name/
12
+ README.md # client overview (status, contact, summary)
13
+ contacts/ # people from the company
14
+ jan-novak.md # contact person
15
+ communication/ # key decisions and communication
16
+ 2026-04-10-cena-dohodnuta.md
17
+ files/ # documents
18
+ contracts/ # signed contracts, NDAs, amendments
19
+ proposals/ # price quotes, proposals
20
+ invoices/ # issued invoices
21
+ meetings/ # meeting notes
22
+ 2026-04-10-kickoff.md
23
+ projects/ # projects for the client
24
+ project-name/ # each project = folder
25
+ README.md # scope, status, timeline
26
+ zadani.md # brief from the client
27
+ deliverables/ # outputs
28
+ notes/ # ongoing notes
29
+ ```
30
+
31
+ ## What goes where
32
+
33
+ ### contacts/
34
+
35
+ Each person from the client company = one .md file.
36
+
37
+ - Frontmatter: name, role, email, phone, linkedin
38
+ - Body: notes, preferences, what you know about them
39
+
40
+ ### communication/
41
+
42
+ Important decisions and communication. NOT every email — only what changes direction.
43
+
44
+ - Filename format: `YYYY-MM-DD-description.md`
45
+ - Frontmatter: date, channel (email/call/chat), participants, decision
46
+ - Example: `2026-04-10-cena-dohodnuta.md` — client approved the quote
47
+
48
+ ### files/
49
+
50
+ Documents associated with the client.
51
+
52
+ - `contracts/` — signed contracts, NDAs, amendments, orders
53
+ - `proposals/` — price quotes, proposals (including drafts)
54
+ - `invoices/` — issued invoices
55
+ - Filename format: `YYYY-MM-DD-description.pdf`
56
+ - NEVER `final_v3_FINAL(2).pdf` — use git for versioning
57
+
58
+ ### meetings/
59
+
60
+ Meeting notes.
61
+
62
+ - Filename format: `YYYY-MM-DD-topic.md`
63
+ - Frontmatter: date, attendees, duration
64
+ - Body: summary, action items, transcript (in <details>)
65
+ - Automatically populated from Fireflies webhook (see automations/)
66
+
67
+ ### projects/
68
+
69
+ Each project = its own folder.
70
+
71
+ - `README.md` — scope, status, timeline, deliverables
72
+ - `zadani.md` — original brief from the client
73
+ - `deliverables/` — final outputs
74
+ - `notes/` — ongoing notes, drafts
75
+
76
+ ## Rules
77
+
78
+ 1. **A lead is a file, a client is a folder.** A lead doesn't need meetings and projects.
79
+ 2. **Lead to client conversion:** `scripts/convert-to-client.sh slug`
80
+ 3. **New project:** copy `templates/project/` to `clients/company/projects/name/`
81
+ 4. **New communication:** copy `templates/communication.md`
82
+ 5. **Git = database.** Versioning, blame, history — all for free.
@@ -0,0 +1,133 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # convert-to-client.sh — Convert a lead to a client with full folder structure
5
+ #
6
+ # Usage:
7
+ # ./convert-to-client.sh firma-slug
8
+ #
9
+ # What it does:
10
+ # 1. Reads leads/firma-slug.md
11
+ # 2. Creates clients/firma-slug/ folder structure
12
+ # 3. Copies frontmatter to clients/firma-slug/README.md
13
+ # 4. Updates status to "active" and type to "client"
14
+ # 5. Deletes the lead file (history preserved in git)
15
+
16
+ CRM_DIR="$(cd "$(dirname "$0")/.." && pwd)"
17
+ LEADS_DIR="$CRM_DIR/leads"
18
+ CLIENTS_DIR="$CRM_DIR/clients"
19
+ CLIENT_TEMPLATE="$CRM_DIR/templates/client/README.md"
20
+
21
+ if [ $# -lt 1 ]; then
22
+ echo "Usage: convert-to-client.sh <lead-slug>"
23
+ echo ""
24
+ echo "Example: convert-to-client.sh acme-corp"
25
+ exit 1
26
+ fi
27
+
28
+ SLUG="$1"
29
+ LEAD_FILE="$LEADS_DIR/$SLUG.md"
30
+ CLIENT_DIR="$CLIENTS_DIR/$SLUG"
31
+
32
+ # Validate lead exists
33
+ if [ ! -f "$LEAD_FILE" ]; then
34
+ echo "Error: Lead not found: $LEAD_FILE"
35
+ echo ""
36
+ echo "Available leads:"
37
+ ls "$LEADS_DIR" | sed 's/\.md$//' | head -20
38
+ exit 1
39
+ fi
40
+
41
+ # Check client doesn't already exist
42
+ if [ -d "$CLIENT_DIR" ]; then
43
+ echo "Error: Client folder already exists: $CLIENT_DIR"
44
+ exit 1
45
+ fi
46
+
47
+ # Extract frontmatter from lead
48
+ TITLE=$(grep '^title:' "$LEAD_FILE" | head -1 | sed 's/^title: *"\{0,1\}//;s/"\{0,1\}$//')
49
+ CREATED=$(grep '^created:' "$LEAD_FILE" | head -1 | sed 's/^created: *"\{0,1\}//;s/"\{0,1\}$//')
50
+ CITY=$(grep '^city:' "$LEAD_FILE" | head -1 | sed 's/^city: *"\{0,1\}//;s/"\{0,1\}$//')
51
+ INDUSTRY=$(grep '^industry:' "$LEAD_FILE" | head -1 | sed 's/^industry: *"\{0,1\}//;s/"\{0,1\}$//')
52
+ SOURCE=$(grep '^source:' "$LEAD_FILE" | head -1 | sed 's/^source: *"\{0,1\}//;s/"\{0,1\}$//')
53
+ EMAIL=$(grep '^email:' "$LEAD_FILE" | head -1 | sed 's/^email: *"\{0,1\}//;s/"\{0,1\}$//')
54
+ PHONE=$(grep '^phone:' "$LEAD_FILE" | head -1 | sed 's/^phone: *"\{0,1\}//;s/"\{0,1\}$//')
55
+ ICO=$(grep '^ico:' "$LEAD_FILE" | head -1 | sed 's/^ico: *"\{0,1\}//;s/"\{0,1\}$//')
56
+ WEB=$(grep '^web:' "$LEAD_FILE" | head -1 | sed 's/^web: *"\{0,1\}//;s/"\{0,1\}$//')
57
+ SCORE=$(grep '^score:' "$LEAD_FILE" | head -1 | sed 's/^score: *//')
58
+ SIZE=$(grep '^size:' "$LEAD_FILE" | head -1 | sed 's/^size: *"\{0,1\}//;s/"\{0,1\}$//')
59
+ PRIORITY=$(grep '^priority:' "$LEAD_FILE" | head -1 | sed 's/^priority: *"\{0,1\}//;s/"\{0,1\}$//')
60
+ TODAY=$(date +%Y-%m-%d)
61
+
62
+ echo "Converting lead to client:"
63
+ echo " Title: $TITLE"
64
+ echo " Email: $EMAIL"
65
+ echo " Score: $SCORE"
66
+ echo ""
67
+
68
+ # Create folder structure
69
+ mkdir -p "$CLIENT_DIR/contacts"
70
+ mkdir -p "$CLIENT_DIR/projects"
71
+ mkdir -p "$CLIENT_DIR/meetings"
72
+ mkdir -p "$CLIENT_DIR/communication"
73
+ mkdir -p "$CLIENT_DIR/files/smlouvy"
74
+ mkdir -p "$CLIENT_DIR/files/nabidky"
75
+ mkdir -p "$CLIENT_DIR/files/faktury"
76
+
77
+ # Create README.md from template with lead data
78
+ sed -e "s|^title: ''|title: \"$TITLE\"|" \
79
+ -e "s|^created: ''|created: \"$TODAY\"|" \
80
+ -e "s|^city: ''|city: \"$CITY\"|" \
81
+ -e "s|^size: ''|size: \"$SIZE\"|" \
82
+ -e "s|^industry: ''|industry: \"$INDUSTRY\"|" \
83
+ -e "s|^source: ''|source: \"$SOURCE\"|" \
84
+ -e "s|^email: ''|email: \"$EMAIL\"|" \
85
+ -e "s|^phone: ''|phone: \"$PHONE\"|" \
86
+ -e "s|^ico: ''|ico: \"$ICO\"|" \
87
+ -e "s|^web: ''|web: \"$WEB\"|" \
88
+ -e "s|^score: 0|score: $SCORE|" \
89
+ -e "s|^priority: ''|priority: \"$PRIORITY\"|" \
90
+ -e "s|^converted_from_lead: ''|converted_from_lead: \"leads/$SLUG.md (see git history)\"|" \
91
+ "$CLIENT_TEMPLATE" > "$CLIENT_DIR/README.md"
92
+
93
+ # If lead had an email, create a contact file
94
+ if [ -n "$EMAIL" ] && [ "$EMAIL" != '""' ]; then
95
+ CONTACT_SLUG=$(echo "$TITLE" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//')
96
+ cat > "$CLIENT_DIR/contacts/$CONTACT_SLUG.md" << CONTACT
97
+ ---
98
+ title: '$TITLE (primary contact)'
99
+ created: '$TODAY'
100
+ tags: [contact]
101
+ type: contact
102
+ role: 'primary'
103
+ email: '$EMAIL'
104
+ phone: '$PHONE'
105
+ linkedin: ''
106
+ last_contact: ''
107
+ notes: 'Auto-created from lead conversion'
108
+ ---
109
+
110
+ ## Notes
111
+
112
+ Converted from lead on $TODAY.
113
+ CONTACT
114
+ echo " Contact created: $CONTACT_SLUG.md"
115
+ fi
116
+
117
+ # Delete lead file
118
+ rm "$LEAD_FILE"
119
+ echo " Lead file deleted (history in git)"
120
+
121
+ echo ""
122
+ echo "Client created: $CLIENT_DIR/"
123
+ echo " README.md — overview + frontmatter"
124
+ echo " contacts/ — key people"
125
+ echo " projects/ — deliverables"
126
+ echo " meetings/ — meeting notes"
127
+ echo " communication/ — key decisions"
128
+ echo " files/ — contracts, proposals"
129
+ echo ""
130
+ echo "Next steps:"
131
+ echo " 1. Review and edit README.md"
132
+ echo " 2. Add project scope to projects/"
133
+ echo " 3. Schedule first meeting"
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # new-lead.sh — Create a new lead from template
5
+ #
6
+ # Usage:
7
+ # ./new-lead.sh "Firma s.r.o." --source firmy-cz --city Plzen --industry ucetnictvi
8
+ # ./new-lead.sh "Firma s.r.o." (interactive — prompts for fields)
9
+
10
+ CRM_DIR="$(cd "$(dirname "$0")/.." && pwd)"
11
+ TEMPLATE="$CRM_DIR/templates/lead.md"
12
+ LEADS_DIR="$CRM_DIR/leads"
13
+
14
+ if [ $# -lt 1 ]; then
15
+ echo "Usage: new-lead.sh \"Firma Name\" [--source X] [--city X] [--industry X] [--email X] [--phone X] [--web X]"
16
+ exit 1
17
+ fi
18
+
19
+ TITLE="$1"
20
+ shift
21
+
22
+ # Generate slug from title
23
+ SLUG=$(echo "$TITLE" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//')
24
+ TODAY=$(date +%Y-%m-%d)
25
+ OUTPUT="$LEADS_DIR/$SLUG.md"
26
+
27
+ if [ -f "$OUTPUT" ]; then
28
+ echo "Error: Lead already exists: $OUTPUT"
29
+ exit 1
30
+ fi
31
+
32
+ # Parse optional flags
33
+ SOURCE="" CITY="" INDUSTRY="" EMAIL="" PHONE="" WEB=""
34
+ while [ $# -gt 0 ]; do
35
+ case "$1" in
36
+ --source) SOURCE="$2"; shift 2 ;;
37
+ --city) CITY="$2"; shift 2 ;;
38
+ --industry) INDUSTRY="$2"; shift 2 ;;
39
+ --email) EMAIL="$2"; shift 2 ;;
40
+ --phone) PHONE="$2"; shift 2 ;;
41
+ --web) WEB="$2"; shift 2 ;;
42
+ *) echo "Unknown flag: $1"; exit 1 ;;
43
+ esac
44
+ done
45
+
46
+ # If no flags provided, prompt interactively
47
+ if [ -z "$SOURCE" ] && [ -t 0 ]; then
48
+ read -p "Source (e.g. firmy-cz, apify, manual): " SOURCE
49
+ read -p "City: " CITY
50
+ read -p "Industry: " INDUSTRY
51
+ read -p "Email: " EMAIL
52
+ read -p "Phone: " PHONE
53
+ read -p "Web: " WEB
54
+ fi
55
+
56
+ # Create lead from template
57
+ sed -e "s|^title: ''|title: \"$TITLE\"|" \
58
+ -e "s|^created: ''|created: \"$TODAY\"|" \
59
+ -e "s|^source: ''|source: \"$SOURCE\"|" \
60
+ -e "s|^city: ''|city: \"$CITY\"|" \
61
+ -e "s|^industry: ''|industry: \"$INDUSTRY\"|" \
62
+ -e "s|^email: ''|email: \"$EMAIL\"|" \
63
+ -e "s|^phone: ''|phone: \"$PHONE\"|" \
64
+ -e "s|^web: ''|web: \"$WEB\"|" \
65
+ "$TEMPLATE" > "$OUTPUT"
66
+
67
+ echo "Created: $OUTPUT"
68
+ echo "Status: new (next step: enrich with ARES data)"
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env bash
2
+ set -uo pipefail
3
+
4
+ # new-project.sh — Create a new project folder for a client
5
+ #
6
+ # Usage:
7
+ # ./new-project.sh client-slug project-name
8
+ # ./new-project.sh acme-consulting "Web Redesign"
9
+
10
+ CRM_DIR="$(cd "$(dirname "$0")/.." && pwd)"
11
+ CLIENTS_DIR="$CRM_DIR/clients"
12
+ TEMPLATE_DIR="$CRM_DIR/templates/project"
13
+
14
+ if [ $# -lt 2 ]; then
15
+ echo "Usage: new-project.sh <client-slug> \"Project Name\""
16
+ echo ""
17
+ echo "Available clients:"
18
+ ls "$CLIENTS_DIR"
19
+ exit 1
20
+ fi
21
+
22
+ CLIENT_SLUG="$1"
23
+ PROJECT_NAME="$2"
24
+ CLIENT_DIR="$CLIENTS_DIR/$CLIENT_SLUG"
25
+
26
+ if [ ! -d "$CLIENT_DIR" ]; then
27
+ echo "Error: Client not found: $CLIENT_DIR"
28
+ echo ""
29
+ echo "Available clients:"
30
+ ls "$CLIENTS_DIR"
31
+ exit 1
32
+ fi
33
+
34
+ # Generate project slug
35
+ PROJECT_SLUG=$(echo "$PROJECT_NAME" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//')
36
+ PROJECT_DIR="$CLIENT_DIR/projects/$PROJECT_SLUG"
37
+ TODAY=$(date +%Y-%m-%d)
38
+
39
+ if [ -d "$PROJECT_DIR" ]; then
40
+ echo "Error: Project already exists: $PROJECT_DIR"
41
+ exit 1
42
+ fi
43
+
44
+ # Copy template
45
+ cp -r "$TEMPLATE_DIR" "$PROJECT_DIR"
46
+
47
+ # Fill in README.md
48
+ sed -i '' \
49
+ -e "s|^title: ''|title: '$PROJECT_NAME'|" \
50
+ -e "s|^created: ''|created: '$TODAY'|" \
51
+ -e "s|^start: ''|start: '$TODAY'|" \
52
+ "$PROJECT_DIR/README.md"
53
+
54
+ # Fill in zadani.md
55
+ sed -i '' \
56
+ -e "s|^title: 'Zadani — '|title: 'Zadani — $PROJECT_NAME'|" \
57
+ -e "s|^created: ''|created: '$TODAY'|" \
58
+ "$PROJECT_DIR/zadani.md"
59
+
60
+ echo "Project created: $PROJECT_DIR/"
61
+ echo ""
62
+ echo " README.md — scope, status, timeline"
63
+ echo " zadani.md — brief od klienta"
64
+ echo " deliverables/ — vystupy"
65
+ echo " notes/ — prubezne poznamky"
66
+ echo ""
67
+ echo "Next steps:"
68
+ echo " 1. Vyplnit zadani.md"
69
+ echo " 2. Doplnit scope a timeline v README.md"