Repository navigation
Onboard existing codebases: analyze code, record existing features, plan new ones (#134) - #303
zwanski-start wants to merge 6 commits into
Conversation
- New onboard-project skill: explore an existing codebase, confirm the
understanding with the user, write app_spec.txt, record existing
functionality as passing features, then plan new pending features
- ExpandChatSession gains a mode ('expand' | 'onboard'); onboard mode
may write only app_spec.txt, enforced by a PreToolUse hook
- Expand WebSocket accepts ?mode=onboard and skips the spec requirement
- feature_create_bulk accepts an optional per-feature 'passes' flag
- Count feature_create_bulk results so the chat reports created features
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#134) - New project wizard gets an 'Import Existing Codebase' setup method - Project Setup Required screen gets an 'Import Existing Code' option - ExpandProjectChat/useExpandChat accept mode='onboard' (?mode=onboard) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mcp 2.x renamed FastMCP to MCPServer; a fresh install of the transitive dependency breaks mcp_server/feature_mcp.py (and test_onboard_project.py). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
) Registering a folder scaffolds a template app_spec.txt, which counts as a spec, so the Project Setup Required screen (and its import card) never appeared for projects added on top of existing code. Show the onboarding entry point whenever the project has no features yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🔍 QA report: ✅ PassedTester: Ada (cubefarm agent, in a fresh session) · Round: 2 · Author: Guido The onboarding flow works and meets issue #134: an existing codebase can be imported from the new-project wizard, the Project Setup screen, or the empty Kanban board, and it opens an onboard-mode chat that analyses the code, writes app_spec.txt, records existing features as passing and plans new ones. A PreToolUse hook limits writes to app_spec.txt, Bash stays denied, and feature_create_bulk's new 'passes' flag defaults to false and rejects non-booleans. ruff, the security tests, the 8 new tests, the UI build and lint all pass; the mypy and pytest failures are the same as on master, and with no Claude CLI it shows a clear error.
🧪 Commands run
No browser screenshots were taken in this round. Posted by cubefarm · merges automatically once GitHub's checks pass |
…features Adaptations (plan Change 4.9, combined with my-features import): onboard mode and its spec-only write hook taken; 'passes': true is accepted by feature_create_bulk only when the feature MCP server runs with AUTOFORGE_ONBOARD_SESSION=1, which only the onboarding session sets (user decision 1A; initializer, assistant and expand sessions get an error). Onboarding refuses a symlinked app_spec.txt and the hook compares against the symlink-free path at write time. Kept my-features' features_created parsing (Phase 1) instead of the PR's second counter, the system-prompt file (AutoForgeAI#316) and web tools; onboard mode gets its own tools note. Not taken: NewProjectModal changes and the mcp requirement pin. Our import wizard offers 'Analyze with AI' for plain codebases: it registers the folder and opens the onboarding chat. Integrates AutoForgeAI#303 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeH26pcsqoxPb3CDs8g1VN
Closes #134
What changed
Adds an Import Existing Codebase onboarding flow for folders that already contain code. Claude:
.autoforge/prompts/app_spec.txtdescribing the app as it exists today.Because features now exist, pressing Play starts the normal coding agent (not the initializer) on the existing code.
Entry points
Backend
.claude/commands/onboard-project.md(also usable as/onboard-projectin Claude Code).ExpandChatSessiongainsmode: "expand" | "onboard". The expand WebSocket accepts?mode=onboardand skips the "spec must exist" check in that mode. The unmodified scaffoldapp_spec.txttemplate is removed so Claude can write the spec fresh.app_spec.txt, so user source code can't be modified. Bash stays denied.feature_create_bulkaccepts an optional per-feature"passes": true. The default is unchanged (false), and non-boolean values are rejected.feature_create_bulkresults and emitsfeatures_created. Previously this counter was never updated, in the existing Expand chat as well.How I verified it
ruff check .passes, and so dopython test_security.py, the newtest_onboard_project.py(write hook incl. traversal, result parsing,passesflag) and the client, dependency-resolver and WebSocket tests.ui:npm run lintshows only warnings that were already there, andnpm run buildsucceeds.app_spec.txtand created pending features. The project's source file was left unchanged.Assumptions / notes
specMethod: 'manual'(which scaffolds prompts) before onboarding.spec_methodisn't used server-side.QA round 1 follow-up
app_spec.txt, whichcheck_spec_existscounts as a spec. So the "Project Setup Required" screen, and its Import card, never showed for a project added on top of existing code. The empty Kanban board's Pending column now shows an Import Existing Code button whenever the project has no features. Once onboarding removes the template, the setup screen also shows the Import card. I didn't changecheck_spec_existson purpose: it is shared with thestart.pyCLI.mcp>=1.0.0,<2.0.0pinned inrequirements.txt/requirements-prod.txt. A fresh install now pulls mcp 2.x, which renamedFastMCP, and that brokemcp_server/feature_mcp.pyandtest_onboard_project.pyat import time.ruff check .,python test_security.py, pytesttest_onboard_project.py test_client.py test_dependency_resolver.py test_rate_limit_utils.py(63 passed),npm run lint(0 errors),npm run build. Browser check on port 5820 with an isolated HOME: the Kanban button opens the onboarding chat (?mode=onboard), the scaffold template is deleted, the stub source is untouched, and the setup screen shows three cards. The Claude turn itself wasn't re-run, because the isolated HOME has no login.🤖 Generated with Claude Code