Claude Code Standalone Project Scaffolding
Your goal is to create an initial setup for Claude Code in a pre-existing standalone project, including agent instructions and context information. You work in close collaboration with the user to obtain the required base knowledge about the goals and structure of the project.
Additional user arguments: $ARGUMENTS
Language hint: Always create all generated document content in English, while continuing to speak to the user in the language of their choice.
Platform hint: Instructions and templates assume a Linux host with GNU coreutils. Adapt to the detected user OS.
- macOS — Substitute BSD equivalents for GNU-only utilities.
- Windows — Still use
.shfiles (skip irrelevantchmod +x), assuming Git Bash is available at runtime. Highlight this requirement in the Debriefing. Set"shell": "bash"on command hooks insettings.json. Omit the entiresandboxblock fromsettings.jsonas long as bash sandboxing is unsupported.
Agent Content Principles
When generating content for .md files below, you are writing prompts and context for other AI coding agents.
Follow these principles to optimally tailor your instructions to their needs:
- Concise — Minimize token usage. Prefer keywords and terse bullet points over prose.
- Structured — Use compact Markdown to delineate connected aspects.
- Actionable — Generate concrete operational directives, not abstract guidelines. Avoid aspirational quality statements, general engineering practices, blanket prohibitions.
- Referential — Provide pointers to key code files the agents can read themselves. Do not describe how code works in agent instructions as such duplication leads to drift.
- Scoped — Context is hierarchical. The CLAUDE.md must only contain core project identity and semantics. Rules and agent instructions progressively disclose domain- and task-specific knowledge.
- Durable — Only include details that remain invariant under normal codebase evolution. Avoid specific technology versions. Reference namespaces or search terms instead of single artifacts.
Workflow
- Begin execution by creating a formal task list for progress tracking using the
TaskCreatetool. Create a task for each of the following phases (##) and sub-phases (###). Do not duplicate the contents in the description, only reference this skill (abc-init:standalone) and the workflow item. - Create a dependency chain between all tasks using
TaskUpdate, settingaddBlockedByto the predecessor task. - Work through the
TaskListusingTaskUpdateto mark tasks as in_progress and completed as you go.
Phase 1: Reconnaissance
- Use
Exploreagents to scan the repository and build an initial understanding of its structure- Top-level directory content that hints at used technologies (e.g.
package.json,composer.json,Cargo.toml,go.mod,Makefile,Dockerfile) - Existing documentation (e.g.
README.md,CONTRIBUTING.mdordocs/) - Style (e.g. imperative mood) and common patterns (e.g. ticket numbers) in commit messages from the
git log.
- Top-level directory content that hints at used technologies (e.g.
- Read any discovered documentation and technology manifest files
- Check for an existing
CLAUDE.mdor.claude/directory — if found, establish if the user wants to amend or replace these. - Summarize your findings and conclusions briefly for the user and ask if they want to comment or add information.
Phase 2: User Interview
Interview the user to establish the project's base details.
Use AskUserQuestion where appropriate to keep the conversation structured.
Offer pre-defined choice options if likely answers to a question are already known from context. However, never skip parts of the interview even if all answers could be inferred. The purpose of the interview is to include tribal project knowledge not captured by reconnaissance.
Question Catalogue
- What is the name of the project?
- Who is the project creator and/or maintainer (company/organization)?
- What is the overall purpose of the project (one-sentence summary)?
- What is the production scale of the project (data size, number of users)?
- What are the main technologies used (programming language, framework, deployment...)?
- What are key concepts or vocabulary that every developer needs to learn on their first day?
- What are the key source directories?
- How are automated tests organized and run?
- Are there tools for linting or other automated code quality control?
Phase 3: Generate Artifacts
3a — Claude Code Settings
- Copy the settings template to
<project-dir>/.claude/settings.json - Copy the statusline template to
<project-dir>/.claude/statusline.shand make it executable (chmod +x). - Replace the
{{PLACEHOLDERS}}based on acquired context. - Inject
{{GITIGNORE-EXCLUSIONS}}into the sandbox config, limiting write access to version-controlled files only.
3b — Central CLAUDE.md
- Copy the template to
<project-dir>/CLAUDE.md - Replace the
{{PLACEHOLDERS}}based on acquired context. - For placeholders that do not have corresponding answers, ask the user whether they want to provide an answer, generate an answer from code exploration, or omit the section.
The content is written for AI, not humans. There is no need for verbose introductions or explanations. Keep this file as brief as possible to preserve tokens. Prefer keywords and enumeration over continuous text. Use clear section headers and other Markdown formatting to demark connected aspects.
3c — Local Override Files
If a .gitignore file exists in the project root, append the following entries (if not already present):
/CLAUDE.local.md
/.claude/settings.local.json
3d — Explorer Agent
- Copy the template to
<project-dir>/.claude/agents/<project-slug>-explorer.md - Replace the
{{PLACEHOLDERS}}based on acquired context. Add available{{MCP-SEARCH-TOOLS}}for read-only exploration. Omit the nativeGlobandGreptools if suitable MCP replacements are present. - Use a general purpose
Exploreagent to perform a more thorough exploration of the project's code and add additional context information and instructions that are helpful to navigate the code structure as well as common conventions and nomenclature. - Modify
.claude/settings.json, add"Agent(Explore)"to thepermissions.denyarray (create it if it does not exist).
3e — Rules
- Create a
.claude/rules/directory in the project root. - For each programming language used in the project, create a code style rule
from the template at
<project-dir>/.claude/rules/<language>-code-style.md- Replace the
{{PLACEHOLDERS}}according to the aspects of the programming language. - Populate the style rules from linting tool configuration if discovered in Phase 1, or from conventions observed during code exploration.
- Replace the
- For each testing framework used in the project, create a testing rule
from the template at
<project-dir>/.claude/rules/testing.md- Determine a glob pattern matching only existing test files (e.g.
**/*.test.ts,**/*Test.php,**/test_*.py,**/*_test.go). - Derive common conventions from test files discovered in Phase 1 or the interview answers about test organization.
- Populate with concrete test conventions (file placement, naming, assertion style, setup patterns) discovered in Phase 1 or the interview answers about test organization.
- Determine a glob pattern matching only existing test files (e.g.
If any of these steps seem inapplicable to the given project, skip them and note this during the summary.
3f — Quality Gate Hooks
The following hooks are pre-r