Skip to content

Commit a1daadc

Browse files
committed
Initial public release of Skillforge
0 parents  commit a1daadc

33 files changed

Lines changed: 3979 additions & 0 deletions

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 22
17+
cache: npm
18+
- run: npm ci
19+
- run: npm run check
20+
- run: npm test
21+
- run: npm run build

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
dist
3+
coverage
4+
.DS_Store
5+
*.log

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Bobtoshi
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Skillforge
2+
3+
Skillforge turns successful agent traces into reusable skills.
4+
5+
It compiles a source run into:
6+
7+
- a portable `skill.contract.json`
8+
- an OpenClaw-friendly `SKILL.md`
9+
- a `verification.report.json`
10+
- example inputs for reuse
11+
12+
The goal is simple: stop losing good agent work in transcripts. Capture what worked, parameterize it, attach approval gates, and make it reusable across OpenClaw or your own agent stack.
13+
14+
## Why it exists
15+
16+
Most agent tooling can execute one-off tasks, but successful runs usually die as logs. Skillforge promotes a successful trace into a reusable asset:
17+
18+
- extract inputs like paths, URLs, repositories, dates, and emails
19+
- convert raw steps into a reusable execution plan
20+
- infer tool requirements and approval gates
21+
- export an installable markdown skill plus a portable JSON contract
22+
- statically verify that the generated skill can be re-rendered safely
23+
24+
## Install
25+
26+
```bash
27+
npm install
28+
npm run build
29+
```
30+
31+
Or run the CLI directly in development:
32+
33+
```bash
34+
npm run dev -- inspect examples/fix-flaky-test.trace.json
35+
```
36+
37+
## CLI
38+
39+
Compile a trace into a skill bundle:
40+
41+
```bash
42+
npm run dev -- compile examples/fix-flaky-test.trace.json --out generated-skills
43+
```
44+
45+
Inspect a trace without writing files:
46+
47+
```bash
48+
npm run dev -- inspect examples/publish-weekly-report.trace.json
49+
```
50+
51+
Verify a generated contract:
52+
53+
```bash
54+
npm run dev -- verify generated-skills/fix-flaky-auth-test/skill.contract.json
55+
```
56+
57+
List a local skill registry:
58+
59+
```bash
60+
npm run dev -- list generated-skills
61+
```
62+
63+
## Supported input shapes
64+
65+
Skillforge accepts:
66+
67+
- normalized trace JSON with `objective` + `steps`
68+
- objects containing `messages`
69+
- objects containing `events`, `entries`, or `trace`
70+
- JSONL event streams
71+
72+
The compiler is intentionally conservative. It aims to create a useful reusable skill from incomplete data without executing any part of the source trace.
73+
74+
## Output structure
75+
76+
Each compiled skill bundle contains:
77+
78+
- `skill.contract.json`: portable contract for any agent runtime
79+
- `SKILL.md`: Markdown skill for OpenClaw-style skill registries
80+
- `verification.report.json`: static verification result
81+
- `inputs.example.json`: extracted example values
82+
83+
## Development
84+
85+
```bash
86+
npm run check
87+
npm test
88+
npm run build
89+
```
90+
91+
## Roadmap
92+
93+
- adapter plugins for more agent trace formats
94+
- richer policy engines for command risk classification
95+
- replay-backed verification harnesses
96+
- registry publishing and trust receipts

