Initial commit
This commit is contained in:
6
skills/skill-adapter/assets/README.md
Normal file
6
skills/skill-adapter/assets/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Assets
|
||||
|
||||
Bundled resources for api-contract-generator skill
|
||||
|
||||
- [ ] contract_template.json: A JSON template for the Pact contract, allowing customization of the contract structure.
|
||||
- [ ] example_contract.json: An example of a generated Pact contract.
|
||||
32
skills/skill-adapter/assets/config-template.json
Normal file
32
skills/skill-adapter/assets/config-template.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"skill": {
|
||||
"name": "skill-name",
|
||||
"version": "1.0.0",
|
||||
"enabled": true,
|
||||
"settings": {
|
||||
"verbose": false,
|
||||
"autoActivate": true,
|
||||
"toolRestrictions": true
|
||||
}
|
||||
},
|
||||
"triggers": {
|
||||
"keywords": [
|
||||
"example-trigger-1",
|
||||
"example-trigger-2"
|
||||
],
|
||||
"patterns": []
|
||||
},
|
||||
"tools": {
|
||||
"allowed": [
|
||||
"Read",
|
||||
"Grep",
|
||||
"Bash"
|
||||
],
|
||||
"restricted": []
|
||||
},
|
||||
"metadata": {
|
||||
"author": "Plugin Author",
|
||||
"category": "general",
|
||||
"tags": []
|
||||
}
|
||||
}
|
||||
85
skills/skill-adapter/assets/contract_template.json
Normal file
85
skills/skill-adapter/assets/contract_template.json
Normal file
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"_comment": "Pact contract template. Customize this to match your API's structure.",
|
||||
"provider": {
|
||||
"name": "YourProviderAPI"
|
||||
},
|
||||
"consumer": {
|
||||
"name": "YourConsumer"
|
||||
},
|
||||
"interactions": [
|
||||
{
|
||||
"_comment": "Example interaction. Modify as needed.",
|
||||
"description": "A request for a user",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"path": "/users/123",
|
||||
"headers": {
|
||||
"Accept": "application/json"
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json; charset=utf-8"
|
||||
},
|
||||
"body": {
|
||||
"id": 123,
|
||||
"name": "John Doe",
|
||||
"email": "john.doe@example.com",
|
||||
"address": {
|
||||
"street": "123 Main St",
|
||||
"city": "Anytown",
|
||||
"zip": "12345"
|
||||
},
|
||||
"_comment": "You can use Pact matchers here, e.g., using a regex to validate email format.",
|
||||
"email_verification_status": "verified"
|
||||
}
|
||||
},
|
||||
"providerStates": [
|
||||
{
|
||||
"name": "User 123 exists",
|
||||
"params": {
|
||||
"user_id": 123
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"_comment": "Another example interaction - creating a new user.",
|
||||
"description": "Creating a new user",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"path": "/users",
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"body": {
|
||||
"name": "Jane Smith",
|
||||
"email": "jane.smith@example.com"
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": 201,
|
||||
"headers": {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Location": "/users/456"
|
||||
},
|
||||
"body": {
|
||||
"id": 456,
|
||||
"name": "Jane Smith",
|
||||
"email": "jane.smith@example.com"
|
||||
}
|
||||
},
|
||||
"providerStates": [
|
||||
{
|
||||
"name": "The user service is available"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"pactSpecification": {
|
||||
"version": "3.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
129
skills/skill-adapter/assets/example_contract.json
Normal file
129
skills/skill-adapter/assets/example_contract.json
Normal file
@@ -0,0 +1,129 @@
|
||||
{
|
||||
"_comment": "Pact contract example generated by the api-contract-generator plugin.",
|
||||
"provider": {
|
||||
"name": "Article Service"
|
||||
},
|
||||
"consumer": {
|
||||
"name": "Article Reader"
|
||||
},
|
||||
"interactions": [
|
||||
{
|
||||
"_comment": "An interaction represents a single request-response pair.",
|
||||
"description": "a request for an article with ID 123",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"path": "/articles/123",
|
||||
"headers": {
|
||||
"Accept": "application/json"
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json; charset=utf-8"
|
||||
},
|
||||
"body": {
|
||||
"_comment": "Example article data.",
|
||||
"id": 123,
|
||||
"title": "My First Article",
|
||||
"content": "This is the content of my first article.",
|
||||
"author": "John Doe",
|
||||
"publicationDate": "2024-01-01T00:00:00Z",
|
||||
"tags": ["news", "technology"]
|
||||
},
|
||||
"matchingRules": {
|
||||
"_comment": "Define rules for matching request and response elements.",
|
||||
"$.body.id": {
|
||||
"match": "type"
|
||||
},
|
||||
"$.body.title": {
|
||||
"match": "type"
|
||||
},
|
||||
"$.body.content": {
|
||||
"match": "type"
|
||||
},
|
||||
"$.body.author": {
|
||||
"match": "type"
|
||||
},
|
||||
"$.body.publicationDate": {
|
||||
"match": "regex",
|
||||
"regex": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
|
||||
},
|
||||
"$.body.tags": {
|
||||
"match": "type"
|
||||
}
|
||||
}
|
||||
},
|
||||
"providerStates": [
|
||||
{
|
||||
"name": "an article with ID 123 exists",
|
||||
"params": {
|
||||
"articleId": 123
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"_comment": "Another interaction representing a request for all articles.",
|
||||
"description": "a request for all articles",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"path": "/articles",
|
||||
"headers": {
|
||||
"Accept": "application/json"
|
||||
},
|
||||
"query": "page=1&limit=10"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json; charset=utf-8"
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"id": 123,
|
||||
"title": "My First Article",
|
||||
"content": "This is the content of my first article.",
|
||||
"author": "John Doe",
|
||||
"publicationDate": "2024-01-01T00:00:00Z",
|
||||
"tags": ["news", "technology"]
|
||||
},
|
||||
{
|
||||
"id": 456,
|
||||
"title": "Another Article",
|
||||
"content": "This is another article.",
|
||||
"author": "Jane Smith",
|
||||
"publicationDate": "2024-01-05T10:00:00Z",
|
||||
"tags": ["sports", "local"]
|
||||
}
|
||||
],
|
||||
"matchingRules": {
|
||||
"$.body[*].id": {
|
||||
"match": "type"
|
||||
},
|
||||
"$.body[*].title": {
|
||||
"match": "type"
|
||||
},
|
||||
"$.body[*].content": {
|
||||
"match": "type"
|
||||
},
|
||||
"$.body[*].author": {
|
||||
"match": "type"
|
||||
},
|
||||
"$.body[*].publicationDate": {
|
||||
"match": "regex",
|
||||
"regex": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
|
||||
},
|
||||
"$.body[*].tags": {
|
||||
"match": "type"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"pactSpecification": {
|
||||
"version": "3.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
28
skills/skill-adapter/assets/skill-schema.json
Normal file
28
skills/skill-adapter/assets/skill-schema.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Claude Skill Configuration",
|
||||
"type": "object",
|
||||
"required": ["name", "description"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-z0-9-]+$",
|
||||
"maxLength": 64,
|
||||
"description": "Skill identifier (lowercase, hyphens only)"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"maxLength": 1024,
|
||||
"description": "What the skill does and when to use it"
|
||||
},
|
||||
"allowed-tools": {
|
||||
"type": "string",
|
||||
"description": "Comma-separated list of allowed tools"
|
||||
},
|
||||
"version": {
|
||||
"type": "string",
|
||||
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
||||
"description": "Semantic version (x.y.z)"
|
||||
}
|
||||
}
|
||||
}
|
||||
27
skills/skill-adapter/assets/test-data.json
Normal file
27
skills/skill-adapter/assets/test-data.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"testCases": [
|
||||
{
|
||||
"name": "Basic activation test",
|
||||
"input": "trigger phrase example",
|
||||
"expected": {
|
||||
"activated": true,
|
||||
"toolsUsed": ["Read", "Grep"],
|
||||
"success": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Complex workflow test",
|
||||
"input": "multi-step trigger example",
|
||||
"expected": {
|
||||
"activated": true,
|
||||
"steps": 3,
|
||||
"toolsUsed": ["Read", "Write", "Bash"],
|
||||
"success": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"fixtures": {
|
||||
"sampleInput": "example data",
|
||||
"expectedOutput": "processed result"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user