{"id":50988147,"url":"https://github.com/darknessnerd/claude-scafold-go","last_synced_at":"2026-06-19T22:30:37.623Z","repository":{"id":365877336,"uuid":"1273151182","full_name":"darknessnerd/claude-scafold-go","owner":"darknessnerd","description":"Team-shared Claude AI configuration for consistent, safe, context-aware behavior across the codebase.","archived":false,"fork":false,"pushed_at":"2026-06-19T09:05:58.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-19T10:25:25.099Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darknessnerd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-18T08:55:17.000Z","updated_at":"2026-06-19T09:06:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/darknessnerd/claude-scafold-go","commit_stats":null,"previous_names":["darknessnerd/claude-scafold-go"],"tags_count":null,"template":true,"template_full_name":null,"purl":"pkg:github/darknessnerd/claude-scafold-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darknessnerd%2Fclaude-scafold-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darknessnerd%2Fclaude-scafold-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darknessnerd%2Fclaude-scafold-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darknessnerd%2Fclaude-scafold-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darknessnerd","download_url":"https://codeload.github.com/darknessnerd/claude-scafold-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darknessnerd%2Fclaude-scafold-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34550858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-19T22:30:36.850Z","updated_at":"2026-06-19T22:30:37.615Z","avatar_url":"https://github.com/darknessnerd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# claude-baseline-go\n\n![Claude Code](https://img.shields.io/badge/Claude_Code-compatible-6B48FF?logo=anthropic\u0026logoColor=white)\n![MCP](https://img.shields.io/badge/MCP-GitHub%20%7C%20Postgres%20%7C%20Datadog-0078D4?logo=amazonwebservices\u0026logoColor=white)\n![Go](https://img.shields.io/badge/Go-1.26-00ADD8?logo=go\u0026logoColor=white)\n![Hooks](https://img.shields.io/badge/hooks-bash-4EAA25?logo=gnubash\u0026logoColor=white)\n![Maintained](https://img.shields.io/badge/maintained-yes-brightgreen)\n\nTeam-shared Claude AI configuration for consistent, safe, context-aware behavior across the codebase.\n\n---\n\n## Agent Session Context\n\n\u003e **Claude: read this section at the start of every session.**\n\n**What this repo is:** A scaffold template for wiring Claude Code into a Go project. It ships pre-configured hooks, permissions, MCP connections, rules, commands, and skills. Teams fork it and fill in the stubs.\n\n**What is live vs stub:**\n\n| Path | Status | Notes |\n|------|--------|-------|\n| `.claude/settings.json` | Live | Permissions + hooks wired. `go lint` entry is stale — `go lint` was removed; use `golangci-lint`. |\n| `.claude/hooks/pre-bash.sh` | Live | Parses stdin JSON via `jq`. Blocks on `exit 2`. Requires `jq` installed. |\n| `.claude/hooks/post-tool-use.sh` | Live | Parses stdin JSON via `jq`. Writes audit log + stderr alert on Edit/Write/Bash failures. |\n| `.claude/rules/*.md` | Partial stubs | Scaffold defaults filled in (layer layout, interfaces, error handling, SOLID, security vuln classes). Team-specific sections (system overview, auth model, coverage %) still need filling. |\n| `.claude/commands/` | Live | `/review`, `/standup`, `/db-schema` are functional. |\n| `.claude/skills/` | Live | `on-new-file`, `pre-commit-check`, `explain-error`, `c4-architecture`, `solid-principles`, `frontend-design` auto-trigger. |\n| `.mcp.json` | Live config, disabled locally | All three MCP servers are disabled in `settings.local.json`. Confirm env vars are set before assuming MCP works. |\n| `main.go` | Placeholder | GoLand demo code — not the real application entry point. |\n| `go.mod` | Placeholder | Module named `agent-conf-skeleton`. Rename when forking. |\n\n**Key invariants — maintain these when editing:**\n\n- Never write secrets, tokens, or credentials to any file.\n- Never modify `.env` files (blocked by hook and deny list).\n- `CLAUDE.local.md` is gitignored — personal preferences live there, not in `CLAUDE.md`.\n- The four rule files (`.claude/rules/*.md`) are stubs until the team fills them in. Treat missing content as \"not defined yet\", not as permission to invent conventions.\n- MCP servers (GitHub, Postgres, Datadog) require env vars. If `settings.local.json` has `disabledMcpjsonServers`, those connections are off regardless of `.mcp.json`.\n- Hook scripts must be executable: `chmod +x .claude/hooks/*.sh`.\n\n**Known issues to fix before production use:**\n\n1. `settings.json` — replace `Bash(go lint:*)` with `Bash(golangci-lint:*)`.\n2. `main.go` — remove GoLand TIP comments; fix `fmt.Println` → `fmt.Printf` for format verbs.\n3. Rules stubs — fill team-specific sections: system overview, auth model, coverage expectations.\n\n---\n\n## How It Works\n\nClaude reads configuration files at startup. The structure splits concerns:\n\n| File / Folder | Who edits | Committed | Purpose |\n|---|---|---|---|\n| `CLAUDE.md` | Team | Yes | What Claude knows about the project |\n| `CLAUDE.local.md` | Individual | **No** | Personal overrides and notes |\n| `.mcp.json` | Team | Yes | External tool connections (GitHub, DB, Datadog) |\n| `.claude/settings.json` | Team | Yes | What Claude can and cannot run |\n| `.claude/rules/` | Team | Yes | Detailed chapters of `CLAUDE.md` |\n| `.claude/commands/` | Team | Yes | Prompts **you** trigger with `/command-name` |\n| `.claude/skills/` | Team | Yes | Prompts **Claude** triggers automatically |\n| `.claude/hooks/` | Team | Yes | Shell scripts that fire on Claude events |\n\n---\n\n## Setup\n\n### 1. Copy `CLAUDE.local.md`\n\n`CLAUDE.local.md` is the **personal** config. It is already gitignored.\n\n```bash\n# It's already there as an example — edit it directly\n# Never commit it\n```\n\n### 2. Set environment variables for MCP\n\n`.mcp.json` references env vars — never hardcoded secrets.\n\n```bash\nexport GITHUB_TOKEN=...\nexport DATABASE_URL=postgres://...\nexport DD_API_KEY=...\nexport DD_APP_KEY=...\nexport DD_SITE=datadoghq.eu   # or datadoghq.com\n```\n\nIf you have a `settings.local.json` with `disabledMcpjsonServers`, remove the entries you want active.\n\n### 3. Fill in the rules\n\nEach file in `.claude/rules/` has placeholder sections. Fill them in once:\n\n```\n.claude/rules/01-architecture.md  → system overview, components, data flow\n.claude/rules/02-conventions.md   → naming, file layout, forbidden patterns\n.claude/rules/03-testing.md       → framework, coverage, what must be tested\n.claude/rules/04-security.md      → secret handling, auth model, vuln classes\n```\n\nClaude reads these every session — keep them accurate. Until filled, Claude treats them as undefined.\n\n### 4. Fix the hooks\n\n```bash\nchmod +x .claude/hooks/*.sh\n```\n\nBoth hooks require `jq`. Install it if not present: `apt install jq` / `brew install jq`.\n\n---\n\n## Minimal Fork Path\n\nStart with the smallest viable structure and grow as needed. Do not add layers before you need them.\n\n```\nStage 1 — no database yet\n  cmd/main.go\n  internal/\n    domain/        (value types + errors only)\n    service/       (business logic, defines its own interfaces)\n    handler/       (HTTP, imports service only)\n\nStage 2 — add persistence\n  internal/\n    repository/    (add when you have a real DB; implements interface defined in service/)\n\nStage 3 — scale\n  Split service/ into sub-packages by domain noun\n  Add internal/platform/ for cross-cutting concerns (logging, tracing, health)\n```\n\nRule: never add a layer \"just in case.\" Add it when the next concrete feature requires it.\n\n---\n\n## Commands — You trigger these\n\nType `/command-name` in Claude to run a command.\n\n| Command | What it does |\n|---|---|\n| `/review` | Review current diff or a file for bugs, conventions, security |\n| `/standup` | Generate standup summary from yesterday's git log |\n| `/db-schema` | Fetch and display DB schema via MCP postgres connection |\n\n**To add a command:** create `.claude/commands/your-command.md`. Describe what Claude should do. Use `$ARGUMENTS` for user-provided input.\n\n---\n\n## Skills — Claude triggers these automatically\n\nSkills are self-activating — Claude applies them without being asked.\n\n| Skill | Trigger |\n|---|---|\n| `on-new-file` | Claude just created a source file |\n| `pre-commit-check` | Claude is about to suggest a `git commit` |\n| `explain-error` | A command exited non-zero |\n| `c4-architecture` | Designing, diagramming, or documenting system architecture; filling `01-architecture.md` |\n| `solid-principles` | Creating a package, designing an interface, or reviewing component structure |\n| `frontend-design` | Building or reviewing web UI — design tokens (3-tier), typography constraints, WCAG AA accessibility, component states |\n| `caveman` | User types `/caveman` — activates compressed response mode |\n\n**To add a skill:** create `.claude/skills/your-skill.md`. Start with a `**Trigger:**` line so Claude knows when to apply it.\n\n### Versioned skills via GitHub Packages\n\nSkills are distributed as versioned npm packages hosted on GitHub Packages.  \n`@team/caveman-skill` is pulled automatically — no manual file copy needed.\n\n**Architecture:**\n\n```\n@team/caveman-skill  (GitHub Packages, versioned)\n        ↓  dependency of\n@team/claude-skills  (GitHub Packages, versioned)\n        ↓  devDependency of\nconsumer repo  →  npm install \u0026\u0026 npm run setup:claude\n                  writes .claude/skills/caveman.md automatically\n```\n\n**One-time org setup — add `.npmrc` to every consumer repo:**\n\n```ini\n# .npmrc\n@team:registry=https://npm.pkg.github.com\n//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}\n```\n\n`GITHUB_TOKEN` is available automatically in GitHub Actions. Local dev: use a PAT with `read:packages` scope.\n\n**Consumer repo `package.json`:**\n\n```json\n{\n  \"devDependencies\": {\n    \"@team/claude-skills\": \"^1.0.0\"\n  },\n  \"scripts\": {\n    \"setup:claude\": \"claude-skills install\"\n  }\n}\n```\n\n**Install:**\n\n```bash\nnpm install             # pulls @team/claude-skills + its @team/caveman-skill dep\nnpm run setup:claude    # copies all skills → .claude/skills/\n```\n\n**Upgrade caveman:**  \nBump `@team/caveman-skill` version in `packages/claude-skills/package.json`, publish, then consumer repos run `npm update @team/claude-skills \u0026\u0026 npm run setup:claude` and commit the lockfile.\n\n**`.gitignore` in consumer repos:**\n```\n.claude/skills/caveman.md   # generated — source of truth is @team/caveman-skill\n```\n\nPackage source lives in `packages/claude-skills/`.\n\n---\n\n### Extending for another language\n\nFork this repo → rename → swap the Go-specific files:\n\n| File | What to change |\n|---|---|\n| `.claude/settings.json` | Replace `go build/test/vet/fmt` with your toolchain |\n| `.claude/skills/pre-commit-check.md` | Replace `go vet ./...` and `go test ./...` |\n| `.claude/rules/03-testing.md` | Replace `go test` with your test runner |\n| `README.md` badge | Update Go version badge |\n| `go.mod` / `main.go` | Remove or replace with your language entry point |\n\nEverything else — MCP, hooks, commands, rules structure, caveman — is language-agnostic.\n\n---\n\n## Hooks — Shell scripts on events\n\nHooks run outside Claude, in the shell, on specific events.\n\n| Hook | Event | What it does |\n|---|---|---|\n| `pre-bash.sh` | Before every Bash call | Blocks forbidden command patterns |\n| `post-tool-use.sh` | After every tool call | Audit log + failure alerts |\n\nHooks must be executable:\n```bash\nchmod +x .claude/hooks/*.sh\n```\n\n**Note:** Claude Code passes hook payloads as JSON via stdin, not positional args. Both hook scripts need updating to parse stdin with `jq`. See Known Issues in the Agent Session Context section above.\n\n---\n\n## Settings — Allow / Deny\n\n`.claude/settings.json` controls what Claude can run.\n\n- **allow** — commands Claude runs without prompting you\n- **deny** — commands Claude can never run, even if asked\n\nEdit the lists to match your project's toolchain. The skeleton ships with safe defaults for a Go project.\n\n---\n\n## Rules vs CLAUDE.md\n\n`CLAUDE.md` is the summary — short enough to read in 30 seconds.  \n`.claude/rules/*.md` are the chapters — full detail Claude uses when writing code.\n\nBoth are always loaded. Keep `CLAUDE.md` as an index; put specifics in rules.\n\n---\n\n## Adding a New Team Member\n\n1. Clone repo\n2. Copy env var template (share out-of-band, never commit)\n3. Edit `CLAUDE.local.md` with personal preferences\n4. Run `chmod +x .claude/hooks/*.sh`\n5. Check `settings.local.json` — remove any `disabledMcpjsonServers` you need active\n6. Start Claude — configuration is automatic\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarknessnerd%2Fclaude-scafold-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarknessnerd%2Fclaude-scafold-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarknessnerd%2Fclaude-scafold-go/lists"}