ucode-agent 1.62.3 → 1.62.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +464 -464
- package/package.json +63 -63
- package/skills/build-app/DIGEST.md +154 -145
- package/skills/build-app/SKILL.md +10 -1
- package/src/core/loop.js +98 -6
- package/src/tools/index.js +5 -1
- package/src/tools/shell.js +15 -0
package/package.json
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ucode-agent",
|
|
3
|
-
"version": "1.62.
|
|
4
|
-
"description": "ucode - a terminal coding agent that reads, edits and runs your code, on Google Gemini models.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "ucode.js",
|
|
7
|
-
"bin": {
|
|
8
|
-
"ucode": "ucode.js"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"ucode.js",
|
|
12
|
-
"src/",
|
|
13
|
-
"skills/",
|
|
14
|
-
"templates/",
|
|
15
|
-
"THIRD_PARTY_NOTICES.md"
|
|
16
|
-
],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"start": "node ucode.js",
|
|
19
|
-
"test": "node test/run.js",
|
|
20
|
-
"prepublishOnly": "node scripts/no-bundled-key.js && node test/run.js",
|
|
21
|
-
"hooks": "node scripts/install-hooks.js"
|
|
22
|
-
},
|
|
23
|
-
"repository": {
|
|
24
|
-
"type": "git",
|
|
25
|
-
"url": "git+https://github.com/sppideey/ucode-agent.git"
|
|
26
|
-
},
|
|
27
|
-
"bugs": {
|
|
28
|
-
"url": "https://github.com/sppideey/ucode-agent/issues"
|
|
29
|
-
},
|
|
30
|
-
"homepage": "https://github.com/sppideey/ucode-agent#readme",
|
|
31
|
-
"engines": {
|
|
32
|
-
"node": ">=22"
|
|
33
|
-
},
|
|
34
|
-
"keywords": [
|
|
35
|
-
"agent",
|
|
36
|
-
"cli",
|
|
37
|
-
"terminal",
|
|
38
|
-
"coding-agent",
|
|
39
|
-
"llm",
|
|
40
|
-
"gemini",
|
|
41
|
-
"google-gemini",
|
|
42
|
-
"ai"
|
|
43
|
-
],
|
|
44
|
-
"author": "om dixit",
|
|
45
|
-
"license": "MIT",
|
|
46
|
-
"dependencies": {
|
|
47
|
-
"@babel/parser": "^7.29.9",
|
|
48
|
-
"chalk": "^6.0.0",
|
|
49
|
-
"dotenv": "^18.0.3",
|
|
50
|
-
"jsonrepair": "^3.15.0",
|
|
51
|
-
"marked": "^15.0.12",
|
|
52
|
-
"marked-terminal": "^7.3.0",
|
|
53
|
-
"openai": "^7.23.0",
|
|
54
|
-
"playwright-core": "^1.63.0"
|
|
55
|
-
},
|
|
56
|
-
"devDependencies": {
|
|
57
|
-
"@types/node": "^26.6.2",
|
|
58
|
-
"typescript": "^5.9.3"
|
|
59
|
-
},
|
|
60
|
-
"publishConfig": {
|
|
61
|
-
"access": "public"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "ucode-agent",
|
|
3
|
+
"version": "1.62.4",
|
|
4
|
+
"description": "ucode - a terminal coding agent that reads, edits and runs your code, on Google Gemini models.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "ucode.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"ucode": "ucode.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"ucode.js",
|
|
12
|
+
"src/",
|
|
13
|
+
"skills/",
|
|
14
|
+
"templates/",
|
|
15
|
+
"THIRD_PARTY_NOTICES.md"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"start": "node ucode.js",
|
|
19
|
+
"test": "node test/run.js",
|
|
20
|
+
"prepublishOnly": "node scripts/no-bundled-key.js && node test/run.js",
|
|
21
|
+
"hooks": "node scripts/install-hooks.js"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/sppideey/ucode-agent.git"
|
|
26
|
+
},
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/sppideey/ucode-agent/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/sppideey/ucode-agent#readme",
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=22"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"agent",
|
|
36
|
+
"cli",
|
|
37
|
+
"terminal",
|
|
38
|
+
"coding-agent",
|
|
39
|
+
"llm",
|
|
40
|
+
"gemini",
|
|
41
|
+
"google-gemini",
|
|
42
|
+
"ai"
|
|
43
|
+
],
|
|
44
|
+
"author": "om dixit",
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@babel/parser": "^7.29.9",
|
|
48
|
+
"chalk": "^6.0.0",
|
|
49
|
+
"dotenv": "^18.0.3",
|
|
50
|
+
"jsonrepair": "^3.15.0",
|
|
51
|
+
"marked": "^15.0.12",
|
|
52
|
+
"marked-terminal": "^7.3.0",
|
|
53
|
+
"openai": "^7.23.0",
|
|
54
|
+
"playwright-core": "^1.63.0"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@types/node": "^26.6.2",
|
|
58
|
+
"typescript": "^5.9.3"
|
|
59
|
+
},
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -1,145 +1,154 @@
|
|
|
1
|
-
# Building something from nothing — the short form
|
|
2
|
-
|
|
3
|
-
The failure mode is not bad code. It is a folder of files that has never been
|
|
4
|
-
run, handed over as if it works.
|
|
5
|
-
|
|
6
|
-
## 1. Decide the shape before any file exists
|
|
7
|
-
|
|
8
|
-
One line each: **what it does**, **the core loop** (the one path that must work
|
|
9
|
-
perfectly), **the stack**, **the file list**.
|
|
10
|
-
|
|
11
|
-
| Need | Choose |
|
|
12
|
-
| --- | --- |
|
|
13
|
-
| One page, no secrets, no server | `create_app` with `plain-html` |
|
|
14
|
-
| Interactive client app, no secrets | `plain-html` still, unless it truly needs a build |
|
|
15
|
-
| Pages plus a server, secrets, API routes, SEO | `create_app` with `next-shadcn` |
|
|
16
|
-
| An API on its own | Node (Hono/Express) or Python (FastAPI) |
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
1
|
+
# Building something from nothing — the short form
|
|
2
|
+
|
|
3
|
+
The failure mode is not bad code. It is a folder of files that has never been
|
|
4
|
+
run, handed over as if it works.
|
|
5
|
+
|
|
6
|
+
## 1. Decide the shape before any file exists
|
|
7
|
+
|
|
8
|
+
One line each: **what it does**, **the core loop** (the one path that must work
|
|
9
|
+
perfectly), **the stack**, **the file list**.
|
|
10
|
+
|
|
11
|
+
| Need | Choose |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| One page, no secrets, no server | `create_app` with `plain-html` |
|
|
14
|
+
| Interactive client app, no secrets | `plain-html` still, unless it truly needs a build |
|
|
15
|
+
| Pages plus a server, secrets, API routes, SEO | `create_app` with `next-shadcn` |
|
|
16
|
+
| An API on its own | Node (Hono/Express) or Python (FastAPI) |
|
|
17
|
+
|
|
18
|
+
**Scope: complete, not sprawling.** Build what was asked, and build all of it
|
|
19
|
+
well: every feature someone using that kind of app expects on first use — a
|
|
20
|
+
tasks app adds, edits, ticks off, deletes, filters and remembers across a
|
|
21
|
+
reload; a quiz has questions, scoring, feedback and a restart; a game has
|
|
22
|
+
rules, a score, win and lose, and play again. Nothing from a different app: no
|
|
23
|
+
timer, calendar or analytics dashboard bolted onto a tasks app, no accounts on
|
|
24
|
+
a quiz. Features nobody named cost minutes and are where builds break — if one
|
|
25
|
+
is worth it, offer it in one line at the end instead of building it.
|
|
26
|
+
|
|
27
|
+
Pick the smallest stack that does the job and mean it: a tasks app, a
|
|
28
|
+
calculator, a timer, a game, a visualisation — all one page. Next.js costs an
|
|
29
|
+
install and a build, minutes the user waits through, and buys nothing an app
|
|
30
|
+
with no server needs.
|
|
31
|
+
|
|
32
|
+
## 2. Start from the starter — and finish in the same call
|
|
33
|
+
|
|
34
|
+
`create_app` takes `files`, so for a one-page app the scaffold and the whole
|
|
35
|
+
app are one call:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
create_app({ folder: "tide", name: "Tide", files: [
|
|
39
|
+
{ path: "tide/index.html", content: "…" },
|
|
40
|
+
{ path: "tide/styles.css", content: "…" },
|
|
41
|
+
{ path: "tide/app.js", content: "…" },
|
|
42
|
+
]})
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Every round trip is ten to forty seconds of the user's time, so one call
|
|
46
|
+
instead of four is most of how long the build takes.
|
|
47
|
+
|
|
48
|
+
- `plain-html` is the default: three files, no install, no build. Its files
|
|
49
|
+
come back in full inside the result — **never read them back**.
|
|
50
|
+
- `next-shadcn` installs in the background; commands in that folder wait for
|
|
51
|
+
it on their own, so start writing components at once. Re-tint `globals.css`
|
|
52
|
+
for the app's direction rather than shipping the slate default.
|
|
53
|
+
- Never run `create-next-app` or `shadcn init`. Nothing you run has a
|
|
54
|
+
keyboard: every scaffolder needs its answers as flags up front.
|
|
55
|
+
|
|
56
|
+
## 2a. Paths in `files` are not the paths in the page
|
|
57
|
+
|
|
58
|
+
The two are relative to different things, and getting them confused is the
|
|
59
|
+
commonest way a finished build comes up as bare markup. `files` paths are
|
|
60
|
+
relative to the **project root**, so they carry the app folder. A link inside a
|
|
61
|
+
page is relative to **that page**, so it must not.
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
create_app({ folder: "tide", name: "Tide", files: [
|
|
65
|
+
{ path: "tide/index.html", content: "... <link rel=stylesheet href=\"styles.css\">
|
|
66
|
+
<script type=module src=\"app.js\"></script> ..." },
|
|
67
|
+
{ path: "tide/styles.css", content: "..." },
|
|
68
|
+
{ path: "tide/app.js", content: "..." },
|
|
69
|
+
]})
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Wrong, and it 404s: `href="tide/styles.css"` inside `tide/index.html` — the
|
|
73
|
+
browser resolves that to `tide/tide/styles.css`, so no stylesheet and no script
|
|
74
|
+
load, and the page is unstyled markup with dead buttons.
|
|
75
|
+
|
|
76
|
+
## 2b. Look before you create
|
|
77
|
+
|
|
78
|
+
`create_app` refuses a folder that already has something in it unless you pass
|
|
79
|
+
the app in `files` — and a folder you half-made on an earlier attempt counts.
|
|
80
|
+
One `list_dir` in front of it costs a second and tells you whether you are
|
|
81
|
+
starting or resuming. The same goes for any command that makes a directory.
|
|
82
|
+
|
|
83
|
+
## 2c. Do not type what already exists
|
|
84
|
+
|
|
85
|
+
`add_block` has the pieces every app needs, written for whichever starter this
|
|
86
|
+
one uses: a list you can add to, tick off, rename and remove; a filter row; a
|
|
87
|
+
localStorage store; a dialog; toasts; a theme toggle; a table; an empty state.
|
|
88
|
+
Call it before writing any of those by hand. Each is a hundred lines you skip,
|
|
89
|
+
and typing is the slowest part of a build — a page assembled from blocks is
|
|
90
|
+
done minutes before the same page typed out. Call `add_block` with no name to
|
|
91
|
+
see what fits this app.
|
|
92
|
+
|
|
93
|
+
## 3. Structure
|
|
94
|
+
|
|
95
|
+
One component per file, named for what it is, not a 600-line `page.tsx`. In
|
|
96
|
+
Next.js: `src/app` (routes, `globals.css`, `api/<name>/route.ts`),
|
|
97
|
+
`src/components/<feature>/`, `src/lib/` for outside services and schemas.
|
|
98
|
+
Server components by default, `"use client"` only where it is interactive.
|
|
99
|
+
Types at every boundary; parse external data rather than trusting its shape.
|
|
100
|
+
|
|
101
|
+
## 4. Secrets and outside services
|
|
102
|
+
|
|
103
|
+
- **A key never reaches the browser.** It lives in a server route. Anything
|
|
104
|
+
imported by a `"use client"` file ships to every visitor, including a
|
|
105
|
+
"hardcoded for now" key — put it in a server-only module and say where.
|
|
106
|
+
- Every outbound call gets a timeout (`AbortSignal.timeout(60_000)`), a status
|
|
107
|
+
check, and an error that says what failed — surfaced as a real message,
|
|
108
|
+
never a silent `catch {}`.
|
|
109
|
+
- Calling a model: ask for JSON and parse it defensively (extract the first
|
|
110
|
+
`{...}`, validate, clamp numbers), put the judgement rules in the prompt
|
|
111
|
+
explicitly, and make the route timeout longer than the model takes.
|
|
112
|
+
|
|
113
|
+
## 5. Build order
|
|
114
|
+
|
|
115
|
+
Skeleton and design tokens first, so everything after is styled correctly the
|
|
116
|
+
first time; then the server route with the real integration; then the core
|
|
117
|
+
loop UI wired to it; then every state — empty, loading, success, error,
|
|
118
|
+
invalid input; then polish: motion, responsive, copy, title and metadata.
|
|
119
|
+
|
|
120
|
+
## 5a. It has to look finished
|
|
121
|
+
|
|
122
|
+
People judge the app in the first second it is on screen, before they click
|
|
123
|
+
anything. Before handing it over, check:
|
|
124
|
+
|
|
125
|
+
- A real title and one line saying what it is for — never "Welcome to…".
|
|
126
|
+
- The main action is visible without scrolling and is the most prominent button.
|
|
127
|
+
- Every button and input has hover and focus states; nothing is left browser-default.
|
|
128
|
+
- An empty list says what to do next ("No tasks yet — add one above"), never blank.
|
|
129
|
+
- It fits a 375px phone with no sideways scroll; tap targets are at least 44px.
|
|
130
|
+
- The number that matters (a score, a total, a timer) is big — several times body text.
|
|
131
|
+
|
|
132
|
+
## 5b. Tests, where there is a runner
|
|
133
|
+
|
|
134
|
+
`next-shadcn` ships vitest and one passing test, so `npm test` works from
|
|
135
|
+
the first minute — add cases for the core loop as you build it, not after, and
|
|
136
|
+
ucode will run the ones that touch whatever you change. Assert behaviour: that
|
|
137
|
+
adding an item puts it in the list, that the total is right, that an empty
|
|
138
|
+
input is refused.
|
|
139
|
+
|
|
140
|
+
`plain-html` has no runner and installs nothing, by design. Its test is the
|
|
141
|
+
browser check: ucode opens the app, types into the first field, presses Enter
|
|
142
|
+
and clicks the button that submits. Make sure that path is the one that works.
|
|
143
|
+
|
|
144
|
+
## 6. Prove it works, then report
|
|
145
|
+
|
|
146
|
+
`npm run build` type-checks and lints — a build that fails is not done. Start
|
|
147
|
+
it (`npm run dev` backgrounds itself and returns the URL; do not start it
|
|
148
|
+
twice), then `look_at_app` on every page. A clean build proves it compiles,
|
|
149
|
+
not that it works. Fix what you find and check again.
|
|
150
|
+
|
|
151
|
+
Done means: the core loop works end to end, no TODO, no placeholder copy, no
|
|
152
|
+
dead buttons, no console errors, every async action has its states, secrets
|
|
153
|
+
server-side, build passes. Then say what you built, how to run it, and — in
|
|
154
|
+
one sentence — anything you did not finish or could not test.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: build-app
|
|
3
3
|
description: Take an app from nothing to running and finished — stack choice, non-interactive scaffolding, project structure, secrets, AI and API integration, error handling, and proving it works before saying it does.
|
|
4
|
-
auto: scaffold, new project, from scratch, build an app, make an app, create an app, build a website, make a website, build a site, build me a, next.js app, nextjs app, next app, react app, vite app, shadcn, create-next-app, full stack, fullstack, saas, mvp
|
|
4
|
+
auto: scaffold, new project, from scratch, build an app, make an app, create an app, make me a, make me an, build me an, create me a, build a website, make a website, build a site, build me a, next.js app, nextjs app, next app, react app, vite app, shadcn, create-next-app, full stack, fullstack, saas, mvp
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Building something from nothing
|
|
@@ -32,6 +32,15 @@ One line each:
|
|
|
32
32
|
|
|
33
33
|
- **The file list** — the whole tree, before creating any of it.
|
|
34
34
|
|
|
35
|
+
**Scope: complete, not sprawling.** Build what was asked, and build all of it
|
|
36
|
+
well: every feature someone using that kind of app expects on first use — a
|
|
37
|
+
tasks app adds, edits, ticks off, deletes, filters and remembers across a
|
|
38
|
+
reload; a quiz has questions, scoring, feedback and a restart; a game has
|
|
39
|
+
rules, a score, win and lose, and play again. Nothing from a different app: no
|
|
40
|
+
timer, calendar or analytics dashboard bolted onto a tasks app, no accounts on
|
|
41
|
+
a quiz. Features nobody named cost minutes and are where builds break — if one
|
|
42
|
+
is worth it, offer it in one line at the end instead of building it.
|
|
43
|
+
|
|
35
44
|
If there is a user interface, the `ui-ux` skill is already loaded. Decide the
|
|
36
45
|
design direction now, not after the logic works. If the app calls a model,
|
|
37
46
|
load `ai-features`; if it has accounts, keys or uploads, load `security`.
|