Skip to content

hengistchan/learn-agent-code-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learn Agent Code

TypeScript/Bun 版的渐进式 agent harness 教学项目。

这个仓库把原先的 Python 教学实现重写成了 Bun + TypeScript 版本,并保留原有的 20 个递进章节:

  • s01_agent_loop/code.tss20_comprehensive/code.ts
  • agents/ 下基于共享核心的 20 个入口,以及完整版本 agents/s_full.ts
  • docs/en|zh|ja 三语章节文档
  • web/ 交互式文档站

Quick Start

安装依赖:

bun install
cp .env.example .env

运行测试:

bun test

启动任意章节:

bun s01_agent_loop/code.ts
bun s07_skill_loading/code.ts
bun s20_comprehensive/code.ts

也可以通过根脚本运行复用 src/core 的共享核心版本:

bun run s01
bun run s05
bun run s20
bun run full

两套入口覆盖相同的学习路径:根目录章节便于逐文件阅读和对照上游,agents/ 入口便于复用、测试与扩展共享运行时。

Web Docs

生成展示数据并启动文档站:

bun run web:extract
bun run web:dev

构建文档站:

bun run web:build

Project Shape

s01_.../      Teaching entrypoints for each progressive stage
agents/       Shared-core entrypoints and the full harness
src/core/     Shared runtime, tools, managers, and scenario builders
docs/         English / Chinese / Japanese lesson notes
skills/       Example SKILL.md bundles used by s07
tests/        Bun test suite for core runtime and extraction
web/          Next.js documentation site

Learning Path

  1. s01 The Agent Loop
  2. s02 Tool Use
  3. s03 Permission System
  4. s04 Hooks System
  5. s05 Todo Write
  6. s06 Subagent
  7. s07 Skill Loading
  8. s08 Context Compact
  9. s09 Memory
  10. s10 System Prompt
  11. s11 Error Recovery
  12. s12 Task System
  13. s13 Background Tasks
  14. s14 Cron Scheduler
  15. s15 Agent Teams
  16. s16 Team Protocols
  17. s17 Autonomous Agents
  18. s18 Worktree Isolation
  19. s19 MCP Plugin
  20. s20 Comprehensive

Upstream And License

这个仓库是对上游项目 shareAI-lab/learn-claude-code 的 TypeScript/Bun 重构版。

  • 当前对齐版本记录在 upstream.json
  • 上游许可证:MIT
  • 上游版权声明:Copyright (c) 2024 shareAI Lab
  • 当前仓库保留原 MIT 许可通知,并将本仓库新增修改继续按 MIT 分发

分发或复制本仓库时,请一并保留根目录下的 LICENSENOTICE

Notes

  • 运行时默认使用 Bun。
  • 模型客户端默认接 Anthropic,读取 ANTHROPIC_API_KEYMODEL_ID
  • web/scripts/extract-content.ts 会从根目录的 TypeScript agent 源码和文档中生成展示数据,不再依赖旧的 Python 源目录。

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages