t27.aiРусский

A spec for your own idea

You will learn

How to say an idea as one input, one output and one test, and why an idea with no test is not ready to hand to an agent.

An agent can build only what you can say. The smallest thing you can say about an idea has three parts: one input, one output and one test that tells you it is done. Take a made-up reading log: the input is one book title, the output is how many books are logged, and the test is that after one title the count is 1. The spec of this lesson holds those three as numbers and checks them with 4 tests. Ready means one of each: 1 x 1 x 1 = 1. Set the test count to 0 and the tests that name it go red, because an idea with no test is not ready to hand over. Your own idea can be as small as this one.

Try it

In the spec, set IDEA_TESTS to 0 and read which 2 tests fail; then put it back. Then write your own idea as one input, one output and one test, one sentence each.

Open the interactive lesson →

A spec for your own idea: one input, one output, one test ↗

The three parts an idea needs before you hand it to an agent, filled in for a made-up reading log. Lesson 25 of the Vibecoding course.

specs/vibecoding/own_spec.t27

// SPDX-License-Identifier: Apache-2.0
; Vibecoding, lesson 25: A spec for your own idea.
; An idea is ready to hand to an agent when you can name its one input, its one output and the
; one test that tells you it is done. This spec is that sentence as a program, for a made-up
; idea: a reading log that takes one book title and answers with how many books are logged.
; Change a number below and see which test goes red. Ready is one of each: 1 x 1 x 1 = 1.
; phi^2 + 1/phi^2 = 3 | TRINITY

module vibecoding_own_spec;

; The idea, in numbers a beginner can count.
pub const IDEA_INPUTS : u8 = 1;
pub const IDEA_OUTPUTS : u8 = 1;
pub const IDEA_TESTS : u8 = 1;

test the_reading_log_has_one_input {
    assert IDEA_INPUTS == 1;
}

test the_reading_log_has_one_output {
    assert IDEA_OUTPUTS == 1;
}

test the_reading_log_has_a_test_that_says_done {
    assert IDEA_TESTS >= 1;
}

test the_idea_is_ready_to_hand_over {
    assert IDEA_INPUTS * IDEA_OUTPUTS * IDEA_TESTS == 1;
}

Open the lesson's spec in the player ↗

All lessons