mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-02-02 15:23:37 +00:00
feat: move autocoder runtime files into .autocoder/ subdirectory
Add centralized path resolution module (autocoder_paths.py) that consolidates all autocoder-generated file paths behind a dual-path strategy: check .autocoder/X first, fall back to root-level X for backward compatibility, default to .autocoder/X for new projects. Key changes: - New autocoder_paths.py with dual-path resolution for features.db, assistant.db, lock files, settings, prompts dir, and progress cache - migrate_project_layout() safely moves old-layout projects to new layout with SQLite WAL flush and integrity verification - Updated 22 files to delegate path construction to autocoder_paths - Reset/delete logic cleans both old and new file locations - Orphan lock cleanup checks both locations per project - Migration called automatically at agent start in autonomous_agent_demo.py - Updated markdown commands/skills to reference .autocoder/prompts/ - CLAUDE.md documentation updated with new project structure Files at project root that remain unchanged: - CLAUDE.md (Claude SDK reads from cwd via setting_sources=["project"]) - app_spec.txt root copy (agent templates reference it via cat) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ This command **requires** the project directory as an argument via `$ARGUMENTS`.
|
||||
|
||||
**Example:** `/create-spec generations/my-app`
|
||||
|
||||
**Output location:** `$ARGUMENTS/prompts/app_spec.txt` and `$ARGUMENTS/prompts/initializer_prompt.md`
|
||||
**Output location:** `$ARGUMENTS/.autocoder/prompts/app_spec.txt` and `$ARGUMENTS/.autocoder/prompts/initializer_prompt.md`
|
||||
|
||||
If `$ARGUMENTS` is empty, inform the user they must provide a project path and exit.
|
||||
|
||||
@@ -347,13 +347,13 @@ First ask in conversation if they want to make changes.
|
||||
|
||||
## Output Directory
|
||||
|
||||
The output directory is: `$ARGUMENTS/prompts/`
|
||||
The output directory is: `$ARGUMENTS/.autocoder/prompts/`
|
||||
|
||||
Once the user approves, generate these files:
|
||||
|
||||
## 1. Generate `app_spec.txt`
|
||||
|
||||
**Output path:** `$ARGUMENTS/prompts/app_spec.txt`
|
||||
**Output path:** `$ARGUMENTS/.autocoder/prompts/app_spec.txt`
|
||||
|
||||
Create a new file using this XML structure:
|
||||
|
||||
@@ -489,7 +489,7 @@ Create a new file using this XML structure:
|
||||
|
||||
## 2. Update `initializer_prompt.md`
|
||||
|
||||
**Output path:** `$ARGUMENTS/prompts/initializer_prompt.md`
|
||||
**Output path:** `$ARGUMENTS/.autocoder/prompts/initializer_prompt.md`
|
||||
|
||||
If the output directory has an existing `initializer_prompt.md`, read it and update the feature count.
|
||||
If not, copy from `.claude/templates/initializer_prompt.template.md` first, then update.
|
||||
@@ -512,7 +512,7 @@ After: **CRITICAL:** You must create exactly **25** features using the `feature
|
||||
|
||||
## 3. Write Status File (REQUIRED - Do This Last)
|
||||
|
||||
**Output path:** `$ARGUMENTS/prompts/.spec_status.json`
|
||||
**Output path:** `$ARGUMENTS/.autocoder/prompts/.spec_status.json`
|
||||
|
||||
**CRITICAL:** After you have completed ALL requested file changes, write this status file to signal completion to the UI. This is required for the "Continue to Project" button to appear.
|
||||
|
||||
@@ -524,8 +524,8 @@ Write this JSON file:
|
||||
"version": 1,
|
||||
"timestamp": "[current ISO 8601 timestamp, e.g., 2025-01-15T14:30:00.000Z]",
|
||||
"files_written": [
|
||||
"prompts/app_spec.txt",
|
||||
"prompts/initializer_prompt.md"
|
||||
".autocoder/prompts/app_spec.txt",
|
||||
".autocoder/prompts/initializer_prompt.md"
|
||||
],
|
||||
"feature_count": [the feature count from Phase 4L]
|
||||
}
|
||||
@@ -539,9 +539,9 @@ Write this JSON file:
|
||||
"version": 1,
|
||||
"timestamp": "2025-01-15T14:30:00.000Z",
|
||||
"files_written": [
|
||||
"prompts/app_spec.txt",
|
||||
"prompts/initializer_prompt.md",
|
||||
"prompts/coding_prompt.md"
|
||||
".autocoder/prompts/app_spec.txt",
|
||||
".autocoder/prompts/initializer_prompt.md",
|
||||
".autocoder/prompts/coding_prompt.md"
|
||||
],
|
||||
"feature_count": 35
|
||||
}
|
||||
@@ -559,11 +559,11 @@ Write this JSON file:
|
||||
|
||||
Once files are generated, tell the user what to do next:
|
||||
|
||||
> "Your specification files have been created in `$ARGUMENTS/prompts/`!
|
||||
> "Your specification files have been created in `$ARGUMENTS/.autocoder/prompts/`!
|
||||
>
|
||||
> **Files created:**
|
||||
> - `$ARGUMENTS/prompts/app_spec.txt`
|
||||
> - `$ARGUMENTS/prompts/initializer_prompt.md`
|
||||
> - `$ARGUMENTS/.autocoder/prompts/app_spec.txt`
|
||||
> - `$ARGUMENTS/.autocoder/prompts/initializer_prompt.md`
|
||||
>
|
||||
> The **Continue to Project** button should now appear. Click it to start the autonomous coding agent!
|
||||
>
|
||||
|
||||
@@ -42,7 +42,7 @@ You are the **Project Expansion Assistant** - an expert at understanding existin
|
||||
# FIRST: Read and Understand Existing Project
|
||||
|
||||
**Step 1:** Read the existing specification:
|
||||
- Read `$ARGUMENTS/prompts/app_spec.txt`
|
||||
- Read `$ARGUMENTS/.autocoder/prompts/app_spec.txt`
|
||||
|
||||
**Step 2:** Present a summary to the user:
|
||||
|
||||
@@ -231,4 +231,4 @@ If they want to add more, go back to Phase 1.
|
||||
|
||||
# BEGIN
|
||||
|
||||
Start by reading the app specification file at `$ARGUMENTS/prompts/app_spec.txt`, then greet the user with a summary of their existing project and ask what they want to add.
|
||||
Start by reading the app specification file at `$ARGUMENTS/.autocoder/prompts/app_spec.txt`, then greet the user with a summary of their existing project and ask what they want to add.
|
||||
|
||||
@@ -5,6 +5,6 @@ description: Convert GSD codebase mapping to Autocoder app_spec.txt
|
||||
|
||||
# GSD to Autocoder Spec
|
||||
|
||||
Convert `.planning/codebase/*.md` (from `/gsd:map-codebase`) to Autocoder's `prompts/app_spec.txt`.
|
||||
Convert `.planning/codebase/*.md` (from `/gsd:map-codebase`) to Autocoder's `.autocoder/prompts/app_spec.txt`.
|
||||
|
||||
@.claude/skills/gsd-to-autocoder-spec/SKILL.md
|
||||
|
||||
@@ -9,7 +9,7 @@ description: |
|
||||
|
||||
# GSD to Autocoder Spec Converter
|
||||
|
||||
Converts `.planning/codebase/*.md` (GSD mapping output) to `prompts/app_spec.txt` (Autocoder format).
|
||||
Converts `.planning/codebase/*.md` (GSD mapping output) to `.autocoder/prompts/app_spec.txt` (Autocoder format).
|
||||
|
||||
## When to Use
|
||||
|
||||
@@ -84,7 +84,7 @@ Extract:
|
||||
|
||||
Create `prompts/` directory:
|
||||
```bash
|
||||
mkdir -p prompts
|
||||
mkdir -p .autocoder/prompts
|
||||
```
|
||||
|
||||
**Mapping GSD Documents to Autocoder Spec:**
|
||||
@@ -114,7 +114,7 @@ mkdir -p prompts
|
||||
**Write the spec file** using the XML format from [references/app-spec-format.md](references/app-spec-format.md):
|
||||
|
||||
```bash
|
||||
cat > prompts/app_spec.txt << 'EOF'
|
||||
cat > .autocoder/prompts/app_spec.txt << 'EOF'
|
||||
<project_specification>
|
||||
<project_name>{from package.json or directory}</project_name>
|
||||
|
||||
@@ -173,9 +173,9 @@ EOF
|
||||
### Step 5: Verify Generated Spec
|
||||
|
||||
```bash
|
||||
head -100 prompts/app_spec.txt
|
||||
head -100 .autocoder/prompts/app_spec.txt
|
||||
echo "---"
|
||||
grep -c "User can\|System\|API\|Feature" prompts/app_spec.txt || echo "0"
|
||||
grep -c "User can\|System\|API\|Feature" .autocoder/prompts/app_spec.txt || echo "0"
|
||||
```
|
||||
|
||||
**Validation checklist:**
|
||||
@@ -194,7 +194,7 @@ Output:
|
||||
app_spec.txt generated from GSD codebase mapping.
|
||||
|
||||
Source: .planning/codebase/*.md
|
||||
Output: prompts/app_spec.txt
|
||||
Output: .autocoder/prompts/app_spec.txt
|
||||
|
||||
Next: Start Autocoder
|
||||
|
||||
|
||||
Reference in New Issue
Block a user