-
Notifications
You must be signed in to change notification settings - Fork 68
fix: normalize --agent flag, migrate 6 commands to onboarding helpers #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,7 +147,7 @@ export class ManifestAddCommand extends Command { | |
| description: 'Specific skills to include (comma-separated)', | ||
| }); | ||
|
|
||
| agents = Option.String('--agents,-a', { | ||
| agents = Option.String('--agent,--agents,-a', { | ||
| description: 'Target agents (comma-separated)', | ||
| }); | ||
|
Comment on lines
+150
to
152
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add required deprecation warning for This adds alias compatibility, but the command still doesn’t emit the required warning message when users pass Suggested patch async execute(): Promise<number> {
+ if (process.argv.includes('--agents')) {
+ warn('Use --agent instead (--agents will be removed in v2.0)');
+ }
+
const options: { skills?: string[]; agents?: string[] } = {};🤖 Prompt for AI Agents |
||
|
|
||
|
|
@@ -159,6 +159,9 @@ export class ManifestAddCommand extends Command { | |
| } | ||
|
|
||
| if (this.agents) { | ||
| if (process.argv.includes('--agents')) { | ||
| console.warn('Warning: --agents is deprecated, use --agent instead (--agents will be removed in v2.0)'); | ||
| } | ||
| options.agents = this.agents.split(',').map(s => s.trim()); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ import { Command, Option } from 'clipanion'; | |
| import { resolve } from 'node:path'; | ||
| import { existsSync } from 'node:fs'; | ||
| import { SkillScanner, formatResult, Severity } from '@skillkit/core'; | ||
| import { error } from '../onboarding/index.js'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: Yes—in No—v0.11.x does not provide an officially supported way to route (For context: newer Sources Citations:
🏁 Script executed: # First, find and examine the scan.ts file to see the context
fd -t f "scan.ts" --path "*packages/cli*"Repository: rohitg00/skillkit Length of output: 294 🏁 Script executed: # Get the exact lines mentioned in the review - lines 54, 60, 70
sed -n '1,80p' packages/cli/src/commands/scan.ts | cat -nRepository: rohitg00/skillkit Length of output: 3301 🏁 Script executed: # Examine the error() import source
cat -n packages/cli/src/onboarding/index.js | head -50Repository: rohitg00/skillkit Length of output: 129 🏁 Script executed: # Search for what clack is and how it's used in onboarding
rg "clack|log\.error" packages/cli/src/onboarding/ -A 2 -B 2Repository: rohitg00/skillkit Length of output: 8204 🏁 Script executed: # Find the onboarding index file
fd -t f "index" packages/cli/src/onboarding/Repository: rohitg00/skillkit Length of output: 97 🏁 Script executed: # Check the onboarding index content
cat -n packages/cli/src/onboarding/index.tsRepository: rohitg00/skillkit Length of output: 7486 🏁 Script executed: # Check package.json for clack version
rg "@clack/prompts" packages/cli/package.jsonRepository: rohitg00/skillkit Length of output: 93 🏁 Script executed: # Search for this.context.stderr usage in the codebase
rg "this\.context\.stderr" packages/cli/Repository: rohitg00/skillkit Length of output: 12940 🏁 Script executed: # Check if ScanCommand has direct access to context
rg "class ScanCommand" -A 20 packages/cli/src/commands/scan.tsRepository: rohitg00/skillkit Length of output: 919 Use Lines 54, 60, and 70 use Adopt the pattern used in other commands (e.g., 🤖 Prompt for AI Agents |
||
|
|
||
| const SEVERITY_MAP: Record<string, Severity> = { | ||
| critical: Severity.CRITICAL, | ||
|
|
@@ -50,13 +51,13 @@ export class ScanCommand extends Command { | |
| const targetPath = resolve(this.skillPath); | ||
|
|
||
| if (!existsSync(targetPath)) { | ||
| this.context.stderr.write(`Path not found: ${targetPath}\n`); | ||
| error(`Path not found: ${targetPath}`); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Scan command error messages redirected from stderr to stdout The scan command previously wrote validation errors to stderr via Affected lines in scan.tsLines 54, 60, and 70 all changed from Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
| return 1; | ||
| } | ||
|
|
||
| const validFormats = ['summary', 'json', 'table', 'sarif']; | ||
| if (!validFormats.includes(this.format)) { | ||
| this.context.stderr.write(`Invalid format: "${this.format}". Must be one of: ${validFormats.join(', ')}\n`); | ||
| error(`Invalid format: "${this.format}". Must be one of: ${validFormats.join(', ')}`); | ||
| return 1; | ||
| } | ||
|
|
||
|
|
@@ -66,7 +67,7 @@ export class ScanCommand extends Command { | |
| if (this.failOn) { | ||
| failOnSeverity = SEVERITY_MAP[this.failOn.toLowerCase()]; | ||
| if (!failOnSeverity) { | ||
| this.context.stderr.write(`Invalid --fail-on value: "${this.failOn}". Must be one of: ${Object.keys(SEVERITY_MAP).join(', ')}\n`); | ||
| error(`Invalid --fail-on value: "${this.failOn}". Must be one of: ${Object.keys(SEVERITY_MAP).join(', ')}`); | ||
| return 1; | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.