@anhvupt/tito 0.1.0
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/LICENSE +201 -0
- package/README.md +170 -0
- package/dist/cli.js +208 -0
- package/dist/core/agents.js +66 -0
- package/dist/core/config.js +108 -0
- package/dist/core/init.js +65 -0
- package/dist/core/inspect.js +89 -0
- package/dist/core/lifecycle.js +54 -0
- package/dist/core/plan.js +59 -0
- package/dist/core/profiles.js +81 -0
- package/dist/core/routing.js +35 -0
- package/dist/core/specialists.js +237 -0
- package/dist/core/work-plan.js +270 -0
- package/package.json +32 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Vu Pham
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Tito
|
|
2
|
+
|
|
3
|
+
**Quiet orchestration. Trusted continuity.**
|
|
4
|
+
|
|
5
|
+
Tito is a chat-first engineering coordinator for solo builders. You talk to one
|
|
6
|
+
coordinator; Tito explores the repository, chooses the right working mode,
|
|
7
|
+
turns larger work into reviewable slices, and keeps implementation inside the
|
|
8
|
+
scope you approved.
|
|
9
|
+
|
|
10
|
+
It is local-first, Git-friendly, and designed to add coordination without
|
|
11
|
+
replacing your project documentation, rules, or specialists.
|
|
12
|
+
|
|
13
|
+
## What Tito helps with
|
|
14
|
+
|
|
15
|
+
- **One place to ask:** use ordinary Cursor chat or `/tito` instead of manually
|
|
16
|
+
coordinating several agents.
|
|
17
|
+
- **The right amount of process:** Tito recommends Ask for discovery, Plan for
|
|
18
|
+
uncertain or critical work, and Agent only for an approved implementation
|
|
19
|
+
slice.
|
|
20
|
+
- **Plans that make decisions:** the planner owns technical choices, records
|
|
21
|
+
important trade-offs, and includes signatures, schemas, pseudocode, or
|
|
22
|
+
guidance code when that makes implementation clearer.
|
|
23
|
+
- **Smaller reviews:** work is split into bounded slices with acceptance
|
|
24
|
+
criteria, tests, forbidden changes, risks, and a stop condition.
|
|
25
|
+
- **Safer changes:** Tito preserves uncommitted work, refuses silent overwrites,
|
|
26
|
+
and requires approval before commits, pushes, deployments, publication, or
|
|
27
|
+
irreversible external actions.
|
|
28
|
+
- **Project-aware adoption:** Tito is intended to discover and preserve existing
|
|
29
|
+
rules, skills, BMad workflows, and project-owned specialists rather than
|
|
30
|
+
replacing them.
|
|
31
|
+
- **Controlled model use:** Tito recommends the least expensive capable tier,
|
|
32
|
+
using stronger reasoning models for architecture, ambiguity, migrations,
|
|
33
|
+
security, and other high-consequence planning. If a requested model is
|
|
34
|
+
unavailable, Tito asks instead of substituting one silently.
|
|
35
|
+
|
|
36
|
+
## Specialists
|
|
37
|
+
|
|
38
|
+
You call Tito. Tito selects only the specialists the task needs. A specialist's
|
|
39
|
+
mode decides whether it may change anything:
|
|
40
|
+
|
|
41
|
+
| Specialist | Read-only mode | Mutating mode |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| Explorer | Scout the repository | — |
|
|
44
|
+
| Product analyst | Clarify requirements | — |
|
|
45
|
+
| Architect | Decide the technical approach | — |
|
|
46
|
+
| ERP specialist | Advise or review domain rules | — |
|
|
47
|
+
| QA reviewer | Review correctness | — |
|
|
48
|
+
| Security reviewer | Review security-sensitive changes | — |
|
|
49
|
+
| Frontend engineer | Design | Implement files |
|
|
50
|
+
| Backend engineer | — | Implement files |
|
|
51
|
+
| DevOps engineer | Plan | Change infrastructure, with approval |
|
|
52
|
+
| Tech docs writer | — | Update technical documentation |
|
|
53
|
+
| User docs writer | — | Update user documentation |
|
|
54
|
+
|
|
55
|
+
Several read-only specialists may work together. Only one mutating mode may be
|
|
56
|
+
active. Backend and frontend work is split into sequential slices. After a
|
|
57
|
+
module is finished, Tito schedules the tech docs writer and then the user docs
|
|
58
|
+
writer, one at a time, before calling that module done. Skip that handoff only
|
|
59
|
+
when you explicitly waive it for that module. Each specialist carries triggers,
|
|
60
|
+
knowledge references, handoffs, and a stop condition. The detailed prompt stays
|
|
61
|
+
lean and loads knowledge only when that mode needs it.
|
|
62
|
+
|
|
63
|
+
Cursor agent files such as `.cursor/agents/tito-frontend.md` are not generated
|
|
64
|
+
yet. The roster above is the contract those files will follow.
|
|
65
|
+
|
|
66
|
+
## Chat first, CLI when useful
|
|
67
|
+
|
|
68
|
+
Chat is the primary mental model. Every operation is implemented once in the
|
|
69
|
+
core and exposed through both chat and the CLI:
|
|
70
|
+
|
|
71
|
+
- `/tito` is the open-ended coordinator.
|
|
72
|
+
- `/tito-inspect` and `tito inspect` produce the same repository report.
|
|
73
|
+
- `/tito-apply` and `tito apply --dry-run` produce the same adoption plan.
|
|
74
|
+
|
|
75
|
+
Tito-coordinated chat responses begin with `Hola, Tito here!` so you can see
|
|
76
|
+
that the coordinator is active. The greeting is not added to CLI or
|
|
77
|
+
machine-readable output.
|
|
78
|
+
|
|
79
|
+
## Install in a project
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
npm install -D @anhvupt/tito
|
|
83
|
+
npx tito init --profile client-careful
|
|
84
|
+
npx tito init --profile client-careful --confirm
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The first `init` prints the plan and writes nothing. `--confirm` creates the
|
|
88
|
+
missing Tito files and specialist agents. It keeps an existing `AGENTS.md` and
|
|
89
|
+
refuses to overwrite a file that is already there. Open a new Cursor chat, then
|
|
90
|
+
start with `/tito`.
|
|
91
|
+
|
|
92
|
+
## What works today
|
|
93
|
+
|
|
94
|
+
Tito 0.1 is under active development. The current implementation includes:
|
|
95
|
+
|
|
96
|
+
- strict `tito.yaml` parsing with `client-careful`, `solo-balanced`, and
|
|
97
|
+
`solo-fast` risk profiles;
|
|
98
|
+
- mandatory escalation for authentication, payments, secrets, production data,
|
|
99
|
+
destructive database work, privacy, public infrastructure, irreversible
|
|
100
|
+
actions, and financial invariants;
|
|
101
|
+
- deterministic Ask, Plan, and Agent routing from explicit task facts;
|
|
102
|
+
- an enforced lifecycle from discovery through review and completion;
|
|
103
|
+
- validated dependency-aware work plans with concurrent read-only readiness and
|
|
104
|
+
one active implementation writer;
|
|
105
|
+
- specialist manifests whose selected mode, not the role name, owns mutation
|
|
106
|
+
authority;
|
|
107
|
+
- read-only repository inspection for `tito.yaml` and `AGENTS.md`;
|
|
108
|
+
- deterministic dry-run adoption planning that shows create, keep, and conflict
|
|
109
|
+
decisions without writing files;
|
|
110
|
+
- matching Cursor chat skills for the implemented CLI operations.
|
|
111
|
+
|
|
112
|
+
`tito init --confirm` can write a new `tito.yaml`, a missing `AGENTS.md`, and
|
|
113
|
+
the specialist agent files. It does not overwrite existing files. A lock file,
|
|
114
|
+
upgrade command, BMad adoption, project-agent discovery, and model/cost
|
|
115
|
+
reporting remain on the roadmap.
|
|
116
|
+
|
|
117
|
+
## Current commands
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
node dist/cli.js --help
|
|
121
|
+
node dist/cli.js --version
|
|
122
|
+
node dist/cli.js inspect
|
|
123
|
+
node dist/cli.js inspect --root .
|
|
124
|
+
node dist/cli.js apply --dry-run --profile solo-balanced
|
|
125
|
+
node dist/cli.js init --profile solo-balanced
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
`inspect` reads `tito.yaml` when it exists and checks whether `AGENTS.md` is
|
|
129
|
+
present. It does not write to the directory.
|
|
130
|
+
|
|
131
|
+
`apply --dry-run` prints the proposed `tito.yaml` and `AGENTS.md` actions. It
|
|
132
|
+
does not write. `apply` without `--dry-run` is refused.
|
|
133
|
+
|
|
134
|
+
`init` prints the same kind of plan for `tito.yaml`, `AGENTS.md`, and the
|
|
135
|
+
specialist agent files. It writes those files only with `--confirm`, and it
|
|
136
|
+
refuses when an existing file would be overwritten. In chat, `/tito-init` runs
|
|
137
|
+
this same command.
|
|
138
|
+
|
|
139
|
+
## How work moves
|
|
140
|
+
|
|
141
|
+
The normal careful path is:
|
|
142
|
+
|
|
143
|
+
`DISCOVERY → PLANNED → APPROVED → IMPLEMENTING → READY_FOR_REVIEW → APPROVED_FOR_COMMIT → DONE`
|
|
144
|
+
|
|
145
|
+
A small, obvious change can move from discovery directly to an explicitly
|
|
146
|
+
approved slice. Review feedback can return an in-scope slice to implementation.
|
|
147
|
+
Other lifecycle skips are rejected.
|
|
148
|
+
|
|
149
|
+
## Development
|
|
150
|
+
|
|
151
|
+
Requirements:
|
|
152
|
+
|
|
153
|
+
- Node.js 20 or newer
|
|
154
|
+
- npm
|
|
155
|
+
|
|
156
|
+
```sh
|
|
157
|
+
npm install
|
|
158
|
+
npm run build
|
|
159
|
+
npm test
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Acknowledgement
|
|
163
|
+
|
|
164
|
+
Tito is respectfully inspired by Francesc “Tito” Vilanova: quiet leadership,
|
|
165
|
+
continuity, trust, and understanding of the complete system. Tito is not
|
|
166
|
+
affiliated with FC Barcelona.
|
|
167
|
+
|
|
168
|
+
## License
|
|
169
|
+
|
|
170
|
+
Apache-2.0
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { parseArgs } from "node:util";
|
|
4
|
+
import { InspectionError, formatInspection, inspectRepository, } from "./core/inspect.js";
|
|
5
|
+
import { PlanError, formatAdoptionPlan, planAdoption } from "./core/plan.js";
|
|
6
|
+
import { InitError, applyInitialization, formatInitialization, planInitialization, } from "./core/init.js";
|
|
7
|
+
const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
8
|
+
const help = `Tito — quiet orchestration for solo builders
|
|
9
|
+
|
|
10
|
+
Usage:
|
|
11
|
+
tito [options]
|
|
12
|
+
tito inspect [--root <path>]
|
|
13
|
+
tito apply --dry-run --profile <id> [--root <path>]
|
|
14
|
+
tito init --profile <id> [--root <path>] [--confirm]
|
|
15
|
+
|
|
16
|
+
Options:
|
|
17
|
+
-h, --help Show help
|
|
18
|
+
-v, --version Show version
|
|
19
|
+
|
|
20
|
+
Commands:
|
|
21
|
+
inspect Report tito.yaml and AGENTS.md. Reads only.
|
|
22
|
+
apply Dry-run an adoption plan. Writes are not available.
|
|
23
|
+
init Install Tito files and specialist agents. Confirm before writing.
|
|
24
|
+
`;
|
|
25
|
+
function fail(message) {
|
|
26
|
+
process.stderr.write(`${message}\n`);
|
|
27
|
+
process.exitCode = 1;
|
|
28
|
+
}
|
|
29
|
+
function runInspect(args) {
|
|
30
|
+
if (args.includes("-h") || args.includes("--help")) {
|
|
31
|
+
process.stdout.write(help);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
let root = process.cwd();
|
|
35
|
+
try {
|
|
36
|
+
const { values } = parseArgs({
|
|
37
|
+
args,
|
|
38
|
+
options: { root: { type: "string" } },
|
|
39
|
+
strict: true,
|
|
40
|
+
allowPositionals: false,
|
|
41
|
+
});
|
|
42
|
+
if (values.root !== undefined)
|
|
43
|
+
root = values.root;
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
fail(error instanceof Error ? error.message : "Invalid inspect arguments.");
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
process.stdout.write(formatInspection(inspectRepository(root)));
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
if (error instanceof InspectionError) {
|
|
54
|
+
fail(`${error.code}: ${error.message}`);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function runApply(args) {
|
|
61
|
+
if (args.includes("-h") || args.includes("--help")) {
|
|
62
|
+
process.stdout.write(help);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
let root = process.cwd();
|
|
66
|
+
let profile;
|
|
67
|
+
let dryRun = false;
|
|
68
|
+
try {
|
|
69
|
+
const { values } = parseArgs({
|
|
70
|
+
args,
|
|
71
|
+
options: {
|
|
72
|
+
"dry-run": { type: "boolean" },
|
|
73
|
+
profile: { type: "string" },
|
|
74
|
+
root: { type: "string" },
|
|
75
|
+
},
|
|
76
|
+
strict: true,
|
|
77
|
+
allowPositionals: false,
|
|
78
|
+
});
|
|
79
|
+
dryRun = values["dry-run"] === true;
|
|
80
|
+
if (values.profile !== undefined)
|
|
81
|
+
profile = values.profile;
|
|
82
|
+
if (values.root !== undefined)
|
|
83
|
+
root = values.root;
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
fail(error instanceof Error ? error.message : "Invalid apply arguments.");
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (!dryRun) {
|
|
90
|
+
fail("apply writes are not available. Re-run with --dry-run.");
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (profile === undefined) {
|
|
94
|
+
fail("Missing required option --profile.");
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
const plan = planAdoption(inspectRepository(root), profile);
|
|
99
|
+
process.stdout.write(formatAdoptionPlan(plan));
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
if (error instanceof InspectionError || error instanceof PlanError) {
|
|
103
|
+
fail(`${error.code}: ${error.message}`);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
throw error;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function runInit(args) {
|
|
110
|
+
if (args.includes("-h") || args.includes("--help")) {
|
|
111
|
+
process.stdout.write(help);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
let root = process.cwd();
|
|
115
|
+
let profile;
|
|
116
|
+
let confirm = false;
|
|
117
|
+
try {
|
|
118
|
+
const { values } = parseArgs({
|
|
119
|
+
args,
|
|
120
|
+
options: {
|
|
121
|
+
confirm: { type: "boolean" },
|
|
122
|
+
profile: { type: "string" },
|
|
123
|
+
root: { type: "string" },
|
|
124
|
+
},
|
|
125
|
+
strict: true,
|
|
126
|
+
allowPositionals: false,
|
|
127
|
+
});
|
|
128
|
+
confirm = values.confirm === true;
|
|
129
|
+
if (values.profile !== undefined)
|
|
130
|
+
profile = values.profile;
|
|
131
|
+
if (values.root !== undefined)
|
|
132
|
+
root = values.root;
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
fail(error instanceof Error ? error.message : "Invalid init arguments.");
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (profile === undefined) {
|
|
139
|
+
fail("Missing required option --profile.");
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
try {
|
|
143
|
+
const plan = planInitialization(inspectRepository(root), profile);
|
|
144
|
+
if (!confirm) {
|
|
145
|
+
process.stdout.write(formatInitialization(plan));
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
applyInitialization(plan);
|
|
149
|
+
process.stdout.write(formatInitialization(plan));
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
if (error instanceof InspectionError || error instanceof PlanError || error instanceof InitError) {
|
|
153
|
+
fail(`${error.code}: ${error.message}`);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (typeof error === "object" &&
|
|
157
|
+
error !== null &&
|
|
158
|
+
"code" in error &&
|
|
159
|
+
error.code === "EPERM") {
|
|
160
|
+
fail("filesystem: Tito could not create .cursor/agents.");
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
throw error;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function run(args) {
|
|
167
|
+
if (args[0] === "inspect") {
|
|
168
|
+
runInspect(args.slice(1));
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (args[0] === "apply") {
|
|
172
|
+
runApply(args.slice(1));
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (args[0] === "init") {
|
|
176
|
+
runInit(args.slice(1));
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
let helpRequested = false;
|
|
180
|
+
let versionRequested = false;
|
|
181
|
+
try {
|
|
182
|
+
const { values } = parseArgs({
|
|
183
|
+
args,
|
|
184
|
+
options: {
|
|
185
|
+
help: { type: "boolean", short: "h" },
|
|
186
|
+
version: { type: "boolean", short: "v" },
|
|
187
|
+
},
|
|
188
|
+
strict: true,
|
|
189
|
+
allowPositionals: false,
|
|
190
|
+
});
|
|
191
|
+
helpRequested = values.help === true;
|
|
192
|
+
versionRequested = values.version === true;
|
|
193
|
+
}
|
|
194
|
+
catch (error) {
|
|
195
|
+
fail(error instanceof Error ? error.message : "Invalid arguments.");
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (helpRequested) {
|
|
199
|
+
process.stdout.write(help);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if (versionRequested) {
|
|
203
|
+
process.stdout.write(`${packageJson.version}\n`);
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
process.stdout.write(help);
|
|
207
|
+
}
|
|
208
|
+
run(process.argv.slice(2));
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { SPECIALIST_IDS, SPECIALISTS } from "./specialists.js";
|
|
2
|
+
const AGENT_FILE_NAMES = {
|
|
3
|
+
explorer: "tito-explorer.md",
|
|
4
|
+
"product-analyst": "tito-product.md",
|
|
5
|
+
architect: "tito-architect.md",
|
|
6
|
+
"backend-engineer": "tito-backend.md",
|
|
7
|
+
"frontend-engineer": "tito-frontend.md",
|
|
8
|
+
"devops-engineer": "tito-devops.md",
|
|
9
|
+
"erp-specialist": "tito-erp.md",
|
|
10
|
+
"qa-reviewer": "tito-qa.md",
|
|
11
|
+
"security-reviewer": "tito-security.md",
|
|
12
|
+
"tech-docs-writer": "tito-tech-docs.md",
|
|
13
|
+
"user-docs-writer": "tito-user-docs.md",
|
|
14
|
+
};
|
|
15
|
+
export function cursorAgentPath(id) {
|
|
16
|
+
return `.cursor/agents/${AGENT_FILE_NAMES[id]}`;
|
|
17
|
+
}
|
|
18
|
+
export function compileCursorAgent(id) {
|
|
19
|
+
const manifest = SPECIALISTS[id];
|
|
20
|
+
const readOnly = manifest.modes.every((mode) => mode.capability === "read-only");
|
|
21
|
+
const modes = manifest.modes
|
|
22
|
+
.map((mode) => `- \`${mode.id}\`: ${mode.capability}`)
|
|
23
|
+
.join("\n");
|
|
24
|
+
const knowledge = manifest.knowledge
|
|
25
|
+
.map((item) => `- \`${item.id}\` (${item.load})`)
|
|
26
|
+
.join("\n");
|
|
27
|
+
return `---
|
|
28
|
+
name: ${AGENT_FILE_NAMES[id].replace(/\.md$/, "")}
|
|
29
|
+
description: >
|
|
30
|
+
${manifest.role}. Tito delegates this specialist only for: ${manifest.triggers.join("; ")}.
|
|
31
|
+
You are not the root coordinator. Follow the assigned mode and stop condition.
|
|
32
|
+
model: inherit
|
|
33
|
+
readonly: ${readOnly}
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
# ${manifest.role}
|
|
37
|
+
|
|
38
|
+
You are \`${id}\`, delegated by Tito. You are not the root coordinator.
|
|
39
|
+
|
|
40
|
+
## Modes
|
|
41
|
+
|
|
42
|
+
${modes}
|
|
43
|
+
|
|
44
|
+
Use only the mode named in Tito's task packet. A read-only mode must not edit files. A mutating mode may change only the approved slice.
|
|
45
|
+
|
|
46
|
+
## Load when relevant
|
|
47
|
+
|
|
48
|
+
${knowledge}
|
|
49
|
+
|
|
50
|
+
Do not restate project documentation. Load it only when the task needs it.
|
|
51
|
+
|
|
52
|
+
## Handoffs
|
|
53
|
+
|
|
54
|
+
Return the result to Tito. Suggest another specialist only from this manifest's handoff list.
|
|
55
|
+
|
|
56
|
+
## Stop
|
|
57
|
+
|
|
58
|
+
${manifest.stopCondition}
|
|
59
|
+
`;
|
|
60
|
+
}
|
|
61
|
+
export function compiledCursorAgents() {
|
|
62
|
+
return SPECIALIST_IDS.map((id) => ({
|
|
63
|
+
path: cursorAgentPath(id),
|
|
64
|
+
body: compileCursorAgent(id),
|
|
65
|
+
}));
|
|
66
|
+
}
|