@lotagate/cli 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.md +21 -0
- package/README.md +251 -0
- package/SECURITY.md +96 -0
- package/bin/lotagate.exe +1 -0
- package/bin/lotagate.mjs +12 -0
- package/native-targets.mjs +35 -0
- package/package.json +91 -0
- package/scripts/install-native.mjs +69 -0
- package/skills/api-contract-review/SKILL.md +17 -0
- package/skills/architecture-review/SKILL.md +22 -0
- package/skills/code-review/SKILL.md +20 -0
- package/skills/database-review/SKILL.md +17 -0
- package/skills/debugging/SKILL.md +20 -0
- package/skills/dependency-review/SKILL.md +16 -0
- package/skills/documentation/SKILL.md +16 -0
- package/skills/feature-implementation/SKILL.md +25 -0
- package/skills/frontend-review/SKILL.md +18 -0
- package/skills/incident-response/SKILL.md +18 -0
- package/skills/performance-review/SKILL.md +17 -0
- package/skills/refactor/SKILL.md +23 -0
- package/skills/release-readiness/SKILL.md +16 -0
- package/skills/security-review/SKILL.md +16 -0
- package/skills/test-plan/SKILL.md +22 -0
- package/skills/verify/SKILL.md +13 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 LotaGate
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
# @lotagate/cli
|
|
2
|
+
|
|
3
|
+
@lotagate/cli is the terminal client for LotaGate AI agents. It provides an interactive streaming TUI, a headless automation interface, durable project-scoped sessions, local tools with approval controls, MCP, plugins, skills, hooks, and image, audio, and video commands.
|
|
4
|
+
|
|
5
|
+
The CLI consumes @lotagate/sdk and @lotagate/agent-sdk as independent npm dependencies. CLI-specific policy, persistence, terminal presentation, local filesystem and shell integrations remain owned by this package.
|
|
6
|
+
|
|
7
|
+
## Highlights
|
|
8
|
+
|
|
9
|
+
- Interactive terminal workspace with streaming responses, slash commands, model selection, attachments, tool activity, and approval prompts.
|
|
10
|
+
- Headless exec and JSONL agent protocol for scripts and integrations.
|
|
11
|
+
- Project trust, explicit tool approval, workspace confinement, safe process execution, and encrypted local API-key storage.
|
|
12
|
+
- Durable sessions, context compaction, resumable goals, and bounded subagents.
|
|
13
|
+
- User- and project-scoped MCP servers, plugins, skills, and hooks.
|
|
14
|
+
- Image, audio, speech, transcription, translation, and video workflows.
|
|
15
|
+
- Native executable installation on supported Windows, macOS, and glibc Linux hosts, with a verified Node launcher fallback elsewhere.
|
|
16
|
+
|
|
17
|
+
## Requirements
|
|
18
|
+
|
|
19
|
+
- Node.js 22 or later for installation, development, and Node-launcher hosts.
|
|
20
|
+
- A LotaGate API key and at least one model available from the configured API endpoint.
|
|
21
|
+
- A terminal with ANSI input/output support for the interactive client.
|
|
22
|
+
|
|
23
|
+
Native installations run independently after npm has installed the matching artifact. Node.js remains required on fallback hosts and for package-management commands.
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
Install globally:
|
|
28
|
+
|
|
29
|
+
~~~bash
|
|
30
|
+
npm install --global @lotagate/cli
|
|
31
|
+
lotagate --help
|
|
32
|
+
~~~
|
|
33
|
+
|
|
34
|
+
Or invoke the current package without a global installation:
|
|
35
|
+
|
|
36
|
+
~~~bash
|
|
37
|
+
npx @lotagate/cli --help
|
|
38
|
+
~~~
|
|
39
|
+
|
|
40
|
+
### Native executable distribution
|
|
41
|
+
|
|
42
|
+
The main package selects a matching optional native package during installation and verifies its SHA-256 checksum before replacing the launcher. This gives the process its own LotaGate identity, such as lotagate.exe in Windows Task Manager. Do not install with --ignore-scripts or --omit=optional; either option prevents native installation.
|
|
43
|
+
|
|
44
|
+
| Distribution | Hosts | Architectures |
|
|
45
|
+
| --- | --- | --- |
|
|
46
|
+
| Native executable | Windows, macOS, glibc Linux | x64, ARM64 |
|
|
47
|
+
| Node launcher fallback | Alpine/musl Linux, Android/Termux, FreeBSD, OpenBSD, NetBSD | Architectures supported by Node.js |
|
|
48
|
+
|
|
49
|
+
Windows native binaries include the LotaGate icon but are not code-signed. Windows may therefore show its normal unsigned-publisher warning on first run. This does not affect npm installation or normal execution.
|
|
50
|
+
|
|
51
|
+
## Quick start
|
|
52
|
+
|
|
53
|
+
~~~bash
|
|
54
|
+
# Save an API-key profile. The command masks the key input.
|
|
55
|
+
lotagate auth login
|
|
56
|
+
|
|
57
|
+
# Fetch available models and select one.
|
|
58
|
+
lotagate model list
|
|
59
|
+
lotagate model use <model-id>
|
|
60
|
+
|
|
61
|
+
# Start the interactive workspace.
|
|
62
|
+
lotagate
|
|
63
|
+
~~~
|
|
64
|
+
|
|
65
|
+
When the interactive workspace starts in a new project, it asks whether to trust that project. Until trust is granted, local filesystem tools, shell commands, project MCP servers, plugins, skills, and hooks cannot run.
|
|
66
|
+
|
|
67
|
+
## Interactive workspace
|
|
68
|
+
|
|
69
|
+
Run lotagate to open the TUI. Type / to browse interactive commands.
|
|
70
|
+
|
|
71
|
+
| Input | Action |
|
|
72
|
+
| --- | --- |
|
|
73
|
+
| Enter | Send the prompt or run the selected command |
|
|
74
|
+
| Shift+Enter | Insert a newline |
|
|
75
|
+
| Tab | Complete the active command suggestion |
|
|
76
|
+
| Esc | Cancel an active response; when idle, clear the draft safely |
|
|
77
|
+
| Ctrl+V | Paste text |
|
|
78
|
+
| Alt+V | Paste an image when the host clipboard supports it |
|
|
79
|
+
|
|
80
|
+
Use /model to select a model. Media slash commands prompt for a compatible request-only model when --model is omitted; the selection applies only to that command and never changes the active root model.
|
|
81
|
+
|
|
82
|
+
Common commands:
|
|
83
|
+
|
|
84
|
+
~~~text
|
|
85
|
+
/help
|
|
86
|
+
/context
|
|
87
|
+
/session list
|
|
88
|
+
/session resume <id>
|
|
89
|
+
/goal <objective>
|
|
90
|
+
/details
|
|
91
|
+
/exit
|
|
92
|
+
~~~
|
|
93
|
+
|
|
94
|
+
The TUI records durable conversation state by project identity. It renders tool activity and approval choices below the composer, while the transcript remains scrollable with the session.
|
|
95
|
+
|
|
96
|
+
## Direct commands and automation
|
|
97
|
+
|
|
98
|
+
Use direct commands for scripts and non-interactive tasks:
|
|
99
|
+
|
|
100
|
+
~~~bash
|
|
101
|
+
# A direct chat completion.
|
|
102
|
+
lotagate chat "Summarize the current project."
|
|
103
|
+
|
|
104
|
+
# A trusted, tool-capable headless agent run.
|
|
105
|
+
lotagate exec "Inspect the repository and report the test command."
|
|
106
|
+
|
|
107
|
+
# A durable multi-turn objective.
|
|
108
|
+
lotagate goal run "Audit the project configuration" --max-turns 20
|
|
109
|
+
|
|
110
|
+
# Machine-readable agent protocol over standard input/output.
|
|
111
|
+
lotagate agent stdio
|
|
112
|
+
~~~
|
|
113
|
+
|
|
114
|
+
lotagate exec --json and lotagate exec --jsonl provide structured output for automation. lotagate agent stdio exposes the versioned JSONL protocol; it validates requests, bounds in-flight work, supports cancellation, and emits safe structured errors instead of raw provider failures.
|
|
115
|
+
|
|
116
|
+
Run lotagate help for the complete direct-command reference. The executable command catalog is the source of truth for command arguments and flags.
|
|
117
|
+
|
|
118
|
+
## Models and media
|
|
119
|
+
|
|
120
|
+
The CLI fetches its model catalog from LotaGate; it does not hardcode model identifiers. --model <model-id> overrides the model for one media request only.
|
|
121
|
+
|
|
122
|
+
~~~bash
|
|
123
|
+
lotagate image "A red fox reading in a library" --size 1024x1024
|
|
124
|
+
lotagate image edit "Make the sky a sunset" --image assets/source.png
|
|
125
|
+
|
|
126
|
+
lotagate audio speech "Welcome to LotaGate" --voice alloy --response-format mp3
|
|
127
|
+
lotagate audio transcribe --file recordings/interview.wav --response-format srt
|
|
128
|
+
lotagate audio translate --file recordings/interview.wav --response-format text
|
|
129
|
+
|
|
130
|
+
lotagate video "A paper boat sailing through a city canal" \
|
|
131
|
+
--parameters '{"durationSeconds":8}'
|
|
132
|
+
lotagate video status <operation-id>
|
|
133
|
+
lotagate video download <operation-id>
|
|
134
|
+
~~~
|
|
135
|
+
|
|
136
|
+
All media inputs and outputs are confined to a trusted workspace. Generated artifacts default to dedicated directories below <workspace>/tmp/; use --out <file> for an exact path or --out-dir <directory> for a directory. The CLI does not overwrite an artifact unless --force is supplied with --out.
|
|
137
|
+
|
|
138
|
+
Video creation is asynchronous. It normally waits for the gateway operation and downloads the final artifact. Use --no-wait to return the operation ID, then use video status and video download later. The CLI never polls a provider directly; the LotaGate gateway owns provider credentials and polling.
|
|
139
|
+
|
|
140
|
+
## Trust, local tools, and approvals
|
|
141
|
+
|
|
142
|
+
Trust is project-scoped and explicit:
|
|
143
|
+
|
|
144
|
+
~~~bash
|
|
145
|
+
lotagate trust status
|
|
146
|
+
lotagate trust grant
|
|
147
|
+
lotagate trust revoke
|
|
148
|
+
~~~
|
|
149
|
+
|
|
150
|
+
In a trusted project, local tools remain bounded by workspace path validation, symlink escape checks, structured shell arguments, output and timeout limits, and the approval policy. A tool approval allows or denies that one action; the TUI can remember a narrow local rule for a previously approved operation.
|
|
151
|
+
|
|
152
|
+
Project policy lives in <project>/.lotagate/settings.json. For example:
|
|
153
|
+
|
|
154
|
+
~~~json
|
|
155
|
+
{
|
|
156
|
+
"schemaVersion": 1,
|
|
157
|
+
"permissions": {
|
|
158
|
+
"allow": ["shell.exec:git status"],
|
|
159
|
+
"ask": ["filesystem.write:src/*"],
|
|
160
|
+
"deny": ["shell.exec:git push*"]
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
~~~
|
|
164
|
+
|
|
165
|
+
deny takes precedence over ask and allow. Local remembered approvals are stored separately in settings.local.json, which is intended to remain out of shared project configuration.
|
|
166
|
+
|
|
167
|
+
## Extensions
|
|
168
|
+
|
|
169
|
+
Extensions are either user-scoped or project-scoped. Direct commands require an explicit --scope user|project; the interactive client presents a selector when a scope is omitted. Project scope requires project trust.
|
|
170
|
+
|
|
171
|
+
~~~bash
|
|
172
|
+
# Add an MCP server to the trusted project.
|
|
173
|
+
lotagate mcp add filesystem --type stdio --command npx \
|
|
174
|
+
--args "-y,@modelcontextprotocol/server-filesystem,." --scope project
|
|
175
|
+
|
|
176
|
+
# Review configured integrations.
|
|
177
|
+
lotagate mcp list
|
|
178
|
+
lotagate plugin list
|
|
179
|
+
lotagate skill list
|
|
180
|
+
lotagate hook list
|
|
181
|
+
|
|
182
|
+
# Install a verified plugin or standalone skill.
|
|
183
|
+
lotagate plugin install <source> --scope user --sha256 <sha256>
|
|
184
|
+
~~~
|
|
185
|
+
|
|
186
|
+
Plugins are declarative packages with .lotagate-plugin/plugin.json. The CLI copies and validates them atomically; it does not run package-install scripts. Skills are validated SKILL.md directories and can be user, project, plugin, or immutable bundled skills. Project hooks are loaded only from <project>/.lotagate/hooks/ in a trusted project.
|
|
187
|
+
|
|
188
|
+
## Configuration and data
|
|
189
|
+
|
|
190
|
+
Configuration is merged in this order, with later layers taking precedence:
|
|
191
|
+
|
|
192
|
+
1. <home>/.lotagate/settings.json
|
|
193
|
+
2. <project>/.lotagate/settings.json
|
|
194
|
+
3. <project>/.lotagate/settings.local.json
|
|
195
|
+
|
|
196
|
+
Run lotagate config path to see the actual paths on the current host. Credentials are encrypted locally and are never written to settings.json or shown in diagnostic output.
|
|
197
|
+
|
|
198
|
+
| Location | Purpose |
|
|
199
|
+
| --- | --- |
|
|
200
|
+
| <home>/.lotagate/credentials.enc.json | Encrypted API-key profiles |
|
|
201
|
+
| <home>/.lotagate/projects/ | Project-scoped session journals, attachments, locks, and subagent records |
|
|
202
|
+
| <home>/.lotagate/skills/ and plugins/ | User extensions |
|
|
203
|
+
| <home>/.lotagate/mcp.json | User MCP configuration |
|
|
204
|
+
| <home>/.lotagate/cache/ and logs/ | Bounded cache and redacted operational logs |
|
|
205
|
+
| <project>/.lotagate/ | Reviewable project configuration and project extensions |
|
|
206
|
+
|
|
207
|
+
Use LOTAGATE_HOME to choose the parent home used for global CLI storage. For non-persistent automation credentials, set LOTAGATE_API_KEY; optional LOTAGATE_BASE_URL and LOTAGATE_PROFILE select its endpoint and profile. Environment credentials are read-only and are not persisted.
|
|
208
|
+
|
|
209
|
+
Operational controls:
|
|
210
|
+
|
|
211
|
+
| Variable | Purpose |
|
|
212
|
+
| --- | --- |
|
|
213
|
+
| LOTAGATE_CACHE_ENABLED | Enable or disable the local cache |
|
|
214
|
+
| LOTAGATE_MODEL_CACHE_TTL_SECONDS | Model-catalog cache lifetime |
|
|
215
|
+
| LOTAGATE_CACHE_MAX_ENTRY_BYTES / LOTAGATE_CACHE_MAX_BYTES | Cache size limits |
|
|
216
|
+
| LOTAGATE_LOG_LEVEL / LOTAGATE_LOG_RETENTION_DAYS | Redacted log policy |
|
|
217
|
+
| LOTAGATE_VIDEO_POLL_INTERVAL_MS / LOTAGATE_VIDEO_WAIT_TIMEOUT_MS | Local video wait policy |
|
|
218
|
+
| LOTAGATE_MEDIA_DOWNLOAD_TIMEOUT_MS | Generated-media download timeout |
|
|
219
|
+
| LOTAGATE_ASCII=1 | Use ASCII-only terminal symbols |
|
|
220
|
+
|
|
221
|
+
## Sessions, goals, and subagents
|
|
222
|
+
|
|
223
|
+
Sessions are durable but isolated by canonical project identity. Resume or inspect them with lotagate session list, lotagate session show <id>, and lotagate session resume <id> --interactive. The CLI can compact a session to retain bounded context while preserving the system instructions and a durable summary.
|
|
224
|
+
|
|
225
|
+
Goals make a multi-turn objective resumable:
|
|
226
|
+
|
|
227
|
+
~~~bash
|
|
228
|
+
lotagate goal run "Prepare a release checklist" --token-budget 50000
|
|
229
|
+
lotagate goal status <session-id> --json
|
|
230
|
+
lotagate goal pause <session-id>
|
|
231
|
+
lotagate goal resume <session-id>
|
|
232
|
+
~~~
|
|
233
|
+
|
|
234
|
+
Trusted agents can delegate bounded research or explicitly scoped worker tasks to subagents. Child agents cannot create unrestricted nested work, and a safety-limit stop returns a resumable handoff rather than silently continuing.
|
|
235
|
+
|
|
236
|
+
## Supported hosts
|
|
237
|
+
|
|
238
|
+
The CLI centralizes host detection and supports Windows, Linux, macOS, and BSD (FreeBSD, OpenBSD, NetBSD); Android is handled through the Linux path. It selects platform-specific process, path, and clipboard behavior at startup.
|
|
239
|
+
|
|
240
|
+
On Linux and BSD, image clipboard paste requires wl-paste or xclip. If no provider is available, the CLI reports that clipboard capability as unavailable instead of falling back to an unsafe shell command.
|
|
241
|
+
|
|
242
|
+
## Security and support
|
|
243
|
+
|
|
244
|
+
See [SECURITY.md](SECURITY.md) for vulnerability reporting and security controls. The CLI redacts known sensitive values from operational logs and keeps provider failures out of the machine-readable protocol where possible, but users should still avoid placing credentials or private data in prompts.
|
|
245
|
+
|
|
246
|
+
## Package and licensing
|
|
247
|
+
|
|
248
|
+
- Package: @lotagate/cli
|
|
249
|
+
- License: MIT
|
|
250
|
+
- Website: [LotaGate](https://lotagate.com)
|
|
251
|
+
- Support and bug reports: [Contact LotaGate](https://lotagate.com/contact)
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
This document defines the production security expectations for
|
|
4
|
+
`@lotagate/cli`.
|
|
5
|
+
|
|
6
|
+
## Security boundary
|
|
7
|
+
|
|
8
|
+
The CLI is a local privileged application: it can read and write within a
|
|
9
|
+
trusted workspace, execute approved local processes, connect to configured MCP
|
|
10
|
+
servers and send workspace content to the selected model endpoint. Users and
|
|
11
|
+
operators must treat a trusted project, an installed plugin and an MCP server
|
|
12
|
+
as code and configuration that can cause side effects.
|
|
13
|
+
|
|
14
|
+
## Production controls
|
|
15
|
+
|
|
16
|
+
### Credentials
|
|
17
|
+
|
|
18
|
+
- Authentication uses API keys only.
|
|
19
|
+
- Interactive API-key input is not echoed.
|
|
20
|
+
- Persisted profiles are encrypted with AES-256-GCM.
|
|
21
|
+
- The CLI initializes a random local encryption key on first interactive use;
|
|
22
|
+
operators may provide `LOTAGATE_CREDENTIAL_SECRET` for managed key material.
|
|
23
|
+
- API keys are excluded from settings files, status output and structured logs.
|
|
24
|
+
- CI environment credentials are ephemeral and are never persisted by the CLI.
|
|
25
|
+
- Credential files and session data are created with owner-only permissions
|
|
26
|
+
where the operating system supports them.
|
|
27
|
+
|
|
28
|
+
### Project trust and authorization
|
|
29
|
+
|
|
30
|
+
- A project must be explicitly trusted before local tools, MCP connections or
|
|
31
|
+
project extensions are enabled.
|
|
32
|
+
- Tool approval is deny-by-default for untrusted projects.
|
|
33
|
+
- `ask`, `auto` and `deny` approval modes are validated configuration values.
|
|
34
|
+
- Approval is evaluated at the tool boundary; hiding a command in the UI is not
|
|
35
|
+
treated as authorization.
|
|
36
|
+
|
|
37
|
+
### Filesystem and process execution
|
|
38
|
+
|
|
39
|
+
- Workspace paths are canonicalized and checked for traversal and symlink
|
|
40
|
+
escapes.
|
|
41
|
+
- Shell tools use structured command arguments with `shell: false`.
|
|
42
|
+
- Process execution has bounded output and time limits and supports cancellation.
|
|
43
|
+
- Tool results and clipboard images have explicit size limits.
|
|
44
|
+
- Sensitive bearer and API-key-like values are redacted from process output.
|
|
45
|
+
|
|
46
|
+
### Extensions and MCP
|
|
47
|
+
|
|
48
|
+
- Plugin installation uses an atomic destination update.
|
|
49
|
+
- Plugin packages reject symbolic links and manifest paths that escape the
|
|
50
|
+
plugin directory.
|
|
51
|
+
- SHA-256 integrity verification is supported; Ed25519 verification can be
|
|
52
|
+
required by supplying a trusted public key and detached signature.
|
|
53
|
+
- Skills cannot read supporting files outside their own directory.
|
|
54
|
+
- MCP commands are validated before persistence and connections require project
|
|
55
|
+
trust.
|
|
56
|
+
- Do not install plugins or configure MCP servers from untrusted sources.
|
|
57
|
+
|
|
58
|
+
### Sessions, attachments and logs
|
|
59
|
+
|
|
60
|
+
- Session metadata, journals and attachments are stored under the CLI data root.
|
|
61
|
+
- Session writes use process locks and atomic metadata writes.
|
|
62
|
+
- Attachment bytes are stored separately from transcript metadata.
|
|
63
|
+
- Session export files may contain prompts, responses and image data; protect
|
|
64
|
+
them as confidential records.
|
|
65
|
+
- Do not send logs, exported sessions or diagnostic output to public trackers
|
|
66
|
+
without removing secrets and workspace content.
|
|
67
|
+
|
|
68
|
+
## Operator checklist
|
|
69
|
+
|
|
70
|
+
Before production use:
|
|
71
|
+
|
|
72
|
+
1. Use a dedicated API key with the minimum available service scope.
|
|
73
|
+
2. Set restrictive permissions on the CLI data directory and backup location.
|
|
74
|
+
3. Trust only repositories whose source and extension configuration has been
|
|
75
|
+
reviewed.
|
|
76
|
+
4. Keep approval mode at `ask` unless the workspace and automation boundary are
|
|
77
|
+
controlled and `auto` is explicitly justified.
|
|
78
|
+
5. Review MCP commands, URLs, headers and server ownership.
|
|
79
|
+
6. Verify plugin checksums or signatures through an independent trusted channel.
|
|
80
|
+
7. Apply the organization’s retention policy to sessions, attachments and logs.
|
|
81
|
+
8. Keep Node.js and the CLI package on an approved supported release.
|
|
82
|
+
|
|
83
|
+
## Reporting a vulnerability
|
|
84
|
+
|
|
85
|
+
Do not disclose vulnerabilities, API keys, credentials, image Base64 payloads,
|
|
86
|
+
session exports or private source code in public issues. Report privately to the
|
|
87
|
+
LotaGate maintainers through the security contact configured for the project.
|
|
88
|
+
Include:
|
|
89
|
+
|
|
90
|
+
- affected CLI version and operating system;
|
|
91
|
+
- reproduction steps and required trust/configuration state;
|
|
92
|
+
- impact and security boundary crossed;
|
|
93
|
+
- a minimal proof of concept with secrets removed.
|
|
94
|
+
|
|
95
|
+
Allow maintainers reasonable time to investigate and coordinate a fix. Rotate
|
|
96
|
+
any credential that may have appeared in a report immediately.
|
package/bin/lotagate.exe
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Native executable installation did not complete. Reinstall @lotagate/cli without --ignore-scripts or --omit=optional.
|
package/bin/lotagate.mjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { main } from '../dist/main.js';
|
|
4
|
+
|
|
5
|
+
void main(process.argv.slice(2)).then(
|
|
6
|
+
(exitCode) => { process.exitCode = exitCode; },
|
|
7
|
+
(error) => {
|
|
8
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
9
|
+
process.stderr.write(`lotagate: ${message}\n`);
|
|
10
|
+
process.exitCode = 1;
|
|
11
|
+
},
|
|
12
|
+
);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Native distribution targets. Keep this list aligned with host-platform.ts. */
|
|
2
|
+
export const NATIVE_TARGETS = Object.freeze([
|
|
3
|
+
target('windows-x64', ['win32', 'cygwin'], 'x64'),
|
|
4
|
+
target('windows-arm64', ['win32', 'cygwin'], 'arm64'),
|
|
5
|
+
target('linux-x64-gnu', ['linux'], 'x64', 'gnu'),
|
|
6
|
+
target('linux-arm64-gnu', ['linux'], 'arm64', 'gnu'),
|
|
7
|
+
target('macos-x64', ['darwin'], 'x64'),
|
|
8
|
+
target('macos-arm64', ['darwin'], 'arm64'),
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
export function targetForRuntime(platform, arch, linuxLibc = detectLinuxLibc(platform)) {
|
|
12
|
+
return NATIVE_TARGETS.find((target) => target.platforms.includes(platform)
|
|
13
|
+
&& target.arch === arch
|
|
14
|
+
&& target.libc === linuxLibc);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function targetById(id) {
|
|
18
|
+
return NATIVE_TARGETS.find((target) => target.id === id);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function detectLinuxLibc(platform, report = process.report?.getReport?.()) {
|
|
22
|
+
if (platform !== 'linux') return undefined;
|
|
23
|
+
return report?.header?.glibcVersionRuntime === undefined ? 'musl' : 'gnu';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function target(id, platforms, arch, libc) {
|
|
27
|
+
return Object.freeze({
|
|
28
|
+
id,
|
|
29
|
+
platforms: Object.freeze(platforms),
|
|
30
|
+
arch,
|
|
31
|
+
packageName: `@lotagate/cli-native-${id}`,
|
|
32
|
+
binaryName: 'lotagate.exe',
|
|
33
|
+
libc,
|
|
34
|
+
});
|
|
35
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lotagate/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Enterprise-grade terminal client for LotaGate AI agents.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "LotaGate",
|
|
8
|
+
"homepage": "https://lotagate.com",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/huy20222003/lotagate-cli.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://lotagate.com/contact"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"ai",
|
|
18
|
+
"agent",
|
|
19
|
+
"cli",
|
|
20
|
+
"lotagate",
|
|
21
|
+
"terminal",
|
|
22
|
+
"tui"
|
|
23
|
+
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=22.0.0"
|
|
26
|
+
},
|
|
27
|
+
"packageManager": "npm@11.8.0",
|
|
28
|
+
"bin": {
|
|
29
|
+
"lotagate": "./bin/lotagate.exe"
|
|
30
|
+
},
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"files": [
|
|
33
|
+
"bin/lotagate.exe",
|
|
34
|
+
"bin/lotagate.mjs",
|
|
35
|
+
"dist",
|
|
36
|
+
"scripts/install-native.mjs",
|
|
37
|
+
"native-targets.mjs",
|
|
38
|
+
"skills",
|
|
39
|
+
"README.md",
|
|
40
|
+
"LICENSE.md",
|
|
41
|
+
"SECURITY.md"
|
|
42
|
+
],
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "node ./scripts/build.mjs",
|
|
48
|
+
"build:native": "node ./scripts/build-native.mjs",
|
|
49
|
+
"package:native": "node ./scripts/create-native-target-package.mjs",
|
|
50
|
+
"dev": "npm run build && node ./bin/lotagate.mjs",
|
|
51
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
52
|
+
"typecheck:test": "tsc -p tsconfig.test.json --noEmit",
|
|
53
|
+
"lint": "eslint .",
|
|
54
|
+
"test": "tsx --test test/**/*.test.ts test/**/*.test.tsx",
|
|
55
|
+
"test:integration": "tsx --test test/integration/**/*.test.ts",
|
|
56
|
+
"test:native": "node ./scripts/test-native-install.mjs",
|
|
57
|
+
"test:package": "npm run build && node test/package-smoke.mjs",
|
|
58
|
+
"pack:check": "npm pack --dry-run",
|
|
59
|
+
"postinstall": "node ./scripts/install-native.mjs",
|
|
60
|
+
"prepack": "npm run build"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@lotagate/agent-sdk": "^0.1.4",
|
|
64
|
+
"@lotagate/sdk": "^0.1.2",
|
|
65
|
+
"ink": "^7.1.1",
|
|
66
|
+
"react": "^19.2.4",
|
|
67
|
+
"tiktoken": "^1.0.22"
|
|
68
|
+
},
|
|
69
|
+
"optionalDependencies": {
|
|
70
|
+
"@lotagate/cli-native-linux-arm64-gnu": "0.1.0",
|
|
71
|
+
"@lotagate/cli-native-linux-x64-gnu": "0.1.0",
|
|
72
|
+
"@lotagate/cli-native-macos-arm64": "0.1.0",
|
|
73
|
+
"@lotagate/cli-native-macos-x64": "0.1.0",
|
|
74
|
+
"@lotagate/cli-native-windows-arm64": "0.1.0",
|
|
75
|
+
"@lotagate/cli-native-windows-x64": "0.1.0"
|
|
76
|
+
},
|
|
77
|
+
"devDependencies": {
|
|
78
|
+
"@eslint/js": "9.39.5",
|
|
79
|
+
"@types/node": "20.19.43",
|
|
80
|
+
"@types/react": "^19.2.4",
|
|
81
|
+
"@typescript-eslint/eslint-plugin": "8.65.0",
|
|
82
|
+
"@typescript-eslint/parser": "8.65.0",
|
|
83
|
+
"esbuild": "0.28.2",
|
|
84
|
+
"eslint": "9.39.5",
|
|
85
|
+
"globals": "16.4.0",
|
|
86
|
+
"ink-testing-library": "^4.0.0",
|
|
87
|
+
"resedit": "3.0.2",
|
|
88
|
+
"tsx": "4.23.12",
|
|
89
|
+
"typescript": "5.9.3"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { copyFile, mkdir, readFile, rename, rm, stat } from 'node:fs/promises';
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
4
|
+
import { dirname, resolve } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { targetForRuntime } from '../native-targets.mjs';
|
|
7
|
+
|
|
8
|
+
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
9
|
+
const target = targetForRuntime(process.platform, process.arch);
|
|
10
|
+
|
|
11
|
+
if (existsSync(resolve(packageRoot, '.git'))) process.exit(0);
|
|
12
|
+
|
|
13
|
+
if (target === undefined) await installNodeFallback();
|
|
14
|
+
else await installNativeTarget(target);
|
|
15
|
+
|
|
16
|
+
async function installNativeTarget(nativeTarget) {
|
|
17
|
+
const nativePackageRoot = resolve(packageRoot, 'node_modules', ...nativeTarget.packageName.split('/'));
|
|
18
|
+
const source = resolve(nativePackageRoot, 'bin', nativeTarget.binaryName);
|
|
19
|
+
const destination = resolve(packageRoot, 'bin', nativeTarget.binaryName);
|
|
20
|
+
const metadataFile = resolve(nativePackageRoot, 'package.json');
|
|
21
|
+
const cliMetadataFile = resolve(packageRoot, 'package.json');
|
|
22
|
+
try {
|
|
23
|
+
const [metadataText, cliMetadataText, sourceStat] = await Promise.all([readFile(metadataFile, 'utf8'), readFile(cliMetadataFile, 'utf8'), stat(source)]);
|
|
24
|
+
if (!sourceStat.isFile()) fail(`Native artifact is invalid: ${nativeTarget.packageName}.`);
|
|
25
|
+
const metadata = JSON.parse(metadataText);
|
|
26
|
+
const cliMetadata = JSON.parse(cliMetadataText);
|
|
27
|
+
const declared = metadata.lotagateNative;
|
|
28
|
+
if (metadata.name !== nativeTarget.packageName || metadata.version !== cliMetadata.version) fail(`Native artifact metadata does not match @lotagate/cli ${String(cliMetadata.version)}.`);
|
|
29
|
+
if (declared?.target !== nativeTarget.id || declared?.sha256 !== await sha256(source)) fail(`Native artifact integrity validation failed: ${nativeTarget.packageName}.`);
|
|
30
|
+
await installExecutable(source, destination);
|
|
31
|
+
} catch (error) {
|
|
32
|
+
await rm(destination, { force: true }).catch(() => undefined);
|
|
33
|
+
fail(error instanceof Error ? error.message : String(error));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async function installNodeFallback() {
|
|
38
|
+
if (process.platform === 'win32' || process.platform === 'cygwin') fail(`No native LotaGate CLI artifact is available for ${process.platform}/${process.arch}.`);
|
|
39
|
+
const destination = resolve(packageRoot, 'bin', 'lotagate.exe');
|
|
40
|
+
try {
|
|
41
|
+
await installExecutable(resolve(packageRoot, 'bin', 'lotagate.mjs'), destination);
|
|
42
|
+
} catch (error) {
|
|
43
|
+
await rm(destination, { force: true }).catch(() => undefined);
|
|
44
|
+
fail(`Node launcher installation failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function installExecutable(source, destination) {
|
|
49
|
+
const temporary = `${destination}.install-${process.pid}-${Date.now()}`;
|
|
50
|
+
await mkdir(dirname(destination), { recursive: true });
|
|
51
|
+
await copyFile(source, temporary);
|
|
52
|
+
await chmodExecutable(temporary);
|
|
53
|
+
await rename(temporary, destination);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function sha256(filePath) {
|
|
57
|
+
return createHash('sha256').update(await readFile(filePath)).digest('hex');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function chmodExecutable(filePath) {
|
|
61
|
+
if (process.platform !== 'win32') await import('node:fs/promises').then(({ chmod }) => chmod(filePath, 0o755));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function fail(message) {
|
|
65
|
+
process.stderr.write(`@lotagate/cli: ${message}\n`);
|
|
66
|
+
process.stderr.write('Reinstall without --ignore-scripts or --omit=optional.\n');
|
|
67
|
+
process.exitCode = 1;
|
|
68
|
+
throw new Error(message);
|
|
69
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-contract-review
|
|
3
|
+
description: Review an API contract, adapter or protocol flow for compatibility, validation and failure behavior.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
model-invocable: true
|
|
6
|
+
allowed-tools: [filesystem.read, filesystem.list]
|
|
7
|
+
---
|
|
8
|
+
# API contract review
|
|
9
|
+
|
|
10
|
+
Trace the request and response from the public boundary through validation,
|
|
11
|
+
application logic, adapters and mapping.
|
|
12
|
+
|
|
13
|
+
Check input and output schemas, optionality, backward compatibility, error
|
|
14
|
+
codes, authentication, authorization, timeouts, retries, cancellation,
|
|
15
|
+
pagination, idempotency and sensitive data exposure. Compare the contract with
|
|
16
|
+
callers and tests. Report evidence-backed findings and distinguish runtime
|
|
17
|
+
verification requirements from confirmed behavior.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architecture-review
|
|
3
|
+
description: Trace a feature end to end and assess ownership, boundaries and extensibility.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
model-invocable: true
|
|
6
|
+
allowed-tools: [filesystem.read, filesystem.list]
|
|
7
|
+
---
|
|
8
|
+
# Architecture review
|
|
9
|
+
|
|
10
|
+
Analyze the requested feature using evidence from the repository.
|
|
11
|
+
|
|
12
|
+
1. Identify the entry point, owning module and allowed dependency direction.
|
|
13
|
+
2. Trace the flow through validation, application logic, ports, infrastructure
|
|
14
|
+
adapters and presentation boundaries.
|
|
15
|
+
3. Reuse existing abstractions before proposing new files or dependencies.
|
|
16
|
+
4. Check for duplicated business rules, leaky infrastructure details and
|
|
17
|
+
unclear ownership.
|
|
18
|
+
5. Propose the smallest complete design that preserves contracts and supports
|
|
19
|
+
testing, operations and future extension; do not defer required behavior.
|
|
20
|
+
|
|
21
|
+
Clearly distinguish confirmed facts from recommendations and runtime
|
|
22
|
+
verification requirements.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: Review a change for correctness, security, maintainability and regression risk.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
model-invocable: true
|
|
6
|
+
allowed-tools: [filesystem.read, filesystem.list]
|
|
7
|
+
---
|
|
8
|
+
# Code review
|
|
9
|
+
|
|
10
|
+
Review the requested repository scope as a production code review.
|
|
11
|
+
|
|
12
|
+
1. Trace the affected execution flow before forming conclusions.
|
|
13
|
+
2. Inspect the relevant callers, callees, contracts, validation and tests.
|
|
14
|
+
3. Report confirmed defects before style preferences.
|
|
15
|
+
4. For every finding, include severity, confidence, file/location, evidence,
|
|
16
|
+
impact and a focused remediation.
|
|
17
|
+
5. Check security boundaries, error paths, cancellation, resource cleanup and
|
|
18
|
+
regression coverage.
|
|
19
|
+
|
|
20
|
+
Do not modify files unless the user explicitly asks for implementation.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: database-review
|
|
3
|
+
description: Review database access for correctness, integrity, query behavior and concurrency safety.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
model-invocable: true
|
|
6
|
+
allowed-tools: [filesystem.read, filesystem.list]
|
|
7
|
+
---
|
|
8
|
+
# Database review
|
|
9
|
+
|
|
10
|
+
Trace repositories, queries, transactions and constraints through their
|
|
11
|
+
callers. Inspect filtering, tenant isolation, soft deletion, pagination,
|
|
12
|
+
indexes, joins, read-modify-write races, unique constraints, lock behavior and
|
|
13
|
+
external calls inside transactions.
|
|
14
|
+
|
|
15
|
+
Do not recommend an index or schema change without query shape, data-volume and
|
|
16
|
+
write-amplification evidence. Label runtime plans and load behavior as needing
|
|
17
|
+
verification when no measurements are available.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debugging
|
|
3
|
+
description: Diagnose a reproducible failure from evidence and prepare a minimal safe fix.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
model-invocable: true
|
|
6
|
+
allowed-tools: [filesystem.read, filesystem.list, shell.exec]
|
|
7
|
+
---
|
|
8
|
+
# Debugging
|
|
9
|
+
|
|
10
|
+
Diagnose the reported failure without guessing.
|
|
11
|
+
|
|
12
|
+
1. Reproduce or isolate the failure with the narrowest safe command.
|
|
13
|
+
2. Trace the input from its boundary to the failing operation.
|
|
14
|
+
3. Compare the runtime behavior with the declared types, validation and
|
|
15
|
+
configuration.
|
|
16
|
+
4. Identify the root cause, affected cases and regression risk.
|
|
17
|
+
5. Add or update a focused regression test before implementing a fix.
|
|
18
|
+
6. Run the narrow test first, then the relevant project checks.
|
|
19
|
+
|
|
20
|
+
Do not hide failures, weaken validation or modify unrelated modules.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dependency-review
|
|
3
|
+
description: Evaluate a dependency change for necessity, security, compatibility and operational cost.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
model-invocable: true
|
|
6
|
+
allowed-tools: [filesystem.read, filesystem.list, shell.exec]
|
|
7
|
+
---
|
|
8
|
+
# Dependency review
|
|
9
|
+
|
|
10
|
+
Check whether an existing abstraction, direct dependency, native API or
|
|
11
|
+
framework capability already solves the problem. If a new package is still
|
|
12
|
+
justified, assess maintenance, license, advisories, transitive dependencies,
|
|
13
|
+
runtime cost, compatibility, migration risk and rollback.
|
|
14
|
+
|
|
15
|
+
Do not modify manifests or lockfiles unless the user explicitly requests the
|
|
16
|
+
dependency change and the evidence supports it.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: documentation
|
|
3
|
+
description: Produce accurate maintainable documentation from verified repository behavior.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
model-invocable: true
|
|
6
|
+
allowed-tools: [filesystem.read, filesystem.list, filesystem.write]
|
|
7
|
+
---
|
|
8
|
+
# Documentation
|
|
9
|
+
|
|
10
|
+
Inspect the implementation, configuration and existing documentation before
|
|
11
|
+
writing. Document the supported workflow, prerequisites, configuration,
|
|
12
|
+
security boundaries, failure behavior, examples and verification commands.
|
|
13
|
+
|
|
14
|
+
Keep documentation aligned with public behavior, avoid secrets and speculative
|
|
15
|
+
claims, preserve the project voice, and update the nearest authoritative file
|
|
16
|
+
rather than creating duplicate guidance.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-implementation
|
|
3
|
+
description: Implement a requested feature end to end while preserving architecture, contracts and operational safety.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
model-invocable: true
|
|
6
|
+
allowed-tools: [filesystem.read, filesystem.list, filesystem.exists, filesystem.write, shell.exec]
|
|
7
|
+
---
|
|
8
|
+
# Feature implementation
|
|
9
|
+
|
|
10
|
+
Implement only an explicitly requested behavior change.
|
|
11
|
+
|
|
12
|
+
1. Read repository guidance, the package manifest, relevant configuration and
|
|
13
|
+
the complete affected flow before editing.
|
|
14
|
+
2. Identify the owning layer, reusable abstractions, public contracts and
|
|
15
|
+
trust boundaries. Extend an existing abstraction when ownership remains
|
|
16
|
+
cohesive.
|
|
17
|
+
3. Define the smallest complete design, including validation, errors,
|
|
18
|
+
cancellation, persistence and user-visible states where applicable.
|
|
19
|
+
4. Edit cohesive files with complete content. Preserve unrelated changes and
|
|
20
|
+
never write secrets, generated artifacts or unrelated formatting.
|
|
21
|
+
5. Run focused type, lint and behavior checks after the implementation, then
|
|
22
|
+
run the relevant integrated regression checks.
|
|
23
|
+
6. Report changed files, preserved contracts, evidence, limitations and risks.
|
|
24
|
+
|
|
25
|
+
Do not defer required behavior or claim completion without verification.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-review
|
|
3
|
+
description: Review a frontend flow for state ownership, rendering behavior, accessibility and resilient user states.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
model-invocable: true
|
|
6
|
+
allowed-tools: [filesystem.read, filesystem.list]
|
|
7
|
+
---
|
|
8
|
+
# Frontend review
|
|
9
|
+
|
|
10
|
+
Trace route, page, component, state, request and render behavior. Check state
|
|
11
|
+
ownership, derived state, effect chains, stale responses, cancellation,
|
|
12
|
+
loading/error/empty states, keyboard access, focus, semantics, large lists and
|
|
13
|
+
user-visible failure recovery.
|
|
14
|
+
|
|
15
|
+
Recommend memoization or component extraction only when the affected subtree,
|
|
16
|
+
trigger and measurable benefit are clear. Preserve the established frontend
|
|
17
|
+
architecture and avoid presentation code becoming the source of truth for
|
|
18
|
+
authorization.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: incident-response
|
|
3
|
+
description: Investigate an operational failure using a bounded evidence-first response workflow.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
model-invocable: false
|
|
6
|
+
allowed-tools: [filesystem.read, filesystem.list, shell.exec]
|
|
7
|
+
---
|
|
8
|
+
# Incident response
|
|
9
|
+
|
|
10
|
+
Establish the impact, timeline, affected component and current safety boundary
|
|
11
|
+
before changing anything. Preserve evidence and secrets, inspect logs and
|
|
12
|
+
configuration through approved paths, and separate confirmed facts from
|
|
13
|
+
hypotheses.
|
|
14
|
+
|
|
15
|
+
Prioritize containment, reversible mitigation, data integrity and clear
|
|
16
|
+
rollback. Record commands, observations, decision points and verification. Do
|
|
17
|
+
not delete evidence, rotate credentials, alter production state or apply a
|
|
18
|
+
destructive fix without explicit authorization.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: performance-review
|
|
3
|
+
description: Find evidence-backed performance bottlenecks and define a measurable safe optimization.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
model-invocable: true
|
|
6
|
+
allowed-tools: [filesystem.read, filesystem.list, shell.exec]
|
|
7
|
+
---
|
|
8
|
+
# Performance review
|
|
9
|
+
|
|
10
|
+
Inspect the complete flow and existing measurements before proposing an
|
|
11
|
+
optimization. Prioritize database and external I/O, duplicate requests,
|
|
12
|
+
blocking CPU work, unbounded concurrency, memory growth and large payloads.
|
|
13
|
+
|
|
14
|
+
For every finding state the evidence, workload, bottleneck, correctness risks,
|
|
15
|
+
measurement command and acceptance criterion. Do not invent percentage gains or
|
|
16
|
+
recommend caching, memoization, larger pools or infrastructure without an
|
|
17
|
+
invalidation and capacity analysis.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: refactor
|
|
3
|
+
description: Restructure existing code to improve ownership, reuse and testability without changing behavior.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
model-invocable: true
|
|
6
|
+
allowed-tools: [filesystem.read, filesystem.list, filesystem.exists, filesystem.write, shell.exec]
|
|
7
|
+
---
|
|
8
|
+
# Refactor
|
|
9
|
+
|
|
10
|
+
Refactor only when the requested scope has a concrete maintainability or
|
|
11
|
+
correctness benefit.
|
|
12
|
+
|
|
13
|
+
1. Trace all callers, exports, contracts and tests before moving code.
|
|
14
|
+
2. Separate responsibilities by ownership and dependency direction, not by
|
|
15
|
+
arbitrary file size.
|
|
16
|
+
3. Reuse existing utilities and preserve public behavior, errors, ordering and
|
|
17
|
+
side effects.
|
|
18
|
+
4. Keep each extracted unit cohesive and independently testable.
|
|
19
|
+
5. Use a focused diff and verify after each safe extraction, then run the
|
|
20
|
+
broader regression checks.
|
|
21
|
+
|
|
22
|
+
Do not combine unrelated cleanup, introduce premature generic abstractions or
|
|
23
|
+
hide behavior changes inside a refactor.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: release-readiness
|
|
3
|
+
description: Assess whether a requested change is ready for release across behavior, security, operations and verification.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
model-invocable: false
|
|
6
|
+
allowed-tools: [filesystem.read, filesystem.list, filesystem.exists, shell.exec]
|
|
7
|
+
---
|
|
8
|
+
# Release readiness
|
|
9
|
+
|
|
10
|
+
Inspect the diff, package metadata, build and test configuration, public
|
|
11
|
+
contracts, migrations, configuration, documentation and deployment assumptions.
|
|
12
|
+
|
|
13
|
+
Check backward compatibility, secret handling, authorization, error and
|
|
14
|
+
rollback behavior, observability, resource cleanup, versioning and file-size
|
|
15
|
+
constraints. Run only documented checks and report blockers, evidence,
|
|
16
|
+
pre-existing failures and unverified runtime risks separately.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-review
|
|
3
|
+
description: Review the current workspace for security risks with evidence and safe remediation guidance.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
model-invocable: false
|
|
6
|
+
allowed-tools: [filesystem.exists, filesystem.read, filesystem.list]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Review the current workspace for security issues. Trace each relevant input to
|
|
10
|
+
its sensitive sink before reporting it. Prioritize authentication,
|
|
11
|
+
authorization, path traversal, command injection, secret handling, unsafe
|
|
12
|
+
deserialization, and dependency boundaries.
|
|
13
|
+
|
|
14
|
+
Report only evidence-backed findings. For each finding, include the affected
|
|
15
|
+
file and flow, trigger condition, impact, confidence, and the smallest safe
|
|
16
|
+
remediation. Do not modify files unless the user explicitly asks for a fix.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-plan
|
|
3
|
+
description: Design a focused test plan covering behavior, errors, security and integration boundaries.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
model-invocable: true
|
|
6
|
+
allowed-tools: [filesystem.read, filesystem.list]
|
|
7
|
+
---
|
|
8
|
+
# Test plan
|
|
9
|
+
|
|
10
|
+
Create an implementation-ready test plan for the requested change.
|
|
11
|
+
|
|
12
|
+
Cover:
|
|
13
|
+
|
|
14
|
+
- happy paths and important edge cases;
|
|
15
|
+
- runtime validation and stable error behavior;
|
|
16
|
+
- authentication, authorization and trust boundaries;
|
|
17
|
+
- cancellation, timeout and bounded-concurrency behavior;
|
|
18
|
+
- persistence, external adapters and malformed input;
|
|
19
|
+
- the narrow unit test, integration test and final regression command.
|
|
20
|
+
|
|
21
|
+
For each test, state the setup, action, expected result and why it protects a
|
|
22
|
+
business invariant. Prefer behavior assertions over implementation details.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verify
|
|
3
|
+
description: Identify and run the narrowest relevant verification for the requested workspace change.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
model-invocable: false
|
|
6
|
+
allowed-tools: [filesystem.exists, filesystem.read, filesystem.list, shell.exec]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Inspect the workspace documentation and package configuration to determine the
|
|
10
|
+
narrowest relevant verification for the requested scope. Run only commands
|
|
11
|
+
that are documented by the project. Report each command and its result,
|
|
12
|
+
separating pre-existing failures from failures introduced by the requested
|
|
13
|
+
change. Do not edit source files as part of verification.
|