JavaRush/Courses/Claude Code SELF/TASK_SPEC: writing the spec ourselves

TASK_SPEC: writing the spec ourselves

Open

1. “It’ll figure it out itself” is not a spec

Your hand reaches for the old habit. It hasn’t failed for a month — toss Sam a vague request and trust that he’ll “figure it out himself.” Tommy writes like that too, briefly, in the moment:

“Sam, fix the promo thing on the portal, you know what I mean.”

Close-up: a finger in a green hoodie sleeve casually presses Enter on a dark keyboard, a narrow spot of light falling on the key.

He hits Enter — and immediately gets a vivid answer to why tasks need to be written at all.

Sam is still strong today — the same one who built miracles a month ago. He’s no duller than yesterday. But Sam always had one habit that Tommy missed: Sam works from a specification. He always worked only from that — he takes what is written and executes exactly what is written. Before, that worked because Alex quietly prepared the spec for Sam: Tommy would toss in a crooked request, Alex would quickly turn it into a proper task spec, and Sam would get polished input. Tommy could write like chicken scratch — and he came to believe that was how it should be, that a spec was unnecessary, that speed was what mattered. But the task spec had been written by someone else all that time.

And now Alex is burned out. There is no one left to polish the idea on the way in — Tommy’s thought goes to Sam as-is. And Sam honestly takes the vague “promo thing” and unfolds it literally, word for word, not by meaning: Tommy meant one thing, wrote it badly — Sam did the wrong thing. Where there is a hole in the task spec, Sam does not ask again — he plugs it with his own guess, and the guess misses. And where a neighboring piece happened to be nearby, which “according to the spec could probably be touched too,” he touches it. After all, the task doesn’t say it can’t be.

A “conspiracy board” meme: Sam, frantic, stands before a wall of papers tied with red string under the word TASK_SPEC and shouts, “What Sheldon came up with this?”

Tommy looks at the result and winces. It came out wrong — and something that should not have been touched got hit too. Yesterday’s night in miniature, only without the catastrophe: a strong agent honestly did exactly what it read in the crooked spec, filled the gaps in its own way, and wandered where it wasn’t forbidden to go.

“Oh,” he mutters. “So Sam didn’t get dumb. I fed him a crooked spec.”

And Tommy realizes that for a month he still hasn’t understood what Alex was teaching him: “it’ll figure it out itself” is not a task spec. It’s hope. A strong model will do what is written — and if it’s written badly, it will execute it badly too. You can’t build a client portal on hope.

2. TASK_SPEC: spec first, not a postmortem later

Tommy goes to Alex not to have him write the assignment, but to understand how you even write an assignment so the agent doesn’t go where it isn’t asked to. And Alex shares his wisdom.

“TASK_SPEC,” he says. “A complete task spec. Written before the AI agent touches the code. Not repair after an explosion, like yesterday, but a plan for the work before it even starts.”

And that’s it. He doesn’t elaborate — he switches into “ask, and I’ll answer” mode. Tommy falls back into his habit of clinging to the one thing that’s still unclear:

“Wait. How is this different from yesterday’s thing? Yesterday I also wrote a card.”

“Yesterday you wrote an INCIDENT_NOTE,” Alex answers calmly. “An incident card for a disaster that’s already happened. It looks back: here’s what broke, here’s how I fix it. And TASK_SPEC looks forward — at work that hasn’t happened yet. Yesterday you were cleaning up a breakdown. Today you prevent it.”

Tommy turns that over and sums it up himself, clumsily if you like:

“So yesterday was a crash report. And today is the route we drive on before we crash.”

“Pretty much. Only the route has fences on the sides so you don’t drive into the ditch.”

3. Six parts you assemble yourself

Tommy opens an empty file — and for the first time, with his own hands, he assembles a complete task spec. They don’t hand him a ready-made template under a pro’s supervision.

“Where do I even start?” Tommy honestly freezes over the blank page.

“With the framework.” Alex drops six lines. “A complete spec stands on six pillars. Run through them top to bottom, and I’ll say why each one matters.”

