-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(skill): Add Claude Agent Skills generation support #998
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
71515c7
feat(cli): Add --generate-skill option for Claude Agent Skills output
yamadashy df5647c
feat(skill): Enhance skill output with split files and auto-naming
yamadashy f854dd4
refactor(skill): Improve skill output generation and add tests
yamadashy e137b56
feat(skill): Add interactive skill location selection
yamadashy 46094b8
fix(cli): Show correct skill output path in summary
yamadashy c5fb07c
fix(cli): Show relative path for skill output when under cwd
yamadashy 7b82617
refactor(cli): Apply relative path display to regular output
yamadashy 686cebe
style(cli): Improve skill overwrite confirmation message format
yamadashy 6f67173
refactor(cli): Extract getDisplayPath helper function
yamadashy c57dd55
feat(skill): Add line counts to directory structure in skill output
yamadashy 88a20b9
docs(skill): Update SKILL.md to explain grep-friendly features
yamadashy e40c5f3
refactor(skill): Remove git diffs and logs from skill output
yamadashy 9916cec
docs(skill): Improve SKILL.md template for better usability
yamadashy 8aa10c5
docs(skill): Improve SKILL.md template with overview and use cases
yamadashy 2a4209d
feat(skill): Add tech-stack detection and file statistics to skill ou…
yamadashy b4f25a0
refactor(skill): Pass skillName directly instead of remoteUrl in config
yamadashy 975ffe6
refactor(cli): Move skillPrompts.ts to cli/prompts directory
yamadashy 84c14cc
feat(skill): Enhance tech-stack detection and improve skill output
yamadashy 1987d1d
refactor(skill): Remove unused git diffs/logs section generators
yamadashy 54a1391
refactor(cli): Use cliOptions directly for skillName and skillDir
yamadashy 0fa885c
refactor(skill): Move skill-related code to core/skill/ directory
yamadashy e52a430
refactor(skill): Remove unnecessary re-exports from outputGenerate.ts
yamadashy 6002e06
fix(skill): Remove duplicate calculateMetrics call and fix MCP tool
yamadashy d6d82b6
fix(security): Add path traversal protection for skill generation
yamadashy 6a397a0
test(skill): Add tests for skill generation functionality
yamadashy d1f6498
chore(typos): Add typos configuration to allow 'styl' extension
yamadashy 5688667
fix(typos): Rename .typos.toml to _typos.toml
yamadashy f8f476f
fix(typos): Add 'styl' to extend-words in existing typos.toml
yamadashy 59a42e6
refactor(skill): Improve code quality based on review feedback
yamadashy 7e5a431
fix(skill): Address PR review feedback
yamadashy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| import fs from 'node:fs/promises'; | ||
| import os from 'node:os'; | ||
| import path from 'node:path'; | ||
| import * as prompts from '@clack/prompts'; | ||
| import pc from 'picocolors'; | ||
| import { OperationCancelledError } from '../../shared/errorHandle.js'; | ||
| import { getDisplayPath } from '../cliReport.js'; | ||
|
|
||
| export type SkillLocation = 'personal' | 'project'; | ||
|
|
||
| export interface SkillPromptResult { | ||
| location: SkillLocation; | ||
| skillDir: string; | ||
| } | ||
|
|
||
| const onCancelOperation = (): never => { | ||
| prompts.cancel('Skill generation cancelled.'); | ||
| throw new OperationCancelledError('Skill generation cancelled'); | ||
| }; | ||
|
|
||
| /** | ||
| * Get the base directory for skills based on location type. | ||
| */ | ||
| export const getSkillBaseDir = (cwd: string, location: SkillLocation): string => { | ||
| if (location === 'personal') { | ||
| return path.join(os.homedir(), '.claude', 'skills'); | ||
| } | ||
| return path.join(cwd, '.claude', 'skills'); | ||
| }; | ||
|
|
||
| /** | ||
| * Prompt user for skill location and handle overwrite confirmation. | ||
| */ | ||
| export const promptSkillLocation = async ( | ||
| skillName: string, | ||
| cwd: string, | ||
| deps = { | ||
| select: prompts.select, | ||
| confirm: prompts.confirm, | ||
| isCancel: prompts.isCancel, | ||
| access: fs.access, | ||
| }, | ||
| ): Promise<SkillPromptResult> => { | ||
| // Step 1: Ask for skill location | ||
| const location = await deps.select({ | ||
| message: 'Where would you like to save the skill?', | ||
| options: [ | ||
| { | ||
| value: 'personal' as SkillLocation, | ||
| label: 'Personal Skills', | ||
| hint: '~/.claude/skills/ - Available across all projects', | ||
| }, | ||
| { | ||
| value: 'project' as SkillLocation, | ||
| label: 'Project Skills', | ||
| hint: '.claude/skills/ - Shared with team via git', | ||
| }, | ||
| ], | ||
| initialValue: 'personal' as SkillLocation, | ||
| }); | ||
|
|
||
| if (deps.isCancel(location)) { | ||
| onCancelOperation(); | ||
| } | ||
|
|
||
| const skillDir = path.join(getSkillBaseDir(cwd, location as SkillLocation), skillName); | ||
|
|
||
| // Step 2: Check if directory exists and ask for overwrite | ||
| let dirExists = false; | ||
| try { | ||
| await deps.access(skillDir); | ||
| dirExists = true; | ||
| } catch { | ||
| // Directory doesn't exist | ||
| } | ||
|
|
||
| if (dirExists) { | ||
| const displayPath = getDisplayPath(skillDir, cwd); | ||
| const overwrite = await deps.confirm({ | ||
| message: `Skill directory already exists. Do you want to overwrite it?\n${pc.dim(`path: ${displayPath}`)}`, | ||
| }); | ||
|
|
||
| if (deps.isCancel(overwrite) || !overwrite) { | ||
| onCancelOperation(); | ||
| } | ||
| } | ||
|
|
||
| return { | ||
| location: location as SkillLocation, | ||
| skillDir, | ||
| }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.