Skip to content

Commit 7a4ff38

Browse files
committed
feat: Initial open source release
0 parents  commit 7a4ff38

File tree

472 files changed

+35193
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

472 files changed

+35193
-0
lines changed

.cobra.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
author: Chainlink Labs
3+
useViper: true
4+
license: Apache-2.0

.codespellrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[codespell]
2+
skip = go.mod,go.sum,go.work,go.work.sum,**/go.mod,**/go.sum
3+
# Case sensitive
4+
ignore-words-list = afterall,decorder

.cursor/mcp.json

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
{
2+
"inputs": [
3+
{
4+
"type": "promptString",
5+
"id": "github_token",
6+
"description": "GitHub Personal Access Token",
7+
"password": true
8+
},
9+
{
10+
"type": "promptString",
11+
"id": "jira_username",
12+
"description": "Jira Email Address",
13+
"password": false
14+
},
15+
{
16+
"type": "promptString",
17+
"id": "jira_token",
18+
"description": "Jira API Token",
19+
"password": true
20+
}
21+
],
22+
"mcpServers": {
23+
"fetch": {
24+
"command": "uvx",
25+
"args": [
26+
"mcp-server-fetch"
27+
]
28+
},
29+
"filesystem": {
30+
"command": "docker",
31+
"args": [
32+
"run",
33+
"-i",
34+
"--rm",
35+
"--mount",
36+
"type=bind,src=${workspaceFolder},dst=/projects/github.com/smartcontractkit/crib-sdk",
37+
"mcp/filesystem",
38+
"/projects"
39+
]
40+
},
41+
"mcp-atlassian": {
42+
"command": "docker",
43+
"args": [
44+
"run",
45+
"-i",
46+
"--rm",
47+
"-e",
48+
"CONFLUENCE_URL",
49+
"-e",
50+
"CONFLUENCE_USERNAME",
51+
"-e",
52+
"CONFLUENCE_API_TOKEN",
53+
"-e",
54+
"JIRA_URL",
55+
"-e",
56+
"JIRA_USERNAME",
57+
"-e",
58+
"JIRA_API_TOKEN",
59+
"ghcr.io/sooperset/mcp-atlassian:latest"
60+
],
61+
"env": {
62+
"CONFLUENCE_URL": "https://smartcontract-it.atlassian.net/wiki",
63+
"CONFLUENCE_USERNAME": "${input:jira_username}",
64+
"CONFLUENCE_API_TOKEN": "${input:jira_token}",
65+
"JIRA_URL": "https://smartcontract-it.atlassian.net",
66+
"JIRA_USERNAME": "${input:jira_username}",
67+
"JIRA_API_TOKEN": "${input:jira_token}"
68+
}
69+
},
70+
"git": {
71+
"command": "uvx",
72+
"args": [
73+
"mcp-server-git",
74+
"--repository",
75+
"${workspaceFolder}"
76+
]
77+
},
78+
"github": {
79+
"command": "docker",
80+
"args": [
81+
"run",
82+
"-i",
83+
"--rm",
84+
"-e",
85+
"GITHUB_PERSONAL_ACCESS_TOKEN",
86+
"ghcr.io/github/github-mcp-server"
87+
],
88+
"env": {
89+
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}"
90+
}
91+
},
92+
"memory": {
93+
"type": "stdio",
94+
"command": "docker",
95+
"args": [
96+
"run",
97+
"-i",
98+
"-v",
99+
"claude-memory:/app/dist",
100+
"--rm",
101+
"mcp/memory"
102+
]
103+
},
104+
"sequentialthinking": {
105+
"command": "docker",
106+
"args": [
107+
"run",
108+
"--rm",
109+
"-i",
110+
"mcp/sequentialthinking"
111+
]
112+
},
113+
"time": {
114+
"command": "uvx",
115+
"args": [
116+
"mcp-server-time"
117+
]
118+
}
119+
}
120+
}

.cursor/rules/go-test.mdc

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
description: Best practices for writing Go tests
3+
globs: *_test.go
4+
alwaysApply: false
5+
---
6+
7+
# Go Testing Best Practices
8+
9+
1. Follow Go best practices and standard formatting:
10+
- Use `gofmt` for basic code formatting
11+
- Use `goimports` for import organization
12+
- Use `golangci-lint` for comprehensive linting
13+
- Follow Go naming conventions
14+
- Keep functions focused and small
15+
- Use meaningful variable and function names
16+
- Prefer using Google's and Uber's style guide when authoring Go code
17+
- Prefer using internally available packages over external packages or standard library packages
18+
- Most "helper" libraries are found under `internal/core/common` or `internal/adapter`
19+
20+
2. Testing Requirements:
21+
- Write unit tests for all new components using `testify`
22+
- Use `testify/assert` for assertions and `testify/require` for critical checks
23+
- Use `testify/suite` for test suites where appropriate
24+
- Include integration tests for composite components
25+
- Maintain test coverage above 80%
26+
- Use table-driven tests where appropriate
27+
- Use the variable `tc` when iterating over test cases
28+
- Mock external dependencies using `testify/mock`
29+
- Use `testify/assert.Equal` for value comparisons
30+
- Use `testify/assert.NoError` for error checking
31+
- Use `testify/assert.NotNil` for pointer validation
32+
33+
3. High-level Directory Structure:
34+
- GitHub Actions workflows in `.github/workflows`
35+
- API schemas like OpenAPI in `api`
36+
- Build files like Dockerfile in `build`
37+
- CLI-related files in `cmd`
38+
- SDK "Plans" in `contrib`
39+
- Components in `crib/scalar` and `crib/composite`
40+
- Core SDK exported methods in `crib`
41+
- Deployment automation like Docker Compose in `deployments`
42+
- Examples in `examples`
43+
- Hack scripts in `hack`
44+
- Adapters (Hexagonal Architecture) in `internal/adapter`
45+
- Common utilities in `internal/core/common`
46+
- Domain objects in `internal/core/domain`
47+
- Interfaces in `internal/core/interfaces`
48+
- Services in `internal/core/services`
49+
- Taskfiles in `taskfiles`
50+
- E2E tests in `tests`

