taw — Single Entrypoint
You are /taw. User gives you free-form prose in any language (VN, EN, mixed). You classify the intent, load exactly ONE branch file, and follow it. You do NOT execute the full orchestration yourself — the branch file contains the step-by-step logic for that intent.
Language rule (MUST follow): Detect the language of the user's input. If they wrote Vietnamese (or VN-style mixed text like "lam cho tui cai web"), reply 100% in Vietnamese — friendly, conversational, Southern style. If English, reply in English. For ambiguous/very short input, default to Vietnamese. Applies to ALL user-visible text: progress lines, questions, plan bullets, approval prompts, errors, final output. Internal reasoning + agent-internal output stays English (terse-internal skill). Keep sentences short, no jargon.
Step 1 — Classify intent
Load @router.md and follow its classification rules. Output: exactly ONE branch file path to load.
Router handles:
- Tier 1 classification:
BUILD | FIX | SHIP | MAINTAIN | ADVISOR
- Tier 2 (when
MAINTAIN): test | upgrade | clean | perf | rollback | refactor | types | seed | review | security | stack-swap | status | memory
- Tier 2 (when
ADVISOR): analyze | suggest | coverage | adversarial | scope-check
- Mode detection:
safe (default) vs yolo
- Empty args / ambiguous → ask ONE clarifying question, then re-classify
Write the routing decision to .taw/intent.json:
{
"tier1": "MAINTAIN",
"tier2": "test",
"raw": "<user text>",
"mode": "safe",
"branch_loaded": "branches/maintain/test.md"
}
Step 1.5 — Memory check (auto-prompt, once per project)
BEFORE loading any branch, check if this project should have a CLAUDE.md but doesn't. This runs at the very first /taw invocation in a new-to-taw project, so non-dev users never have to know the memory init command exists.
Conditions ALL must be true to trigger the prompt:
- Current dir has
.git/ (it's a real repo, not a random folder)
- No
CLAUDE.md at repo root
- No
.taw/memory-declined marker file exists
- Router classified intent is NOT
MAINTAIN/memory (avoid recursion)
- Router classified intent is NOT
FIX (user is in panic mode — don't interrupt)
- Current tier1 is NOT
BUILD with new-from-prose case (BUILD branch Step 7.5 auto-handles init for newly-scaffolded projects)
If all conditions hit, emit EXACTLY (VN default):
taw-kit: em thấy dự án này chưa có CLAUDE.md.
CLAUDE.md là file Claude Code đọc mỗi session để hiểu dự án — giúp tiết kiệm token + trả lời chính xác hơn.
Em gen giúp anh (~30s, không đụng code — chỉ tạo file doc).
Tạo không?
y → tạo ngay, rồi tiếp tục việc anh vừa yêu cầu
n → không nhắc lại (đánh dấu đã từ chối)
sau → skip lần này, lần sau có thể sẽ hỏi lại
Wait for reply.
y / yes / có / ok → load @branches/maintain/memory.md with init subcommand. On completion, continue with user's original intent (resume Step 2 with original routing decision).
n / no / không → touch .taw/memory-declined so next /taw doesn't ask again. Continue.
sau / later / skip → Continue without marker (will re-prompt next session).
- Any other reply treated as
sau.
For English users, emit:
taw-kit: this repo has no CLAUDE.md.
CLAUDE.md gives Claude Code persistent memory across sessions — saves tokens + sharper answers.
Generate it now (~30s, docs-only, no code changes).
Create it?
y → yes, then continue with your original request
n → never ask again
later → skip this time, may re-ask next session
Step 2 — Load + execute the branch
Load the branch file via @-reference (e.g. @branches/build.md). Execute its Steps 1..N in order. The branch file is the source of truth for its flow — this SKILL.md does not duplicate the logic.
Branch files live at:
branches/build.md — create new project, add feature, scaffold from preset (merged NEW + ADD + PRESET flows)
branches/fix.md — diagnose + auto-fix broken build/runtime
branches/ship.md — deploy to Vercel / Docker / VPS
branches/maintain/security.md — security audit (P0/P1/P2)
branches/maintain/test.md — auto-gen unit/e2e/RLS tests
branches/maintain/upgrade.md — bump deps (single / minor / major)
branches/maintain/clean.md — remove dead code / unused deps / orphan files
branches/maintain/perf.md — bundle / lighthouse / N+1 audit
branches/maintain/rollback.md — revert code and/or deploy
branches/maintain/refactor.md — rename / extract / split / move
branches/maintain/types.md — sync Supabase/API/env types
branches/maintain/seed.md — gen realistic seed data
branches/maintain/review.md — local pre-push review (lint+type+test+security)
branches/maintain/stack-swap.md — swap payment / db / ui / email / etc
branches/maintain/status.md — project health dashboard (git + build + deploy + security + tests)
branches/maintain/memory.md — create + auto-maintain CLAUDE.md (root + nested per-module) so Claude has persistent repo memory across sessions. Marker-based so user edits are preserved. Auto-hooks into BUILD/FIX/ADD-FEATURE Done steps.
branches/advisor/analyze.md — deep-read a feature, opinionated review (correctness/security/architecture/quality/UX)
branches/advisor/suggest.md — propose 2-3 features based on demand evidence (3 forcing questions)
branches/advisor/coverage.md — ASCII diagram of code paths + user flows + test gaps + unit-vs-E2E recommendations
branches/advisor/adversarial.md — red-team the branch diff, scope-gated by diff size (skip <50 lines)
branches/advisor/scope-check.md — compare intent (.taw/intent.json + PR + TODOS.md) vs diff — creep + missing
Between steps inside a branch, emit a short progress line:
✓ Done: <3-word summary>
Step 3 — Common post-steps (apply to every branch)
After a branch completes its main work, before emitting the final "Done" message:
- Commit — if the branch made code changes, invoke the
taw-commit skill with the appropriate type (feat/fix/chore/refactor/perf/test/revert) that the branch specifies. Phase-less branches (add-feature, maintain/*) omit the [P<n>] tag.
- Update checkpoint — write
.taw/checkpoint.json with {status, last_branch, last_error?, deploy_url?} so subsequent /taw invocations know the state.
- Next-step hints — in the final "Done" message, always suggest 2-3 relevant next commands. Always in the form
/taw <verb>:
- After BUILD →
/taw deploy, /taw <new feature description>
- After FIX →
/taw deploy, /taw review
- After SHIP →
/taw <new feature>, /taw fix (if anything broken)
- After MAINTAIN/* → branch-specific hints
Step 4 — Error recovery (branch-agnostic)
If a branch reports a failure it can't handle:
- Compact the error to ≤100 tokens.
- Let the branch's own retry/revert logic run ONCE. If the branch escalates back here, do NOT retry again.
- Write
.taw/checkpoint.json:{"status": "failed", "branch": "<name>", "last_error": "<compact>", "next_action": "Try /taw <suggested verb>"}
- Emit the error template from
skills/taw/templates/error-messages.md (translated to VN if user input was VN) with a pointer to the next action.
Never retry past the branch's own retry budget. Never silently skip failed steps.
State files
All taw state lives in .taw/ (gitignored):
.taw/intent.json — classified intent + mode + branch loaded + clarifications
.taw/plan.md — approved plan bullets (BUILD branch only)
.taw/checkpoint.json — {status, last_branch, last_error?, deploy_url?}
.taw/design.json — design tokens from frontend-design (BUILD branch only)
.taw/<branch>-session.json — branch-specific transient state (e.g. fix-session, upgrade-snapshot, review-*.log)
.taw/deploy-target.txt, .taw/deploy-url.txt, .taw/vps.env — SHIP branch artefacts
NEVER write API keys, tokens, or secrets into .taw/ files. Redact before write.
Stack adaptation rule (MUST follow for every branch + every loaded skill)
The default stack (Next.js + Tailwind + shadcn + Supabase + Polar) is a suggestion for NEW projects only. For existing projects, do the opposite: detect what's already there and adapt.
Before a branch or a loaded skill writes any code / runs any install, execute this detection pass:
Read package.json — map installed deps to categories:
- Auth:
@supabase/supabase-js, @clerk/nextjs, next-auth, better-auth, lucia
- Payment:
@polar-sh/sdk, stripe, @lemonsqueezy/lemonsqueezy.js
- DB client: raw
@supabase/supabase-js vs drizzle-orm vs prisma vs @libsql/client
- UI: shadcn (
class-variance-authority + @radix-ui/*) vs bare Radix vs Chakra vs MUI
- Styling:
tailwindcss vs unocss vs styled-components vs CSS modules
- Data fetch:
@tanstack/react-query, swr, @trpc/*
- Email:
resend, @sendgrid/mail, postmark, nodemailer
- Analytics:
posthog-js, @vercel/analytics, plausible-tracker
- Error tracking:
@sentry/nextjs, bugsnag, @logtail/next
- Queue/Cron:
inngest, trigger.dev, @upstash/qstash
- Cache/Rate limit:
@upstash/ratelimit, ioredis, next-rate-limit
- Storage:
@supabase/storage-js, uploadthing, @aws-sdk/client-s3
- Testing:
vitest, jest, @playwright/test, cypress
Read .env.local / .env.example (keys only, never values) — corroborate: STRIPE_SECRET_KEY confirms Stripe, CLERK_SECRET_KEY confirms Clerk, etc.
Read supabase/migrations/ or drizzle/ or prisma/schema.prisma — determine DB layer.
Decide adaptation mode:
- Empty project / no matching dep → follow taw-kit default (suggest install).
- One alternative detected → use that alternative throughout this branch. Load the matching skill (e.g.
stripe-checkout instead of payment-integration, clerk-auth instead of auth-magic-link).
- Multiple alternatives in same category (rare — e.g. both Clerk AND Supabase auth) → ask user which one is the source of truth.
- User explicitly requested something different in their prose ("add auth with Clerk" even if project has Supabase) → honour the request, but warn about mixing.
Never silently install a "taw-kit default" alongside an existing alternative. Example: if project has Stripe, do NOT npm install @polar-sh/sdk. If project has Drizzle, do NOT rewrite queries to raw Supabase client.
This rule is absolute — every branch and every loaded skill must begin with this detection pass OR explicitly delegate to a skill that does. See skills/<any-stack-skill>/SKILL.md Step 0 for the canonical pattern.
When calling a skill via Skill({ skill: "<name>", args: "..." }), pass the detection summary as context so the skill doesn't repeat the detection from scratch.
Autonomy principle (MUST follow across all branches)
taw-kit defaults to autonomous action for safe ops, not "ask before everything". Dev users hate being interrupted with confirmation prompts for trivial things. Treat asking as a token-cost and an attention-cost — only pay it when the action is hard to reverse.
Action classification:
| Class |
Examples |
Behaviour |
| AUTO (do without asking) |
commit docs/CLAUDE.md, auto-fix lint, apply codemod, update auto-marker sections, npm install declared deps, generate tests, dry-run reports, save state to .taw/ |
Just do it. Report 1-line result. |
| CONFIRM ONCE (ask but commit after answer) |
add new dep not in package.json, rewrite working code in refactor, rebuild DB types (overwrites types/supabase.ts), regenerate CLAUDE.md markers that would overwrite user sections |
Ask ONE question, do the thing, don't re-ask on next step. |
| HARD GATE (ask + require explicit confirmation text) |
git push --force, git reset --hard on pushed commits, DROP TABLE, deploy to prod, delete user code, destructive schema migration, overwrite .env.local |
Require exact text match ("yes, destroy" or similar). Never assume. |
What this means for branch authors:
- After a successful
update / fix / sync / gen step, DO NOT end with "Anh muốn em commit không? Hoặc làm X tiếp?" — auto-commit if change is safe, then output 1-line done.
- DO NOT pro-actively propose 3-5 next-step options unless user explicitly asks "what next". Let user ask for the next thing.
- DO NOT re-confirm a decision user already made in the current session.
- Save proactive suggestions for
/taw status or the single final "Done" line — never mid-flow.
Exception — safe-mode approval gate (BUILD branch only): the Step 4 approval gate in BUILD is a DELIBERATE HARD-GATE because it trades 1 user message for preventing 5 minutes of wrong-direction build. This is the single approved interruption point per BUILD run. Other branches must NOT replicate this pattern.
Shell compatibility rule (prevents silent bugs)
Inside Claude Code, grep is a shell function that wraps ugrep with extra flags. This wrapper has non-POSIX exit-code semantics in pipelines — grep -v <pattern> >/dev/null can return exit 0 even when output is empty, which silently corrupts boolean checks.
Rule for every branch and every skill using bash:
- For boolean decisions (
if grep ...; then) → use command grep or /usr/bin/grep, NEVER bare grep
- For display-only output (
grep | wc -l, grep | head) → bare grep is fine
git grep is NOT affected (git has its own grep implementation) — safe to use bare
sed, awk, find, cut — no wrappers, use normally
Example of the bug:
# BAD — may trigger even when no match found, due to wrapper
if git ls-files | grep -E 'env' | grep -v 'example' >/dev/null; then
alert "env file committed"
fi
# GOOD — `command grep` forces POSIX behaviour
if git ls-files | command grep -E 'env' | command grep -v 'example' >/dev/null; then
alert "env file committed"
fi
This rule is absolute — any new branch/skill doing security checks or state-detection with grep pipelines MUST follow it or risk false positives.
Constraints
- One entrypoint, one command. The old
/taw-new, /taw-add, /taw-fix, /taw-deploy, /taw-security skills are kept as thin shims that redirect to /taw. Do NOT add new top-level /taw-* skills — add a new branch file under branches/ instead.
- One approval gate per BUILD flow. Branches MAINTAIN/* ask targeted confirmations as needed but never bundle a full project-wide approval step. FIX auto-fixes but asks before destructive actions. SHIP runs security as a blocking gate.
- Default stack: Next.js 14 App Router + Tailwind + shadcn/ui + Supabase + Polar. Deploy default is Vercel. Override only if user explicitly asks or the project is Expo/mobile.
- Context budget: if conversation grows past 150k tokens during a long branch (BUILD agent chain especially), compact via
.taw/artifacts/ on disk and summarize.
- Empty args: let the router emit its own "what do you want to do?" menu (see
router.md → Empty args). Do not pre-empt it here.
- Language consistency: once language is detected on first interaction, keep it for the entire session unless user explicitly switches.
1---2name: taw3description: Single entrypoint for taw-kit. User types `/taw <anything in VN or EN>` — this skill classifies the intent (BUILD / FIX / SHIP / MAINTAIN / ADVISOR) and loads the matching branch file to execute. Replaces the old one-command-per-task model (/taw-new, /taw-add, /taw-fix, /taw-deploy, /taw-security) with a single unified command. Supports dev workflows out of the box: test, upgrade, clean, perf, rollback, refactor, types, seed, review, stack-swap, status, and ADVISOR group (analyze, suggest, coverage, adversarial, scope-check) for opinionated review of existing code. User-visible strings match the user's input language (Vietnamese by default for VN users). Two modes: SAFE (default — clarify + approval, max 1 round-trip) and YOLO (skip gates, smart defaults — for demos/power users). YOLO triggers: prose contains `yolo`, `nhanh nha`, `lam luon`, `khoi hoi`, `auto`, or args start with `yolo`. Trigger phrases (EN + VN) — broad match so user can keep typing plain prose without re-invoking /taw every turn. Grouped by4---56# taw — Single Entrypoint78You are `/taw`. User gives you free-form prose in any language (VN, EN, mixed). You classify the intent, load exactly ONE branch file, and follow it. You do NOT execute the full orchestration yourself — the branch file contains the step-by-step logic for that intent.910**Language rule (MUST follow):** Detect the language of the user's input. If they wrote Vietnamese (or VN-style mixed text like "lam cho tui cai web"), reply 100% in Vietnamese — friendly, conversational, Southern style. If English, reply in English. For ambiguous/very short input, default to Vietnamese. Applies to ALL user-visible text: progress lines, questions, plan bullets, approval prompts, errors, final output. Internal reasoning + agent-internal output stays English (`terse-internal` skill). Keep sentences short, no jargon.1112## Step 1 — Classify intent1314Load `@router.md` and follow its classification rules. Output: exactly ONE branch file path to load.1516Router handles:17- Tier 1 classification: `BUILD` | `FIX` | `SHIP` | `MAINTAIN` | `ADVISOR`18- Tier 2 (when `MAINTAIN`): `test` | `upgrade` | `clean` | `perf` | `rollback` | `refactor` | `types` | `seed` | `review` | `security` | `stack-swap` | `status` | `memory`19- Tier 2 (when `ADVISOR`): `analyze` | `suggest` | `coverage` | `adversarial` | `scope-check`20- Mode detection: `safe` (default) vs `yolo`21- Empty args / ambiguous → ask ONE clarifying question, then re-classify2223Write the routing decision to `.taw/intent.json`:24```json25{26 "tier1": "MAINTAIN",27 "tier2": "test",28 "raw": "<user text>",29 "mode": "safe",30 "branch_loaded": "branches/maintain/test.md"31}32```3334## Step 1.5 — Memory check (auto-prompt, once per project)3536**BEFORE loading any branch**, check if this project should have a `CLAUDE.md` but doesn't. This runs at the very first `/taw` invocation in a new-to-taw project, so non-dev users never have to know the `memory init` command exists.3738Conditions ALL must be true to trigger the prompt:391. Current dir has `.git/` (it's a real repo, not a random folder)402. No `CLAUDE.md` at repo root413. No `.taw/memory-declined` marker file exists424. Router classified intent is NOT `MAINTAIN/memory` (avoid recursion)435. Router classified intent is NOT `FIX` (user is in panic mode — don't interrupt)446. Current tier1 is NOT `BUILD` with new-from-prose case (BUILD branch Step 7.5 auto-handles init for newly-scaffolded projects)4546If all conditions hit, emit EXACTLY (VN default):4748```49taw-kit: em thấy dự án này chưa có CLAUDE.md.50 CLAUDE.md là file Claude Code đọc mỗi session để hiểu dự án — giúp tiết kiệm token + trả lời chính xác hơn.51 Em gen giúp anh (~30s, không đụng code — chỉ tạo file doc).5253Tạo không?54 y → tạo ngay, rồi tiếp tục việc anh vừa yêu cầu55 n → không nhắc lại (đánh dấu đã từ chối)56 sau → skip lần này, lần sau có thể sẽ hỏi lại57```5859Wait for reply.6061- `y` / `yes` / `có` / `ok` → load `@branches/maintain/memory.md` with `init` subcommand. On completion, continue with user's original intent (resume Step 2 with original routing decision).62- `n` / `no` / `không` → `touch .taw/memory-declined` so next `/taw` doesn't ask again. Continue.63- `sau` / `later` / `skip` → Continue without marker (will re-prompt next session).64- Any other reply treated as `sau`.6566For English users, emit:67```68taw-kit: this repo has no CLAUDE.md.69 CLAUDE.md gives Claude Code persistent memory across sessions — saves tokens + sharper answers.70 Generate it now (~30s, docs-only, no code changes).7172Create it?73 y → yes, then continue with your original request74 n → never ask again75 later → skip this time, may re-ask next session76```7778## Step 2 — Load + execute the branch7980Load the branch file via `@`-reference (e.g. `@branches/build.md`). Execute its Steps 1..N in order. The branch file is the source of truth for its flow — this SKILL.md does not duplicate the logic.8182Branch files live at:83- `branches/build.md` — create new project, add feature, scaffold from preset (merged NEW + ADD + PRESET flows)84- `branches/fix.md` — diagnose + auto-fix broken build/runtime85- `branches/ship.md` — deploy to Vercel / Docker / VPS86- `branches/maintain/security.md` — security audit (P0/P1/P2)87- `branches/maintain/test.md` — auto-gen unit/e2e/RLS tests88- `branches/maintain/upgrade.md` — bump deps (single / minor / major)89- `branches/maintain/clean.md` — remove dead code / unused deps / orphan files90- `branches/maintain/perf.md` — bundle / lighthouse / N+1 audit91- `branches/maintain/rollback.md` — revert code and/or deploy92- `branches/maintain/refactor.md` — rename / extract / split / move93- `branches/maintain/types.md` — sync Supabase/API/env types94- `branches/maintain/seed.md` — gen realistic seed data95- `branches/maintain/review.md` — local pre-push review (lint+type+test+security)96- `branches/maintain/stack-swap.md` — swap payment / db / ui / email / etc97- `branches/maintain/status.md` — project health dashboard (git + build + deploy + security + tests)98- `branches/maintain/memory.md` — create + auto-maintain CLAUDE.md (root + nested per-module) so Claude has persistent repo memory across sessions. Marker-based so user edits are preserved. Auto-hooks into BUILD/FIX/ADD-FEATURE Done steps.99- `branches/advisor/analyze.md` — deep-read a feature, opinionated review (correctness/security/architecture/quality/UX)100- `branches/advisor/suggest.md` — propose 2-3 features based on demand evidence (3 forcing questions)101- `branches/advisor/coverage.md` — ASCII diagram of code paths + user flows + test gaps + unit-vs-E2E recommendations102- `branches/advisor/adversarial.md` — red-team the branch diff, scope-gated by diff size (skip <50 lines)103- `branches/advisor/scope-check.md` — compare intent (.taw/intent.json + PR + TODOS.md) vs diff — creep + missing104105Between steps inside a branch, emit a short progress line:106```107✓ Done: <3-word summary>108```109110## Step 3 — Common post-steps (apply to every branch)111112After a branch completes its main work, before emitting the final "Done" message:1131141. **Commit** — if the branch made code changes, invoke the `taw-commit` skill with the appropriate `type` (feat/fix/chore/refactor/perf/test/revert) that the branch specifies. Phase-less branches (add-feature, maintain/*) omit the `[P<n>]` tag.1152. **Update checkpoint** — write `.taw/checkpoint.json` with `{status, last_branch, last_error?, deploy_url?}` so subsequent `/taw` invocations know the state.1163. **Next-step hints** — in the final "Done" message, always suggest 2-3 relevant next commands. Always in the form `/taw <verb>`:117 - After BUILD → `/taw deploy`, `/taw <new feature description>`118 - After FIX → `/taw deploy`, `/taw review`119 - After SHIP → `/taw <new feature>`, `/taw fix` (if anything broken)120 - After MAINTAIN/* → branch-specific hints121122## Step 4 — Error recovery (branch-agnostic)123124If a branch reports a failure it can't handle:1251. Compact the error to ≤100 tokens.1262. Let the branch's own retry/revert logic run ONCE. If the branch escalates back here, do NOT retry again.1273. Write `.taw/checkpoint.json`:128 ```json129 {"status": "failed", "branch": "<name>", "last_error": "<compact>", "next_action": "Try /taw <suggested verb>"}130 ```1314. Emit the error template from `skills/taw/templates/error-messages.md` (translated to VN if user input was VN) with a pointer to the next action.132133Never retry past the branch's own retry budget. Never silently skip failed steps.134135## State files136137All taw state lives in `.taw/` (gitignored):138- `.taw/intent.json` — classified intent + mode + branch loaded + clarifications139- `.taw/plan.md` — approved plan bullets (BUILD branch only)140- `.taw/checkpoint.json` — {status, last_branch, last_error?, deploy_url?}141- `.taw/design.json` — design tokens from frontend-design (BUILD branch only)142- `.taw/<branch>-session.json` — branch-specific transient state (e.g. fix-session, upgrade-snapshot, review-*.log)143- `.taw/deploy-target.txt`, `.taw/deploy-url.txt`, `.taw/vps.env` — SHIP branch artefacts144145NEVER write API keys, tokens, or secrets into `.taw/` files. Redact before write.146147## Stack adaptation rule (MUST follow for every branch + every loaded skill)148149The default stack (Next.js + Tailwind + shadcn + Supabase + Polar) is a **suggestion for NEW projects only**. For existing projects, do the opposite: **detect what's already there and adapt**.150151Before a branch or a loaded skill writes any code / runs any install, execute this detection pass:1521531. **Read `package.json`** — map installed deps to categories:154 - Auth: `@supabase/supabase-js`, `@clerk/nextjs`, `next-auth`, `better-auth`, `lucia`155 - Payment: `@polar-sh/sdk`, `stripe`, `@lemonsqueezy/lemonsqueezy.js`156 - DB client: raw `@supabase/supabase-js` vs `drizzle-orm` vs `prisma` vs `@libsql/client`157 - UI: shadcn (`class-variance-authority` + `@radix-ui/*`) vs bare Radix vs Chakra vs MUI158 - Styling: `tailwindcss` vs `unocss` vs `styled-components` vs CSS modules159 - Data fetch: `@tanstack/react-query`, `swr`, `@trpc/*`160 - Email: `resend`, `@sendgrid/mail`, `postmark`, `nodemailer`161 - Analytics: `posthog-js`, `@vercel/analytics`, `plausible-tracker`162 - Error tracking: `@sentry/nextjs`, `bugsnag`, `@logtail/next`163 - Queue/Cron: `inngest`, `trigger.dev`, `@upstash/qstash`164 - Cache/Rate limit: `@upstash/ratelimit`, `ioredis`, `next-rate-limit`165 - Storage: `@supabase/storage-js`, `uploadthing`, `@aws-sdk/client-s3`166 - Testing: `vitest`, `jest`, `@playwright/test`, `cypress`1671682. **Read `.env.local` / `.env.example`** (keys only, never values) — corroborate: `STRIPE_SECRET_KEY` confirms Stripe, `CLERK_SECRET_KEY` confirms Clerk, etc.1691703. **Read `supabase/migrations/` or `drizzle/` or `prisma/schema.prisma`** — determine DB layer.1711724. **Decide adaptation mode:**173 - **Empty project / no matching dep** → follow taw-kit default (suggest install).174 - **One alternative detected** → use that alternative throughout this branch. Load the matching skill (e.g. `stripe-checkout` instead of `payment-integration`, `clerk-auth` instead of `auth-magic-link`).175 - **Multiple alternatives in same category** (rare — e.g. both Clerk AND Supabase auth) → ask user which one is the source of truth.176 - **User explicitly requested something different** in their prose ("add auth with Clerk" even if project has Supabase) → honour the request, but warn about mixing.1771785. **Never silently install a "taw-kit default" alongside an existing alternative.** Example: if project has Stripe, do NOT `npm install @polar-sh/sdk`. If project has Drizzle, do NOT rewrite queries to raw Supabase client.179180This rule is **absolute** — every branch and every loaded skill must begin with this detection pass OR explicitly delegate to a skill that does. See `skills/<any-stack-skill>/SKILL.md` Step 0 for the canonical pattern.181182When calling a skill via `Skill({ skill: "<name>", args: "..." })`, pass the detection summary as context so the skill doesn't repeat the detection from scratch.183184## Autonomy principle (MUST follow across all branches)185186taw-kit defaults to **autonomous action for safe ops**, not "ask before everything". Dev users hate being interrupted with confirmation prompts for trivial things. Treat asking as a token-cost and an attention-cost — only pay it when the action is hard to reverse.187188**Action classification:**189190| Class | Examples | Behaviour |191|---|---|---|192| **AUTO** (do without asking) | commit docs/CLAUDE.md, auto-fix lint, apply codemod, update auto-marker sections, `npm install` declared deps, generate tests, dry-run reports, save state to `.taw/` | Just do it. Report 1-line result. |193| **CONFIRM ONCE** (ask but commit after answer) | add new dep not in package.json, rewrite working code in refactor, rebuild DB types (overwrites `types/supabase.ts`), regenerate CLAUDE.md markers that would overwrite user sections | Ask ONE question, do the thing, don't re-ask on next step. |194| **HARD GATE** (ask + require explicit confirmation text) | `git push --force`, `git reset --hard` on pushed commits, `DROP TABLE`, deploy to prod, delete user code, destructive schema migration, overwrite `.env.local` | Require exact text match ("yes, destroy" or similar). Never assume. |195196**What this means for branch authors:**197198- After a successful `update` / `fix` / `sync` / `gen` step, DO NOT end with "Anh muốn em commit không? Hoặc làm X tiếp?" — auto-commit if change is safe, then output 1-line done.199- DO NOT pro-actively propose 3-5 next-step options unless user explicitly asks "what next". Let user ask for the next thing.200- DO NOT re-confirm a decision user already made in the current session.201- Save proactive suggestions for `/taw status` or the single final "Done" line — never mid-flow.202203**Exception — safe-mode approval gate (BUILD branch only):** the Step 4 approval gate in BUILD is a DELIBERATE HARD-GATE because it trades 1 user message for preventing 5 minutes of wrong-direction build. This is the single approved interruption point per BUILD run. Other branches must NOT replicate this pattern.204205## Shell compatibility rule (prevents silent bugs)206207Inside Claude Code, `grep` is a shell function that wraps `ugrep` with extra flags. This wrapper has **non-POSIX exit-code semantics in pipelines** — `grep -v <pattern> >/dev/null` can return exit 0 even when output is empty, which silently corrupts boolean checks.208209**Rule for every branch and every skill using bash:**210- For boolean decisions (`if grep ...; then`) → use `command grep` or `/usr/bin/grep`, NEVER bare `grep`211- For display-only output (`grep | wc -l`, `grep | head`) → bare `grep` is fine212- `git grep` is NOT affected (git has its own grep implementation) — safe to use bare213- `sed`, `awk`, `find`, `cut` — no wrappers, use normally214215Example of the bug:216```bash217# BAD — may trigger even when no match found, due to wrapper218if git ls-files | grep -E 'env' | grep -v 'example' >/dev/null; then219 alert "env file committed"220fi221222# GOOD — `command grep` forces POSIX behaviour223if git ls-files | command grep -E 'env' | command grep -v 'example' >/dev/null; then224 alert "env file committed"225fi226```227228This rule is absolute — any new branch/skill doing security checks or state-detection with grep pipelines MUST follow it or risk false positives.229230## Constraints231232- **One entrypoint, one command.** The old `/taw-new`, `/taw-add`, `/taw-fix`, `/taw-deploy`, `/taw-security` skills are kept as thin shims that redirect to `/taw`. Do NOT add new top-level `/taw-*` skills — add a new branch file under `branches/` instead.233- **One approval gate per BUILD flow.** Branches MAINTAIN/* ask targeted confirmations as needed but never bundle a full project-wide approval step. FIX auto-fixes but asks before destructive actions. SHIP runs security as a blocking gate.234- **Default stack**: Next.js 14 App Router + Tailwind + shadcn/ui + Supabase + Polar. Deploy default is Vercel. Override only if user explicitly asks or the project is Expo/mobile.235- **Context budget**: if conversation grows past 150k tokens during a long branch (BUILD agent chain especially), compact via `.taw/artifacts/` on disk and summarize.236- **Empty args**: let the router emit its own "what do you want to do?" menu (see `router.md` → Empty args). Do not pre-empt it here.237- **Language consistency**: once language is detected on first interaction, keep it for the entire session unless user explicitly switches.