{"id":28300390,"url":"https://github.com/crisfeim/cli-tddbuddy","last_synced_at":"2025-06-16T22:31:24.081Z","repository":{"id":292230615,"uuid":"980223937","full_name":"crisfeim/cli-tddbuddy","owner":"crisfeim","description":"🛠️ Experiment on AI-assisted test-driven development.","archived":false,"fork":false,"pushed_at":"2025-05-26T15:48:57.000Z","size":1939,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-26T15:54:10.983Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","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/crisfeim.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,"zenodo":null}},"created_at":"2025-05-08T19:17:18.000Z","updated_at":"2025-05-26T15:49:01.000Z","dependencies_parsed_at":"2025-05-26T15:35:53.131Z","dependency_job_id":"acd347ba-fd82-4a3a-b820-4b785a4cbfaf","html_url":"https://github.com/crisfeim/cli-tddbuddy","commit_stats":null,"previous_names":["crisrojas/cli-tddbuddy","crisfeim/cli-tddbuddy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/crisfeim/cli-tddbuddy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crisfeim%2Fcli-tddbuddy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crisfeim%2Fcli-tddbuddy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crisfeim%2Fcli-tddbuddy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crisfeim%2Fcli-tddbuddy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crisfeim","download_url":"https://codeload.github.com/crisfeim/cli-tddbuddy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crisfeim%2Fcli-tddbuddy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260251302,"owners_count":22981008,"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":"2025-05-23T16:22:29.781Z","updated_at":"2025-06-16T22:31:24.068Z","avatar_url":"https://github.com/crisfeim.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tddbudy\n\nThis is an experiment in AI-assisted test-driven development.\n\n![](tddbuddy.png)\n\n### User Stories\n\n- As a developer, I want to write unit tests without writing any SUT code, so the AI can generate the implementation for me. *(The SUT is defined implicitly by the assertion; the AI infers the intended behavior.)*\n- As a developer, I want the tool to automatically retry code generation when the AI produces non-compiling code or failing tests.\n- As a developer, I want to configure a maximum number of retries per prompt to avoid infinite loops.\n- As a developer, I want to see the build output and test results after each generation attempt.\n- As a developer, I want a lightweight CLI that I can run locally.\n- As a developer, I want the tool to be model-agnostic — compatible with OpenAI, Mistral, LLaMA, or any other provider.\n- As a developer, I want each generation attempt archived (prompt, AI response, result) for traceability and debugging.\n\n### Desired Behavior\n\nThe CLI should accept the following inputs:\n\n- A `specs.swift` file containing the test cases.\n- An output filename for the generated implementation.\n- A maximum number of allowed iterations (for retrying failed generations).\n\n### Proposed System Flow:\n\n![](subsystem.png)\n\n```\nSystem.generateCodeFrom(specs) → (GeneratedCode, Stdout/Stderr)\n    → LLM.send(specs) → GeneratedCode\n    → Concatenator.concatenate(GeneratedCode, Specs) → Concatenated\n    → CodeRunner.run(Concatenated) → Stdout/Stderr\n    → Exit\n```\n\nMore control is needed (input \u0026 output urls, max iteration count), so we'll probably need more components and a higher level coordinator:\n\n![](system.png)\n\n### Usage\n\nDefine your specs in a swift folder without implementing the _sut_.\n\n```swift\n//specs.swift\nfunc test_adder() {\n    let sut = Adder(a: 1, b: 2)\n    assert(sut.result == 3)\n}\n```\n\nPass the path of the file to _TestBuddy_:\n\n```shell\ntddbuddy \\\n  --input adder.swift \\\n  --output adder-generated.swift \\\n  --iterations 5\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrisfeim%2Fcli-tddbuddy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrisfeim%2Fcli-tddbuddy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrisfeim%2Fcli-tddbuddy/lists"}