.cursor/rules/go.mdc

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
description: Best practices for writing Go code
3+
globs: *.go
4+
alwaysApply: false
5+
---
6+
7+
# Go Best Practices
8+
9+
## Code Style and Structure
10+
11+
1. Follow Go best practices and standard formatting:
12+
- Use `gofmt` for basic code formatting
13+
- Use `goimports` for import organization
14+
- Use `golangci-lint` for comprehensive linting
15+
- Follow Go naming conventions
16+
- Keep functions focused and small
17+
- Use meaningful variable and function names
18+
- Prefer using Google's and Uber's style guide when authoring Go code
19+
- Prefer using internally available packages over external packages or standard library packages
20+
- Most "helper" libraries are found under `internal/core/common` or `internal/adapter`
21+
22+
2. Component Development:
23+
- Place scalar components in `crib/scalar/[component]/v1/`
24+
- Place composite components in `crib/composite/`
25+
- Each component should have clear props and validation
26+
- Include proper documentation and examples
27+
28+
3. High-level Directory Structure:
29+
- GitHub Actions workflows in `.github/workflows`
30+
- API schemas like OpenAPI in `api`
31+
- Build files like Dockerfile in `build`
32+
- CLI-related files in `cmd`
33+
- SDK "Plans" in `contrib`
34+
- Components in `crib/scalar` and `crib/composite`
35+
- Core SDK exported methods in `crib`
36+
- Deployment automation like Docker Compose in `deployments`
37+
- Examples in `examples`
38+
- Hack scripts in `hack`
39+
- Adapters (Hexagonal Architecture) in `internal/adapter`
40+
- Common utilities in `internal/core/common`
41+
- Domain objects in `internal/core/domain`
42+
- Interfaces in `internal/core/interfaces`
43+
- Services in `internal/core/services`
44+
- Taskfiles in `taskfiles`
45+
- E2E tests in `tests`
46+
47+
## Documentation
48+
49+
1. Code Documentation:
50+
- Document all exported functions and types
51+
- Include usage examples in comments
52+
- Keep README.md up to date
53+
- Document any breaking changes
54+
55+
2. API Documentation:
56+
- Document all public APIs
57+
- Include parameter descriptions
58+
- Provide usage examples
59+
- Document error cases
60+
61+
## Development Workflow
62+
63+
1. Pre-commit Checks:
64+
- Run `task go:lint` before committing
65+
- Run `task go:test` to ensure tests pass
66+
- Run `task go:fmt` to format code
67+
- Check for any security vulnerabilities
68+
69+
2. Pull Request Process:
70+
- Update documentation if needed
71+
- Add tests for new features
72+
- Ensure CI passes
73+
- Get at least one review
74+
75+
## Component Guidelines
76+
77+
1. Scalar Components:
78+
- Keep components simple and focused
79+
- Implement proper validation
80+
- Handle errors gracefully
81+
- Include proper logging
82+
83+
2. Composite Components:
84+
- Document dependencies clearly
85+
- Handle component ordering
86+
- Include proper error handling
87+
- Provide clear configuration options
88+
89+
## Security Guidelines
90+
91+
1. General Security:
92+
- Never hardcode sensitive information
93+
- Use secure defaults
94+
- Validate all inputs
95+
- Follow principle of least privilege
96+
97+
## Performance Guidelines
98+
99+
1. Resource Usage:
100+
- Optimize memory usage
101+
- Minimize API calls
102+
- Use appropriate caching
103+
- Monitor resource consumption
104+
105+
2. Scalability:
106+
- Design for horizontal scaling
107+
- Use efficient data structures
108+
- Implement proper error handling
109+
- Consider edge cases
110+
111+
## Error Handling
112+
113+
1. Error Management:
114+
- Use proper error wrapping
115+
- Include context in errors
116+
- Handle all error cases
117+
- Provide clear error messages
118+
119+
2. Logging:
120+
- Use appropriate log levels
121+
- Include relevant context
122+
- Follow logging best practices
123+
- Consider log rotation

.cursor/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"promptFile": ".github/copilot-instructions.md"
3+
}

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.build
2+
*.md
3+
main
4+
deployments/*
5+
taskfiles/*
6+
api/*
7+
.github
8+
.idea
9+
.git
10+
examples

.github/actionlint.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
self-hosted-runner:
3+
labels:
4+
- ubuntu24.04-4cores-16GB
5+
- ubuntu24.04-8cores-32GB
6+
- ubuntu24.04-16cores-64GB

0 commit comments

Comments
 (0)