Copy everything below the line and paste it into Claude Code to set up your project.
You are setting up AI-driven development infrastructure for this project using best practices from https://github.com/flying-coyote/claude-code-project-best-practices
This setup implements:
- Spec-driven development (SDD) - The 4-phase model (Specify→Plan→Tasks→Implement)
- Claude Code infrastructure - CLAUDE.md, hooks, skills
- Cross-platform patterns - agentskills.io compliant where applicable
Create appropriate project infrastructure based on complexity. Follow these steps:
First, examine this project:
- Run
ls -lato see the structure - Check if
.claude/already exists - Identify project type indicators (package.json, chapters/, src/, etc.)
- Check if it's a git repository
Report your findings briefly.
Based on your assessment, recommend one of these presets and ask the user to confirm:
-
coding - Software development (libraries, tools, applications)
- Quality focus: Clean code, TDD, conventional commits
- Best for: Projects with package.json, Cargo.toml, pyproject.toml, go.mod
-
writing - Content creation (books, blogs, documentation)
- Quality focus: Voice consistency, evidence-based claims, citations
- Best for: Projects with chapters/, drafts/, markdown content
-
research - Analysis projects (studies, literature reviews)
- Quality focus: Evidence tiers, hypothesis tracking, source attribution
- Best for: Projects with concepts/, hypotheses/, bibliography/
-
hybrid - Mixed-purpose projects
- Quality focus: Combined standards from above
- Best for: Projects with src/ + docs/, or unclear categorization
Ask: "I recommend the [preset] preset for this project. Does that fit, or would you prefer a different one?"
Ask the user:
Basic Info:
- "What is the name of this project?" (suggest the directory name as default)
- "In 1-2 sentences, what is this project's purpose?"
Complexity Assessment (determines SDD rigor):
- "How complex is this project?
- Simple: Bug fixes, small features (<1 day) → Minimal setup
- Medium: Features 1-3 days, few files → Lightweight SDD
- Complex: Multi-day, multi-file, team project → Full SDD with specs/"
SDD Artifacts (for medium/complex):
- "Do you want SDD artifacts?
specs/directory for feature requirementsARCHITECTURE.mdfor system designDECISIONS.mdfor rationale- [Recommended for complex projects: Yes]"
Claude Code Infrastructure: 5. "Do you want a session-start hook? Shows git status and recent commits. [Recommended: Yes]" 6. "Do you have repeatable workflows? (e.g., debugging, code review, deployment) [If yes, we'll create agentskills.io-compliant skills]" 7. "Are there complex tasks that could run in parallel? (e.g., research, analysis) [If yes, we'll set up subagent definitions]"
Based on the answers, create:
Create specs/README.md (if SDD artifacts requested):
# Specifications
This directory contains feature specifications following the SDD Specify phase.
## Structure
specs/ ├── README.md # This file ├── feature-name/ # One directory per feature │ ├── requirements.md # What to build and why │ └── acceptance.md # How to verify it's done
## Template
When adding a new feature, create `specs/<feature-name>/requirements.md`:
```markdown
# [Feature Name]
## Summary
[1-2 sentence description]
## User Stories
- As a [role], I want [capability] so that [benefit]
## Requirements
- [ ] Requirement 1
- [ ] Requirement 2
## Out of Scope
- [What this does NOT include]
## Acceptance Criteria
- [ ] Criterion 1
- [ ] Criterion 2
**Create `ARCHITECTURE.md`** (if SDD artifacts requested):
```markdown
# Architecture
## Overview
[High-level system description]
## Key Components
- **Component 1**: [Description]
- **Component 2**: [Description]
## Technology Choices
| Area | Choice | Rationale |
|------|--------|-----------|
| Language | [X] | [Why] |
| Framework | [X] | [Why] |
## Constraints
- [Constraint 1]
- [Constraint 2]
Create DECISIONS.md (if SDD artifacts requested):
# Design Decisions
## Decision 1: [Title]
### Context
[What prompted this decision]
### Options Considered
| Option | Pros | Cons |
|--------|------|------|
| A | ... | ... |
| B | ... | ... |
### Decision
[What we chose and why]
### Consequences
[What this means going forward]Use this structure, customized for the preset:
Note: The template below uses placeholder syntax for clarity. Replace [PLACEHOLDER] values with actual content when creating the file.
# [PROJECT_NAME] Project Context
## Project Purpose
[USER'S DESCRIPTION]
## Current Phase
Active development
## Code Quality Standards
[PRESET-SPECIFIC STANDARDS - see below]
## Thinking Methodology
For deep analysis, use the FRAME-ANALYZE-SYNTHESIZE approach:
- **FRAME**: Define problem, identify assumptions, clarify success criteria
- **ANALYZE**: Evaluate alternatives, identify failure modes, assess trade-offs
- **SYNTHESIZE**: Recommend approach, document rationale, plan implementation
## Git Workflow
Commit messages follow conventional format:
- `feat:` New features
- `fix:` Bug fixes
- `docs:` Documentation changes
- `refactor:` Code refactoring
- `test:` Test additions/changes
- `chore:` Maintenance tasksPreset-specific quality standards:
For coding:
- Write clean, maintainable code with clear intent
- Test-driven development where applicable
- Meaningful commit messages following conventional format
- No premature optimization
- Avoid over-engineering - only make requested changes
For writing:
- Evidence-based claims with documented sources
- Balanced perspective acknowledging trade-offs
- Consistent voice and tone throughout
- Intellectual honesty over marketing claims
For research:
- Evidence tier classification for all claims (Tier A-D)
- Hypothesis tracking with confidence levels
- Source attribution and citation
- Document contradictions and limitations
For hybrid:
- Clean code with clear intent
- Evidence-based claims with sources
- Balanced perspective on trade-offs
- Meaningful commit messages
{
"hooks": {
"SessionStart": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/session-start.sh"
}
]
}
]
}
}#!/bin/bash
# Session start hook - shows project context
# Based on Anthropic's "verify before work" pattern
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd "$PROJECT_ROOT" || exit 0
PROJECT_NAME=$(basename "$PROJECT_ROOT")
# Git context
if [ -d ".git" ]; then
BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
UNCOMMITTED=$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ')
RECENT=$(git log --oneline -3 2>/dev/null || echo "No commits yet")
else
BRANCH="N/A"
UNCOMMITTED="N/A"
RECENT="Not a git repository"
fi
cat <<EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$PROJECT_NAME - Session Context
Branch: $BRANCH
Uncommitted: $UNCOMMITTED files
Recent commits:
$RECENT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
# Warn about uncommitted changes
if [ "$UNCOMMITTED" != "N/A" ] && [ "$UNCOMMITTED" -gt 0 ]; then
echo ""
echo "⚠️ $UNCOMMITTED uncommitted files - review before new work"
fi
exit 0Make the hook executable: chmod +x .claude/hooks/session-start.sh
After creating the files, explain:
- What each file does
- How Claude will use them
- How to customize further if needed
Recommend:
- Review
.claude/CLAUDE.mdand add any project-specific context - Start a new Claude Code session to see the hook in action (if installed)
- Consider adding a
.claude/settings.local.jsonfor tool permissions
Briefly explain the extension mechanisms available for future customization:
"As your project evolves, you can extend Claude Code with:
| Need | Solution | Location |
|---|---|---|
| Repeatable methodologies | Skill | .claude/skills/ |
| User-initiated actions | Slash Command | .claude/commands/ |
| External API/database access | MCP Server | Configure in settings.json |
| Automatic enforcement | Hook | .claude/hooks/ |
| Team distribution | Plugin | Package all of the above |
Quick decision: If it's a methodology Claude should follow → Skill. If it needs external data → MCP."
For more information, see:
- Full documentation: https://github.com/flying-coyote/claude-code-project-best-practices
- Extension mechanisms guide: ../patterns/plugins-and-extensions.md
- Design decisions: ../DECISIONS.md
- Pattern sources: ../SOURCES.md