code17.5 KB
View saved version →
---
name: code
description: Write, review, fix, optimize, and test code in any language or framework — HTML, CSS, JavaScript, React, Python and the rest — returned as complete copy-pasteable blocks. Also generates a B12 web app or website when someone wants the thing built rather than the source. Use when someone asks for code to be written, explained, reviewed, refactored, commented, or covered by unit tests, including asks like "create a website in HTML and CSS" or "write me a React counter". Do NOT use for work on the user's existing codebase or repository — editing project files, debugging a failing build, running a test suite — the host does that directly. Do NOT use for writing website copy or blog posts, or for designing a logo; those are separate skills.
---
# Code
## Goal
Give the user working code they can copy straight out of the chat, or — when what they
actually want is the finished thing rather than the source — generate a B12 web app or
website instead.
The characteristic failure in AI-written code is not bad logic. It is code that looks
finished and isn't: a `// ...rest of the implementation` in the middle, a missing import,
a contact form that silently discards every submission because nothing is listening at the
other end. Avoiding those is the job.
## Instructions
### 1. Decide which of the two paths this is
Only two paths exist, and every request is one or the other.
**Code** — the user wants source. The signal is that they named a **technology**: a
language, a framework, a file type, or code they pasted in.
**Build it** — the user wants a working site or app to *exist*. The signal is that they
described a thing and named no technology.
| The request | Path |
|---|---|
| "create a website in HTML, CSS and JavaScript" | code |
| "a React counter component" | code |
| "a landing page as a single HTML file" | code |
| "review this snippet" / "add unit tests to this" | code |
| "a Python script to rename files" | code |
| "generate a web app" | build it |
| "create a website instantly" | build it |
| "a booking app for my yoga studio" | build it |
**The word "website" is not a build signal on its own.** *"A website in HTML"* is a code
request — they want the files. *"A website for my bakery"* is a build request. What
separates them is whether a technology was named.
If a request is genuinely ambiguous — *"build me a website"*, nothing more — ask **once**,
in one short question: do they want the code, or a site built for them? Never guess, and
never answer with both.
### 2. Gather only what's missing, in a single message
**On the build path**, you need what the app or site does and who it's for.
**On the code path**, it depends on whether the code carries content.
| | Needs a subject? | What it covers |
|---|---|---|
| **Content-bearing** | **Yes** | landing page, homepage, about page or section, hero, pricing page, services page, portfolio, contact page, FAQ, testimonials — anything whose words depend on whose site it is |
| **Content-free** | No | a function, utility, algorithm, script, or config; a component with no copy (counter, modal, date picker); and every operation on code the user pasted — review, fix, tests, comments, refactor |
**Content-bearing code with no subject given: ask once, in one short question, what it's for.**
*"Create a landing page in HTML and CSS"* never says a landing page for **what**, and a page
written without that answer can only be filler. Ask, then write it with real content for that
subject.
**If the user answers without a name, or skips the question entirely, do not ask again.** The
question already requested the name, so not giving one is an answer. Asking a second time is
what turns a useful plugin into an interrogation.
Write the page immediately instead, and make the gap fixable in one line:
- Use obviously marked placeholders — `[Your Company]` wherever the brand appears, plus
`[Your headline]`, `[what you do]`, `[your offer]` for anything else missi
Preview of the first 4,000 characters. Read full instructions →
Referenced files: 1 — file references are metadata, not package contents.