opencode-skills-collection 4.0.0 → 4.0.1
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/bundled-skills/.antigravity-install-manifest.json +24 -1
- package/bundled-skills/007/SKILL.md +2 -2
- package/bundled-skills/10-andruia-skill-smith/SKILL.md +1 -1
- package/bundled-skills/agent-squad/SKILL.md +5 -0
- package/bundled-skills/agent-squad/alex/SKILL.md +3 -0
- package/bundled-skills/agent-squad/aria/SKILL.md +3 -0
- package/bundled-skills/agent-squad/dep/SKILL.md +3 -0
- package/bundled-skills/agent-squad/luna/SKILL.md +4 -1
- package/bundled-skills/agent-squad/mason/SKILL.md +3 -0
- package/bundled-skills/agent-squad/max/SKILL.md +3 -0
- package/bundled-skills/agent-squad/quinn/SKILL.md +3 -0
- package/bundled-skills/agent-squad/rex/SKILL.md +3 -0
- package/bundled-skills/angular/metadata.json +1 -1
- package/bundled-skills/angular-best-practices/metadata.json +1 -1
- package/bundled-skills/angular-state-management/metadata.json +1 -1
- package/bundled-skills/angular-ui-patterns/metadata.json +1 -1
- package/bundled-skills/antigravity-skill-orchestrator/SKILL.md +2 -2
- package/bundled-skills/apify-actor-development/SKILL.md +2 -2
- package/bundled-skills/apple-container/SKILL.md +165 -0
- package/bundled-skills/apple-container/references/commands.md +1593 -0
- package/bundled-skills/apple-container/references/concepts.md +294 -0
- package/bundled-skills/apple-container/references/configuration.md +499 -0
- package/bundled-skills/apple-container/references/workflows.md +498 -0
- package/bundled-skills/ask-copilot/SKILL.md +112 -0
- package/bundled-skills/auto-research/SKILL.md +126 -0
- package/bundled-skills/brooks-lint/SKILL.md +1 -1
- package/bundled-skills/browser-harness/references/install.md +3 -1
- package/bundled-skills/chrome-extension-developer/SKILL.md +1 -1
- package/bundled-skills/clean-code-guard/SKILL.md +184 -0
- package/bundled-skills/clean-code-guard/references/ai-failure-modes.md +345 -0
- package/bundled-skills/clean-code-guard/references/comments-and-formatting.md +115 -0
- package/bundled-skills/clean-code-guard/references/dry-kiss-yagni.md +133 -0
- package/bundled-skills/clean-code-guard/references/naming-and-functions.md +187 -0
- package/bundled-skills/clean-code-guard/references/review-checklist.md +150 -0
- package/bundled-skills/clean-code-guard/references/solid.md +280 -0
- package/bundled-skills/clean-code-guard/references/sources.md +47 -0
- package/bundled-skills/cloudflare-security-audit/SKILL.md +137 -0
- package/bundled-skills/cloudflare-security-audit/references/AI-AND-LLM.md +67 -0
- package/bundled-skills/cloudflare-security-audit/references/ATTACK-CLASSES.md +116 -0
- package/bundled-skills/cloudflare-security-audit/references/CLIENT-SIDE.md +67 -0
- package/bundled-skills/cloudflare-security-audit/references/HUNTING.md +110 -0
- package/bundled-skills/cloudflare-security-audit/references/MEMORY-SAFETY-AND-BINARY.md +58 -0
- package/bundled-skills/cloudflare-security-audit/references/RECONNAISSANCE.md +46 -0
- package/bundled-skills/cloudflare-security-audit/references/VALIDATION-AND-REPORTING.md +109 -0
- package/bundled-skills/cloudflare-security-audit/references/WEB-PROTOCOL-AND-AUTH.md +85 -0
- package/bundled-skills/cloudflare-security-audit/resources/report-schema.json +210 -0
- package/bundled-skills/comfyui-gateway/references/troubleshooting.md +1 -1
- package/bundled-skills/commit/SKILL.md +2 -1
- package/bundled-skills/deepapi/SKILL.md +6 -6
- package/bundled-skills/docs/README.md +1 -1
- package/bundled-skills/docs/contributors/quality-bar.md +1 -1
- package/bundled-skills/docs/contributors/security-guardrails.md +1 -1
- package/bundled-skills/docs/integrations/jetski-cortex.md +5 -5
- package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +3 -3
- package/bundled-skills/docs/maintainers/ci-drift-fix.md +7 -5
- package/bundled-skills/docs/maintainers/merge-batch.md +24 -7
- package/bundled-skills/docs/maintainers/pr-autonomy.md +89 -0
- package/bundled-skills/docs/maintainers/release-notes-7.2.0.md +1 -1
- package/bundled-skills/docs/maintainers/release-process.md +9 -9
- package/bundled-skills/docs/maintainers/repo-growth-seo.md +5 -5
- package/bundled-skills/docs/maintainers/skills-date-tracking.md +1 -1
- package/bundled-skills/docs/maintainers/skills-update-guide.md +2 -2
- package/bundled-skills/docs/users/{antigravity-awesome-skills-vs-awesome-claude-skills.md → agentic-awesome-skills-vs-awesome-claude-skills.md} +5 -5
- package/bundled-skills/docs/users/ai-agent-skills.md +4 -4
- package/bundled-skills/docs/users/best-claude-code-skills-github.md +3 -3
- package/bundled-skills/docs/users/best-cursor-skills-github.md +3 -3
- package/bundled-skills/docs/users/bundles.md +56 -57
- package/bundled-skills/docs/users/claude-code-skills.md +6 -6
- package/bundled-skills/docs/users/codex-cli-skills.md +5 -5
- package/bundled-skills/docs/users/cursor-skills.md +3 -3
- package/bundled-skills/docs/users/faq.md +27 -15
- package/bundled-skills/docs/users/gemini-cli-skills.md +4 -4
- package/bundled-skills/docs/users/getting-started.md +22 -12
- package/bundled-skills/docs/users/kiro-integration.md +7 -7
- package/bundled-skills/docs/users/plugins.md +8 -9
- package/bundled-skills/docs/users/security-skills.md +1 -1
- package/bundled-skills/docs/users/skills-vs-mcp-tools.md +1 -1
- package/bundled-skills/docs/users/specialized-plugin-roadmap.md +3 -4
- package/bundled-skills/docs/users/usage.md +9 -9
- package/bundled-skills/docs/users/visual-guide.md +7 -7
- package/bundled-skills/docs/users/windows-truncation-recovery.md +1 -1
- package/bundled-skills/docs/users/workflows.md +1 -1
- package/bundled-skills/docs/vietnamese/BUNDLES.vi.md +1 -1
- package/bundled-skills/docs/vietnamese/FAQ.vi.md +15 -8
- package/bundled-skills/docs/vietnamese/GETTING_STARTED.vi.md +12 -5
- package/bundled-skills/docs/vietnamese/QUALITY_BAR.vi.md +1 -1
- package/bundled-skills/docs/vietnamese/README.vi.md +21 -17
- package/bundled-skills/docs/vietnamese/SECURITY_GUARDRAILS.vi.md +1 -1
- package/bundled-skills/docs/vietnamese/SKILLS_README.vi.md +2 -2
- package/bundled-skills/docs/vietnamese/TRANSLATION_PLAN.vi.md +1 -1
- package/bundled-skills/docs/vietnamese/VISUAL_GUIDE.vi.md +8 -8
- package/bundled-skills/docs-guard/SKILL.md +109 -0
- package/bundled-skills/docs-guard/references/code-samples.md +46 -0
- package/bundled-skills/docs-guard/references/docstrings.md +60 -0
- package/bundled-skills/docs-guard/references/review-checklist.md +45 -0
- package/bundled-skills/docs-guard/references/sources.md +22 -0
- package/bundled-skills/docs-guard/references/verification.md +51 -0
- package/bundled-skills/efficient-web-research/SKILL.md +4 -0
- package/bundled-skills/electron-development/SKILL.md +1 -1
- package/bundled-skills/event-staffing-compliance/SKILL.md +3 -0
- package/bundled-skills/event-staffing-ordering/SKILL.md +3 -0
- package/bundled-skills/feature-tracking/SKILL.md +222 -0
- package/bundled-skills/flutter-expert/SKILL.md +6 -1
- package/bundled-skills/flutter-expert/resources/implementation-playbook.md +214 -0
- package/bundled-skills/gemini-deep-research/README.md +246 -0
- package/bundled-skills/gemini-deep-research/SKILL.md +136 -0
- package/bundled-skills/gemini-deep-research/requirements.txt +2 -0
- package/bundled-skills/gemini-deep-research/scripts/research.py +692 -0
- package/bundled-skills/git-pushing/SKILL.md +21 -4
- package/bundled-skills/git-pushing/scripts/smart_commit.sh +206 -11
- package/bundled-skills/go-in-depth/scripts/workflow-script.js +4 -1
- package/bundled-skills/grok-build/SKILL.md +167 -0
- package/bundled-skills/grok-build/references/cli.md +99 -0
- package/bundled-skills/huggingface-tool-builder/references/find_models_by_paper.sh +1 -1
- package/bundled-skills/idea-autopsy/SKILL.md +147 -0
- package/bundled-skills/it-manager-hospital/README.md +1 -1
- package/bundled-skills/it-manager-pro/README.md +1 -1
- package/bundled-skills/itil-expert/README.md +1 -1
- package/bundled-skills/langgraph/SKILL.md +1 -1
- package/bundled-skills/linkedin-content-generator/SKILL.md +1 -1
- package/bundled-skills/lint-and-validate/scripts/lint_runner.py +23 -23
- package/bundled-skills/lint-and-validate/scripts/type_coverage.py +30 -30
- package/bundled-skills/logic-lens/SKILL.md +1 -1
- package/bundled-skills/lore/LICENSE +21 -0
- package/bundled-skills/lore/README.md +386 -0
- package/bundled-skills/lore/README.zh-CN.md +386 -0
- package/bundled-skills/lore/SKILL.md +453 -0
- package/bundled-skills/lore/WORKFLOWS.md +216 -0
- package/bundled-skills/lore/WORKFLOWS.zh-CN.md +216 -0
- package/bundled-skills/lore/references/audit-template.md +60 -0
- package/bundled-skills/lore/references/compatibility.md +228 -0
- package/bundled-skills/lore/references/config.md +125 -0
- package/bundled-skills/lore/references/entry-format.md +70 -0
- package/bundled-skills/lore/references/history-command.md +106 -0
- package/bundled-skills/lore/references/monorepo-detection.md +78 -0
- package/bundled-skills/lore/references/platform-mirrors.md +377 -0
- package/bundled-skills/lore/references/stale-new-markers.md +62 -0
- package/bundled-skills/lore/references/summary-template.md +98 -0
- package/bundled-skills/lore/scripts/README.md +54 -0
- package/bundled-skills/lore/scripts/README.zh-CN.md +54 -0
- package/bundled-skills/lore/scripts/find_duplicates.py +211 -0
- package/bundled-skills/lore/scripts/find_stale.py +116 -0
- package/bundled-skills/lore/scripts/history.py +527 -0
- package/bundled-skills/lore/scripts/id_hash.py +32 -0
- package/bundled-skills/lore/scripts/list_entries.py +183 -0
- package/bundled-skills/lovable-cleanup/SKILL.md +3 -3
- package/bundled-skills/makepad-splash/SKILL.md +1 -1
- package/bundled-skills/mmx-cli/SKILL.md +14 -1
- package/bundled-skills/monopoly/SKILL.md +5 -0
- package/bundled-skills/monopoly/patterns/SKILL.md +4 -0
- package/bundled-skills/monopoly/scale-benchmarks/SKILL.md +4 -0
- package/bundled-skills/monopoly/security-checklist/SKILL.md +4 -0
- package/bundled-skills/monopoly/tech-matrix/SKILL.md +4 -0
- package/bundled-skills/mtls-configuration/SKILL.md +1 -1
- package/bundled-skills/network-101/SKILL.md +4 -5
- package/bundled-skills/nika/SKILL.md +270 -0
- package/bundled-skills/not-a-vibe-coder/SKILL.md +4 -0
- package/bundled-skills/ontoly-software-graph/SKILL.md +160 -0
- package/bundled-skills/openclaw-github-repo-commander/SKILL.md +1 -1
- package/bundled-skills/pilot-protocol/SKILL.md +6 -3
- package/bundled-skills/postgres-readonly-queries/README.md +77 -0
- package/bundled-skills/postgres-readonly-queries/SKILL.md +152 -0
- package/bundled-skills/postgres-readonly-queries/connections.example.json +34 -0
- package/bundled-skills/postgres-readonly-queries/requirements.txt +1 -0
- package/bundled-skills/postgres-readonly-queries/scripts/query.py +262 -0
- package/bundled-skills/pptx-deck-creation/SKILL.md +275 -0
- package/bundled-skills/pptx-deck-creation/references/audit-checklist.md +156 -0
- package/bundled-skills/pptx-deck-creation/references/design-profiles.md +96 -0
- package/bundled-skills/pptx-deck-creation/references/python-snippets.md +150 -0
- package/bundled-skills/pptx-deck-creation/references/reference-deck-analysis.md +91 -0
- package/bundled-skills/pptx-deck-creation/references/visual-asset-adapters.md +158 -0
- package/bundled-skills/privilege-escalation-methods/SKILL.md +1 -1
- package/bundled-skills/product-decision-agent/SKILL.md +94 -0
- package/bundled-skills/product-decision-agent/agents/openai.yaml +7 -0
- package/bundled-skills/product-decision-agent/references/methodology-basis.md +232 -0
- package/bundled-skills/product-decision-agent/references/product-playbooks.md +813 -0
- package/bundled-skills/product-decision-agent/references/reasoning-engine.md +289 -0
- package/bundled-skills/product-decision-agent/references/response-examples.md +279 -0
- package/bundled-skills/product-decision-agent/scripts/quality_gate.py +221 -0
- package/bundled-skills/product-decision-agent/scripts/test_quality_gate.py +94 -0
- package/bundled-skills/pytest-skill/reference/playbook.md +358 -0
- package/bundled-skills/quit-sponsor/SKILL.md +96 -0
- package/bundled-skills/rclone-cli/references/providers/s3.md +1 -1
- package/bundled-skills/security-and-hardening/SKILL.md +1 -1
- package/bundled-skills/semgrep-rule-creator/SKILL.md +6 -6
- package/bundled-skills/skill-creator/README.md +3 -3
- package/bundled-skills/skill-creator/SKILL.md +8 -4
- package/bundled-skills/skill-creator/scripts/quick_validate.py +1 -1
- package/bundled-skills/sql-injection-testing/SKILL.md +4 -4
- package/bundled-skills/subagent-orchestrator/README.md +1 -1
- package/bundled-skills/super-code/bash/SKILL.md +3 -0
- package/bundled-skills/super-code/c/SKILL.md +3 -0
- package/bundled-skills/super-code/cpp/SKILL.md +3 -0
- package/bundled-skills/super-code/csharp/SKILL.md +3 -0
- package/bundled-skills/super-code/dart/SKILL.md +3 -0
- package/bundled-skills/super-code/elixir/SKILL.md +3 -0
- package/bundled-skills/super-code/go/SKILL.md +3 -0
- package/bundled-skills/super-code/java/SKILL.md +3 -0
- package/bundled-skills/super-code/kotlin/SKILL.md +3 -0
- package/bundled-skills/super-code/php/SKILL.md +3 -0
- package/bundled-skills/super-code/python/SKILL.md +3 -0
- package/bundled-skills/super-code/ruby/SKILL.md +3 -0
- package/bundled-skills/super-code/rust/SKILL.md +3 -0
- package/bundled-skills/super-code/scala/SKILL.md +3 -0
- package/bundled-skills/super-code/swift/SKILL.md +3 -0
- package/bundled-skills/super-code/typescript/SKILL.md +3 -0
- package/bundled-skills/telegram-bot-messaging/README.md +185 -0
- package/bundled-skills/telegram-bot-messaging/SKILL.md +101 -0
- package/bundled-skills/telegram-bot-messaging/scripts/telegram.sh +420 -0
- package/bundled-skills/test-guard/SKILL.md +132 -0
- package/bundled-skills/test-guard/references/jest.md +50 -0
- package/bundled-skills/test-guard/references/llm-app-testing.md +40 -0
- package/bundled-skills/test-guard/references/phpunit.md +56 -0
- package/bundled-skills/test-guard/references/pytest.md +65 -0
- package/bundled-skills/trading-ledger/SKILL.md +11 -3
- package/bundled-skills/uizze-ui-research/SKILL.md +93 -0
- package/bundled-skills/vibe-code-auditor/SKILL.md +1 -1
- package/bundled-skills/vibecode-production-qa-validator/SKILL.md +1 -1
- package/bundled-skills/videodb/scripts/ws_listener.py +29 -15
- package/bundled-skills/voice-ai-engine-development/README.md +1 -1
- package/bundled-skills/vulnerability-scanner/SKILL.md +1 -1
- package/bundled-skills/warehouse/SKILL.md +154 -0
- package/bundled-skills/woo-guard/SKILL.md +113 -0
- package/bundled-skills/woo-guard/references/checkout-and-money.md +64 -0
- package/bundled-skills/woo-guard/references/hpos-and-crud.md +87 -0
- package/bundled-skills/woo-guard/references/review-checklist.md +44 -0
- package/bundled-skills/woo-guard/references/sources.md +17 -0
- package/bundled-skills/wp-guard/SKILL.md +119 -0
- package/bundled-skills/wp-guard/references/i18n.md +88 -0
- package/bundled-skills/wp-guard/references/performance.md +70 -0
- package/bundled-skills/wp-guard/references/review-checklist.md +57 -0
- package/bundled-skills/wp-guard/references/security.md +100 -0
- package/bundled-skills/wp-guard/references/sources.md +27 -0
- package/bundled-skills/writing-skills/gotchas.md +1 -1
- package/bundled-skills/writing-skills/references/standards/metadata-standard.md +1 -1
- package/bundled-skills/x-twitter-scraper/SKILL.md +14 -32
- package/bundled-skills/xss-html-injection/SKILL.md +3 -3
- package/bundled-skills/youtube-seo-optimizer/SKILL.md +1 -1
- package/bundled-skills/youtube-summarizer/CHANGELOG.md +2 -2
- package/package.json +1 -1
- package/skills_index.json +273 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Test Guard — JavaScript / TypeScript / Jest / Vitest Patterns
|
|
2
|
+
|
|
3
|
+
Concrete applications of the nine rules for JS/TS projects. Read this when reviewing or writing Jest or Vitest tests.
|
|
4
|
+
|
|
5
|
+
## Rule 2: Mock boundaries in JS/TS
|
|
6
|
+
|
|
7
|
+
Justified mock targets:
|
|
8
|
+
|
|
9
|
+
- Network: prefer `msw` (Mock Service Worker) over `jest.mock`-ing your own fetch wrapper — it mocks at the true boundary
|
|
10
|
+
- LLM / third-party SDK clients (`openai`, `@anthropic-ai/sdk`, Stripe, etc.)
|
|
11
|
+
- Timers and randomness: `vi.useFakeTimers()` / `jest.useFakeTimers()`, seeded RNG
|
|
12
|
+
- Filesystem and process env in Node code
|
|
13
|
+
|
|
14
|
+
Unjustified mocks:
|
|
15
|
+
|
|
16
|
+
- `jest.mock('../utils/helpers')` — mocking your own internal module to isolate a "unit" (Rule 2)
|
|
17
|
+
- Mocking a class's private method via prototype patching (Rule 1)
|
|
18
|
+
- Hand-built object literals pretending to be domain entities when a real constructor or factory exists (Rule 8)
|
|
19
|
+
|
|
20
|
+
## Rule 3: test.each
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
// Violation: three near-identical it() blocks
|
|
24
|
+
// Fix:
|
|
25
|
+
test.each([
|
|
26
|
+
['Hello World', 'hello-world'],
|
|
27
|
+
[' padded ', 'padded'],
|
|
28
|
+
['Café Menu', 'cafe-menu'],
|
|
29
|
+
])('slugify(%s) → %s', (raw, expected) => {
|
|
30
|
+
expect(slugify(raw)).toBe(expected);
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Snapshot discipline
|
|
35
|
+
|
|
36
|
+
Snapshot tests are implementation tests in disguise unless the snapshot *is* the contract (e.g., a public JSON output, a CLI's help text). Avoid snapshots of:
|
|
37
|
+
|
|
38
|
+
- Full component trees that change on every styling tweak (Rule 1 — brittle, asserts implementation)
|
|
39
|
+
- Large objects nobody reviews — an unread snapshot approves itself (Rule 4)
|
|
40
|
+
|
|
41
|
+
Prefer targeted assertions: `expect(screen.getByRole('button')).toHaveTextContent('Save')`.
|
|
42
|
+
|
|
43
|
+
## UI component tests
|
|
44
|
+
|
|
45
|
+
- Test what the user sees and does (Testing Library queries by role/label), not component internals or state hooks (Rule 1).
|
|
46
|
+
- Don't test that React renders, routes resolve, or props propagate — framework guarantees (Rule 7).
|
|
47
|
+
|
|
48
|
+
## Rule 9: Real persistence
|
|
49
|
+
|
|
50
|
+
For data-layer logic (Prisma/Drizzle/Knex queries), run against a real test database — `testcontainers`, a Dockerized Postgres, or SQLite where compatible. Mocking the query builder to test the query builder tests nothing.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Test Guard — LLM Application Rules
|
|
2
|
+
|
|
3
|
+
Three additional rules for projects that call LLM APIs, use agent/workflow frameworks (LangGraph, CrewAI, custom state machines), or wire up observability/telemetry (Langfuse, LangSmith, OpenTelemetry). Apply these on top of the nine core rules.
|
|
4
|
+
|
|
5
|
+
## Rule 10: Prompt tests — test the contract, not the content
|
|
6
|
+
|
|
7
|
+
Prompt text changes constantly; tests pinned to wording rot within a week. Don't assert specific phrasing.
|
|
8
|
+
|
|
9
|
+
Do test:
|
|
10
|
+
|
|
11
|
+
- The prompt template exists and loads without error (smoke test)
|
|
12
|
+
- Template variables are substituted correctly — no leftover `{placeholder}` markers
|
|
13
|
+
- The prompt contains required structural markers *if the caller parses them* (e.g., a JSON schema block, a delimiter the parser splits on)
|
|
14
|
+
|
|
15
|
+
## Rule 11: Observability is infrastructure
|
|
16
|
+
|
|
17
|
+
Don't unit-test telemetry wiring. The violation pattern is asserting a tracing/analytics mock's call arguments:
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
# Violation — tests wiring, not behavior
|
|
21
|
+
mock_tracer.assert_called_once_with(session_id=..., tags=[...])
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Mocking observability calls to *prevent side effects* during tests is fine and often necessary. Just don't assert on the mock's call args. If telemetry breaks, dashboards show it; a unit test asserting wiring only breaks refactors.
|
|
25
|
+
|
|
26
|
+
## Rule 12: Agent and flow tests test transitions
|
|
27
|
+
|
|
28
|
+
For agent frameworks and state machines: test that given a state plus an event, the flow reaches the correct next state with the correct fields set. Mock the LLM calls to return controlled responses.
|
|
29
|
+
|
|
30
|
+
Test: state in → state out.
|
|
31
|
+
|
|
32
|
+
Don't test: the exact prompt string passed to the LLM, the number of LLM calls made, or internal retry logic — those are implementation details (Rule 1) that change with every model upgrade.
|
|
33
|
+
|
|
34
|
+
A useful pattern is a table of transition cases (data-driven, Rule 3): starting state, mocked LLM response, expected resulting state.
|
|
35
|
+
|
|
36
|
+
## Severity
|
|
37
|
+
|
|
38
|
+
- **Must fix:** Rule 12 violations that assert prompt strings or call counts — they break on every model/prompt change
|
|
39
|
+
- **Should fix:** Rule 10 wording assertions
|
|
40
|
+
- **Worth noting:** Rule 11 — flag it, but don't block a small change on it
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Test Guard — PHP / PHPUnit / Pest Patterns
|
|
2
|
+
|
|
3
|
+
Concrete applications of the nine rules for PHP projects, including WordPress and WooCommerce. Read this when reviewing or writing PHP tests.
|
|
4
|
+
|
|
5
|
+
## Rule 2: Mock boundaries in PHP
|
|
6
|
+
|
|
7
|
+
Justified mock targets:
|
|
8
|
+
|
|
9
|
+
- HTTP: Guzzle handlers/middleware, `pre_http_request` filter in WordPress
|
|
10
|
+
- External SDKs: payment gateways, mail providers, LLM API clients
|
|
11
|
+
- Clock: inject a clock (`psr/clock`) instead of calling `time()` directly
|
|
12
|
+
- Filesystem on external paths (prefer `vfsStream` or temp dirs over mocking)
|
|
13
|
+
|
|
14
|
+
Unjustified mocks:
|
|
15
|
+
|
|
16
|
+
- Mockery/Prophecy doubles for the project's own value objects, DTOs, or entities — construct real instances (Rule 8)
|
|
17
|
+
- Mocking internal services just to isolate a class — if wiring is painful, fix the constructor, don't fake the collaborator
|
|
18
|
+
- Partial mocks of the class under test — you are no longer testing the class
|
|
19
|
+
|
|
20
|
+
## Rule 3: Data providers
|
|
21
|
+
|
|
22
|
+
```php
|
|
23
|
+
/**
|
|
24
|
+
* @see Rule 3 — variants of one scenario belong in a data provider.
|
|
25
|
+
*/
|
|
26
|
+
#[DataProvider('provideSlugCases')]
|
|
27
|
+
public function test_slugify_normalizes_input( string $raw, string $expected ): void {
|
|
28
|
+
$this->assertSame( $expected, slugify( $raw ) );
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public static function provideSlugCases(): array {
|
|
32
|
+
return array(
|
|
33
|
+
'lowercases' => array( 'Hello World', 'hello-world' ),
|
|
34
|
+
'strips padding' => array( ' padded ', 'padded' ),
|
|
35
|
+
'transliterates' => array( 'Café Menu', 'cafe-menu' ),
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Pest equivalent: `it('normalizes slug', ...)->with([...])`.
|
|
41
|
+
|
|
42
|
+
## WordPress-specific boundaries
|
|
43
|
+
|
|
44
|
+
- **Integration tests** (`WP_UnitTestCase` / `wp-env` / `wp-cli scaffold`): use the real WordPress test framework with factories — `self::factory()->post->create()`, `self::factory()->user->create()`. Don't mock `WP_Post` or `WP_User`; the factories exist precisely so you don't have to (Rule 8).
|
|
45
|
+
- **Unit tests without WordPress loaded** (Brain Monkey / WP_Mock): mocking WordPress functions like `get_option()` or `apply_filters()` is a boundary mock and justified. But assert what *your code does* with the values, not that `get_option` was called with specific args (Rule 1).
|
|
46
|
+
- Mock outbound HTTP with the `pre_http_request` filter rather than patching `wp_remote_get` internals.
|
|
47
|
+
- Don't test that WordPress sanitizes, escapes, or that hooks fire — that's core's guarantee (Rule 7). Test your callback's behavior given an input.
|
|
48
|
+
|
|
49
|
+
## WooCommerce notes
|
|
50
|
+
|
|
51
|
+
- Build real `WC_Product` / `WC_Order` objects via `WC_Helper_Product` and `WC_Helper_Order` in integration tests — never `MagicMock`-style doubles of them (Rule 8).
|
|
52
|
+
- Cart and checkout logic is stateful: prefer integration tests over heavily mocked unit tests; mocked carts hide hook-ordering bugs.
|
|
53
|
+
|
|
54
|
+
## Rule 9: Real database
|
|
55
|
+
|
|
56
|
+
`WP_UnitTestCase` already wraps each test in a transaction against a real schema — use it for query, meta, and persistence logic instead of mocking `$wpdb`. Mocking `$wpdb->prepare` or `$wpdb->get_results` to test a query builder tests nothing.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Test Guard — Python / pytest Patterns
|
|
2
|
+
|
|
3
|
+
Concrete applications of the nine rules for pytest projects. Read this when reviewing or writing Python tests.
|
|
4
|
+
|
|
5
|
+
## Rule 2: Mock boundaries in Python
|
|
6
|
+
|
|
7
|
+
Justified mock targets:
|
|
8
|
+
|
|
9
|
+
- HTTP clients: `httpx`, `requests`, `aiohttp` (or use `respx` / `responses` instead of raw mocks)
|
|
10
|
+
- LLM SDK calls: `openai`, `anthropic`, `litellm.completion` and friends
|
|
11
|
+
- Database sessions, when the database is not the subject (see Rule 9)
|
|
12
|
+
- Filesystem I/O on external paths (`tmp_path` fixture is often better than mocking)
|
|
13
|
+
- Clock and randomness: `time.time`, `datetime.now`, `random` (prefer `freezegun` or injected clocks)
|
|
14
|
+
|
|
15
|
+
Unjustified mocks (common agent-generated violations):
|
|
16
|
+
|
|
17
|
+
- `MagicMock()` standing in for a Pydantic model or dataclass — construct the real thing
|
|
18
|
+
- Mocking internal utility functions to isolate a "unit"
|
|
19
|
+
- Mocking `json.loads` / `json.dumps` or other stdlib pure functions
|
|
20
|
+
|
|
21
|
+
## Rule 3: Parametrize
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
# Violation: three copy-pasted tests differing by one value
|
|
25
|
+
def test_slug_lowercase(): ...
|
|
26
|
+
def test_slug_strips_spaces(): ...
|
|
27
|
+
def test_slug_handles_unicode(): ...
|
|
28
|
+
|
|
29
|
+
# Fix
|
|
30
|
+
@pytest.mark.parametrize(
|
|
31
|
+
("raw", "expected"),
|
|
32
|
+
[
|
|
33
|
+
("Hello World", "hello-world"),
|
|
34
|
+
(" padded ", "padded"),
|
|
35
|
+
("Café Menu", "cafe-menu"),
|
|
36
|
+
],
|
|
37
|
+
)
|
|
38
|
+
def test_slugify_normalizes_input(raw, expected):
|
|
39
|
+
assert slugify(raw) == expected
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Rule 8: Real Pydantic/dataclass instances
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
# Wrong — hides field typos and validation errors
|
|
46
|
+
state = MagicMock()
|
|
47
|
+
state.user_id = "123"
|
|
48
|
+
state.status = "ACTIVE"
|
|
49
|
+
|
|
50
|
+
# Right — Pydantic validates the construction itself
|
|
51
|
+
state = UserState(user_id="123", status="ACTIVE")
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
If a model needs many fields, add a factory fixture or use `factory_boy` — don't fall back to `MagicMock`.
|
|
55
|
+
|
|
56
|
+
## Rule 9: Real database via fixtures
|
|
57
|
+
|
|
58
|
+
Use a fixture that applies real migrations (e.g., a session-scoped test database with `alembic upgrade head`), and function-scoped transactions rolled back per test. `pytest-postgresql`, `testcontainers`, or an SQLite-compatible fallback all work; the point is real schema, not a mocked session, whenever query or persistence logic is the subject.
|
|
59
|
+
|
|
60
|
+
## pytest-specific smells
|
|
61
|
+
|
|
62
|
+
- `assert mock.call_count == N` on anything internal — Rule 1 violation
|
|
63
|
+
- `@patch` stacks three or more deep — the test is coupled to implementation; restructure
|
|
64
|
+
- Asserting log output via `caplog` for messages no caller parses — Rule 4 violation
|
|
65
|
+
- Fixtures that build mocks of project classes — Rule 8 violation, make the fixture build real objects
|
|
@@ -28,9 +28,15 @@ A journaling skill in the tradition of the *Market Wizards* interviews: a writte
|
|
|
28
28
|
|
|
29
29
|
## How It Works
|
|
30
30
|
|
|
31
|
-
### Step 1:
|
|
31
|
+
### Step 1: Confirm the database (first use per session)
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Use Notion `search` to find candidate **databases** (type `database`, not pages) whose title
|
|
34
|
+
contains **"trading-ledger"**. Before any `query` or `create-pages` call, show the user the
|
|
35
|
+
candidate title and `data_source_id` (`collection://...` UUID) and ask them to confirm the exact
|
|
36
|
+
database for this session. A single title match is not sufficient confirmation. If the connector
|
|
37
|
+
returns owner or schema metadata, show it as an additional identity check. Use only the
|
|
38
|
+
user-confirmed ID for the remainder of the session; do not re-run fuzzy selection after a
|
|
39
|
+
confirmation.
|
|
34
40
|
|
|
35
41
|
The companion Notion template (free, linked in the source repo) ships this schema — select values are a controlled enum, copy them exactly:
|
|
36
42
|
|
|
@@ -101,7 +107,9 @@ Agent: 3 closed since last review:
|
|
|
101
107
|
|
|
102
108
|
## Security & Safety Notes
|
|
103
109
|
|
|
104
|
-
- **Mutation scope**: writes and updates rows only in the
|
|
110
|
+
- **Mutation scope**: writes and updates rows only in the exact Notion database ID confirmed by
|
|
111
|
+
the user for the current session via the official Notion connector (MCP) — no shell commands,
|
|
112
|
+
no network fetches, no market-data lookups, no credentials.
|
|
105
113
|
- **This skill must never produce trading signals, price data, or buy/sell recommendations.** It records and mirrors the user's own decisions; the review asks questions, it does not advise. Nothing it writes is financial advice, and it should say so if asked for a recommendation.
|
|
106
114
|
- On claude.ai, Notion's write tools default to *needs approval* — the first write pops an approval prompt; expected, not a hang.
|
|
107
115
|
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: uizze-ui-research
|
|
3
|
+
description: "Use when building or reviewing web and iOS product UI and you need real UI references, structured design contracts, or implementation validation through UIZZE MCP."
|
|
4
|
+
category: design
|
|
5
|
+
risk: safe
|
|
6
|
+
source: https://github.com/aislon/uizze-mcp/tree/main/skills/uizze-ui-research
|
|
7
|
+
source_repo: aislon/uizze-mcp
|
|
8
|
+
source_type: official
|
|
9
|
+
date_added: "2026-07-12"
|
|
10
|
+
author: samuelbushi
|
|
11
|
+
tags: [ui-design, ui-research, mcp, design-contracts, agent-workflows]
|
|
12
|
+
tools: [claude, cursor, codex, copilot, antigravity, lovable]
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# UIZZE UI Research
|
|
16
|
+
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
Use UIZZE to give coding agents real product-UI context before implementation rather than relying on a generic styling prompt. The public catalog is free to browse; the hosted MCP workflow requires full access and a configured UIZZE agent token.
|
|
20
|
+
|
|
21
|
+
This skill turns UI research into an explicit workflow: retrieve relevant references, translate transferable patterns into a design contract, implement within the current project's system, and run the available validation or critique gates.
|
|
22
|
+
|
|
23
|
+
## When to Use This Skill
|
|
24
|
+
|
|
25
|
+
- You are designing a new product screen, flow, or component for web or iOS.
|
|
26
|
+
- You need real interface references before implementing an AI-generated UI.
|
|
27
|
+
- You are reviewing an implementation against explicit design constraints.
|
|
28
|
+
- You need to reduce generic or repetitive UI by grounding work in observed product patterns.
|
|
29
|
+
|
|
30
|
+
## How It Works
|
|
31
|
+
|
|
32
|
+
### Step 1: Confirm access and scope
|
|
33
|
+
|
|
34
|
+
Confirm that the UIZZE MCP connection is already configured with a valid agent token before invoking hosted workflows. If it is unavailable, use the free public catalog for research or ask the user to configure access; do not attempt to bypass access controls or expose credentials.
|
|
35
|
+
|
|
36
|
+
### Step 2: Retrieve relevant visual context
|
|
37
|
+
|
|
38
|
+
Use the available UIZZE tools to find screens, flows, components, or elements that match the product task. Focus on transferable patterns such as hierarchy, navigation, interaction states, spacing, density, and responsive behavior.
|
|
39
|
+
|
|
40
|
+
### Step 3: Make constraints explicit
|
|
41
|
+
|
|
42
|
+
Create or use a structured design contract when the task needs explicit acceptance criteria. Adapt patterns to the existing project design system instead of treating any reference as a visual template.
|
|
43
|
+
|
|
44
|
+
### Step 4: Validate before completion
|
|
45
|
+
|
|
46
|
+
Use the available UIZZE validation, audit, or critique workflow when the implementation is ready for review. Resolve the findings in the project and run normal project tests before calling the work complete.
|
|
47
|
+
|
|
48
|
+
## Examples
|
|
49
|
+
|
|
50
|
+
### Research an iOS onboarding flow
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
Use UIZZE to research real iOS onboarding flows for a subscription product. Identify transferable patterns for progressive disclosure and permission timing, turn them into a concise design contract, then propose an implementation that fits this app's existing design system.
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Review a web settings screen
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
Use UIZZE to inspect relevant real product settings screens, audit this implementation against a design contract for hierarchy, form states, and navigation, then list the concrete changes needed before release.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Best Practices
|
|
63
|
+
|
|
64
|
+
- ✅ Start with the smallest relevant set of references rather than collecting a broad gallery.
|
|
65
|
+
- ✅ Separate observed patterns from the current project's brand and component rules.
|
|
66
|
+
- ✅ Use validation findings as implementation feedback, not as permission to copy an interface.
|
|
67
|
+
- ❌ Do not reproduce another product's brand, proprietary copy, assets, or exact layout.
|
|
68
|
+
- ❌ Do not commit agent tokens, include them in prompts, or place them in client-side code.
|
|
69
|
+
|
|
70
|
+
## Security & Safety Notes
|
|
71
|
+
|
|
72
|
+
- Keep the UIZZE agent token in local agent configuration or an environment variable only.
|
|
73
|
+
- Hosted MCP workflows require authorized access; the free catalog does not grant permission to use paid workflows.
|
|
74
|
+
- Treat returned references as research context, not reusable visual assets.
|
|
75
|
+
|
|
76
|
+
## Common Pitfalls
|
|
77
|
+
|
|
78
|
+
- **Problem:** Treating a reference as a design to clone.
|
|
79
|
+
**Solution:** Extract the interaction or hierarchy pattern, then implement it using the target project's own design system and content.
|
|
80
|
+
- **Problem:** Starting implementation before the agent has relevant UI context.
|
|
81
|
+
**Solution:** Search for the smallest useful set of matching screens or flows first, then define constraints before coding.
|
|
82
|
+
- **Problem:** Exposing an agent token in a repository or chat transcript.
|
|
83
|
+
**Solution:** Store credentials only in supported local configuration or environment variables and rotate a token if it is exposed.
|
|
84
|
+
|
|
85
|
+
## Related Skills
|
|
86
|
+
|
|
87
|
+
- `@stitch-ui-design` - Use when generating or iterating UI concepts in Google Stitch.
|
|
88
|
+
|
|
89
|
+
## Limitations
|
|
90
|
+
|
|
91
|
+
- This skill does not replace product-specific user research, accessibility review, project tests, or human design judgment.
|
|
92
|
+
- It cannot make a hosted UIZZE MCP workflow available without a valid authorized connection.
|
|
93
|
+
- Stop and ask for clarification if the product goal, existing design system, or access boundaries are missing.
|
|
@@ -57,7 +57,7 @@ Use these heuristics to accelerate detection:
|
|
|
57
57
|
|
|
58
58
|
| Pattern | Likely Issue | Quick Check |
|
|
59
59
|
|---------|-------------|-------------|
|
|
60
|
-
| `eval()`, `exec()`, `os.system()` | Security critical | Search for these strings |
|
|
60
|
+
| `eval()`, `exec()`, `os.system()` | Security critical | Search for these strings | <!-- security-allowlist: defensive audit table -->
|
|
61
61
|
| `except:` or `except Exception:` | Silent failures | Grep for bare excepts |
|
|
62
62
|
| `password`, `secret`, `key`, `token` in code | Hardcoded credentials | Search + check if literal string |
|
|
63
63
|
| `if DEBUG`, `debug=True` | Insecure defaults | Check config blocks |
|
|
@@ -239,7 +239,7 @@ qa:heavyload() {
|
|
|
239
239
|
qa:vulns() {
|
|
240
240
|
npm audit 2>/dev/null | grep -E "critical|high" | grep . && echo " ✗ Vulnerabilities!" || echo " ✓ No critical/high vulns"
|
|
241
241
|
npm outdated 2>/dev/null | head -5 | grep . || echo " ✓ All up to date"
|
|
242
|
-
local D=$(grep -rn "eval(\|new Function(\|document.write(" app/ src/ --include="*.ts" --include="*.tsx" 2>/dev/null | head -5)
|
|
242
|
+
local D=$(grep -rn "eval(\|new Function(\|document.write(" app/ src/ --include="*.ts" --include="*.tsx" 2>/dev/null | head -5) # security-allowlist: defensive source scan
|
|
243
243
|
[ -n "$D" ] && echo " ⚠ Dangerous patterns:" && echo "$D" || echo " ✓ No dangerous patterns"
|
|
244
244
|
}
|
|
245
245
|
qa:cleanup() {
|
|
@@ -35,17 +35,9 @@ from datetime import datetime, timezone
|
|
|
35
35
|
from pathlib import Path
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
def
|
|
39
|
-
"""
|
|
40
|
-
|
|
41
|
-
raise ValueError("Custom base directories are not supported for CLI paths")
|
|
42
|
-
base_path = Path.cwd().resolve()
|
|
43
|
-
resolved_path = Path(path_value).expanduser().resolve()
|
|
44
|
-
try:
|
|
45
|
-
resolved_path.relative_to(base_path)
|
|
46
|
-
except ValueError as exc:
|
|
47
|
-
raise ValueError(f"Path escapes allowed directory: {path_value}") from exc
|
|
48
|
-
return resolved_path
|
|
38
|
+
def normalize_output_dir(path_value):
|
|
39
|
+
"""Normalize the user-selected state directory without resolving symlinks."""
|
|
40
|
+
return Path(os.path.abspath(os.path.expanduser(str(path_value))))
|
|
49
41
|
|
|
50
42
|
from dotenv import load_dotenv
|
|
51
43
|
load_dotenv()
|
|
@@ -77,7 +69,7 @@ def parse_args():
|
|
|
77
69
|
state_root = Path(os.environ.get("XDG_STATE_HOME", Path.home() / ".local" / "state"))
|
|
78
70
|
output_dir = str(state_root / "videodb-events")
|
|
79
71
|
|
|
80
|
-
return clear,
|
|
72
|
+
return clear, normalize_output_dir(output_dir)
|
|
81
73
|
|
|
82
74
|
CLEAR_EVENTS, OUTPUT_DIR = parse_args()
|
|
83
75
|
EVENTS_FILE = OUTPUT_DIR / "videodb_events.jsonl"
|
|
@@ -106,6 +98,28 @@ def ensure_output_dir():
|
|
|
106
98
|
OUTPUT_DIR.mkdir(parents=True, mode=DIR_MODE, exist_ok=True)
|
|
107
99
|
|
|
108
100
|
|
|
101
|
+
def safe_output_path(path_value):
|
|
102
|
+
"""Resolve a generated output file under the configured output directory."""
|
|
103
|
+
candidate = Path(path_value)
|
|
104
|
+
if not candidate.is_absolute():
|
|
105
|
+
candidate = OUTPUT_DIR / candidate
|
|
106
|
+
candidate = Path(os.path.abspath(candidate))
|
|
107
|
+
try:
|
|
108
|
+
candidate.relative_to(OUTPUT_DIR)
|
|
109
|
+
except ValueError as exc:
|
|
110
|
+
raise ValueError(f"Path escapes output directory: {path_value}") from exc
|
|
111
|
+
if candidate.is_symlink():
|
|
112
|
+
raise OSError(f"Refusing to use symlinked output file: {candidate}")
|
|
113
|
+
|
|
114
|
+
output_root = OUTPUT_DIR.resolve()
|
|
115
|
+
resolved_path = candidate.resolve(strict=False)
|
|
116
|
+
try:
|
|
117
|
+
resolved_path.relative_to(output_root)
|
|
118
|
+
except ValueError as exc:
|
|
119
|
+
raise ValueError(f"Path escapes output directory: {path_value}") from exc
|
|
120
|
+
return resolved_path
|
|
121
|
+
|
|
122
|
+
|
|
109
123
|
def secure_open(path: Path, *, append: bool):
|
|
110
124
|
"""Open a regular file without following symlinks."""
|
|
111
125
|
ensure_output_dir()
|
|
@@ -113,7 +127,7 @@ def secure_open(path: Path, *, append: bool):
|
|
|
113
127
|
flags |= os.O_APPEND if append else os.O_TRUNC
|
|
114
128
|
flags |= getattr(os, "O_NOFOLLOW", 0)
|
|
115
129
|
|
|
116
|
-
fd = os.open(
|
|
130
|
+
fd = os.open(safe_output_path(path), flags, FILE_MODE)
|
|
117
131
|
try:
|
|
118
132
|
file_stat = os.fstat(fd)
|
|
119
133
|
if not stat.S_ISREG(file_stat.st_mode):
|
|
@@ -128,14 +142,14 @@ def secure_open(path: Path, *, append: bool):
|
|
|
128
142
|
|
|
129
143
|
def secure_write_text(path: Path, content: str):
|
|
130
144
|
"""Write text to a regular file with private permissions."""
|
|
131
|
-
fd = secure_open(
|
|
145
|
+
fd = secure_open(path, append=False)
|
|
132
146
|
with os.fdopen(fd, "w", encoding="utf-8") as handle:
|
|
133
147
|
handle.write(content)
|
|
134
148
|
|
|
135
149
|
|
|
136
150
|
def secure_append_text(path: Path, content: str):
|
|
137
151
|
"""Append text to a regular file with private permissions."""
|
|
138
|
-
fd = secure_open(
|
|
152
|
+
fd = secure_open(path, append=True)
|
|
139
153
|
with os.fdopen(fd, "a", encoding="utf-8") as handle:
|
|
140
154
|
handle.write(content)
|
|
141
155
|
|
|
@@ -150,7 +150,7 @@ See `references/common_pitfalls.md` for detailed solutions to:
|
|
|
150
150
|
|
|
151
151
|
## Contributing
|
|
152
152
|
|
|
153
|
-
This skill is part of the
|
|
153
|
+
This skill is part of the Agentic Awesome Skills repository. Contributions are welcome!
|
|
154
154
|
|
|
155
155
|
## Related Skills
|
|
156
156
|
|
|
@@ -204,7 +204,7 @@ Is it actively exploited (EPSS >0.5)?
|
|
|
204
204
|
| Pattern | Risk | Look For |
|
|
205
205
|
|---------|------|----------|
|
|
206
206
|
| **String concat in queries** | Injection | `"SELECT * FROM " + user_input` |
|
|
207
|
-
| **Dynamic code execution** | RCE | `eval()`, `exec()`, `Function()` |
|
|
207
|
+
| **Dynamic code execution** | RCE | `eval()`, `exec()`, `Function()` | <!-- security-allowlist: defensive vulnerability taxonomy -->
|
|
208
208
|
| **Unsafe deserialization** | RCE | `pickle.loads()`, `unserialize()` |
|
|
209
209
|
| **Path manipulation** | Traversal | User input in file paths |
|
|
210
210
|
| **Disabled security** | Various | `verify=False`, `--insecure` |
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: warehouse
|
|
3
|
+
description: "Plan and review read-only data warehouse analysis with explicit scope, privacy, provenance, and validation checks."
|
|
4
|
+
category: data
|
|
5
|
+
risk: critical
|
|
6
|
+
source: self
|
|
7
|
+
source_type: self
|
|
8
|
+
date_added: "2026-07-12"
|
|
9
|
+
author: Rudra-G-23
|
|
10
|
+
tags: [analytics, data-warehouse, sql, data-quality]
|
|
11
|
+
tools: [claude, cursor, gemini]
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Warehouse Analysis
|
|
15
|
+
|
|
16
|
+
## Overview
|
|
17
|
+
|
|
18
|
+
Use this skill to turn a business question into a careful, reproducible warehouse-analysis plan. It is vendor-neutral and assumes no particular schema, semantic layer, connector, or command-line tool.
|
|
19
|
+
|
|
20
|
+
The skill defaults to read-only work. It helps identify the data needed, review a proposed query, and communicate results without overstating what the evidence supports.
|
|
21
|
+
|
|
22
|
+
## When to Use
|
|
23
|
+
|
|
24
|
+
- The user wants to answer a business question using an authorized data warehouse.
|
|
25
|
+
- A proposed SQL query needs a review for grain, joins, filters, privacy, or interpretation risks.
|
|
26
|
+
- An analysis needs a clear record of scope, freshness, assumptions, and source tables.
|
|
27
|
+
|
|
28
|
+
Do not use this skill for warehouse administration, pipeline repair, access escalation, schema mutation, or production data changes.
|
|
29
|
+
|
|
30
|
+
## Required Inputs
|
|
31
|
+
|
|
32
|
+
Before proposing a query, establish:
|
|
33
|
+
|
|
34
|
+
1. The decision or question the analysis should inform.
|
|
35
|
+
2. The population, metric, dimensions, and time window.
|
|
36
|
+
3. The authorized warehouse or query interface available to the user.
|
|
37
|
+
4. The relevant schema documentation or table metadata.
|
|
38
|
+
5. Any privacy, retention, regional, or minimum-group-size constraints.
|
|
39
|
+
|
|
40
|
+
If a required input is missing, ask a focused question. Never invent table names, column names, business definitions, credentials, or query results.
|
|
41
|
+
|
|
42
|
+
## Workflow
|
|
43
|
+
|
|
44
|
+
### 1. Define the analytical contract
|
|
45
|
+
|
|
46
|
+
Restate the request as:
|
|
47
|
+
|
|
48
|
+
- **Question:** what is being measured or compared.
|
|
49
|
+
- **Population:** which entities are included and excluded.
|
|
50
|
+
- **Metric:** numerator, denominator, aggregation, and unit.
|
|
51
|
+
- **Window:** dates, timezone, and whether the period is complete.
|
|
52
|
+
- **Decision:** how the result will be used.
|
|
53
|
+
|
|
54
|
+
Call out ambiguous terms such as “active,” “customer,” “revenue,” or “last month.” Resolve ambiguity before querying.
|
|
55
|
+
|
|
56
|
+
### 2. Find governed sources
|
|
57
|
+
|
|
58
|
+
Prefer documented metrics, curated models, and governed tables over raw event streams. Use only schema information supplied by the user or available through an authorized interface.
|
|
59
|
+
|
|
60
|
+
For each proposed source, record:
|
|
61
|
+
|
|
62
|
+
- table or model name;
|
|
63
|
+
- expected grain and primary key;
|
|
64
|
+
- freshness or maximum available date;
|
|
65
|
+
- owner or documentation reference;
|
|
66
|
+
- known exclusions and quality warnings.
|
|
67
|
+
|
|
68
|
+
If the source cannot be verified, label the plan as provisional and stop before presenting numerical conclusions.
|
|
69
|
+
|
|
70
|
+
### 3. Draft a read-only query
|
|
71
|
+
|
|
72
|
+
Create a query only when the real schema is known. The query should:
|
|
73
|
+
|
|
74
|
+
- select only the columns needed for the stated question;
|
|
75
|
+
- filter the requested time window explicitly;
|
|
76
|
+
- use qualified column names and deterministic joins;
|
|
77
|
+
- guard division by zero and null-sensitive calculations;
|
|
78
|
+
- avoid row-level personal data when an aggregate answers the question;
|
|
79
|
+
- include a conservative row limit for exploratory output when appropriate.
|
|
80
|
+
|
|
81
|
+
Do not emit guessed SQL with fictional identifiers. If no authorized execution tool is available, provide the reviewed query for the user to run rather than claiming it was executed.
|
|
82
|
+
|
|
83
|
+
### 4. Review before execution
|
|
84
|
+
|
|
85
|
+
Check the proposed query against this list:
|
|
86
|
+
|
|
87
|
+
- Does every join preserve the intended grain?
|
|
88
|
+
- Can a one-to-many join duplicate the numerator or denominator?
|
|
89
|
+
- Are test, deleted, internal, or incomplete records handled deliberately?
|
|
90
|
+
- Are timezone boundaries and partial periods explicit?
|
|
91
|
+
- Does the query expose identifiers or small groups unnecessarily?
|
|
92
|
+
- Would a simpler aggregate answer reduce data access?
|
|
93
|
+
- Are metric definitions consistent with the documented source?
|
|
94
|
+
|
|
95
|
+
Revise any failed check before execution. For sensitive or high-impact decisions, ask for review by the data owner or another qualified analyst.
|
|
96
|
+
|
|
97
|
+
### 5. Execute only with authorization
|
|
98
|
+
|
|
99
|
+
Run a query only through a user-authorized, read-only interface. Do not request credentials in chat, bypass access controls, broaden permissions, or turn a read-only task into a write operation.
|
|
100
|
+
|
|
101
|
+
Stop if the interface is unavailable, the scope exceeds the user's authorization, or the result would reveal restricted personal or confidential data.
|
|
102
|
+
|
|
103
|
+
### 6. Validate the result
|
|
104
|
+
|
|
105
|
+
Before interpreting output:
|
|
106
|
+
|
|
107
|
+
- compare row counts and totals with a trusted reference when one exists;
|
|
108
|
+
- inspect null rates, duplicates, and unexpected categories;
|
|
109
|
+
- test whether conclusions change under reasonable window or filter choices;
|
|
110
|
+
- separate observed values from hypotheses about their causes.
|
|
111
|
+
|
|
112
|
+
Do not infer causality from a descriptive query. Do not hide contradictory or incomplete evidence.
|
|
113
|
+
|
|
114
|
+
### 7. Report with provenance
|
|
115
|
+
|
|
116
|
+
Use a compact result structure:
|
|
117
|
+
|
|
118
|
+
```text
|
|
119
|
+
Finding: [what the data shows]
|
|
120
|
+
Scope: [population and period]
|
|
121
|
+
Method: [metric and source summary]
|
|
122
|
+
Confidence: [high, medium, or low, with reason]
|
|
123
|
+
Caveats: [freshness, exclusions, quality, or privacy limits]
|
|
124
|
+
Next step: [optional validation or decision input]
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Include the query or a reproducible query summary when disclosure is appropriate. Redact secrets, credentials, and unnecessary row-level data.
|
|
128
|
+
|
|
129
|
+
## Example
|
|
130
|
+
|
|
131
|
+
**Request:** “Did weekly activated accounts improve after the onboarding change?”
|
|
132
|
+
|
|
133
|
+
**Safe response plan:**
|
|
134
|
+
|
|
135
|
+
1. Clarify the activation definition, rollout date, eligible population, timezone, and comparison window.
|
|
136
|
+
2. Locate the governed activation metric and account cohort source.
|
|
137
|
+
3. Aggregate weekly counts or rates without selecting account-level identifiers.
|
|
138
|
+
4. Review cohort overlap, partial weeks, seasonality, and join duplication.
|
|
139
|
+
5. Report the observed change as an association, with confidence and caveats, not as proof of causation.
|
|
140
|
+
|
|
141
|
+
## Security & Safety Notes
|
|
142
|
+
|
|
143
|
+
- Treat warehouse contents and schema metadata as confidential unless the user establishes otherwise.
|
|
144
|
+
- Use least privilege and read-only access; never modify tables, permissions, pipelines, or production configuration.
|
|
145
|
+
- Minimize personal data and aggregate results whenever possible.
|
|
146
|
+
- Never place credentials, tokens, connection strings, or raw sensitive records in prompts or reports.
|
|
147
|
+
- Stop and escalate to the data owner when policy, authorization, or disclosure boundaries are unclear.
|
|
148
|
+
|
|
149
|
+
## Limitations
|
|
150
|
+
|
|
151
|
+
- This skill cannot discover an undocumented schema or verify a result without an authorized data source.
|
|
152
|
+
- It does not replace organization-specific metric definitions, privacy policy, or expert review.
|
|
153
|
+
- It does not diagnose pipelines, administer warehouses, or make product and business decisions.
|
|
154
|
+
- Conclusions remain limited by source quality, freshness, sampling, and the analytical design.
|