examples/fix-flaky-test.trace.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"schemaVersion": "1.0",
3+
"metadata": {
4+
"source": "demo",
5+
"title": "Fix flaky auth test"
6+
},
7+
"objective": "Fix the flaky test in tests/auth.spec.ts and verify it with npm test -- auth.",
8+
"steps": [
9+
{
10+
"kind": "message",
11+
"role": "user",
12+
"content": "Fix the flaky test in tests/auth.spec.ts and make sure npm test -- auth passes."
13+
},
14+
{
15+
"kind": "tool",
16+
"tool": "read_file",
17+
"input": {
18+
"path": "tests/auth.spec.ts"
19+
}
20+
},
21+
{
22+
"kind": "tool",
23+
"tool": "edit_file",
24+
"input": {
25+
"path": "tests/auth.spec.ts",
26+
"instruction": "Replace the fixed sleep with a waitFor assertion."
27+
}
28+
},
29+
{
30+
"kind": "tool",
31+
"tool": "bash",
32+
"input": {
33+
"command": "npm test -- auth"
34+
}
35+
},
36+
{
37+
"kind": "artifact",
38+
"path": "tests/auth.spec.ts",
39+
"summary": "Updated flaky test with deterministic waiting."
40+
}
41+
]
42+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"metadata": {
3+
"source": "demo",
4+
"title": "Publish weekly report"
5+
},
6+
"objective": "Draft the weekly report in reports/weekly-2026-04-01.md from https://status.example.com and get approval before git commit.",
7+
"steps": [
8+
{
9+
"kind": "message",
10+
"role": "user",
11+
"content": "Draft the weekly report in reports/weekly-2026-04-01.md from https://status.example.com."
12+
},
13+
{
14+
"kind": "tool",
15+
"tool": "web_fetch",
16+
"input": {
17+
"url": "https://status.example.com"
18+
}
19+
},
20+
{
21+
"kind": "tool",
22+
"tool": "write_file",
23+
"input": {
24+
"path": "reports/weekly-2026-04-01.md",
25+
"content": "# Weekly Report\n\nSummarize incidents and uptime."
26+
}
27+
},
28+
{
29+
"kind": "approval",
30+
"reason": "Approve the generated report before making a commit."
31+
},
32+
{
33+
"kind": "tool",
34+
"tool": "bash",
35+
"input": {
36+
"command": "git commit -am \"weekly report\""
37+
}
38+
}
39+
]
40+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Fix Flaky Auth Test
3+
slug: fix-flaky-auth-test
4+
summary: Fix the flaky test in tests/auth.spec.ts and verify it with npm test -- auth.
5+
generated_by: skillforge
6+
trust_score: 92
7+
---
8+
9+
# Fix Flaky Auth Test
10+
11+
## Objective
12+
Fix the flaky test in tests/auth.spec.ts and verify it with npm test -- auth.
13+
14+
## Inputs
15+
- `authSpecPath` (path): File or directory path detected in the source run. Example: `tests/auth.spec.ts`.
16+
- `authSpecTsRepository` (repo): Repository reference detected in the source run. Example: `tests/auth.spec.ts`.
17+
18+
## Required Tools
19+
- `read_file`: read_file is a bounded trace step. Risk: low. Approval: none.
20+
- `edit_file`: edit_file changes files. Risk: medium. Approval: recommended.
21+
- `bash`: command `npm test -- auth` looks read-only or verification-focused. Risk: low. Approval: none.
22+
23+
## Approval Gates
24+
- Approval recommended before run edit_file because edit_file changes files
25+
26+
## Execution Plan
27+
1. Fix the flaky test in {{authSpecPath}} and verify it with npm test -- auth.
28+
2. Fix the flaky test in {{authSpecPath}} and make sure npm test -- auth passes.
29+
3. Read {{authSpecPath}}
30+
4. Modify {{authSpecPath}} with {
31+
"instruction": "Replace the fixed sleep with a waitFor assertion.",
32+
"path": "{{authSpecPath}}"
33+
}
34+
5. Run command: npm test -- auth
35+
6. Collect artifact {{authSpecPath}}: Updated flaky test with deterministic waiting.
36+
37+
## Verification
38+
- `npm test -- auth`
39+
- `Collect artifact {{authSpecPath}}: Updated flaky test with deterministic waiting.`
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"authSpecPath": "tests/auth.spec.ts",
3+
"authSpecTsRepository": "tests/auth.spec.ts"
4+
}

0 commit comments

Comments
 (0)