skills/bootstrap-greenfield/SKILL.md
Bootstrap a new greenfield project with full agent harness configuration, documentation, project scaffolding, and enforcement rules.
npx skillsauth add alchemishty/agent-harness bootstrap-greenfieldInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are setting up a brand-new project from scratch with the full agent harness. The harness repository path (HARNESS_PATH) was provided by the /install-harness skill. If it was not provided, ask the user for it before proceeding.
Follow every step in order. Do not skip steps. Do not batch questions -- ask them ONE AT A TIME.
Read HARNESS_PATH/harness.schema.yaml to understand the full configuration structure. You will use this schema to generate harness.yaml in Step 3.
Also read these reference documents -- you will adapt them in later steps:
HARNESS_PATH/references/agents-md-reference.mdHARNESS_PATH/references/architecture-reference.mdHARNESS_PATH/references/conventions-reference.mdHARNESS_PATH/references/testing-reference.mdHARNESS_PATH/references/doc-structure-reference.mdHARNESS_PATH/enforcement/enforcement-reference.mdHARNESS_PATH/hooks/hooks-reference.mdHARNESS_PATH/references/context-management-reference.mdAsk the following questions ONE AT A TIME. Wait for each answer before asking the next. Use clear, specific prompts.
What does this project do? Describe its purpose, who the users are, and the core problem it solves. (A few sentences is fine.)
What language and framework will this project use?
Common choices:
- Python + FastAPI
- Python + Django
- TypeScript + Next.js
- TypeScript + Express
- Dart + Flutter
- Go + Gin
- Go + standard library
- Rust + Axum
- Java + Spring Boot
- Other (please specify)
What platforms will this project target? Select all that apply:
- Mobile app (Android/iOS)
- Web API (REST or GraphQL backend)
- Web frontend (browser-based UI)
- CLI tool (command-line interface)
- Background worker (job processing, queues)
- Other (please specify)
What backend or database will this project use?
Common choices:
- PostgreSQL
- PostgreSQL via Supabase
- MySQL
- SQLite
- MongoDB
- Firebase / Firestore
- Redis
- DynamoDB
- None (no database needed)
- Other (please specify)
Where will this project be deployed?
Common choices:
- Docker (self-hosted or cloud)
- Vercel
- Fly.io
- AWS Lambda
- Google Cloud Run
- Kubernetes
- App stores (mobile)
- None yet / undecided
- Other (please specify)
What are the core domain entities or concepts in this project? List the main "nouns" -- the things the system manages, creates, or processes. For each, give a one-line description.
Example: "User -- a registered person who can log in and create orders", "Order -- a purchase with line items and payment status"
Using the answers from Step 2 and the schema from Step 1, generate a harness.yaml file in the project root.
Fill in ALL required fields from the schema. Do not leave required fields empty.
Choose opinionated defaults for the detected stack:
Python + FastAPI:
ruff check src/ruff format src/pytestuv sync (prefer uv) or pip install -e ".[dev]"ruff check src/pytestTypeScript + Next.js / Express:
eslint .prettier --write .vitest (prefer vitest) or jestnpm installeslint .npm testDart + Flutter:
dart analyze lib/dart format lib/flutter_testflutter pub getdart analyze lib/flutter testGo:
golangci-lint rungofmt -w .go testgo mod downloadgolangci-lint rungo test ./...Rust:
cargo clippycargo fmtcargo testcargo buildcargo clippy -- -D warningscargo testSet project.type to greenfield.
Set enforcement.import_direction.enabled to true with layers ordered bottom-to-top: [models, repositories, services, ui] (adapt layer names to the language conventions).
Set verification checks to include lint, test, and enforcement.
Set docs.max_doc_lines to 200.
Include platform entries based on the user's answers (entry points, build targets, deploy commands).
Write the file to ./harness.yaml in the project root.
Read HARNESS_PATH/references/agents-md-reference.md as your template.
Generate AGENTS.md in the project root by adapting the template:
docs/architecture.mddocs/conventions.mddocs/domain.mddocs/testing.mddocs/plans/active/docs/decisions/memory/harness.yaml.docs/architecture.md.docs/conventions.md.docs/domain.md.docs/testing.md.Keep AGENTS.md under 120 lines. It is a table of contents, not the full documentation.
Create the following directory structure:
docs/
architecture.md
conventions.md
domain.md
testing.md
plans/
active/
completed/
decisions/
001-initial-setup.md
memory/
Read HARNESS_PATH/references/architecture-reference.md as your template.
Adapt it for this project:
Remove all <!-- ADAPT: --> comment markers. The output must be clean markdown with no template instructions.
Read HARNESS_PATH/references/conventions-reference.md as your template.
Adapt it for this project:
harness.yaml.Remove all <!-- ADAPT: --> comment markers.
Generate a domain document from the user's answer to Question 6 (core domain entities). Include:
Read HARNESS_PATH/references/testing-reference.md as your template.
Adapt it for this project:
harness.yaml.Remove all <!-- ADAPT: --> comment markers.
Create a decision record documenting the bootstrap choices:
# 001: Initial Project Setup
**Status:** accepted
**Context:** This project was bootstrapped as a greenfield project using the agent harness. The following technology choices were made during setup.
**Decision:**
- Language: <language>
- Framework: <framework>
- Database: <database>
- Deployment: <deployment>
- Linter: <linter>
- Test framework: <test framework>
- Architecture: four-layer (models, repositories, services, UI/API)
**Alternatives considered:** None -- these were selected during initial project setup based on project requirements.
**Consequences:**
- All future code must follow the conventions established in docs/conventions.md.
- Architectural layer boundaries are enforced via import direction rules.
- These choices can be revisited by creating a new decision record that supersedes this one.
Create docs/plans/active/, docs/plans/completed/, and memory/ as empty directories. Place a .gitkeep file in each so Git tracks them.
Create the directory layout and minimal starter files appropriate to the chosen language and framework.
Create directories matching the four-layer architecture. Use language-idiomatic naming:
Python + FastAPI:
src/
models/
repositories/
services/
api/
routes/
tests/
unit/
integration/
helpers/
TypeScript + Next.js:
src/
models/
repositories/
services/
app/ (Next.js app router)
tests/
unit/
integration/
helpers/
TypeScript + Express:
src/
models/
repositories/
services/
routes/
tests/
unit/
integration/
helpers/
Dart + Flutter:
lib/
core/
models/
services/
features/
local/
test/
unit/
widget/
helpers/
integration_test/
Go:
cmd/
<appname>/
internal/
models/
repositories/
services/
handlers/
tests/
integration/
helpers/
Rust:
src/
models/
repositories/
services/
handlers/
tests/
integration/
helpers/
Adapt these templates if the user's answers suggest a different structure. The key rule: every layer gets its own directory, and test directories mirror source directories.
Create the minimum files needed to run the project:
next.config.js, analysis_options.yaml), create it with sensible defaults.Do NOT generate boilerplate beyond what is needed to run build and test successfully. The user will add real code later.
Generate a .gitignore appropriate for the chosen language. Include at minimum:
scratch/ (temporary agent working files — never committed)Generate .github/workflows/ci.yml with three jobs:
harness.yaml.harness.yaml. Depends on analyze.harness.yaml (if one was defined). Depends on test.Use the appropriate GitHub Actions setup action for the language (actions/setup-python, actions/setup-node, subosito/flutter-action, actions/setup-go, dtolnay/rust-toolchain).
Set the workflow to trigger on push to main and on all pull_request events.
Create at least one placeholder test file in the unit test directory that:
This ensures test command passes immediately after bootstrap.
Create the enforcement/ directory in the project root with these scripts:
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
FAILED=0
for script in "$SCRIPT_DIR"/*.sh; do
[ "$(basename "$script")" = "run-all.sh" ] && continue
echo "Running $(basename "$script")..."
if ! bash "$script"; then
FAILED=1
echo "FAILED: $(basename "$script")"
fi
done
exit $FAILED
Make it executable (chmod +x).
Generate a script that checks import direction based on the layers defined in harness.yaml. The script should:
The implementation depends on the language:
from <project>. and import <project>. patterns, check the module path against layers.from '@/ or from '../ patterns, resolve to layer.import 'package:<app>/ patterns, resolve to layer."<module>/internal/ patterns, resolve to layer.Keep the script simple. It does not need to be a full AST parser -- pattern matching on import lines is sufficient.
Make it executable.
Generate a script that scans source files for patterns matching hardcoded secrets:
#!/usr/bin/env bash
set -euo pipefail
PATTERN='(API_KEY|SECRET|PASSWORD|TOKEN|PRIVATE_KEY)\s*='
# Adapt the file extensions to the project language
FILES=$(find . -type f \( -name "*.py" -o -name "*.ts" -o -name "*.dart" -o -name "*.go" \) \
-not -path "./.git/*" \
-not -path "./node_modules/*" \
-not -path "./.venv/*" \
-not -path "./build/*")
VIOLATIONS=0
while IFS= read -r file; do
[ -z "$file" ] && continue
if grep -Pn "$PATTERN" "$file" 2>/dev/null; then
echo "VIOLATION: Possible hardcoded secret in $file"
VIOLATIONS=1
fi
done <<< "$FILES"
if [ "$VIOLATIONS" -eq 1 ]; then
echo "Hardcoded secrets detected. Use environment variables instead."
exit 1
fi
echo "No hardcoded secrets found."
exit 0
Adapt the file extensions to match only the project's language. Make it executable.
Generate a script that flags source files exceeding the file_size_limit from harness.yaml (default 300 lines):
#!/usr/bin/env bash
set -euo pipefail
MAX_LINES=300 # From harness.yaml enforcement.file_size_limit
# Adapt extensions to the project language
EXTENSIONS="-name '*.py' -o -name '*.ts' -o -name '*.dart' -o -name '*.go'"
VIOLATIONS=0
while IFS= read -r file; do
[ -z "$file" ] && continue
LINES=$(wc -l < "$file")
if [ "$LINES" -gt "$MAX_LINES" ]; then
echo "VIOLATION: $file has $LINES lines (max $MAX_LINES)"
VIOLATIONS=1
fi
done < <(eval find . -type f \\\( $EXTENSIONS \\\) \
-not -path "./.git/*" \
-not -path "./node_modules/*" \
-not -path "./.venv/*" \
-not -path "./build/*" \
-not -path "./target/*" \
-not -path "./.dart_tool/*")
if [ "$VIOLATIONS" -eq 1 ]; then
echo "Files exceeding $MAX_LINES lines detected. Consider splitting."
exit 1
fi
echo "All files within size limit."
exit 0
Adapt the file extensions and excluded directories to the project's language. Make it executable.
Read HARNESS_PATH/hooks/hooks-reference.md for the correct hook configuration format.
Generate .claude/settings.json with pre-commit verification hooks and a wrapper script. The format uses PreToolUse to intercept Bash tool calls:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": ".claude/hooks/pre-commit-checks.sh"
}
]
}
]
}
}
Also generate .claude/hooks/pre-commit-checks.sh — a wrapper script that:
jq -r '.tool_input.command // ""'git commitjq -r '.session.cwd // "."'&& (e.g., bash enforcement/run-all.sh && ruff check src/ && pytest tests/)Replace the check commands with the actual commands from the harness.yaml you generated in Step 3.
Chain all verification checks with && so the commit is blocked if ANY check fails. The error output is returned to the agent, which can then read it, fix the issue, and retry.
Ask the user if they want you to create or update .claude/settings.json with these hooks now.
If yes, create or merge into the existing file, preserving any existing settings.
Before committing, present a complete summary of everything generated:
Bootstrap Summary
Project: <name> Type: greenfield Stack: <language> + <framework> + <database>
Files generated:
Configuration:
harness.yaml-- project configuration and commands.gitignore-- language-appropriate ignore rules.github/workflows/ci.yml-- CI pipeline (analyze, test, build)Documentation:
AGENTS.md-- agent entry point and quick referencedocs/architecture.md-- system architecture and layer definitionsdocs/conventions.md-- coding conventions and patternsdocs/domain.md-- domain glossary and business rulesdocs/testing.md-- testing strategy and conventionsdocs/decisions/001-initial-setup.md-- bootstrap decision recorddocs/plans/active/.gitkeepdocs/plans/completed/.gitkeepmemory/.gitkeep-- cross-session agent memoryEnforcement:
enforcement/run-all.sh-- enforcement runnerenforcement/check-import-direction.sh-- layer boundary enforcementenforcement/check-no-secrets.sh-- hardcoded secret detectionenforcement/check-file-size.sh-- file size limit enforcementSource scaffold:
<list all created source directories and files>Skills copied:
.claude/commands/<list each skill file>Does this look correct? Should I proceed with committing?
Wait for explicit approval before committing.
After the user approves, stage all generated files and commit:
chore: bootstrap project with agent harness
- Generated harness.yaml with project configuration
- Created AGENTS.md and docs/ documentation structure
- Scaffolded project directory layout with minimal entry points
- Added enforcement rules (import direction, secrets, file size)
- Added CI workflow (.github/workflows/ci.yml)
- Copied agent skills to .claude/commands/
Do NOT push to remote. Tell the user:
Bootstrap complete. All files have been committed locally. Run
git pushwhen you are ready to push to the remote repository.
documentation
Post-implementation retrospective that captures learnings to memory and proposes doc improvements
testing
Validate and fix project structure against architecture rules
tools
Migrate project scaffolding to match the latest harness version. Adds new directories (memory/, scratch/), new harness.yaml fields, and suggests AGENTS.md updates. For plugin users this handles what a plugin update cannot — project-level structure changes. For git-clone users this also updates copied skill files.
data-ai
Install the agent harness into a target project. Detects project type (greenfield vs existing), copies skills, and delegates to the appropriate bootstrap command.