Repository navigation
Add --skills-dir, --skills and --methodology to the CLI - #1779
Merged
Merged
Conversation
--skills loads named skills into the root agent before the scan starts and is persisted in run.json so --resume keeps them. --skills-dir and STRIX_SKILLS_DIR add extra skill roots ahead of the packaged set so installed builds can add or override skills without rebuilding. Docs explain when to use an instruction file versus a skill.
Contributor
[Medium impact] The changes affect scan setup and the prompts used by Strix agents. Fix the lost resume guidance and empty-prompt failure before merging. Findings
Fix with agent prompt### Issue 1
strix/interface/cli_args.py:571-573
**Custom skills vanish on resume.** A run started with `--skills-dir ./my-skills --skills custom/foo` saves the skill name but not its directory. A later `--resume RUN_NAME` in a new process restores the name without restoring the search path. The rebuilt prompt silently skips the skill; overrides of built-in skills silently revert to the packaged version. Save and restore the custom directories, or save the skill contents, before rebuilding resumed agents.
### Issue 2
strix/agents/prompt.py:138-142
**Skill name empties the prompt.** Loading a custom skill named `methodology` puts that key in `skill_content`. The new explicit `methodology=` argument then conflicts with `**skill_content`, raising `TypeError` even without `--methodology`. The exception handler returns an empty string, which the factory uses as the agent's instructions. Keep skill bodies separate from the template's named arguments so a valid skill name cannot erase the entire system prompt.
### Issue 3
strix/interface/cli_args.py:395-396
**Distinct methodologies get dropped.** `resolve_methodology` reduces file paths and qualified skill names to a short display name. This check then silently drops any later item with that name. For example, `--methodology ./team/methodology.md --methodology ./project/methodology.md` applies only the first file, even when their contents differ. Deduplicate by the resolved source, not the display tag, or reject the collision explicitly.
### Issue 4
strix/skills/__init__.py:64-66
**Saved skill directories are ignored.** The configuration guide supports settings through the JSON file's `env` map, but `env_skill_dirs` reads only `os.environ`. The configuration loader neither exports file values there nor recognizes `STRIX_SKILLS_DIR` as a settings field. Thus `{"env":{"STRIX_SKILLS_DIR":"/my/skills"}}` has no effect: custom names are rejected and built-in overrides are not used. Connect this option to the settings loader, or clearly document it as environment-only.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryAdds command-line options to preload skills, use custom skill directories, and apply shared methodologies to scan agents.
Reviews (1) · Last reviewed commit: "Add --methodology to apply a file or ski..." · Reviewed by Greptile |
A file named methodology.md rendered as nested <methodology> tags in the system prompt. Such an entry now uses the tag methodology_rules.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds two things the CLI did not have: a way to use your own skills without editing the installed package, and a way to give a testing methodology to every agent in a scan.
Before this change, a custom skill had to be put in
strix/skills/inside the install. A cross-cutting methodology (coordination rules, shared artifacts, completion criteria) had no good home: as a skill, it is only a name and a one-line description in a catalog, and an agent may never pick it.New flags
--skills-dir PATH(repeatable),STRIX_SKILLS_DIR<category>/<name>.mdlayout as the built-in skills. The agents find them in the skill catalog. A custom skill with the same relative path as a built-in skill replaces it.STRIX_SKILLS_DIRtakes several directories, separated byos.pathsep.--skills a,b--methodology FILE_OR_SKILL(repeatable)How a methodology reaches every agent
resolve_methodology(ref)reads the file or the skill. A missing or empty file is a CLI error.render_system_prompt(..., methodology=[{name, content}])renders a<methodology>block, one tag per entry. The block tells agents to follow its coordination rules, to pass what a child needs in the delegated task, and to load or assign the skills it names. It also states that the methodology does not change the authorized scope.methodology_tag(name)makes the tag name safe. An entry namedmethodologyrenders as<methodology_rules>so it does not nest inside the wrapper tag.When to use which
--instruction/--instruction-file: facts about this engagement (targets, credentials, focus).--methodology: how to do the work, reused across engagements, seen by every agent.docs/advanced/skills.mdx(new),docs/usage/cli.mdx,docs/usage/instructions.mdxanddocs/advanced/configuration.mdxdocument this.Tests
tests/test_cli_skills.py(20 tests) covers flag parsing, directory precedence,STRIX_SKILLS_DIR, methodology resolution and errors, the rendered prompt for root and child agents, and the tag name rule. A real scan with--methodologyand--skills-diragainst a local test API showed the methodology in the root and child system prompts.Closes STR-1649
Link to Devin session: https://app.devin.ai/sessions/b45989020f3943e3b150469e7bcf97ec
Open in Devin Desktop: https://app.devin.ai/desktop/session/b45989020f3943e3b150469e7bcf97ec?variant=devin
Requested by: @bearsyankees