Reading: Part 5. Initial Project Setup

Lesson 1 of 5 in module «Part 5. Initial Project Setup»
You are viewing the lesson without signing in. Sign in to save progress and take tests.

Part 5. Initial Project Setup

Initial setup is not about generating the entire application. It is creating a minimal, clear foundation on which you can safely write the constitution and the first feature specification. In the learning project, the base will be a TypeScript project with Git, but without product logic.

Goal of the Stage

After initial setup you should have:

  • Git repository;
  • README.md with a brief product vision;
  • QWEN.md;
  • .qwen/settings.json;
  • minimal TypeScript stub;
  • empty or nearly empty src/index.ts;
  • package.json;
  • tsconfig.json with strict mode.

Do not add Hono, SQLite, Vitest or pages yet. These decisions should go into specs/tech-stack.md and the roadmap, and then be implemented through feature specifications.

Commands

mkdir agentclinic
cd agentclinic
git init
npm init -y
npm install -D typescript @types/node
npx tsc --init
mkdir -p src specs .qwen
touch src/index.ts

Open tsconfig.json and make sure strict mode is enabled:

{
  "compilerOptions": {
    "strict": true
  }
}

In package.json add:

{
  "scripts": {
    "typecheck": "tsc --noEmit"
  }
}

Create .gitignore to avoid accidentally committing build artifacts and local secrets:

node_modules/
dist/
build/
.env
.env.*

# local SQLite memory (see part 19)
.qwen/memory/agent-memory.db
.qwen/memory/agent-memory.db-shm
.qwen/memory/agent-memory.db-wal

# IDE
.idea/
.vscode/

Do not put .qwen/settings.json configuration into .gitignore — the team needs it. But check that it contains no secrets; for secrets there are environment variables and .env.

Check:

npm run typecheck
git status

What to Feed the Agent at the Start of a Session

Every launch of Qwen Code is a new window. If every time the agent guesses on its own what to read, you will spend part of the request on bringing it up to speed. It is more reliable to fix in advance which files it must read at the beginning:

  • QWEN.md — agent behavior rules in the repository.
  • specs/mission.md, specs/tech-stack.md, specs/roadmap.md — project constitution.
  • The current specification folder, if work is on a feature: specs/<YYYY-MM-DD-feature>/.

This is the same idea as @file in prompts, but you elevate it to the level of habit and QWEN.md. One option is to add a block to QWEN.md:

Before starting any work, read:
- README.md
- specs/mission.md, specs/tech-stack.md, specs/roadmap.md
- the active feature specification, if it is mentioned in the request.
Do not guess the contents of these files: if they are missing, say so.

In corporate texts this practice is called Knowledge Priming — "loading knowledge" at the start of a session. The name does not matter; what matters is that before the first action the agent already knows three essential things: why the project exists, what the stack is, and what the current phase is.

Minimal README

# AgentClinic

AgentClinic is a fictional mental health clinic where AI agents recover from the stress of working with humans.

Project participants' wishes:
- the engineering team wants a reliable learning application in TypeScript;
- the product team wants agents, ailments, therapies, appointment booking, feedback and reviews;
- marketing needs a modern browser experience with a memorable satirical tone.

This README is needed not as final documentation, but as initial wishes of project participants for the agent. In the next part, Qwen Code will read it and ask questions before creating the constitution.

First Commit

git add README.md QWEN.md package.json package-lock.json tsconfig.json src .qwen
git commit -m "Initialize AgentClinic scaffold"

If you do not want to commit .qwen/settings.json yet, check that it has no secrets. Configuration with a model name is usually acceptable, keys are not.

Checking Initial Setup via Qwen Code

Run:

qwen

Enter:

Check this repository.
Do not write files.
Report:
1. whether Git is initialized;
2. whether TypeScript strict mode is enabled;
3. whether `QWEN.md` sufficiently sets SDD rules;
4. what is missing before creating specs/mission.md, tech-stack.md and roadmap.md.

If Qwen suggests immediately installing a framework or writing the application, stop it. Before the constitution this is premature.

Why Not Write Code Right Away

In normal development with agents, initial setup often turns into "build the application." In SDD it should be boring. Its task is to give the agent a workspace and a Git boundary, not to make product decisions.

Compare:

Build the AgentClinic application.

and:

Prepare the repository for SDD.
Do not choose a web framework yet.
Do not implement product routes.

Make sure TypeScript and Git are ready.

The second prompt preserves decisions for the right stage.

Practice

  1. Perform the initial setup.
  2. Run npm run typecheck.
  3. Ask Qwen Code about repository readiness.
  4. Fix only blocking initial setup issues.
  5. Make a commit.

Review Questions

  1. Why should initial setup not include product features?
  2. What files does the agent need before creating the constitution?
  3. What should be committed before the first feature branch?
My notes
0 / 10000

Notes are saved in this browser. They will not appear on another device.

Course menu

Course

Specification-Driven Development with Qwen Code CLI
Progress 0 / 135