axiom-coding-agent-setup 1.0.10 → 1.0.11

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 (106) hide show
  1. package/.agents/skills/agent-browser/SKILL.md +55 -0
  2. package/.agents/skills/developing-with-streamlit/SKILL.md +220 -0
  3. package/.agents/skills/developing-with-streamlit/skills/building-streamlit-chat-ui/SKILL.md +195 -0
  4. package/.agents/skills/developing-with-streamlit/skills/building-streamlit-custom-components-v2/SKILL.md +233 -0
  5. package/.agents/skills/developing-with-streamlit/skills/building-streamlit-custom-components-v2/references/packaged-components.md +212 -0
  6. package/.agents/skills/developing-with-streamlit/skills/building-streamlit-custom-components-v2/references/state-sync.md +149 -0
  7. package/.agents/skills/developing-with-streamlit/skills/building-streamlit-custom-components-v2/references/theme-css-variables.md +243 -0
  8. package/.agents/skills/developing-with-streamlit/skills/building-streamlit-custom-components-v2/references/troubleshooting.md +121 -0
  9. package/.agents/skills/developing-with-streamlit/skills/building-streamlit-dashboards/SKILL.md +147 -0
  10. package/.agents/skills/developing-with-streamlit/skills/building-streamlit-multipage-apps/SKILL.md +218 -0
  11. package/.agents/skills/developing-with-streamlit/skills/choosing-streamlit-selection-widgets/SKILL.md +139 -0
  12. package/.agents/skills/developing-with-streamlit/skills/connecting-streamlit-to-snowflake/SKILL.md +188 -0
  13. package/.agents/skills/developing-with-streamlit/skills/creating-streamlit-themes/SKILL.md +486 -0
  14. package/.agents/skills/developing-with-streamlit/skills/displaying-streamlit-data/SKILL.md +199 -0
  15. package/.agents/skills/developing-with-streamlit/skills/improving-streamlit-design/SKILL.md +191 -0
  16. package/.agents/skills/developing-with-streamlit/skills/optimizing-streamlit-performance/SKILL.md +323 -0
  17. package/.agents/skills/developing-with-streamlit/skills/organizing-streamlit-code/SKILL.md +91 -0
  18. package/.agents/skills/developing-with-streamlit/skills/setting-up-streamlit-environment/SKILL.md +128 -0
  19. package/.agents/skills/developing-with-streamlit/skills/using-streamlit-cli/SKILL.md +165 -0
  20. package/.agents/skills/developing-with-streamlit/skills/using-streamlit-custom-components/SKILL.md +170 -0
  21. package/.agents/skills/developing-with-streamlit/skills/using-streamlit-layouts/SKILL.md +229 -0
  22. package/.agents/skills/developing-with-streamlit/skills/using-streamlit-markdown/SKILL.md +207 -0
  23. package/.agents/skills/developing-with-streamlit/skills/using-streamlit-session-state/SKILL.md +144 -0
  24. package/.agents/skills/developing-with-streamlit/templates/.gitattributes +3 -0
  25. package/.agents/skills/developing-with-streamlit/templates/apps/README.md +188 -0
  26. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-companies/pyproject.toml +12 -0
  27. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-companies/streamlit_app.py +365 -0
  28. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-compute/pyproject.toml +12 -0
  29. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-compute/streamlit_app.py +461 -0
  30. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-compute-snowflake/.streamlit/secrets.toml.example +20 -0
  31. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-compute-snowflake/pyproject.toml +11 -0
  32. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-compute-snowflake/snowflake.yml +18 -0
  33. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-compute-snowflake/streamlit_app.py +527 -0
  34. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-feature-usage/pyproject.toml +12 -0
  35. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-feature-usage/streamlit_app.py +307 -0
  36. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-metrics/pyproject.toml +12 -0
  37. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-metrics/streamlit_app.py +426 -0
  38. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-metrics-snowflake/.streamlit/secrets.toml.example +20 -0
  39. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-metrics-snowflake/pyproject.toml +11 -0
  40. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-metrics-snowflake/snowflake.yml +18 -0
  41. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-metrics-snowflake/streamlit_app.py +463 -0
  42. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-seattle-weather/pyproject.toml +12 -0
  43. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-seattle-weather/streamlit_app.py +252 -0
  44. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-stock-peers/pyproject.toml +12 -0
  45. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-stock-peers/streamlit_app.py +342 -0
  46. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-stock-peers-snowflake/.streamlit/secrets.toml.example +20 -0
  47. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-stock-peers-snowflake/pyproject.toml +11 -0
  48. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-stock-peers-snowflake/snowflake.yml +18 -0
  49. package/.agents/skills/developing-with-streamlit/templates/apps/dashboard-stock-peers-snowflake/streamlit_app.py +384 -0
  50. package/.agents/skills/developing-with-streamlit/templates/themes/README.md +128 -0
  51. package/.agents/skills/developing-with-streamlit/templates/themes/_configs/dracula.toml +39 -0
  52. package/.agents/skills/developing-with-streamlit/templates/themes/_configs/github.toml +37 -0
  53. package/.agents/skills/developing-with-streamlit/templates/themes/_configs/minimal.toml +39 -0
  54. package/.agents/skills/developing-with-streamlit/templates/themes/_configs/nord.toml +39 -0
  55. package/.agents/skills/developing-with-streamlit/templates/themes/_configs/snowflake.toml +42 -0
  56. package/.agents/skills/developing-with-streamlit/templates/themes/_configs/solarized-light.toml +38 -0
  57. package/.agents/skills/developing-with-streamlit/templates/themes/_configs/spotify.toml +34 -0
  58. package/.agents/skills/developing-with-streamlit/templates/themes/_configs/stripe.toml +35 -0
  59. package/.agents/skills/developing-with-streamlit/templates/themes/_shared/streamlit_app.py +336 -0
  60. package/.agents/skills/developing-with-streamlit/templates/themes/_templates/pyproject.toml.tmpl +12 -0
  61. package/.agents/skills/developing-with-streamlit/templates/themes/dracula/.streamlit/config.toml +39 -0
  62. package/.agents/skills/developing-with-streamlit/templates/themes/dracula/pyproject.toml +10 -0
  63. package/.agents/skills/developing-with-streamlit/templates/themes/dracula/streamlit_app.py +337 -0
  64. package/.agents/skills/developing-with-streamlit/templates/themes/github/.streamlit/config.toml +37 -0
  65. package/.agents/skills/developing-with-streamlit/templates/themes/github/pyproject.toml +10 -0
  66. package/.agents/skills/developing-with-streamlit/templates/themes/github/streamlit_app.py +337 -0
  67. package/.agents/skills/developing-with-streamlit/templates/themes/manage.py +332 -0
  68. package/.agents/skills/developing-with-streamlit/templates/themes/minimal/.streamlit/config.toml +39 -0
  69. package/.agents/skills/developing-with-streamlit/templates/themes/minimal/pyproject.toml +10 -0
  70. package/.agents/skills/developing-with-streamlit/templates/themes/minimal/streamlit_app.py +337 -0
  71. package/.agents/skills/developing-with-streamlit/templates/themes/nord/.streamlit/config.toml +39 -0
  72. package/.agents/skills/developing-with-streamlit/templates/themes/nord/pyproject.toml +10 -0
  73. package/.agents/skills/developing-with-streamlit/templates/themes/nord/streamlit_app.py +337 -0
  74. package/.agents/skills/developing-with-streamlit/templates/themes/snowflake/.streamlit/config.toml +42 -0
  75. package/.agents/skills/developing-with-streamlit/templates/themes/snowflake/pyproject.toml +10 -0
  76. package/.agents/skills/developing-with-streamlit/templates/themes/snowflake/streamlit_app.py +337 -0
  77. package/.agents/skills/developing-with-streamlit/templates/themes/solarized-light/.streamlit/config.toml +38 -0
  78. package/.agents/skills/developing-with-streamlit/templates/themes/solarized-light/pyproject.toml +10 -0
  79. package/.agents/skills/developing-with-streamlit/templates/themes/solarized-light/streamlit_app.py +337 -0
  80. package/.agents/skills/developing-with-streamlit/templates/themes/spotify/.streamlit/config.toml +34 -0
  81. package/.agents/skills/developing-with-streamlit/templates/themes/spotify/pyproject.toml +10 -0
  82. package/.agents/skills/developing-with-streamlit/templates/themes/spotify/streamlit_app.py +337 -0
  83. package/.agents/skills/developing-with-streamlit/templates/themes/stripe/.streamlit/config.toml +35 -0
  84. package/.agents/skills/developing-with-streamlit/templates/themes/stripe/pyproject.toml +10 -0
  85. package/.agents/skills/developing-with-streamlit/templates/themes/stripe/streamlit_app.py +337 -0
  86. package/.agents/skills/fastapi/SKILL.md +436 -0
  87. package/.agents/skills/fastapi/references/dependencies.md +142 -0
  88. package/.agents/skills/fastapi/references/other-tools.md +76 -0
  89. package/.agents/skills/fastapi/references/streaming.md +105 -0
  90. package/.agents/skills/frontend-design/LICENSE.txt +177 -0
  91. package/.agents/skills/frontend-design/SKILL.md +42 -0
  92. package/.agents/skills/gradio/SKILL.md +84 -0
  93. package/.agents/skills/gradio/references/api-signatures.md +115 -0
  94. package/.agents/skills/gradio/references/event-listeners.md +130 -0
  95. package/.agents/skills/gradio/references/examples.md +613 -0
  96. package/.agents/skills/ui-ux-pro-max/SKILL.md +659 -0
  97. package/.agents/skills/ui-ux-pro-max/data +1 -0
  98. package/.agents/skills/ui-ux-pro-max/scripts +1 -0
  99. package/.env.axiom +8 -0
  100. package/AGENTS.md +2 -1
  101. package/README.md +19 -3
  102. package/bin/cli.js +11 -1
  103. package/opencode.json +7 -4
  104. package/package.json +1 -1
  105. package/skills-lock.json +36 -0
  106. package/.agents/skills/n8n-patterns/SKILL.md +0 -272
