-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathfollowups.ts
More file actions
183 lines (178 loc) · 5.51 KB
/
followups.ts
File metadata and controls
183 lines (178 loc) · 5.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
// altimate_change start — skill follow-up suggestions for conversational engagement
export namespace SkillFollowups {
export interface Suggestion {
skill: string // skill name to suggest
label: string // short display label
description: string // why this is a good next step
}
// Map from skill name to follow-up suggestions
const FOLLOWUPS: Record<string, Suggestion[]> = {
"dbt-develop": [
{
skill: "dbt-test",
label: "Add tests",
description: "Write schema tests and unit tests for the model you just created to ensure data quality.",
},
{
skill: "dbt-docs",
label: "Document your model",
description: "Add descriptions to your model and columns in schema.yml for discoverability.",
},
{
skill: "dbt-analyze",
label: "Check downstream impact",
description: "Analyze the blast radius of your changes on downstream models before merging.",
},
{
skill: "sql-review",
label: "Review SQL quality",
description: "Run a quality gate on your SQL — lint for anti-patterns and grade readability.",
},
],
"dbt-troubleshoot": [
{
skill: "dbt-test",
label: "Add regression tests",
description: "Now that the bug is fixed, add tests to prevent it from recurring.",
},
{
skill: "dbt-analyze",
label: "Check downstream impact",
description: "Verify your fix didn't break downstream models.",
},
{
skill: "dbt-develop",
label: "Improve the model",
description: "Refactor or extend the model now that it's working correctly.",
},
],
"dbt-test": [
{
skill: "dbt-develop",
label: "Build more models",
description: "Continue building new models in your dbt project.",
},
{
skill: "dbt-docs",
label: "Document tested models",
description: "Add documentation to the models you just tested.",
},
],
"dbt-docs": [
{
skill: "dbt-test",
label: "Add tests",
description: "Add data quality tests for the models you just documented.",
},
{
skill: "dbt-analyze",
label: "Analyze lineage",
description: "Review column-level lineage to ensure documentation matches data flow.",
},
],
"dbt-analyze": [
{
skill: "dbt-test",
label: "Add tests for affected models",
description: "Add tests to downstream models that could be impacted by changes.",
},
{
skill: "dbt-develop",
label: "Make the changes",
description: "Proceed with implementing the changes now that you understand the impact.",
},
],
"sql-review": [
{
skill: "query-optimize",
label: "Optimize performance",
description: "Improve query performance based on the review findings.",
},
{
skill: "sql-translate",
label: "Translate to another dialect",
description: "Port this SQL to a different database dialect.",
},
],
"sql-translate": [
{
skill: "sql-review",
label: "Review translated SQL",
description: "Run a quality check on the translated SQL to catch dialect-specific issues.",
},
],
"query-optimize": [
{
skill: "sql-review",
label: "Review optimized query",
description: "Run a quality gate on the optimized SQL.",
},
{
skill: "cost-report",
label: "Check cost impact",
description: "Analyze how the optimization affects query costs.",
},
],
"cost-report": [
{
skill: "query-optimize",
label: "Optimize expensive queries",
description: "Optimize the most expensive queries identified in the report.",
},
],
"pii-audit": [
{
skill: "sql-review",
label: "Review SQL for PII exposure",
description: "Check specific queries for PII leakage.",
},
],
"lineage-diff": [
{
skill: "dbt-analyze",
label: "Full impact analysis",
description: "Run a comprehensive impact analysis on the changed models.",
},
{
skill: "dbt-test",
label: "Add tests for changed paths",
description: "Add tests covering the changed data flow paths.",
},
],
"schema-migration": [
{
skill: "dbt-develop",
label: "Update dbt models",
description: "Update your dbt models to reflect the schema changes.",
},
],
}
// A special warehouse nudge for users who haven't connected yet
const WAREHOUSE_NUDGE =
"**Tip:** Connect a warehouse to validate against real data. Run `/discover` to auto-detect your connections."
export function get(skillName: string): readonly Suggestion[] {
return Object.freeze(FOLLOWUPS[skillName] ?? [])
}
export function format(skillName: string): string {
const suggestions = get(skillName)
if (suggestions.length === 0) return ""
const lines = [
"",
"---",
"",
"## What's Next?",
"",
"Now that this task is complete, here are suggested next steps:",
"",
...suggestions.map(
(s, i) => `${i + 1}. **${s.label}** — ${s.description} → Use \`/skill ${s.skill}\` or just ask me.`,
),
"",
WAREHOUSE_NUDGE,
"",
"*You can continue this conversation — just type your next request.*",
]
return lines.join("\n")
}
}
// altimate_change end