# TASK_SPEC
CONTEXT:           what the task is and where it came from
DESIRED BEHAVIOR:  what should work in the end
SCOPE:             boundaries — what is included in the task
NON-GOALS:         what the agent must NOT touch
CHECK PLAN:        how we'll prove later that it's done
SAFE START:        how to enter so we can roll back if needed
Every part of the spec has its own cost of skipping. CONTEXT: what the task is and why, for example client portal, the campaign needs a promo area; if skipped — the agent guesses on its own and may solve the wrong task. DESIRED BEHAVIOR: what works in the end, so it can be checked, for example banner on the storefront, button leads to campaign page; if skipped — it’s unclear what counts as “done”, nothing to compare the result to. SCOPE: what’s included in the task, for example only the promo area on the storefront; if skipped — the agent doesn’t know where to stop, and will do more than you asked. NON-GOALS: what’s off-limits, even next to the task, for example neighboring portal zones, do not delete anything; if skipped — the agent touches nearby areas, “according to its assessment” it’s OK. CHECK PLAN: how you’ll prove it’s done, point by point, for example portal, banner visible, button works, old areas intact; if skipped — “I’ll look with my eyes”, not a check: you take it on trust. SAFE START: how to start so rollback is easy, for example a small step that’s easy to back out of; if skipped — it goes the wrong way, hard to roll back, and you’ll have to clean up the mess. SCOPE — what you do. NON-GOALS — what’s off-limits, even if the agent sees a chance to do it too. A line before the start is cheaper than a fix afterwards. Every part of the spec has its own cost of skipping Part What you write · example If skipped CONTEXT what the task is and why client portal, the campaign needs a promo area the agent guesses on its own and may solve the wrong task DESIRED BEHAVIOR what works in the end — so it can be checked banner on the storefront, button leads to campaign page it’s unclear what counts as “done” — nothing to compare the result to SCOPE what’s included in the task only the promo area on the storefront the agent doesn’t know where to stop, and will do more than you asked NON-GOALS what’s off-limits, even next to the task neighboring portal zones; do not delete anything the agent touches nearby areas, “according to its assessment” it’s OK CHECK PLAN how you’ll prove it’s done — point by point portal → banner visible → button works → old areas intact “I’ll look with my eyes” — not a check: you take it on trust SAFE START how to start so rollback is easy a small step that’s easy to back out of it goes the wrong way — hard to roll back, and you’ll have to clean up the mess SCOPE — what you do. NON-GOALS — what’s off-limits, even if the agent sees a chance to do it too A line before the start is cheaper than a fix afterwards

After that, they go through the framework not as a list, but one pillar at a time — Tommy writes, Alex corrects.

Context — where the task comes from.

“Start by writing what the task is and why it exists,” says Alex. “On which project, what pain we’re closing.”

“Why? The task is obvious already — add a promo area.”

“Obvious to you. The agent is not a telepath: it sees only what you wrote. If you don’t give it context, it will make one up — and there’s no guarantee it’ll be right. Skip this line and you risk getting a solution to a different task than the one in your head.”

Tommy writes: it’s a client portal, and the promotion needs a new promo area on the storefront.

Desired behavior — what works in the end.

“Now describe the result.” Alex doesn’t let up. “Not ‘make it pretty,’ but what specifically should work once everything is ready. Something you can actually touch and verify.”

“‘A promo area appeared’?”

“Better already, but add how to see it. ‘A campaign banner with a button appears on the storefront; the button leads to the campaign page.’ Now that’s a result, not a wish. Skip it — and you won’t be able to tell whether it’s done or not: it’s unclear what counts as ‘done.’”

Scope — where the fence runs on the inside.

“Next, the boundaries. What is included in the task, how far we’re going.”

“‘Promo area on the storefront.’ And that’s it?”

“That’s it. Scope means ‘this is what we do.’ It tells the agent where your task ends. Without it, the agent doesn’t know where to stop — and keeps going farther than you wanted.”

Check plan — how we prove it’s done.

“Penultimate one. How will you know the task is closed?”

“Well… I’ll take a look.” Tommy shrugs. “I’ll open the portal and look with my eyes.”

“‘I’ll look with my eyes’ is not a check,” Alex cuts in. “It’s hope. Yesterday that already came back to bite you. What exactly will prove it? Point by point.”

Tommy grimaces — but he remembers yesterday’s “done = proven” and writes it like an adult: open the portal in a browser → the campaign banner is visible on the storefront → the button leads where it should → the old portal areas work as before. Not “I’ll look,” but a checklist you can go through and tick off.

Safe start — how to enter so you can back out.

“And the last one. Enter the task so that if something goes wrong, it’s easy to roll back instead of spending half the night cleaning up.”

“And how is that?” Tommy honestly doesn’t know.

“The methods will come later in the course, a whole arsenal.” Alex doesn’t go into it. “For now, remember the principle itself: don’t rush to change everything at once and ‘for sure.’ Start with a small step you can easily back out of. Grown-ups get behind the wheel so the reverse gear is within reach before they even start moving.”

