@vesviet/agent-skills 5.6.0 → 5.7.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/INDEX.md +5 -5
- package/README.md +1 -1
- package/VERSION +1 -1
- package/adapters/antigravity/a2a-config.template.yaml +1 -1
- package/adapters/antigravity/role-skill-index.json +12 -12
- package/adapters/claude/CLAUDE_ADAPTER.md +1 -1
- package/adapters/cursor/README.md +185 -185
- package/bin/agent-skills.mjs +17 -14
- package/core/contracts/README.md +1 -1
- package/core/contracts/schemas/api-contract-spec.json +191 -191
- package/core/contracts/schemas/data-pipeline-spec.json +1 -1
- package/core/contracts/schemas/design-tokens-spec.json +19 -0
- package/core/contracts/schemas/feature-ticket.json +1293 -1293
- package/core/contracts/schemas/pull-request-spec.json +338 -338
- package/core/contracts/schemas/references/detailed/01-solution-and-governance.md +19 -19
- package/core/contracts/schemas/references/detailed/02-engineering-delivery.md +93 -93
- package/core/contracts/schemas/references/detailed/04-finance-accounting-and-compliance.md +54 -54
- package/core/contracts/schemas/references/detailed/05-design-and-content.md +92 -92
- package/core/contracts/schemas/references/detailed/06-seo-and-publishing.md +48 -48
- package/core/contracts/schemas/references/detailed/07-a2a-protocol.md +85 -85
- package/core/contracts/schemas/security-audit.json +143 -12
- package/core/contracts/schemas/system-design-spec.json +9 -1
- package/core/contracts/schemas/test-report.json +530 -530
- package/core/contracts/schemas/ux-flow-spec.json +66 -0
- package/core/roles/ai-systems-engineer.md +31 -18
- package/core/roles/aws-engineer.md +33 -29
- package/core/roles/backend-developer.md +6 -4
- package/core/roles/content-manager.md +7 -7
- package/core/roles/data-engineer.md +39 -36
- package/core/roles/qa-engineer.md +18 -18
- package/core/roles/references/ai-systems-engineer-review-checklist.md +11 -3
- package/core/roles/references/aws-engineer-review-checklist.md +29 -16
- package/core/roles/references/business-analyst-responsibilities.md +207 -207
- package/core/roles/references/content-manager-governance-standards.md +2 -2
- package/core/roles/references/content-manager-review-checklist.md +7 -1
- package/core/roles/references/data-engineer-review-checklist.md +11 -3
- package/core/roles/references/frontend-developer-responsibilities.md +275 -275
- package/core/roles/references/qa-engineer-review-checklist.md +10 -5
- package/core/roles/references/security-engineer-review-checklist.md +8 -0
- package/core/roles/references/solution-architect-review-checklist.md +6 -1
- package/core/roles/references/system-engineer-review-checklist.md +11 -0
- package/core/roles/references/ui-ux-designer-review-checklist.md +12 -0
- package/core/roles/security-engineer.md +35 -5
- package/core/roles/solution-architect.md +7 -7
- package/core/roles/system-engineer.md +470 -465
- package/core/roles/ui-ux-designer.md +17 -3
- package/core/skills/agent/agent-memory-compaction/references/anchored-schema-and-compaction-algorithms.md +141 -141
- package/core/skills/agent/architect-mcp-server/SKILL.md +3 -3
- package/core/skills/agent/decompose-agentic-system/SKILL.md +1 -1
- package/core/skills/ai/deploy-vllm-inference/SKILL.md +14 -14
- package/core/skills/ai-agent/agent-evaluation/SKILL.md +5 -0
- package/core/skills/ai-agent/context-optimization/SKILL.md +9 -0
- package/core/skills/backend/add-api-endpoint/SKILL.md +1 -0
- package/core/skills/backend/add-event-handler/SKILL.md +1 -0
- package/core/skills/backend/add-service-client/SKILL.md +1 -0
- package/core/skills/backend/build-mcp-server/SKILL.md +101 -100
- package/core/skills/backend/implement-auth/SKILL.md +1 -0
- package/core/skills/backend/implement-structured-outputs/SKILL.md +95 -94
- package/core/skills/backend/optimize-postgres/SKILL.md +1 -0
- package/core/skills/backend/scaffold-new-service/SKILL.md +1 -0
- package/core/skills/business/elicit-requirements/SKILL.md +102 -102
- package/core/skills/business/elicit-requirements/references/elicitation-techniques-and-babok-criteria.md +60 -60
- package/core/skills/business/trace-requirements-impact/SKILL.md +97 -97
- package/core/skills/business/trace-requirements-impact/references/rtm-graph-and-prioritization-models.md +109 -109
- package/core/skills/business/write-use-cases/SKILL.md +106 -106
- package/core/skills/business/write-use-cases/references/cockburn-scoping-and-13-field-template.md +135 -135
- package/core/skills/content/audit-content/SKILL.md +3 -2
- package/core/skills/content/audit-content/references/information-gain-rubric.md +1 -1
- package/core/skills/content/design-content-strategy/SKILL.md +6 -5
- package/core/skills/content/design-content-strategy/references/information-gain-and-decay-triage.md +2 -2
- package/core/skills/content/optimize-seo/SKILL.md +6 -5
- package/core/skills/content/optimize-seo/references/geo-ai-citation-playbook.md +2 -2
- package/core/skills/content/optimize-seo/references/process-and-checklist.md +1 -1
- package/core/skills/content/repurpose-content/SKILL.md +4 -3
- package/core/skills/content/write-article/SKILL.md +6 -5
- package/core/skills/content/write-copy/SKILL.md +3 -2
- package/core/skills/document/pptx/SKILL.md +1 -0
- package/core/skills/document/pptx/scripts/add_slide.py +0 -0
- package/core/skills/document/pptx/scripts/clean.py +0 -0
- package/core/skills/document/pptx/scripts/thumbnail.py +0 -0
- package/core/skills/document/xlsx/scripts/recalc.py +0 -0
- package/core/skills/documentation/write-documentation/SKILL.md +143 -143
- package/core/skills/documentation/write-tech-radar/SKILL.md +149 -149
- package/core/skills/foundation/accessibility-review/SKILL.md +160 -160
- package/core/skills/foundation/design-review/SKILL.md +11 -1
- package/core/skills/foundation/design-ux-flow/SKILL.md +13 -1
- package/core/skills/foundation/performance-profiling/SKILL.md +3 -1
- package/core/skills/foundation/release-notes/SKILL.md +192 -192
- package/core/skills/foundation/webapp-server-runner/scripts/with_server.py +0 -0
- package/core/skills/foundation/write-product-brief/SKILL.md +160 -160
- package/core/skills/foundation/write-tests/SKILL.md +11 -10
- package/core/skills/frontend/anti-ui-slop-finish-gate/SKILL.md +5 -0
- package/core/skills/frontend/design-md-specification/SKILL.md +1 -0
- package/core/skills/frontend/design-system-engineering/SKILL.md +4 -2
- package/core/skills/meetings-analysis/analyze-business-requirements/SKILL.md +1 -1
- package/core/skills/platform/add-telemetry-instrumentation/SKILL.md +2 -1
- package/core/skills/platform/aws-infrastructure/SKILL.md +12 -11
- package/core/skills/platform/cloudflare-email-service/SKILL.md +166 -166
- package/core/skills/platform/cloudflare-email-service/references/routing.md +199 -199
- package/core/skills/platform/debug-runtime-platform/SKILL.md +1 -0
- package/core/skills/platform/debug-workers-edge/SKILL.md +111 -111
- package/core/skills/platform/sandbox-sdk/SKILL.md +183 -183
- package/core/skills/platform/setup-gpu-finops/SKILL.md +111 -107
- package/core/skills/platform/setup-llm-gateway/SKILL.md +110 -108
- package/core/skills/platform/supply-chain-security/SKILL.md +1 -0
- package/core/skills/platform/system-design/SKILL.md +7 -0
- package/core/skills/platform/turnstile-spin/SKILL.md +118 -118
- package/core/skills/platform/turnstile-spin/scripts/auth-probe.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/fetch-secret.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/persist-skill.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/validate.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/widget-create.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/worker-deploy.sh +0 -0
- package/core/skills/platform/turnstile-spin/templates/worker/src/index.ts +199 -199
- package/core/skills/platform/turnstile-spin/templates/worker/wrangler.toml +31 -31
- package/core/skills/platform/web-perf/SKILL.md +151 -151
- package/core/skills/platform/workers-best-practices/references/rules.md +463 -463
- package/core/skills/product/build-story-map/SKILL.md +104 -104
- package/core/skills/product/build-story-map/references/story-mapping-and-cpm-scheduling.md +101 -101
- package/core/skills/product/define-product-strategy/SKILL.md +105 -105
- package/core/skills/product/define-product-strategy/references/strategy-frameworks-and-pr-faq.md +142 -142
- package/core/skills/product/model-saas-metrics/SKILL.md +104 -104
- package/core/skills/product/model-saas-metrics/references/saas-unit-economics-and-pricing.md +110 -110
- package/core/skills/product/prioritize-roadmap/SKILL.md +106 -106
- package/core/skills/product/prioritize-roadmap/references/prioritization-scoring-and-kill-criteria.md +105 -105
- package/core/skills/repo-ops/commit-code/SKILL.md +190 -190
- package/core/skills/repo-ops/commit-code/references/multi-repo-and-deployment.md +21 -21
- package/core/skills/repo-ops/navigate-service/SKILL.md +199 -199
- package/core/skills/repo-ops/review-code/references/process-and-format.md +100 -100
- package/core/skills/repo-ops/review-service/SKILL.md +186 -186
- package/core/skills/repo-ops/troubleshoot-service/SKILL.md +127 -127
- package/core/skills/repo-ops/troubleshoot-service/references/failure-modes-and-security.md +22 -22
- package/core/skills/repo-ops/troubleshoot-service/references/suggested-process.md +110 -110
- package/core/skills/security-data/build-data-pipeline/SKILL.md +15 -14
- package/core/skills/security-data/build-data-pipeline/references/producer-contracts-and-lakehouse.md +5 -5
- package/core/skills/security-data/database-maintenance/SKILL.md +1 -0
- package/core/skills/security-data/database-maintenance/references/relational-and-vector-maintenance.md +5 -5
- package/core/skills/security-data/manage-secrets/SKILL.md +3 -0
- package/core/skills/security-data/optimize-olap-database/SKILL.md +14 -13
- package/core/skills/security-data/optimize-olap-database/references/olap-database-guide.md +2 -2
- package/core/skills/security-data/prompt-injection-defense/SKILL.md +3 -0
- package/core/skills/security-data/query-analytical-engine/SKILL.md +8 -7
- package/core/skills/security-data/query-analytical-engine/references/analytical-query-guide.md +3 -3
- package/core/skills/security-data/security-audit/SKILL.md +126 -119
- package/core/workflows/add-new-feature.md +212 -212
- package/core/workflows/agent-a2a-delegation.md +142 -142
- package/core/workflows/bug-fix.md +147 -147
- package/core/workflows/build-deploy.md +208 -208
- package/core/workflows/code-review.md +137 -137
- package/core/workflows/curriculum-delivery.md +1 -1
- package/core/workflows/dependency-upgrade.md +193 -193
- package/core/workflows/feature-delivery.md +149 -149
- package/core/workflows/hotfix-production.md +172 -172
- package/core/workflows/qa-validation.md +231 -231
- package/core/workflows/refactoring.md +154 -154
- package/core/workflows/revert-deployment.md +147 -147
- package/core/workflows/security-incident-response.md +191 -191
- package/core/workflows/seo-content-lifecycle.md +91 -91
- package/core/workflows/service-review-release.md +223 -223
- package/core/workflows/setup-new-service.md +214 -214
- package/core/workflows/tech-repo-review.md +245 -245
- package/core/workflows/troubleshooting.md +241 -241
- package/overlays/astro-cloudflare/README.md +93 -93
- package/overlays/data-analyst-stack/README.md +109 -109
- package/overlays/data-analyst-stack/rules/metric-dashboard-templates.md +135 -135
- package/overlays/data-analyst-stack/rules/stack-conventions.md +80 -80
- package/overlays/ecommerce-microservices/README.md +65 -65
- package/overlays/go-microservices/README.md +78 -78
- package/overlays/go-microservices/rules/go-conventions.md +223 -223
- package/overlays/laravel-filament/README.md +90 -90
- package/overlays/laravel-filament/rules/laravel-conventions.md +220 -220
- package/overlays/laravel-filament/skills/develop-laravel-feature/SKILL.md +141 -141
- package/overlays/laravel-filament/workflows/deploy-laravel.md +133 -133
- package/overlays/obj-configurator/rules/obj-project-rules.md +111 -111
- package/overlays/obj-configurator/skills/develop-obj-feature/SKILL.md +71 -71
- package/overlays/r3f-stack/README.md +89 -89
- package/overlays/r3f-stack/rules/stub.md +43 -43
- package/overlays/r3f-stack/skills/debug-3d-scene/SKILL.md +166 -166
- package/overlays/r3f-stack/skills/integrate-r3f-three-legacy/SKILL.md +159 -159
- package/overlays/r3f-stack/skills/optimize-3d-assets/SKILL.md +128 -128
- package/overlays/seo-publishing/rules/site-mix-and-cannibalization.md +52 -52
- package/overlays/ui-design-system/rules/handoff-conventions.md +73 -73
- package/package.json +2 -2
- package/core/README.md +0 -53
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
# Data Analyst Stack — DuckDB, Metabase, BI Overlay
|
|
2
|
-
|
|
3
|
-
Stack overlay for the `data-analyst` role. Extends `core/roles/data-analyst.md` with conventions for local analytics (DuckDB), dashboard requirements (Metabase), and generic BI chart specs.
|
|
4
|
-
|
|
5
|
-
## Tech Stack (2026)
|
|
6
|
-
|
|
7
|
-
| Layer | Tool | Version | Notes |
|
|
8
|
-
|-------|------|---------|-------|
|
|
9
|
-
| Explore & SQL | DuckDB | Latest | File-backed or in-memory; Iceberg REST catalog support |
|
|
10
|
-
| Transformation | dbt Core | **1.9** | Microbatch incremental strategy, dbt Fusion engine |
|
|
11
|
-
| Lakehouse format | Apache Iceberg | — | Production standard for analytics at scale |
|
|
12
|
-
| Dashboards | Metabase | 1.x | Business KPIs for non-technical stakeholders |
|
|
13
|
-
| Infrastructure | Grafana | — | Service observability, time-series (NOT business KPIs) |
|
|
14
|
-
| Presentation | Excel/CSV | — | Dated exports with Metrics sheet |
|
|
15
|
-
|
|
16
|
-
## 2026 Key Updates
|
|
17
|
-
|
|
18
|
-
### dbt Core 1.9 — Microbatch Incremental Strategy
|
|
19
|
-
```yaml
|
|
20
|
-
# dbt_project.yml — microbatch for large Iceberg tables
|
|
21
|
-
models:
|
|
22
|
-
my_model:
|
|
23
|
-
materialized: incremental
|
|
24
|
-
incremental_strategy: microbatch
|
|
25
|
-
event_time: created_at
|
|
26
|
-
batch_size: day
|
|
27
|
-
begin: '2024-01-01'
|
|
28
|
-
```
|
|
29
|
-
Microbatch runs are **parallelizable** — critical performance win for large Iceberg tables.
|
|
30
|
-
|
|
31
|
-
### Apache Iceberg + DuckDB (Production Standard)
|
|
32
|
-
```python
|
|
33
|
-
# Production requirements for Iceberg:
|
|
34
|
-
# 1. Use Iceberg REST Catalog (not path-based scanning)
|
|
35
|
-
import duckdb
|
|
36
|
-
con = duckdb.connect()
|
|
37
|
-
con.execute("INSTALL iceberg; LOAD iceberg;")
|
|
38
|
-
con.execute("""
|
|
39
|
-
CREATE SECRET iceberg_catalog (
|
|
40
|
-
TYPE S3,
|
|
41
|
-
REGION 'us-east-1',
|
|
42
|
-
KEY_ID '...',
|
|
43
|
-
SECRET '...'
|
|
44
|
-
)
|
|
45
|
-
""")
|
|
46
|
-
# 2. Implement compaction + snapshot expiration + orphan file removal
|
|
47
|
-
# 3. Medallion architecture: Staging → Intermediate → Marts
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Metabase vs Grafana (Clear Separation)
|
|
51
|
-
| Tool | Use For |
|
|
52
|
-
|------|---------|
|
|
53
|
-
| **Metabase 1.x** | Business KPIs, non-technical users, SQL-based analytics |
|
|
54
|
-
| **Grafana** | Infrastructure metrics, time-series, Loki logs, operational observability |
|
|
55
|
-
|
|
56
|
-
Do NOT use Grafana for business dashboards — escalate to Metabase spec.
|
|
57
|
-
|
|
58
|
-
## Base Role & Scope
|
|
59
|
-
|
|
60
|
-
- **Base role:** `core/roles/data-analyst.md`
|
|
61
|
-
- **Primary skill:** `analyze-data`
|
|
62
|
-
- **Default compute:** DuckDB (file-backed or Iceberg-backed)
|
|
63
|
-
- **Dashboard handoff:** Metabase question/card requirements (spec only)
|
|
64
|
-
- **Stakeholder exports:** Excel/CSV with dated filenames
|
|
65
|
-
|
|
66
|
-
## Included
|
|
67
|
-
|
|
68
|
-
- `rules/stack-conventions.md` — Paths, env vars, SQL layout, export naming, PII
|
|
69
|
-
- `rules/metric-dashboard-templates.md` — Metric tables, Metabase spec template, JSON mapping
|
|
70
|
-
|
|
71
|
-
## Activation
|
|
72
|
-
|
|
73
|
-
```
|
|
74
|
-
Role: data-analyst
|
|
75
|
-
Overlay: overlays/data-analyst-stack
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## Environment Variables
|
|
79
|
-
|
|
80
|
-
| Variable | Purpose | Example |
|
|
81
|
-
|----------|---------|---------|
|
|
82
|
-
| `ANALYTICS_DATA_ROOT` | Root for inputs (CSV, Parquet) | `./data/analytics` |
|
|
83
|
-
| `DUCKDB_PATH` | File-backed DuckDB database | `./data/analytics/warehouse.duckdb` |
|
|
84
|
-
| `METABASE_INSTANCE_URL` | Base URL for linking specs (read-only) | `http://localhost:3000` |
|
|
85
|
-
| `DBT_PROFILES_DIR` | dbt profiles directory | `~/.dbt` |
|
|
86
|
-
|
|
87
|
-
Default: `ANALYTICS_DATA_ROOT=./data/analytics` relative to active repo.
|
|
88
|
-
|
|
89
|
-
## Standard 2026 Alignment
|
|
90
|
-
|
|
91
|
-
This file is part of the agent-skills engineering pack. The 2026 upgrade
|
|
92
|
-
pass added this footer so every prose file in the pack carries a
|
|
93
|
-
consistent Standard 2026 pointer.
|
|
94
|
-
|
|
95
|
-
- **OWASP ASI**: applied as described in `core/roles/role-standard.md`
|
|
96
|
-
(ASI01-ASI10) and the per-skill `## Security Guardrails (OWASP ASI)` sections.
|
|
97
|
-
- **Failure Modes**: the rule in this file can be violated by drift, missing
|
|
98
|
-
context, or untracked exceptions. Concrete failure scenarios belong in the
|
|
99
|
-
related skill or workflow's `### Failure Modes` section.
|
|
100
|
-
- **Output Contracts**: structured artifacts produced under this file must
|
|
101
|
-
conform to schemas in `core/contracts/schemas/`.
|
|
102
|
-
- **Skill Toolbox Lock**: this file's rules are enforced by the role that
|
|
103
|
-
owns the affected action; the runtime gate is
|
|
104
|
-
`core/scripts/hooks/check-policy.py`.
|
|
105
|
-
- **Commit / publish gate**: changes that affect user-visible behavior
|
|
106
|
-
follow the META-RULE in `core/rules/code.md` — no commit, no push, no
|
|
107
|
-
publish without explicit user confirmation.
|
|
108
|
-
|
|
109
|
-
Last updated: 2026-09-01
|
|
1
|
+
# Data Analyst Stack — DuckDB, Metabase, BI Overlay
|
|
2
|
+
|
|
3
|
+
Stack overlay for the `data-analyst` role. Extends `core/roles/data-analyst.md` with conventions for local analytics (DuckDB), dashboard requirements (Metabase), and generic BI chart specs.
|
|
4
|
+
|
|
5
|
+
## Tech Stack (2026)
|
|
6
|
+
|
|
7
|
+
| Layer | Tool | Version | Notes |
|
|
8
|
+
|-------|------|---------|-------|
|
|
9
|
+
| Explore & SQL | DuckDB | Latest | File-backed or in-memory; Iceberg REST catalog support |
|
|
10
|
+
| Transformation | dbt Core | **1.9** | Microbatch incremental strategy, dbt Fusion engine |
|
|
11
|
+
| Lakehouse format | Apache Iceberg | — | Production standard for analytics at scale |
|
|
12
|
+
| Dashboards | Metabase | 1.x | Business KPIs for non-technical stakeholders |
|
|
13
|
+
| Infrastructure | Grafana | — | Service observability, time-series (NOT business KPIs) |
|
|
14
|
+
| Presentation | Excel/CSV | — | Dated exports with Metrics sheet |
|
|
15
|
+
|
|
16
|
+
## 2026 Key Updates
|
|
17
|
+
|
|
18
|
+
### dbt Core 1.9 — Microbatch Incremental Strategy
|
|
19
|
+
```yaml
|
|
20
|
+
# dbt_project.yml — microbatch for large Iceberg tables
|
|
21
|
+
models:
|
|
22
|
+
my_model:
|
|
23
|
+
materialized: incremental
|
|
24
|
+
incremental_strategy: microbatch
|
|
25
|
+
event_time: created_at
|
|
26
|
+
batch_size: day
|
|
27
|
+
begin: '2024-01-01'
|
|
28
|
+
```
|
|
29
|
+
Microbatch runs are **parallelizable** — critical performance win for large Iceberg tables.
|
|
30
|
+
|
|
31
|
+
### Apache Iceberg + DuckDB (Production Standard)
|
|
32
|
+
```python
|
|
33
|
+
# Production requirements for Iceberg:
|
|
34
|
+
# 1. Use Iceberg REST Catalog (not path-based scanning)
|
|
35
|
+
import duckdb
|
|
36
|
+
con = duckdb.connect()
|
|
37
|
+
con.execute("INSTALL iceberg; LOAD iceberg;")
|
|
38
|
+
con.execute("""
|
|
39
|
+
CREATE SECRET iceberg_catalog (
|
|
40
|
+
TYPE S3,
|
|
41
|
+
REGION 'us-east-1',
|
|
42
|
+
KEY_ID '...',
|
|
43
|
+
SECRET '...'
|
|
44
|
+
)
|
|
45
|
+
""")
|
|
46
|
+
# 2. Implement compaction + snapshot expiration + orphan file removal
|
|
47
|
+
# 3. Medallion architecture: Staging → Intermediate → Marts
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Metabase vs Grafana (Clear Separation)
|
|
51
|
+
| Tool | Use For |
|
|
52
|
+
|------|---------|
|
|
53
|
+
| **Metabase 1.x** | Business KPIs, non-technical users, SQL-based analytics |
|
|
54
|
+
| **Grafana** | Infrastructure metrics, time-series, Loki logs, operational observability |
|
|
55
|
+
|
|
56
|
+
Do NOT use Grafana for business dashboards — escalate to Metabase spec.
|
|
57
|
+
|
|
58
|
+
## Base Role & Scope
|
|
59
|
+
|
|
60
|
+
- **Base role:** `core/roles/data-analyst.md`
|
|
61
|
+
- **Primary skill:** `analyze-data`
|
|
62
|
+
- **Default compute:** DuckDB (file-backed or Iceberg-backed)
|
|
63
|
+
- **Dashboard handoff:** Metabase question/card requirements (spec only)
|
|
64
|
+
- **Stakeholder exports:** Excel/CSV with dated filenames
|
|
65
|
+
|
|
66
|
+
## Included
|
|
67
|
+
|
|
68
|
+
- `rules/stack-conventions.md` — Paths, env vars, SQL layout, export naming, PII
|
|
69
|
+
- `rules/metric-dashboard-templates.md` — Metric tables, Metabase spec template, JSON mapping
|
|
70
|
+
|
|
71
|
+
## Activation
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
Role: data-analyst
|
|
75
|
+
Overlay: overlays/data-analyst-stack
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Environment Variables
|
|
79
|
+
|
|
80
|
+
| Variable | Purpose | Example |
|
|
81
|
+
|----------|---------|---------|
|
|
82
|
+
| `ANALYTICS_DATA_ROOT` | Root for inputs (CSV, Parquet) | `./data/analytics` |
|
|
83
|
+
| `DUCKDB_PATH` | File-backed DuckDB database | `./data/analytics/warehouse.duckdb` |
|
|
84
|
+
| `METABASE_INSTANCE_URL` | Base URL for linking specs (read-only) | `http://localhost:3000` |
|
|
85
|
+
| `DBT_PROFILES_DIR` | dbt profiles directory | `~/.dbt` |
|
|
86
|
+
|
|
87
|
+
Default: `ANALYTICS_DATA_ROOT=./data/analytics` relative to active repo.
|
|
88
|
+
|
|
89
|
+
## Standard 2026 Alignment
|
|
90
|
+
|
|
91
|
+
This file is part of the agent-skills engineering pack. The 2026 upgrade
|
|
92
|
+
pass added this footer so every prose file in the pack carries a
|
|
93
|
+
consistent Standard 2026 pointer.
|
|
94
|
+
|
|
95
|
+
- **OWASP ASI**: applied as described in `core/roles/role-standard.md`
|
|
96
|
+
(ASI01-ASI10) and the per-skill `## Security Guardrails (OWASP ASI)` sections.
|
|
97
|
+
- **Failure Modes**: the rule in this file can be violated by drift, missing
|
|
98
|
+
context, or untracked exceptions. Concrete failure scenarios belong in the
|
|
99
|
+
related skill or workflow's `### Failure Modes` section.
|
|
100
|
+
- **Output Contracts**: structured artifacts produced under this file must
|
|
101
|
+
conform to schemas in `core/contracts/schemas/`.
|
|
102
|
+
- **Skill Toolbox Lock**: this file's rules are enforced by the role that
|
|
103
|
+
owns the affected action; the runtime gate is
|
|
104
|
+
`core/scripts/hooks/check-policy.py`.
|
|
105
|
+
- **Commit / publish gate**: changes that affect user-visible behavior
|
|
106
|
+
follow the META-RULE in `core/rules/code.md` — no commit, no push, no
|
|
107
|
+
publish without explicit user confirmation.
|
|
108
|
+
|
|
109
|
+
Last updated: 2026-09-01
|
|
@@ -1,135 +1,135 @@
|
|
|
1
|
-
# Metric And Dashboard Templates — Data Analyst Stack
|
|
2
|
-
|
|
3
|
-
Copy-ready templates for metrics, Metabase handoff, and mapping to `data-analysis-report.json`.
|
|
4
|
-
|
|
5
|
-
## Metric Definition Table
|
|
6
|
-
|
|
7
|
-
Use in every analysis brief and Excel **Metrics** sheet:
|
|
8
|
-
|
|
9
|
-
| Metric | Definition | Numerator / Denominator | Filters | Grain | Time zone | Notes |
|
|
10
|
-
| ------ | ---------- | ----------------------- | ------- | ----- | --------- | ----- |
|
|
11
|
-
| Example: WAU | Distinct users with ≥1 qualifying event in ISO week | COUNT(DISTINCT user_id) / none | exclude test accounts | user_id, week_start | UTC+7 | Align with product analytics doc v2 |
|
|
12
|
-
|
|
13
|
-
## Metabase Question Spec Template
|
|
14
|
-
|
|
15
|
-
Save as `specs/metabase/<slug>.md`:
|
|
16
|
-
|
|
17
|
-
```markdown
|
|
18
|
-
# Metabase — <Title>
|
|
19
|
-
|
|
20
|
-
## Purpose
|
|
21
|
-
- Business question:
|
|
22
|
-
- Audience:
|
|
23
|
-
- Refresh: (e.g. daily 06:00 UTC+7)
|
|
24
|
-
|
|
25
|
-
## Data Source
|
|
26
|
-
- Database / schema:
|
|
27
|
-
- Table or view:
|
|
28
|
-
- Grain:
|
|
29
|
-
- Known limitations:
|
|
30
|
-
|
|
31
|
-
## Question Type
|
|
32
|
-
- (simple / native SQL / model)
|
|
33
|
-
|
|
34
|
-
## Dimensions
|
|
35
|
-
| Field | Type | Description |
|
|
36
|
-
| ----- | ---- | ----------- |
|
|
37
|
-
|
|
38
|
-
## Measures
|
|
39
|
-
| Measure | Aggregation | Definition |
|
|
40
|
-
| ------- | ----------- | ---------- |
|
|
41
|
-
|
|
42
|
-
## Filters (default)
|
|
43
|
-
- ...
|
|
44
|
-
|
|
45
|
-
## Segments
|
|
46
|
-
- ...
|
|
47
|
-
|
|
48
|
-
## Visualization
|
|
49
|
-
- Chart type:
|
|
50
|
-
- Sort / limit:
|
|
51
|
-
- Comparison period (if any):
|
|
52
|
-
|
|
53
|
-
## Acceptance
|
|
54
|
-
- [ ] Spot-check total matches DuckDB export for same filters
|
|
55
|
-
- [ ] PII columns hidden or aggregated
|
|
56
|
-
- [ ] Definition matches official metric catalog / BA ticket
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Generic BI Chart Spec (non-Metabase)
|
|
60
|
-
|
|
61
|
-
```markdown
|
|
62
|
-
# BI Chart — <Title>
|
|
63
|
-
|
|
64
|
-
- Chart type:
|
|
65
|
-
- X-axis / dimension:
|
|
66
|
-
- Y-axis / measure(s):
|
|
67
|
-
- Filters:
|
|
68
|
-
- Drill-down:
|
|
69
|
-
- Export schedule:
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Mapping To `data-analysis-report.json`
|
|
73
|
-
|
|
74
|
-
| Report section | JSON field |
|
|
75
|
-
| -------------- | ---------- |
|
|
76
|
-
| Business question | `business_question` |
|
|
77
|
-
| Metric table rows | `metrics[]` (`name`, `definition`, `value`, `grain`, `time_range`) |
|
|
78
|
-
| Source inventory | `sources[]` |
|
|
79
|
-
| Verified numbers / tables | `findings[]` |
|
|
80
|
-
| Narrative / options | `interpretation[]` |
|
|
81
|
-
| Profiling issues | `data_quality_issues[]` |
|
|
82
|
-
| Next steps | `recommendations[]` |
|
|
83
|
-
| High / Medium / Low | `confidence` |
|
|
84
|
-
| `exports/...`, `queries/...`, `specs/...` | `artifacts[]` |
|
|
85
|
-
|
|
86
|
-
## BA → Analyst Handoff Block
|
|
87
|
-
|
|
88
|
-
When Business Analyst delegates analysis, the brief SHOULD include:
|
|
89
|
-
|
|
90
|
-
```markdown
|
|
91
|
-
## Analytics Request (for Data Analyst)
|
|
92
|
-
- Decision supported:
|
|
93
|
-
- Questions (numbered):
|
|
94
|
-
- Proposed metrics (names only if undefined):
|
|
95
|
-
- Segments / actors:
|
|
96
|
-
- Time range and timezone:
|
|
97
|
-
- Sources known (paths, tables, exports):
|
|
98
|
-
- Constraints (PII, read-only, deadline):
|
|
99
|
-
- Out of scope for this analysis:
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
Analyst returns `data-analysis-report.json` plus optional Metabase spec and dated export.
|
|
103
|
-
|
|
104
|
-
## Standard 2026 Alignment
|
|
105
|
-
|
|
106
|
-
This overlay rule file is part of the agent-skills engineering pack. The 2026
|
|
107
|
-
upgrade pass added the following Standard 2026 alignment footer to every
|
|
108
|
-
overlay rule file in the pack.
|
|
109
|
-
|
|
110
|
-
- **OWASP ASI**: applied as described in the core pack — see
|
|
111
|
-
`core/roles/role-standard.md` (ASI01-ASI10) and the per-skill
|
|
112
|
-
`## Security Guardrails (OWASP ASI)` section in each skill. The rules in this
|
|
113
|
-
file are applied by the role that owns the affected action; the runtime
|
|
114
|
-
gate is `core/scripts/hooks/check-policy.py` with
|
|
115
|
-
`core/policies/action-boundaries.yaml`.
|
|
116
|
-
- **Failure Modes** (overlay-specific): the rules in this file can be violated
|
|
117
|
-
by drift, missing context, or untracked exceptions. The owning role is
|
|
118
|
-
expected to surface concrete failure scenarios in the workflow's
|
|
119
|
-
`### Failure Modes` section and to capture remediations via
|
|
120
|
-
`contracts/schemas/incident-report.json` when the rule is bypassed.
|
|
121
|
-
- **Output Contracts**: when a rule in this file produces a structured
|
|
122
|
-
artifact (brief, plan, config, content handoff, audit event), the artifact
|
|
123
|
-
must conform to the corresponding schema in `core/contracts/schemas/`.
|
|
124
|
-
See `See `core/skills/foundation/analyze-data/SKILL.md` and the `data-analysis-report.json` schema.` for the related skill output contract reference.
|
|
125
|
-
- **Skill Toolbox Lock**: a rule in this file is enforced by the role whose
|
|
126
|
-
Skill Toolbox lists the related skill as Primary. Roles that hold the
|
|
127
|
-
skill as Supporting must delegate rather than execute directly (per
|
|
128
|
-
`core/workflows/README.md`).
|
|
129
|
-
- **Commit / publish gate**: rule changes that affect user-visible behavior
|
|
130
|
-
must follow the META-RULE in `core/rules/code.md` — no commit, no push,
|
|
131
|
-
no publish without explicit user confirmation.
|
|
132
|
-
|
|
133
|
-
See `core/skills/foundation/analyze-data/SKILL.md` and the `data-analysis-report.json` schema.
|
|
134
|
-
|
|
135
|
-
Last updated: 2026-09-01
|
|
1
|
+
# Metric And Dashboard Templates — Data Analyst Stack
|
|
2
|
+
|
|
3
|
+
Copy-ready templates for metrics, Metabase handoff, and mapping to `data-analysis-report.json`.
|
|
4
|
+
|
|
5
|
+
## Metric Definition Table
|
|
6
|
+
|
|
7
|
+
Use in every analysis brief and Excel **Metrics** sheet:
|
|
8
|
+
|
|
9
|
+
| Metric | Definition | Numerator / Denominator | Filters | Grain | Time zone | Notes |
|
|
10
|
+
| ------ | ---------- | ----------------------- | ------- | ----- | --------- | ----- |
|
|
11
|
+
| Example: WAU | Distinct users with ≥1 qualifying event in ISO week | COUNT(DISTINCT user_id) / none | exclude test accounts | user_id, week_start | UTC+7 | Align with product analytics doc v2 |
|
|
12
|
+
|
|
13
|
+
## Metabase Question Spec Template
|
|
14
|
+
|
|
15
|
+
Save as `specs/metabase/<slug>.md`:
|
|
16
|
+
|
|
17
|
+
```markdown
|
|
18
|
+
# Metabase — <Title>
|
|
19
|
+
|
|
20
|
+
## Purpose
|
|
21
|
+
- Business question:
|
|
22
|
+
- Audience:
|
|
23
|
+
- Refresh: (e.g. daily 06:00 UTC+7)
|
|
24
|
+
|
|
25
|
+
## Data Source
|
|
26
|
+
- Database / schema:
|
|
27
|
+
- Table or view:
|
|
28
|
+
- Grain:
|
|
29
|
+
- Known limitations:
|
|
30
|
+
|
|
31
|
+
## Question Type
|
|
32
|
+
- (simple / native SQL / model)
|
|
33
|
+
|
|
34
|
+
## Dimensions
|
|
35
|
+
| Field | Type | Description |
|
|
36
|
+
| ----- | ---- | ----------- |
|
|
37
|
+
|
|
38
|
+
## Measures
|
|
39
|
+
| Measure | Aggregation | Definition |
|
|
40
|
+
| ------- | ----------- | ---------- |
|
|
41
|
+
|
|
42
|
+
## Filters (default)
|
|
43
|
+
- ...
|
|
44
|
+
|
|
45
|
+
## Segments
|
|
46
|
+
- ...
|
|
47
|
+
|
|
48
|
+
## Visualization
|
|
49
|
+
- Chart type:
|
|
50
|
+
- Sort / limit:
|
|
51
|
+
- Comparison period (if any):
|
|
52
|
+
|
|
53
|
+
## Acceptance
|
|
54
|
+
- [ ] Spot-check total matches DuckDB export for same filters
|
|
55
|
+
- [ ] PII columns hidden or aggregated
|
|
56
|
+
- [ ] Definition matches official metric catalog / BA ticket
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Generic BI Chart Spec (non-Metabase)
|
|
60
|
+
|
|
61
|
+
```markdown
|
|
62
|
+
# BI Chart — <Title>
|
|
63
|
+
|
|
64
|
+
- Chart type:
|
|
65
|
+
- X-axis / dimension:
|
|
66
|
+
- Y-axis / measure(s):
|
|
67
|
+
- Filters:
|
|
68
|
+
- Drill-down:
|
|
69
|
+
- Export schedule:
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Mapping To `data-analysis-report.json`
|
|
73
|
+
|
|
74
|
+
| Report section | JSON field |
|
|
75
|
+
| -------------- | ---------- |
|
|
76
|
+
| Business question | `business_question` |
|
|
77
|
+
| Metric table rows | `metrics[]` (`name`, `definition`, `value`, `grain`, `time_range`) |
|
|
78
|
+
| Source inventory | `sources[]` |
|
|
79
|
+
| Verified numbers / tables | `findings[]` |
|
|
80
|
+
| Narrative / options | `interpretation[]` |
|
|
81
|
+
| Profiling issues | `data_quality_issues[]` |
|
|
82
|
+
| Next steps | `recommendations[]` |
|
|
83
|
+
| High / Medium / Low | `confidence` |
|
|
84
|
+
| `exports/...`, `queries/...`, `specs/...` | `artifacts[]` |
|
|
85
|
+
|
|
86
|
+
## BA → Analyst Handoff Block
|
|
87
|
+
|
|
88
|
+
When Business Analyst delegates analysis, the brief SHOULD include:
|
|
89
|
+
|
|
90
|
+
```markdown
|
|
91
|
+
## Analytics Request (for Data Analyst)
|
|
92
|
+
- Decision supported:
|
|
93
|
+
- Questions (numbered):
|
|
94
|
+
- Proposed metrics (names only if undefined):
|
|
95
|
+
- Segments / actors:
|
|
96
|
+
- Time range and timezone:
|
|
97
|
+
- Sources known (paths, tables, exports):
|
|
98
|
+
- Constraints (PII, read-only, deadline):
|
|
99
|
+
- Out of scope for this analysis:
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Analyst returns `data-analysis-report.json` plus optional Metabase spec and dated export.
|
|
103
|
+
|
|
104
|
+
## Standard 2026 Alignment
|
|
105
|
+
|
|
106
|
+
This overlay rule file is part of the agent-skills engineering pack. The 2026
|
|
107
|
+
upgrade pass added the following Standard 2026 alignment footer to every
|
|
108
|
+
overlay rule file in the pack.
|
|
109
|
+
|
|
110
|
+
- **OWASP ASI**: applied as described in the core pack — see
|
|
111
|
+
`core/roles/role-standard.md` (ASI01-ASI10) and the per-skill
|
|
112
|
+
`## Security Guardrails (OWASP ASI)` section in each skill. The rules in this
|
|
113
|
+
file are applied by the role that owns the affected action; the runtime
|
|
114
|
+
gate is `core/scripts/hooks/check-policy.py` with
|
|
115
|
+
`core/policies/action-boundaries.yaml`.
|
|
116
|
+
- **Failure Modes** (overlay-specific): the rules in this file can be violated
|
|
117
|
+
by drift, missing context, or untracked exceptions. The owning role is
|
|
118
|
+
expected to surface concrete failure scenarios in the workflow's
|
|
119
|
+
`### Failure Modes` section and to capture remediations via
|
|
120
|
+
`contracts/schemas/incident-report.json` when the rule is bypassed.
|
|
121
|
+
- **Output Contracts**: when a rule in this file produces a structured
|
|
122
|
+
artifact (brief, plan, config, content handoff, audit event), the artifact
|
|
123
|
+
must conform to the corresponding schema in `core/contracts/schemas/`.
|
|
124
|
+
See `See `core/skills/foundation/analyze-data/SKILL.md` and the `data-analysis-report.json` schema.` for the related skill output contract reference.
|
|
125
|
+
- **Skill Toolbox Lock**: a rule in this file is enforced by the role whose
|
|
126
|
+
Skill Toolbox lists the related skill as Primary. Roles that hold the
|
|
127
|
+
skill as Supporting must delegate rather than execute directly (per
|
|
128
|
+
`core/workflows/README.md`).
|
|
129
|
+
- **Commit / publish gate**: rule changes that affect user-visible behavior
|
|
130
|
+
must follow the META-RULE in `core/rules/code.md` — no commit, no push,
|
|
131
|
+
no publish without explicit user confirmation.
|
|
132
|
+
|
|
133
|
+
See `core/skills/foundation/analyze-data/SKILL.md` and the `data-analysis-report.json` schema.
|
|
134
|
+
|
|
135
|
+
Last updated: 2026-09-01
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
# Stack Conventions — Data Analyst (DuckDB, Metabase, BI)
|
|
2
|
-
|
|
3
|
-
Strict toolchain rules for the `data-analyst` role operating with DuckDB, Metabase, and Spreadsheet BI exports.
|
|
4
|
-
|
|
5
|
-
## 1. Data Layout & Workspace Hygiene
|
|
6
|
-
|
|
7
|
-
To keep the analytics environment uncluttered, all analysis must occur strictly within the `ANALYTICS_DATA_ROOT` (default `./data/analytics`).
|
|
8
|
-
|
|
9
|
-
```text
|
|
10
|
-
analytics/
|
|
11
|
-
raw/ # Immutable raw drops (gitignored)
|
|
12
|
-
staging/ # Cleaned intermediate files
|
|
13
|
-
warehouse.duckdb # Local DuckDB instance
|
|
14
|
-
queries/ # Saved SQL scripts (.sql)
|
|
15
|
-
exports/ # Finalized Excel/CSV outputs (gitignored if sensitive)
|
|
16
|
-
specs/ # Metabase requirement docs (markdown/JSON)
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
- **Saved SQL Rules:** All analytical queries must be saved as `.sql` files inside `queries/`. Do not run ephemeral queries without saving logic.
|
|
20
|
-
- **SQL Headers:** Every `.sql` file MUST begin with a header specifying: `purpose`, `grain`, and `as_of` date.
|
|
21
|
-
- **Data Privacy:** Absolutely NO Personally Identifiable Information (PII) is allowed to be committed to version control. PII must be aggregated, masked, or kept locally in gitignored folders.
|
|
22
|
-
|
|
23
|
-
## 2. DuckDB Execution Rules
|
|
24
|
-
|
|
25
|
-
- **Connections:** Open connections using an explicit file path (`DUCKDB_PATH`), or strictly in-memory for ephemeral probes.
|
|
26
|
-
- **Tracing:** Always log row counts after any materializing steps (`CREATE TABLE AS`, `INSERT`, major `WHERE`).
|
|
27
|
-
- **Boundaries:** Analysts read from paths engineered by the `data-engineer`. Analysts DO NOT invent production ingest pipelines.
|
|
28
|
-
|
|
29
|
-
## 3. Metabase Handoff Boundaries
|
|
30
|
-
|
|
31
|
-
- **No Admin Assumptions:** The Data Analyst does NOT create dashboards directly in the production Metabase instance unless explicitly granted admin access.
|
|
32
|
-
- **Specification Delivery:** The analyst delivers dashboard requirements purely as **Specs** (Markdown or JSON) stored in `specs/metabase/`.
|
|
33
|
-
- **Spec Requirements:** Every spec MUST strictly define: the source table/view, the exact `dimensions`, `measures`, default `filters`, `segment` logic, and `refresh` intervals.
|
|
34
|
-
|
|
35
|
-
## 4. Excel / BI Export Standards
|
|
36
|
-
|
|
37
|
-
- **Output Path:** All exports must be saved to `exports/` with the filename pattern: `YYYY-MM-DD_<slug>.xlsx` (or `.csv`).
|
|
38
|
-
- **Mandatory "Metrics" Sheet:** Every Excel export MUST include a dedicated "Metrics" sheet that clearly documents the definitions of the numbers presented.
|
|
39
|
-
- **Structure:** Separate **Facts** (computed data tables) from **Notes** (analyst interpretation/insights) on distinct sheets or distinct visual sections.
|
|
40
|
-
- **Anonymization:** Mask or aggregate all PII columns before export unless the user explicitly confirms clearance.
|
|
41
|
-
|
|
42
|
-
## 5. Escalation To Data Engineer
|
|
43
|
-
|
|
44
|
-
Escalate to a Data Engineer if:
|
|
45
|
-
- New recurring ingest pipelines (Airflow, dbt) are needed.
|
|
46
|
-
- DuckDB hits processing limits and needs replacement with a dedicated Cloud Data Warehouse.
|
|
47
|
-
- Source data is missing, corrupt, or stale.
|
|
48
|
-
|
|
49
|
-
## Standard 2026 Alignment
|
|
50
|
-
|
|
51
|
-
This overlay rule file is part of the agent-skills engineering pack. The 2026
|
|
52
|
-
upgrade pass added the following Standard 2026 alignment footer to every
|
|
53
|
-
overlay rule file in the pack.
|
|
54
|
-
|
|
55
|
-
- **OWASP ASI**: applied as described in the core pack — see
|
|
56
|
-
`core/roles/role-standard.md` (ASI01-ASI10) and the per-skill
|
|
57
|
-
`## Security Guardrails (OWASP ASI)` section in each skill. The rules in this
|
|
58
|
-
file are applied by the role that owns the affected action; the runtime
|
|
59
|
-
gate is `core/scripts/hooks/check-policy.py` with
|
|
60
|
-
`core/policies/action-boundaries.yaml`.
|
|
61
|
-
- **Failure Modes** (overlay-specific): the rules in this file can be violated
|
|
62
|
-
by drift, missing context, or untracked exceptions. The owning role is
|
|
63
|
-
expected to surface concrete failure scenarios in the workflow's
|
|
64
|
-
`### Failure Modes` section and to capture remediations via
|
|
65
|
-
`contracts/schemas/incident-report.json` when the rule is bypassed.
|
|
66
|
-
- **Output Contracts**: when a rule in this file produces a structured
|
|
67
|
-
artifact (brief, plan, config, content handoff, audit event), the artifact
|
|
68
|
-
must conform to the corresponding schema in `core/contracts/schemas/`.
|
|
69
|
-
See `See `core/skills/foundation/analyze-data/SKILL.md` and the `data-analysis-report.json` schema.` for the related skill output contract reference.
|
|
70
|
-
- **Skill Toolbox Lock**: a rule in this file is enforced by the role whose
|
|
71
|
-
Skill Toolbox lists the related skill as Primary. Roles that hold the
|
|
72
|
-
skill as Supporting must delegate rather than execute directly (per
|
|
73
|
-
`core/workflows/README.md`).
|
|
74
|
-
- **Commit / publish gate**: rule changes that affect user-visible behavior
|
|
75
|
-
must follow the META-RULE in `core/rules/code.md` — no commit, no push,
|
|
76
|
-
no publish without explicit user confirmation.
|
|
77
|
-
|
|
78
|
-
See `core/skills/foundation/analyze-data/SKILL.md` and the `data-analysis-report.json` schema.
|
|
79
|
-
|
|
80
|
-
Last updated: 2026-09-01
|
|
1
|
+
# Stack Conventions — Data Analyst (DuckDB, Metabase, BI)
|
|
2
|
+
|
|
3
|
+
Strict toolchain rules for the `data-analyst` role operating with DuckDB, Metabase, and Spreadsheet BI exports.
|
|
4
|
+
|
|
5
|
+
## 1. Data Layout & Workspace Hygiene
|
|
6
|
+
|
|
7
|
+
To keep the analytics environment uncluttered, all analysis must occur strictly within the `ANALYTICS_DATA_ROOT` (default `./data/analytics`).
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
analytics/
|
|
11
|
+
raw/ # Immutable raw drops (gitignored)
|
|
12
|
+
staging/ # Cleaned intermediate files
|
|
13
|
+
warehouse.duckdb # Local DuckDB instance
|
|
14
|
+
queries/ # Saved SQL scripts (.sql)
|
|
15
|
+
exports/ # Finalized Excel/CSV outputs (gitignored if sensitive)
|
|
16
|
+
specs/ # Metabase requirement docs (markdown/JSON)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- **Saved SQL Rules:** All analytical queries must be saved as `.sql` files inside `queries/`. Do not run ephemeral queries without saving logic.
|
|
20
|
+
- **SQL Headers:** Every `.sql` file MUST begin with a header specifying: `purpose`, `grain`, and `as_of` date.
|
|
21
|
+
- **Data Privacy:** Absolutely NO Personally Identifiable Information (PII) is allowed to be committed to version control. PII must be aggregated, masked, or kept locally in gitignored folders.
|
|
22
|
+
|
|
23
|
+
## 2. DuckDB Execution Rules
|
|
24
|
+
|
|
25
|
+
- **Connections:** Open connections using an explicit file path (`DUCKDB_PATH`), or strictly in-memory for ephemeral probes.
|
|
26
|
+
- **Tracing:** Always log row counts after any materializing steps (`CREATE TABLE AS`, `INSERT`, major `WHERE`).
|
|
27
|
+
- **Boundaries:** Analysts read from paths engineered by the `data-engineer`. Analysts DO NOT invent production ingest pipelines.
|
|
28
|
+
|
|
29
|
+
## 3. Metabase Handoff Boundaries
|
|
30
|
+
|
|
31
|
+
- **No Admin Assumptions:** The Data Analyst does NOT create dashboards directly in the production Metabase instance unless explicitly granted admin access.
|
|
32
|
+
- **Specification Delivery:** The analyst delivers dashboard requirements purely as **Specs** (Markdown or JSON) stored in `specs/metabase/`.
|
|
33
|
+
- **Spec Requirements:** Every spec MUST strictly define: the source table/view, the exact `dimensions`, `measures`, default `filters`, `segment` logic, and `refresh` intervals.
|
|
34
|
+
|
|
35
|
+
## 4. Excel / BI Export Standards
|
|
36
|
+
|
|
37
|
+
- **Output Path:** All exports must be saved to `exports/` with the filename pattern: `YYYY-MM-DD_<slug>.xlsx` (or `.csv`).
|
|
38
|
+
- **Mandatory "Metrics" Sheet:** Every Excel export MUST include a dedicated "Metrics" sheet that clearly documents the definitions of the numbers presented.
|
|
39
|
+
- **Structure:** Separate **Facts** (computed data tables) from **Notes** (analyst interpretation/insights) on distinct sheets or distinct visual sections.
|
|
40
|
+
- **Anonymization:** Mask or aggregate all PII columns before export unless the user explicitly confirms clearance.
|
|
41
|
+
|
|
42
|
+
## 5. Escalation To Data Engineer
|
|
43
|
+
|
|
44
|
+
Escalate to a Data Engineer if:
|
|
45
|
+
- New recurring ingest pipelines (Airflow, dbt) are needed.
|
|
46
|
+
- DuckDB hits processing limits and needs replacement with a dedicated Cloud Data Warehouse.
|
|
47
|
+
- Source data is missing, corrupt, or stale.
|
|
48
|
+
|
|
49
|
+
## Standard 2026 Alignment
|
|
50
|
+
|
|
51
|
+
This overlay rule file is part of the agent-skills engineering pack. The 2026
|
|
52
|
+
upgrade pass added the following Standard 2026 alignment footer to every
|
|
53
|
+
overlay rule file in the pack.
|
|
54
|
+
|
|
55
|
+
- **OWASP ASI**: applied as described in the core pack — see
|
|
56
|
+
`core/roles/role-standard.md` (ASI01-ASI10) and the per-skill
|
|
57
|
+
`## Security Guardrails (OWASP ASI)` section in each skill. The rules in this
|
|
58
|
+
file are applied by the role that owns the affected action; the runtime
|
|
59
|
+
gate is `core/scripts/hooks/check-policy.py` with
|
|
60
|
+
`core/policies/action-boundaries.yaml`.
|
|
61
|
+
- **Failure Modes** (overlay-specific): the rules in this file can be violated
|
|
62
|
+
by drift, missing context, or untracked exceptions. The owning role is
|
|
63
|
+
expected to surface concrete failure scenarios in the workflow's
|
|
64
|
+
`### Failure Modes` section and to capture remediations via
|
|
65
|
+
`contracts/schemas/incident-report.json` when the rule is bypassed.
|
|
66
|
+
- **Output Contracts**: when a rule in this file produces a structured
|
|
67
|
+
artifact (brief, plan, config, content handoff, audit event), the artifact
|
|
68
|
+
must conform to the corresponding schema in `core/contracts/schemas/`.
|
|
69
|
+
See `See `core/skills/foundation/analyze-data/SKILL.md` and the `data-analysis-report.json` schema.` for the related skill output contract reference.
|
|
70
|
+
- **Skill Toolbox Lock**: a rule in this file is enforced by the role whose
|
|
71
|
+
Skill Toolbox lists the related skill as Primary. Roles that hold the
|
|
72
|
+
skill as Supporting must delegate rather than execute directly (per
|
|
73
|
+
`core/workflows/README.md`).
|
|
74
|
+
- **Commit / publish gate**: rule changes that affect user-visible behavior
|
|
75
|
+
must follow the META-RULE in `core/rules/code.md` — no commit, no push,
|
|
76
|
+
no publish without explicit user confirmation.
|
|
77
|
+
|
|
78
|
+
See `core/skills/foundation/analyze-data/SKILL.md` and the `data-analysis-report.json` schema.
|
|
79
|
+
|
|
80
|
+
Last updated: 2026-09-01
|