@@ -0,0 +1,307 @@
1
+ """
2
+ API Usage Dashboard Template
3
+
4
+ A feature analytics dashboard demonstrating:
5
+ - Segmented control for category selection
6
+ - Multiselect for endpoint filtering
7
+ - Starter kits / presets for quick selection
8
+ - Time series visualization with normalization
9
+ - Metric cards with 28-day deltas
10
+ - Rolling average options
11
+
12
+ This template uses synthetic data. Replace generate_api_data()
13
+ with your actual data source (e.g., Snowflake queries, APIs, etc.)
14
+ """
15
+
16
+ from datetime import date, timedelta
17
+ import numpy as np
18
+ import pandas as pd
19
+ import streamlit as st
20
+ import altair as alt
21
+
22
+ st.set_page_config(
23
+ page_title="API Usage Dashboard",
24
+ page_icon=":material/api:",
25
+ layout="wide",
26
+ )
27
+
28
+
29
+ # =============================================================================
30
+ # Synthetic Data Generation (Replace with your data source)
31
+ # =============================================================================
32
+
33
+ # API categories and their endpoints
34
+ API_CATEGORIES = {
35
+ "Users": ["/users", "/users/{id}", "/users/me", "/users/search", "/users/bulk", "/users/export"],
36
+ "Orders": ["/orders", "/orders/{id}", "/orders/create", "/orders/cancel", "/orders/refund", "/orders/status"],
37
+ "Products": ["/products", "/products/{id}", "/products/search", "/products/categories", "/products/inventory"],
38
+ "Analytics": ["/analytics/events", "/analytics/metrics", "/analytics/reports", "/analytics/dashboards"],
39
+ }
40
+
41
+ # Starter kits - predefined endpoint selections
42
+ STARTER_KITS = {
43
+ "None": [],
44
+ "Core CRUD": ["/users", "/users/{id}", "/orders", "/orders/{id}"],
45
+ "Search": ["/users/search", "/products/search", "/products/categories"],
46
+ "Analytics": ["/analytics/events", "/analytics/metrics", "/analytics/reports"],
47
+ "High Volume": ["/users", "/products", "/orders", "/analytics/events"],
48
+ }
49
+
50
+ ROLLING_OPTIONS = {"Raw": 1, "7-day average": 7, "28-day average": 28}
51
+
52
+
53
+ def generate_api_data(
54
+ endpoints: list[str],
55
+ start_date: date,
56
+ end_date: date,
57
+ ) -> pd.DataFrame:
58
+ """Generate synthetic API usage data.
59
+
60
+ Replace this function with your actual data source.
61
+ """
62
+ np.random.seed(42)
63
+
64
+ dates = pd.date_range(start=start_date, end=end_date, freq="D")
65
+ records = []
66
+
67
+ for endpoint in endpoints:
68
+ # Each endpoint has different base traffic and growth
69
+ base = np.random.randint(1000, 50000)
70
+ growth = np.random.uniform(0.0005, 0.003)
71
+
72
+ for i, dt in enumerate(dates):
73
+ # Base trend with growth
74
+ trend = base * (1 + growth) ** i
75
+
76
+ # Weekly seasonality (lower on weekends)
77
+ if dt.dayofweek >= 5:
78
+ trend *= 0.4
79
+
80
+ # Random noise
81
+ value = trend * np.random.uniform(0.85, 1.15)
82
+
83
+ records.append({
84
+ "date": dt,
85
+ "endpoint": endpoint,
86
+ "request_count": int(value),
87
+ })
88
+
89
+ df = pd.DataFrame(records)
90
+ return df
91
+
92
+
93
+ @st.cache_data(ttl=3600)
94
+ def load_api_data() -> pd.DataFrame:
95
+ """Load all API usage data."""
96
+ end_date = date.today() - timedelta(days=1)
97
+ start_date = end_date - timedelta(days=365)
98
+
99
+ all_endpoints = []
100
+ for endpoints in API_CATEGORIES.values():
101
+ all_endpoints.extend(endpoints)
102
+
103
+ return generate_api_data(all_endpoints, start_date, end_date)
104
+
105
+
106
+ def apply_rolling_average(df: pd.DataFrame, window: int) -> pd.DataFrame:
107
+ """Apply rolling average to request data."""
108
+ if window == 1:
109
+ return df
110
+
111
+ result = df.copy()
112
+ result["request_count"] = (
113
+ result.groupby("endpoint")["request_count"]
114
+ .transform(lambda x: x.rolling(window, min_periods=1).mean())
115
+ )
116
+ return result
117
+
118
+
119
+ def normalize_data(df: pd.DataFrame) -> pd.DataFrame:
120
+ """Normalize request counts to percentages (share of total per day)."""
121
+ result = df.copy()
122
+ daily_totals = result.groupby("date")["request_count"].transform("sum")
123
+ result["request_count"] = result["request_count"] / daily_totals
124
+ return result
125
+
126
+
127
+ def calculate_delta(df: pd.DataFrame, endpoint: str) -> tuple[float, float | None]:
128
+ """Calculate 28-day delta for an endpoint."""
129
+ endpoint_data = df[df["endpoint"] == endpoint].sort_values("date")
130
+
131
+ if len(endpoint_data) < 2:
132
+ return endpoint_data["request_count"].iloc[-1], None
133
+
134
+ latest = endpoint_data["request_count"].iloc[-1]
135
+
136
+ if len(endpoint_data) > 28:
137
+ previous = endpoint_data["request_count"].iloc[-29]
138
+ else:
139
+ previous = endpoint_data["request_count"].iloc[0]
140
+
141
+ delta = latest - previous
142
+ return latest, delta
143
+
144
+
145
+ # =============================================================================
146
+ # Page Layout
147
+ # =============================================================================
148
+
149
+ # Load data
150
+ raw_data = load_api_data()
151
+
152
+ # Header
153
+ st.markdown("# API Usage :material/api:")
154
+ st.caption("Select an API category to explore endpoint usage over time.")
155
+
156
+ # Category selection (not centered)
157
+ category = st.segmented_control(
158
+ "Select category",
159
+ options=[
160
+ ":material/person: Users",
161
+ ":material/shopping_cart: Orders",
162
+ ":material/inventory_2: Products",
163
+ ":material/analytics: Analytics",
164
+ ],
165
+ default=":material/person: Users",
166
+ label_visibility="collapsed",
167
+ )
168
+
169
+ if not category:
170
+ st.warning("Please select a category above.", icon=":material/warning:")
171
+ st.stop()
172
+
173
+ # Map display name to category key
174
+ category_map = {
175
+ ":material/person: Users": "Users",
176
+ ":material/shopping_cart: Orders": "Orders",
177
+ ":material/inventory_2: Products": "Products",
178
+ ":material/analytics: Analytics": "Analytics",
179
+ }
180
+ selected_category = category_map[category]
181
+
182
+ st.subheader(f"{category} endpoints", divider="gray")
183
+
184
+ # Layout: filters on left, chart on right
185
+ filter_col, chart_col = st.columns([1, 2])
186
+
187
+ with filter_col:
188
+ # Metric selection
189
+ with st.expander("Metric", expanded=True, icon=":material/analytics:"):
190
+ measure = st.selectbox(
191
+ "Choose a measure",
192
+ ["Request count", "Unique callers", "Error rate"],
193
+ index=0,
194
+ label_visibility="collapsed",
195
+ disabled=True, # Only one option in this template
196
+ help="In production, connect to different metrics tables",
197
+ )
198
+
199
+ rolling_label = st.segmented_control(
200
+ "Time aggregation",
201
+ list(ROLLING_OPTIONS.keys()),
202
+ default="7-day average",
203
+ label_visibility="collapsed",
204
+ )
205
+
206
+ if rolling_label is None:
207
+ st.caption("Please select a time aggregation.")
208
+ st.stop()
209
+
210
+ rolling_window = ROLLING_OPTIONS[rolling_label]
211
+
212
+ normalize = st.toggle(
213
+ "Normalize",
214
+ value=False,
215
+ help="Normalize to show percentage share of total requests",
216
+ )
217
+
218
+ # Starter kits
219
+ with st.expander("Starter kits", expanded=True, icon=":material/auto_awesome:"):
220
+ starter_kit = st.pills(
221
+ "Quick select",
222
+ options=list(STARTER_KITS.keys()),
223
+ default="None",
224
+ label_visibility="collapsed",
225
+ )
226
+
227
+ # Endpoint selection
228
+ available_endpoints = API_CATEGORIES[selected_category]
229
+
230
+ # Determine default selection based on starter kit
231
+ if starter_kit and starter_kit != "None":
232
+ default_endpoints = [e for e in STARTER_KITS[starter_kit] if e in available_endpoints]
233
+ else:
234
+ default_endpoints = available_endpoints[:4] # First 4 endpoints
235
+
236
+ with st.expander("Endpoints", expanded=True, icon=":material/checklist:"):
237
+ selected_endpoints = st.multiselect(
238
+ "Select endpoints",
239
+ options=available_endpoints,
240
+ default=default_endpoints,
241
+ label_visibility="collapsed",
242
+ )
243
+
244
+ # Filter and process data
245
+ if not selected_endpoints:
246
+ with chart_col:
247
+ st.info("Select at least one endpoint to view usage data.", icon=":material/info:")
248
+ st.stop()
249
+
250
+ filtered_data = raw_data[raw_data["endpoint"].isin(selected_endpoints)].copy()
251
+ filtered_data = apply_rolling_average(filtered_data, rolling_window)
252
+
253
+ if normalize:
254
+ filtered_data = normalize_data(filtered_data)
255
+
256
+ with chart_col:
257
+ # Latest metrics
258
+ with st.expander("Latest numbers", expanded=True, icon=":material/numbers:"):
259
+ metrics_row = st.container(horizontal=True)
260
+
261
+ for endpoint in selected_endpoints:
262
+ latest, delta = calculate_delta(filtered_data, endpoint)
263
+
264
+ if normalize:
265
+ value_str = f"{latest:.2%}"
266
+ delta_str = f"{delta:+.2%}" if delta is not None else None
267
+ else:
268
+ value_str = f"{latest:,.0f}"
269
+ delta_str = f"{delta:+,.0f}" if delta is not None else None
270
+
271
+ metrics_row.metric(
272
+ label=endpoint,
273
+ value=value_str,
274
+ delta=delta_str,
275
+ border=True,
276
+ )
277
+
278
+ # Time series chart
279
+ with st.expander("Time series", expanded=True, icon=":material/show_chart:"):
280
+ y_format = ".1%" if normalize else ",.0f"
281
+ y_title = "Share of requests" if normalize else "Request count"
282
+
283
+ chart = (
284
+ alt.Chart(filtered_data)
285
+ .mark_line()
286
+ .encode(
287
+ x=alt.X("date:T", title="Date"),
288
+ y=alt.Y("request_count:Q", title=y_title, axis=alt.Axis(format=y_format)),
289
+ color=alt.Color("endpoint:N", title="Endpoint", legend=alt.Legend(orient="bottom")),
290
+ tooltip=[
291
+ alt.Tooltip("date:T", title="Date", format="%Y-%m-%d"),
292
+ alt.Tooltip("endpoint:N", title="Endpoint"),
293
+ alt.Tooltip("request_count:Q", title="Requests", format=y_format),
294
+ ],
295
+ )
296
+ .properties(height=450)
297
+ .interactive()
298
+ )
299
+
300
+ st.altair_chart(chart)
301
+
302
+ # Raw data section
303
+ with st.expander("Raw data", expanded=False, icon=":material/table:"):
304
+ display_df = filtered_data.copy()
305
+ if normalize:
306
+ display_df["request_count"] = display_df["request_count"].apply(lambda x: f"{x:.2%}")
307
+ st.dataframe(display_df, hide_index=True)
@@ -0,0 +1,12 @@
1
+ [project]
2
+ name = "dashboard-metrics"
3
+ version = "1.0.0"
4
+ description = "A metrics dashboard template showing time series with sparklines and filtering"
5
+ requires-python = ">=3.11"
6
+ dependencies = [
7
+ "altair>=5.5.0",
8
+ "numpy>=1.26.0",
9
+ "pandas>=2.2.3",
10
+ "snowflake-connector-python>=3.3.0",
11
+ "streamlit[snowflake]>=1.54.0",
12
+ ]