AI Skill Hub 推荐使用:开源AI工作流 是一款优质的Agent工作流。AI 综合评分 7.5 分,在同类工具中表现稳健。如果你正在寻找可靠的Agent工作流解决方案,这是一个值得深入了解的选择。
基于Kanban中心的Pi代理,使用token高效工具,安全防护,提高工作效率
开源AI工作流 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
基于Kanban中心的Pi代理,使用token高效工具,安全防护,提高工作效率
开源AI工作流 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:npm 全局安装 npm install -g agentcastle # 方式二:npx 直接运行(无需安装) npx agentcastle --help # 方式三:项目依赖安装 npm install agentcastle # 方式四:从源码运行 git clone https://github.com/SchneiderDaniel/agentcastle cd agentcastle npm install npm start
# 命令行使用
agentcastle --help
# 基本用法
agentcastle [options] <input>
# Node.js 代码中使用
const agentcastle = require('agentcastle');
const result = await agentcastle.run(options);
console.log(result);
# agentcastle 配置说明 # 查看配置选项 agentcastle --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export AGENTCASTLE_CONFIG="/path/to/config.yml"
Kanban-centred Pi agent with token-efficient tools, security guardrails, and efficient workflow enhancements. Docker + Pi AI — autonomous Kanban pipeline, sandboxed execution, real-time feedback.
---
cd flask_blogs git checkout -b worktree-git-issue-42-add-user-authentication git push -u origin worktree-git-issue-42-add-user-authentication cd ..
Everyone should build their own Pi. This repo is my personal Pi agent harness. Fork it as a starting point, but the real power comes from shaping it into your own — your preferred tools, your workflows, your guardrails.
Why? Every developer and every team is different. The most effective way of working with an AI coding harness is the one that fits your workflow, not a one-size-fits-all maximalist suite. A harness packed with every imaginable feature often gets in the way. The best harness is the one you build for yourself.
Customize ruthlessly. Make it yours.
---
git clone git@github.com:SchneiderDaniel/agentcastle.git
cd agentcastle
./agent-castle.sh
That's it. The wrapper script: 1. Builds the OCI image from docker/Dockerfile (first run, ~2 min; cached thereafter) 2. Starts the container with your repo bind-mounted, API keys loaded, and UID/GID mapped 3. Drops you into the Pi TUI inside the container
1. Clone the repo
git clone git@github.com:SchneiderDaniel/agentcastle.git && cd agentcastle
2. Configure API keys ```bash cp docker/agent_env.example .agent_env
┌────────────────────────────────────────────────────┐
│ Terminal (Docker) │
│ ┌──────────────────────────────────────────────┐ │
│ │ Pi TUI (Terminal) — agentcastle theme │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │ │
│ │ │ Exts │ │ AI Prov │ │ Rich Footer │ │ │
│ │ │ .pi/ │ │OpenCode │ │branch model │ │ │
│ │ │ exts/ │ │Go/... │ │tokens TPS │ │ │
│ │ └───┬──────┘ └──────────┘ └──────────────┘ │ │
│ │ │ │ │
│ └──────┼────────────────────────────────────────┘ │
└─────────┼───────────────────────────────────────────┘
│
┌────▼────────────────────────────┐
│ External tools │
│ ┌──────────┐ ┌───────────────┐ │
│ │ ctags │ │ ast-grep │ │
│ │map_code- │ │structural_ │ │
│ │base tool │ │search tool │ │
│ └──────────┘ └───────────────┘ │
│ ┌──────────┐ ┌───────────────┐ │
│ │ ripgrep │ │ crawl4ai │ │
│ │ripgrep_ │ │Python venv │ │
│ │search │ │(host browser) │ │
│ └──────────┘ └───────────────┘ │
└─────────────────────────────────┘
Key principle: All tools run locally. Web crawling runs on host (network-only for crawl). Ctags, ast-grep, ripgrep are system binaries invoked via pi.exec(). No MCP servers, no network-exposed tool endpoints.
This project deliberately avoids the Model Context Protocol (MCP). All tools are pi extensions — TypeScript files in .pi/extensions/ that run inside the agent's Node.js runtime. No external MCP servers, no network-exposed tool endpoints, no separate processes.
Two reasons: security and token efficiency.
🔒 Security: MCP servers introduce a new attack surface (OWASP maintains the MCP Top 10). Extensions treat tool execution as a function call. No network layer = no network attack surface.
📉 Token Efficiency: MCP servers expose full JSON Schema tool descriptions to the LLM on every request. Pi extensions use prompt snippets — concise one-line descriptions (~50-120 tokens vs ~300-800 for MCP). Full schema is only loaded when the tool is actually called. Saves thousands of tokens per turn.
| File/Path | What it is |
|---|---|
.pi/extensions/codebase-mapper.ts | map_codebase tool via universal-ctags |
.pi/extensions/structural-analyzer.ts | structural_search tool via ast-grep |
.pi/extensions/ripgrep-search.ts | ripgrep_search tool via ripgrep |
.pi/extensions/crawl4ai/ | web_crawl tool: local crawl4ai → Apify → HTTP fallback |
.pi/extensions/supervisor/ | Kanban-driven multi-agent orchestration |
.pi/extensions/context-info/ | Rich TUI status bar, welcome banner, TPS |
.pi/extensions/session-logger/ | Session logging to JSONL |
.pi/extensions/ask-user/ | Interactive MC questions + CSV logger |
.pi/extensions/caveman/ | Token-efficient communication protocol |
.pi/extensions/format-on-save/ | Auto Prettier + ESLint after write/edit |
.pi/extensions/lsp-auditor/ | LSP diagnostics pre-audit for supervisor |
.pi/extensions/piignore.ts | .piignore path blocking |
.pi/extensions/tsc-checkpoint.ts | /check command: tsc --noEmit |
.pi/agents/researcher.md | Researcher agent (pipeline step 1) |
.pi/agents/architect.md | Architect agent (pipeline step 2) |
.pi/agents/test-designer.md | TestDesigner agent (pipeline step 3) |
.pi/agents/developer.md | Developer agent (pipeline step 4) |
.pi/agents/auditor.md | Auditor agent (pipeline step 5) |
.pi/settings.json | Supervisor + context status bar config |
.pi/themes/agentcastle.json | Dark cyberpunk TUI theme |
.pi/prompts/issue-cutter.md | Epic → sub-issues with layer labels |
.pi/prompts/issue-refinement.md | Socratic interview + MC refinement |
.pi/prompts/extension-spec.md | Extension design PRD generator |
.pi/prompts/handover.md | Session handover document |
.pi/prompts/quiz-master.md | PR review quiz + auto-merge |
.piignore | Agent path blocking (gitignore syntax) |
AGENTS.md | Caveman protocol (active every session) |
scripts/setup-github-project.sh | Create GitHub Project from settings |
scripts/session-query.sh | Query JSONL session logs with jq |
Makefile | Deprecated — see ./agent-castle.sh for Docker-based launch |
test/ | 27+ unit/integration test files |
flask_blogs/ | Submodule: Flask blog apps |
Pi auto-discovers extensions from .pi/extensions/ in the project root. No config file needed. No --extension flag.
| Extension | Purpose |
|---|---|
| **Codebase Mapper** | map_codebase via universal-ctags. Returns symbol tree (classes, functions, variables) grouped by file. |
| **Structural Analyzer** | structural_search via ast-grep. AST-aware pattern matching (function calls, try/catch, class defs). |
| **Ripgrep Search** | ripgrep_search via ripgrep. Fast literal/regex code search, respects .gitignore. |
| **Supervisor** | Kanban-driven multi-agent pipeline. Reads issue from GitHub project, dispatches agents in loop. Registers /supervisor <issue-number> command. |
| **Web Crawler** | web_crawl: local crawl4ai → Apify cloud → HTTP fallback. Auto-installs venv + Chromium deps. |
| **Context Info** | Rich TUI status bar (branch, model, tokens, TPS), welcome banner, animated working indicator. |
| **Session Logger** | Logs sessions to .pi/sessions/<id>.jsonl. Generates .md reports with sub-agent output from supervisor pipeline. Toggle with /session-logger. Query with scripts/session-query.sh. |
| **Caveman Protocol** | Token-efficient communication. Active via AGENTS.md. Configurable intensity levels. |
| **Ask User** | Interactive MC picker for AI-to-user questions. Uses arrow-key navigation + CSV logging. |
| **Format on Save** | Auto-formats TS/JS with Prettier + ESLint --fix after write/edit. Non-blocking lint warnings. |
| **PiIgnore** | Blocks paths matching .piignore patterns from read/write/edit/bash. Supports negation (!). |
| **TSC Checkpoint** | /check command runs tsc --noEmit on worktree. Used in pipeline Implementation→Audit. |
| **LSP Auditor** | Runs real LSP diagnostics on modified files before merge. Groups by server, auto-retry (max 3). Called by supervisor. |
Agents are Markdown files in .pi/agents/ with YAML frontmatter. The supervisor reads them at runtime.
| Agent | File | Tools |
|---|---|---|
| **Researcher** | researcher.md | read, bash, structural_search, ripgrep_search |
| **Architect** | architect.md | read, bash, structural_search, ripgrep_search |
| **TestDesigner** | test-designer.md | read, bash, structural_search, ripgrep_search |
| **Developer** | developer.md | read, bash, write, edit, structural_search, ripgrep_search |
| **Auditor** | auditor.md | read, bash, structural_search, ripgrep_search |
All agents use opencode-go/deepseek-v4-flash model. Developer additionally uses format-on-save and tsc-checkpoint extensions.
Invocable via /name in Pi's editor:
| Template | Usage | What it does |
|---|---|---|
| **issue-cutter** | /issue-cutter <number> | Split epic into ordered, testable sub-issues with layer labels. Auto-links children to parent via GraphQL. |
| **issue-refinement** | /issue-refinement <number> | Grill issue against codebase, Socratic interview via ask_user (≥3 MC options), replace body with concrete ACs. |
| **extension-spec** | /extension-spec <idea> | Design new extension or refactor existing one. Researches pi docs, audits TypeScript, produces PRD. |
| **handover** | /handover | Write handover doc summarizing conversation. Saves to tmp/ with datetime prefix. |
| **model-select** | /model-select <objective> | Research + recommend models per agent role. Crawls providers, benchmarks, pricing. Three objectives: cost-optimized, performance-optimized, balanced. Applies model: field in agent files. |
| **quiz-master** | /quiz-master | List open PRs across repo + submodules, quiz reviewer on diff with MC questions, auto-merge if score ≥80%. |
Empirical token consumption comparing tool configurations on a real audit task ("Audit test coverage of chart/figure generation methods"). Config 4 (ripgrep) is the most token-efficient tool-enabled config.
| Config | Avg Input | Avg Output | Avg Total | Avg Duration | vs Config 2 (total) |
|---|---|---|---|---|---|
| 1 — no tools | 15 | 959 | 1,870 | 15,842ms | — |
| 2 — mapper | 14,958 | 7,028 | 281,506 | 76,133ms | baseline |
| 3 — mapper + structural | 24,264 | 5,056 | 299,784 | 62,461ms | +6% |
| **4 — mapper + structural + rg** | **15,248** | **4,131** | **204,532** | **51,345ms** | **-27%** |
Config 4 uses 27% fewer total tokens and runs 33% faster than mapper-only (config 2). The ripgrep fix resolved the earlier issue where ripgrep made token consumption worse.
The agent footer also shows a TPS (tokens-per-second) gauge during streaming, computed from a rolling 30s window, plus worktree name in brackets next to the branch when inside a git worktree.
Run withscripts/benchmark-tools.sh(2 runs per config). Results saved toscripts/benchmark-results/.
Currently no skills installed (.pi/skills/.gitkeep). Skills are used sparingly in this project — every skill's description injects ~50-150 tokens into the context window on every turn, causing context rot. Prefer extensions (concise prompt snippets) or prompt templates (lazy-loaded) over skills.
---
For users who prefer a host-level install (Node.js, apt packages, Pi on bare metal), the original install scripts are preserved in scripts/legacy/:
| File | Purpose |
|---|---|
scripts/legacy/install.sh | Automated apt + npm install for Ubuntu/Debian hosts |
scripts/legacy/postinstall.sh | Patch Pi footer pipe separator |
These scripts are deprecated — the Docker workflow is the supported path. They remain for reference and for users who cannot run Docker.
**3. Launch**bash ./agent-castle.sh
**4. Set provider (first session only)**bash pi --provider opencode-go --api-key "your-key" ``` Exit with Ctrl+C twice. The provider is persisted in .pi/settings.json.
./agent-castle.sh runs docker compose up with: - Image built from docker/Dockerfile (Debian 12-slim, Node.js 22, Python 3, ctags, ripgrep, ast-grep, pi, gosu) - Repo root bind-mounted to /workspaces/main inside the container - .agent_env file mounted and sourced automatically - Host UID/GID mapped to container user agentuser (no permission issues with bind mounts) - Interactive TTY for the Pi TUI
---
The supervisor (/supervisor <issue-number>) is the heart of this harness. It takes a GitHub issue, runs it through 5 agent stages in a Kanban loop, creates git worktrees, runs quality gates, and creates pull requests — all autonomously.
┌─────────────────────────────────────────────────────────────────────────┐
│ GITHUB PROJECT BOARD │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────┐ ┌─────────┐ │
│ │ Research │ │Architect.│ │TestDesign│ │Implement. │ │ Audit │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ └──────┬───────┘ └────┬────┘ │
│ │ │ │ │ │ │
└───────┼─────────────┼────────────┼──────────────┼──────────────┼───────┘
│ │ │ │ │
┌────────▼────────┐ ┌──▼────────┐ ┌─▼───────────┐ │ ┌─────────▼──────┐
│ Researcher │ │ Architect │ │ TestDesigner │ │ │ Auditor │
│ crawls web │ │ proposes │ │ writes │ │ │ reviews │
│ for best │ │ target │ │ test plan │ │ │ implements │
│ practices, │ │ architec- │ │ from archi- │ │ │ creates PR │
│ lib versions, │ │ ture │ │ tecture │ │ │ or rejects │
│ pitfalls │ │ │ │ │ │ │ │
└────────┬────────┘ └──┬────────┘ └─┬───────────┘ │ └────────┬───────┘
│ │ │ │ │
▼ ▼ ▼ │ ▼
GitHub Comment GitHub Comment GitHub Comment │ GitHub Comment
## Research ## Architectu- ## Test Plan │ ## Audit Approved
Findings re Approach │ + PR created
│
┌───────────────────────────────┘
│
▼
┌──────────────────────┐
│ QUALITY GATES │
│ ┌────────────────┐ │
│ │ TSC --noEmit │──│──→ pass → continue
│ │ (tsc-checkpoint)│ │ fail → back to Implementation
│ └────────────────┘ │
│ ┌────────────────┐ │
│ │ LSP pre-audit │──│──→ pass → continue
│ │ (lsp-auditor) │ │ fail → back to Implementation
│ │ │ │ (max 3 retries)
│ └────────────────┘ │
└──────────────────────┘
│
▼
┌──────────────────────┐
│ Auditor decision │
│ ┌──────────────┐ │
│ │ APPROVED? │──│──→ Yes → Create PR → DONE
│ │ │ │ No → back to Implementation
│ └──────────────┘ │
└──────────────────────┘
│
▼
┌──────────────────────┐
│ POST-PIPELINE │
│ Check PR for │
│ merge conflicts │
│ Auto-merge or │
│ dispatch Developer │
└──────────────────────┘
Loop rules: - Each agent posts a structured GitHub comment on the issue - Supervisor reads the agent's output for a completion marker to know the agent finished - If agent times out, supervisor logs it and stops - Auditor can reject → sends back to Implementation (counts as 1 rejection) - LSP/TSC errors → sends back to Implementation (does NOT count as rejection, max 3 retries) - maxRejections (default 5) stops the loop to prevent infinite cycles
| # | Agent | Entry Marker | Completion Marker | Tools | Thinking | Role |
|---|---|---|---|---|---|---|
| 1 | **Researcher** | Research | RESEARCH_COMPLETE | read, bash, structural_search, ripgrep_search | medium | Crawls 3-5 web pages on issue topic, synthesizes findings. Posts ## Research Findings. Never makes recommendations. |
| 2 | **Architect** | Architecture | ARCHITECTURE_COMPLETE | read, bash, structural_search, ripgrep_search | high | Applies Clean Architecture, PEAA, Philosophy of Software Design principles. Proposes target architecture. |
| 3 | **TestDesigner** | TestDesign | TEST_PLAN_COMPLETE | read, bash, structural_search, ripgrep_search | medium | Writes test plan: unit, integration, characterization tests. |
| 4 | **Developer** | Implementation | IMPLEMENTATION_COMPLETE | read, bash, write, edit, structural_search, ripgrep_search | low | Implements code in pre-created worktree, commits, pushes. Handles submodule changes. |
| 5 | **Auditor** | Audit | AUDIT_APPROVED or AUDIT_REJECTED | read, bash, structural_search, ripgrep_search | medium | Reviews code against architecture + test plan. Creates PR if approved, or rejects with specifics. |
Each issue gets an isolated git worktree. This prevents agents from interfering with each other and keeps main clean.
Branch naming: worktree-git-issue-<number>-<title-slug> (e.g., worktree-git-issue-42-add-user-authentication)
Worktree path: ../worktree-git-issue-<number>-<title-slug>/
Lifecycle (supervisor-owned):
1. Supervisor creates worktree before Developer dispatch
└── git worktree add -b <branch> ../<branch> <defaultBranch>
2. Supervisor dispatches Developer agent with cwd=<worktree-path>
└── Agent tools (write, edit, bash, read) resolve against worktree
3. Developer implements, commits, pushes (inside worktree via cwd)
├── git add -A
├── git commit -m "feat(#42): Add user auth"
└── git push origin <branch>
4. Supervisor dispatches Auditor agent with same cwd=<worktree-path>
└── git diff <defaultBranch>
5. On approval: Auditor creates PR
└── gh pr create --repo owner/repo --base <defaultBranch> --head <branch> --title "feat(#42): ..." --body "Closes #42"
6. Post-pipeline: supervisor cleans up worktree
├── git worktree remove --force ../<branch>
├── git worktree prune
└── git branch -D <branch>
Key rules: - Worktree is created and owned by the supervisor pipeline — agents never create or remove worktrees - Agent cwd is set to worktree path automatically — no cd needed in agent tasks - All Git operations happen inside the worktree (tools resolve against cwd) - Worktree persists across feedback loops (auditor reject → re-implement) - Supervisor cleans up worktree after pipeline completes (success, failure, or stop) - Configurable via supervisor.worktreeBase and supervisor.branchPrefix in .pi/settings.json
When the repo has submodules, the Developer works on both repos simultaneously using a matched-branch pattern:
Main repo (agentcastle) Submodule (flask_blogs)
│ │
├─ Branch: worktree-git-... ├─ Branch: worktree-git-... (same name)
├─ Commit includes submodule ├─ Actual code changes
│ pointer update (pinned SHA) │
└───────────────────────────────┴───────────────────────────────
Detailed workflow:
```
git submodule update --init --recursive
cd flask_blogs git add -A && git commit -m "feat(#42): Add user auth" git push origin worktree-git-issue-42-add-user-authentication cd ..
git add -A git commit -m "feat(#42): Add user auth" git push origin worktree-git-issue-42-add-user-authentication
**Why submodule must be pushed first:** The agentcastle commit records a specific submodule SHA. If that SHA only exists locally, teammates get `fatal: reference is not a tree`. The `push.recurseSubmodules check` config blocks the push if submodule commits haven't been pushed — a safety net, not a replacement for correct order.
**Why submodules start in detached HEAD:** Git submodules pin a specific commit, not a branch. `git submodule update` checks out that exact commit. You must explicitly checkout a branch to make editable changes — standard Git behavior.
**Result:** Two branches with same name exist:
- `agentcastle:worktree-git-issue-42-add-user-authentication`
- `flask_blogs:worktree-git-issue-42-add-user-authentication`
**Disk usage note:** Each worktree clones submodules independently (under `.git/worktrees/<name>/modules/`). Not shared across worktrees — known Git design tradeoff.
**Auditor PR creation order:**
Step 1 — Create submodule PR FIRST (if submodule has changes): cd flask_blogs gh pr create --repo owner/flask_blogs --base main --head <branch> --title "feat(#42): ..."
Step 2 — Create main repo PR SECOND (includes submodule pointer): gh pr create --repo owner/agentcastle --base main --head <branch> --title "feat(#42): ..." --body "Closes #42"
#### 8.5 Quality Gates
Before transitioning `Implementation → Audit`, the supervisor runs two checks on the worktree:
**1. TSC Checkpoint** (`tsc-checkpoint` extension)
- Runs `npx tsc --noEmit` on the worktree
- Only runs if `tsconfig.json` exists
- Non-blocking if tsc binary not found
**2. LSP Pre-Audit** (`lsp-auditor` extension)
- Runs real LSP diagnostics on **modified files only** (git diff vs `defaultBranch`)
- Groups files by language server (TypeScript, Python, ESLint, etc.)
- Each group audited concurrently via separate LSP server process
- Auto-retries on errors (max 3 attempts), exponential backoff
- Only blocks if LSP server is available AND reports errors
**Decision table:**
| TSC | LSP | Outcome |
|-----|-----|---------|
| pass | pass | → Audit |
| pass | fail | → Implementation (retry LSP, max 3) |
| pass | N/A (no LSP) | → Audit |
| fail | (skipped) | → Implementation |
| N/A (no tsconfig) | pass | → Audit |
#### 8.6 Merge Conflict Resolution
After pipeline reaches `Done`, supervisor checks the created PR for merge conflicts:
PR created (pipeline done) └─ gh pr view ... --json mergeable ├─ No conflict → done └─ Conflict? └─ Ask user: fix? (ctx.ui.confirm) ├─ Yes → auto-merge attempt (git merge base) │ ├─ Success → git push → done │ └─ Fail → dispatch Developer agent to resolve └─ No → done
#### 8.7 GitHub Interaction
The supervisor interacts with GitHub on every step:
| Action | Method | Purpose |
|--------|--------|---------|
| `gh issue view <N> --json ...` | pi.exec | Fetch issue data (pre-filtered to trusted codeowners) |
| `gh project view <projectNumber> ...` | pi.exec | Get field IDs for status options |
| `gh project item-list <projectNumber> ...` | pi.exec | Find issue's project item, read current status |
| `gh api graphql ...` (set status) | pi.exec | Move issue to next status on board |
| `gh issue comment <N> --repo <R> --body <B>` | pi.exec | Agent posts structured comment |
| `gh pr create --repo <R> --base <B> --head <H>` | pi.exec | Auditor creates PR on approval |
| `gh pr view <branch> --json ...` | pi.exec | Post-pipeline merge conflict check |
**Security:** All issue data is **pre-filtered** before reaching agents — only the body (if author is a codeowner) and comments from trusted codeowners are passed. The agent is explicitly instructed: "Use ONLY the issue data provided above. Do NOT run `gh issue view`." This prevents prompt injection via untrusted issue comments.
#### 8.8 Configuration Reference
All supervisor settings in `.pi/settings.json` under the `supervisor` key:
jsonc { "supervisor": { "repo": "SchneiderDaniel/agentcastle", // REQUIRED — owner/repo format "projectNumber": 3, // REQUIRED — GitHub Project (v2) number "statusMapping": { // REQUIRED — board status → agent file "Research": "researcher", "Architecture": "architect", "TestDesign": "test-designer", "Implementation": "developer", "Audit": "auditor" }, "codeowners": ["SchneiderDaniel"], // REQUIRED — trusted GitHub usernames "statusField": "Status", // Single-select field on project board "maxRejections": 5, // Max Auditor rejections before loop stops "remote": "origin", // Remote name for git push "defaultBranch": "main", // Worktree base and PR target "worktreeBase": "../", // Parent dir for worktrees "branchPrefix": "worktree-git-issue-", // Prefix for auto-generated branch names "agentTimeoutsMin": { // Per-agent timeout (optional) "researcher": 10, "developer": 30 }, "submodules": [ // Auto-parsed from .gitmodules if absent { "path": "flask_blogs", "repo": "Owner/flask_blogs" } ] } }
#### 8.9 Complete Walkthrough
Here's what happens end-to-end when you run `/supervisor 42`:
You: /supervisor 42
── Step 1: Fetch ──────────────────────────────────────────────── Supervisor reads .pi/settings.json → repo, project board, statuses Fetches issue #42 from GitHub, filters to trusted codeowners only Reads issue's current status from project board → "Research"
── Step 2: Researcher ─────────────────────────────────────────── Spins up agent with researcher system prompt + issue data Agent crawls 3-5 web pages about the issue topic Posts: gh issue comment 42 --repo owner/repo --body "## Research Findings..." Outputs: RESEARCH_COMPLETE Supervisor moves issue → "Architecture" on board
── Step 3: Architect ──────────────────────────────────────────── Spins up agent with architect prompt + issue + research findings Analyzes codebase using read, bash, structural_search, ripgrep_search Proposes architecture following Clean Architecture + PEAA principles Posts: gh issue comment 42 --body "## Architecture Approach..." Outputs: ARCHITECTURE_COMPLETE Supervisor moves issue → "TestDesign"
── Step 4: TestDesigner ───────────────────────────────────────── Spins up agent with test-designer prompt + issue + architecture Writes test plan: unit, integration, characterization tests Posts: gh issue comment 42 --body "## Test Plan..." Outputs: TEST_PLAN_COMPLETE Supervisor moves issue → "Implementation"
── Step 5: Developer ──────────────────────────────────────────── Supervisor creates worktree: git worktree add -b <branch> ../<branch> main Spins up agent with developer prompt + issue + arch + test plan, cwd=<worktree-path> Implements feature, runs tests, formats code git add -A && git commit -m "feat(#42): ..." git push origin <branch> Outputs: IMPLEMENTATION_COMPLETE
── Step 6: Quality Gates ──────────────────────────────────────── TSC: runs npx tsc --noEmit on worktree → pass LSP: runs diagnostics on modified files → pass Supervisor moves issue → "Audit"
── Step 7: Auditor ────────────────────────────────────────────── Spins up agent with auditor prompt + all previous data, cwd=<worktree-path> git diff main (reviews changes) Reviews against architecture + test plan Decision: APPROVED ✔ Creates submodule PRs if needed Creates main PR: gh pr create --repo owner/repo --head <branch> --title "feat(#42): ..." Posts: ## Audit Approved Outputs: AUDIT_APPROVED Supervisor moves issue → "Done"
── Step 8: Post-pipeline ──────────────────────────────────────── Checks PR for merge conflicts If conflicted → asks you if you want to auto-fix If yes → attempts auto-merge If auto-merge fails → dispatches Developer to resolve
── Done ───────────────────────────────────────────────────────── Issue #42 is complete with a PR ready for final review. ```
Note: The walkthrough above shows the updated pipeline: dependency gate, in-process agent execution (live TUI widget), architecture-before-research sequence, auditor summary file protocol, and post-pipeline merge conflict resolution.
---
Rebuild the image without cache:
docker compose build --no-cache
./agent-castle.sh
The extension auto-installs system libraries inside the container. If it persists:
rm -rf .pi/crawl4ai-venv .pi/chromium-deps # Next call auto-recreates
UID/GID mapping is automatic via agent-castle.sh. If you need to run manually:
HOST_UID=$(id -u) HOST_GID=$(id -g) docker compose up
gh auth status shows "not logged in"Inside the container, run:
gh auth login
Authenticate with Login with a web browser.
.piignore blocking legitimate pathsEdit .piignore and add a negation pattern:
!path/to/allow Reload: /reload
---
该项目提供了一个开源的AI工作流解决方案,使用TypeScript编写,具有Kanban中心的Pi代理和token高效工具,安全防护,提高工作效率。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
总体来看,开源AI工作流 是一款质量良好的Agent工作流,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | agentcastle |
| 原始描述 | 开源AI工作流:Kanban-centred Pi agent with token-efficient tools, security guardrails, and eff。⭐7 · TypeScript |
| Topics | workflowtypescript |
| GitHub | https://github.com/SchneiderDaniel/agentcastle |
| License | MIT |
| 语言 | TypeScript |
收录时间:2026-05-22 · 更新时间:2026-05-23 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端