agent-skillforge 0.2.0__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {agent_skillforge-0.2.0/src/agent_skillforge.egg-info → agent_skillforge-0.4.0}/PKG-INFO +65 -9
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/README.md +64 -8
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/pyproject.toml +1 -1
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0/src/agent_skillforge.egg-info}/PKG-INFO +65 -9
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/agent_skillforge.egg-info/SOURCES.txt +7 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/__init__.py +1 -2
- agent_skillforge-0.4.0/src/skillforge/builtin_skills/contract-test-generator/SKILL.md +52 -0
- agent_skillforge-0.4.0/src/skillforge/builtin_skills/performance-profiler/SKILL.md +35 -0
- agent_skillforge-0.4.0/src/skillforge/builtin_skills/secret-sanitizer/SKILL.md +42 -0
- agent_skillforge-0.4.0/src/skillforge/builtin_skills/security-threat-modeler/SKILL.md +37 -0
- agent_skillforge-0.4.0/src/skillforge/builtin_skills/skill-architect/SKILL.md +37 -0
- agent_skillforge-0.4.0/src/skillforge/builtin_skills/skill-architect/references/mechanics.md +27 -0
- agent_skillforge-0.4.0/src/skillforge/builtin_skills/supply-chain-sentinel/SKILL.md +42 -0
- agent_skillforge-0.4.0/src/skillforge/cli.py +683 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/mcp_server.py +29 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/security.py +160 -9
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/skill.py +64 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/tests/test_builtins.py +16 -8
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/tests/test_cli.py +73 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/tests/test_mcp_server.py +22 -3
- agent_skillforge-0.4.0/tests/test_security.py +132 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/tests/test_skill.py +23 -0
- agent_skillforge-0.2.0/src/skillforge/cli.py +0 -311
- agent_skillforge-0.2.0/tests/test_security.py +0 -64
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/LICENSE +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/setup.cfg +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/agent_skillforge.egg-info/dependency_links.txt +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/agent_skillforge.egg-info/entry_points.txt +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/agent_skillforge.egg-info/requires.txt +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/agent_skillforge.egg-info/top_level.txt +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/__main__.py +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/adapters.py +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/builtin_skills/agent-observability/SKILL.md +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/builtin_skills/antislop-code/SKILL.md +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/builtin_skills/blast-radius-containment/SKILL.md +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/builtin_skills/caveman/SKILL.md +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/builtin_skills/cognitive-loop-breaker/SKILL.md +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/builtin_skills/context-compactor/SKILL.md +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/builtin_skills/flaky-test-isolation/SKILL.md +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/builtin_skills/human-in-the-loop/SKILL.md +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/builtin_skills/mcp-tool-designer/SKILL.md +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/builtin_skills/runtime-api-verification/SKILL.md +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/builtin_skills/self-improving-agent/SKILL.md +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/builtin_skills/spec-driven-development/SKILL.md +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/builtin_skills/summarize/SKILL.md +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/builtin_skills/systematic-debugging/SKILL.md +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/builtin_skills/tavily-search/SKILL.md +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/builtin_skills/zero-downtime-migration/SKILL.md +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/errors.py +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/src/skillforge/registry.py +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/tests/test_adapters.py +0 -0
- {agent_skillforge-0.2.0 → agent_skillforge-0.4.0}/tests/test_registry.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agent-skillforge
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Universal package manager, security auditor, and MCP server for portable agent skills (SKILL.md).
|
|
5
5
|
Author-email: gintingism <gintingism@users.noreply.github.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -75,11 +75,16 @@ skillforge add anthropics/skills:pdf
|
|
|
75
75
|
skillforge add gintingism/skillforge:systematic-debugging
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
SkillForge fetches the skill, runs a security check against it, installs it into your project's active assistant folders, and pins
|
|
78
|
+
SkillForge fetches the skill, runs a security check against it, installs it into your project's active assistant folders, and pins its SHA-256 package digest in `skillforge.lock`.
|
|
79
|
+
|
|
80
|
+
To install and verify all locked skills across a team checkout or CI environment:
|
|
81
|
+
```bash
|
|
82
|
+
skillforge sync
|
|
83
|
+
```
|
|
79
84
|
|
|
80
85
|
### 2. Audit a skill before running it (`audit`)
|
|
81
86
|
|
|
82
|
-
Before letting an agent read and execute a skill, inspect it for hidden payloads and prompt injection:
|
|
87
|
+
Before letting an agent read and execute a skill, inspect it for hidden payloads, broken progressive disclosure links, and prompt injection:
|
|
83
88
|
|
|
84
89
|
```bash
|
|
85
90
|
skillforge audit ./skills/my-new-skill
|
|
@@ -89,22 +94,66 @@ Example output:
|
|
|
89
94
|
```text
|
|
90
95
|
Audit Report: my-new-skill
|
|
91
96
|
Status: PASSED (Score: 100/100)
|
|
97
|
+
Context Load: 24 pointer tokens | 280 body tokens (42 lines)
|
|
92
98
|
Total Findings: 0
|
|
93
99
|
```
|
|
94
100
|
|
|
95
101
|
What the auditor scans for:
|
|
96
102
|
- **Invisible Unicode (SEC-001):** Zero-width spaces (`\u200B`, `\uFEFF`), homoglyphs, and directional overrides used to hide prompt instructions from human code review.
|
|
97
|
-
- **Prompt Injections & Jailbreaks (SEC-002):** Directives like `"ignore previous instructions"`, `"system override"`, or attempts to disable safety guardrails.
|
|
103
|
+
- **Prompt Injections & Jailbreaks (SEC-002):** Directives like `"ignore previous instructions"`, `"system override"`, or attempts to disable safety guardrails (with smart context filters for defensive guides).
|
|
98
104
|
- **Dangerous Shell Commands (SEC-003):** Script patterns like `curl ... | bash`, base64-decoded execution, and outbound data exfiltration.
|
|
99
105
|
- **Credential Path Access (SEC-004):** Unsanctioned attempts to access `~/.ssh`, `~/.aws/credentials`, or local environment secrets.
|
|
100
|
-
- **
|
|
106
|
+
- **Data & Environment Exfiltration (SEC-005):** Sending environment variables or secrets to external webhook endpoints (`webhook.site`, `pipedream.net`).
|
|
107
|
+
- **Hardcoded Secrets & API Keys (SEC-006):** Detects hardcoded GitHub tokens, Anthropic API keys, Google Cloud keys, and AWS credentials.
|
|
108
|
+
- **Trigger Quality (QUAL-001):** Checks whether model-invoked descriptions contain explicit activation conditions (skipped when `disable-model-invocation: true`).
|
|
109
|
+
- **Directory Alignment (QUAL-002):** Verifies the package folder name matches the skill `name` in YAML frontmatter.
|
|
110
|
+
- **Progressive Disclosure Budget (QUAL-003):** Flags `SKILL.md` bodies exceeding 500 lines or ~5,000 tokens so heavy reference docs are moved into `references/`.
|
|
111
|
+
- **Broken Disclosure Pointers (QUAL-004):** Verifies every `references/...` or `scripts/...` file cited in `SKILL.md` actually exists in the package.
|
|
112
|
+
- **Applicability Hijacking (QUAL-006):** Flags overbroad trigger descriptions that claim all tasks (metadata poisoning).
|
|
101
113
|
|
|
102
114
|
For CI pipelines, pass `--strict` to fail on any warning, or `--json` for automation:
|
|
103
115
|
```bash
|
|
104
116
|
skillforge audit ./skills/my-new-skill --strict --json
|
|
105
117
|
```
|
|
106
118
|
|
|
107
|
-
### 3.
|
|
119
|
+
### 3. Run a full environment diagnostic (`doctor`)
|
|
120
|
+
|
|
121
|
+
Inspect all installed skills across your project or global workstation (Claude Code, Cursor, Antigravity, Windsurf) for security vulnerabilities, context window load, and broken pointers:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Diagnose active project
|
|
125
|
+
skillforge doctor
|
|
126
|
+
|
|
127
|
+
# Diagnose all global machine skills
|
|
128
|
+
skillforge doctor --global
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### 4. Compare changes before updating (`diff`)
|
|
132
|
+
|
|
133
|
+
Inspect diffs between local skills and upstream repositories, or compare two skill versions:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
skillforge diff ./skills/my-skill
|
|
137
|
+
skillforge diff my-skill gintingism/skillforge:my-skill
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### 5. Profile your project's context token budget (`budget`)
|
|
141
|
+
|
|
142
|
+
Every model-invoked skill keeps its `name` and `description` in the startup context window on every turn. Measure how much context your skills consume before they even trigger:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
skillforge budget
|
|
146
|
+
# Or inspect the built-in catalog:
|
|
147
|
+
skillforge budget --builtin
|
|
148
|
+
```
|
|
149
|
+
```text
|
|
150
|
+
Context Budget Profile (22 skills)
|
|
151
|
+
Always-Loaded Startup Pointer Cost: ~1280 tokens
|
|
152
|
+
On-Demand SKILL.md Body Cost: ~7450 tokens
|
|
153
|
+
Disclosed Resources Cost: ~349 tokens
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### 6. Check what's installed in your project (`list` & `remove`)
|
|
108
157
|
|
|
109
158
|
See which skills are active across your editor targets:
|
|
110
159
|
|
|
@@ -126,7 +175,7 @@ To remove a skill from all detected assistants and update your lockfile:
|
|
|
126
175
|
skillforge remove antislop-code
|
|
127
176
|
```
|
|
128
177
|
|
|
129
|
-
###
|
|
178
|
+
### 5. Create and package your own skills (`create` & `pack`)
|
|
130
179
|
|
|
131
180
|
Scaffold a single skill file or a full directory package with scripts and reference docs:
|
|
132
181
|
|
|
@@ -169,10 +218,15 @@ skillforge install systematic-debugging --global
|
|
|
169
218
|
|
|
170
219
|
## Shipped Built-in Skills
|
|
171
220
|
|
|
172
|
-
SkillForge ships with
|
|
221
|
+
SkillForge ships with 22 practical engineering skills designed to counteract common agent failure modes identified in benchmark research (SWE-bench, Snyk ToxicSkills, Skill-Inject):
|
|
173
222
|
|
|
174
|
-
### Code Quality &
|
|
223
|
+
### Code Quality, Security & Performance
|
|
224
|
+
- `supply-chain-sentinel`: Verify package existence, registry age, and run CVE audits (`pip-audit`, `npm audit`) before adding dependencies.
|
|
225
|
+
- `secret-sanitizer`: Pre-commit git diff auditor that prevents API keys, private tokens, and `.env` credentials from leaking.
|
|
226
|
+
- `contract-test-generator`: Property-based testing and contract boundary fuzz tests (Hypothesis, fast-check) to verify algebraic invariants.
|
|
175
227
|
- `blast-radius-containment`: Upstream reference tracing and a strict "file touch budget" before modifying shared code or public APIs.
|
|
228
|
+
- `security-threat-modeler`: Trust-boundary mapping, IDOR/BOLA object-level authorization checks, SSRF validation, and injection sink verification.
|
|
229
|
+
- `performance-profiler`: Baseline-first latency (`p50`/`p95`/`p99`), N+1 query detection, and algorithmic complexity verification before optimizing.
|
|
176
230
|
- `antislop-code`: Comment hygiene and anti-overengineering filters (removes trivial narrative comments, stops speculative generality).
|
|
177
231
|
- `spec-driven-development`: Schema-first API design and red-green verification loops before writing application logic.
|
|
178
232
|
- `zero-downtime-migration`: Four-phase Expand-Contract pattern for non-breaking database schema and API payload evolutions.
|
|
@@ -184,6 +238,7 @@ SkillForge ships with 16 practical engineering skills designed to counteract com
|
|
|
184
238
|
- `runtime-api-verification`: Interactive signature introspection (`inspect`, `dir()`, compiler definitions) to prevent hallucinated kwargs.
|
|
185
239
|
|
|
186
240
|
### Context Efficiency & Multi-Agent Operations
|
|
241
|
+
- `skill-architect`: Multi-file progressive disclosure guide (bundled with `references/mechanics.md`) for authoring low-token `SKILL.md`, `AGENTS.md`, and `CLAUDE.md` files.
|
|
187
242
|
- `caveman`: Terse, high-density technical communication mode that reduces token spend while preserving exact paths, commands, and errors.
|
|
188
243
|
- `context-compactor`: Structured state distillation and active hypothesis ledgers for long-running agent threads nearing context limits.
|
|
189
244
|
- `mcp-tool-designer`: Type-safe schema design, idempotent hints, token boundaries, and stderr error separation for MCP servers.
|
|
@@ -216,6 +271,7 @@ SkillForge can run as an MCP server so your agent can search, read, and audit sk
|
|
|
216
271
|
Exposed MCP tools:
|
|
217
272
|
- `search_skills(query, limit)`: Search local and built-in skill catalogs.
|
|
218
273
|
- `get_skill(name)`: Read the full `SKILL.md` instructions.
|
|
274
|
+
- `get_skill_resource(name, resource_path)`: Read disclosed `references/*` or `scripts/*` files from a skill package on demand.
|
|
219
275
|
- `validate_skill(content)`: Test frontmatter syntax.
|
|
220
276
|
- `audit_skill(content)`: Audit a raw skill document for prompt injections and malicious patterns.
|
|
221
277
|
- `skill://{name}`: Resource URI for direct document retrieval.
|
|
@@ -37,11 +37,16 @@ skillforge add anthropics/skills:pdf
|
|
|
37
37
|
skillforge add gintingism/skillforge:systematic-debugging
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
SkillForge fetches the skill, runs a security check against it, installs it into your project's active assistant folders, and pins
|
|
40
|
+
SkillForge fetches the skill, runs a security check against it, installs it into your project's active assistant folders, and pins its SHA-256 package digest in `skillforge.lock`.
|
|
41
|
+
|
|
42
|
+
To install and verify all locked skills across a team checkout or CI environment:
|
|
43
|
+
```bash
|
|
44
|
+
skillforge sync
|
|
45
|
+
```
|
|
41
46
|
|
|
42
47
|
### 2. Audit a skill before running it (`audit`)
|
|
43
48
|
|
|
44
|
-
Before letting an agent read and execute a skill, inspect it for hidden payloads and prompt injection:
|
|
49
|
+
Before letting an agent read and execute a skill, inspect it for hidden payloads, broken progressive disclosure links, and prompt injection:
|
|
45
50
|
|
|
46
51
|
```bash
|
|
47
52
|
skillforge audit ./skills/my-new-skill
|
|
@@ -51,22 +56,66 @@ Example output:
|
|
|
51
56
|
```text
|
|
52
57
|
Audit Report: my-new-skill
|
|
53
58
|
Status: PASSED (Score: 100/100)
|
|
59
|
+
Context Load: 24 pointer tokens | 280 body tokens (42 lines)
|
|
54
60
|
Total Findings: 0
|
|
55
61
|
```
|
|
56
62
|
|
|
57
63
|
What the auditor scans for:
|
|
58
64
|
- **Invisible Unicode (SEC-001):** Zero-width spaces (`\u200B`, `\uFEFF`), homoglyphs, and directional overrides used to hide prompt instructions from human code review.
|
|
59
|
-
- **Prompt Injections & Jailbreaks (SEC-002):** Directives like `"ignore previous instructions"`, `"system override"`, or attempts to disable safety guardrails.
|
|
65
|
+
- **Prompt Injections & Jailbreaks (SEC-002):** Directives like `"ignore previous instructions"`, `"system override"`, or attempts to disable safety guardrails (with smart context filters for defensive guides).
|
|
60
66
|
- **Dangerous Shell Commands (SEC-003):** Script patterns like `curl ... | bash`, base64-decoded execution, and outbound data exfiltration.
|
|
61
67
|
- **Credential Path Access (SEC-004):** Unsanctioned attempts to access `~/.ssh`, `~/.aws/credentials`, or local environment secrets.
|
|
62
|
-
- **
|
|
68
|
+
- **Data & Environment Exfiltration (SEC-005):** Sending environment variables or secrets to external webhook endpoints (`webhook.site`, `pipedream.net`).
|
|
69
|
+
- **Hardcoded Secrets & API Keys (SEC-006):** Detects hardcoded GitHub tokens, Anthropic API keys, Google Cloud keys, and AWS credentials.
|
|
70
|
+
- **Trigger Quality (QUAL-001):** Checks whether model-invoked descriptions contain explicit activation conditions (skipped when `disable-model-invocation: true`).
|
|
71
|
+
- **Directory Alignment (QUAL-002):** Verifies the package folder name matches the skill `name` in YAML frontmatter.
|
|
72
|
+
- **Progressive Disclosure Budget (QUAL-003):** Flags `SKILL.md` bodies exceeding 500 lines or ~5,000 tokens so heavy reference docs are moved into `references/`.
|
|
73
|
+
- **Broken Disclosure Pointers (QUAL-004):** Verifies every `references/...` or `scripts/...` file cited in `SKILL.md` actually exists in the package.
|
|
74
|
+
- **Applicability Hijacking (QUAL-006):** Flags overbroad trigger descriptions that claim all tasks (metadata poisoning).
|
|
63
75
|
|
|
64
76
|
For CI pipelines, pass `--strict` to fail on any warning, or `--json` for automation:
|
|
65
77
|
```bash
|
|
66
78
|
skillforge audit ./skills/my-new-skill --strict --json
|
|
67
79
|
```
|
|
68
80
|
|
|
69
|
-
### 3.
|
|
81
|
+
### 3. Run a full environment diagnostic (`doctor`)
|
|
82
|
+
|
|
83
|
+
Inspect all installed skills across your project or global workstation (Claude Code, Cursor, Antigravity, Windsurf) for security vulnerabilities, context window load, and broken pointers:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Diagnose active project
|
|
87
|
+
skillforge doctor
|
|
88
|
+
|
|
89
|
+
# Diagnose all global machine skills
|
|
90
|
+
skillforge doctor --global
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 4. Compare changes before updating (`diff`)
|
|
94
|
+
|
|
95
|
+
Inspect diffs between local skills and upstream repositories, or compare two skill versions:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
skillforge diff ./skills/my-skill
|
|
99
|
+
skillforge diff my-skill gintingism/skillforge:my-skill
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### 5. Profile your project's context token budget (`budget`)
|
|
103
|
+
|
|
104
|
+
Every model-invoked skill keeps its `name` and `description` in the startup context window on every turn. Measure how much context your skills consume before they even trigger:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
skillforge budget
|
|
108
|
+
# Or inspect the built-in catalog:
|
|
109
|
+
skillforge budget --builtin
|
|
110
|
+
```
|
|
111
|
+
```text
|
|
112
|
+
Context Budget Profile (22 skills)
|
|
113
|
+
Always-Loaded Startup Pointer Cost: ~1280 tokens
|
|
114
|
+
On-Demand SKILL.md Body Cost: ~7450 tokens
|
|
115
|
+
Disclosed Resources Cost: ~349 tokens
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 6. Check what's installed in your project (`list` & `remove`)
|
|
70
119
|
|
|
71
120
|
See which skills are active across your editor targets:
|
|
72
121
|
|
|
@@ -88,7 +137,7 @@ To remove a skill from all detected assistants and update your lockfile:
|
|
|
88
137
|
skillforge remove antislop-code
|
|
89
138
|
```
|
|
90
139
|
|
|
91
|
-
###
|
|
140
|
+
### 5. Create and package your own skills (`create` & `pack`)
|
|
92
141
|
|
|
93
142
|
Scaffold a single skill file or a full directory package with scripts and reference docs:
|
|
94
143
|
|
|
@@ -131,10 +180,15 @@ skillforge install systematic-debugging --global
|
|
|
131
180
|
|
|
132
181
|
## Shipped Built-in Skills
|
|
133
182
|
|
|
134
|
-
SkillForge ships with
|
|
183
|
+
SkillForge ships with 22 practical engineering skills designed to counteract common agent failure modes identified in benchmark research (SWE-bench, Snyk ToxicSkills, Skill-Inject):
|
|
135
184
|
|
|
136
|
-
### Code Quality &
|
|
185
|
+
### Code Quality, Security & Performance
|
|
186
|
+
- `supply-chain-sentinel`: Verify package existence, registry age, and run CVE audits (`pip-audit`, `npm audit`) before adding dependencies.
|
|
187
|
+
- `secret-sanitizer`: Pre-commit git diff auditor that prevents API keys, private tokens, and `.env` credentials from leaking.
|
|
188
|
+
- `contract-test-generator`: Property-based testing and contract boundary fuzz tests (Hypothesis, fast-check) to verify algebraic invariants.
|
|
137
189
|
- `blast-radius-containment`: Upstream reference tracing and a strict "file touch budget" before modifying shared code or public APIs.
|
|
190
|
+
- `security-threat-modeler`: Trust-boundary mapping, IDOR/BOLA object-level authorization checks, SSRF validation, and injection sink verification.
|
|
191
|
+
- `performance-profiler`: Baseline-first latency (`p50`/`p95`/`p99`), N+1 query detection, and algorithmic complexity verification before optimizing.
|
|
138
192
|
- `antislop-code`: Comment hygiene and anti-overengineering filters (removes trivial narrative comments, stops speculative generality).
|
|
139
193
|
- `spec-driven-development`: Schema-first API design and red-green verification loops before writing application logic.
|
|
140
194
|
- `zero-downtime-migration`: Four-phase Expand-Contract pattern for non-breaking database schema and API payload evolutions.
|
|
@@ -146,6 +200,7 @@ SkillForge ships with 16 practical engineering skills designed to counteract com
|
|
|
146
200
|
- `runtime-api-verification`: Interactive signature introspection (`inspect`, `dir()`, compiler definitions) to prevent hallucinated kwargs.
|
|
147
201
|
|
|
148
202
|
### Context Efficiency & Multi-Agent Operations
|
|
203
|
+
- `skill-architect`: Multi-file progressive disclosure guide (bundled with `references/mechanics.md`) for authoring low-token `SKILL.md`, `AGENTS.md`, and `CLAUDE.md` files.
|
|
149
204
|
- `caveman`: Terse, high-density technical communication mode that reduces token spend while preserving exact paths, commands, and errors.
|
|
150
205
|
- `context-compactor`: Structured state distillation and active hypothesis ledgers for long-running agent threads nearing context limits.
|
|
151
206
|
- `mcp-tool-designer`: Type-safe schema design, idempotent hints, token boundaries, and stderr error separation for MCP servers.
|
|
@@ -178,6 +233,7 @@ SkillForge can run as an MCP server so your agent can search, read, and audit sk
|
|
|
178
233
|
Exposed MCP tools:
|
|
179
234
|
- `search_skills(query, limit)`: Search local and built-in skill catalogs.
|
|
180
235
|
- `get_skill(name)`: Read the full `SKILL.md` instructions.
|
|
236
|
+
- `get_skill_resource(name, resource_path)`: Read disclosed `references/*` or `scripts/*` files from a skill package on demand.
|
|
181
237
|
- `validate_skill(content)`: Test frontmatter syntax.
|
|
182
238
|
- `audit_skill(content)`: Audit a raw skill document for prompt injections and malicious patterns.
|
|
183
239
|
- `skill://{name}`: Resource URI for direct document retrieval.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "agent-skillforge"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.4.0"
|
|
8
8
|
description = "Universal package manager, security auditor, and MCP server for portable agent skills (SKILL.md)."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agent-skillforge
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Universal package manager, security auditor, and MCP server for portable agent skills (SKILL.md).
|
|
5
5
|
Author-email: gintingism <gintingism@users.noreply.github.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -75,11 +75,16 @@ skillforge add anthropics/skills:pdf
|
|
|
75
75
|
skillforge add gintingism/skillforge:systematic-debugging
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
SkillForge fetches the skill, runs a security check against it, installs it into your project's active assistant folders, and pins
|
|
78
|
+
SkillForge fetches the skill, runs a security check against it, installs it into your project's active assistant folders, and pins its SHA-256 package digest in `skillforge.lock`.
|
|
79
|
+
|
|
80
|
+
To install and verify all locked skills across a team checkout or CI environment:
|
|
81
|
+
```bash
|
|
82
|
+
skillforge sync
|
|
83
|
+
```
|
|
79
84
|
|
|
80
85
|
### 2. Audit a skill before running it (`audit`)
|
|
81
86
|
|
|
82
|
-
Before letting an agent read and execute a skill, inspect it for hidden payloads and prompt injection:
|
|
87
|
+
Before letting an agent read and execute a skill, inspect it for hidden payloads, broken progressive disclosure links, and prompt injection:
|
|
83
88
|
|
|
84
89
|
```bash
|
|
85
90
|
skillforge audit ./skills/my-new-skill
|
|
@@ -89,22 +94,66 @@ Example output:
|
|
|
89
94
|
```text
|
|
90
95
|
Audit Report: my-new-skill
|
|
91
96
|
Status: PASSED (Score: 100/100)
|
|
97
|
+
Context Load: 24 pointer tokens | 280 body tokens (42 lines)
|
|
92
98
|
Total Findings: 0
|
|
93
99
|
```
|
|
94
100
|
|
|
95
101
|
What the auditor scans for:
|
|
96
102
|
- **Invisible Unicode (SEC-001):** Zero-width spaces (`\u200B`, `\uFEFF`), homoglyphs, and directional overrides used to hide prompt instructions from human code review.
|
|
97
|
-
- **Prompt Injections & Jailbreaks (SEC-002):** Directives like `"ignore previous instructions"`, `"system override"`, or attempts to disable safety guardrails.
|
|
103
|
+
- **Prompt Injections & Jailbreaks (SEC-002):** Directives like `"ignore previous instructions"`, `"system override"`, or attempts to disable safety guardrails (with smart context filters for defensive guides).
|
|
98
104
|
- **Dangerous Shell Commands (SEC-003):** Script patterns like `curl ... | bash`, base64-decoded execution, and outbound data exfiltration.
|
|
99
105
|
- **Credential Path Access (SEC-004):** Unsanctioned attempts to access `~/.ssh`, `~/.aws/credentials`, or local environment secrets.
|
|
100
|
-
- **
|
|
106
|
+
- **Data & Environment Exfiltration (SEC-005):** Sending environment variables or secrets to external webhook endpoints (`webhook.site`, `pipedream.net`).
|
|
107
|
+
- **Hardcoded Secrets & API Keys (SEC-006):** Detects hardcoded GitHub tokens, Anthropic API keys, Google Cloud keys, and AWS credentials.
|
|
108
|
+
- **Trigger Quality (QUAL-001):** Checks whether model-invoked descriptions contain explicit activation conditions (skipped when `disable-model-invocation: true`).
|
|
109
|
+
- **Directory Alignment (QUAL-002):** Verifies the package folder name matches the skill `name` in YAML frontmatter.
|
|
110
|
+
- **Progressive Disclosure Budget (QUAL-003):** Flags `SKILL.md` bodies exceeding 500 lines or ~5,000 tokens so heavy reference docs are moved into `references/`.
|
|
111
|
+
- **Broken Disclosure Pointers (QUAL-004):** Verifies every `references/...` or `scripts/...` file cited in `SKILL.md` actually exists in the package.
|
|
112
|
+
- **Applicability Hijacking (QUAL-006):** Flags overbroad trigger descriptions that claim all tasks (metadata poisoning).
|
|
101
113
|
|
|
102
114
|
For CI pipelines, pass `--strict` to fail on any warning, or `--json` for automation:
|
|
103
115
|
```bash
|
|
104
116
|
skillforge audit ./skills/my-new-skill --strict --json
|
|
105
117
|
```
|
|
106
118
|
|
|
107
|
-
### 3.
|
|
119
|
+
### 3. Run a full environment diagnostic (`doctor`)
|
|
120
|
+
|
|
121
|
+
Inspect all installed skills across your project or global workstation (Claude Code, Cursor, Antigravity, Windsurf) for security vulnerabilities, context window load, and broken pointers:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Diagnose active project
|
|
125
|
+
skillforge doctor
|
|
126
|
+
|
|
127
|
+
# Diagnose all global machine skills
|
|
128
|
+
skillforge doctor --global
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### 4. Compare changes before updating (`diff`)
|
|
132
|
+
|
|
133
|
+
Inspect diffs between local skills and upstream repositories, or compare two skill versions:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
skillforge diff ./skills/my-skill
|
|
137
|
+
skillforge diff my-skill gintingism/skillforge:my-skill
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### 5. Profile your project's context token budget (`budget`)
|
|
141
|
+
|
|
142
|
+
Every model-invoked skill keeps its `name` and `description` in the startup context window on every turn. Measure how much context your skills consume before they even trigger:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
skillforge budget
|
|
146
|
+
# Or inspect the built-in catalog:
|
|
147
|
+
skillforge budget --builtin
|
|
148
|
+
```
|
|
149
|
+
```text
|
|
150
|
+
Context Budget Profile (22 skills)
|
|
151
|
+
Always-Loaded Startup Pointer Cost: ~1280 tokens
|
|
152
|
+
On-Demand SKILL.md Body Cost: ~7450 tokens
|
|
153
|
+
Disclosed Resources Cost: ~349 tokens
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### 6. Check what's installed in your project (`list` & `remove`)
|
|
108
157
|
|
|
109
158
|
See which skills are active across your editor targets:
|
|
110
159
|
|
|
@@ -126,7 +175,7 @@ To remove a skill from all detected assistants and update your lockfile:
|
|
|
126
175
|
skillforge remove antislop-code
|
|
127
176
|
```
|
|
128
177
|
|
|
129
|
-
###
|
|
178
|
+
### 5. Create and package your own skills (`create` & `pack`)
|
|
130
179
|
|
|
131
180
|
Scaffold a single skill file or a full directory package with scripts and reference docs:
|
|
132
181
|
|
|
@@ -169,10 +218,15 @@ skillforge install systematic-debugging --global
|
|
|
169
218
|
|
|
170
219
|
## Shipped Built-in Skills
|
|
171
220
|
|
|
172
|
-
SkillForge ships with
|
|
221
|
+
SkillForge ships with 22 practical engineering skills designed to counteract common agent failure modes identified in benchmark research (SWE-bench, Snyk ToxicSkills, Skill-Inject):
|
|
173
222
|
|
|
174
|
-
### Code Quality &
|
|
223
|
+
### Code Quality, Security & Performance
|
|
224
|
+
- `supply-chain-sentinel`: Verify package existence, registry age, and run CVE audits (`pip-audit`, `npm audit`) before adding dependencies.
|
|
225
|
+
- `secret-sanitizer`: Pre-commit git diff auditor that prevents API keys, private tokens, and `.env` credentials from leaking.
|
|
226
|
+
- `contract-test-generator`: Property-based testing and contract boundary fuzz tests (Hypothesis, fast-check) to verify algebraic invariants.
|
|
175
227
|
- `blast-radius-containment`: Upstream reference tracing and a strict "file touch budget" before modifying shared code or public APIs.
|
|
228
|
+
- `security-threat-modeler`: Trust-boundary mapping, IDOR/BOLA object-level authorization checks, SSRF validation, and injection sink verification.
|
|
229
|
+
- `performance-profiler`: Baseline-first latency (`p50`/`p95`/`p99`), N+1 query detection, and algorithmic complexity verification before optimizing.
|
|
176
230
|
- `antislop-code`: Comment hygiene and anti-overengineering filters (removes trivial narrative comments, stops speculative generality).
|
|
177
231
|
- `spec-driven-development`: Schema-first API design and red-green verification loops before writing application logic.
|
|
178
232
|
- `zero-downtime-migration`: Four-phase Expand-Contract pattern for non-breaking database schema and API payload evolutions.
|
|
@@ -184,6 +238,7 @@ SkillForge ships with 16 practical engineering skills designed to counteract com
|
|
|
184
238
|
- `runtime-api-verification`: Interactive signature introspection (`inspect`, `dir()`, compiler definitions) to prevent hallucinated kwargs.
|
|
185
239
|
|
|
186
240
|
### Context Efficiency & Multi-Agent Operations
|
|
241
|
+
- `skill-architect`: Multi-file progressive disclosure guide (bundled with `references/mechanics.md`) for authoring low-token `SKILL.md`, `AGENTS.md`, and `CLAUDE.md` files.
|
|
187
242
|
- `caveman`: Terse, high-density technical communication mode that reduces token spend while preserving exact paths, commands, and errors.
|
|
188
243
|
- `context-compactor`: Structured state distillation and active hypothesis ledgers for long-running agent threads nearing context limits.
|
|
189
244
|
- `mcp-tool-designer`: Type-safe schema design, idempotent hints, token boundaries, and stderr error separation for MCP servers.
|
|
@@ -216,6 +271,7 @@ SkillForge can run as an MCP server so your agent can search, read, and audit sk
|
|
|
216
271
|
Exposed MCP tools:
|
|
217
272
|
- `search_skills(query, limit)`: Search local and built-in skill catalogs.
|
|
218
273
|
- `get_skill(name)`: Read the full `SKILL.md` instructions.
|
|
274
|
+
- `get_skill_resource(name, resource_path)`: Read disclosed `references/*` or `scripts/*` files from a skill package on demand.
|
|
219
275
|
- `validate_skill(content)`: Test frontmatter syntax.
|
|
220
276
|
- `audit_skill(content)`: Audit a raw skill document for prompt injections and malicious patterns.
|
|
221
277
|
- `skill://{name}`: Resource URI for direct document retrieval.
|
|
@@ -22,13 +22,20 @@ src/skillforge/builtin_skills/blast-radius-containment/SKILL.md
|
|
|
22
22
|
src/skillforge/builtin_skills/caveman/SKILL.md
|
|
23
23
|
src/skillforge/builtin_skills/cognitive-loop-breaker/SKILL.md
|
|
24
24
|
src/skillforge/builtin_skills/context-compactor/SKILL.md
|
|
25
|
+
src/skillforge/builtin_skills/contract-test-generator/SKILL.md
|
|
25
26
|
src/skillforge/builtin_skills/flaky-test-isolation/SKILL.md
|
|
26
27
|
src/skillforge/builtin_skills/human-in-the-loop/SKILL.md
|
|
27
28
|
src/skillforge/builtin_skills/mcp-tool-designer/SKILL.md
|
|
29
|
+
src/skillforge/builtin_skills/performance-profiler/SKILL.md
|
|
28
30
|
src/skillforge/builtin_skills/runtime-api-verification/SKILL.md
|
|
31
|
+
src/skillforge/builtin_skills/secret-sanitizer/SKILL.md
|
|
32
|
+
src/skillforge/builtin_skills/security-threat-modeler/SKILL.md
|
|
29
33
|
src/skillforge/builtin_skills/self-improving-agent/SKILL.md
|
|
34
|
+
src/skillforge/builtin_skills/skill-architect/SKILL.md
|
|
35
|
+
src/skillforge/builtin_skills/skill-architect/references/mechanics.md
|
|
30
36
|
src/skillforge/builtin_skills/spec-driven-development/SKILL.md
|
|
31
37
|
src/skillforge/builtin_skills/summarize/SKILL.md
|
|
38
|
+
src/skillforge/builtin_skills/supply-chain-sentinel/SKILL.md
|
|
32
39
|
src/skillforge/builtin_skills/systematic-debugging/SKILL.md
|
|
33
40
|
src/skillforge/builtin_skills/tavily-search/SKILL.md
|
|
34
41
|
src/skillforge/builtin_skills/zero-downtime-migration/SKILL.md
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: contract-test-generator
|
|
3
|
+
description: Author property-based fuzz tests and contract invariants to verify edge cases, serialization symmetry, and boundary conditions. Use when testing schemas, parser logic, or public library APIs.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Universal
|
|
6
|
+
metadata:
|
|
7
|
+
version: "1.0.0"
|
|
8
|
+
author: "SkillForge Team"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Contract Test Generator Protocol
|
|
12
|
+
|
|
13
|
+
Traditional example-based tests ($N = 2$ fixtures) miss edge cases, numeric boundary overflows, and Unicode malformations. Author property-based contract tests that assert mathematical invariants over generated random input spaces.
|
|
14
|
+
|
|
15
|
+
## 1. Property-Based Test Principles
|
|
16
|
+
|
|
17
|
+
Define invariants that must hold true for *all* valid inputs, not just cherry-picked samples:
|
|
18
|
+
|
|
19
|
+
1. **Roundtrip Symmetry (Serialization Invariant)**:
|
|
20
|
+
`deserialize(serialize(x)) == x`
|
|
21
|
+
Assert that parsing and rendering preserve identity across Unicode strings, nested mappings, and timestamps.
|
|
22
|
+
2. **Idempotence Invariant**:
|
|
23
|
+
`f(f(x)) == f(x)`
|
|
24
|
+
Assert that running a formatting, migration, or normalization pass a second time produces identical output.
|
|
25
|
+
3. **Monotonicity & Invariant Bounds**:
|
|
26
|
+
Output lengths, sorted orders, or checksums must satisfy predictable algebraic properties ($len(dedup(x)) \le len(x)$).
|
|
27
|
+
|
|
28
|
+
## 2. Test Harness Frameworks
|
|
29
|
+
|
|
30
|
+
- **Python**: Use `hypothesis`
|
|
31
|
+
```python
|
|
32
|
+
from hypothesis import given, strategies as st
|
|
33
|
+
|
|
34
|
+
@given(st.text(min_size=1, max_size=200))
|
|
35
|
+
def test_roundtrip_parsing(sample: str) -> None:
|
|
36
|
+
assert parse(render(sample)) == sample
|
|
37
|
+
```
|
|
38
|
+
- **TypeScript / Node.js**: Use `fast-check`
|
|
39
|
+
```typescript
|
|
40
|
+
import fc from "fast-check";
|
|
41
|
+
|
|
42
|
+
test("roundtrip JSON schema", () => {
|
|
43
|
+
fc.assert(fc.property(fc.record({ id: fc.uuid(), val: fc.string() }), data => {
|
|
44
|
+
expect(decode(encode(data))).toEqual(data);
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 3. Verification Gate
|
|
50
|
+
|
|
51
|
+
- Run the test suite with a randomized seed and at least 100 test iterations (`--hypothesis-seed` or default generator iterations).
|
|
52
|
+
- Ensure zero flakiness and deterministic error shrinking.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: performance-profiler
|
|
3
|
+
description: Isolate latency bottlenecks, N+1 query patterns, memory allocations, and algorithmic complexity regressions using baseline-first measurement. Use when optimizing slow endpoints, high CPU/memory usage, or database queries.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Universal
|
|
6
|
+
metadata:
|
|
7
|
+
version: "1.0.0"
|
|
8
|
+
author: "SkillForge Team"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Performance Profiler Protocol
|
|
12
|
+
|
|
13
|
+
Never optimize by intuition. Measure baseline latency, query count, or allocation volume before modifying code, and prove the delta with a repeatable benchmark.
|
|
14
|
+
|
|
15
|
+
## 1. Capture the Baseline
|
|
16
|
+
|
|
17
|
+
1. **Reproduce with Realistic Cardinality**:
|
|
18
|
+
- Run the target path against representative dataset sizes ($N \ge 10^3$ rows or items) rather than trivial unit-test fixtures ($N = 2$).
|
|
19
|
+
2. **Record Primary Metrics**:
|
|
20
|
+
- Capture wall-clock latency (`p50`, `p95`, `p99`), total SQL/RPC round-trips per request, or peak heap allocation before touching implementation code.
|
|
21
|
+
|
|
22
|
+
## 2. Isolate the Dominant Bottleneck
|
|
23
|
+
|
|
24
|
+
- **I/O & Query Amplification (N+1)**:
|
|
25
|
+
- Check whether loop bodies issue sequential queries, network calls, or filesystem reads. Batch into a single `WHERE id IN (...)` query, join, or bulk RPC.
|
|
26
|
+
- **Algorithmic Complexity ($O(N^2)$ Traps)**:
|
|
27
|
+
- Replace repeated linear scans (`item in list`, nested filter loops, repeated string/array concatenation) with hash sets, indexed maps, or single-pass accumulators.
|
|
28
|
+
- **Serialization & Payload Bloat**:
|
|
29
|
+
- Project only required columns (`SELECT id, status` instead of `SELECT *`), stream large responses, and avoid re-parsing static configurations inside hot loops.
|
|
30
|
+
- **Unbounded Concurrency or Lock Contention**:
|
|
31
|
+
- Bound parallel fan-out with semaphores and keep network/disk I/O outside database transactions or mutex locks.
|
|
32
|
+
|
|
33
|
+
## 3. Verification Gate
|
|
34
|
+
|
|
35
|
+
- Re-run the exact baseline harness after the change and report `before -> after` metrics (latency, query count, or memory) alongside passing functional tests.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: secret-sanitizer
|
|
3
|
+
description: Audit staged files, commit diffs, and terminal outputs for leaked API keys, tokens, and private credentials. Use when preparing git commits, staging code changes, or configuring environment variables.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Universal
|
|
6
|
+
metadata:
|
|
7
|
+
version: "1.0.0"
|
|
8
|
+
author: "SkillForge Team"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Secret Sanitizer Protocol
|
|
12
|
+
|
|
13
|
+
Block credentials, private keys, session tokens, and environment secrets from leaking into version control, commit logs, or terminal session histories.
|
|
14
|
+
|
|
15
|
+
## 1. High-Entropy Credential Patterns
|
|
16
|
+
|
|
17
|
+
Scan git diffs and staged changes for high-entropy tokens and signature prefixes before running `git commit`:
|
|
18
|
+
|
|
19
|
+
| Secret Type | Signature Pattern | Example Prefix |
|
|
20
|
+
| :--- | :--- | :--- |
|
|
21
|
+
| **GitHub Tokens** | `ghp_[A-Za-z0-9]{36}`, `github_pat_[A-Za-z0-9_]{82}` | `ghp_`, `github_pat_` |
|
|
22
|
+
| **Anthropic API Keys** | `sk-ant-[A-Za-z0-9_-]{32,}` | `sk-ant-` |
|
|
23
|
+
| **OpenAI API Keys** | `sk-[A-Za-z0-9]{48}` | `sk-` |
|
|
24
|
+
| **Google Cloud / Gemini** | `AIzaSy[A-Za-z0-9_-]{33}` | `AIzaSy` |
|
|
25
|
+
| **AWS Credentials** | `AKIA[0-9A-Z]{16}` | `AKIA` |
|
|
26
|
+
| **Private Keys** | `-----BEGIN (RSA|EC|OPENSSH|PRIVATE) KEY-----` | `-----BEGIN` |
|
|
27
|
+
|
|
28
|
+
## 2. Pre-Commit Staging Audit Procedure
|
|
29
|
+
|
|
30
|
+
1. **Review Diff of Staged Files**:
|
|
31
|
+
`git diff --cached --unified=0`
|
|
32
|
+
2. **Verify `.gitignore` Coverage**:
|
|
33
|
+
Ensure `.env`, `.env.local`, `.env.*.local`, `*.pem`, `*.key`, `*.pfx`, and credentials caches (`.aws/`, `.gcloud/`) are explicitly ignored.
|
|
34
|
+
3. **Check Staged File List**:
|
|
35
|
+
`git diff --cached --name-only`
|
|
36
|
+
Reject any file matching `.env*`, `credentials.json`, `id_rsa`, or service account keys.
|
|
37
|
+
|
|
38
|
+
## 3. Redaction & Remediation Rule
|
|
39
|
+
|
|
40
|
+
- If a secret was committed locally:
|
|
41
|
+
Do not push. Reset the commit (`git reset HEAD~1`), sanitize the code to read from `os.environ` or a secrets manager, and rotate the compromised credential immediately.
|
|
42
|
+
- Test suites must use dummy mock values (e.g., `"test-api-key"`, `"dummy-token-123"`) rather than live keys.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-threat-modeler
|
|
3
|
+
description: Map trust boundaries, attack surfaces, object-level authorization (IDOR/BOLA), SSRF vectors, and injection sinks before shipping backend or agent endpoints. Use when reviewing security, designing APIs, or auditing auth flows.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Universal
|
|
6
|
+
metadata:
|
|
7
|
+
version: "1.0.0"
|
|
8
|
+
author: "SkillForge Team"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Security Threat Modeler Protocol
|
|
12
|
+
|
|
13
|
+
Perform structured trust-boundary and attack-surface analysis before merging authentication, API, webhook, file-handling, or tool-execution changes.
|
|
14
|
+
|
|
15
|
+
## 1. Enumerate Trust Boundaries
|
|
16
|
+
|
|
17
|
+
1. **Identify Untrusted Inputs**:
|
|
18
|
+
- List every external entry point: HTTP params, headers, webhook bodies, uploaded archives, database records containing user text, and LLM/tool outputs.
|
|
19
|
+
2. **Trace Principal & Tenant Scope**:
|
|
20
|
+
- Verify how the caller's identity (`user_id`, `org_id`, `role`) is bound to the session token rather than read from request parameters.
|
|
21
|
+
|
|
22
|
+
## 2. High-Severity Vulnerability Checklist
|
|
23
|
+
|
|
24
|
+
- **Broken Object Level Authorization (IDOR / BOLA)**:
|
|
25
|
+
- Scope every read, update, and delete query by both resource ID and authenticated tenant/owner (`WHERE id = :id AND org_id = :auth_org_id`).
|
|
26
|
+
- **Server-Side Request Forgery (SSRF)**:
|
|
27
|
+
- Reject user-supplied URLs targeting loopback (`127.0.0.0/8`, `::1`), link-local metadata (`169.254.169.254`), and RFC1918 private ranges; validate resolved IP addresses immediately before connecting.
|
|
28
|
+
- **Path Traversal & Archive Extraction**:
|
|
29
|
+
- Resolve candidate paths with `Path.resolve()` and assert `target.is_relative_to(base_dir)` before reading, writing, or extracting zip/tar members.
|
|
30
|
+
- **Command & Query Injection**:
|
|
31
|
+
- Execute subprocesses as argument arrays with `shell=False` and bind all SQL parameters via parameterized queries.
|
|
32
|
+
- **Webhook & Callback Authenticity**:
|
|
33
|
+
- Verify HMAC signatures using constant-time comparison (`hmac.compare_digest`) over the raw request body and enforce timestamp replay windows.
|
|
34
|
+
|
|
35
|
+
## 3. Completion Gate
|
|
36
|
+
|
|
37
|
+
- Write at least one negative security test proving an unauthorized tenant, traversed path, or forged signature is rejected with an explicit error status.
|