@arkone_ai/pipeline-report 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,31 @@
1
+ # @arkone_ai/pipeline-report
2
+
3
+ A [Claude Code](https://claude.ai/code) skill that generates pipeline snapshot reports with forecasting, velocity metrics, and at-risk deal analysis.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @arkone_ai/pipeline-report
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ In any Claude Code session:
14
+
15
+ ```
16
+ /pipeline-report
17
+ ```
18
+
19
+ ## What it does
20
+
21
+ - Pulls pipeline data from HubSpot, Salesforce, or Pipedrive — or reads a local `./pipeline.csv`
22
+ - Analyzes deals by stage (count + value), weighted pipeline (value × stage probability), and forecast (committed / best case / pipeline)
23
+ - Calculates velocity: average days per stage, average deal cycle length
24
+ - Identifies stale deals (no activity in 14+ days) and at-risk deals (stalled, no next steps, champion left)
25
+ - Computes stage-to-stage conversion rates, new deals added, and deals lost with reasons
26
+ - Produces executive summary, pipeline-by-stage table, forecast, velocity, at-risk list, and rep comparison
27
+ - Saves to `./pipeline-report-{date}.md`
28
+
29
+ ## License
30
+
31
+ MIT
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+ import { copyFileSync, mkdirSync, existsSync } from 'fs';
3
+ import { join } from 'path';
4
+ import { homedir } from 'os';
5
+
6
+ const root = join(import.meta.dirname, '..');
7
+ const home = homedir();
8
+
9
+ const agents = [
10
+ { name: 'Claude Code', dir: join(home, '.claude', 'skills') },
11
+ { name: 'Codex', dir: join(home, '.codex', 'skills') },
12
+ { name: 'Kiro', dir: join(home, '.kiro', 'skills') },
13
+ ];
14
+
15
+ const files = [
16
+ { src: join(root, 'skill.md'), dest: 'pipeline-report.md' },
17
+ ];
18
+
19
+ let installed = 0;
20
+ for (const agent of agents) {
21
+ if (!existsSync(agent.dir)) continue;
22
+ for (const file of files) {
23
+ copyFileSync(file.src, join(agent.dir, file.dest));
24
+ }
25
+ console.log(`\u2713 ${agent.name}: ${agent.dir}`);
26
+ installed++;
27
+ }
28
+
29
+ if (installed === 0) {
30
+ mkdirSync(agents[0].dir, { recursive: true });
31
+ for (const file of files) {
32
+ copyFileSync(file.src, join(agents[0].dir, file.dest));
33
+ }
34
+ console.log(`\u2713 Claude Code: ${agents[0].dir}`);
35
+ }
36
+
37
+ console.log('\nUse /pipeline-report in any supported AI session.');
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@arkone_ai/pipeline-report",
3
+ "version": "1.0.0",
4
+ "description": "Claude Code skill: generate pipeline snapshot reports with forecast, velocity metrics, and at-risk deal analysis from CRM or CSV",
5
+ "type": "module",
6
+ "scripts": { "postinstall": "node install/install.js" },
7
+ "bin": { "pipeline-report": "install/install.js" },
8
+ "files": ["skill.md", "install/", "README.md"],
9
+ "keywords": ["claude", "claude-code", "arkone", "bd-ops", "pipeline-report", "pipeline", "forecast"],
10
+ "license": "MIT",
11
+ "engines": { "node": ">=18" }
12
+ }
package/skill.md ADDED
@@ -0,0 +1,225 @@
1
+ ---
2
+ name: pipeline-report
3
+ description: "Generate a pipeline snapshot report with deal-stage analysis, forecast, velocity metrics, and at-risk deals from CRM or local CSV. Use this skill when: 'pipeline report', 'show pipeline', 'forecast report', 'pipeline analysis', 'deal pipeline status'. Also trigger for: 'pipeline review', 'sales forecast', 'pipeline health', 'quarterly pipeline', 'pipeline snapshot'."
4
+ license: MIT
5
+ compatibility: Designed for Claude Code
6
+ ---
7
+
8
+ # Pipeline Report
9
+
10
+ Generate a pipeline snapshot: deals by stage, weighted forecast, velocity metrics, at-risk deals, and conversion rates. Pulls from HubSpot, Salesforce, Pipedrive, or a local CSV.
11
+
12
+ ## When to Use
13
+
14
+ - Weekly or monthly pipeline reviews
15
+ - Board meeting prep
16
+ - Identifying stale or at-risk deals
17
+ - Forecasting committed vs. best-case revenue
18
+
19
+ ## Step 1: Gather Inputs
20
+
21
+ ### Required
22
+
23
+ | Input | Default |
24
+ |---|---|
25
+ | Time period | Current quarter |
26
+
27
+ ### Optional
28
+
29
+ | Input | Default |
30
+ |---|---|
31
+ | Pipeline data source | Auto-detect (CRM env vars or `./pipeline.csv`) |
32
+ | Filter by rep name | All reps |
33
+ | Filter by stage | All stages |
34
+ | Filter by deal size | No filter |
35
+ | Target revenue for period | Not specified |
36
+ | Historical comparison period | Prior quarter |
37
+
38
+ ## Step 2: CRM Config Discovery
39
+
40
+ Check for CRM configuration in this order:
41
+
42
+ ### Priority 1: Environment Variables
43
+
44
+ | Env Var(s) | Provider |
45
+ |---|---|
46
+ | `HUBSPOT_API_KEY` | HubSpot |
47
+ | `SALESFORCE_ACCESS_TOKEN` + `SALESFORCE_INSTANCE_URL` | Salesforce |
48
+ | `PIPEDRIVE_API_KEY` | Pipedrive |
49
+
50
+ ### Priority 2: Config File
51
+
52
+ Check `~/.claude/crm-config.json`:
53
+
54
+ ```json
55
+ {
56
+ "provider": "hubspot",
57
+ "api_key": "pat-xxxx",
58
+ "instance_url": "",
59
+ "default_pipeline": "default",
60
+ "default_owner": ""
61
+ }
62
+ ```
63
+
64
+ ### Priority 3: Local CSV Fallback
65
+
66
+ If no CRM config is found or user declines setup, look for:
67
+ 1. `./pipeline.csv` in the current directory
68
+ 2. User-specified CSV file path
69
+
70
+ **Expected CSV columns:** `deal_name, company, stage, value, probability, owner, created_date, last_activity_date, close_date, next_step, notes`
71
+
72
+ If none exists, ask the user to provide their pipeline data.
73
+
74
+ ## Step 3: Pull Pipeline Data
75
+
76
+ ### HubSpot
77
+
78
+ ```
79
+ POST https://api.hubapi.com/crm/v3/objects/deals/search
80
+ Authorization: Bearer {api_key}
81
+ Body: filter by close_date within period, return deal name, amount, dealstage, owner, last activity
82
+ ```
83
+
84
+ ### Salesforce
85
+
86
+ ```
87
+ GET {instance_url}/services/data/v59.0/query?q=SELECT+Name,Amount,StageName,OwnerId,LastActivityDate,CloseDate+FROM+Opportunity+WHERE+CloseDate>=PERIOD_START+AND+CloseDate<=PERIOD_END
88
+ Authorization: Bearer {access_token}
89
+ ```
90
+
91
+ ### Pipedrive
92
+
93
+ ```
94
+ GET https://api.pipedrive.com/v1/deals?status=open&api_token={key}
95
+ Filter by expected_close_date within period
96
+ ```
97
+
98
+ Apply any user-specified filters (rep, stage, deal size) after pulling data.
99
+
100
+ ## Step 4: Analyze the Pipeline
101
+
102
+ ### Deals by Stage
103
+
104
+ For each stage: count of deals, total value, average deal size.
105
+
106
+ ### Weighted Pipeline
107
+
108
+ For each deal: `weighted_value = deal_value × (stage_probability / 100)`
109
+
110
+ Default stage probabilities:
111
+ | Stage | Probability |
112
+ |---|---|
113
+ | Prospecting | 10% |
114
+ | Qualification | 20% |
115
+ | Discovery | 30% |
116
+ | Demo / Proposal | 50% |
117
+ | Negotiation | 70% |
118
+ | Contract Sent | 90% |
119
+ | Closed Won | 100% |
120
+ | Closed Lost | 0% |
121
+
122
+ Use CRM-defined probabilities if available.
123
+
124
+ ### Forecast
125
+
126
+ | Category | Definition |
127
+ |---|---|
128
+ | Committed | Deals with ≥90% probability or "Commit" forecast category |
129
+ | Best Case | Committed + deals ≥50% probability |
130
+ | Pipeline | All open deals (weighted sum) |
131
+
132
+ ### Velocity Metrics
133
+
134
+ - Average days per stage (based on stage entry dates if available, else last_activity_date)
135
+ - Average total deal cycle (created_date to close_date for closed deals this period)
136
+ - Compare to prior period if historical data available
137
+
138
+ ### Stale Deals
139
+
140
+ Deals where `last_activity_date` is 14 or more days ago AND status is not closed.
141
+
142
+ ### At-Risk Deals
143
+
144
+ Flag a deal as at-risk if any of these are true:
145
+ - Time in current stage is more than 2× the average for that stage
146
+ - No `next_step` defined
147
+ - `next_step_date` is overdue by more than 7 days
148
+ - Champion/primary contact left (flag for user to investigate)
149
+
150
+ ### Conversion Rates
151
+
152
+ For each stage transition, calculate: `deals_advanced / deals_entered × 100%`
153
+
154
+ ## Step 5: Generate Report
155
+
156
+ ### Executive Summary
157
+
158
+ Total pipeline value, weighted value, forecast (committed / best / pipeline), active deal count, key risks (top 3 at-risk deals), vs. target (if provided).
159
+
160
+ ### Pipeline by Stage Table
161
+
162
+ | Stage | Deals | Total Value | Avg Size | Weighted |
163
+ |---|---|---|---|---|
164
+
165
+ ### Forecast Table
166
+
167
+ | Category | Value | Notes |
168
+ |---|---|---|
169
+ | Committed | ${amount} | {count} deals at ≥90% |
170
+ | Best Case | ${amount} | Committed + ≥50% |
171
+ | Pipeline | ${amount} | All open (weighted) |
172
+
173
+ ### Velocity Metrics
174
+
175
+ | Stage | Avg Days | vs. Prior Period |
176
+ |---|---|---|
177
+
178
+ ### At-Risk Deals
179
+
180
+ | Deal | Company | Value | Stage | Risk Reason | Recommended Action |
181
+ |---|---|---|---|---|---|
182
+
183
+ ### Rep Performance (if multi-rep)
184
+
185
+ | Rep | Deals | Pipeline | Weighted | Avg Cycle | Win Rate |
186
+ |---|---|---|---|---|---|
187
+
188
+ ### Trend vs. Prior Period
189
+
190
+ If historical data is available: total pipeline change (%), new deals added, deals lost, win rate change.
191
+
192
+ ## Step 6: Save Output
193
+
194
+ Save to:
195
+
196
+ ```
197
+ ./pipeline-report-{YYYY-MM-DD}.md
198
+ ```
199
+
200
+ ## Step 7: Output Summary
201
+
202
+ ```
203
+ Pipeline Report Generated
204
+ ─────────────────────────
205
+ Period: {time period}
206
+ Active Deals: {count}
207
+ Pipeline Value: ${total}
208
+ Weighted: ${weighted}
209
+ Committed: ${committed}
210
+ At-Risk: {count} deals
211
+ Stale: {count} deals
212
+ Saved to: ./pipeline-report-{date}.md
213
+ ```
214
+
215
+ ## Error Handling
216
+
217
+ | Error | Action |
218
+ |---|---|
219
+ | CRM returns 401/403 | Inform user — credentials may be expired. Offer CSV fallback. |
220
+ | CRM returns 500 | Warn user, retry once, then offer CSV fallback |
221
+ | CSV not found | Ask user for file path or offer to accept pasted data |
222
+ | CSV malformed | Show parsing error, list expected columns |
223
+ | No deals in period | Report empty pipeline, note the time period |
224
+ | API rate limit | Wait 10 seconds, retry once |
225
+ | Missing stage probabilities | Use default table above |