heymegabyte/agent-skills / 06-build-and-slice-loop
build-and-slice-loop
VerifiedUse when implementing features or streaming OnePrompt site builds. Complete vertical slices with real content, strict TypeScript and Zod. Parallel section/data work, deterministic assembly, granular patches and immediate valid previews.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.2 KB |
| admin-dashboard.md | markdown | 5.5 KB |
| ai-chat-widget.md | markdown | 6.0 KB |
| blog-and-content-engine.md | markdown | 6.2 KB |
| build-breaking-rules.md | markdown | 7.4 KB |
| chat-native-dashboard.md | markdown | 3.6 KB |
| contact-forms-and-endpoints.md | markdown | 6.7 KB |
| copilot-and-ai-features.md | markdown | 7.4 KB |
| custom-error-pages.md | markdown | 4.5 KB |
| data-tables.md | markdown | 7.7 KB |
| domain-provisioning.md | markdown | 4.6 KB |
| easter-eggs.md | markdown | 4.7 KB |
| empty-states-and-loading.md | markdown | 5.7 KB |
| file-uploads-and-storage.md | markdown | 6.7 KB |
| internationalization.md | markdown | 4.3 KB |
| keyboard-shortcuts-and-command-palette.md | markdown | 6.7 KB |
| microcopy-library.md | markdown | 8.0 KB |
| notification-center.md | markdown | 8.4 KB |
| onboarding-and-first-run.md | markdown | 5.0 KB |
| pre-digested-builds.md | markdown | 3.6 KB |
| pwa-kit.md | markdown | 6.8 KB |
| realtime-and-websockets.md | markdown | 7.2 KB |
| rich-text-editor.md | markdown | 7.4 KB |
| site-search.md | markdown | 4.0 KB |
| stripe-first-donations.md | markdown | 10.7 KB |
| web-manifest-system.md | markdown | 11.9 KB |
| webhook-system.md | markdown | 9.5 KB |
build-breaking-rules.md
View on GitHub---
name: "06 build-breaking build+slice loop rules"
description: "Universal template-leverage gates: every build's slice loop MUST start from template.projectsites.dev clone (not from scratch), homepage-first vertical slicing, anti-placeholder enforcement (no lorem/TODO/gray-box), incremental visual checkpoints per slice, slice budget gate. Migrated from prompt-improvements brainstorm 2026-05-10."
metadata:
version: "1.0.0"
updated: "2026-05-10"
effort: "high"
context: "fork"
license: "Rutgers"
compatibility:
claude-code: ">=2.0.0"
agentskills: ">=1.0.0"
---
# 06 — Build-Breaking Build + Slice Loop Rules
Initialized from prompt-improvements brainstorm 2026-05-10 — 8 template-leverage rules (#1-8) that bind every build's slice loop.
## Every build (***TEMPLATE LEVERAGE #1 — START FROM `template.projectsites.dev` CLONE — UNIVERSAL — BUILD-BREAKING***)
- Clone from R2 bucket `project-sites-template/` — NEVER scaffold via `npm create vite`.
### Template includes
- PWA shell (manifest + sw.js + offline.html)
- 9 favicon assets
- `_creativity_preamble.txt` + `_mission_preamble.txt`
- 4-layer CSS cascade
- Analytics auto-provisioning
- GTM + PostHog + Sentry + GA4 stubs wired
- Turnstile widget
- Resend stub
- Route metadata template
- JSON-LD generators
### Pipeline
1. Orchestrator boot
2. `wrangler r2 object get project-sites-template/dist.tar.gz` → extract
3. Site-specific overrides applied
4. Slice loop begins
### Validator
- `validate-template-origin.mjs` — assert `dist/.template-version` matches current `template.projectsites.dev` SHA AND ≥80% of template files preserved in slice 0
## Every build (***TEMPLATE LEVERAGE #2 — HOMEPAGE-FIRST VERTICAL SLICING — UNIVERSAL — BUILD-BREAKING***)
- Start slice loop with `/` before any secondary route; NEVER parallel-render all routes from prompt-zero.
### Slice order
- **Slice 0** — template clone + brand override
- **Slice 1** — homepage hero + nav + footer (deployable)
- **Slice 2** — homepage feature sections (deployable)
- **Slice 3** — `/about` route
- **Slice 4** — `/contact` route
- **Slice N** — remaining routes in priority order
Each slice ships independently — partial site beats full-site-broken.
### Validator
- `validate-homepage-first.mjs` — assert `_slice_log.json[0].route === "/"` AND homepage at HEAD-200 before any other route in build trace
## Every slice (***TEMPLATE LEVERAGE #3 — ANTI-PLACEHOLDER ENFORCEMENT — UNIVERSAL — BUILD-BREAKING***)
Every slice MUST ship zero placeholders:
- No `lorem ipsum`
- No `TODO`/`FIXME`/`XXX`
- No gray-box image fallbacks
- No `placeholder.com` URLs
- No `Coming Soon` labels
- No `[Your Name]` template strings
- No `https://example.com` references
### Validator
- `validate-anti-placeholder.mjs` — grep `dist/**/*.{html,css,js,json}` for `/lorem ipsum|TODO|FIXME|XXX|placeholder\.com|coming soon|\[your |\bexample\.com\b/i` — any match = slice FAIL
## Every slice (***TEMPLATE LEVERAGE #4 — INCREMENTAL DUAL-VISION CHECKPOINT — UNIVERSAL — BUILD-BREAKING — see ~/.claude/rules/visual-inspection.md***)
- End every slice with Playwright screenshots at 2bp (375 + 1280) + Claude Vision (Sonnet 4.6, FREE on Max 20x OAuth) scoring 0-10 before next slice fires.
- Below 8/10 → apply critique + regenerate (max 2 attempts) → if still <8/10 log to `_visual_failures.json` and continue.
### Tier order
- **T1 (FREE)** — Playwright a11y tree + axe-core + DOM-walker contrast first. Catches ~80% with zero token spend.
- **T2 (FREE on Max 20x)** — Claude Vision Sonnet 4.6 on every slice every breakpoint
- **T3 (METERED, $0.50 build cap)** — GPT Image 2 vision JUDGE reserved for hero/ATF slice + brand-fidelity slice vs source-site screenshot + arbitration when Claude Vision <8 OR Claude+a11y-tree disagree
### Consensus
- Both ≥8 → slice ships
- One <8 → remediate (3-round cap)
### Auth context
- Container context = Max 20x OAuth = Claude Vision FREE uncapped
- Worker context = API key = metered both ways → cost-balance there
### Pipeline
1. Slice complete → deploy to staging URL
2. Playwright 2bp screenshots
3. Tier 1 axe-core (FREE)
4. Tier 2 Claude Vision (FREE) with prompt template `(slice_role, brand_palette, target_aesthetic, source_screenshot?) → score 0-10 + evidence per claim`
5. If hero/ATF or brand-fidelity slice, also fire Tier 3 GPT Image 2 vision judge (consumes budget)
6. If Claude<8 or providers disagree, fire Tier 3 arbitration
7. Every vision call logs `{slice_id, vision_provider, auth_mode ("max-oauth"|"api-key"), score, cost_usd}` to `_iteration_log.json.vision_calls[]` + D1 `audit_logs`
### Validator
- `validate-slice-dual-vision.mjs` — assert every slice in `_slice_log.json` has `claude_vision_score >= 8` OR documented `visual_failures` entry AND every hero/ATF + brand-fidelity slice also has `gpt4o_judge_score`
## Every slice (***TEMPLATE LEVERAGE #5 — SLICE TIME BUDGET (10min HOMEPAGE / 5min ROUTE) — UNIVERSAL — BUILD-BREAKING***)
Budget limits:
- Homepage slice — ≤10min wall-clock
- Secondary-route slice — ≤5min
- Polish slice — ≤3min
Exceeding budget = cut scope, ship MVP slice, surface remainder as recommendation.
### Pipeline
1. Slice timer starts on slice begin
2. At budget-80% checkpoint, orchestrator forces scope-cut (drop optional sections, defer to next iteration)
3. At budget-100%, slice MUST ship deployable state
### Validator
- `validate-slice-budget.mjs` — assert every `_slice_log.json[i].duration_ms` ≤ budget for its type AND scope-cuts logged when triggered
## Every slice (***TEMPLATE LEVERAGE #6 — DEPLOYABLE-AT-EVERY-SLICE GATE — UNIVERSAL — BUILD-BREAKING***)
- Every slice MUST end deployable — no broken HTML, no JS console errors, no broken internal links.
### Pipeline
1. Slice complete → `wrangler deploy --env staging`
2. Playwright headless visits 6 breakpoints
3. Console-error count must be 0
4. Broken-link count must be 0
5. Failures roll back to previous slice
### Validator
- `validate-deployable-slice.mjs` — assert post-slice staging deploy returns 200 + console-errors === 0 + broken-links === 0 across all 6 breakpoints
## Every slice (***TEMPLATE LEVERAGE #7 — REAL CONTENT FROM RESEARCH ARTIFACTS — UNIVERSAL — BUILD-BREAKING***)
- Source all copy + media from build's pre-research artifacts (`_research.json`, `_corpus.json`, `_media_extraction.json`, `_brand.json`) — NEVER LLM-fabricated content.
### Pipeline
- Slice prompt receives `(slice_role, route, research_artifacts[]) → renders only with provided facts`
- LLM may rephrase + condense + structure, never invent
- Every quantitative claim (%, $, N, dates) MUST cite `_research.json.refId` per `~/.claude/rules/citations.md`
### Validator
- `validate-real-content.mjs` — assert every `<section data-slice="X">` has ≥1 cite into `_research.json` OR `_corpus.json` AND no quantitative claim ships uncited
## Every slice (***TEMPLATE LEVERAGE #8 — SLICE LOG AS BUILD-OUTPUT ARTIFACT — UNIVERSAL — BUILD-BREAKING***)
Every build MUST emit `_slice_log.json` capturing per-slice metadata:
```
{slice_id, route, role, started_at, ended_at, duration_ms,
files_changed[], visual_score, console_errors[], broken_links[],
scope_cuts[], cite_count, recommendations_emitted[]}
```
- Surfaced under `/admin/build-trace` post-deploy for owner inspection.
### Validator
- `validate-slice-log.mjs` — assert `_slice_log.json` exists + has entry per slice + all 12 fields populated
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |