Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions .agents/skills/sqlmap/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
```markdown
# sqlmap Development Patterns

> Auto-generated skill from repository analysis

## Overview

This skill teaches you how to contribute effectively to the sqlmap codebase, a Python-based SQL injection tool. You'll learn the project's coding conventions, how to implement new features, update settings, add payloads, and maintain documentation. The guide covers typical workflows, commit practices, and provides command suggestions for common tasks.

## Coding Conventions

- **File Naming:**
Use camelCase for file names.
_Example:_
```
connectHandler.py
optionDict.py
```

- **Import Style:**
Use relative imports within the package.
_Example:_
```python
from .common import getUnicode
from ..request import connect
```

- **Export Style:**
Use named exports; avoid wildcard imports.
_Example:_
```python
def getUnicode(value):
...
```

- **Commit Messages:**
- Freeform style, no strict prefixes.
- Average length: ~23 characters.
- Reference issues or features when possible.

## Workflows

### Core Settings Paired Update
**Trigger:** When you need to add, update, or fix a feature or bug that requires changing global settings and related logic.
**Command:** `/update-setting`

1. Edit `lib/core/settings.py` to update, add, or remove a setting or constant.
2. Edit one or more related files to implement or support the change.
_Examples:_
- `lib/core/common.py`
- `lib/request/connect.py`
- `plugins/dbms/mysql/fingerprint.py`
- `lib/core/agent.py`
3. Commit both changes together, referencing the relevant issue or feature.

_Example:_
```python
# lib/core/settings.py
NEW_FEATURE_ENABLED = True

# lib/core/common.py
from .settings import NEW_FEATURE_ENABLED

if NEW_FEATURE_ENABLED:
# new logic here
```

---

### Add or Update Payload or Query
**Trigger:** When you want to support new database payloads, queries, or exfiltration techniques.
**Command:** `/add-payload`

1. Edit or add a file in:
- `data/xml/payloads/*.xml`
- `data/xml/queries.xml`
- `data/procs/oracle/*.sql`
2. Optionally, update `lib/core/settings.py` to register or reference the new payload/query.
3. Commit both changes together.

_Example:_
```xml
<!-- data/xml/payloads/boolean_blind.xml -->
<payload>
<type>boolean_blind</type>
<sql>SELECT ...</sql>
</payload>
```

---

### Implement New Option or Feature
**Trigger:** When introducing a new CLI option or a major feature.
**Command:** `/add-option`

1. Edit `lib/core/settings.py` to add new option constants or defaults.
2. Edit `lib/parse/cmdline.py` to parse the new option.
3. Edit `lib/core/option.py` and/or `lib/core/optiondict.py` to handle the new option.
4. Edit `sqlmap.conf` to document the new option.
5. Edit or add implementation files as needed (e.g., `lib/core/agent.py`, `lib/techniques/union/test.py`).
6. Commit all related changes together.

_Example:_
```python
# lib/core/settings.py
NEW_OPTION = False

# lib/parse/cmdline.py
parser.add_option("--new-option", action="store_true", dest="new_option", help="Enable new option")

# lib/core/option.py
if conf.new_option:
# handle new option
```

---

### Documentation or README Update
**Trigger:** When updating documentation or adding a new translation.
**Command:** `/update-docs`

1. Edit or add files in `doc/translations/` or the main `README.md`.
2. Optionally, update `lib/core/settings.py` if documentation reflects a new/changed feature.
3. Commit documentation changes.

_Example:_
```
# doc/translations/README-de-DE.md
# sqlmap Dokumentation (Deutsch)
...
```

## Testing Patterns

- **Framework:** Unknown (not explicitly detected).
- **Test File Pattern:** Files matching `*.test.*`
- **Typical Test Location:** Scattered; look for files with `.test.` in their names.
- **Style:** No standard framework detected; tests may be run manually or with custom scripts.

_Example:_
```
lib/core/testing.py
lib/techniques/union/test.py
```

## Commands

| Command | Purpose |
|-----------------|-------------------------------------------------------|
| /update-setting | Update or fix a feature by changing settings and logic|
| /add-payload | Add or update a SQL payload or query |
| /add-option | Add a new command-line option or major feature |
| /update-docs | Update documentation or add a translation |
```
6 changes: 6 additions & 0 deletions .agents/skills/sqlmap/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
interface:
display_name: "Sqlmap"
short_description: "Repo-specific patterns and workflows for sqlmap"
default_prompt: "Use the sqlmap repo skill to follow existing architecture, testing, and workflow conventions."
policy:
allow_implicit_invocation: true
38 changes: 38 additions & 0 deletions .claude/commands/add-or-update-payload-or-query.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: add-or-update-payload-or-query
description: Workflow command scaffold for add-or-update-payload-or-query in sqlmap.
allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"]
---

# /add-or-update-payload-or-query

Use this workflow when working on **add-or-update-payload-or-query** in `sqlmap`.

## Goal

Add or update a SQL payload or query file, sometimes pairing with core settings changes.

## Common Files

- `data/xml/payloads/boolean_blind.xml`
- `data/xml/queries.xml`
- `data/procs/oracle/dns_request.sql`
- `lib/core/settings.py`

## Suggested Sequence

1. Understand the current state and failure mode before editing.
2. Make the smallest coherent change that satisfies the workflow goal.
3. Run the most relevant verification for touched files.
4. Summarize what changed and what still needs review.

## Typical Commit Signals

- Edit or add a file in data/xml/payloads/*.xml or data/xml/queries.xml or data/procs/oracle/*.sql.
- Optionally, update lib/core/settings.py to register or reference the new payload/query.
- Commit both changes together.

## Notes

- Treat this as a scaffold, not a hard-coded script.
- Update the command if the workflow evolves materially.
40 changes: 40 additions & 0 deletions .claude/commands/core-settings-paired-update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: core-settings-paired-update
description: Workflow command scaffold for core-settings-paired-update in sqlmap.
allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"]
---

# /core-settings-paired-update

Use this workflow when working on **core-settings-paired-update** in `sqlmap`.

## Goal

Update or fix a feature by modifying lib/core/settings.py together with one or more related core or plugin files.

## Common Files

- `lib/core/settings.py`
- `lib/core/common.py`
- `lib/request/connect.py`
- `plugins/dbms/mysql/fingerprint.py`
- `plugins/dbms/h2/fingerprint.py`
- `plugins/dbms/oracle/fingerprint.py`

## Suggested Sequence

1. Understand the current state and failure mode before editing.
2. Make the smallest coherent change that satisfies the workflow goal.
3. Run the most relevant verification for touched files.
4. Summarize what changed and what still needs review.

## Typical Commit Signals

- Edit lib/core/settings.py to update/add/remove a setting or constant.
- Edit one or more related files (e.g., lib/core/common.py, lib/request/connect.py, plugins/dbms/*/fingerprint.py, lib/core/agent.py, etc.) to implement or support the change.
- Commit both changes together with a reference to the issue or feature.

## Notes

- Treat this as a scaffold, not a hard-coded script.
- Update the command if the workflow evolves materially.
42 changes: 42 additions & 0 deletions .claude/commands/implement-new-option-or-feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: implement-new-option-or-feature
description: Workflow command scaffold for implement-new-option-or-feature in sqlmap.
allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"]
---

# /implement-new-option-or-feature

Use this workflow when working on **implement-new-option-or-feature** in `sqlmap`.

## Goal

Add a new command-line option or feature, updating settings, option parsing, and configuration.

## Common Files

- `lib/core/settings.py`
- `lib/parse/cmdline.py`
- `lib/core/option.py`
- `lib/core/optiondict.py`
- `sqlmap.conf`
- `lib/core/agent.py`

## Suggested Sequence

1. Understand the current state and failure mode before editing.
2. Make the smallest coherent change that satisfies the workflow goal.
3. Run the most relevant verification for touched files.
4. Summarize what changed and what still needs review.

## Typical Commit Signals

- Edit lib/core/settings.py to add new option constants or defaults.
- Edit lib/parse/cmdline.py to parse the new option.
- Edit lib/core/option.py and/or lib/core/optiondict.py to handle the new option.
- Edit sqlmap.conf to document the new option.
- Edit or add implementation files as needed (e.g., lib/core/agent.py, lib/techniques/union/test.py).

## Notes

- Treat this as a scaffold, not a hard-coded script.
- Update the command if the workflow evolves materially.
Loading
Loading