speci 0.3.0 → 0.4.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/README.md +0 -36
- package/bin/speci.ts +38 -39
- package/lib/commands/init.ts +4 -4
- package/lib/commands/plan.ts +7 -7
- package/lib/commands/refactor.ts +6 -6
- package/lib/commands/run.ts +9 -9
- package/lib/commands/status.ts +396 -47
- package/lib/commands/task.ts +6 -6
- package/lib/config.ts +1 -1
- package/lib/copilot.ts +2 -2
- package/lib/state.ts +49 -1
- package/lib/ui/banner-animation.ts +34 -13
- package/lib/ui/banner.ts +4 -4
- package/lib/ui/box.ts +3 -3
- package/lib/ui/colors.ts +1 -1
- package/lib/utils/gate.ts +3 -3
- package/lib/utils/lock.ts +2 -2
- package/lib/utils/logger.ts +3 -3
- package/lib/utils/preflight.ts +2 -2
- package/package.json +4 -2
- package/templates/agents/speci-impl.agent.md +5 -0
- package/templates/agents/speci-refactor.agent.md +301 -379
- package/templates/agents/speci-review.agent.md +2 -0
- package/templates/agents/speci-task.agent.md +70 -16
- package/templates/agents/subagents/progress_generator.prompt.md +36 -17
- package/templates/agents/subagents/refactor_analyze_crosscutting.prompt.md +24 -55
- package/templates/agents/subagents/refactor_analyze_duplication.prompt.md +24 -54
- package/templates/agents/subagents/refactor_analyze_errors.prompt.md +24 -54
- package/templates/agents/subagents/refactor_analyze_functions.prompt.md +24 -55
- package/templates/agents/subagents/refactor_analyze_naming.prompt.md +24 -54
- package/templates/agents/subagents/refactor_analyze_performance.prompt.md +24 -55
- package/templates/agents/subagents/refactor_analyze_state.prompt.md +24 -55
- package/templates/agents/subagents/refactor_analyze_structure.prompt.md +22 -53
- package/templates/agents/subagents/refactor_analyze_testing.prompt.md +24 -55
- package/templates/agents/subagents/refactor_analyze_types.prompt.md +24 -55
- package/templates/agents/subagents/refactor_review_completeness.prompt.md +27 -63
- package/templates/agents/subagents/refactor_review_final.prompt.md +20 -54
- package/templates/agents/subagents/refactor_review_risks.prompt.md +28 -63
- package/templates/agents/subagents/refactor_review_roadmap.prompt.md +28 -63
- package/templates/agents/subagents/refactor_review_technical.prompt.md +28 -63
- package/lib/commands/monitor.ts +0 -579
package/README.md
CHANGED
|
@@ -7,7 +7,6 @@ AI-powered implementation loop orchestrator for GitHub Copilot.
|
|
|
7
7
|
- **Automated Implementation Loops** - Orchestrates Copilot-driven development workflows
|
|
8
8
|
- **Gate Validation** - Runs lint, typecheck, and test commands before committing
|
|
9
9
|
- **Progress Tracking** - Maintains state in PROGRESS.md with task completion tracking
|
|
10
|
-
- **Real-time Monitoring** - TUI-based log viewer with live updates
|
|
11
10
|
- **Beautiful CLI** - Ice Blue styling with unicode glyphs and ANSI colors
|
|
12
11
|
|
|
13
12
|
## Quick Start
|
|
@@ -267,41 +266,6 @@ speci run --dry-run
|
|
|
267
266
|
|
|
268
267
|
**Note:** This command intentionally has no short alias for safety.
|
|
269
268
|
|
|
270
|
-
### `speci monitor` (alias: `m`)
|
|
271
|
-
|
|
272
|
-
Real-time TUI log viewer with live updates.
|
|
273
|
-
|
|
274
|
-
**Usage:**
|
|
275
|
-
|
|
276
|
-
```bash
|
|
277
|
-
speci monitor [options]
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
**Options:**
|
|
281
|
-
|
|
282
|
-
- `-l, --log-file <path>` - Custom log file to monitor
|
|
283
|
-
- `--poll-interval <ms>` - Polling interval in milliseconds
|
|
284
|
-
- `--max-lines <n>` - Maximum lines to display
|
|
285
|
-
- `-v, --verbose` - Show detailed output
|
|
286
|
-
|
|
287
|
-
**Examples:**
|
|
288
|
-
|
|
289
|
-
```bash
|
|
290
|
-
# Monitor default log file
|
|
291
|
-
speci monitor
|
|
292
|
-
|
|
293
|
-
# Short alias version
|
|
294
|
-
speci m
|
|
295
|
-
|
|
296
|
-
# Limit display buffer
|
|
297
|
-
speci monitor --max-lines 1000
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
**Controls:**
|
|
301
|
-
|
|
302
|
-
- Arrow keys / Page Up/Down - Scroll through log
|
|
303
|
-
- `q` or `Ctrl+C` - Exit monitor
|
|
304
|
-
|
|
305
269
|
## Configuration
|
|
306
270
|
|
|
307
271
|
### speci.config.json
|
package/bin/speci.ts
CHANGED
|
@@ -15,12 +15,20 @@ import { task } from '../lib/commands/task.js';
|
|
|
15
15
|
import { refactor } from '../lib/commands/refactor.js';
|
|
16
16
|
import { run } from '../lib/commands/run.js';
|
|
17
17
|
import { status } from '../lib/commands/status.js';
|
|
18
|
-
import monitor from '../lib/commands/monitor.js';
|
|
19
18
|
import { findSimilarCommands } from '../lib/utils/suggest.js';
|
|
20
19
|
import { setVerbose, debug } from '../lib/utils/logger.js';
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
|
-
* Display the
|
|
22
|
+
* Display the static (non-animated) banner
|
|
23
|
+
*
|
|
24
|
+
* @param options - Optional configuration for banner display
|
|
25
|
+
*/
|
|
26
|
+
function displayStaticBanner(): void {
|
|
27
|
+
console.log('\n' + renderBanner({ showVersion: true }) + '\n');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Display the application banner with animation when appropriate
|
|
24
32
|
*
|
|
25
33
|
* Conditionally animates the banner when appropriate conditions are met.
|
|
26
34
|
* Returns a Promise when animation is enabled, or void when displaying static banner.
|
|
@@ -32,7 +40,7 @@ function displayBanner(options?: { color?: boolean }): Promise<void> | void {
|
|
|
32
40
|
console.log();
|
|
33
41
|
return animateBanner().then(() => console.log());
|
|
34
42
|
} else {
|
|
35
|
-
|
|
43
|
+
displayStaticBanner();
|
|
36
44
|
}
|
|
37
45
|
}
|
|
38
46
|
|
|
@@ -56,14 +64,16 @@ program
|
|
|
56
64
|
debug('Arguments', process.argv);
|
|
57
65
|
}
|
|
58
66
|
|
|
59
|
-
// Display banner before any command, except for --help
|
|
67
|
+
// Display banner before any command, except for --help, --version, --json output, or status command
|
|
60
68
|
const args = process.argv;
|
|
61
69
|
const isHelpOrVersion =
|
|
62
70
|
args.includes('--help') ||
|
|
63
71
|
args.includes('-h') ||
|
|
64
72
|
args.includes('--version') ||
|
|
65
73
|
args.includes('-V');
|
|
66
|
-
|
|
74
|
+
const isJsonOutput = args.includes('--json');
|
|
75
|
+
const isStatusCommand = args.includes('status') || args.includes('s');
|
|
76
|
+
if (!isHelpOrVersion && !isJsonOutput && !isStatusCommand) {
|
|
67
77
|
const result = displayBanner({ color: opts.color });
|
|
68
78
|
if (result instanceof Promise) {
|
|
69
79
|
await result;
|
|
@@ -179,50 +189,26 @@ Examples:
|
|
|
179
189
|
program
|
|
180
190
|
.command('status')
|
|
181
191
|
.alias('s')
|
|
182
|
-
.description(
|
|
183
|
-
|
|
192
|
+
.description(
|
|
193
|
+
'Show current loop state and task statistics (live fullscreen dashboard)'
|
|
194
|
+
)
|
|
195
|
+
.option('--json', 'Output status as JSON and exit')
|
|
196
|
+
.option('--once', 'Show status once and exit (non-interactive)')
|
|
184
197
|
.option('-v, --verbose', 'Show detailed status')
|
|
185
198
|
.addHelpText(
|
|
186
199
|
'after',
|
|
187
200
|
`
|
|
188
201
|
Examples:
|
|
189
|
-
$ speci status
|
|
202
|
+
$ speci status Live fullscreen dashboard (press q to quit)
|
|
203
|
+
$ speci s --once Show status once and exit
|
|
190
204
|
$ speci s --json Output as JSON for scripts
|
|
191
205
|
$ speci status --verbose Detailed status information
|
|
192
206
|
`
|
|
193
207
|
)
|
|
194
208
|
.action(status);
|
|
195
209
|
|
|
196
|
-
// Monitor Command (alias: m)
|
|
197
|
-
program
|
|
198
|
-
.command('monitor')
|
|
199
|
-
.alias('m')
|
|
200
|
-
.description('Real-time log viewer with TUI')
|
|
201
|
-
.option('-l, --log-file <path>', 'Custom log file to monitor')
|
|
202
|
-
.option('--poll-interval <ms>', 'Polling interval in milliseconds', parseInt)
|
|
203
|
-
.option('--max-lines <n>', 'Maximum lines to display', parseInt)
|
|
204
|
-
.option('-v, --verbose', 'Show detailed output')
|
|
205
|
-
.addHelpText(
|
|
206
|
-
'after',
|
|
207
|
-
`
|
|
208
|
-
Examples:
|
|
209
|
-
$ speci monitor Monitor default log file
|
|
210
|
-
$ speci m Short alias version
|
|
211
|
-
$ speci monitor --max-lines 1000 Limit display buffer
|
|
212
|
-
`
|
|
213
|
-
)
|
|
214
|
-
.action(monitor);
|
|
215
|
-
|
|
216
210
|
// List of all available commands (for unknown command handling)
|
|
217
|
-
const availableCommands = [
|
|
218
|
-
'init',
|
|
219
|
-
'plan',
|
|
220
|
-
'task',
|
|
221
|
-
'refactor',
|
|
222
|
-
'run',
|
|
223
|
-
'status',
|
|
224
|
-
'monitor',
|
|
225
|
-
];
|
|
211
|
+
const availableCommands = ['init', 'plan', 'task', 'refactor', 'run', 'status'];
|
|
226
212
|
|
|
227
213
|
// Unknown command handler
|
|
228
214
|
program.on('command:*', (operands) => {
|
|
@@ -241,8 +227,14 @@ program.on('command:*', (operands) => {
|
|
|
241
227
|
process.exit(2);
|
|
242
228
|
});
|
|
243
229
|
|
|
244
|
-
//
|
|
230
|
+
// Check if help or version is being requested
|
|
231
|
+
const args = process.argv.slice(2);
|
|
232
|
+
const isHelpRequest =
|
|
233
|
+
args.includes('-h') || args.includes('--help') || args[0] === 'help';
|
|
234
|
+
const isVersionRequest = args.includes('-V') || args.includes('--version');
|
|
235
|
+
|
|
245
236
|
if (process.argv.length <= 2) {
|
|
237
|
+
// No arguments: show animated banner + help
|
|
246
238
|
(async () => {
|
|
247
239
|
const result = displayBanner({ color: program.opts().color });
|
|
248
240
|
if (result instanceof Promise) {
|
|
@@ -250,7 +242,14 @@ if (process.argv.length <= 2) {
|
|
|
250
242
|
}
|
|
251
243
|
program.help();
|
|
252
244
|
})();
|
|
245
|
+
} else if (isHelpRequest) {
|
|
246
|
+
// Help request: show static banner + help
|
|
247
|
+
displayStaticBanner();
|
|
248
|
+
program.parse(process.argv);
|
|
249
|
+
} else if (isVersionRequest) {
|
|
250
|
+
// Version request: just show version (no banner)
|
|
251
|
+
program.parse(process.argv);
|
|
253
252
|
} else {
|
|
254
|
-
//
|
|
253
|
+
// Regular command: parse normally (preAction hook handles banner)
|
|
255
254
|
program.parse(process.argv);
|
|
256
255
|
}
|
package/lib/commands/init.ts
CHANGED
|
@@ -14,15 +14,15 @@ import {
|
|
|
14
14
|
statSync,
|
|
15
15
|
} from 'node:fs';
|
|
16
16
|
import { join, relative } from 'node:path';
|
|
17
|
-
import { log } from '
|
|
18
|
-
import { renderBanner } from '
|
|
19
|
-
import { colorize } from '
|
|
17
|
+
import { log } from '@/utils/logger.js';
|
|
18
|
+
import { renderBanner } from '@/ui/banner.js';
|
|
19
|
+
import { colorize } from '@/ui/colors.js';
|
|
20
20
|
import {
|
|
21
21
|
getDefaults,
|
|
22
22
|
getAgentsTemplatePath,
|
|
23
23
|
GITHUB_AGENTS_DIR,
|
|
24
24
|
type SpeciConfig,
|
|
25
|
-
} from '
|
|
25
|
+
} from '@/config.js';
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Options for the init command
|
package/lib/commands/plan.ts
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
import { existsSync } from 'node:fs';
|
|
10
10
|
import { resolve } from 'node:path';
|
|
11
|
-
import { loadConfig, resolveAgentPath } from '
|
|
12
|
-
import { buildCopilotArgs, spawnCopilot } from '
|
|
13
|
-
import { preflight } from '
|
|
14
|
-
import { renderBanner } from '
|
|
15
|
-
import { log } from '
|
|
16
|
-
import { drawBox } from '
|
|
17
|
-
import { colorize } from '
|
|
11
|
+
import { loadConfig, resolveAgentPath } from '@/config.js';
|
|
12
|
+
import { buildCopilotArgs, spawnCopilot } from '@/copilot.js';
|
|
13
|
+
import { preflight } from '@/utils/preflight.js';
|
|
14
|
+
import { renderBanner } from '@/ui/banner.js';
|
|
15
|
+
import { log } from '@/utils/logger.js';
|
|
16
|
+
import { drawBox } from '@/ui/box.js';
|
|
17
|
+
import { colorize } from '@/ui/colors.js';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Options for the plan command
|
package/lib/commands/refactor.ts
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
import { existsSync, statSync } from 'node:fs';
|
|
10
10
|
import { isAbsolute, resolve } from 'node:path';
|
|
11
|
-
import { loadConfig, resolveAgentPath } from '
|
|
12
|
-
import { buildCopilotArgs, spawnCopilot } from '
|
|
13
|
-
import { preflight } from '
|
|
14
|
-
import { renderBanner } from '
|
|
15
|
-
import { log } from '
|
|
16
|
-
import { infoBox } from '
|
|
11
|
+
import { loadConfig, resolveAgentPath } from '@/config.js';
|
|
12
|
+
import { buildCopilotArgs, spawnCopilot } from '@/copilot.js';
|
|
13
|
+
import { preflight } from '@/utils/preflight.js';
|
|
14
|
+
import { renderBanner } from '@/ui/banner.js';
|
|
15
|
+
import { log } from '@/utils/logger.js';
|
|
16
|
+
import { infoBox } from '@/ui/box.js';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Options for the refactor command
|
package/lib/commands/run.ts
CHANGED
|
@@ -11,24 +11,24 @@ import { mkdirSync } from 'node:fs';
|
|
|
11
11
|
import { join } from 'node:path';
|
|
12
12
|
import { createInterface } from 'node:readline';
|
|
13
13
|
import { Writable } from 'node:stream';
|
|
14
|
-
import { loadConfig, type SpeciConfig } from '
|
|
15
|
-
import { getState, STATE } from '
|
|
14
|
+
import { loadConfig, type SpeciConfig } from '@/config.js';
|
|
15
|
+
import { getState, STATE } from '@/state.js';
|
|
16
16
|
import {
|
|
17
17
|
acquireLock,
|
|
18
18
|
releaseLock,
|
|
19
19
|
isLocked,
|
|
20
20
|
getLockInfo,
|
|
21
|
-
} from '
|
|
22
|
-
import { preflight } from '
|
|
23
|
-
import { runGate, resetGateAttempts } from '
|
|
24
|
-
import { runAgent } from '
|
|
25
|
-
import { renderBanner } from '
|
|
26
|
-
import { log } from '
|
|
21
|
+
} from '@/utils/lock.js';
|
|
22
|
+
import { preflight } from '@/utils/preflight.js';
|
|
23
|
+
import { runGate, resetGateAttempts } from '@/utils/gate.js';
|
|
24
|
+
import { runAgent } from '@/copilot.js';
|
|
25
|
+
import { renderBanner } from '@/ui/banner.js';
|
|
26
|
+
import { log } from '@/utils/logger.js';
|
|
27
27
|
import {
|
|
28
28
|
installSignalHandlers,
|
|
29
29
|
registerCleanup,
|
|
30
30
|
removeSignalHandlers,
|
|
31
|
-
} from '
|
|
31
|
+
} from '@/utils/signals.js';
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Options for the run command
|