Skip to content

Commit 44b3645

Browse files
binarykclaude
andcommitted
feat: rename config to aidocs-config.yml + add docs_root
BREAKING CHANGE: Config file renamed from docs/config.yml to docs/aidocs-config.yml - Add docs_root config key to specify documentation output directory - Add Step 0 config discovery to all workflows (generate, flow, batch, update, execute) - Config is now REQUIRED - workflows will prompt for /docs:init if not found - Add migration hint for old config.yml files - Update all docs/ hardcoded paths to use {docs_root} 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent b5fc745 commit 44b3645

File tree

8 files changed

+322
-95
lines changed

8 files changed

+322
-95
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "aidocs"
3-
version = "0.12.1"
3+
version = "0.13.0"
44
description = "AI-powered documentation generator for web applications. Install docs commands into your Claude Code project."
55
readme = "README.md"
66
license = { text = "MIT" }

src/aidocs_cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""AI-powered documentation generator CLI for Claude Code projects."""
22

3-
__version__ = "0.12.1"
3+
__version__ = "0.13.0"
44

55
from .cli import app
66

src/aidocs_cli/templates/workflows/batch/workflow.md

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,56 @@ description: Generate documentation for multiple pages from a list of URLs or a
1111

1212
---
1313

14+
## STEP 0: FIND AND LOAD CONFIGURATION
15+
16+
**CRITICAL:** Before doing anything else, locate and load the configuration file.
17+
18+
### 0.1 Search for Config File
19+
20+
Search for `aidocs-config.yml` in this order:
21+
1. `docs/aidocs-config.yml` (default location)
22+
2. `./aidocs-config.yml` (project root)
23+
24+
**Also check for old config format:**
25+
If `docs/config.yml` exists but `aidocs-config.yml` doesn't:
26+
```
27+
⚠️ Found old config format: docs/config.yml
28+
29+
Please rename it to: docs/aidocs-config.yml
30+
Then run this command again.
31+
```
32+
33+
### 0.2 If Config Found
34+
35+
Load the config and extract:
36+
- `docs_root` → Base directory for all documentation (default: `docs`)
37+
- `urls.base` → Base URL for page navigation
38+
- `auth.method` → How to authenticate
39+
- `skip_pages` → Patterns to exclude from batch
40+
41+
### 0.3 If Config NOT Found
42+
43+
Display message and STOP:
44+
```
45+
⚠️ No aidocs-config.yml found.
46+
47+
This workflow requires a configuration file to run.
48+
49+
Would you like to create one now?
50+
1. Yes - run /docs:init to set up configuration
51+
2. No - I'll create docs/aidocs-config.yml manually
52+
```
53+
54+
**IMPORTANT:** Do NOT proceed without config. Config is required.
55+
56+
---
57+
1458
## ARGUMENTS PARSING
1559

1660
Parse the arguments. Expected formats:
1761
```
18-
/docs:batch <urls-file> [--auth user:pass] [--output ./docs]
19-
/docs:batch --discover [--base-url https://app.example.com] [--auth user:pass] [--output ./docs]
62+
/docs:batch <urls-file> [--auth user:pass] [--output ./{docs_root}]
63+
/docs:batch --discover [--base-url https://app.example.com] [--auth user:pass] [--output ./{docs_root}]
2064
```
2165

2266
**Option 1: URLs file**
@@ -77,8 +121,8 @@ Proceed with all? [Y/n] Or type numbers to select specific pages.
77121

78122
**Load credentials using same logic as /docs:generate:**
79123

80-
Check `auth.method` in `docs/config.yml`:
81-
1. **method: "file"** → Read from `docs/.auth`
124+
Check `auth.method` in config (loaded in Step 0):
125+
1. **method: "file"** → Read from `{docs_root}/.auth`
82126
2. **method: "env"** → Read from environment variables
83127
3. **method: "manual"** → Require `--auth` flag
84128
4. **--auth flag** always overrides stored credentials
@@ -138,7 +182,7 @@ After all pages processed, create summary:
138182
⚠ {warning_count} pages with warnings
139183
✗ {error_count} pages failed
140184
141-
📁 Output directory: {output_path}
185+
📁 Output directory: {docs_root}/
142186
143187
📄 Files created:
144188
- dashboard.md
@@ -156,7 +200,7 @@ After all pages processed, create summary:
156200
```
157201

158202
### Index File:
159-
Create `{output}/index.md` with links to all generated docs:
203+
Create `{docs_root}/index.md` with links to all generated docs:
160204

161205
```markdown
162206
# Documentation Index

src/aidocs_cli/templates/workflows/execute/workflow.md

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,54 @@ description: Execute the documentation plan and generate all docs with screensho
1010
**Your Role:** You are a documentation generator. You will systematically work through the plan, running explore and flow documentation for each module.
1111

1212
**Requires:**
13-
- `docs/plan.yml` from `/docs:plan`
13+
- `{docs_root}/plan.yml` from `/docs:plan`
1414
- Playwright MCP for browser automation
1515

1616
---
1717

18+
## STEP 0: FIND AND LOAD CONFIGURATION
19+
20+
**CRITICAL:** Before doing anything else, locate and load the configuration file.
21+
22+
### 0.1 Search for Config File
23+
24+
Search for `aidocs-config.yml` in this order:
25+
1. `docs/aidocs-config.yml` (default location)
26+
2. `./aidocs-config.yml` (project root)
27+
28+
**Also check for old config format:**
29+
If `docs/config.yml` exists but `aidocs-config.yml` doesn't:
30+
```
31+
⚠️ Found old config format: docs/config.yml
32+
33+
Please rename it to: docs/aidocs-config.yml
34+
Then run this command again.
35+
```
36+
37+
### 0.2 If Config Found
38+
39+
Load the config and extract:
40+
- `docs_root` → Base directory for all documentation (default: `docs`)
41+
- `urls.base` → Base URL for screenshots
42+
- `auth.method` → How to authenticate
43+
44+
### 0.3 If Config NOT Found
45+
46+
Display message and STOP:
47+
```
48+
⚠️ No aidocs-config.yml found.
49+
50+
This workflow requires a configuration file to run.
51+
52+
Would you like to create one now?
53+
1. Yes - run /docs:init to set up configuration
54+
2. No - I'll create docs/aidocs-config.yml manually
55+
```
56+
57+
**IMPORTANT:** Do NOT proceed without config. Config is required.
58+
59+
---
60+
1861
## ARGUMENTS PARSING
1962

2063
Parse the arguments:
@@ -39,7 +82,7 @@ Examples:
3982
```
4083
📋 Loading documentation plan...
4184
42-
✓ Plan found: docs/plan.yml
85+
✓ Plan found: {docs_root}/plan.yml
4386
Created: 2024-01-15 10:30:00
4487
Modules: 4
4588
Cross-module flows: 2
@@ -97,10 +140,10 @@ For each module in plan, verify knowledge exists:
97140
```
98141
📁 Verifying knowledge base...
99142
100-
✓ users - docs/.knowledge/modules/users/
101-
✓ campaigns - docs/.knowledge/modules/campaigns/
102-
✓ orders - docs/.knowledge/modules/orders/
103-
✓ payments - docs/.knowledge/modules/payments/
143+
✓ users - {docs_root}/.knowledge/modules/users/
144+
✓ campaigns - {docs_root}/.knowledge/modules/campaigns/
145+
✓ orders - {docs_root}/.knowledge/modules/orders/
146+
✓ payments - {docs_root}/.knowledge/modules/payments/
104147
105148
All modules have discovery data.
106149
```

src/aidocs_cli/templates/workflows/flow/workflow.md

Lines changed: 68 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,66 @@ description: Document a code flow with screenshots, diagrams, and user-friendly
2020

2121
---
2222

23-
## LOAD CONFIGURATION
23+
## STEP 0: FIND AND LOAD CONFIGURATION
2424

25-
**First, check if `docs/config.yml` exists in the project root.**
25+
**CRITICAL:** Before doing anything else, locate and load the configuration file.
2626

27-
If it exists, load:
27+
### 0.1 Search for Config File
28+
29+
Search for `aidocs-config.yml` in this order:
30+
1. `docs/aidocs-config.yml` (default location)
31+
2. `./aidocs-config.yml` (project root)
32+
33+
**Also check for old config format:**
34+
If `docs/config.yml` exists but `aidocs-config.yml` doesn't:
35+
```
36+
⚠️ Found old config format: docs/config.yml
37+
38+
Please rename it to: docs/aidocs-config.yml
39+
Then run this command again.
40+
```
41+
42+
### 0.2 If Config Found
43+
44+
Load the config and extract these values:
45+
- `docs_root` → Base directory for all documentation (default: `docs`)
2846
- `urls.base` → Base URL for screenshots (e.g., `https://app.example.com`)
2947
- `auth.method` → How to authenticate for screenshots
30-
- `output.directory` → Where to save documentation
3148

32-
Store for later use in screenshot capture step.
49+
### 0.3 If Config NOT Found
50+
51+
Display message and STOP:
52+
```
53+
⚠️ No aidocs-config.yml found.
54+
55+
This workflow requires a configuration file to run.
56+
57+
Would you like to create one now?
58+
1. Yes - run /docs:init to set up configuration
59+
2. No - I'll create docs/aidocs-config.yml manually
60+
```
61+
62+
**If user chooses "Yes":** Execute the `/docs:init` workflow to walk through setup.
63+
**If user chooses "No":** Stop and provide this minimal config template:
64+
65+
```yaml
66+
# Minimal aidocs-config.yml
67+
docs_root: docs
68+
urls:
69+
base: "https://your-app.com"
70+
auth:
71+
required: false
72+
```
73+
74+
**IMPORTANT:** Do NOT proceed without config. Config is required.
75+
76+
### 0.4 Resolve Paths
77+
78+
Once config is loaded, set these path variables:
79+
- `{docs_root}` → Use for all output paths (from config, default: `docs`)
80+
- `{docs_root}/.auth` → Credentials file location
81+
- `{docs_root}/flows/` → Flow documentation folder
82+
- `{docs_root}/flows/images/` → Flow screenshots folder
3383

3484
---
3585

@@ -367,30 +417,24 @@ Or run with --no-screenshots flag (not recommended).
367417

368418
**Step 1: Check for credentials file**
369419

370-
Read the `docs/.auth` file if it exists:
420+
Read the `{docs_root}/.auth` file if it exists:
371421

372422
```yaml
373-
# docs/.auth format:
423+
# {docs_root}/.auth format:
374424
username: "[email protected]"
375425
password: "secretpassword"
376426
login_url: "/login" # optional, defaults to /login
377427
```
378428
379429
**Step 2: Check config for auth settings**
380430
381-
Also check `docs/config.yml` for auth configuration:
382-
383-
```yaml
384-
auth:
385-
method: file # or "env" or "manual"
386-
login_url: "/login"
387-
urls:
388-
base: "https://app.example.com"
389-
```
431+
The config was already loaded in Step 0. Use:
432+
- `auth.method` - How to authenticate (file, env, manual)
433+
- `urls.base` - Base URL for login page
390434

391435
**Step 3: Perform login if credentials found**
392436

393-
If `docs/.auth` exists and contains credentials:
437+
If `{docs_root}/.auth` exists and contains credentials:
394438

395439
1. Navigate to login URL: `{base_url}/login` (or custom `login_url`)
396440
2. Wait for login form to load
@@ -402,7 +446,7 @@ If `docs/.auth` exists and contains credentials:
402446

403447
```
404448
🔐 Authenticating...
405-
Reading credentials from docs/.auth
449+
Reading credentials from {docs_root}/.auth
406450
Navigating to: https://app.example.com/login
407451
Filling login form...
408452
✓ Logged in successfully
@@ -436,7 +480,7 @@ Capture relevant screenshots:
436480
Looking for: button containing "Import"
437481
Found: "Import Payments" button
438482

439-
Saved: docs/flows/images/import-payments-trigger.png
483+
Saved: {docs_root}/flows/images/import-payments-trigger.png
440484
```
441485
442486
**Screenshot 2: Modal/Form (if applicable)**
@@ -445,7 +489,7 @@ Capture relevant screenshots:
445489
Clicking: "Import Payments" button
446490
Waiting for: modal or form
447491

448-
Saved: docs/flows/images/import-payments-form.png
492+
Saved: {docs_root}/flows/images/import-payments-form.png
449493
```
450494
451495
### 6.5 Screenshot Summary
@@ -459,7 +503,7 @@ Capture relevant screenshots:
459503
2. import-payments-form.png
460504
└── Import modal with file upload field
461505

462-
Screenshots saved to: docs/flows/images/
506+
Screenshots saved to: {docs_root}/flows/images/
463507
```
464508
465509
---
@@ -509,7 +553,7 @@ Create the markdown file with all gathered information.
509553

510554
### 8.1 Create Output Directory
511555

512-
Ensure `docs/flows/` and `docs/flows/images/` directories exist.
556+
Ensure `{docs_root}/flows/` and `{docs_root}/flows/images/` directories exist.
513557

514558
### 8.2 Generate Filename
515559

@@ -693,7 +737,7 @@ public function handle(CsvPaymentImporter $importer)
693737
694738
### 8.4 Save File
695739
696-
Write to `docs/flows/{kebab-case-title}.md`
740+
Write to `{docs_root}/flows/{kebab-case-title}.md`
697741
698742
---
699743
@@ -704,7 +748,7 @@ Display final summary:
704748
```
705749
✅ Flow Documentation Complete
706750

707-
📄 Output: docs/flows/import-payments-from-csv.md
751+
📄 Output: {docs_root}/flows/import-payments-from-csv.md
708752

709753
📊 Analysis Summary:
710754
Files analyzed: 6

0 commit comments

Comments
 (0)