| name | aidlc-build-and-test |
| description | Use when code implementation is complete and needs to be built, tested, and verified before completion. |
| metadata | {"version":"0.5.0","author":"Jay","category":"ai-dlc-workflow","invoke_mode":"orchestrator-only","return_behavior":"stop-no-gate","output_path":"devflow-docs/construction/build-and-test/","skill_nature":"compensation","lifecycle":"active","model_dependency":"๋ชจ๋ธ์ด ๋น๋/ํ
์คํธ๋ฅผ ์คํ ์์ด 'ํต๊ณผ'๋ก ์ ์ธํจ"} |
aidlc-build-and-test
Purpose
Execute build and full test suite after all units are implemented, then generate reference instructions for future use.
Execute
Step 1: ํ๋ก์ ํธ ๋ถ์
๋ค์์ ํ์ธํ์ฌ ๋น๋/ํ
์คํธ ํ๊ฒฝ์ ํ์
ํ๋ค:
- ๋น๋ ์ค์ ํ์ผ โ
package.json, go.mod, Cargo.toml, pyproject.toml, pom.xml
- ์์ค ํ์ผ โ
.py, .go, .ts, .js, .rs, .java
- Code plans โ
devflow-docs/construction/*/code-plan.md์์ ์์ฑ๋ ํ์ผ ๋ชฉ๋ก
- units.md โ
devflow-docs/inception/units.md (์์ผ๋ฉด) โ unit ๊ฐ ํตํฉ ํฌ์ธํธ
- Verification Contract โ
devflow-docs/construction/{unit}/code-plan.md์ ## Verification Contract ์น์
์ ํ์ธํ๋ค. ์น์
์ด ์์ผ๋ฉด ๊ฒ์ฆ ๋ช
๋ น์ Step 3์์ ์ฐ์ ์ฌ์ฉํ๋ค. ์น์
์ด ์์ผ๋ฉด ๊ธฐ์กด ๋์(ํ๋ก์ ํธ ํ์
์๋ ๊ฐ์ง)์ ์ ์งํ๋ค. auto-fix ํ ์ฌ์คํ ์์๋ Verification Contract์ ๊ฒ์ฆ ๋ช
๋ น ์ ์ฒด๋ฅผ ๋ค์ ์คํํ๋ค.
Step 2: ๋น๋ ์คํ
- ๋น๋ ๋ช
๋ น ๊ฒฐ์ (ํ๋ก์ ํธ ํ์
๋ณ ์๋ ๊ฐ์ง):
package.json โ npm run build (build ์คํฌ๋ฆฝํธ ์์ผ๋ฉด) ๋๋ npm install
pyproject.toml โ pip install -e . ๋๋ poetry install
go.mod โ go build ./...
Cargo.toml โ cargo build
pom.xml โ mvn compile
- ๋น๋ ์คํ
- ๊ฒฐ๊ณผ ํ์ธ:
- ์ฑ๊ณต โ Step 3์ผ๋ก
- ์คํจ โ ์๋ฌ ๋ฉ์์ง ํฌํจํ์ฌ Return (์ค์ผ์คํธ๋ ์ดํฐ๊ฐ ์ฒ๋ฆฌ)
Step 3: ์ ์ฒด ํ
์คํธ ์ค์ํธ ์คํ
- ํ
์คํธ ๋ช
๋ น ๊ฒฐ์ (ํ๋ก์ ํธ ํ์
๋ณ ์๋ ๊ฐ์ง):
.py โ pytest -v ๋๋ python -m pytest -v
.ts/.js โ npm test
go.mod โ go test ./... -v
Cargo.toml โ cargo test
pom.xml โ mvn test
- ์ ์ฒด ํ
์คํธ ์คํ (unit ํ
์คํธ + ํตํฉ ํ
์คํธ ํฌํจ)
- ๊ฒฐ๊ณผ ํ์ฑ:
- ์ ์ฒด ํต๊ณผ โ Step 3.5๋ก
- ์คํจ ์์ โ ์คํจ ํ
์คํธ ๋ชฉ๋ก ํฌํจํ์ฌ Return
"โ ๏ธ [N]๊ฐ ํ
์คํธ ์คํจ. systematic-debugging ๊ถ์ฅ."
Step 3.5: Stub ์์กด ๊ฒ์ฆ (Brownfield ์ ์ฉ)
construction-orchestrator๊ฐ ํธ์ถ ์ "Brownfield: true" ์ธ๋ผ์ธ ์ ๋ฌํ ๊ฒฝ์ฐ์๋ง ์คํ. ๋ฏธ์ ๋ฌ ์ ์คํตํ๊ณ Step 4๋ก.
- Stub Scan๊ณผ ๋์ผ ํจํด์ผ๋ก ํ๋ก์ ํธ ๋ฃจํธ ์ค์บ
- ๋ณ๊ฒฝ ํ์ผ ๋ชฉ๋ก ์ถ์ถ:
devflow-state.md์ ## Worktree โ branch ํ์ธ
- ์ํฌํธ๋ฆฌ ์์:
git diff --name-only main...HEAD
- ์ํฌํธ๋ฆฌ ์์:
git diff --name-only $(git merge-base HEAD origin/main)...HEAD
- diff ๊ฒฐ๊ณผ ๋น์ด์์ผ๋ฉด:
"โ ๏ธ ๋ณ๊ฒฝ ํ์ผ ๊ฐ์ง ๋ถ๊ฐ. A) ์๋ ์ง์ / B) ์ ์ฒด ์ค์บ"
- stub ์ค์บ ๊ฒฐ๊ณผ์ ๋ณ๊ฒฝ ํ์ผ ๊ต์ฐจ ๋น๊ต โ ๋ณ๊ฒฝ ํ์ผ ๋ด stub๋ง ์ถ์ถ
๊ด๋ จ stub ์์:
โ
Stub ์์กด ๊ฒ์ฆ ํต๊ณผ โ ๋ณ๊ฒฝ ํ์ผ ๋ด ๋ฏธ๊ตฌํ stub ์์
โ Step 4๋ก ์งํ
๊ด๋ จ stub ๋ฐ๊ฒฌ ์ โ ์กฐ๊ฑด๋ถ ๊ฒ์ดํธ:
โ ๏ธ Stub ์์กด ๋ฐ๊ฒฌ โ ๋ณ๊ฒฝ ํ์ผ ๋ด ๋ฏธ๊ตฌํ stub [N]๊ฑด
| ํ์ผ | ๋ผ์ธ | ๋ด์ฉ |
|------|------|------|
| [ํ์ผ๊ฒฝ๋ก] | [๋ผ์ธ] | [stub ๋ด์ฉ] |
A) stub ์์ ํ build-and-test ์ฌ์คํ
B) stub์ ์ธ์งํ๊ณ ์งํ โ ์ฌ์ ์
๋ ฅ ์์ฒญ
A ์ ํ ์: ์ฌ์ฉ์๊ฐ stub ์์ โ build-and-test ์ฌ์คํ (Step 2๋ถํฐ)
B ์ ํ ์: ์ฌ์ ์
๋ ฅ ์์ฒญ ํ, session-summary ## Deferred Stubs ๊ตฌ์กฐํ ํ
์ด๋ธ์ ๊ธฐ๋ก:
## Deferred Stubs
| ํ์ผ:๋ผ์ธ | stub ๋ด์ฉ | ์ฌ์ | ๊ด๋ จ unit | ์์ ํด๊ฒฐ ์์ |
|-----------|----------|------|----------|--------------|
- devflow-audit์
"stub-deferred: [ํ์ผ:๋ผ์ธ] โ [์ฌ์ ]" ๊ธฐ๋ก
- ๋ค์ ์ธ์
์ฌ๊ฐ ์ construction-orchestrator๊ฐ
## Deferred Stubs๋ฅผ ๊ฐ์งํ์ฌ Stub Scan์ ํฌํจ
์ค์บ ์คํจ ์: ์ฌ์๋/์คํต ๊ฒ์ดํธ + devflow-audit์ "stub-scan-error" ๊ธฐ๋ก
Step 4: ์ง์นจ ๋ฌธ์ ์์ฑ
๋น๋์ ํ
์คํธ๊ฐ ๋ชจ๋ ์ฑ๊ณตํ ํ, ์ฐธ์กฐ์ฉ ์ง์นจ ๋ฌธ์๋ฅผ ์์ฑํ๋ค.
devflow-docs/construction/build-and-test/build-instructions.md:
# Build Instructions
## Prerequisites
[๋น๋์ ํ์ํ ๋๊ตฌ์ ๋ฒ์ ]
## Steps
1. [์ ํํ ๋ช
๋ น์ด]
2. [์ ํํ ๋ช
๋ น์ด]
## Expected Output
[์ฑ๊ณต ์ ์ด๋ค ๊ฒฐ๊ณผ๊ฐ ๋์ค๋์ง]
devflow-docs/construction/build-and-test/test-instructions.md:
# Test Instructions
## Unit Tests
Run: `[์ ํํ ๋ช
๋ น์ด]`
Expected: [N]๊ฐ ํ
์คํธ ํต๊ณผ
## Integration Tests
Run: `[์ ํํ ๋ช
๋ น์ด]`
## Manual Verification
[์๋ํํ ์ ์๋ ํ์ธ ๋จ๊ณ๊ฐ ์์ผ๋ฉด]
Return to Orchestrator
conventions ํ์ค ํ์. ๋ฐํ ํ๋:
- ๋น๋: โ
์ฑ๊ณต | โ ์คํจ ([์๋ฌ ์์ฝ])
- ํ
์คํธ: โ
[N]๊ฐ ํต๊ณผ, 0 ์คํจ | โ [N]๊ฐ ํต๊ณผ, [M]๊ฐ ์คํจ
- Verification Contract: [์๋ฃ ์กฐ๊ฑด pass/fail ์ฒดํฌ๋ฆฌ์คํธ] (๊ณ์ฝ์ด ์๋ ๊ฒฝ์ฐ์๋ง ํฌํจ)
- ์ฐ์ถ๋ฌผ: build-instructions.md, test-instructions.md
Error Handling
๋น๋ ๋ช
๋ น์ ๊ฒฐ์ ํ ์ ์์ ๋
๋น๋ ์์คํ
์ด ํ์ธ๋์ง ์์ผ๋ฉด ํ์ผ ํ์ฅ์๋ก ์ถ๋ก ํ๋ค:
.py โ pip install -r requirements.txt && python -m pytest
.ts/.js โ npm install && npm test
go.mod โ go build ./... && go test ./...
Cargo.toml โ cargo build && cargo test
์์ฑ๋ ์ฝ๋๊ฐ ์์ ๋
devflow-docs/ ๋ฐ์ ์์ค ํ์ผ์ด ์์ผ๋ฉด:
- "โ ๏ธ ์์ฑ๋ ์ฝ๋๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค." ํ์
- placeholder ์ง์นจ ์์ฑ: "์ฝ๋ ์์ฑ ํ ์คํ"