| name | rootbuild |
| description | New-feature build mode that respects existing patterns and never merges without tests. Use when user wants to add a new feature (not fix bugs, not refactor) โ new API endpoint, new module, new functionality. Forces requirement clarification, existing-pattern survey, design proposal, and test-coupled implementation before any code is written. |
| triggers | ["๊ธฐ๋ฅ ์ถ๊ฐ","๊ธฐ๋ฅ ์ถ๊ฐํด์ค","์ ๊ธฐ๋ฅ","์ ๊ท ๊ธฐ๋ฅ","์๋ก์ด ๊ธฐ๋ฅ","์ถ๊ฐํด์ค","์ถ๊ฐํ๊ณ ์ถ์ด","๋ง๋ค๊ณ ์ถ์ด","๊ตฌํํด์ค","๊ตฌํํ๊ณ ์ถ์ด","๋น๋ํด์ค","build","implement","add feature","new feature","์ด๋ฐ ๊ธฐ๋ฅ","์ด๋ฐ๊ฑฐ ๋ง๋ค๊ณ ","๋ฃจํธ๋น๋","rootbuild"] |
rootbuild โ Pattern-Respecting Build Mode
Add a new feature. But be a citizen of the existing codebase. Don't introduce new patterns. Don't merge without tests. Don't bundle multiple features in one PR.
Activation
Explicit: /rootbuild
Auto-triggers:
- "๊ธฐ๋ฅ ์ถ๊ฐ", "์ ๊ธฐ๋ฅ", "์ ๊ท ๊ธฐ๋ฅ"
- "์ถ๊ฐํด์ค", "๊ตฌํํด์ค", "๋ง๋ค์ด์ค"
- "์ด๋ฐ ๊ธฐ๋ฅ ๋ฃ์ด์ค"
- "X ๊ฐ์ ๊ฑฐ ๋ง๋ค์ด์ค"
- "build", "implement", "add feature"
Note: When the user explicitly invokes another skill (e.g., "autopilot์ผ๋ก ๋ง๋ค์ด์ค"), rootbuild stays inactive. autopilot builds from scratch; rootbuild slots into existing code.
What's Different (vs general / autopilot)
| General Mode | rootbuild | autopilot |
|---|
| Introduce new patterns freely | Follow existing patterns | Design from scratch OK |
| Tests later | Tests must be paired with code | Auto QA cycle |
| Bundle multiple features in one PR | One PR = one feature | Build big features whole |
| Add dependencies freely | User approval required | Auto-add allowed |
| Works = good enough | Verify no existing breakage | Multi-perspective review |
The Two Anti-Patterns (encoded by real experience)
A. "Ignore existing patterns, introduce new ones"
The most common and most damaging anti-pattern. The #1 reason codebases become inconsistent over time.
Python signal:
@app.get("/users/{id}")
def get_user(id: int, db: Session = Depends(get_db)):
return db.query(User).filter(User.id == id).first()
db_connection = create_engine(...)
@app.get("/products/{id}")
def get_product(id: int):
with db_connection.connect() as conn:
return conn.execute(...).fetchone()
Mitigation:
- Always grep first: find how similar features are implemented
grep -rn "@app.get" . (FastAPI pattern)
grep -rn "class.*Service" . (Service pattern)
- Confirm pattern via 3+ examples before extracting it
- New code follows that pattern exactly
- If existing pattern is truly bad โ exit rootbuild, fix via rootclean first
B. "Merge without tests"
"I'll add them later" โ never happens. Regressions can't be caught.
Python signal:
- PR has N new functions, 0 new tests
- Existing
test_*.py exists, new module missing
- Only "I ran it manually" in PR description
Mitigation:
- One commit = function + test always paired
- Use pytest fixtures (follow existing patterns)
- Minimum 3 cases:
- Happy path
- Edge case (boundary, empty, null)
- Error path
- Mocks follow project conventions (
unittest.mock vs pytest-mock)
Python Pattern Checklist
Before adding new feature, check via grep:
| Item | Grep command | Check |
|---|
| API pattern | grep -rn "@app.\(get|post\)" | FastAPI? Flask? Django? |
| DB access | grep -rn "Session|engine|cursor" | SQLAlchemy ORM? Raw SQL? |
| Auth | grep -rn "Depends|@require|auth" | What middleware? |
| Error handling | grep -rn "raise HTTPException|class.*Error" | Custom exception? HTTPException? |
| Logging | grep -rn "logger|logging|print" | structlog? standard logging? |
| Config | grep -rn "os.environ|settings|Config" | pydantic-settings? dotenv? |
| Tests | grep -rn "fixture|conftest" | pytest fixture location? |
| Type hints | grep -rn ": .*->|TypedDict" | How much typing? |
| async | grep -rn "async def|asyncio" | sync or async? |
| Dependencies | cat pyproject.toml | requirements.txt | Available packages? |
6-Step Workflow
1. Requirement Clarification โ Ask immediately if vague
Preferred workflow: systematic (requirements โ design โ implementation). Never jump to code.
Question priority:
- What: exact input/output? (1-2 example data points)
- Who: auth needed? permissions?
- When: sync? async? batch?
- How: part of existing domain or new?
- On failure: how to handle? retry? error?
If answers are vague, ask again, don't guess. autopilot's deep-interview philosophy.
2. Existing Pattern Learning โ Force grep
Once requirements are clear, immediately grep:
- Similar feature exists? (if yes, follow its structure exactly)
- API style? DB access? Error handling?
- Where are tests? How?
- New dependency needed? (if yes, check for existing similar package first)
Confirm via 3+ examples before extracting a pattern. 1 example might be a fluke.
3. Design Proposal โ Show before writing code
Show the user:
- New file location:
services/notifications.py (existing services/ pattern)
- Function signature: input/output types
- Dependency graph: which existing modules to import?
- Impact scope: which existing functions are affected?
- Pattern match: "Same structure as existing user_service.py"
- Test plan:
test_notifications.py โ happy/edge/error cases
Never write code without user approval.
4. Incremental Implementation โ Inside out
Implementation order:
- Types/Schema first: Pydantic model, TypedDict, dataclass
- Tests first (optional): write failing test โ make it pass
- Pure functions first: I/O-free logic
- I/O integration: DB, API, external calls
- Endpoint/Entry point: HTTP route, CLI command, Lambda handler
Each step paired with 1+ test. No "test after everything's done".
5. Integration Verification โ No breakage
Don't only check the new feature. Verify:
- All tests:
pytest passes all
- Type check:
mypy passes (if used)
- Lint:
ruff check passes
- Manual check: new feature 1x + critical existing scenario 1x
pytest
pytest -k new_feature
mypy .
ruff check .
6. PR Separation โ 1 feature = 1 PR
Don't mix in one PR:
- โ "feature add + bug fix + refactor"
- โ
PR 1: feature add only
- โ
PR 2: bug fix โ rootfix
- โ
PR 3: refactor โ rootclean
PR description must include:
- What was added
- Which existing pattern was followed (file path explicit)
- How tests were done
- Dependency additions (if any, with reason)
Anti-Patterns (Forbidden in this mode)
- Write code without grep โ Always grep first
- Introduce new patterns โ "This is more modern" rejected. Separate PR via rootclean.
- No-test implementation โ "Urgent, just do it" absolutely forbidden
- Multiple features in one PR โ "While I'm here" forbidden
- Unauthorized dependencies โ New package = explicit user approval
- Guess vague requirements โ Ask, don't guess
- Manual test = OK โ "I ran it once" โ verification
Output Format
When receiving a feature request, answer in this order:
[Requirement Check]
- Input: <type + example>
- Output: <type + example>
- Auth/permissions: <required?>
- On failure: <handling>
(If vague โ ask, continue after answer)
[Existing Pattern Survey]
grep results:
- API pattern: <FastAPI Depends, ref services/user.py>
- DB access: <SQLAlchemy session, repositories/ pattern>
- Error handling: <HTTPException used>
- Tests: <pytest fixture in conftest.py>
[Design Proposal]
New file: <path>
Signature: <function/endpoint>
Dependencies: <existing imports only / no new packages>
Impact: <which existing code is affected>
Test plan: <file name + 3 cases>
Proceed?
Termination Conditions
Exit rootbuild mode only when ALL of:
- Requirements unambiguous
- Existing pattern grep done + new code follows it
- Design approved by user
- Tests written alongside code (paired commit)
- All tests + types + lint pass
- PR scope is one feature
Notes
- This skill encodes anti-patterns observed in Python (Lambda, FastAPI, AI/ML) work: introducing new patterns instead of following existing ones, and merging without tests.
- Preferred workflow: requirements clarification โ design โ implementation (systematic).
- Pair with rootfix and rootclean. rootfix changes behavior (bug fixes), rootclean preserves behavior (cleanup), rootbuild adds (new features). Don't mix.
- Small features โ regular conversation. Activate this for medium+ feature additions (1+ file).
- Bigger greenfield projects โ autopilot is better (rootbuild is for slotting into existing code).
- Works in any project. Global skill.