-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add supermodel skill command #125
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
Closed
jonathanpopham
wants to merge
2
commits into
supermodeltools:main
from
jonathanpopham:feat/skill-command
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| This repository has .graph.* files next to source files containing code relationship data from Supermodel. | ||
|
|
||
| The naming convention: for src/Foo.py the graph file is src/Foo.graph.py (insert .graph before the extension). Each graph file has up to three sections: | ||
| - [deps] — what this file imports and what imports it | ||
| - [calls] — function call relationships with file paths and line numbers | ||
| - [impact] — blast radius: risk level, affected domains, direct/transitive dependents | ||
|
|
||
| **Read the .graph file before the source file.** It shows the full dependency and call picture in far fewer tokens. Construct the path directly — don't ls the directory to discover it. | ||
|
|
||
| Before grepping to understand how code connects, check the relevant .graph files. They already answer most structural navigation questions: what calls what, what imports what, and what breaks if you change something. When you grep for a function name, .graph files appear in results showing every caller and callee — use this to navigate instead of searching for each one individually. |
Binary file not shown.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,37 @@ | ||
| package cmd | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| const skillPrompt = `This repository has .graph.* files next to source files containing code relationship data from Supermodel. | ||
|
|
||
| The naming convention: for src/Foo.py the graph file is src/Foo.graph.py (insert .graph before the extension). Each graph file has up to three sections: | ||
| - [deps] — what this file imports and what imports it | ||
| - [calls] — function call relationships with file paths and line numbers | ||
| - [impact] — blast radius: risk level, affected domains, direct/transitive dependents | ||
|
|
||
| **Read the .graph file before the source file.** It shows the full dependency and call picture in far fewer tokens. Construct the path directly — don't ls the directory to discover it. | ||
|
|
||
| Before grepping to understand how code connects, check the relevant .graph files. They already answer most structural navigation questions: what calls what, what imports what, and what breaks if you change something. When you grep for a function name, .graph files appear in results showing every caller and callee — use this to navigate instead of searching for each one individually.` | ||
|
|
||
| func init() { | ||
| c := &cobra.Command{ | ||
| Use: "skill", | ||
| Short: "Print agent awareness prompt for graph files", | ||
| Long: `Prints a prompt that teaches AI coding agents how to use Supermodel's | ||
| graph files. Pipe into your agent's instructions: | ||
|
|
||
| supermodel skill >> CLAUDE.md | ||
| supermodel skill >> AGENTS.md | ||
| supermodel skill >> .cursorrules`, | ||
| Args: cobra.NoArgs, | ||
| Run: func(cmd *cobra.Command, args []string) { | ||
| fmt.Println(skillPrompt) | ||
| }, | ||
| } | ||
|
|
||
| rootCmd.AddCommand(c) | ||
| } |
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,32 @@ | ||
| package cmd | ||
|
|
||
| import ( | ||
| "strings" | ||
| "testing" | ||
| ) | ||
|
|
||
| func TestSkillPrompt_ContainsKeyElements(t *testing.T) { | ||
| required := []struct { | ||
| substr string | ||
| reason string | ||
| }{ | ||
| {".graph.", "must reference graph file extension"}, | ||
| {"[deps]", "must document deps section"}, | ||
| {"[calls]", "must document calls section"}, | ||
| {"[impact]", "must document impact section"}, | ||
| {".graph.py", "must show naming convention with concrete example"}, | ||
| {"before the source file", "must instruct read-order (graph first)"}, | ||
| } | ||
|
|
||
| for _, r := range required { | ||
| if !strings.Contains(skillPrompt, r.substr) { | ||
| t.Errorf("skill prompt missing %q — %s", r.substr, r.reason) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| func TestSkillPrompt_NotEmpty(t *testing.T) { | ||
| if len(strings.TrimSpace(skillPrompt)) < 100 { | ||
| t.Error("skill prompt is suspiciously short") | ||
| } | ||
| } |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
skill (generic)benchmark values look stale against this PR’s stated results.Line 12-Line 14 and Line 18 still show the older run (
$0.15,42s,11 turns). The PR objective states the updated result is$0.11,31s,7 turns, so the derived comparison line is also off.📌 Suggested update
Also applies to: 18-18
🤖 Prompt for AI Agents