{"id":15019978,"url":"https://github.com/docker/labs-githooks","last_synced_at":"2025-10-19T16:32:29.545Z","repository":{"id":237403095,"uuid":"794448682","full_name":"docker/labs-githooks","owner":"docker","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-13T01:15:35.000Z","size":6238,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-30T01:51:16.152Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/docker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-05-01T07:27:08.000Z","updated_at":"2024-12-30T17:06:45.000Z","dependencies_parsed_at":"2024-05-15T19:28:07.652Z","dependency_job_id":"79557c00-a4d1-43ae-b094-93724fe95f51","html_url":"https://github.com/docker/labs-githooks","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"7008db91fe3f632515be2dc8f38e8d031492d423"},"previous_names":["docker/githooks"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Flabs-githooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Flabs-githooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Flabs-githooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Flabs-githooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/docker","download_url":"https://codeload.github.com/docker/labs-githooks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237172156,"owners_count":19266626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-09-24T19:54:24.593Z","updated_at":"2025-10-19T16:32:28.202Z","avatar_url":"https://github.com/docker.png","language":"Nix","readme":"# Containerizing GitHooks\n\n## What is this project\n\nThis project contains three sets of prompts.  These represent different stages of improvements\nto an assistant that can help developers configure githooks in their project.\n\n```\nprompts/\n├── git_hooks_with_linguist.md\n├── git_hooks.md\n├── git_hooks_single_step.md\n```\n\n## How to get started\n\nMake sure that your local Docker Desktop engine is running. Besides a running docker engine and access to Docker Hub, no other tools need to be pre-installed.\n\nThe default version of scripts use openai.  To run these tests, you will need to write your OpenAI API key to the a file named `$HOME/.openai-api-key`.\n\nThe second argument to each of the scripts below should be the path to the root of some git cloned project.\n\n\n### githooks\n\nStart by prompting an LLM with a prompt such as:\n\n```\nHow do I setup githooks?\n```\n\nThe results are useful but very general and lack project context.\n\n### git_hooks_with_linguist\n\nIn the first set of prompts, we add one capability to the LLM.  We give it a tool to do\nlinguistic analysis on the project and _then_ ask it to setup the githooks.\nYou can try this verion of the prompts using OpenAI by running.\n\n```sh\n./prompts/run_prompts.sh \"github:docker/labs-githooks?ref=main\u0026path=prompts/git_hooks_with_linguist.md\" {/absolute/path/to/your/project}\n```\n\n### git_hooks\n\nWe can make the advice even more specific by augmenting the prompts with information about\nhow we prefer to setup githooks.  See [this example](prompts/git_hooks/015_system_prompt.md) where\nwe describe how to setup githooks using the [pre-commit](https://github.com/pre-commit/pre-commit) tool.\n\nRun this set of prompts using:\n\n```sh\n./prompts/run_prompts.sh \"github:docker/labs-githooks?ref=main\u0026path=prompts/git_hooks.md\" {/absolute/path/to/your/project}\n```\n\n### git_hooks_single_step\n\nFinally, a set of prompts which can takes the LLM response and then calls a function that configures the githooks in the root of your project.\nThis script will make updates to your .git/hooks folder and add an assistant authored pre-commig-config.yaml file.  It can be run using:\n\n```sh\n./prompts/run_prompts.sh \"github:docker/labs-githooks?ref=main\u0026path=prompts/git_hooks_single_step.md\" {/absolute/path/to/your/project}\n```\n\n## Summary\n\nAfter analyzing the project for different file types and setting up the githooks,\nboth the `pre-commit` and\n`commit-msg` hooks are configured by the assistant. All tools run in containers but even the githooks themselves are containerized.\nThis allows us to distribute an assistant that relies only on access to trusted set of docker images.\n\n![commit cap](gifs/commit.gif)\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocker%2Flabs-githooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocker%2Flabs-githooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocker%2Flabs-githooks/lists"}