Skip to content

Commit 265a066

Browse files
authored
Merge pull request #44 from nghodkicisco/feat/openclaw-hermes-support
This commit adds OpenClaw and Hermes agent framework support
2 parents e2d3ac9 + d9a5093 commit 265a066

7 files changed

Lines changed: 179 additions & 4 deletions

File tree

.github/workflows/build-ide-bundles.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ jobs:
5757
zip -r ../ide-rules-antigravity.zip .agent/
5858
zip -r ../ide-rules-opencode.zip .opencode/
5959
zip -r ../ide-rules-codex.zip .codex/
60+
zip -r ../ide-rules-openclaw.zip .openclaw/
61+
zip -r ../ide-rules-hermes.zip .hermes/
6062
cd ..
6163
zip -r ide-rules-all.zip dist/
6264
ls -lh ide-rules-*.zip
@@ -73,5 +75,7 @@ jobs:
7375
ide-rules-antigravity.zip \
7476
ide-rules-opencode.zip \
7577
ide-rules-codex.zip \
78+
ide-rules-openclaw.zip \
79+
ide-rules-hermes.zip \
7680
--clobber
7781

.github/workflows/validate-rules.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,17 @@ jobs:
103103
echo "❌ Codex rules not generated"
104104
exit 1
105105
fi
106-
106+
107+
if [ ! -d "test-output/.openclaw" ]; then
108+
echo "❌ OpenClaw rules not generated"
109+
exit 1
110+
fi
111+
112+
if [ ! -d "test-output/.hermes" ]; then
113+
echo "❌ Hermes rules not generated"
114+
exit 1
115+
fi
116+
107117
echo "✅ All IDE formats generated successfully"
108118
109119
- name: Check skills/ directory is up-to-date

docs/getting-started.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ Before you begin, familiarize yourself with how rules work in your AI coding too
4141

