kodu 1.1.13 → 1.1.15
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/AGENTS.md +184 -199
- package/README.md +32 -3
- package/dist/src/app.module.js +2 -0
- package/dist/src/app.module.js.map +1 -1
- package/dist/src/commands/init/init.command.js +16 -0
- package/dist/src/commands/init/init.command.js.map +1 -1
- package/dist/src/commands/ops/ops.command.d.ts +4 -0
- package/dist/src/commands/ops/ops.command.js +39 -0
- package/dist/src/commands/ops/ops.command.js.map +1 -0
- package/dist/src/commands/ops/ops.module.d.ts +2 -0
- package/dist/src/commands/ops/ops.module.js +33 -0
- package/dist/src/commands/ops/ops.module.js.map +1 -0
- package/dist/src/commands/ops/ops.types.d.ts +13 -0
- package/dist/src/commands/ops/ops.types.js +12 -0
- package/dist/src/commands/ops/ops.types.js.map +1 -0
- package/dist/src/commands/ops/ops.utils.d.ts +13 -0
- package/dist/src/commands/ops/ops.utils.js +117 -0
- package/dist/src/commands/ops/ops.utils.js.map +1 -0
- package/dist/src/commands/ops/subcommands/ops-env.command.d.ts +17 -0
- package/dist/src/commands/ops/subcommands/ops-env.command.js +109 -0
- package/dist/src/commands/ops/subcommands/ops-env.command.js.map +1 -0
- package/dist/src/commands/ops/subcommands/ops-routes.command.d.ts +18 -0
- package/dist/src/commands/ops/subcommands/ops-routes.command.js +166 -0
- package/dist/src/commands/ops/subcommands/ops-routes.command.js.map +1 -0
- package/dist/src/commands/ops/subcommands/ops-service.command.d.ts +16 -0
- package/dist/src/commands/ops/subcommands/ops-service.command.js +128 -0
- package/dist/src/commands/ops/subcommands/ops-service.command.js.map +1 -0
- package/dist/src/commands/ops/subcommands/ops-sysinfo.command.d.ts +9 -0
- package/dist/src/commands/ops/subcommands/ops-sysinfo.command.js +60 -0
- package/dist/src/commands/ops/subcommands/ops-sysinfo.command.js.map +1 -0
- package/dist/src/commands/pack/pack.command.js +1 -2
- package/dist/src/commands/pack/pack.command.js.map +1 -1
- package/dist/src/core/config/config.schema.d.ts +28 -0
- package/dist/src/core/config/config.schema.js +19 -0
- package/dist/src/core/config/config.schema.js.map +1 -1
- package/dist/src/core/file-system/fs.service.d.ts +4 -1
- package/dist/src/core/file-system/fs.service.js +57 -21
- package/dist/src/core/file-system/fs.service.js.map +1 -1
- package/dist/src/shared/constants.d.ts +1 -0
- package/dist/src/shared/constants.js +2 -1
- package/dist/src/shared/constants.js.map +1 -1
- package/dist/src/shared/ssh/ssh.module.d.ts +2 -0
- package/dist/src/shared/ssh/ssh.module.js +21 -0
- package/dist/src/shared/ssh/ssh.module.js.map +1 -0
- package/dist/src/shared/ssh/ssh.service.d.ts +11 -0
- package/dist/src/shared/ssh/ssh.service.js +53 -0
- package/dist/src/shared/ssh/ssh.service.js.map +1 -0
- package/dist/src/shared/tokenizer/tokenizer.service.js +1 -1
- package/dist/src/shared/tokenizer/tokenizer.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/docs/plans/2026-03-01-agentops-design.md +194 -0
- package/docs/plans/2026-03-01-agentops-implementation.md +358 -0
- package/kodu.json +15 -0
- package/kodu.schema.json +59 -0
- package/package.json +1 -1
- package/src/app.module.ts +2 -0
- package/src/commands/init/init.command.ts +16 -0
- package/src/commands/ops/ops.command.ts +30 -0
- package/src/commands/ops/ops.module.ts +20 -0
- package/src/commands/ops/ops.types.ts +24 -0
- package/src/commands/ops/ops.utils.ts +156 -0
- package/src/commands/ops/subcommands/ops-env.command.ts +121 -0
- package/src/commands/ops/subcommands/ops-routes.command.ts +185 -0
- package/src/commands/ops/subcommands/ops-service.command.ts +154 -0
- package/src/commands/ops/subcommands/ops-sysinfo.command.ts +53 -0
- package/src/commands/pack/pack.command.ts +1 -2
- package/src/core/config/config.schema.ts +23 -0
- package/src/core/file-system/fs.service.ts +72 -23
- package/src/shared/constants.ts +1 -0
- package/src/shared/ssh/ssh.module.ts +8 -0
- package/src/shared/ssh/ssh.service.ts +61 -0
- package/src/shared/tokenizer/tokenizer.service.ts +2 -2
- package/.cursor/commands/openspec-apply.md +0 -23
- package/.cursor/commands/openspec-archive.md +0 -27
- package/.cursor/commands/openspec-proposal.md +0 -28
- package/.windsurf/workflows/openspec-apply.md +0 -21
- package/.windsurf/workflows/openspec-archive.md +0 -25
- package/.windsurf/workflows/openspec-proposal.md +0 -26
- package/openspec/AGENTS.md +0 -456
- package/openspec/changes/archive/2026-01-26-translate-project-to-english/design.md +0 -30
- package/openspec/changes/archive/2026-01-26-translate-project-to-english/proposal.md +0 -17
- package/openspec/changes/archive/2026-01-26-translate-project-to-english/specs/ai/spec.md +0 -26
- package/openspec/changes/archive/2026-01-26-translate-project-to-english/specs/cleaner/spec.md +0 -26
- package/openspec/changes/archive/2026-01-26-translate-project-to-english/specs/config/spec.md +0 -22
- package/openspec/changes/archive/2026-01-26-translate-project-to-english/specs/ui/spec.md +0 -33
- package/openspec/changes/archive/2026-01-26-translate-project-to-english/tasks.md +0 -33
- package/openspec/project.md +0 -72
- package/openspec/specs/cleaner/spec.md +0 -31
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { CommandRunner, SubCommand } from 'nest-commander';
|
|
2
|
+
import { ConfigService } from '../../../core/config/config.service';
|
|
3
|
+
import { SshService } from '../../../shared/ssh/ssh.service';
|
|
4
|
+
import {
|
|
5
|
+
printCliError,
|
|
6
|
+
printJson,
|
|
7
|
+
printSshError,
|
|
8
|
+
resolveServerOrThrow,
|
|
9
|
+
} from '../ops.utils';
|
|
10
|
+
|
|
11
|
+
@SubCommand({
|
|
12
|
+
name: 'sysinfo',
|
|
13
|
+
description: 'Collect remote server diagnostics',
|
|
14
|
+
arguments: '<alias>',
|
|
15
|
+
})
|
|
16
|
+
export class OpsSysinfoCommand extends CommandRunner {
|
|
17
|
+
constructor(
|
|
18
|
+
private readonly configService: ConfigService,
|
|
19
|
+
private readonly sshService: SshService,
|
|
20
|
+
) {
|
|
21
|
+
super();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async run(passedParams: string[]): Promise<void> {
|
|
25
|
+
const [alias] = passedParams;
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
const server = await resolveServerOrThrow(
|
|
29
|
+
this.configService.getConfig(),
|
|
30
|
+
alias,
|
|
31
|
+
);
|
|
32
|
+
const payload = `echo "{"uptime": "$(uptime -p)", "disk_usage": "$(df -h / | tail -1 | awk '{print $5}')", "mem_free": "$(free -m | grep Mem | awk '{print $4}')MB"}"`;
|
|
33
|
+
|
|
34
|
+
const result = await this.sshService.execute(server, payload);
|
|
35
|
+
if (!result.success) {
|
|
36
|
+
printSshError(result, payload);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let data: Record<string, string> = {};
|
|
41
|
+
try {
|
|
42
|
+
data = JSON.parse(result.stdout) as Record<string, string>;
|
|
43
|
+
} catch {
|
|
44
|
+
data = { raw: result.stdout.trim() };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
printJson({ status: 'ok', data });
|
|
48
|
+
} catch (error) {
|
|
49
|
+
printCliError(error);
|
|
50
|
+
process.exitCode = 1;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -124,8 +124,7 @@ export class PackCommand extends CommandRunner {
|
|
|
124
124
|
const chunks = await Promise.all(
|
|
125
125
|
files.map(async (file) => {
|
|
126
126
|
const content = await this.fsService.readFileRelative(file);
|
|
127
|
-
|
|
128
|
-
return `// file: ${posixPath}\n${content}`;
|
|
127
|
+
return `// file: ${file}\n${content}`;
|
|
129
128
|
}),
|
|
130
129
|
);
|
|
131
130
|
|
|
@@ -73,6 +73,27 @@ const promptsSchema = z
|
|
|
73
73
|
})
|
|
74
74
|
.optional();
|
|
75
75
|
|
|
76
|
+
const serverPathsSchema = z
|
|
77
|
+
.object({
|
|
78
|
+
apps: z.string().default('/var/agent-apps'),
|
|
79
|
+
caddy: z.string().optional(),
|
|
80
|
+
})
|
|
81
|
+
.optional();
|
|
82
|
+
|
|
83
|
+
const serverConfigSchema = z.object({
|
|
84
|
+
host: z.string(),
|
|
85
|
+
port: z.number().default(22),
|
|
86
|
+
user: z.string(),
|
|
87
|
+
sshKeyPath: z.string(),
|
|
88
|
+
description: z.string().optional(),
|
|
89
|
+
paths: serverPathsSchema,
|
|
90
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const opsSchema = z.object({
|
|
94
|
+
servers: z.record(z.string(), serverConfigSchema),
|
|
95
|
+
});
|
|
96
|
+
|
|
76
97
|
export const configSchema = z.object({
|
|
77
98
|
$schema: z.string().optional(),
|
|
78
99
|
llm: llmSchema.optional(),
|
|
@@ -97,6 +118,8 @@ export const configSchema = z.object({
|
|
|
97
118
|
contentBasedBinaryDetection: false,
|
|
98
119
|
}),
|
|
99
120
|
prompts: promptsSchema,
|
|
121
|
+
ops: opsSchema.optional(),
|
|
100
122
|
});
|
|
101
123
|
|
|
102
124
|
export type KoduConfig = z.infer<typeof configSchema>;
|
|
125
|
+
export type ServerConfig = z.infer<typeof serverConfigSchema>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { promises as fs } from 'node:fs';
|
|
1
|
+
import { promises as fs, type Stats } from 'node:fs';
|
|
3
2
|
import path from 'node:path';
|
|
4
3
|
import { Injectable } from '@nestjs/common';
|
|
5
4
|
import ignore from 'ignore';
|
|
@@ -36,27 +35,29 @@ export class FsService {
|
|
|
36
35
|
const { packer } = this.configService.getConfig();
|
|
37
36
|
const shouldUseGitignore = options.useGitignore ?? packer.useGitignore;
|
|
38
37
|
const gitignorePatterns = shouldUseGitignore
|
|
39
|
-
? await this.
|
|
38
|
+
? await this.readIgnoreFile('.gitignore')
|
|
40
39
|
: [];
|
|
40
|
+
const koduignorePatterns = await this.readIgnoreFile('.koduignore');
|
|
41
|
+
|
|
42
|
+
const baseIgnore = options.ignore ?? packer.ignore ?? [];
|
|
43
|
+
const normalizedBase = this.normalizeIgnorePatterns(baseIgnore);
|
|
44
|
+
const combinedIgnore = [
|
|
45
|
+
...normalizedBase,
|
|
46
|
+
...gitignorePatterns,
|
|
47
|
+
...koduignorePatterns,
|
|
48
|
+
].map((pattern) => pattern.replace(/\\/g, '/'));
|
|
41
49
|
|
|
42
50
|
const ig = ignore();
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
.map((pattern) => pattern.trim())
|
|
46
|
-
.filter((pattern) => pattern.length > 0)
|
|
47
|
-
.map((pattern) => pattern.replace(/\\/g, '/'));
|
|
48
|
-
if (ignorePatterns.length > 0) {
|
|
49
|
-
ig.add(ignorePatterns);
|
|
50
|
-
}
|
|
51
|
-
if (gitignorePatterns.length > 0) {
|
|
52
|
-
ig.add(gitignorePatterns);
|
|
51
|
+
if (combinedIgnore.length > 0) {
|
|
52
|
+
ig.add(combinedIgnore);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
const globIgnore = this.buildGlobIgnorePatterns(combinedIgnore);
|
|
55
56
|
const entries = await glob(['**/*'], {
|
|
56
57
|
onlyFiles: true,
|
|
57
58
|
absolute: true,
|
|
58
59
|
dot: true,
|
|
59
|
-
ignore: GLOB_IGNORE,
|
|
60
|
+
ignore: [...GLOB_IGNORE, ...globIgnore],
|
|
60
61
|
});
|
|
61
62
|
|
|
62
63
|
const relativePaths = entries
|
|
@@ -114,22 +115,70 @@ export class FsService {
|
|
|
114
115
|
return fs.readFile(absolute, 'utf8');
|
|
115
116
|
}
|
|
116
117
|
|
|
117
|
-
private
|
|
118
|
-
|
|
118
|
+
private toPosixPath(relativePath: string): string {
|
|
119
|
+
return relativePath.split(path.sep).join(path.posix.sep);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
private normalizeIgnorePatterns(patterns: string[]): string[] {
|
|
123
|
+
return patterns
|
|
124
|
+
.map((pattern) => pattern.trim())
|
|
125
|
+
.filter((pattern) => pattern.length > 0 && !pattern.startsWith('#'));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
private buildGlobIgnorePatterns(patterns: string[]): string[] {
|
|
129
|
+
const normalized = patterns
|
|
130
|
+
.map((pattern) => pattern.trim())
|
|
131
|
+
.filter(
|
|
132
|
+
(pattern) =>
|
|
133
|
+
pattern.length > 0 &&
|
|
134
|
+
!pattern.startsWith('#') &&
|
|
135
|
+
!pattern.startsWith('!'),
|
|
136
|
+
)
|
|
137
|
+
.map((pattern) => pattern.replace(/\\/g, '/'));
|
|
138
|
+
|
|
139
|
+
const result = new Set<string>();
|
|
140
|
+
|
|
141
|
+
for (const pattern of normalized) {
|
|
142
|
+
const trimmed = pattern.replace(/\/+$/, '');
|
|
143
|
+
result.add(pattern);
|
|
144
|
+
|
|
145
|
+
if (trimmed.length === 0) {
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (!pattern.includes('*')) {
|
|
150
|
+
result.add(`${trimmed}/**`);
|
|
151
|
+
result.add(`**/${trimmed}/**`);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (!pattern.startsWith('**/')) {
|
|
155
|
+
result.add(`**/${trimmed}`);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (pattern.endsWith('/')) {
|
|
159
|
+
result.add(`${trimmed}/**`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return [...result];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
private async readIgnoreFile(fileName: string): Promise<string[]> {
|
|
167
|
+
const target = path.join(process.cwd(), fileName);
|
|
119
168
|
|
|
120
169
|
try {
|
|
121
|
-
const content = await fs.readFile(
|
|
122
|
-
return content
|
|
123
|
-
.split(/\r?\n/)
|
|
124
|
-
.map((line) => line.trim())
|
|
125
|
-
.filter((line) => line.length > 0 && !line.startsWith('#'));
|
|
170
|
+
const content = await fs.readFile(target, 'utf8');
|
|
171
|
+
return this.parseIgnoreContent(content);
|
|
126
172
|
} catch {
|
|
127
173
|
return [];
|
|
128
174
|
}
|
|
129
175
|
}
|
|
130
176
|
|
|
131
|
-
private
|
|
132
|
-
return
|
|
177
|
+
private parseIgnoreContent(content: string): string[] {
|
|
178
|
+
return content
|
|
179
|
+
.split(/\r?\n/)
|
|
180
|
+
.map((line) => line.trim())
|
|
181
|
+
.filter((line) => line.length > 0 && !line.startsWith('#'));
|
|
133
182
|
}
|
|
134
183
|
|
|
135
184
|
private isBinaryExtension(relativePath: string): boolean {
|
package/src/shared/constants.ts
CHANGED
|
@@ -3,6 +3,7 @@ export const WARNING_TOKEN_THRESHOLD = 12_000;
|
|
|
3
3
|
export const DEFAULT_COMMIT_TOKENS = 1_500;
|
|
4
4
|
export const DEFAULT_REVIEW_TOKENS = 5_000;
|
|
5
5
|
export const DEFAULT_LLM_MODEL = 'gpt-4o';
|
|
6
|
+
export const DEFAULT_PRICE_PER_MILLION = 5;
|
|
6
7
|
|
|
7
8
|
const BINARY_EXTENSION_LIST = [
|
|
8
9
|
'.png',
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { execa } from 'execa';
|
|
3
|
+
import type { ServerConfig } from '../../core/config/config.schema';
|
|
4
|
+
|
|
5
|
+
export type SshResult = {
|
|
6
|
+
success: boolean;
|
|
7
|
+
stdout: string;
|
|
8
|
+
stderr: string;
|
|
9
|
+
exitCode: number;
|
|
10
|
+
error?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
@Injectable()
|
|
14
|
+
export class SshService {
|
|
15
|
+
async execute(
|
|
16
|
+
serverConfig: ServerConfig,
|
|
17
|
+
command: string,
|
|
18
|
+
): Promise<SshResult> {
|
|
19
|
+
const args = [
|
|
20
|
+
'-i',
|
|
21
|
+
serverConfig.sshKeyPath,
|
|
22
|
+
'-p',
|
|
23
|
+
String(serverConfig.port ?? 22),
|
|
24
|
+
'-o',
|
|
25
|
+
'StrictHostKeyChecking=no',
|
|
26
|
+
'-o',
|
|
27
|
+
'ConnectTimeout=10',
|
|
28
|
+
`${serverConfig.user}@${serverConfig.host}`,
|
|
29
|
+
command,
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
const { stdout, stderr, exitCode } = await execa('ssh', args, {
|
|
34
|
+
env: serverConfig.env,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
success: (exitCode ?? 0) === 0,
|
|
39
|
+
stdout,
|
|
40
|
+
stderr,
|
|
41
|
+
exitCode: exitCode ?? 0,
|
|
42
|
+
};
|
|
43
|
+
} catch (error) {
|
|
44
|
+
const failure = error as {
|
|
45
|
+
stdout?: string;
|
|
46
|
+
stderr?: string;
|
|
47
|
+
exitCode?: number;
|
|
48
|
+
shortMessage?: string;
|
|
49
|
+
message?: string;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
success: false,
|
|
54
|
+
stdout: failure.stdout ?? '',
|
|
55
|
+
stderr: failure.stderr ?? '',
|
|
56
|
+
exitCode: failure.exitCode ?? -1,
|
|
57
|
+
error: failure.shortMessage ?? failure.message ?? 'Unknown SSH error',
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Injectable } from '@nestjs/common';
|
|
2
2
|
import { encodingForModel, getEncoding, type TiktokenModel } from 'js-tiktoken';
|
|
3
3
|
import { ConfigService } from '../../core/config/config.service';
|
|
4
|
-
import { DEFAULT_LLM_MODEL } from '../constants';
|
|
4
|
+
import { DEFAULT_LLM_MODEL, DEFAULT_PRICE_PER_MILLION } from '../constants';
|
|
5
5
|
|
|
6
6
|
type TokenEstimate = {
|
|
7
7
|
tokens: number;
|
|
@@ -31,7 +31,7 @@ export class TokenizerService {
|
|
|
31
31
|
const config = this.configService.getConfig();
|
|
32
32
|
const model = config.llm?.model ?? `openai/${DEFAULT_LLM_MODEL}`;
|
|
33
33
|
const key = this.normalizeModelKey(model);
|
|
34
|
-
return PRICE_PER_MILLION[key] ??
|
|
34
|
+
return PRICE_PER_MILLION[key] ?? DEFAULT_PRICE_PER_MILLION;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
private createEncoder() {
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: /openspec-apply
|
|
3
|
-
id: openspec-apply
|
|
4
|
-
category: OpenSpec
|
|
5
|
-
description: Implement an approved OpenSpec change and keep tasks in sync.
|
|
6
|
-
---
|
|
7
|
-
<!-- OPENSPEC:START -->
|
|
8
|
-
**Guardrails**
|
|
9
|
-
- Favor straightforward, minimal implementations first and add complexity only when it is requested or clearly required.
|
|
10
|
-
- Keep changes tightly scoped to the requested outcome.
|
|
11
|
-
- Refer to `openspec/AGENTS.md` (located inside the `openspec/` directory—run `ls openspec` or `openspec update` if you don't see it) if you need additional OpenSpec conventions or clarifications.
|
|
12
|
-
|
|
13
|
-
**Steps**
|
|
14
|
-
Track these steps as TODOs and complete them one by one.
|
|
15
|
-
1. Read `changes/<id>/proposal.md`, `design.md` (if present), and `tasks.md` to confirm scope and acceptance criteria.
|
|
16
|
-
2. Work through tasks sequentially, keeping edits minimal and focused on the requested change.
|
|
17
|
-
3. Confirm completion before updating statuses—make sure every item in `tasks.md` is finished.
|
|
18
|
-
4. Update the checklist after all work is done so each task is marked `- [x]` and reflects reality.
|
|
19
|
-
5. Reference `openspec list` or `openspec show <item>` when additional context is required.
|
|
20
|
-
|
|
21
|
-
**Reference**
|
|
22
|
-
- Use `openspec show <id> --json --deltas-only` if you need additional context from the proposal while implementing.
|
|
23
|
-
<!-- OPENSPEC:END -->
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: /openspec-archive
|
|
3
|
-
id: openspec-archive
|
|
4
|
-
category: OpenSpec
|
|
5
|
-
description: Archive a deployed OpenSpec change and update specs.
|
|
6
|
-
---
|
|
7
|
-
<!-- OPENSPEC:START -->
|
|
8
|
-
**Guardrails**
|
|
9
|
-
- Favor straightforward, minimal implementations first and add complexity only when it is requested or clearly required.
|
|
10
|
-
- Keep changes tightly scoped to the requested outcome.
|
|
11
|
-
- Refer to `openspec/AGENTS.md` (located inside the `openspec/` directory—run `ls openspec` or `openspec update` if you don't see it) if you need additional OpenSpec conventions or clarifications.
|
|
12
|
-
|
|
13
|
-
**Steps**
|
|
14
|
-
1. Determine the change ID to archive:
|
|
15
|
-
- If this prompt already includes a specific change ID (for example inside a `<ChangeId>` block populated by slash-command arguments), use that value after trimming whitespace.
|
|
16
|
-
- If the conversation references a change loosely (for example by title or summary), run `openspec list` to surface likely IDs, share the relevant candidates, and confirm which one the user intends.
|
|
17
|
-
- Otherwise, review the conversation, run `openspec list`, and ask the user which change to archive; wait for a confirmed change ID before proceeding.
|
|
18
|
-
- If you still cannot identify a single change ID, stop and tell the user you cannot archive anything yet.
|
|
19
|
-
2. Validate the change ID by running `openspec list` (or `openspec show <id>`) and stop if the change is missing, already archived, or otherwise not ready to archive.
|
|
20
|
-
3. Run `openspec archive <id> --yes` so the CLI moves the change and applies spec updates without prompts (use `--skip-specs` only for tooling-only work).
|
|
21
|
-
4. Review the command output to confirm the target specs were updated and the change landed in `changes/archive/`.
|
|
22
|
-
5. Validate with `openspec validate --strict --no-interactive` and inspect with `openspec show <id>` if anything looks off.
|
|
23
|
-
|
|
24
|
-
**Reference**
|
|
25
|
-
- Use `openspec list` to confirm change IDs before archiving.
|
|
26
|
-
- Inspect refreshed specs with `openspec list --specs` and address any validation issues before handing off.
|
|
27
|
-
<!-- OPENSPEC:END -->
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: /openspec-proposal
|
|
3
|
-
id: openspec-proposal
|
|
4
|
-
category: OpenSpec
|
|
5
|
-
description: Scaffold a new OpenSpec change and validate strictly.
|
|
6
|
-
---
|
|
7
|
-
<!-- OPENSPEC:START -->
|
|
8
|
-
**Guardrails**
|
|
9
|
-
- Favor straightforward, minimal implementations first and add complexity only when it is requested or clearly required.
|
|
10
|
-
- Keep changes tightly scoped to the requested outcome.
|
|
11
|
-
- Refer to `openspec/AGENTS.md` (located inside the `openspec/` directory—run `ls openspec` or `openspec update` if you don't see it) if you need additional OpenSpec conventions or clarifications.
|
|
12
|
-
- Identify any vague or ambiguous details and ask the necessary follow-up questions before editing files.
|
|
13
|
-
- Do not write any code during the proposal stage. Only create design documents (proposal.md, tasks.md, design.md, and spec deltas). Implementation happens in the apply stage after approval.
|
|
14
|
-
|
|
15
|
-
**Steps**
|
|
16
|
-
1. Review `openspec/project.md`, run `openspec list` and `openspec list --specs`, and inspect related code or docs (e.g., via `rg`/`ls`) to ground the proposal in current behaviour; note any gaps that require clarification.
|
|
17
|
-
2. Choose a unique verb-led `change-id` and scaffold `proposal.md`, `tasks.md`, and `design.md` (when needed) under `openspec/changes/<id>/`.
|
|
18
|
-
3. Map the change into concrete capabilities or requirements, breaking multi-scope efforts into distinct spec deltas with clear relationships and sequencing.
|
|
19
|
-
4. Capture architectural reasoning in `design.md` when the solution spans multiple systems, introduces new patterns, or demands trade-off discussion before committing to specs.
|
|
20
|
-
5. Draft spec deltas in `changes/<id>/specs/<capability>/spec.md` (one folder per capability) using `## ADDED|MODIFIED|REMOVED Requirements` with at least one `#### Scenario:` per requirement and cross-reference related capabilities when relevant.
|
|
21
|
-
6. Draft `tasks.md` as an ordered list of small, verifiable work items that deliver user-visible progress, include validation (tests, tooling), and highlight dependencies or parallelizable work.
|
|
22
|
-
7. Validate with `openspec validate <id> --strict --no-interactive` and resolve every issue before sharing the proposal.
|
|
23
|
-
|
|
24
|
-
**Reference**
|
|
25
|
-
- Use `openspec show <id> --json --deltas-only` or `openspec show <spec> --type spec` to inspect details when validation fails.
|
|
26
|
-
- Search existing requirements with `rg -n "Requirement:|Scenario:" openspec/specs` before writing new ones.
|
|
27
|
-
- Explore the codebase with `rg <keyword>`, `ls`, or direct file reads so proposals align with current implementation realities.
|
|
28
|
-
<!-- OPENSPEC:END -->
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Implement an approved OpenSpec change and keep tasks in sync.
|
|
3
|
-
auto_execution_mode: 3
|
|
4
|
-
---
|
|
5
|
-
<!-- OPENSPEC:START -->
|
|
6
|
-
**Guardrails**
|
|
7
|
-
- Favor straightforward, minimal implementations first and add complexity only when it is requested or clearly required.
|
|
8
|
-
- Keep changes tightly scoped to the requested outcome.
|
|
9
|
-
- Refer to `openspec/AGENTS.md` (located inside the `openspec/` directory—run `ls openspec` or `openspec update` if you don't see it) if you need additional OpenSpec conventions or clarifications.
|
|
10
|
-
|
|
11
|
-
**Steps**
|
|
12
|
-
Track these steps as TODOs and complete them one by one.
|
|
13
|
-
1. Read `changes/<id>/proposal.md`, `design.md` (if present), and `tasks.md` to confirm scope and acceptance criteria.
|
|
14
|
-
2. Work through tasks sequentially, keeping edits minimal and focused on the requested change.
|
|
15
|
-
3. Confirm completion before updating statuses—make sure every item in `tasks.md` is finished.
|
|
16
|
-
4. Update the checklist after all work is done so each task is marked `- [x]` and reflects reality.
|
|
17
|
-
5. Reference `openspec list` or `openspec show <item>` when additional context is required.
|
|
18
|
-
|
|
19
|
-
**Reference**
|
|
20
|
-
- Use `openspec show <id> --json --deltas-only` if you need additional context from the proposal while implementing.
|
|
21
|
-
<!-- OPENSPEC:END -->
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Archive a deployed OpenSpec change and update specs.
|
|
3
|
-
auto_execution_mode: 3
|
|
4
|
-
---
|
|
5
|
-
<!-- OPENSPEC:START -->
|
|
6
|
-
**Guardrails**
|
|
7
|
-
- Favor straightforward, minimal implementations first and add complexity only when it is requested or clearly required.
|
|
8
|
-
- Keep changes tightly scoped to the requested outcome.
|
|
9
|
-
- Refer to `openspec/AGENTS.md` (located inside the `openspec/` directory—run `ls openspec` or `openspec update` if you don't see it) if you need additional OpenSpec conventions or clarifications.
|
|
10
|
-
|
|
11
|
-
**Steps**
|
|
12
|
-
1. Determine the change ID to archive:
|
|
13
|
-
- If this prompt already includes a specific change ID (for example inside a `<ChangeId>` block populated by slash-command arguments), use that value after trimming whitespace.
|
|
14
|
-
- If the conversation references a change loosely (for example by title or summary), run `openspec list` to surface likely IDs, share the relevant candidates, and confirm which one the user intends.
|
|
15
|
-
- Otherwise, review the conversation, run `openspec list`, and ask the user which change to archive; wait for a confirmed change ID before proceeding.
|
|
16
|
-
- If you still cannot identify a single change ID, stop and tell the user you cannot archive anything yet.
|
|
17
|
-
2. Validate the change ID by running `openspec list` (or `openspec show <id>`) and stop if the change is missing, already archived, or otherwise not ready to archive.
|
|
18
|
-
3. Run `openspec archive <id> --yes` so the CLI moves the change and applies spec updates without prompts (use `--skip-specs` only for tooling-only work).
|
|
19
|
-
4. Review the command output to confirm the target specs were updated and the change landed in `changes/archive/`.
|
|
20
|
-
5. Validate with `openspec validate --strict --no-interactive` and inspect with `openspec show <id>` if anything looks off.
|
|
21
|
-
|
|
22
|
-
**Reference**
|
|
23
|
-
- Use `openspec list` to confirm change IDs before archiving.
|
|
24
|
-
- Inspect refreshed specs with `openspec list --specs` and address any validation issues before handing off.
|
|
25
|
-
<!-- OPENSPEC:END -->
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Scaffold a new OpenSpec change and validate strictly.
|
|
3
|
-
auto_execution_mode: 3
|
|
4
|
-
---
|
|
5
|
-
<!-- OPENSPEC:START -->
|
|
6
|
-
**Guardrails**
|
|
7
|
-
- Favor straightforward, minimal implementations first and add complexity only when it is requested or clearly required.
|
|
8
|
-
- Keep changes tightly scoped to the requested outcome.
|
|
9
|
-
- Refer to `openspec/AGENTS.md` (located inside the `openspec/` directory—run `ls openspec` or `openspec update` if you don't see it) if you need additional OpenSpec conventions or clarifications.
|
|
10
|
-
- Identify any vague or ambiguous details and ask the necessary follow-up questions before editing files.
|
|
11
|
-
- Do not write any code during the proposal stage. Only create design documents (proposal.md, tasks.md, design.md, and spec deltas). Implementation happens in the apply stage after approval.
|
|
12
|
-
|
|
13
|
-
**Steps**
|
|
14
|
-
1. Review `openspec/project.md`, run `openspec list` and `openspec list --specs`, and inspect related code or docs (e.g., via `rg`/`ls`) to ground the proposal in current behaviour; note any gaps that require clarification.
|
|
15
|
-
2. Choose a unique verb-led `change-id` and scaffold `proposal.md`, `tasks.md`, and `design.md` (when needed) under `openspec/changes/<id>/`.
|
|
16
|
-
3. Map the change into concrete capabilities or requirements, breaking multi-scope efforts into distinct spec deltas with clear relationships and sequencing.
|
|
17
|
-
4. Capture architectural reasoning in `design.md` when the solution spans multiple systems, introduces new patterns, or demands trade-off discussion before committing to specs.
|
|
18
|
-
5. Draft spec deltas in `changes/<id>/specs/<capability>/spec.md` (one folder per capability) using `## ADDED|MODIFIED|REMOVED Requirements` with at least one `#### Scenario:` per requirement and cross-reference related capabilities when relevant.
|
|
19
|
-
6. Draft `tasks.md` as an ordered list of small, verifiable work items that deliver user-visible progress, include validation (tests, tooling), and highlight dependencies or parallelizable work.
|
|
20
|
-
7. Validate with `openspec validate <id> --strict --no-interactive` and resolve every issue before sharing the proposal.
|
|
21
|
-
|
|
22
|
-
**Reference**
|
|
23
|
-
- Use `openspec show <id> --json --deltas-only` or `openspec show <spec> --type spec` to inspect details when validation fails.
|
|
24
|
-
- Search existing requirements with `rg -n "Requirement:|Scenario:" openspec/specs` before writing new ones.
|
|
25
|
-
- Explore the codebase with `rg <keyword>`, `ls`, or direct file reads so proposals align with current implementation realities.
|
|
26
|
-
<!-- OPENSPEC:END -->
|