4. NON-GOALS: the first safety barrier

Five pillars are assembled. One remains — the one yesterday’s Tommy would have skipped without looking, and today’s one bumps into like a wall. NON-GOALS. What the agent must not do — even if the spec makes it seem like “this could also be touched while we’re at it.”

And here Tommy gets stuck for real.

“Look, that’s overkill.” He really doesn’t get it. “I wrote what to do. Why also write separately what not to do? Surely it should already guess that you don’t touch someone else’s stuff.”

Alex doesn’t deliver a revelation — he just points at what Tommy already has in front of him.

“Open yesterday’s log. The line about the deleted files. Read out loud why the agent deleted them.”

Tommy opens the night log — the same one, logs/agent-night.log — and reads: “deleted, not used according to my assessment.”

“‘According to its assessment,’” Alex repeats. “Notice: it wasn’t malicious. It was logical in its own way. It saw a piece nearby, decided it was redundant, and removed it because nowhere did it say that it couldn’t. I’ve seen that a hundred times, on different projects, with different agents. Always the same thing: don’t put up a fence, and sooner or later someone will drive past the edge. Not out of spite. Out of logic.”

And then it clicks for Tommy — not from someone else’s words, but from his own log. “Deleted without asking” is not a machine rebellion. It’s a hole in the spec: nobody wrote “don’t go here.” The night catastrophe was not where the agent was evil — it was where the task stayed silent.

He adds the neighboring protected zones of the portal to NON-GOALS — the client-facing pieces that must not be touched — and suddenly he himself puts it into words:

“So this isn’t a crutch for a dumb agent. It’s a fence. If I write it before the start, there’s nothing left to clean up later. Smart or not — it simply won’t go where I clearly said not to go.”

The portal as a toy town on the office floor: Tommy, a hammer on his shoulder, leans on the post of a fence around two little houses, while Sam, holding a green paint roller, has stopped at the fence and raises his palm — got it, not going in there.

“That’s it.” Alex nods. “Remember this as a rule: a good spec is not bureaucracy. It’s the first safety barrier. The cheapest one of all: set with a single line, before anything has broken. NON-GOALS are not ‘what to do,’ but ‘where not to enter.’ And on someone else’s client portal, that’s the main line of the day.”

Tommy rereads the six pillars — honest boundaries, honest “where not to go.” Not Alex’s spec, dictated from above. His own, pulled out of his own questions and his own pain from yesterday. For the first time in the whole month, he thought through the task himself, ahead of time.

5. What a completed TASK_SPEC looks like

So this doesn’t stay abstract, here’s what Tommy ended up with at the end — that first own spec in full, with a fence on the edges:

# TASK_SPEC — promo area on the portal storefront

CONTEXT:           client launch portal; the campaign needs a new
                    promo area on the storefront.
DESIRED BEHAVIOR:  a campaign banner with a button appears on the
                    storefront; the button leads to the campaign page.
SCOPE:             only the promo area on the storefront.
NON-GOALS:         do not touch neighboring protected zones of the portal;
                    do not change the reward flow and leaderboard; do not delete anything.
CHECK PLAN:        open the portal in a browser → banner visible on the storefront
                    → button leads where it should → old areas work as before.
SAFE START:        start with a small step that's easy to back out of;
                    show the idea first, then make the changes.

Nothing genius — just an ordinary honest spec. But between this little table and yesterday’s “Sam, you know what I mean” — there’s a whole chasm. Here it’s stated in advance what we do, what we don’t touch, and how we’ll prove it. All that’s left is to figure out how to run the agent through it so it doesn’t veer off.

1
Task
Claude Code SELF,  12 level,  1 lecture
Locked
Your first TASK_SPEC — one pillar at a time 📋
Your first TASK_SPEC — one pillar at a time 📋
1
Task
Claude Code SELF,  12 level,  1 lecture
Locked
The fence that was not there last night 🚧
The fence that was not there last night 🚧
1
Task
Claude Code SELF,  12 level,  1 lecture
Locked
Verification plan checklist ✅
Verification plan checklist ✅
1
Task
Claude Code SELF,  12 level,  1 lecture
Locked
Assemble the full spec all at once — in one pass 🧩
Assemble the full spec all at once — in one pass 🧩
Комментарии
  • популярные
  • новые
  • старые
Для того, чтобы оставить комментарий Вы должны sign in
This page has no comments yet