4242
:material-book-open-page-variant: [OpenCode Skills Documentation](https://opencode.ai/docs/skills/)
4343

44+
=== "OpenClaw"
45+
OpenClaw uses `.openclaw/skills` for skill configuration.
46+
47+
:material-book-open-page-variant: [OpenClaw Documentation](https://github.com/openclaw/openclaw)
48+
49+
=== "Hermes"
50+
Hermes uses `.hermes/skills` for skill configuration.
51+
52+
:material-book-open-page-variant: [Hermes Skills Documentation](https://hermes-agent.nousresearch.com/docs/skills/)
53+
4454
## Installation
4555

4656
### Option 1: Install Pre-built Rules (Recommended)
@@ -201,6 +211,34 @@ Select your AI coding tool and follow the instructions:
201211
!!! info "Codex Skills Documentation"
202212
For more information, see the [OpenAI Codex Skills documentation](https://developers.openai.com/codex/skills/).
203213

214+
=== "OpenClaw"
215+
216+
OpenClaw uses the [Agent Skills standard](https://agentskills.io/) for skill discovery.
217+
218+
1. **Download** [`ide-rules-openclaw.zip`](https://github.com/cosai-oasis/project-codeguard/releases) from the Releases page
219+
2. **Extract** the ZIP file
220+
3. **Copy** the `.openclaw/` directory to your project root:
221+
222+
```bash
223+
cp -r .openclaw/ /path/to/your/project/
224+
```
225+
226+
4. **Start a new session** in OpenClaw to load the rules
227+
228+
=== "Hermes"
229+
230+
Hermes uses the [Agent Skills standard](https://agentskills.io/) for skill discovery.
231+
232+
1. **Download** [`ide-rules-hermes.zip`](https://github.com/cosai-oasis/project-codeguard/releases) from the Releases page
233+
2. **Extract** the ZIP file
234+
3. **Copy** the `.hermes/` directory to your project root:
235+
236+
```bash
237+
cp -r .hermes/ /path/to/your/project/
238+
```
239+
240+
4. **Start a new session** in Hermes to load the rules
241+
204242
**Using multiple tools?** Download [`ide-rules-all.zip`](https://github.com/cosai-oasis/project-codeguard/releases) for all formats in one archive.
205243

206244
!!! tip "Repository Level Installation"
@@ -240,6 +278,8 @@ cp -r dist/.github/ /path/to/your/project/
240278
cp -r dist/.agent/ /path/to/your/project/
241279
cp -r dist/.opencode/ /path/to/your/project/
242280
cp -r dist/.codex/ /path/to/your/project/
281+
cp -r dist/.openclaw/ /path/to/your/project/
282+
cp -r dist/.hermes/ /path/to/your/project/
243283
```
244284

245285
## Core vs OWASP Sources
@@ -270,6 +310,8 @@ For GitHub repositories, you can automate rule updates with a workflow that runs
270310
- Antigravity (`.agent/rules/`)
271311
- OpenCode (`.opencode/skills/software-security/rules/`)
272312
- Codex (`.codex/skills/software-security/rules/`)
313+
- OpenClaw (`.openclaw/skills/software-security/rules/`)
314+
- Hermes (`.hermes/skills/software-security/rules/`)
273315

274316
### Setup
275317

@@ -294,6 +336,12 @@ your-project/
294336
│ └── rules/
295337
├── .github/
296338
│ └── instructions/
339+
├── .hermes/
340+
│ └── skills/
341+
│ └── software-security/
342+
├── .openclaw/
343+
│ └── skills/
344+
│ └── software-security/
297345
├── .opencode/
298346
│ └── skills/
299347
│ └── software-security/

src/convert_to_ide_formats.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
AntigravityFormat,
2222
OpenCodeFormat,
2323
CodexFormat,
24+
OpenClawFormat,
25+
HermesFormat,
2426
)
2527
from utils import get_version_from_pyproject
2628
from validate_versions import set_plugin_version, set_marketplace_version
@@ -136,11 +138,13 @@ def convert_rules(
136138
AntigravityFormat(version),
137139
]
138140

139-
# Only include Agent Skills, OpenCode, and Codex formats for core rules
141+
# Only include Agent Skills–based formats (skills with SKILL.md) for core rules
140142
if include_agentskills:
141143
all_formats.append(AgentSkillsFormat(version))
142144
all_formats.append(OpenCodeFormat(version))
143145
all_formats.append(CodexFormat(version))
146+
all_formats.append(OpenClawFormat(version))
147+
all_formats.append(HermesFormat(version))
144148

145149
converter = RuleConverter(formats=all_formats)
146150
path = Path(input_path)
@@ -272,6 +276,18 @@ def convert_rules(
272276
shutil.copy2(output_skill_path, codex_skill_dir / "SKILL.md")
273277
print(f"Copied SKILL.md to {codex_skill_dir / 'SKILL.md'}")
274278

279+
# Copy SKILL.md to the OpenClaw skill directory (.openclaw/skills/software-security/).
280+
openclaw_skill_dir = Path(output_dir) / ".openclaw" / "skills" / "software-security"
281+
openclaw_skill_dir.mkdir(parents=True, exist_ok=True)
282+
shutil.copy2(output_skill_path, openclaw_skill_dir / "SKILL.md")
283+
print(f"Copied SKILL.md to {openclaw_skill_dir / 'SKILL.md'}")
284+
285+
# Copy SKILL.md to the Hermes skill directory (.hermes/skills/software-security/).
286+
hermes_skill_dir = Path(output_dir) / ".hermes" / "skills" / "software-security"
287+
hermes_skill_dir.mkdir(parents=True, exist_ok=True)
288+
shutil.copy2(output_skill_path, hermes_skill_dir / "SKILL.md")
289+
print(f"Copied SKILL.md to {hermes_skill_dir / 'SKILL.md'}")
290+
275291
return results
276292

277293

@@ -372,7 +388,7 @@ def _resolve_source_paths(args) -> list[Path]:
372388
sources_list = ", ".join(p.name for p in source_paths)
373389
print(f"\nConverting {len(source_paths)} sources: {sources_list}")
374390
if has_core:
375-
print("(Agent Skills, OpenCode, and Codex will include only core rules)")
391+
print("(Agent Skills, OpenCode, Codex, OpenClaw, and Hermes will include only core rules)")
376392
print()
377393

378394
# Convert all sources

src/formats/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
- AntigravityFormat: Generates .md files for Google Antigravity
1212
- OpenCodeFormat: Generates .md files for OpenCode AI coding agent
1313
- CodexFormat: Generates .md files for OpenAI Codex
14+
- OpenClawFormat: Generates .md files for OpenClaw AI assistant
15+
- HermesFormat: Generates .md files for Hermes AI coding agent
1416
1517
Usage:
16-
from formats import BaseFormat, ProcessedRule, CursorFormat, WindsurfFormat, CopilotFormat, AgentSkillsFormat, AntigravityFormat, OpenCodeFormat, CodexFormat
18+
from formats import BaseFormat, ProcessedRule, CursorFormat, WindsurfFormat, CopilotFormat, AgentSkillsFormat, AntigravityFormat, OpenCodeFormat, CodexFormat, OpenClawFormat, HermesFormat
1719
1820
version = "1.0.0"
1921
formats = [
@@ -24,6 +26,8 @@
2426
AntigravityFormat(version),
2527
OpenCodeFormat(version),
2628
CodexFormat(version),
29+
OpenClawFormat(version),
30+
HermesFormat(version),
2731
]
2832
"""
2933

@@ -35,6 +39,8 @@
3539
from formats.antigravity import AntigravityFormat
3640
from formats.opencode import OpenCodeFormat
3741
from formats.codex import CodexFormat
42+
from formats.openclaw import OpenClawFormat
43+
from formats.hermes import HermesFormat
3844

3945
__all__ = [
4046
"BaseFormat",
@@ -46,4 +52,6 @@
4652
"AntigravityFormat",
4753
"OpenCodeFormat",
4854
"CodexFormat",
55+
"OpenClawFormat",
56+
"HermesFormat",
4957
]

src/formats/hermes.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
"""
2+
Hermes Format Implementation
3+
4+
Generates .md rule files for Hermes. The SKILL.md is copied from
5+
Agent Skills output (see convert_to_ide_formats.py); rule files are
6+
generated identically to Agent Skills via inheritance.
7+
8+
Hermes discovers skills by scanning for SKILL.md files in directory structures
9+
like .hermes/skills/<skill-name>/SKILL.md. Individual rule files live in a
10+
rules/ subdirectory that the skill tool discovers at runtime.
11+
12+
See: https://github.com/NousResearch/hermes-agent
13+
"""
14+
15+
from formats.agentskills import AgentSkillsFormat
16+
17+
18+
class HermesFormat(AgentSkillsFormat):
19+
"""
20+
Hermes format implementation (.md rule files).
21+
22+
Hermes (https://github.com/NousResearch/hermes-agent) is an AI coding
23+
agent by Nous Research that discovers skills by scanning for SKILL.md
24+
files in specific directory structures. Each skill must live in its own
25+
named directory:
26+
27+
.hermes/skills/<skill-name>/SKILL.md
28+
29+
Individual rule files are placed in a rules/ subdirectory:
30+
31+
.hermes/skills/<skill-name>/rules/<rule>.md
32+
33+
The rule files preserve the original YAML frontmatter (description,
34+
languages, alwaysApply) so rules remain complete and can be referenced
35+
by the AI coding agent.
36+
37+
Inherits generate() from AgentSkillsFormat since the rule file format
38+
is identical.
39+
"""
40+
41+
def get_format_name(self) -> str:
42+
return "hermes"
43+
44+
def get_output_subpath(self) -> str:
45+
return ".hermes/skills/software-security/rules"

src/formats/openclaw.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
"""
2+
OpenClaw Format Implementation
3+
4+
Generates .md rule files for OpenClaw. The SKILL.md is copied from
5+
Agent Skills output (see convert_to_ide_formats.py); rule files are
6+
generated identically to Agent Skills via inheritance.
7+
8+
OpenClaw discovers skills by scanning for SKILL.md files in directory structures
9+
like .openclaw/skills/<skill-name>/SKILL.md. Individual rule files live in a
10+
rules/ subdirectory that the skill tool discovers at runtime.
11+
12+
See: https://github.com/openclaw/openclaw
13+
"""
14+
15+
from formats.agentskills import AgentSkillsFormat
16+
17+
18+
class OpenClawFormat(AgentSkillsFormat):
19+
"""
20+
OpenClaw format implementation (.md rule files).
21+
22+
OpenClaw (https://github.com/openclaw/openclaw) is an AI assistant that
23+
discovers skills by scanning for SKILL.md files in specific directory
24+
structures. Each skill must live in its own named directory:
25+
26+
.openclaw/skills/<skill-name>/SKILL.md
27+
28+
Individual rule files are placed in a rules/ subdirectory:
29+
30+
.openclaw/skills/<skill-name>/rules/<rule>.md
31+
32+
The rule files preserve the original YAML frontmatter (description,
33+
languages, alwaysApply) so rules remain complete and can be referenced
34+
by the AI coding agent.
35+
36+
Inherits generate() from AgentSkillsFormat since the rule file format
37+
is identical.
38+
"""
39+
40+
def get_format_name(self) -> str:
41+
return "openclaw"
42+
43+
def get_output_subpath(self) -> str:
44+
return ".openclaw/skills/software-security/rules"

0 commit comments

Comments
 (0)