craft-code 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- craft_code-0.1.0/.env.example +20 -0
- craft_code-0.1.0/.github/workflows/claude-code-review.yml +44 -0
- craft_code-0.1.0/.github/workflows/claude.yml +50 -0
- craft_code-0.1.0/.gitignore +168 -0
- craft_code-0.1.0/AGENTS.md +35 -0
- craft_code-0.1.0/LICENSE +21 -0
- craft_code-0.1.0/PKG-INFO +121 -0
- craft_code-0.1.0/README.md +80 -0
- craft_code-0.1.0/code_craft/AGENTS.md +35 -0
- craft_code-0.1.0/code_craft/__init__.py +3 -0
- craft_code-0.1.0/code_craft/__main__.py +5 -0
- craft_code-0.1.0/code_craft/agent.py +140 -0
- craft_code-0.1.0/code_craft/auth.py +146 -0
- craft_code-0.1.0/code_craft/cli.py +254 -0
- craft_code-0.1.0/code_craft/config.py +62 -0
- craft_code-0.1.0/code_craft/interrupt_handler.py +131 -0
- craft_code-0.1.0/code_craft/prompts.py +60 -0
- craft_code-0.1.0/code_craft/skills/code-review/SKILL.md +21 -0
- craft_code-0.1.0/code_craft/skills/testing/SKILL.md +22 -0
- craft_code-0.1.0/code_craft/tools.py +59 -0
- craft_code-0.1.0/example.py +34 -0
- craft_code-0.1.0/pyproject.toml +68 -0
- craft_code-0.1.0/skills/code-review/SKILL.md +21 -0
- craft_code-0.1.0/skills/testing/SKILL.md +22 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# --- Anthropic (direct) ---
|
|
2
|
+
ANTHROPIC_API_KEY=your-key-here
|
|
3
|
+
|
|
4
|
+
# --- OpenRouter (alternative — install with: uv pip install -e ".[openrouter]") ---
|
|
5
|
+
# OPENROUTER_API_KEY=sk-or-v1-your-key-here
|
|
6
|
+
|
|
7
|
+
# --- Model selection ---
|
|
8
|
+
# Main agent model. Use provider:model format.
|
|
9
|
+
# Anthropic direct: anthropic:claude-sonnet-4-6
|
|
10
|
+
# OpenRouter: openrouter:anthropic/claude-sonnet-4-6
|
|
11
|
+
# openrouter:google/gemini-2.5-flash
|
|
12
|
+
# openrouter:deepseek/deepseek-r1
|
|
13
|
+
# MODEL=anthropic:claude-sonnet-4-6
|
|
14
|
+
|
|
15
|
+
# Subagent model (code-reviewer, researcher). Defaults to MODEL if unset.
|
|
16
|
+
# Use a cheaper model here to save credits.
|
|
17
|
+
# SUBAGENT_MODEL=openrouter:google/gemini-2.5-flash
|
|
18
|
+
|
|
19
|
+
# --- Project settings ---
|
|
20
|
+
# PROJECT_ROOT=.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Claude Code Review
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize, ready_for_review, reopened]
|
|
6
|
+
# Optional: Only run on specific file changes
|
|
7
|
+
# paths:
|
|
8
|
+
# - "src/**/*.ts"
|
|
9
|
+
# - "src/**/*.tsx"
|
|
10
|
+
# - "src/**/*.js"
|
|
11
|
+
# - "src/**/*.jsx"
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
claude-review:
|
|
15
|
+
# Optional: Filter by PR author
|
|
16
|
+
# if: |
|
|
17
|
+
# github.event.pull_request.user.login == 'external-contributor' ||
|
|
18
|
+
# github.event.pull_request.user.login == 'new-developer' ||
|
|
19
|
+
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
|
|
20
|
+
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
permissions:
|
|
23
|
+
contents: read
|
|
24
|
+
pull-requests: read
|
|
25
|
+
issues: read
|
|
26
|
+
id-token: write
|
|
27
|
+
|
|
28
|
+
steps:
|
|
29
|
+
- name: Checkout repository
|
|
30
|
+
uses: actions/checkout@v4
|
|
31
|
+
with:
|
|
32
|
+
fetch-depth: 1
|
|
33
|
+
|
|
34
|
+
- name: Run Claude Code Review
|
|
35
|
+
id: claude-review
|
|
36
|
+
uses: anthropics/claude-code-action@v1
|
|
37
|
+
with:
|
|
38
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
39
|
+
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
|
|
40
|
+
plugins: 'code-review@claude-code-plugins'
|
|
41
|
+
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
|
|
42
|
+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
|
43
|
+
# or https://code.claude.com/docs/en/cli-reference for available options
|
|
44
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Claude Code
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issue_comment:
|
|
5
|
+
types: [created]
|
|
6
|
+
pull_request_review_comment:
|
|
7
|
+
types: [created]
|
|
8
|
+
issues:
|
|
9
|
+
types: [opened, assigned]
|
|
10
|
+
pull_request_review:
|
|
11
|
+
types: [submitted]
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
claude:
|
|
15
|
+
if: |
|
|
16
|
+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
17
|
+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
18
|
+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
|
|
19
|
+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
permissions:
|
|
22
|
+
contents: read
|
|
23
|
+
pull-requests: read
|
|
24
|
+
issues: read
|
|
25
|
+
id-token: write
|
|
26
|
+
actions: read # Required for Claude to read CI results on PRs
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout repository
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
with:
|
|
31
|
+
fetch-depth: 1
|
|
32
|
+
|
|
33
|
+
- name: Run Claude Code
|
|
34
|
+
id: claude
|
|
35
|
+
uses: anthropics/claude-code-action@v1
|
|
36
|
+
with:
|
|
37
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
38
|
+
|
|
39
|
+
# This is an optional setting that allows Claude to read CI results on PRs
|
|
40
|
+
additional_permissions: |
|
|
41
|
+
actions: read
|
|
42
|
+
|
|
43
|
+
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
|
|
44
|
+
# prompt: 'Update the pull request description to include a summary of changes.'
|
|
45
|
+
|
|
46
|
+
# Optional: Add claude_args to customize behavior and configuration
|
|
47
|
+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
|
48
|
+
# or https://code.claude.com/docs/en/cli-reference for available options
|
|
49
|
+
# claude_args: '--allowed-tools Bash(gh pr:*)'
|
|
50
|
+
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# .python-version
|
|
87
|
+
|
|
88
|
+
# pipenv
|
|
89
|
+
#Pipfile.lock
|
|
90
|
+
|
|
91
|
+
# UV
|
|
92
|
+
#uv.lock
|
|
93
|
+
|
|
94
|
+
# poetry
|
|
95
|
+
#poetry.lock
|
|
96
|
+
#poetry.toml
|
|
97
|
+
|
|
98
|
+
# pdm
|
|
99
|
+
#pdm.lock
|
|
100
|
+
#pdm.toml
|
|
101
|
+
.pdm-python
|
|
102
|
+
.pdm-build/
|
|
103
|
+
|
|
104
|
+
# pixi
|
|
105
|
+
#pixi.lock
|
|
106
|
+
.pixi
|
|
107
|
+
|
|
108
|
+
# PEP 582
|
|
109
|
+
__pypackages__/
|
|
110
|
+
|
|
111
|
+
# Celery stuff
|
|
112
|
+
celerybeat-schedule
|
|
113
|
+
celerybeat.pid
|
|
114
|
+
|
|
115
|
+
# SageMath parsed files
|
|
116
|
+
*.sage.py
|
|
117
|
+
|
|
118
|
+
# Environments
|
|
119
|
+
.env
|
|
120
|
+
.envrc
|
|
121
|
+
.venv
|
|
122
|
+
env/
|
|
123
|
+
venv/
|
|
124
|
+
ENV/
|
|
125
|
+
env.bak/
|
|
126
|
+
venv.bak/
|
|
127
|
+
|
|
128
|
+
# Spyder project settings
|
|
129
|
+
.spyderproject
|
|
130
|
+
.spyproject
|
|
131
|
+
|
|
132
|
+
# Rope project settings
|
|
133
|
+
.ropeproject
|
|
134
|
+
|
|
135
|
+
# mkdocs documentation
|
|
136
|
+
/site
|
|
137
|
+
|
|
138
|
+
# mypy
|
|
139
|
+
.mypy_cache/
|
|
140
|
+
.dmypy.json
|
|
141
|
+
dmypy.json
|
|
142
|
+
|
|
143
|
+
# Pyre type checker
|
|
144
|
+
.pyre/
|
|
145
|
+
|
|
146
|
+
# pytype static type analyzer
|
|
147
|
+
.pytype/
|
|
148
|
+
|
|
149
|
+
# Cython debug symbols
|
|
150
|
+
cython_debug/
|
|
151
|
+
|
|
152
|
+
# Ruff stuff:
|
|
153
|
+
.ruff_cache/
|
|
154
|
+
|
|
155
|
+
# PyPI configuration file
|
|
156
|
+
.pypirc
|
|
157
|
+
|
|
158
|
+
# Cursor
|
|
159
|
+
.cursorignore
|
|
160
|
+
.cursorindexingignore
|
|
161
|
+
|
|
162
|
+
# Marimo
|
|
163
|
+
marimo/_static/
|
|
164
|
+
marimo/_lsp/
|
|
165
|
+
__marimo__/
|
|
166
|
+
|
|
167
|
+
# Claude Code
|
|
168
|
+
.claude/
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Project: Deep Coding Agent
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
A Claude Code-like AI coding assistant built with LangChain Deep Agents.
|
|
5
|
+
|
|
6
|
+
## Tech Stack
|
|
7
|
+
- Python 3.11+
|
|
8
|
+
- LangChain Deep Agents framework
|
|
9
|
+
- LangGraph for orchestration
|
|
10
|
+
- Rich for terminal UI
|
|
11
|
+
|
|
12
|
+
## Project Structure
|
|
13
|
+
```
|
|
14
|
+
code_craft/
|
|
15
|
+
__init__.py — package metadata
|
|
16
|
+
agent.py — core agent factory (build_agent)
|
|
17
|
+
cli.py — interactive CLI entry point
|
|
18
|
+
config.py — AgentConfig dataclass
|
|
19
|
+
interrupt_handler.py — human-in-the-loop approval UI
|
|
20
|
+
prompts.py — system prompts for agent and subagents
|
|
21
|
+
tools.py — custom tools (git, delete, test runner)
|
|
22
|
+
skills/
|
|
23
|
+
testing/SKILL.md
|
|
24
|
+
code_review/SKILL.md
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Commands
|
|
28
|
+
- Run: `code-craft` or `python -m code_craft.cli`
|
|
29
|
+
- Test: `pytest`
|
|
30
|
+
- Lint: `ruff check .`
|
|
31
|
+
|
|
32
|
+
## Conventions
|
|
33
|
+
- Use type hints on public functions
|
|
34
|
+
- Keep modules focused — one responsibility per file
|
|
35
|
+
- Use Rich for all terminal output
|
craft_code-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shubham Agarwal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: craft-code
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A Claude Code-like AI coding assistant built with LangChain Deep Agents
|
|
5
|
+
Project-URL: Homepage, https://github.com/shubhamagarwal/code-craft
|
|
6
|
+
Project-URL: Repository, https://github.com/shubhamagarwal/code-craft
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/shubhamagarwal/code-craft/issues
|
|
8
|
+
Author: Shubham Agarwal
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agent,ai,claude,coding-assistant,langchain,llm
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Requires-Dist: deepagents>=0.4.0
|
|
24
|
+
Requires-Dist: langchain-anthropic>=0.3.0
|
|
25
|
+
Requires-Dist: langchain-openrouter>=0.1.0
|
|
26
|
+
Requires-Dist: langgraph-checkpoint>=2.0.0
|
|
27
|
+
Requires-Dist: langgraph>=0.3.0
|
|
28
|
+
Requires-Dist: prompt-toolkit>=3.0.0
|
|
29
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
30
|
+
Requires-Dist: rich>=13.0.0
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: build>=1.0; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: ruff>=0.8.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: twine>=5.0; extra == 'dev'
|
|
36
|
+
Provides-Extra: openrouter
|
|
37
|
+
Requires-Dist: langchain-openrouter>=0.1.0; extra == 'openrouter'
|
|
38
|
+
Provides-Extra: sandbox
|
|
39
|
+
Requires-Dist: langchain-daytona>=0.1.0; extra == 'sandbox'
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
# Code Craft
|
|
43
|
+
|
|
44
|
+
A Claude Code-like AI coding assistant built with [LangChain Deep Agents](https://docs.langchain.com/oss/python/deepagents/overview).
|
|
45
|
+
|
|
46
|
+
## Features
|
|
47
|
+
|
|
48
|
+
- **File system access** — reads, writes, and edits project files
|
|
49
|
+
- **Shell execution** — runs commands (tests, linters, build tools)
|
|
50
|
+
- **Agentic planning** — breaks tasks into steps with `write_todos`
|
|
51
|
+
- **Human-in-the-loop** — asks approval before destructive operations
|
|
52
|
+
- **Persistent memory** — remembers project context across sessions
|
|
53
|
+
- **Subagent delegation** — spawns code-reviewer and researcher subagents
|
|
54
|
+
- **Skill system** — lazy-loaded workflows for testing, code review, etc.
|
|
55
|
+
|
|
56
|
+
## Quick Start
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# 1. Clone and install
|
|
60
|
+
cd code-craft
|
|
61
|
+
uv venv && source .venv/bin/activate
|
|
62
|
+
uv pip install -e .
|
|
63
|
+
|
|
64
|
+
# 2. Set your API key
|
|
65
|
+
cp .env.example .env
|
|
66
|
+
# Edit .env and add your ANTHROPIC_API_KEY
|
|
67
|
+
|
|
68
|
+
# 3. Run
|
|
69
|
+
coding-agent
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Usage
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Interactive CLI
|
|
76
|
+
coding-agent
|
|
77
|
+
|
|
78
|
+
# Or run directly
|
|
79
|
+
python -m code_craft
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Inside the CLI:
|
|
83
|
+
- Type your coding request
|
|
84
|
+
- The agent will ask for approval before file writes and shell commands
|
|
85
|
+
- Use `/new` to start a fresh thread, `/quit` to exit
|
|
86
|
+
|
|
87
|
+
## Programmatic Usage
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
from code_craft.agent import build_agent
|
|
91
|
+
from code_craft.config import AgentConfig
|
|
92
|
+
|
|
93
|
+
config = AgentConfig(project_root="/path/to/your/project")
|
|
94
|
+
agent, checkpointer, store = build_agent(config)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Configuration
|
|
98
|
+
|
|
99
|
+
Set these in `.env` or as environment variables:
|
|
100
|
+
|
|
101
|
+
| Variable | Default | Description |
|
|
102
|
+
|---|---|---|
|
|
103
|
+
| `ANTHROPIC_API_KEY` | (required) | Your Anthropic API key |
|
|
104
|
+
| `MODEL` | `anthropic:claude-sonnet-4-6` | Model to use |
|
|
105
|
+
| `PROJECT_ROOT` | `.` | Root directory for file operations |
|
|
106
|
+
|
|
107
|
+
## Architecture
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
code_craft/
|
|
111
|
+
agent.py — Agent factory with backends, subagents, skills
|
|
112
|
+
cli.py — Interactive Rich-powered CLI
|
|
113
|
+
config.py — AgentConfig dataclass
|
|
114
|
+
interrupt_handler.py — Human-in-the-loop approval UI
|
|
115
|
+
prompts.py — System prompts
|
|
116
|
+
tools.py — Custom tools (git, delete, tests)
|
|
117
|
+
skills/
|
|
118
|
+
testing/SKILL.md — Test writing workflow
|
|
119
|
+
code_review/SKILL.md — Code review workflow
|
|
120
|
+
AGENTS.md — Project context for the agent
|
|
121
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Code Craft
|
|
2
|
+
|
|
3
|
+
A Claude Code-like AI coding assistant built with [LangChain Deep Agents](https://docs.langchain.com/oss/python/deepagents/overview).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **File system access** — reads, writes, and edits project files
|
|
8
|
+
- **Shell execution** — runs commands (tests, linters, build tools)
|
|
9
|
+
- **Agentic planning** — breaks tasks into steps with `write_todos`
|
|
10
|
+
- **Human-in-the-loop** — asks approval before destructive operations
|
|
11
|
+
- **Persistent memory** — remembers project context across sessions
|
|
12
|
+
- **Subagent delegation** — spawns code-reviewer and researcher subagents
|
|
13
|
+
- **Skill system** — lazy-loaded workflows for testing, code review, etc.
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# 1. Clone and install
|
|
19
|
+
cd code-craft
|
|
20
|
+
uv venv && source .venv/bin/activate
|
|
21
|
+
uv pip install -e .
|
|
22
|
+
|
|
23
|
+
# 2. Set your API key
|
|
24
|
+
cp .env.example .env
|
|
25
|
+
# Edit .env and add your ANTHROPIC_API_KEY
|
|
26
|
+
|
|
27
|
+
# 3. Run
|
|
28
|
+
coding-agent
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Interactive CLI
|
|
35
|
+
coding-agent
|
|
36
|
+
|
|
37
|
+
# Or run directly
|
|
38
|
+
python -m code_craft
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Inside the CLI:
|
|
42
|
+
- Type your coding request
|
|
43
|
+
- The agent will ask for approval before file writes and shell commands
|
|
44
|
+
- Use `/new` to start a fresh thread, `/quit` to exit
|
|
45
|
+
|
|
46
|
+
## Programmatic Usage
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from code_craft.agent import build_agent
|
|
50
|
+
from code_craft.config import AgentConfig
|
|
51
|
+
|
|
52
|
+
config = AgentConfig(project_root="/path/to/your/project")
|
|
53
|
+
agent, checkpointer, store = build_agent(config)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Configuration
|
|
57
|
+
|
|
58
|
+
Set these in `.env` or as environment variables:
|
|
59
|
+
|
|
60
|
+
| Variable | Default | Description |
|
|
61
|
+
|---|---|---|
|
|
62
|
+
| `ANTHROPIC_API_KEY` | (required) | Your Anthropic API key |
|
|
63
|
+
| `MODEL` | `anthropic:claude-sonnet-4-6` | Model to use |
|
|
64
|
+
| `PROJECT_ROOT` | `.` | Root directory for file operations |
|
|
65
|
+
|
|
66
|
+
## Architecture
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
code_craft/
|
|
70
|
+
agent.py — Agent factory with backends, subagents, skills
|
|
71
|
+
cli.py — Interactive Rich-powered CLI
|
|
72
|
+
config.py — AgentConfig dataclass
|
|
73
|
+
interrupt_handler.py — Human-in-the-loop approval UI
|
|
74
|
+
prompts.py — System prompts
|
|
75
|
+
tools.py — Custom tools (git, delete, tests)
|
|
76
|
+
skills/
|
|
77
|
+
testing/SKILL.md — Test writing workflow
|
|
78
|
+
code_review/SKILL.md — Code review workflow
|
|
79
|
+
AGENTS.md — Project context for the agent
|
|
80
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Project: Code Craft
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
A Claude Code-like AI coding assistant built with LangChain Deep Agents.
|
|
5
|
+
|
|
6
|
+
## Tech Stack
|
|
7
|
+
- Python 3.11+
|
|
8
|
+
- LangChain Deep Agents framework
|
|
9
|
+
- LangGraph for orchestration
|
|
10
|
+
- Rich for terminal UI
|
|
11
|
+
|
|
12
|
+
## Project Structure
|
|
13
|
+
```
|
|
14
|
+
code_craft/
|
|
15
|
+
__init__.py — package metadata
|
|
16
|
+
agent.py — core agent factory (build_agent)
|
|
17
|
+
cli.py — interactive CLI entry point
|
|
18
|
+
config.py — AgentConfig dataclass
|
|
19
|
+
interrupt_handler.py — human-in-the-loop approval UI
|
|
20
|
+
prompts.py — system prompts for agent and subagents
|
|
21
|
+
tools.py — custom tools (git, delete, test runner)
|
|
22
|
+
skills/
|
|
23
|
+
testing/SKILL.md
|
|
24
|
+
code_review/SKILL.md
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Commands
|
|
28
|
+
- Run: `code-craft` or `python -m code_craft.cli`
|
|
29
|
+
- Test: `pytest`
|
|
30
|
+
- Lint: `ruff check .`
|
|
31
|
+
|
|
32
|
+
## Conventions
|
|
33
|
+
- Use type hints on public functions
|
|
34
|
+
- Keep modules focused — one responsibility per file
|
|
35
|
+
- Use Rich for all terminal output
|