Loading...
Loading...
Set up a project's meta-structure for agentic engineering — CLAUDE.md, AGENTS.md, docs/, README, and CHANGELOG. Use when starting a new project or retrofitting an existing codebase for the forge workflow.
npx skill4agent add mgratzer/forge forge-setup-project# Check for existing meta files
ls -la CLAUDE.md AGENTS.md README.md CHANGELOG.md .claude/settings.local.json 2>/dev/null
# Check for docs directory
ls docs/ 2>/dev/null
# Check for any code at all
ls -la| State | Description | Behavior |
|---|---|---|
| Greenfield | No code, no meta files | Generate everything from user input |
| Existing, no meta | Has code but no CLAUDE.md/docs/ | Explore codebase first, then generate |
| Partial meta | Has some meta files (e.g., README exists) | Ask user how to handle each existing file |
| Full meta | All meta files already present | Offer to audit and update |
# Directory structure (top 3 levels)
find . -maxdepth 3 -type f -not -path './.git/*' -not -path './node_modules/*' -not -path './vendor/*' -not -path './.next/*' -not -path './dist/*' -not -path './build/*' | head -100
# Detect language/runtime
ls package.json go.mod Cargo.toml pyproject.toml setup.py Gemfile build.gradle pom.xml mix.exs deno.json bunfig.toml composer.json 2>/dev/null
# Package manager and scripts
cat package.json 2>/dev/null | head -80
cat Makefile 2>/dev/null | head -80
cat Taskfile.yml 2>/dev/null | head -80
# Entry points
ls -la src/ app/ cmd/ lib/ main.* index.* 2>/dev/null
# CI/CD configuration
ls .github/workflows/*.yml .gitlab-ci.yml Jenkinsfile .circleci/config.yml 2>/dev/null
# Lint/format configuration
ls .eslintrc* biome.json .prettierrc* .golangci.yml rustfmt.toml .rubocop.yml pyproject.toml 2>/dev/null
# Test configuration
ls jest.config* vitest.config* pytest.ini .mocharc* 2>/dev/null
# Docker
ls Dockerfile docker-compose*.yml 2>/dev/null
# Existing documentation
ls docs/*.md *.md 2>/dev/nullnpmbunCLAUDE.md# <Project Name>
<one-line description from Step 3>
## Commands
<all discovered commands in a code block — install, dev, build, check, lint, format, typecheck, test, etc.>
## Documentation
| Document | Purpose |
|----------|---------|
| [Architecture](docs/architecture.md) | System design, data flow, package responsibilities |
| [Development](docs/development.md) | Prerequisites, setup, daily workflow |
| [Coding Guidelines](docs/coding-guidelines.md) | Code style, error handling, naming conventions |
| [Testing](docs/testing.md) | Test commands, conventions, patterns |
| [PR Workflow](docs/pr-workflow.md) | Commits, PRs, branch naming, review process |
<additional project-specific docs rows if applicable>
## Core Principles
<3-5 principles from Step 3, as a numbered list>
## Commits
Format: `<type>(<scope>): <description>`
Types: feat, fix, docs, refactor, test, chore, perf
<2-3 example commit messages using actual project scopes>
## External Dependencies
<services, APIs, and tools the project depends on — with verification commands>
## Debugging
<what to check first when things break — project-specific troubleshooting patterns>
## Conventions
<naming patterns, preferred libraries, and project-specific rules beyond commit format>## External Dependencies## Debugging## Conventions<!-- TODO: verify this command --># Create AGENTS.md as a symlink to CLAUDE.md
ln -sf CLAUDE.md AGENTS.md
# Create .claude directory
mkdir -p .claude.claude/settings.local.json{
"attribution": {
"commit": "",
"pr": ""
}
}.gitignore.claude/.claude/settings.local.json# Check if .gitignore exists
if [ ! -f .gitignore ]; then
# Create with .claude/ entry
echo ".claude/" > .gitignore
else
# Add .claude/ if not already present
grep -qxF '.claude/' .gitignore || echo '.claude/' >> .gitignore
finode_modules/dist/.env.env.localvendor/__pycache__/.venv/*.pyctarget/.DS_Store*.logcoverage/.gitignoredocs/mkdir -p docs# Architecture
<system design overview — what the project is, how it's structured>
## Project Structure
<directory tree with annotations for key directories>
## Data Flow
<how data moves through the system — request lifecycle, processing pipeline, etc.>
## Package/Module Responsibilities
<table or list of key packages/modules and what they do>
<!-- TODO: Add diagrams if helpful --># Development
## Prerequisites
<runtime, language version, tools needed — detected from project>
## Setup
<step-by-step from clone to running — based on actual project setup>
## Daily Workflow
<common development loop — start dev server, run tests, etc.>
## Available Commands
<full list of all scripts/make targets with descriptions># Coding Guidelines
## Code Style
<detected style rules — formatter, linter config, import ordering, etc.>
## Error Handling
<project's error handling patterns — detected from code or marked TODO>
## Naming Conventions
<file naming, function naming, variable naming patterns detected>
## Documentation
<when to add comments, docstring conventions, etc.>
<!-- TODO: Add examples from the codebase --># Testing
## Running Tests
<exact test commands from project>
## Test Conventions
<test file location, naming, framework-specific patterns>
## Writing Tests
<patterns detected in existing tests — describe what you see>
## Coverage
<coverage commands if available, coverage expectations># PR Workflow
## Commit Conventions
Format: `<type>(<scope>): <description>`
Types: feat, fix, docs, refactor, test, chore, perf
### Examples
<2-3 examples using actual project scopes>
## Branch Naming
Format: `<type>/<issue-number>-<short-kebab-description>`
### Examples
<2-3 examples relevant to the project>
## PR Checklist
- [ ] Code follows project guidelines (see [Coding Guidelines](coding-guidelines.md))
- [ ] Tests added/updated (see [Testing](testing.md))
- [ ] Documentation updated (if applicable)
- [ ] CHANGELOG.md updated for user-facing changes
- [ ] Lint/format checks pass
- [ ] All tests pass
## Review Process
<project-specific review norms, or standard forge workflow>| Detected Signal | Suggested Doc |
|---|---|
| REST/GraphQL routes, OpenAPI spec | |
| Dockerfile, docker-compose | |
| CI workflow files | |
| Auth middleware, security headers | |
| React/Vue/Svelte components | |
| Database migrations, ORM config | |
| Multiple packages/workspaces | |
Based on what I found in the codebase, I'd also suggest creating:
- docs/api-reference.md (detected REST routes in src/routes/)
- docs/deployment.md (detected Dockerfile and docker-compose.yml)
Which of these would you like me to create?<!-- TODO: ... --><p align="center">
<strong><one-line project description></strong><br>
<short tagline — a punchy subtitle that complements the description>
</p>
<p align="center">
<a href="docs/architecture.md">Architecture</a> ·
<a href="docs/development.md">Development</a> ·
<a href="docs/coding-guidelines.md">Guidelines</a> ·
<a href="docs/testing.md">Testing</a> ·
<a href="docs/pr-workflow.md">PR Workflow</a>
</p>
---
<project story from Step 3 — the metaphor connecting the name to the purpose>
---
## Quick Start
<minimal steps to get running — clone, install, start>
## Features
<bullet list of key features — derived from codebase exploration>
## Development
<essential dev commands — install, dev, test, lint>
See [Development Guide](docs/development.md) for full setup instructions.
## Documentation
| Document | Purpose |
|----------|---------|
| [Architecture](docs/architecture.md) | System design and data flow |
| [Development](docs/development.md) | Setup and daily workflow |
| [Coding Guidelines](docs/coding-guidelines.md) | Code style and conventions |
| [Testing](docs/testing.md) | Test commands and patterns |
| [PR Workflow](docs/pr-workflow.md) | Commits, PRs, and review process |
## Contributing
1. Create an issue: `/forge-create-issue`
2. Implement: `/forge-implement-issue <number>`
3. Self-review: `/forge-reflect-pr`
4. Address feedback: `/forge-address-pr-feedback`
5. Update changelog: `/forge-update-changelog`assets/logo.svg<img>---A README.md already exists. How would you like to proceed?
1. Replace it entirely with the new structure
2. Merge — keep existing content and add missing sections
3. Keep the existing README.md unchanged# Changelog
All notable user-facing changes to this project will be documented in this file.
Changes are grouped by release date and category. Only user-facing changes are included — internal refactors, test updates, and CI changes are omitted.This project has existing git history. Would you like me to backfill the changelog from recent commits?
1. Yes — scan recent commits and create initial entries
2. No — start fresh from this point forwardforge-update-changelog# Stage only the meta files we created/modified
git add CLAUDE.md AGENTS.md .gitignore docs/ README.md CHANGELOG.md
# Commit with conventional format
git commit -m "docs: add agentic engineering meta-structure"## Setup Complete
### Files Created
- CLAUDE.md — Project guide with commands, docs table, principles, commit conventions
- AGENTS.md — Symlink → CLAUDE.md
- .claude/settings.local.json — Attribution settings (user-local, not committed)
- .gitignore — Git ignore rules (includes .claude/)
- docs/architecture.md — System design and structure
- docs/development.md — Prerequisites, setup, workflow
- docs/coding-guidelines.md — Code style and conventions
- docs/testing.md — Test commands and patterns
- docs/pr-workflow.md — Commit, PR, and review conventions
<any additional docs created>
- README.md — Project overview and quick start
- CHANGELOG.md — Ready for entries
### Next Steps
1. Review each generated file and fill in any <!-- TODO --> markers
2. Use /forge-create-issue to plan your first piece of work
3. Use /forge-implement-issue to start implementing<!-- TODO: describe X -->docs/testing.md<!-- TODO -->docs/ci.mdforge-create-issueforge-setup-projectforge-create-issueforge-implement-issueforge-reflect-prforge-address-pr-feedbackforge-update-changelog/forge-setup-project
/forge-setup-project /path/to/project