| 1 | # ABCoder: AI-Based Coder(AKA: A Brand-new Coder) |
| 2 | |
| 3 |  |
| 4 | |
| 5 | # Overview |
| 6 | ABCoder, an AI-oriented Code-processing **Framework**, is designed to enhance and extend the coding context for Large-Language-Model (LLM), finally boosting the development of AI-assisted-programming applications. |
| 7 | |
| 8 | |
| 9 | ## Features |
| 10 | |
| 11 | - Universal Abstract-Syntax-Tree (UniAST), a language-independent, AI-friendly specification of code information, providing a boundless, flexible and structural coding context for both AI and humans. |
| 12 | |
| 13 | - General Parser, parses arbitrary-language codes to UniAST. |
| 14 | |
| 15 | - General Writer transforms UniAST back to code. |
| 16 | |
| 17 | - **Code-Retrieval-Augmented-Generation (Code-RAG)**, provides a set of MCP tools to help the LLM understand code repositories precisely and locally. And it can support both in-workspace and out-of-workspace third-party libraries simultaneously -- I guess you are thinking about [DeepWiki](https://deepwiki.org) and [context7](https://github.com/upstash/context7), but ABCoder is more reliable and confidential -- no need to wait for their services to be done, and no worry about your codes will be uploaded! |
| 18 | |
| 19 | Based on these features, developers can easily implement or enhance their AI-assisted programming applications, such as reviewing, optimizing, translating, etc. |
| 20 | |
| 21 | |
| 22 | ## Universal Abstract-Syntax-Tree Specification |
| 23 | |
| 24 | see [UniAST Specification](docs/uniast-zh.md) |
| 25 | |
| 26 | |
| 27 | # Quick Start |
| 28 | |
| 29 | ## Claude Code Integration |
| 30 | |
| 31 | ABCoder provides deep integration with [Claude Code](https://claude.ai/code) through the AST-Driven Coding workflow, enabling hallucination-free code analysis and precise execution. Check [Claude Code Specification](docs/claude-code-spec.md) for more details. |
| 32 | |
| 33 | ### Setup |
| 34 | |
| 35 | Use the `init-spec` command to automatically configure Claude Code integration for your project: |
| 36 | |
| 37 | ```bash |
| 38 | # Install ABCoder |
| 39 | go install github.com/cloudwego/abcoder@latest |
| 40 | |
| 41 | # Run init-spec in your project directory (optional: specify target path) |
| 42 | cd /path/to/your/project |
| 43 | abcoder init-spec |
| 44 | ``` |
| 45 | |
| 46 | The `init-spec` command will: |
| 47 | 1. Copy `.claude` directory to your project root |
| 48 | 2. Configure MCP servers in `~/.claude.json`: |
| 49 | - `abcoder`: for code analysis using AST |
| 50 | - `sequential-thinking`: for complex problem decomposition |
| 51 | 3. Replace all `{{CLAUDE_HOME_PATH}}` placeholders with actual project paths |
| 52 | |
| 53 | ### Start Coding with Claude Code |
| 54 | |
| 55 | Once setup, you can start coding with Claude Code: |
| 56 | |
| 57 | 1. Start Claude Code in your project directory |
| 58 | 2. Use slash common `/abcoder:schedule <problem_desc>` to address your feature/requirement/issue, and ABCoder will help you analyze the codebase and design a technical solution. |
| 59 | 3. Once all questions are set, use slash common `/abcoder:task <task_name>` to create a coding task(specification) |
| 60 | 4. Recheck the task using `/abcoder:recheck <task_name>` before real implementation |
| 61 | 5. Begin coding! Claude Code will process the task step by step according to the specification, leveraging the power of AST-driven analysis. |
| 62 | |
| 63 | ### AST-Driven Coding Workflow |
| 64 | |
| 65 | [`.claude/hooks`](internal/cmd/assets/.claude/hooks) provide a 4-layer analysis chain from repository to node details: |
| 66 | |
| 67 | ``` |
| 68 | list_repos → get_repo_structure → get_package_structure → get_file_structure → get_ast_node |
| 69 | │ │ │ │ │ |
| 70 | └── repo_name └── mod/pkg list └── file list └── node list └── dependencies/references |
| 71 | ``` |
| 72 | |
| 73 | ### Claude Code Slash Commands |
| 74 | |
| 75 | [`.claude/commands`](internal/cmd/assets/.claude/commands) provide three custom slash commands to streamline development: |
| 76 | |
| 77 | | Command | Function | Description | |
| 78 | |---------|----------|-------------| |
| 79 | | [`/abcoder:schedule` <task_desc>](internal/cmd/assets/.claude/commands/abcoder/schedule.md) | Design implementation | Analyze codebase by using ABCoder, design technical solution | |
| 80 | | [`/abcoder:task <name>`](internal/cmd/assets/.claude/commands/abcoder/task.md) | Create coding task | Generate standardized CODE_TASK document | |
| 81 | | |