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
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Binary (anchor to repo root so cmd/codecrucible/ is not ignored)
/codecrucible
/bin/

# Go
coverage.out
coverage.html

# Environment
.env
.env.bak
.env.*

# IDE / Editor
.vscode/
.idea/
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db

# Python (legacy)
.venv/
__pycache__/
*.pyc
.pytest_cache/

# Build artifacts
dist/

# GEPA / experiment artifacts
scripts/
output/
.desloppify/

# Misc
~/

# agent
.claude/
.amp/
.perles*
.beads*
40 changes: 40 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Agent Instructions

This project uses **bd** (beads) for issue tracking. Run `bd onboard` to get started.

## Quick Reference

```bash
bd ready # Find available work
bd show <id> # View issue details
bd update <id> --status in_progress # Claim work
bd close <id> # Complete work
bd sync # Sync with git
```

## Landing the Plane (Session Completion)

**When ending a work session**, you MUST complete ALL steps below. Work is NOT complete until `git push` succeeds.

**MANDATORY WORKFLOW:**

1. **File issues for remaining work** - Create issues for anything that needs follow-up
2. **Run quality gates** (if code changed) - Tests, linters, builds
3. **Update issue status** - Close finished work, update in-progress items
4. **PUSH TO REMOTE** - This is MANDATORY:
```bash
git pull --rebase
bd sync
git push
git status # MUST show "up to date with origin"
```
5. **Clean up** - Clear stashes, prune remote branches
6. **Verify** - All changes committed AND pushed
7. **Hand off** - Provide context for next session

**CRITICAL RULES:**
- Work is NOT complete until `git push` succeeds
- NEVER stop before pushing - that leaves work stranded locally
- NEVER say "ready to push when you are" - YOU must push
- If push fails, resolve and retry until it succeeds

32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Stage 1: Build
FROM golang:1.23-alpine AS builder

RUN apk add --no-cache git

WORKDIR /build

# Cache module downloads.
COPY go.mod go.sum ./
RUN go mod download

# Copy source and build.
COPY . .

ARG VERSION=dev
ARG COMMIT=none
ARG DATE=unknown

RUN CGO_ENABLED=0 GOOS=linux go build \
-ldflags "-X 'github.com/block/codecrucible/internal/cli.version=${VERSION}' \
-X 'github.com/block/codecrucible/internal/cli.commit=${COMMIT}' \
-X 'github.com/block/codecrucible/internal/cli.date=${DATE}'" \
-o codecrucible ./cmd/codecrucible

# Stage 2: Runtime
FROM gcr.io/distroless/static-debian12:nonroot

Check warning

Code scanning / Semgrep OSS

Use Artifactory Mirror for GCR Warning

Use Artifactory Mirror for GCR

COPY --from=builder /build/codecrucible /usr/local/bin/codecrucible
COPY --from=builder /build/prompts /prompts

ENTRYPOINT ["codecrucible"]
CMD ["scan", "--prompts-dir", "/prompts/default"]
53 changes: 53 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
BINARY := codecrucible
MODULE := github.com/block/codecrucible
CMD := ./cmd/codecrucible

VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "none")
DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")

LDFLAGS := -X '$(MODULE)/internal/cli.version=$(VERSION)' \
-X '$(MODULE)/internal/cli.commit=$(COMMIT)' \
-X '$(MODULE)/internal/cli.date=$(DATE)'

.PHONY: build test lint clean coverage docker-build docker-test fmt vet

build:
go build -ldflags "$(LDFLAGS)" -o $(BINARY) $(CMD)

test:
go test -race -count=1 ./...

lint:
@if command -v golangci-lint >/dev/null 2>&1; then \
golangci-lint run ./...; \
else \
echo "golangci-lint not installed, running go vet"; \
go vet ./...; \
fi

coverage:
go test -race -coverprofile=coverage.out -covermode=atomic ./...
go tool cover -func=coverage.out
@echo "---"
@echo "HTML report: go tool cover -html=coverage.out -o coverage.html"

fmt:
gofmt -w .

vet:
go vet ./...

docker-build:
docker build \
--build-arg VERSION=$(VERSION) \
--build-arg COMMIT=$(COMMIT) \
--build-arg DATE=$(DATE) \
-t $(BINARY):$(VERSION) \
-t $(BINARY):latest .

docker-test:
docker run --rm $(BINARY):latest --version

clean:
rm -f $(BINARY) coverage.out coverage.html
Loading