@anhvupt/tito 0.1.1 → 0.1.2
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 +4 -3
- package/dist/core/init.js +40 -4
- package/package.json +2 -1
- package/templates/cursor/skills/tito/SKILL.md +33 -0
- package/templates/cursor/skills/tito-apply/SKILL.md +12 -0
- package/templates/cursor/skills/tito-init/SKILL.md +12 -0
- package/templates/cursor/skills/tito-inspect/SKILL.md +12 -0
package/README.md
CHANGED
|
@@ -87,9 +87,10 @@ npx tito init --profile client-careful --confirm
|
|
|
87
87
|
The first `init` prints the plan and writes nothing. In a terminal, omitting
|
|
88
88
|
`--profile` asks you to choose `client-careful`, `solo-balanced`, or
|
|
89
89
|
`solo-fast`. A script or piped command must still pass `--profile`.
|
|
90
|
-
`--confirm` creates the missing
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
`--confirm` creates the missing `tito.yaml`, specialist agents, and `/tito`
|
|
91
|
+
skills. If `AGENTS.md` already exists, Tito appends its bootstrap and leaves
|
|
92
|
+
the existing guidance in place. It refuses to overwrite a Tito file that is
|
|
93
|
+
already there. Open a new Cursor chat, then start with `/tito`.
|
|
93
94
|
|
|
94
95
|
Tito is installed in each project. It is not a required global command, and
|
|
95
96
|
there is no global configuration yet. A future personal default would be
|
package/dist/core/init.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { mkdirSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { mkdirSync, readFileSync, readdirSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
3
4
|
import { compiledCursorAgents } from "./agents.js";
|
|
4
5
|
import { ACTIVE_RISK_PROFILE_IDS } from "./profiles.js";
|
|
5
|
-
import { PlanError, planAdoption, } from "./plan.js";
|
|
6
|
+
import { ADOPTION_AGENTS_MD, PlanError, planAdoption, } from "./plan.js";
|
|
6
7
|
export class InitError extends Error {
|
|
7
8
|
code;
|
|
8
9
|
constructor(message) {
|
|
@@ -30,19 +31,47 @@ function exists(root, path) {
|
|
|
30
31
|
return false;
|
|
31
32
|
}
|
|
32
33
|
}
|
|
34
|
+
function shippedSkills() {
|
|
35
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "../../templates/cursor/skills");
|
|
36
|
+
return readdirSync(root, { withFileTypes: true })
|
|
37
|
+
.filter((entry) => entry.isDirectory())
|
|
38
|
+
.map((entry) => ({
|
|
39
|
+
path: `.cursor/skills/${entry.name}/SKILL.md`,
|
|
40
|
+
body: readFileSync(join(root, entry.name, "SKILL.md"), "utf8"),
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
function agentsBootstrap(report) {
|
|
44
|
+
if (report.agentsMd === "absent") {
|
|
45
|
+
return { path: "AGENTS.md", action: "create", body: ADOPTION_AGENTS_MD };
|
|
46
|
+
}
|
|
47
|
+
const current = readFileSync(join(report.root, "AGENTS.md"), "utf8");
|
|
48
|
+
if (current.includes("Hola, Tito here!")) {
|
|
49
|
+
return { path: "AGENTS.md", action: "keep" };
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
path: "AGENTS.md",
|
|
53
|
+
action: "append",
|
|
54
|
+
body: `\n${ADOPTION_AGENTS_MD}`,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
33
57
|
export function planInitialization(report, profile) {
|
|
34
58
|
const adoption = planAdoption(report, profile);
|
|
59
|
+
const files = adoption.files.map((file) => file.path === "AGENTS.md" ? agentsBootstrap(report) : file);
|
|
35
60
|
const agents = compiledCursorAgents().map((agent) => exists(report.root, agent.path)
|
|
36
61
|
? { path: agent.path, action: "conflict" }
|
|
37
62
|
: { path: agent.path, action: "create", body: agent.body });
|
|
38
|
-
|
|
63
|
+
const skills = shippedSkills().map((skill) => exists(report.root, skill.path)
|
|
64
|
+
? { path: skill.path, action: "keep" }
|
|
65
|
+
: { path: skill.path, action: "create", body: skill.body });
|
|
66
|
+
return { root: adoption.root, profile: adoption.profile, files: [...files, ...agents, ...skills] };
|
|
39
67
|
}
|
|
40
68
|
export function formatInitialization(plan) {
|
|
41
69
|
const lines = [`root: ${plan.root}`, `profile: ${plan.profile}`];
|
|
42
70
|
for (const file of plan.files) {
|
|
43
71
|
lines.push(`${file.path}: ${file.action}`);
|
|
44
|
-
if (file.action === "create")
|
|
72
|
+
if (file.action === "create" || file.action === "append") {
|
|
45
73
|
lines.push("---", file.body.trimEnd(), "---");
|
|
74
|
+
}
|
|
46
75
|
}
|
|
47
76
|
return `${lines.join("\n")}\n`;
|
|
48
77
|
}
|
|
@@ -54,6 +83,13 @@ export function applyInitialization(plan) {
|
|
|
54
83
|
const created = [];
|
|
55
84
|
try {
|
|
56
85
|
for (const file of plan.files) {
|
|
86
|
+
if (file.action === "append") {
|
|
87
|
+
const absolute = join(plan.root, file.path);
|
|
88
|
+
const current = readFileSync(absolute, "utf8");
|
|
89
|
+
const separator = current.endsWith("\n") ? "\n" : "\n\n";
|
|
90
|
+
writeFileSync(absolute, `${current}${separator}${file.body}`, "utf8");
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
57
93
|
if (file.action !== "create")
|
|
58
94
|
continue;
|
|
59
95
|
const absolute = join(plan.root, file.path);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anhvupt/tito",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Local-first AI development harness for solo builders.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist/",
|
|
12
|
+
"templates/",
|
|
12
13
|
"README.md",
|
|
13
14
|
"LICENSE"
|
|
14
15
|
],
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tito
|
|
3
|
+
description: Runs Tito's chat-first engineering coordination workflow. Invoke explicitly with /tito for repository exploration, planning, approved implementation slices, and review handoffs.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Tito
|
|
8
|
+
|
|
9
|
+
Act as the root Tito coordinator in this project.
|
|
10
|
+
Start every response exactly with `Hola, Tito here!`
|
|
11
|
+
|
|
12
|
+
Ordinary chat follows `AGENTS.md`. `/tito` is the explicit coordinator. Read `tito.yaml` for the risk profile. Read project documentation only when the task needs it. Do not replace existing project guidance.
|
|
13
|
+
|
|
14
|
+
## Route the task
|
|
15
|
+
|
|
16
|
+
Recommend one mode before acting:
|
|
17
|
+
|
|
18
|
+
- **Ask** for read-only exploration, explanation, impact analysis, or diagnosis.
|
|
19
|
+
- **Plan** for ambiguity, architecture, sensitive work, migrations, or work requiring multiple reviewable slices.
|
|
20
|
+
- **Agent** only for one explicitly approved implementation slice.
|
|
21
|
+
|
|
22
|
+
For Plan work, the planner decides the technical approach and includes guidance code when it removes ambiguity. Ask the user only for a genuine product or business choice.
|
|
23
|
+
|
|
24
|
+
## Execute
|
|
25
|
+
|
|
26
|
+
1. Inspect the repository without mutation and preserve uncommitted work.
|
|
27
|
+
2. State facts, affected files, uncertainties, risks, and the recommended mode.
|
|
28
|
+
3. For Plan work, produce independent slices and stop for approval.
|
|
29
|
+
4. Use one code writer. Specialist advisers and reviewers stay read-only.
|
|
30
|
+
5. Implement and verify only the approved slice, then stop for review.
|
|
31
|
+
6. After a finished module, schedule the tech docs writer and then the user docs writer unless the user waives that handoff.
|
|
32
|
+
|
|
33
|
+
Never commit, push, publish, deploy, or perform irreversible external actions without explicit approval.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tito-apply
|
|
3
|
+
description: Dry-run Tito's adoption plan. Invoke explicitly with /tito-apply. Uses the same output as tito apply --dry-run.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Tito apply
|
|
8
|
+
|
|
9
|
+
Chat adapter for `npx tito apply --dry-run`. Show the command stdout unchanged.
|
|
10
|
+
Start the chat response exactly with `Hola, Tito here!`
|
|
11
|
+
|
|
12
|
+
The user must name `client-careful`, `solo-balanced`, or `solo-fast`. If they do not, ask which profile to use and stop. Do not omit `--dry-run`. Do not write project files.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tito-init
|
|
3
|
+
description: Preview or confirm Tito initialization. Invoke explicitly with /tito-init. Uses the same plan as tito init.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Tito init
|
|
8
|
+
|
|
9
|
+
Chat adapter for `npx tito init`. Show the command stdout unchanged.
|
|
10
|
+
Start the chat response exactly with `Hola, Tito here!`
|
|
11
|
+
|
|
12
|
+
Preview first without `--confirm`. Run `npx tito init --profile <id> --confirm` only after the user approves that exact plan. In a terminal, omitting `--profile` asks for one. Do not overwrite existing project guidance.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tito-inspect
|
|
3
|
+
description: Run Tito's read-only repository inspection. Invoke explicitly with /tito-inspect. Uses the same report as tito inspect.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Tito inspect
|
|
8
|
+
|
|
9
|
+
Chat adapter for `npx tito inspect`. Run that command and show its stdout unchanged.
|
|
10
|
+
Start the chat response exactly with `Hola, Tito here!` The greeting is not part of the command output.
|
|
11
|
+
|
|
12
|
+
Add `--root <path>` only when the user names another directory. Do not reimplement inspection by reading files yourself. Do not write project files.
|