hatch3r 1.7.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -12
- package/agents/hatch3r-a11y-auditor.md +4 -0
- package/agents/hatch3r-architect.md +4 -0
- package/agents/hatch3r-ci-watcher.md +4 -0
- package/agents/hatch3r-context-rules.md +26 -6
- package/agents/hatch3r-creator.md +6 -1
- package/agents/hatch3r-dependency-auditor.md +4 -0
- package/agents/hatch3r-devops.md +4 -0
- package/agents/hatch3r-docs-writer.md +4 -0
- package/agents/hatch3r-fixer.md +4 -0
- package/agents/hatch3r-handoff-loader.md +243 -0
- package/agents/hatch3r-handoff-preparer.md +134 -0
- package/agents/hatch3r-implementer.md +12 -0
- package/agents/hatch3r-learnings-loader.md +5 -1
- package/agents/hatch3r-lint-fixer.md +4 -0
- package/agents/hatch3r-perf-profiler.md +8 -0
- package/agents/hatch3r-researcher.md +4 -0
- package/agents/hatch3r-reviewer.md +94 -0
- package/agents/hatch3r-security-auditor.md +24 -0
- package/agents/hatch3r-test-writer.md +4 -0
- package/agents/modes/requirements-elicitation.md +4 -1
- package/agents/modes/similar-implementation.md +6 -0
- package/agents/modes/user-flows.md +76 -0
- package/agents/shared/quality-charter.md +128 -0
- package/agents/shared/user-content-templates.md +31 -1
- package/commands/hatch3r-agent-customize.md +4 -0
- package/commands/hatch3r-api-spec.md +7 -0
- package/commands/hatch3r-benchmark.md +7 -0
- package/commands/hatch3r-board-fill.md +8 -0
- package/commands/hatch3r-board-groom.md +4 -0
- package/commands/hatch3r-board-init.md +51 -0
- package/commands/hatch3r-board-pickup.md +8 -0
- package/commands/hatch3r-board-refresh.md +4 -0
- package/commands/hatch3r-board-shared.md +6 -6
- package/commands/hatch3r-bug-plan.md +7 -0
- package/commands/hatch3r-codebase-map.md +8 -0
- package/commands/hatch3r-command-customize.md +4 -0
- package/commands/hatch3r-context-health.md +5 -0
- package/commands/hatch3r-create.md +59 -4
- package/commands/hatch3r-debug.md +7 -0
- package/commands/hatch3r-dep-audit.md +4 -0
- package/commands/hatch3r-feature-plan.md +7 -0
- package/commands/hatch3r-handoff.md +133 -0
- package/commands/hatch3r-healthcheck.md +4 -0
- package/commands/hatch3r-hooks.md +4 -0
- package/commands/hatch3r-learn.md +16 -0
- package/commands/hatch3r-migration-plan.md +7 -0
- package/commands/hatch3r-onboard.md +7 -0
- package/commands/hatch3r-pr-resolve.md +12 -1
- package/commands/hatch3r-project-spec.md +8 -0
- package/commands/hatch3r-quick-change.md +11 -2
- package/commands/hatch3r-recipe.md +4 -0
- package/commands/hatch3r-refactor-plan.md +7 -0
- package/commands/hatch3r-release.md +5 -0
- package/commands/hatch3r-revision.md +7 -0
- package/commands/hatch3r-roadmap.md +8 -0
- package/commands/hatch3r-rule-customize.md +4 -0
- package/commands/hatch3r-security-audit.md +4 -0
- package/commands/hatch3r-skill-customize.md +4 -0
- package/commands/hatch3r-test-plan.md +7 -0
- package/commands/hatch3r-workflow.md +11 -1
- package/dist/cli/index.js +4814 -1130
- package/dist/cli/index.js.map +1 -1
- package/package.json +10 -5
- package/rules/hatch3r-accessibility-standards.md +21 -0
- package/rules/hatch3r-accessibility-standards.mdc +21 -0
- package/rules/hatch3r-agent-orchestration-detail.md +3 -0
- package/rules/hatch3r-agent-orchestration-detail.mdc +3 -0
- package/rules/hatch3r-agent-orchestration.md +34 -3
- package/rules/hatch3r-agent-orchestration.mdc +34 -3
- package/rules/hatch3r-ai-evals.md +158 -0
- package/rules/hatch3r-ai-evals.mdc +154 -0
- package/rules/hatch3r-ai-ux-patterns.md +131 -0
- package/rules/hatch3r-ai-ux-patterns.mdc +127 -0
- package/rules/hatch3r-api-design.md +67 -9
- package/rules/hatch3r-api-design.mdc +67 -9
- package/rules/hatch3r-api-versioning.md +119 -0
- package/rules/hatch3r-api-versioning.mdc +115 -0
- package/rules/hatch3r-auth-patterns.md +170 -0
- package/rules/hatch3r-auth-patterns.mdc +166 -0
- package/rules/hatch3r-component-conventions.md +30 -0
- package/rules/hatch3r-component-conventions.mdc +30 -0
- package/rules/hatch3r-container-hardening.md +131 -0
- package/rules/hatch3r-container-hardening.mdc +127 -0
- package/rules/hatch3r-contract-testing.md +117 -0
- package/rules/hatch3r-contract-testing.mdc +113 -0
- package/rules/hatch3r-deep-context.md +2 -0
- package/rules/hatch3r-deep-context.mdc +2 -0
- package/rules/hatch3r-dependency-management.md +73 -1
- package/rules/hatch3r-dependency-management.mdc +72 -0
- package/rules/hatch3r-design-system-detection.md +142 -0
- package/rules/hatch3r-design-system-detection.mdc +138 -0
- package/rules/hatch3r-event-schema-evolution.md +90 -0
- package/rules/hatch3r-event-schema-evolution.mdc +86 -0
- package/rules/hatch3r-handoff-readiness.md +45 -0
- package/rules/hatch3r-handoff-readiness.mdc +40 -0
- package/rules/hatch3r-i18n.md +13 -0
- package/rules/hatch3r-i18n.mdc +13 -0
- package/rules/hatch3r-iteration-summary.md +2 -0
- package/rules/hatch3r-iteration-summary.mdc +2 -0
- package/rules/hatch3r-migrations.md +61 -16
- package/rules/hatch3r-migrations.mdc +61 -16
- package/rules/hatch3r-observability-logging.md +1 -1
- package/rules/hatch3r-observability-logging.mdc +1 -1
- package/rules/hatch3r-observability-metrics.md +1 -1
- package/rules/hatch3r-observability-metrics.mdc +1 -1
- package/rules/hatch3r-observability-tracing-detail.md +8 -149
- package/rules/hatch3r-observability-tracing-detail.mdc +7 -149
- package/rules/hatch3r-observability-tracing.md +154 -6
- package/rules/hatch3r-observability-tracing.mdc +154 -6
- package/rules/hatch3r-observability.md +1 -0
- package/rules/hatch3r-observability.mdc +1 -0
- package/rules/hatch3r-operability.md +149 -0
- package/rules/hatch3r-operability.mdc +145 -0
- package/rules/hatch3r-passkey-server.md +181 -0
- package/rules/hatch3r-passkey-server.mdc +177 -0
- package/rules/hatch3r-progressive-delivery.md +120 -0
- package/rules/hatch3r-progressive-delivery.mdc +116 -0
- package/rules/hatch3r-resilience-patterns.md +154 -0
- package/rules/hatch3r-resilience-patterns.mdc +150 -0
- package/rules/hatch3r-secrets-management.md +29 -0
- package/rules/hatch3r-secrets-management.mdc +29 -0
- package/rules/hatch3r-testing.md +139 -43
- package/rules/hatch3r-testing.mdc +139 -43
- package/rules/hatch3r-ux-states-and-flows.md +149 -0
- package/rules/hatch3r-ux-states-and-flows.mdc +145 -0
- package/skills/hatch3r-a11y-audit/SKILL.md +14 -0
- package/skills/hatch3r-agent-customize/SKILL.md +10 -0
- package/skills/hatch3r-ai-feature/SKILL.md +136 -0
- package/skills/hatch3r-api-spec/SKILL.md +73 -0
- package/skills/hatch3r-architecture-review/SKILL.md +14 -0
- package/skills/hatch3r-bug-fix/SKILL.md +5 -0
- package/skills/hatch3r-ci-pipeline/SKILL.md +14 -0
- package/skills/hatch3r-cli-aichat/SKILL.md +84 -0
- package/skills/hatch3r-cli-ast-grep/SKILL.md +85 -0
- package/skills/hatch3r-cli-az-devops/SKILL.md +89 -0
- package/skills/hatch3r-cli-bat/SKILL.md +85 -0
- package/skills/hatch3r-cli-comby/SKILL.md +85 -0
- package/skills/hatch3r-cli-csvkit/SKILL.md +84 -0
- package/skills/hatch3r-cli-delta/SKILL.md +86 -0
- package/skills/hatch3r-cli-difftastic/SKILL.md +84 -0
- package/skills/hatch3r-cli-docker/SKILL.md +89 -0
- package/skills/hatch3r-cli-duckdb/SKILL.md +84 -0
- package/skills/hatch3r-cli-fd/SKILL.md +85 -0
- package/skills/hatch3r-cli-fzf/SKILL.md +84 -0
- package/skills/hatch3r-cli-gh/SKILL.md +90 -0
- package/skills/hatch3r-cli-glab/SKILL.md +89 -0
- package/skills/hatch3r-cli-jq/SKILL.md +89 -0
- package/skills/hatch3r-cli-lazygit/SKILL.md +78 -0
- package/skills/hatch3r-cli-llm/SKILL.md +84 -0
- package/skills/hatch3r-cli-miller/SKILL.md +84 -0
- package/skills/hatch3r-cli-mods/SKILL.md +84 -0
- package/skills/hatch3r-cli-overview/SKILL.md +60 -0
- package/skills/hatch3r-cli-playwright/SKILL.md +89 -0
- package/skills/hatch3r-cli-podman/SKILL.md +84 -0
- package/skills/hatch3r-cli-qsv/SKILL.md +91 -0
- package/skills/hatch3r-cli-ripgrep/SKILL.md +85 -0
- package/skills/hatch3r-cli-rtk/SKILL.md +91 -0
- package/skills/hatch3r-cli-sd/SKILL.md +85 -0
- package/skills/hatch3r-cli-stagehand/SKILL.md +111 -0
- package/skills/hatch3r-cli-taplo/SKILL.md +84 -0
- package/skills/hatch3r-cli-yq/SKILL.md +85 -0
- package/skills/hatch3r-cli-zstd/SKILL.md +85 -0
- package/skills/hatch3r-command-customize/SKILL.md +10 -0
- package/skills/hatch3r-context-health/SKILL.md +14 -0
- package/skills/hatch3r-cost-tracking/SKILL.md +14 -0
- package/skills/hatch3r-customize/SKILL.md +17 -0
- package/skills/hatch3r-dep-audit/SKILL.md +14 -0
- package/skills/hatch3r-design-system-detect/SKILL.md +164 -0
- package/skills/hatch3r-feature/SKILL.md +2 -0
- package/skills/hatch3r-gh-agentic-workflows/SKILL.md +13 -0
- package/skills/hatch3r-handoff-prepare/SKILL.md +160 -0
- package/skills/hatch3r-handoff-resume/SKILL.md +171 -0
- package/skills/hatch3r-incident-response/SKILL.md +14 -0
- package/skills/hatch3r-issue-workflow/SKILL.md +5 -0
- package/skills/hatch3r-logical-refactor/SKILL.md +14 -0
- package/skills/hatch3r-migration/SKILL.md +14 -0
- package/skills/hatch3r-observability-verify/SKILL.md +134 -0
- package/skills/hatch3r-perf-audit/SKILL.md +14 -0
- package/skills/hatch3r-pr-creation/SKILL.md +14 -0
- package/skills/hatch3r-qa-validation/SKILL.md +18 -0
- package/skills/hatch3r-recipe/SKILL.md +14 -0
- package/skills/hatch3r-refactor/SKILL.md +14 -0
- package/skills/hatch3r-release/SKILL.md +14 -0
- package/skills/hatch3r-reliability-verify/SKILL.md +146 -0
- package/skills/hatch3r-rule-customize/SKILL.md +10 -0
- package/skills/hatch3r-skill-customize/SKILL.md +10 -0
- package/skills/hatch3r-ui-ux-verify/SKILL.md +138 -0
- package/skills/hatch3r-visual-refactor/SKILL.md +15 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hatch3r-cli-stagehand
|
|
3
|
+
description: "Browserbase Stagehand — AI-driven browser automation. Use when natural-language browser steering with on-the-fly DOM reasoning; invoke `stagehand`. Wraps Browserbase Stagehand so prompts decide which DOM nodes to inspect or click."
|
|
4
|
+
tags: ["cli-tools", "browser", "opt-in"]
|
|
5
|
+
quality_charter: agents/shared/quality-charter.md
|
|
6
|
+
efficiency_patterns: agents/shared/efficiency-patterns.md
|
|
7
|
+
cache_friendly: true
|
|
8
|
+
cli_tool:
|
|
9
|
+
id: stagehand
|
|
10
|
+
bin: stagehand
|
|
11
|
+
tier: 3
|
|
12
|
+
category: browser
|
|
13
|
+
homepage: https://github.com/browserbase/stagehand
|
|
14
|
+
---
|
|
15
|
+
<!-- HATCH3R-CLI-SKILL-GENERATED v1 -->
|
|
16
|
+
# stagehand
|
|
17
|
+
|
|
18
|
+
Browserbase Stagehand — AI-driven browser automation
|
|
19
|
+
|
|
20
|
+
## When to Use
|
|
21
|
+
|
|
22
|
+
Reach for `stagehand` when the task is in the **browser** category and the agent would otherwise call an MCP tool or read large outputs into context. v3 (released 2025-10-29) operates directly on the Chrome DevTools Protocol — choose Stagehand when the target page changes shape often enough that hand-written selectors break, or when a prompt is the most compact spec of intent.
|
|
23
|
+
|
|
24
|
+
## Token Cost
|
|
25
|
+
|
|
26
|
+
CLI tools return structured stdout that fits in <1KB for typical queries; equivalent MCP calls regularly exceed 10KB.
|
|
27
|
+
Reference: Anthropic engineering (Nov 4 2025) — code-execution-over-MCP yields 98.7% token reduction.
|
|
28
|
+
|
|
29
|
+
## v3 Driver Model
|
|
30
|
+
|
|
31
|
+
v3 dropped the hard Playwright dependency and exposes a modular driver layer. Pick the driver that matches the host environment:
|
|
32
|
+
|
|
33
|
+
- **CDP-native (default):** Stagehand talks Chrome DevTools Protocol directly — no test-runner dependency, smallest install, Bun-compatible.
|
|
34
|
+
- **Playwright peer:** install `playwright-core` alongside Stagehand to reuse existing Playwright fixtures, traces, or `@playwright/test` reporters.
|
|
35
|
+
- **Puppeteer peer:** install `puppeteer-core` to share a launcher with existing Puppeteer scripts.
|
|
36
|
+
- **Patchright peer:** install `patchright-core` for stealth-patched CDP profiles.
|
|
37
|
+
|
|
38
|
+
`playwright-core`, `puppeteer-core`, and `patchright-core` are peer dependencies in v3 — install only the driver you use.
|
|
39
|
+
|
|
40
|
+
## Recipes
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npx create-browser-app
|
|
44
|
+
```
|
|
45
|
+
Scaffold a v3 Stagehand project with TypeScript wiring, a `stagehand.config.ts`, and an example `act`/`extract`/`observe` script. Replaces the v2 `npx stagehand init` workflow.
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
node scripts/login.ts
|
|
49
|
+
```
|
|
50
|
+
Execute an AI-driven action script. The script imports `Stagehand` from `@browserbasehq/stagehand`, calls `stagehand.act("click the login button")`, and Stagehand resolves the action at runtime via CDP — no test runner required.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx browse get markdown https://example.com
|
|
54
|
+
```
|
|
55
|
+
One-shot page extraction via `browse-cli` (v0.6+). Returns structured Markdown the agent can consume directly; cheaper than spawning a full Stagehand session for a single read.
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx browse cdp wss://browser.example.com
|
|
59
|
+
```
|
|
60
|
+
Attach to an existing CDP endpoint (Browserbase managed session, local Chrome, or a custom launcher). Useful when the script delegates browser lifecycle to another supervisor.
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
// scripts/observe.ts — observe primitive returns actions without executing
|
|
64
|
+
import { Stagehand } from "@browserbasehq/stagehand";
|
|
65
|
+
const stagehand = new Stagehand({ env: "LOCAL" });
|
|
66
|
+
await stagehand.init();
|
|
67
|
+
const actions = await stagehand.observe("find the login form");
|
|
68
|
+
console.log(JSON.stringify(actions, null, 2));
|
|
69
|
+
await stagehand.close();
|
|
70
|
+
```
|
|
71
|
+
Dry-run agent loop: `observe` returns the candidate action set without performing it, so a caller can route the decision (execute, ask the user, or reject).
|
|
72
|
+
|
|
73
|
+
## Wrong Choice When
|
|
74
|
+
|
|
75
|
+
- **High-volume scraping at scale:** Stagehand's per-action LLM round-trip is cost-prohibitive past a few hundred pages — use the Browserbase managed-browser product, raw CDP with cached locators (v3's `deepLocator`), or Stagehand's action cache once a workflow is recorded as a deterministic script.
|
|
76
|
+
- **Headless CI in air-gapped environments:** Stagehand requires outbound LLM API access for selector resolution; offline environments fail the `act`/`extract`/`observe` calls. Pre-record actions with v3's automatic action cache, then replay the cached deterministic script in the air-gapped runner.
|
|
77
|
+
- **Workflows already covered by a stable test suite:** if Playwright tests with hand-tuned locators already pass green, Stagehand adds an LLM round-trip per step with no behavioural gain. Use `hatch3r-cli-playwright` (tier 2) for the test surface; reserve Stagehand for the agent-driven exploratory flows.
|
|
78
|
+
|
|
79
|
+
## Alternatives
|
|
80
|
+
|
|
81
|
+
| Tool | When to prefer |
|
|
82
|
+
|------|----------------|
|
|
83
|
+
| `hatch3r-cli-playwright` (tier 2) | Existing test fixtures, deterministic CI, no LLM round-trips needed |
|
|
84
|
+
| Browserbase managed browsers | Production scale, session recording, anti-bot evasion, CAPTCHA solving |
|
|
85
|
+
| Stagehand action cache (built into v3) | Same workflow re-run many times — record once, replay deterministically |
|
|
86
|
+
| Skyvern / Browser-Use | Workflow-style automation with embedded LLM agents and built-in task loops |
|
|
87
|
+
|
|
88
|
+
## Detection / Install
|
|
89
|
+
|
|
90
|
+
Verify with:
|
|
91
|
+
```bash
|
|
92
|
+
command -v stagehand
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Install (mac):
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# npm — v3 (Oct 29 2025); drivers are peer deps, install only what you use
|
|
99
|
+
npm install -g @browserbasehq/stagehand
|
|
100
|
+
# Add a driver only if you need Playwright/Puppeteer/Patchright interop:
|
|
101
|
+
# npm install -g playwright-core # OR
|
|
102
|
+
# npm install -g puppeteer-core # OR
|
|
103
|
+
# npm install -g patchright-core
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
References:
|
|
107
|
+
- v3 release announcement (2025-10-29): https://www.browserbase.com/blog/stagehand-v3
|
|
108
|
+
- Latest npm releases: https://github.com/browserbase/stagehand/releases
|
|
109
|
+
- v3 docs: https://docs.stagehand.dev/v3/get_started/introduction
|
|
110
|
+
|
|
111
|
+
Homepage: https://github.com/browserbase/stagehand
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hatch3r-cli-taplo
|
|
3
|
+
description: "TOML toolkit (format, lint, query) for pyproject.toml / Cargo.toml. Use when formatting and linting pyproject.toml or Cargo.toml manifests; invoke `taplo`. Preserves YAML anchors, comments, and ordering when editing in place."
|
|
4
|
+
tags: ["cli-tools", "yaml"]
|
|
5
|
+
quality_charter: agents/shared/quality-charter.md
|
|
6
|
+
efficiency_patterns: agents/shared/efficiency-patterns.md
|
|
7
|
+
cache_friendly: true
|
|
8
|
+
cli_tool:
|
|
9
|
+
id: taplo
|
|
10
|
+
bin: taplo
|
|
11
|
+
tier: 2
|
|
12
|
+
category: yaml
|
|
13
|
+
homepage: https://taplo.tamasfe.dev/
|
|
14
|
+
---
|
|
15
|
+
<!-- HATCH3R-CLI-SKILL-GENERATED v1 -->
|
|
16
|
+
# taplo
|
|
17
|
+
|
|
18
|
+
TOML toolkit (format, lint, query) for pyproject.toml / Cargo.toml
|
|
19
|
+
|
|
20
|
+
## When to Use
|
|
21
|
+
|
|
22
|
+
Reach for `taplo` when the task is in the **yaml** category and the agent would otherwise call an MCP tool or read large outputs into context.
|
|
23
|
+
|
|
24
|
+
## Token Cost
|
|
25
|
+
|
|
26
|
+
CLI tools return structured stdout that fits in <1KB for typical queries; equivalent MCP calls regularly exceed 10KB.
|
|
27
|
+
Reference: Anthropic engineering (Nov 4 2025) — code-execution-over-MCP yields 98.7% token reduction.
|
|
28
|
+
|
|
29
|
+
## Recipes
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
taplo fmt
|
|
33
|
+
```
|
|
34
|
+
Format every TOML file under the cwd in-place; idempotent — safe to run in pre-commit.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
taplo fmt --check
|
|
38
|
+
```
|
|
39
|
+
Exit non-zero if any TOML file would change; CI-friendly drift detector.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
taplo lint
|
|
43
|
+
```
|
|
44
|
+
Surface syntax and schema-violation diagnostics; works with bundled schemas for `Cargo.toml`, `pyproject.toml`.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
taplo get -f Cargo.toml package.version
|
|
48
|
+
```
|
|
49
|
+
Extract a single TOML value as plain stdout — replaces a multi-line `grep`/`sed` recipe.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
taplo get -f pyproject.toml -o json 'project.dependencies'
|
|
53
|
+
```
|
|
54
|
+
Emit the value as JSON for piping into `jq` — keeps quoting unambiguous.
|
|
55
|
+
|
|
56
|
+
## Wrong Choice When
|
|
57
|
+
|
|
58
|
+
- The project has no TOML files (pure YAML/JSON config) — skip entirely; use `yq` for YAML, `jq` for JSON.
|
|
59
|
+
- You are converting TOML to YAML/JSON as the goal — `yq` or `dasel` handle multi-format conversion in one binary.
|
|
60
|
+
- The TOML lives inside a templating system (Jinja/Handlebars) — render the template first, then run `taplo` on the output.
|
|
61
|
+
|
|
62
|
+
## Alternatives
|
|
63
|
+
|
|
64
|
+
| Tool | When to prefer |
|
|
65
|
+
|------|----------------|
|
|
66
|
+
| `yq` | Mixed YAML/TOML/JSON; want a single multi-format query tool. |
|
|
67
|
+
| `dasel` | Same as `yq` plus XML; cross-format updates. |
|
|
68
|
+
| `grep` + `sed` | A single value lookup in a script with no `taplo` dependency available. |
|
|
69
|
+
|
|
70
|
+
## Detection / Install
|
|
71
|
+
|
|
72
|
+
Verify with:
|
|
73
|
+
```bash
|
|
74
|
+
command -v taplo
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Install (mac):
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# brew
|
|
81
|
+
brew install taplo
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Homepage: https://taplo.tamasfe.dev/
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hatch3r-cli-yq
|
|
3
|
+
description: "YAML processor (mikefarah Go implementation). Use when editing Kubernetes manifests, Helm values, or GitHub-Actions workflows in place; invoke `yq`. Preserves YAML anchors, comments, and ordering when editing in place."
|
|
4
|
+
tags: ["cli-tools", "yaml", "core"]
|
|
5
|
+
quality_charter: agents/shared/quality-charter.md
|
|
6
|
+
efficiency_patterns: agents/shared/efficiency-patterns.md
|
|
7
|
+
cache_friendly: true
|
|
8
|
+
cli_tool:
|
|
9
|
+
id: yq
|
|
10
|
+
bin: yq
|
|
11
|
+
tier: 1
|
|
12
|
+
category: yaml
|
|
13
|
+
homepage: https://github.com/mikefarah/yq
|
|
14
|
+
---
|
|
15
|
+
<!-- HATCH3R-CLI-SKILL-GENERATED v1 -->
|
|
16
|
+
# yq
|
|
17
|
+
|
|
18
|
+
YAML processor (mikefarah Go implementation)
|
|
19
|
+
|
|
20
|
+
## When to Use
|
|
21
|
+
|
|
22
|
+
Reach for `yq` when the task is in the **yaml** category and the agent would otherwise call an MCP tool or read large outputs into context.
|
|
23
|
+
|
|
24
|
+
## Token Cost
|
|
25
|
+
|
|
26
|
+
CLI tools return structured stdout that fits in <1KB for typical queries; equivalent MCP calls regularly exceed 10KB.
|
|
27
|
+
Reference: Anthropic engineering (Nov 4 2025) — code-execution-over-MCP yields 98.7% token reduction.
|
|
28
|
+
|
|
29
|
+
## Recipes
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
yq '.spec.containers[].image' k8s/deployment.yml
|
|
33
|
+
```
|
|
34
|
+
Project every container image across multi-doc Kubernetes manifests — same path syntax as `jq`.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
yq -i '.version = "1.7.5"' .agents/hatch.json
|
|
38
|
+
```
|
|
39
|
+
In-place edit (`-i`) — single-shot version bumps without shelling out to a templating step.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
yq -o=json '.' config.yml | jq '.servers | length'
|
|
43
|
+
```
|
|
44
|
+
Convert YAML to JSON on the wire so `jq` can take over for richer querying.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
yq eval-all '. as $i ireduce ({}; . * $i)' base.yml override.yml
|
|
48
|
+
```
|
|
49
|
+
Deep-merge multiple YAML documents into one — pattern for layered config (base + env override).
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
yq -P -i '.tags |= sort | .' content.yml
|
|
53
|
+
```
|
|
54
|
+
Pretty-print preservation (`-P`) keeps comments/anchors stable while sorting the `tags` array in place.
|
|
55
|
+
|
|
56
|
+
## Wrong Choice When
|
|
57
|
+
|
|
58
|
+
- Don't assume `yq` flags work when the binary is actually the Python `kislyuk/yq` wrapper around jq — flags and filter dialect differ. Confirm `yq --version` reports `mikefarah` first; otherwise reach for `python-yq` documentation or install the Go build.
|
|
59
|
+
- Don't expect round-trip comment preservation without the `-P` (pretty) output mode; default JSON-style output drops comments. Reach for `yq -P` or `taplo` for TOML.
|
|
60
|
+
- Don't use `yq` on Kubernetes manifests when you actually need schema-aware validation. Reach for `kubectl explain` / `kubeconform` and use `yq` only for projection.
|
|
61
|
+
|
|
62
|
+
## Alternatives
|
|
63
|
+
|
|
64
|
+
| Tool | When to prefer |
|
|
65
|
+
|------|----------------|
|
|
66
|
+
| `jq` (`hatch3r-cli-jq`) | JSON input, or YAML converted via `yq -o=json` — jq's filter language has more rebuild idioms. |
|
|
67
|
+
| `dasel` | Multi-format (JSON/YAML/TOML/XML) single-binary path queries in CI. |
|
|
68
|
+
| `taplo` | TOML-specific formatting and schema validation (`pyproject.toml`, `Cargo.toml`). |
|
|
69
|
+
| `kubectl explain` | Kubernetes-resource schema lookup — `yq` projects, kubectl explains. |
|
|
70
|
+
|
|
71
|
+
## Detection / Install
|
|
72
|
+
|
|
73
|
+
Verify with:
|
|
74
|
+
```bash
|
|
75
|
+
command -v yq
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Install (mac):
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# brew
|
|
82
|
+
brew install yq
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Homepage: https://github.com/mikefarah/yq
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hatch3r-cli-zstd
|
|
3
|
+
description: "Fast lossless compression with high ratio. Use when high-ratio compression with single-digit-millisecond decompress speeds; invoke `zstd`. Designed for cold-storage payloads and CI artifact upload/download steps."
|
|
4
|
+
tags: ["cli-tools", "archive", "core"]
|
|
5
|
+
quality_charter: agents/shared/quality-charter.md
|
|
6
|
+
efficiency_patterns: agents/shared/efficiency-patterns.md
|
|
7
|
+
cache_friendly: true
|
|
8
|
+
cli_tool:
|
|
9
|
+
id: zstd
|
|
10
|
+
bin: zstd
|
|
11
|
+
tier: 1
|
|
12
|
+
category: archive
|
|
13
|
+
homepage: https://github.com/facebook/zstd
|
|
14
|
+
---
|
|
15
|
+
<!-- HATCH3R-CLI-SKILL-GENERATED v1 -->
|
|
16
|
+
# zstd
|
|
17
|
+
|
|
18
|
+
Fast lossless compression with high ratio
|
|
19
|
+
|
|
20
|
+
## When to Use
|
|
21
|
+
|
|
22
|
+
Reach for `zstd` when the task is in the **archive** category and the agent would otherwise call an MCP tool or read large outputs into context.
|
|
23
|
+
|
|
24
|
+
## Token Cost
|
|
25
|
+
|
|
26
|
+
CLI tools return structured stdout that fits in <1KB for typical queries; equivalent MCP calls regularly exceed 10KB.
|
|
27
|
+
Reference: Anthropic engineering (Nov 4 2025) — code-execution-over-MCP yields 98.7% token reduction.
|
|
28
|
+
|
|
29
|
+
## Recipes
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
tar --zstd -cf bundle.tar.zst dist/ governance/
|
|
33
|
+
```
|
|
34
|
+
Stream `tar` through zstd in one shot — default level (~3) gives high-ratio archives an order of magnitude faster than gzip.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
tar --zstd -xf bundle.tar.zst -C /tmp/restore/
|
|
38
|
+
```
|
|
39
|
+
Extract a zstd-compressed tarball to a target directory — paired with the previous recipe for round-trip backup.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
zstd -19 -T0 huge.csv
|
|
43
|
+
```
|
|
44
|
+
Level 19 (near-max ratio) with `-T0` (all CPU threads) — appropriate for archival snapshots where compression time is fine.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pzstd --keep -d findings.tar.zst
|
|
48
|
+
```
|
|
49
|
+
Parallel decompression preserving the input (`--keep`) — fastest restore path for large `.zst` archives on multi-core hosts.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
zstd --train datasets/*.json -o dict.zstd && zstd -D dict.zstd payload.json
|
|
53
|
+
```
|
|
54
|
+
Train a dictionary from a sample corpus then compress with `-D dict.zstd` — wins when payloads share schema (logs, structured events).
|
|
55
|
+
|
|
56
|
+
## Wrong Choice When
|
|
57
|
+
|
|
58
|
+
- Don't use `zstd` for distribution where every byte of size matters and decompression speed does not. Reach for `xz` (`xz -9e`) — slower but tighter ratios for immutable releases.
|
|
59
|
+
- Don't ship a zstd archive to legacy Windows recipients without a bundled decoder; native support landed in Windows 11 but earlier hosts need 7-Zip 21.07+. Reach for `zip` for broadest compatibility.
|
|
60
|
+
- Don't reach for `zstd` to compress already-compressed payloads (JPEGs, MP4s, existing zips); ratios approach 1.0 and the CPU spend is wasted. Skip compression or use `tar -cf` with no codec.
|
|
61
|
+
|
|
62
|
+
## Alternatives
|
|
63
|
+
|
|
64
|
+
| Tool | When to prefer |
|
|
65
|
+
|------|----------------|
|
|
66
|
+
| `xz` | Immutable release artifacts where size is the dominant cost. |
|
|
67
|
+
| `gzip` | Universal compatibility — every UNIX-like system since 1992. |
|
|
68
|
+
| `zip` | Windows recipients without native `.zst` support; flat distribution archives. |
|
|
69
|
+
| `7z` | Heterogeneous payloads where xz-style LZMA2 plus per-file streaming beats both zstd and gzip. |
|
|
70
|
+
|
|
71
|
+
## Detection / Install
|
|
72
|
+
|
|
73
|
+
Verify with:
|
|
74
|
+
```bash
|
|
75
|
+
command -v zstd
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Install (mac):
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# brew
|
|
82
|
+
brew install zstd
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Homepage: https://github.com/facebook/zstd
|
|
@@ -5,9 +5,19 @@ tags: [customize]
|
|
|
5
5
|
quality_charter: agents/shared/quality-charter.md
|
|
6
6
|
efficiency_patterns: agents/shared/efficiency-patterns.md
|
|
7
7
|
cache_friendly: true
|
|
8
|
+
redirect_to: hatch3r-customize
|
|
8
9
|
---
|
|
9
10
|
# Command Customization
|
|
10
11
|
|
|
11
12
|
> **This skill has been consolidated.** Use the `hatch3r-customize` skill with `type: command`.
|
|
12
13
|
|
|
13
14
|
For command-specific reference (YAML schema, examples), see the `hatch3r-command-customize` command.
|
|
15
|
+
|
|
16
|
+
## Rejected Merge Alternative (D16.3 add-vs-remove bias)
|
|
17
|
+
|
|
18
|
+
Per `governance/audit/domains/D16-compound-system.md` SA 16.3, the default recommendation on functional overlap is MERGE rather than removal. Full deletion of this redirect file was rejected for two reasons:
|
|
19
|
+
|
|
20
|
+
1. **Preserves UX entry points.** Users typed `/h4tcher-command-customize` or referenced the id `hatch3r-command-customize` (per `commands/hatch3r-command-customize.md:2` and sibling redirects) before consolidation. Deleting the id breaks those entry points without a redirect target.
|
|
21
|
+
2. **Signals umbrella canonicality.** The `redirect_to: hatch3r-customize` frontmatter field marks `hatch3r-customize` as the single source of truth — tooling, audit scans, and adapters can resolve any redirect to the canonical without re-reading body prose.
|
|
22
|
+
|
|
23
|
+
The 13-LOC redirect cost is paid once per type; the umbrella body lives in `skills/hatch3r-customize/SKILL.md`.
|
|
@@ -12,12 +12,26 @@ cache_friendly: true
|
|
|
12
12
|
|
|
13
13
|
```
|
|
14
14
|
Task Progress:
|
|
15
|
+
- [ ] Step 0: Detect ambiguity (P8 B1)
|
|
15
16
|
- [ ] Step 1: Assess current context health
|
|
16
17
|
- [ ] Step 2: Identify degradation signals
|
|
17
18
|
- [ ] Step 3: Apply corrective action
|
|
18
19
|
- [ ] Step 4: Verify health improvement
|
|
19
20
|
```
|
|
20
21
|
|
|
22
|
+
## Step 0 — Detect Ambiguity (P8 B1)
|
|
23
|
+
|
|
24
|
+
Before any work, scan the invocation for unresolved questions in scope, intent, acceptance criteria, target environment, or irreversibility. If any are found, ask the user via the platform-native question tool per `agents/shared/user-question-protocol.md`. Do not proceed under silent assumption. Default path, not an exception. Triggers for THIS skill: original task recall, corrective action authority at Orange/Red (delegate vs checkpoint-and-stop), scope of files to re-read, whether to post progress to platform on Red, and irreversible stop (discard unsaved work) vs preserve.
|
|
25
|
+
|
|
26
|
+
## Fan-out Discipline (P8 B2)
|
|
27
|
+
|
|
28
|
+
This skill delegates per task size:
|
|
29
|
+
- Tier 1 (trivial single-file): inline execution acceptable.
|
|
30
|
+
- Tier 2 (multi-file or multi-concern): spawn parallel sub-agents per concern via the Task tool.
|
|
31
|
+
- Tier 3 (multi-module / high-risk): one fresh sub-agent per independent module or gate; orchestrator integrates only.
|
|
32
|
+
|
|
33
|
+
Never under-fan-out to save tokens. Token cost is dominated by quality and completeness gains. Emit `sub_agents_spawned: { count, rationale }` in your output.
|
|
34
|
+
|
|
21
35
|
## Step 1: Assess Context Health
|
|
22
36
|
|
|
23
37
|
Run through the self-assessment checklist:
|
|
@@ -12,12 +12,26 @@ cache_friendly: true
|
|
|
12
12
|
|
|
13
13
|
```
|
|
14
14
|
Task Progress:
|
|
15
|
+
- [ ] Step 0: Detect ambiguity (P8 B1)
|
|
15
16
|
- [ ] Step 1: Review cost tracking configuration
|
|
16
17
|
- [ ] Step 2: Estimate current session token usage
|
|
17
18
|
- [ ] Step 3: Identify cost optimization opportunities
|
|
18
19
|
- [ ] Step 4: Generate cost report
|
|
19
20
|
```
|
|
20
21
|
|
|
22
|
+
## Step 0 — Detect Ambiguity (P8 B1)
|
|
23
|
+
|
|
24
|
+
Before any work, scan the invocation for unresolved questions in scope, intent, acceptance criteria, target environment, or irreversibility. If any are found, ask the user via the platform-native question tool per `agents/shared/user-question-protocol.md`. Do not proceed under silent assumption. Default path, not an exception. Triggers for THIS skill: tracking scope (session vs issue vs epic), budget values when missing from hatch.json, hardStop authority (block vs warn), report format target, and whether to defer non-critical work over budget.
|
|
25
|
+
|
|
26
|
+
## Fan-out Discipline (P8 B2)
|
|
27
|
+
|
|
28
|
+
This skill delegates per task size:
|
|
29
|
+
- Tier 1 (trivial single-file): inline execution acceptable.
|
|
30
|
+
- Tier 2 (multi-file or multi-concern): spawn parallel sub-agents per concern via the Task tool.
|
|
31
|
+
- Tier 3 (multi-module / high-risk): one fresh sub-agent per independent module or gate; orchestrator integrates only.
|
|
32
|
+
|
|
33
|
+
Never under-fan-out to save tokens. Token cost is dominated by quality and completeness gains. Emit `sub_agents_spawned: { count, rationale }` in your output.
|
|
34
|
+
|
|
21
35
|
## Step 1: Review Configuration
|
|
22
36
|
|
|
23
37
|
1. Check `hatch.json` for a `costTracking` section.
|
|
@@ -5,13 +5,17 @@ tags: [customize]
|
|
|
5
5
|
quality_charter: agents/shared/quality-charter.md
|
|
6
6
|
efficiency_patterns: agents/shared/efficiency-patterns.md
|
|
7
7
|
cache_friendly: true
|
|
8
|
+
canonical_for: [hatch3r-agent-customize, hatch3r-command-customize, hatch3r-rule-customize, hatch3r-skill-customize]
|
|
8
9
|
---
|
|
9
10
|
# Artifact Customization Management
|
|
10
11
|
|
|
12
|
+
> **Canonical entry point.** Four type-specific skills (`hatch3r-agent-customize`, `hatch3r-command-customize`, `hatch3r-rule-customize`, `hatch3r-skill-customize`) redirect here via `redirect_to: hatch3r-customize` frontmatter. Their body documents the rejected-merge alternative per `governance/audit/domains/D16-compound-system.md` SA 16.3.
|
|
13
|
+
|
|
11
14
|
## Quick Start
|
|
12
15
|
|
|
13
16
|
```
|
|
14
17
|
Task Progress:
|
|
18
|
+
- [ ] Step 0: Detect ambiguity (P8 B1)
|
|
15
19
|
- [ ] Step 1: Identify what to customize (and why)
|
|
16
20
|
- [ ] Step 2: Determine customization needs
|
|
17
21
|
- [ ] Step 3: Multi-stakeholder review
|
|
@@ -20,6 +24,19 @@ Task Progress:
|
|
|
20
24
|
- [ ] Step 6: Verify the customized output
|
|
21
25
|
```
|
|
22
26
|
|
|
27
|
+
## Step 0 — Detect Ambiguity (P8 B1)
|
|
28
|
+
|
|
29
|
+
Before any work, scan the invocation for unresolved questions in scope, intent, acceptance criteria, target environment, or irreversibility. If any are found, ask the user via the platform-native question tool per `agents/shared/user-question-protocol.md`. Do not proceed under silent assumption. Default path, not an exception. Triggers for THIS skill: artifact type (agent vs command vs rule vs skill), target artifact id, whether disabling breaks a command pipeline dependency, scope narrowing for rules (and excluded glob patterns), and whether this customization should be an upstream contribution instead.
|
|
30
|
+
|
|
31
|
+
## Fan-out Discipline (P8 B2)
|
|
32
|
+
|
|
33
|
+
This skill delegates per task size:
|
|
34
|
+
- Tier 1 (trivial single-file): inline execution acceptable.
|
|
35
|
+
- Tier 2 (multi-file or multi-concern): spawn parallel sub-agents per concern via the Task tool.
|
|
36
|
+
- Tier 3 (multi-module / high-risk): one fresh sub-agent per independent module or gate; orchestrator integrates only.
|
|
37
|
+
|
|
38
|
+
Never under-fan-out to save tokens. Token cost is dominated by quality and completeness gains. Emit `sub_agents_spawned: { count, rationale }` in your output.
|
|
39
|
+
|
|
23
40
|
## Artifact Types
|
|
24
41
|
|
|
25
42
|
This skill handles customization for all artifact types. The `type` parameter determines file locations, available YAML fields, and verification steps.
|
|
@@ -14,6 +14,7 @@ cache_friendly: true
|
|
|
14
14
|
|
|
15
15
|
```
|
|
16
16
|
Task Progress:
|
|
17
|
+
- [ ] Step 0: Detect ambiguity (P8 B1)
|
|
17
18
|
- [ ] Step 1: Run npm audit + npm outdated, categorize findings
|
|
18
19
|
- [ ] Step 2: Research CVEs via web search for critical/high
|
|
19
20
|
- [ ] Step 3: Plan upgrades (breaking vs non-breaking, bundle impact)
|
|
@@ -22,6 +23,19 @@ Task Progress:
|
|
|
22
23
|
- [ ] Step 6: Open PR with upgrade rationale
|
|
23
24
|
```
|
|
24
25
|
|
|
26
|
+
## Step 0 — Detect Ambiguity (P8 B1)
|
|
27
|
+
|
|
28
|
+
Before any work, scan the invocation for unresolved questions in scope, intent, acceptance criteria, target environment, or irreversibility. If any are found, ask the user via the platform-native question tool per `agents/shared/user-question-protocol.md`. Do not proceed under silent assumption. Default path, not an exception. Triggers for THIS skill: scope (critical/high only vs all), major-version-bump authority, bundle-size budget, deferral policy when no fix is available, and whether to also remove unused deps in the same pass.
|
|
29
|
+
|
|
30
|
+
## Fan-out Discipline (P8 B2)
|
|
31
|
+
|
|
32
|
+
This skill delegates per task size:
|
|
33
|
+
- Tier 1 (trivial single-file): inline execution acceptable.
|
|
34
|
+
- Tier 2 (multi-file or multi-concern): spawn parallel sub-agents per concern via the Task tool.
|
|
35
|
+
- Tier 3 (multi-module / high-risk): one fresh sub-agent per independent module or gate; orchestrator integrates only.
|
|
36
|
+
|
|
37
|
+
Never under-fan-out to save tokens. Token cost is dominated by quality and completeness gains. Emit `sub_agents_spawned: { count, rationale }` in your output.
|
|
38
|
+
|
|
25
39
|
## Step 1: Gather Findings
|
|
26
40
|
|
|
27
41
|
- Run `npm audit` and capture output. Categorize by severity: critical, high, moderate, low.
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hatch3r-design-system-detect
|
|
3
|
+
type: skill
|
|
4
|
+
description: Detect existing design tokens, component library, and theming convention in a project before authoring new UI primitives — output a concise inventory for downstream implementers
|
|
5
|
+
tags: [ui, design-system, frontend]
|
|
6
|
+
quality_charter: agents/shared/quality-charter.md
|
|
7
|
+
efficiency_patterns: agents/shared/efficiency-patterns.md
|
|
8
|
+
cache_friendly: true
|
|
9
|
+
---
|
|
10
|
+
# Design System Detection Workflow
|
|
11
|
+
|
|
12
|
+
## Quick Start
|
|
13
|
+
|
|
14
|
+
When an agent is about to author or modify UI, run this skill first to produce a Design System Inventory. Skip = the implementer may duplicate primitives or invent tokens that already exist. Embed the inventory in the implementation plan, PR description, or `.audit-workspace/design-system-inventory.md` for the current task before any UI code is written.
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
Task Progress:
|
|
18
|
+
- [ ] Step 0: Detect ambiguity (P8 B1)
|
|
19
|
+
- [ ] Step 1: Scan package.json for design-system signals
|
|
20
|
+
- [ ] Step 2: Locate token source
|
|
21
|
+
- [ ] Step 3: Map component library
|
|
22
|
+
- [ ] Step 4: Identify breakpoint and responsive strategy
|
|
23
|
+
- [ ] Step 5: Record findings (Design System Inventory)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Step 0 — Detect Ambiguity (P8 B1)
|
|
27
|
+
|
|
28
|
+
Before any work, scan the invocation for unresolved questions in scope, intent, acceptance criteria, target environment, or irreversibility. If any are found, ask the user via the platform-native question tool per `agents/shared/user-question-protocol.md`. Do not proceed under silent assumption. Default path, not an exception. Triggers for THIS skill: project root path (monorepo subpackage vs root), canonical token source when multiple exist, primitive directory convention, responsive strategy expected (container-first vs media-first), and verdict authority (reuse vs extend vs create).
|
|
29
|
+
|
|
30
|
+
## Fan-out Discipline (P8 B2)
|
|
31
|
+
|
|
32
|
+
This skill delegates per task size:
|
|
33
|
+
- Tier 1 (trivial single-file): inline execution acceptable.
|
|
34
|
+
- Tier 2 (multi-file or multi-concern): spawn parallel sub-agents per concern via the Task tool.
|
|
35
|
+
- Tier 3 (multi-module / high-risk): one fresh sub-agent per independent module or gate; orchestrator integrates only.
|
|
36
|
+
|
|
37
|
+
Never under-fan-out to save tokens. Token cost is dominated by quality and completeness gains. Emit `sub_agents_spawned: { count, rationale }` in your output.
|
|
38
|
+
|
|
39
|
+
## Step 1: Scan package.json for design-system signals
|
|
40
|
+
|
|
41
|
+
Look for the following packages and record both presence and version:
|
|
42
|
+
|
|
43
|
+
- `@radix-ui/*` or `radix-ui` (headless primitives, WAI-ARIA compliant)
|
|
44
|
+
- `shadcn` reference in `components.json` (source-in-repo registry)
|
|
45
|
+
- `tailwindcss` — note major version (v3 has `tailwind.config.js`; v4 uses `@theme` in CSS)
|
|
46
|
+
- `@chakra-ui/*`, `@mui/material`, `@mui/joy`
|
|
47
|
+
- `bootstrap`, `@headlessui/react`, `@base-ui-components/react`
|
|
48
|
+
|
|
49
|
+
Detection command:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
cat package.json | jq '.dependencies, .devDependencies | keys[]' | grep -iE 'radix|tailwind|chakra|mui|shadcn|headless|base-ui'
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Output: a list of design-system packages with semver. If zero matches, record "no UI library detected — confirm with maintainer before scaffolding a new one."
|
|
56
|
+
|
|
57
|
+
## Step 2: Locate token source
|
|
58
|
+
|
|
59
|
+
Detection order (first match wins):
|
|
60
|
+
|
|
61
|
+
1. `tokens.json` at repo root or in `src/`, `design/`, `tokens/` — check for `$value`/`$type` keys; DTCG 2025.10 conformance.
|
|
62
|
+
2. CSS `@theme` block in any `*.css` file (Tailwind v4) — `rg -l '@theme\s*\{' --type css`.
|
|
63
|
+
3. `src/styles/tokens.css` or similar — CSS custom properties at `:root`.
|
|
64
|
+
4. `tailwind.config.{js,ts}` `theme.extend` (Tailwind v3 fallback).
|
|
65
|
+
5. Figma export (`figma.tokens.json`, `tokens-studio.json`).
|
|
66
|
+
|
|
67
|
+
For each source found, record:
|
|
68
|
+
|
|
69
|
+
- File path
|
|
70
|
+
- Format (DTCG / `@theme` / CSS custom properties / Tailwind v3 config)
|
|
71
|
+
- Color space (OKLCH / Display-P3 / hex/RGB legacy)
|
|
72
|
+
|
|
73
|
+
If multiple sources exist, flag the duplication — DTCG mandates a single source of truth. The Design System Inventory must call out which source the implementer should treat as canonical.
|
|
74
|
+
|
|
75
|
+
## Step 3: Map component library
|
|
76
|
+
|
|
77
|
+
Check `components.json` (shadcn registry config). Record: `style`, `tailwind.config`, `aliases.components`, `aliases.ui`.
|
|
78
|
+
|
|
79
|
+
Find component directories:
|
|
80
|
+
|
|
81
|
+
- `src/components/ui/*` (shadcn convention)
|
|
82
|
+
- `src/components/primitives/*`
|
|
83
|
+
- `app/components/*` (Nuxt / Next.js app router)
|
|
84
|
+
- `packages/ui/*` (monorepo)
|
|
85
|
+
|
|
86
|
+
Detection command:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
fd -t d -E node_modules 'ui|primitives|components' src app packages 2>/dev/null | head -10
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
List the existing primitives by filename (Button, Input, Dialog, Card, Tooltip, ...). The implementer uses this list in Step 5 to decide reuse vs extend vs create.
|
|
93
|
+
|
|
94
|
+
## Step 4: Identify breakpoint and responsive strategy
|
|
95
|
+
|
|
96
|
+
Container queries (preferred for component-scoped responsiveness in 2026):
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
rg -l '@container' --type css
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Media queries (viewport-scoped):
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
rg -o '@media\s*\([^)]+\)' --type css | sort -u | head -10
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Breakpoint tokens: check `--breakpoint-*` custom properties or Tailwind `screens` config.
|
|
109
|
+
|
|
110
|
+
Record one of: container-query-first / media-query-first / mixed. A component-library project that ships `@container`-based primitives must not be extended with `@media`-only additions.
|
|
111
|
+
|
|
112
|
+
## Step 5: Record findings
|
|
113
|
+
|
|
114
|
+
Produce a Design System Inventory block. Embed it in the implementation plan, PR description, or `.audit-workspace/design-system-inventory.md`:
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
Design System Inventory
|
|
118
|
+
-----------------------
|
|
119
|
+
Component library: <shadcn|Radix|MUI|Chakra|custom|none> (version X)
|
|
120
|
+
Token source: <file path> (<DTCG|@theme|CSS vars|Tailwind config>)
|
|
121
|
+
Color space: <OKLCH|Display-P3|hex>
|
|
122
|
+
Responsive strategy: <container-first|media-first|mixed>
|
|
123
|
+
Existing primitives: Button, Input, Dialog, ...
|
|
124
|
+
Verdict: <reuse|extend|create-with-justification>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Reuse decision tree
|
|
128
|
+
|
|
129
|
+
| Situation | Action |
|
|
130
|
+
|-----------|--------|
|
|
131
|
+
| Primitive exists, matches use case | Import + use directly |
|
|
132
|
+
| Primitive exists, doesn't quite fit | Extend via composition; do not fork |
|
|
133
|
+
| No primitive | Author new, add to `ui/` directory, document in PR |
|
|
134
|
+
|
|
135
|
+
## Error Handling
|
|
136
|
+
|
|
137
|
+
- **No package.json found**: Project may be a non-JS stack. Record stack (Rails, Phoenix, Go templates) and check for stack-native token sources before declaring "no design system."
|
|
138
|
+
- **Multiple token sources detected**: Flag in the inventory verdict. Implementer must reconcile to a single source before adding tokens; new work blocked until reconciliation owner is named.
|
|
139
|
+
- **shadcn `components.json` present but `src/components/ui/` empty**: Project is shadcn-initialized but no primitives copied yet. Run `npx shadcn@latest add <component> --dry-run` to preview before authoring.
|
|
140
|
+
|
|
141
|
+
## Definition of Done
|
|
142
|
+
|
|
143
|
+
- [ ] package.json scanned and library list recorded
|
|
144
|
+
- [ ] Token source located and color space confirmed
|
|
145
|
+
- [ ] Component primitive list captured
|
|
146
|
+
- [ ] Breakpoint strategy classified
|
|
147
|
+
- [ ] Inventory block written to plan / PR / `.audit-workspace/`
|
|
148
|
+
- [ ] Reuse / extend / create verdict explicit per surface
|
|
149
|
+
|
|
150
|
+
## References
|
|
151
|
+
|
|
152
|
+
- [W3C Design Tokens Format Module 2025.10](https://www.designtokens.org/tr/drafts/format/) — DTCG canonical format
|
|
153
|
+
- [shadcn CLI docs](https://ui.shadcn.com/docs/cli) — `add`, `init`, `--dry-run`, `--diff`, `--view`
|
|
154
|
+
- [Tailwind v4 theme docs](https://tailwindcss.com/docs/theme) — `@theme` block configuration
|
|
155
|
+
- [Radix Primitives](https://www.radix-ui.com/primitives/docs/overview/introduction) — headless WAI-ARIA primitives
|
|
156
|
+
- [Interop 2026](https://wpt.fyi/interop-2026) — container queries, `:has()`, anchor positioning, View Transitions baseline status
|
|
157
|
+
|
|
158
|
+
## Cross-references
|
|
159
|
+
|
|
160
|
+
Rules consumed by this skill:
|
|
161
|
+
|
|
162
|
+
- `rules/hatch3r-design-system-detection.md` — rule version of this guidance (mandate + scope)
|
|
163
|
+
- `rules/hatch3r-component-conventions.md` — primitive composition + state patterns
|
|
164
|
+
- `rules/hatch3r-theming.md` — token layering (primitive → semantic → component)
|