Skip to content
Merged
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
1 change: 1 addition & 0 deletions .agents
Submodule .agents added at cfd86b
14 changes: 14 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"hooks" : {
"SessionStart" : [
{
"hooks" : [
{
"command" : "[ -e .agents/.git ] || { git submodule update --init .agents >&2 && cat .agents/instructions/AGENTS.md; }",
"type" : "command"
}
]
}
]
}
}
1 change: 1 addition & 0 deletions .claude/skills
74 changes: 74 additions & 0 deletions .github/workflows/agents.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Written by .agents/setup.sh, which rewrites it on every skills pull.
# Change the shared workflows in cinchapi/cinchapi-agent-skills instead. Keep
# the name, because the CodeBuild runners start only for a workflow whose name
# begins with "Agent ".
name: Agent skills

on:
pull_request:
types: [opened, reopened, ready_for_review, labeled, synchronize]
pull_request_review:
types: [submitted]
issues:
types: [labeled]
issue_comment:
types: [created]
workflow_dispatch:
inputs:
skill:
description: Skill to run
type: choice
options:
- review-pipeline
- code-review
- code-comment-cleanup
- test-cleanup
- fix
- fix-conflicts
- work-on
- implement
number:
description: Pull request or issue number
type: number
required: true
args:
description: Extra instructions for the skill
type: string
required: false

permissions: {}

jobs:
agents:
# New commits on a pull request marked pipeline:done reach the router whoever
# pushed them, so it takes the label off. Dependabot's do not, because GitHub
# gives Dependabot's runs no Actions secrets, so the router could not act.
if: >-
(github.event_name == 'pull_request' && github.event.action == 'synchronize' &&
github.actor != 'dependabot[bot]' &&
github.event.pull_request.head.repo.full_name == github.repository &&
contains(github.event.pull_request.labels.*.name, 'pipeline:done')) ||
(github.event.sender.type != 'Bot' &&
(github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository &&
((github.event.action == 'labeled' &&
startsWith(github.event.label.name, 'agent:')) ||
(github.event.action != 'labeled' && !github.event.pull_request.draft))) ||
(github.event_name == 'pull_request_review' &&
github.event.pull_request.head.repo.full_name == github.repository &&
(github.event.review.state == 'changes_requested' ||
github.event.review.user.login == github.event.pull_request.user.login)) ||
(github.event_name == 'issues' &&
startsWith(github.event.label.name, 'agent:')) ||
(github.event_name == 'issue_comment' &&
(startsWith(github.event.comment.body, '/agent') ||
startsWith(github.event.comment.body, '/approve')))))
concurrency:
group: agents-${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.number }}
queue: max
uses: cinchapi/cinchapi-agent-skills/.github/workflows/router.yml@cfd86bdd6113b67c3cd4b281142b29b896a07a0c
permissions:
contents: read
id-token: write
secrets: inherit
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule ".agents"]
path = .agents
url = git@github.com:cinchapi/cinchapi-agent-skills.git
1 change: 1 addition & 0 deletions AGENTS.md
34 changes: 34 additions & 0 deletions AGENTS.project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Project instructions

Instructions specific to this repo. The shared instructions in `AGENTS.md` apply
first. Rules here add to them and win on conflict.

Keep this file to what an agent cannot learn from the shared guides or from the
code: how to build and test here, facts that differ by repo, where the project's
own docs live, and any shared rule this repo overrides.

## Build and quality gates

The commands to build, compile, format, lint, and type check, how to run one
test class or file, and which of them must pass before delivery. The full test
suite runs in CI, not on a developer's machine; name a fast test tier here only
when it is a delivery gate.

## Repo layout

The modules or packages and what each one holds.

## Facts that differ by repo

The language and runtime version, the package manager, the framework and the
test runner, the formatter's width, the integration branch, the test base class,
the label set, and anything else the shared guides say to resolve per repo.

## Where to look

The project docs to read before working in a subsystem, and when to read each
one.

## Overrides

Shared rules this repo relaxes or tightens, and why.
1 change: 1 addition & 0 deletions CLAUDE.md
22 changes: 15 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ publishing {
name = 'cloudsmith'
def releasesRepoUrl = "https://api-g.cloudsmith.io/maven/cinchapi/platform/"
def snapshotsRepoUrl = "https://api-g.cloudsmith.io/maven/cinchapi/platform-snapshots/"
url = mavenVersion.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
// Only a master build publishes a plain X.Y.Z, so every other version,
// such as a release candidate or a feature build, is a snapshot.
url = (mavenVersion ==~ /\d+\.\d+\.\d+/) ? releasesRepoUrl : snapshotsRepoUrl
credentials {
username = System.getenv('CLOUDSMITH_API_USER')
password = System.getenv('CLOUDSMITH_API_KEY')
Expand Down Expand Up @@ -49,14 +51,20 @@ def getVersion = { ->
return stdout.toString().trim()
}

// The version that a build version publishes as, also from the "version.sh"
// script, which drops only the build number and keeps the branch's name whole.
def getPublishedVersion = { buildVersion ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'bash', 'version.sh', '--published', buildVersion
standardOutput = stdout
}
return stdout.toString().trim()
}

group = 'com.cinchapi'
version = getVersion()
// Drop the build component from version number and use that for
// publishing
ext.mavenVersion = version.split('\\.')
ext.mavenVersion[3] = ext.mavenVersion[3].replaceAll("[0-9]+-", "-")
ext.mavenVersion[3] = ext.mavenVersion[3].replaceAll("[0-9]+", "").trim()
ext.mavenVersion = ext.mavenVersion.join(".").replace(".-", "-").replaceAll('\\.$', "")
ext.mavenVersion = getPublishedVersion(version)

repositories {
mavenCentral()
Expand Down
Loading