sdd-forge 0.1.0-alpha.29 → 0.1.0-alpha.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/docs/cli_commands.md +133 -195
- package/docs/configuration.md +99 -76
- package/docs/internal_design.md +359 -0
- package/docs/ja/README.md +5 -5
- package/docs/ja/cli_commands.md +289 -168
- package/docs/ja/configuration.md +152 -82
- package/docs/ja/internal_design.md +333 -0
- package/docs/ja/overview.md +74 -86
- package/docs/ja-translate/README.md +188 -0
- package/docs/ja-translate/cli_commands.md +372 -0
- package/docs/ja-translate/configuration.md +193 -0
- package/docs/ja-translate/internal_design.md +325 -0
- package/docs/ja-translate/overview.md +148 -0
- package/docs/overview.md +98 -75
- package/package.json +1 -1
- package/src/README.md +1 -1
- package/src/docs/commands/agents.js +1 -1
- package/src/docs/commands/data.js +5 -0
- package/src/docs/commands/enrich.js +58 -44
- package/src/docs/commands/forge.js +6 -7
- package/src/docs/commands/readme.js +32 -2
- package/src/docs/commands/review.js +1 -2
- package/src/docs/commands/text.js +6 -12
- package/src/docs/commands/translate.js +101 -70
- package/src/docs/data/project.js +1 -1
- package/src/docs/lib/command-context.js +4 -3
- package/src/docs/lib/data-source.js +30 -3
- package/src/docs/lib/directive-parser.js +6 -2
- package/src/docs.js +17 -14
- package/src/flow/commands/cleanup.js +86 -0
- package/src/flow/commands/merge.js +88 -0
- package/src/flow/commands/review.js +301 -0
- package/src/flow/commands/start.js +213 -0
- package/src/flow/commands/status.js +209 -0
- package/src/flow.js +52 -207
- package/src/help.js +18 -18
- package/src/lib/agent.js +82 -20
- package/src/lib/flow-state.js +86 -6
- package/src/locale/en/messages.json +19 -7
- package/src/locale/en/ui.json +42 -46
- package/src/locale/ja/messages.json +19 -7
- package/src/locale/ja/ui.json +42 -46
- package/src/presets/base/templates/en/AGENTS.sdd.md +4 -104
- package/src/presets/base/templates/en/development.md +1 -1
- package/src/presets/base/templates/en/guardrail.md +18 -0
- package/src/presets/base/templates/en/overview.md +3 -3
- package/src/presets/base/templates/en/project_structure.md +1 -1
- package/src/presets/base/templates/en/stack_and_ops.md +1 -1
- package/src/presets/base/templates/ja/AGENTS.sdd.md +4 -104
- package/src/presets/base/templates/ja/development.md +1 -1
- package/src/presets/base/templates/ja/guardrail.md +18 -0
- package/src/presets/base/templates/ja/overview.md +3 -3
- package/src/presets/base/templates/ja/project_structure.md +1 -1
- package/src/presets/base/templates/ja/stack_and_ops.md +1 -1
- package/src/presets/cakephp2/data/config.js +29 -10
- package/src/presets/cakephp2/data/libs.js +8 -5
- package/src/presets/cakephp2/data/models.js +9 -5
- package/src/presets/cakephp2/data/tables.js +5 -2
- package/src/presets/cakephp2/data/views.js +6 -6
- package/src/presets/cakephp2/templates/en/guardrail.md +11 -0
- package/src/presets/cakephp2/templates/ja/guardrail.md +11 -0
- package/src/presets/cli/data/modules.js +2 -2
- package/src/presets/cli/templates/en/README.md +2 -2
- package/src/presets/cli/templates/en/commands.md +1 -1
- package/src/presets/cli/templates/en/config.md +1 -1
- package/src/presets/cli/templates/en/guardrail.md +8 -0
- package/src/presets/cli/templates/ja/README.md +2 -2
- package/src/presets/cli/templates/ja/commands.md +1 -1
- package/src/presets/cli/templates/ja/config.md +1 -1
- package/src/presets/cli/templates/ja/guardrail.md +8 -0
- package/src/presets/laravel/data/commands.js +2 -2
- package/src/presets/laravel/data/config.js +6 -4
- package/src/presets/laravel/data/controllers.js +5 -3
- package/src/presets/laravel/data/tables.js +2 -2
- package/src/presets/laravel/templates/en/guardrail.md +11 -0
- package/src/presets/laravel/templates/ja/guardrail.md +11 -0
- package/src/presets/library/templates/en/guardrail.md +5 -0
- package/src/presets/library/templates/ja/README.md +2 -2
- package/src/presets/library/templates/ja/guardrail.md +5 -0
- package/src/presets/library/templates/ja/public_api.md +1 -1
- package/src/presets/library/templates/ja/usage.md +1 -1
- package/src/presets/node-cli/templates/en/guardrail.md +5 -0
- package/src/presets/node-cli/templates/ja/guardrail.md +5 -0
- package/src/presets/symfony/data/commands.js +2 -2
- package/src/presets/symfony/data/config.js +6 -4
- package/src/presets/symfony/data/controllers.js +5 -3
- package/src/presets/symfony/data/tables.js +2 -2
- package/src/presets/symfony/templates/en/guardrail.md +11 -0
- package/src/presets/symfony/templates/ja/guardrail.md +11 -0
- package/src/presets/webapp/data/controllers.js +2 -2
- package/src/presets/webapp/data/shells.js +2 -2
- package/src/presets/webapp/data/tables.js +2 -2
- package/src/presets/webapp/templates/en/guardrail.md +14 -0
- package/src/presets/webapp/templates/ja/README.md +2 -2
- package/src/presets/webapp/templates/ja/auth_and_session.md +1 -1
- package/src/presets/webapp/templates/ja/batch_and_shell.md +1 -1
- package/src/presets/webapp/templates/ja/business_logic.md +1 -1
- package/src/presets/webapp/templates/ja/controller_routes.md +1 -1
- package/src/presets/webapp/templates/ja/database_architecture.md +1 -1
- package/src/presets/webapp/templates/ja/db_tables.md +1 -1
- package/src/presets/webapp/templates/ja/guardrail.md +14 -0
- package/src/sdd-forge.js +24 -81
- package/src/{docs/commands/setup.js → setup.js} +74 -151
- package/src/spec/commands/gate.js +310 -0
- package/src/spec/commands/guardrail.js +251 -0
- package/src/{specs → spec}/commands/init.js +18 -11
- package/src/spec.js +12 -2
- package/src/templates/config.example.json +30 -11
- package/src/templates/skills/sdd-forge.flow-impl/SKILL.md +103 -0
- package/src/templates/skills/{sdd-flow-close → sdd-forge.flow-merge}/SKILL.md +43 -14
- package/src/templates/skills/{sdd-flow-start → sdd-forge.flow-plan}/SKILL.md +38 -19
- package/src/templates/skills/sdd-forge.flow-status/SKILL.md +94 -0
- package/src/{docs/commands/upgrade.js → upgrade.js} +9 -8
- package/src/docs/commands/default-project.js +0 -49
- package/src/lib/projects.js +0 -127
- package/src/specs/commands/gate.js +0 -142
- package/src/templates/skills/sdd-flow-status/SKILL.md +0 -71
package/README.md
CHANGED
|
@@ -104,11 +104,10 @@ That's it — `docs/` and `README.md` are generated.
|
|
|
104
104
|
| `changelog` | Generate change log from specs/ |
|
|
105
105
|
| `agents` | Update AGENTS.md |
|
|
106
106
|
|
|
107
|
-
###
|
|
107
|
+
### Other
|
|
108
108
|
|
|
109
109
|
| Command | Description |
|
|
110
110
|
|---|---|
|
|
111
|
-
| `default` | Set the default project |
|
|
112
111
|
| `presets` | List available presets |
|
|
113
112
|
| `help` | Show command list |
|
|
114
113
|
|
|
@@ -178,9 +177,10 @@ Add project-specific templates and data sources:
|
|
|
178
177
|
<!-- {{data: docs.chapters("Chapter|Summary")}} -->
|
|
179
178
|
| Chapter | Summary |
|
|
180
179
|
| --- | --- |
|
|
181
|
-
| [01. Tool Overview and Architecture](https://github.com/SpreadWorks/sdd-forge/blob/main/docs/overview.md) | This chapter introduces
|
|
182
|
-
| [02. CLI Command Reference](https://github.com/SpreadWorks/sdd-forge/blob/main/docs/cli_commands.md) |
|
|
183
|
-
| [03. Configuration and Customization](https://github.com/SpreadWorks/sdd-forge/blob/main/docs/configuration.md) |
|
|
180
|
+
| [01. Tool Overview and Architecture](https://github.com/SpreadWorks/sdd-forge/blob/main/docs/overview.md) | This chapter introduces sdd-forge, a CLI tool for Spec-Driven Development that automates technical documentation gene… |
|
|
181
|
+
| [02. CLI Command Reference](https://github.com/SpreadWorks/sdd-forge/blob/main/docs/cli_commands.md) | sdd-forge provides 20+ commands organized into four namespaces (`docs`, `spec`, `flow`, and standalone commands) thro… |
|
|
182
|
+
| [03. Configuration and Customization](https://github.com/SpreadWorks/sdd-forge/blob/main/docs/configuration.md) | sdd-forge is configured primarily through `.sdd-forge/config.json`, which controls output language, project type, doc… |
|
|
183
|
+
| [04. Internal Design](https://github.com/SpreadWorks/sdd-forge/blob/main/docs/internal_design.md) | This chapter describes the internal architecture of sdd-forge, covering its three-layer directory structure (`src/` →… |
|
|
184
184
|
<!-- {{/data}} -->
|
|
185
185
|
|
|
186
186
|
## License
|
package/docs/cli_commands.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## Description
|
|
4
4
|
|
|
5
5
|
<!-- {{text: Write a 1-2 sentence overview of this chapter. Include the total number of commands and subcommand structure.}} -->
|
|
6
|
-
|
|
6
|
+
sdd-forge provides 20+ commands organized into four namespaces (`docs`, `spec`, `flow`, and standalone commands) through a three-level dispatch architecture. The CLI entry point (`sdd-forge`) routes to namespace dispatchers, which in turn delegate to individual command implementations under `commands/` directories.
|
|
7
7
|
<!-- {{/text}} -->
|
|
8
8
|
|
|
9
9
|
## Content
|
|
@@ -11,311 +11,249 @@ This chapter documents all 20 CLI commands available in sdd-forge, covering proj
|
|
|
11
11
|
### Command List
|
|
12
12
|
|
|
13
13
|
<!-- {{text[mode=deep]: List all commands in table format. Include command name, description, and key options. Extract comprehensively from command definitions and routing in the source code.}} -->
|
|
14
|
-
| Command |
|
|
15
|
-
|
|
16
|
-
| `
|
|
17
|
-
| `setup` |
|
|
18
|
-
| `upgrade` |
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
22
|
-
| `forge
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
25
|
-
| `
|
|
26
|
-
| `
|
|
27
|
-
| `
|
|
28
|
-
| `
|
|
29
|
-
| `
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
14
|
+
| Command | Description | Key Options |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| `sdd-forge help` | Display all available commands grouped by section | — |
|
|
17
|
+
| `sdd-forge setup` | Interactive project setup wizard; generates `.sdd-forge/config.json` | `--name`, `--path`, `--type`, `--purpose`, `--tone`, `--agent`, `--lang`, `--dry-run` |
|
|
18
|
+
| `sdd-forge upgrade` | Upgrade template-derived files (skills, etc.) to match installed version | `--dry-run` |
|
|
19
|
+
| `sdd-forge presets list` | Display the preset inheritance tree | — |
|
|
20
|
+
| `sdd-forge docs build` | Run the full documentation pipeline (scan→enrich→init→data→text→readme→agents→translate) | `--agent`, `--force`, `--dry-run`, `--verbose` |
|
|
21
|
+
| `sdd-forge docs scan` | Scan source code and generate `analysis.json` | — |
|
|
22
|
+
| `sdd-forge docs enrich` | AI-enrich analysis entries with summary, detail, chapter, and role metadata | `--agent`, `--dry-run`, `--stdout` |
|
|
23
|
+
| `sdd-forge docs init` | Initialize chapter files from preset templates | `--force`, `--dry-run` |
|
|
24
|
+
| `sdd-forge docs data` | Resolve `{{data}}` directives in chapter files | `--dry-run` |
|
|
25
|
+
| `sdd-forge docs text` | AI-fill `{{text}}` directives in chapter files | `--dry-run` |
|
|
26
|
+
| `sdd-forge docs readme` | Auto-generate `README.md` from chapter files and templates | `--dry-run`, `--lang`, `--output` |
|
|
27
|
+
| `sdd-forge docs forge` | Iteratively improve docs via AI agent and review cycles | `--prompt`, `--prompt-file`, `--spec`, `--max-runs`, `--review-cmd`, `--mode`, `--dry-run`, `--verbose` |
|
|
28
|
+
| `sdd-forge docs review` | Review generated documentation for quality issues | — |
|
|
29
|
+
| `sdd-forge docs translate` | Translate default-language docs to configured non-default languages | `--lang`, `--force`, `--dry-run` |
|
|
30
|
+
| `sdd-forge docs changelog` | Generate changelog from commit history | — |
|
|
31
|
+
| `sdd-forge docs agents` | Update AGENTS.md by resolving directives and AI-refining the PROJECT section | `--dry-run` |
|
|
32
|
+
| `sdd-forge docs snapshot` | Create a snapshot of current documentation state | — |
|
|
33
|
+
| `sdd-forge spec init` | Create a numbered feature branch and spec directory with templates | `--title`, `--base`, `--dry-run`, `--allow-dirty`, `--no-branch`, `--worktree` |
|
|
34
|
+
| `sdd-forge spec gate` | Pre-implementation gate check on spec completeness and guardrail compliance | `--spec`, `--phase`, `--skip-guardrail` |
|
|
35
|
+
| `sdd-forge spec guardrail` | Initialize or update project guardrail rules | Subcommands: `init`, `update`; `--force`, `--dry-run`, `--agent` |
|
|
36
|
+
| `sdd-forge flow start` | Run the full SDD flow (spec init → gate → forge) | `--request`, `--title`, `--spec`, `--agent`, `--max-runs`, `--forge-mode`, `--no-branch`, `--worktree`, `--dry-run` |
|
|
37
|
+
| `sdd-forge flow status` | Display or update SDD flow progress | `--step`, `--status`, `--summary`, `--req`, `--archive` |
|
|
38
|
+
| `sdd-forge flow review` | Run code quality review (draft → final → apply) after implementation | `--dry-run`, `--skip-confirm` |
|
|
36
39
|
<!-- {{/text}} -->
|
|
37
40
|
|
|
38
41
|
### Global Options
|
|
39
42
|
|
|
40
43
|
<!-- {{text[mode=deep]: Describe global options shared by all commands in table format. Extract from argument parsing logic in the source code.}} -->
|
|
41
|
-
The following options are
|
|
44
|
+
The following options are recognized at the top level or shared across most subcommands via the common `parseArgs` utility:
|
|
42
45
|
|
|
43
|
-
| Option |
|
|
44
|
-
|
|
45
|
-
| `--
|
|
46
|
-
|
|
|
47
|
-
| `--
|
|
46
|
+
| Option | Description |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `-h`, `--help` | Display help information for the current command or subcommand. Available on all commands. |
|
|
49
|
+
| `-v`, `--version`, `-V` | Print the installed sdd-forge version and exit. Handled at the top-level entry point. |
|
|
50
|
+
| `--dry-run` | Simulate the command without writing any files to disk. Supported by `build`, `init`, `data`, `text`, `readme`, `translate`, `agents`, `forge`, `setup`, `upgrade`, `spec init`, `flow start`, and `flow review`. |
|
|
51
|
+
| `--verbose` | Enable verbose output with detailed progress information. Supported by `build` and `forge`. |
|
|
48
52
|
|
|
49
|
-
|
|
53
|
+
Note: sdd-forge uses a custom `parseArgs` function (in `src/lib/cli.js`) that supports flag normalization (e.g., `--dry-run` → `dryRun`), option aliases (e.g., `-v` → `--verbose`), and default values. Each command declares its own accepted flags and options independently.
|
|
50
54
|
<!-- {{/text}} -->
|
|
51
55
|
|
|
52
56
|
### Command Details
|
|
53
57
|
|
|
54
58
|
<!-- {{text[mode=deep]: Describe each command's usage, options, and examples in detail. Create a #### subsection for each command. Extract from argument definitions and help messages in the source code.}} -->
|
|
55
|
-
#### help
|
|
59
|
+
#### sdd-forge help
|
|
56
60
|
|
|
57
|
-
|
|
61
|
+
Displays all available commands organized into sections: Project, Docs, Spec, Flow, and Info. Uses ANSI formatting for terminal output. Language is determined by `.sdd-forge/config.json` `lang` setting.
|
|
58
62
|
|
|
59
63
|
```
|
|
60
64
|
sdd-forge help
|
|
61
|
-
sdd-forge
|
|
65
|
+
sdd-forge --help
|
|
62
66
|
sdd-forge -h
|
|
63
67
|
```
|
|
64
68
|
|
|
65
|
-
#### setup
|
|
69
|
+
#### sdd-forge setup
|
|
66
70
|
|
|
67
|
-
|
|
71
|
+
Interactive wizard that registers a project and generates `.sdd-forge/config.json`. Prompts for project name, source path, output language, architecture type, document style, and default agent. Creates required directories (`.sdd-forge/output`, `docs`, `specs`), sets up `AGENTS.md`, `CLAUDE.md`, and skill templates.
|
|
68
72
|
|
|
69
73
|
```
|
|
70
74
|
sdd-forge setup
|
|
71
|
-
sdd-forge setup --name myapp --path /path/to/src --type webapp/cakephp2
|
|
75
|
+
sdd-forge setup --name myapp --path /path/to/src --type webapp/cakephp2
|
|
72
76
|
```
|
|
73
77
|
|
|
74
|
-
|
|
75
|
-
|---|---|
|
|
76
|
-
| `--name <name>` | Project name |
|
|
77
|
-
| `--path <path>` | Source code directory |
|
|
78
|
-
| `--work-root <path>` | Working root (defaults to source path) |
|
|
79
|
-
| `--type <preset>` | Preset identifier (e.g. `webapp/cakephp2`, `cli/node-cli`) |
|
|
80
|
-
| `--purpose <text>` | Documentation purpose description |
|
|
81
|
-
| `--tone <text>` | Documentation tone |
|
|
82
|
-
| `--agent <name>` | Default AI agent name |
|
|
83
|
-
| `--lang <code>` | Output language code |
|
|
84
|
-
| `--set-default` | Mark this project as the default |
|
|
85
|
-
| `--dry-run` | Show what would be written without writing |
|
|
78
|
+
When all required options (`--name`, `--path`, `--type`, `--purpose`, `--tone`) are provided, the wizard runs non-interactively.
|
|
86
79
|
|
|
87
|
-
#### upgrade
|
|
80
|
+
#### sdd-forge upgrade
|
|
88
81
|
|
|
89
|
-
Upgrades template-
|
|
82
|
+
Upgrades template-derived files to match the currently installed sdd-forge version. Compares skill templates in `src/templates/skills/` with `.agents/skills/` and overwrites changed files. Converts symlinks to real files if needed. Also checks `config.json` for missing settings and prints configuration hints.
|
|
90
83
|
|
|
91
84
|
```
|
|
92
85
|
sdd-forge upgrade
|
|
93
86
|
sdd-forge upgrade --dry-run
|
|
94
87
|
```
|
|
95
88
|
|
|
96
|
-
####
|
|
89
|
+
#### sdd-forge presets list
|
|
97
90
|
|
|
98
|
-
|
|
91
|
+
Displays the preset inheritance tree in a visual tree format. Shows base, architecture, and leaf presets with their labels, aliases, and scan keys. Indicates which architecture layers have templates directories.
|
|
99
92
|
|
|
100
93
|
```
|
|
101
|
-
sdd-forge
|
|
102
|
-
sdd-forge default myapp # set "myapp" as default
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
#### build
|
|
106
|
-
|
|
107
|
-
Executes the full documentation generation pipeline in order: `scan → enrich → init → data → text → readme → agents`. If `output.isMultiLang` is `true` in the configuration, a `translate` (or per-language generate) step is appended. Progress is reported via a weighted progress bar.
|
|
108
|
-
|
|
109
|
-
```
|
|
110
|
-
sdd-forge build
|
|
111
|
-
sdd-forge build --agent claude --force --verbose
|
|
112
|
-
sdd-forge build --dry-run
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
| Option | Description |
|
|
116
|
-
|---|---|
|
|
117
|
-
| `--agent <name>` | AI agent to use for `enrich` and `text` steps (overrides `config.defaultAgent`) |
|
|
118
|
-
| `--force` | Force re-initialisation of existing docs files |
|
|
119
|
-
| `--verbose` | Show per-step log output |
|
|
120
|
-
| `--dry-run` | Skip all file writes |
|
|
121
|
-
|
|
122
|
-
#### init
|
|
123
|
-
|
|
124
|
-
Initialises (or re-initialises) `docs/` from the preset templates. Existing files are skipped unless `--force` is set.
|
|
125
|
-
|
|
126
|
-
```
|
|
127
|
-
sdd-forge init
|
|
128
|
-
sdd-forge init --force
|
|
94
|
+
sdd-forge presets list
|
|
129
95
|
```
|
|
130
96
|
|
|
131
|
-
#### forge
|
|
97
|
+
#### sdd-forge docs build
|
|
132
98
|
|
|
133
|
-
|
|
99
|
+
Runs the full documentation generation pipeline in sequence: `scan` → `enrich` → `init` → `data` → `text` → `readme` → `agents` → `translate` (if multi-language is configured). Displays a progress bar during execution. Steps that require an AI agent (`enrich`, `text`) are skipped if no `defaultAgent` is configured.
|
|
134
100
|
|
|
135
101
|
```
|
|
136
|
-
sdd-forge
|
|
137
|
-
sdd-forge
|
|
102
|
+
sdd-forge docs build
|
|
103
|
+
sdd-forge docs build --force --verbose
|
|
104
|
+
sdd-forge docs build --dry-run
|
|
138
105
|
```
|
|
139
106
|
|
|
140
107
|
| Option | Description |
|
|
141
108
|
|---|---|
|
|
142
|
-
| `--
|
|
143
|
-
| `--
|
|
144
|
-
| `--
|
|
145
|
-
| `--
|
|
146
|
-
| `--agent <name>` | Override the configured default agent |
|
|
147
|
-
| `--dry-run` | Skip writes |
|
|
148
|
-
|
|
149
|
-
#### review
|
|
150
|
-
|
|
151
|
-
Runs quality checks against the review checklist (`templates/review-checklist.md`) and reports any issues found in `docs/`. Exits non-zero if the check fails.
|
|
152
|
-
|
|
153
|
-
```
|
|
154
|
-
sdd-forge review
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
#### changelog
|
|
158
|
-
|
|
159
|
-
Reads all `specs/NNN-*/spec.md` files and generates or updates `change_log.md` in the project root.
|
|
160
|
-
|
|
161
|
-
```
|
|
162
|
-
sdd-forge changelog
|
|
163
|
-
```
|
|
109
|
+
| `--agent` | Override the default agent for AI-powered steps |
|
|
110
|
+
| `--force` | Force regeneration of chapter files even if they exist |
|
|
111
|
+
| `--dry-run` | Simulate the pipeline without writing files |
|
|
112
|
+
| `--verbose` | Show detailed progress output |
|
|
164
113
|
|
|
165
|
-
####
|
|
114
|
+
#### sdd-forge docs enrich
|
|
166
115
|
|
|
167
|
-
|
|
116
|
+
Uses AI to annotate each entry in `analysis.json` with `summary`, `detail`, `chapter`, and `role` metadata. Processes entries in batches based on total line count (default: 3000 lines per batch) or item count (default: 20 items). Supports resume — previously enriched entries are skipped, and progress is saved after each batch.
|
|
168
117
|
|
|
169
118
|
```
|
|
170
|
-
sdd-forge
|
|
171
|
-
sdd-forge
|
|
172
|
-
sdd-forge agents --project # update project section only
|
|
173
|
-
sdd-forge agents --dry-run
|
|
119
|
+
sdd-forge docs enrich
|
|
120
|
+
sdd-forge docs enrich --dry-run --stdout
|
|
174
121
|
```
|
|
175
122
|
|
|
176
|
-
#### readme
|
|
123
|
+
#### sdd-forge docs readme
|
|
177
124
|
|
|
178
|
-
Generates `README.md`
|
|
125
|
+
Generates `README.md` from preset templates using bottom-up template resolution. Resolves `{{data}}` and `{{text}}` directives, strips block directives, and normalizes formatting. Supports multi-language output by switching `docsDir` to language-specific directories.
|
|
179
126
|
|
|
180
127
|
```
|
|
181
|
-
sdd-forge readme
|
|
182
|
-
sdd-forge readme --
|
|
128
|
+
sdd-forge docs readme
|
|
129
|
+
sdd-forge docs readme --lang ja --output docs/ja/README.md
|
|
130
|
+
sdd-forge docs readme --dry-run
|
|
183
131
|
```
|
|
184
132
|
|
|
185
|
-
####
|
|
133
|
+
#### sdd-forge docs forge
|
|
186
134
|
|
|
187
|
-
|
|
135
|
+
Iteratively improves documentation through AI agent and review cycles. Operates in three modes: `local` (default), `assist`, and `agent`. Pre-populates `{{data}}` placeholders and `{{text}}` directives from analysis before running the AI. Supports spec-based file targeting via keyword matching.
|
|
188
136
|
|
|
189
137
|
```
|
|
190
|
-
sdd-forge
|
|
191
|
-
sdd-forge
|
|
192
|
-
sdd-forge
|
|
138
|
+
sdd-forge docs forge --prompt "improve API documentation"
|
|
139
|
+
sdd-forge docs forge --spec specs/001-feature/spec.md --mode agent
|
|
140
|
+
sdd-forge docs forge --max-runs 5 --review-cmd "sdd-forge docs review"
|
|
193
141
|
```
|
|
194
142
|
|
|
195
143
|
| Option | Description |
|
|
196
144
|
|---|---|
|
|
197
|
-
| `--
|
|
198
|
-
| `--
|
|
199
|
-
| `--
|
|
145
|
+
| `--prompt` | Improvement prompt for the AI agent |
|
|
146
|
+
| `--prompt-file` | Read prompt from a file |
|
|
147
|
+
| `--spec` | Path to spec file for scoped file targeting |
|
|
148
|
+
| `--max-runs` | Maximum iteration rounds (default: 3) |
|
|
149
|
+
| `--review-cmd` | Review command to run after each round (default: `sdd-forge docs review`) |
|
|
150
|
+
| `--mode` | Agent mode: `local`, `assist`, or `agent` |
|
|
200
151
|
|
|
201
|
-
####
|
|
152
|
+
#### sdd-forge docs translate
|
|
202
153
|
|
|
203
|
-
|
|
154
|
+
Translates default-language documentation to configured non-default languages using AI. Compares `mtime` of source and target files for differential translation. Respects `documentStyle.tone` settings for language-appropriate style (e.g., です/ます for Japanese polite tone).
|
|
204
155
|
|
|
205
156
|
```
|
|
206
|
-
sdd-forge
|
|
157
|
+
sdd-forge docs translate
|
|
158
|
+
sdd-forge docs translate --lang ja --force
|
|
159
|
+
sdd-forge docs translate --dry-run
|
|
207
160
|
```
|
|
208
161
|
|
|
209
|
-
####
|
|
162
|
+
#### sdd-forge docs agents
|
|
210
163
|
|
|
211
|
-
|
|
164
|
+
Updates `AGENTS.md` by resolving `{{data: agents.sdd}}` and `{{data: agents.project}}` directives. The PROJECT section is refined by AI using generated docs, `package.json` scripts, and the SDD section as context.
|
|
212
165
|
|
|
213
166
|
```
|
|
214
|
-
sdd-forge
|
|
167
|
+
sdd-forge docs agents
|
|
168
|
+
sdd-forge docs agents --dry-run
|
|
215
169
|
```
|
|
216
170
|
|
|
217
|
-
####
|
|
171
|
+
#### sdd-forge spec init
|
|
218
172
|
|
|
219
|
-
|
|
173
|
+
Creates a numbered feature branch and spec directory with `spec.md` and `qa.md` templates. Supports three modes: default (creates a git branch), `--worktree` (creates an isolated git worktree), and `--no-branch` (spec files only). Automatically detects the next available sequence number from existing specs and branches.
|
|
220
174
|
|
|
221
175
|
```
|
|
222
|
-
sdd-forge
|
|
223
|
-
sdd-forge
|
|
176
|
+
sdd-forge spec init --title "contact-form"
|
|
177
|
+
sdd-forge spec init --title "login-feature" --base development --worktree
|
|
178
|
+
sdd-forge spec init --title "quick-fix" --no-branch --allow-dirty
|
|
224
179
|
```
|
|
225
180
|
|
|
226
|
-
####
|
|
181
|
+
#### sdd-forge spec gate
|
|
227
182
|
|
|
228
|
-
|
|
183
|
+
Pre-implementation gate check that verifies spec completeness. Detects unresolved tokens (`TBD`, `TODO`, `FIXME`, `NEEDS CLARIFICATION`), unchecked tasks, missing required sections (`Clarifications`, `Open Questions`, `User Confirmation`, `Acceptance Criteria`), and unapproved user confirmation checkboxes. Optionally runs AI-powered guardrail compliance checking.
|
|
229
184
|
|
|
230
185
|
```
|
|
231
|
-
sdd-forge
|
|
232
|
-
sdd-forge
|
|
186
|
+
sdd-forge spec gate --spec specs/001-feature/spec.md
|
|
187
|
+
sdd-forge spec gate --spec specs/001-feature/spec.md --phase post
|
|
188
|
+
sdd-forge spec gate --spec specs/001-feature/spec.md --skip-guardrail
|
|
233
189
|
```
|
|
234
190
|
|
|
235
|
-
|
|
191
|
+
| Option | Description |
|
|
192
|
+
|---|---|
|
|
193
|
+
| `--spec` | Path to spec.md file (required) |
|
|
194
|
+
| `--phase` | `pre` (default) or `post` — pre phase skips Status/Acceptance Criteria unchecked items |
|
|
195
|
+
| `--skip-guardrail` | Skip guardrail AI compliance check |
|
|
196
|
+
|
|
197
|
+
#### sdd-forge spec guardrail
|
|
236
198
|
|
|
237
|
-
|
|
199
|
+
Manages project guardrail rules (immutable principles for spec compliance). The `init` subcommand generates `guardrail.md` from preset templates with language fallback. The `update` subcommand uses AI to propose additional project-specific articles based on `analysis.json`.
|
|
238
200
|
|
|
239
201
|
```
|
|
240
|
-
sdd-forge spec
|
|
241
|
-
sdd-forge spec --
|
|
242
|
-
sdd-forge spec
|
|
243
|
-
sdd-forge spec --title "contact-form" --dry-run
|
|
202
|
+
sdd-forge spec guardrail init
|
|
203
|
+
sdd-forge spec guardrail init --force --dry-run
|
|
204
|
+
sdd-forge spec guardrail update --agent claude
|
|
244
205
|
```
|
|
245
206
|
|
|
246
|
-
|
|
247
|
-
|---|---|
|
|
248
|
-
| `--title <text>` | Feature name — used for branch/directory slug (required) |
|
|
249
|
-
| `--base <branch>` | Base branch (defaults to current HEAD) |
|
|
250
|
-
| `--no-branch` | Create spec files only, no branch |
|
|
251
|
-
| `--worktree` | Create an isolated git worktree under `.sdd-forge/worktree/` |
|
|
252
|
-
| `--allow-dirty` | Skip the working-tree cleanliness check |
|
|
253
|
-
| `--dry-run` | Print what would be created without writing |
|
|
207
|
+
#### sdd-forge flow start
|
|
254
208
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
Validates a `spec.md` file for completeness before (`--phase pre`, default) or after (`--phase post`) implementation. Checks for unresolved tokens (`TBD`, `TODO`, `FIXME`, `[NEEDS CLARIFICATION]`), unchecked task items, required sections (`## Clarifications`, `## Open Questions`, `## User Confirmation`, `## Acceptance Criteria`), and the `- [x] User approved this spec` approval marker.
|
|
209
|
+
Runs the complete SDD flow: spec init → gate check → forge. Requires `--request` to describe the feature or fix. Automatically creates a spec, inserts the request text, runs gate validation, saves flow state to `flow.json`, and launches the forge process.
|
|
258
210
|
|
|
259
211
|
```
|
|
260
|
-
sdd-forge
|
|
261
|
-
sdd-forge
|
|
212
|
+
sdd-forge flow start --request "add login feature"
|
|
213
|
+
sdd-forge flow start --request "fix pagination bug" --forge-mode agent --max-runs 5
|
|
214
|
+
sdd-forge flow start --request "refactor auth" --worktree
|
|
262
215
|
```
|
|
263
216
|
|
|
264
|
-
|
|
265
|
-
|---|---|
|
|
266
|
-
| `--spec <path>` | Path to the spec file (required) |
|
|
267
|
-
| `--phase pre\|post` | Validation phase; `pre` skips task-item checks in Acceptance Criteria sections |
|
|
217
|
+
Gate failure exits with code 2 and displays unresolved items. If user confirmation is missing, specific instructions are shown.
|
|
268
218
|
|
|
269
|
-
#### flow
|
|
219
|
+
#### sdd-forge flow status
|
|
270
220
|
|
|
271
|
-
|
|
221
|
+
Displays or updates SDD flow progress stored in `.sdd-forge/flow.json`. Without options, shows spec path, branch info, step progress (with ✓/>/- icons), and requirements checklist. Supports step updates, requirement management, and flow archival.
|
|
272
222
|
|
|
273
223
|
```
|
|
274
|
-
sdd-forge flow
|
|
275
|
-
sdd-forge flow --
|
|
276
|
-
sdd-forge flow --
|
|
224
|
+
sdd-forge flow status
|
|
225
|
+
sdd-forge flow status --step gate --status done
|
|
226
|
+
sdd-forge flow status --summary '["implement auth", "add tests", "update docs"]'
|
|
227
|
+
sdd-forge flow status --req 0 --status done
|
|
228
|
+
sdd-forge flow status --archive
|
|
277
229
|
```
|
|
278
230
|
|
|
279
|
-
|
|
280
|
-
|---|---|
|
|
281
|
-
| `--request <text>` | The user's change request (required) |
|
|
282
|
-
| `--title <text>` | Spec title slug (derived from `--request` if omitted) |
|
|
283
|
-
| `--spec <path>` | Use an existing spec instead of creating one |
|
|
284
|
-
| `--agent <name>` | AI agent to pass to `forge` |
|
|
285
|
-
| `--max-runs <n>` | Maximum `forge` iterations (default: 5) |
|
|
286
|
-
| `--forge-mode <mode>` | `local` \| `assist` \| `agent` (default: `local`) |
|
|
287
|
-
| `--no-branch` | Create spec without a new branch |
|
|
288
|
-
| `--worktree` | Create an isolated git worktree |
|
|
289
|
-
| `--dry-run` | Skip writes in spec-init and forge steps |
|
|
290
|
-
|
|
291
|
-
#### presets list
|
|
231
|
+
#### sdd-forge flow review
|
|
292
232
|
|
|
293
|
-
|
|
233
|
+
Post-implementation code quality review with three phases: draft (generate improvement proposals), final (AI validation of each proposal as APPROVED/REJECTED), and apply. Extracts review targets from spec `## Scope` section or falls back to full `git diff` against the base branch. Generates `review.md` in the spec directory with checkbox-formatted results.
|
|
294
234
|
|
|
295
235
|
```
|
|
296
|
-
sdd-forge
|
|
297
|
-
sdd-forge
|
|
236
|
+
sdd-forge flow review
|
|
237
|
+
sdd-forge flow review --dry-run
|
|
238
|
+
sdd-forge flow review --skip-confirm
|
|
298
239
|
```
|
|
299
240
|
<!-- {{/text}} -->
|
|
300
241
|
|
|
301
242
|
### Exit Codes and Output
|
|
302
243
|
|
|
303
244
|
<!-- {{text[mode=deep]: Define exit codes and describe stdout/stderr conventions in table format. Extract from process.exit() calls and output patterns in the source code.}} -->
|
|
304
|
-
| Exit Code | Meaning |
|
|
245
|
+
| Exit Code | Meaning | Used By |
|
|
305
246
|
|---|---|---|
|
|
306
|
-
| `0` | Success |
|
|
307
|
-
| `1` | General error | Unknown
|
|
308
|
-
| `2` | Gate
|
|
309
|
-
|
|
310
|
-
**stdout conventions**
|
|
311
|
-
|
|
312
|
-
Informational progress messages, generated Markdown previews (dry-run), and final success summaries are written to `stdout`. The `build` command uses a weighted progress bar (via `createProgress()`) that prints step labels and optionally verbose per-step logs when `--verbose` is set. Commands that produce structured output (e.g. `default` listing projects, `presets list` showing the tree) write their formatted text directly to `stdout`.
|
|
247
|
+
| `0` | Success | All commands on successful completion |
|
|
248
|
+
| `1` | General error | Unknown subcommands, missing required options, missing config, runtime errors, build pipeline failures |
|
|
249
|
+
| `2` | Gate failure | `flow start` when `spec gate` check fails (unresolved items or missing user confirmation) |
|
|
313
250
|
|
|
314
|
-
**stderr conventions
|
|
251
|
+
**stdout/stderr conventions:**
|
|
315
252
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
253
|
+
| Stream | Content |
|
|
254
|
+
|---|---|
|
|
255
|
+
| `stdout` | Primary command output: generated content (`--dry-run` previews), status displays (`flow status`), spec file paths (`spec init`), tree displays (`presets list`), and help text |
|
|
256
|
+
| `stderr` | Progress indicators, step labels (e.g., `[draft] Generating proposals...`), warning messages (prefixed with `WARN:`), error messages (prefixed with `ERROR:`), and build pipeline progress bars |
|
|
319
257
|
|
|
320
|
-
|
|
258
|
+
Commands that support `--dry-run` write the would-be output to `stdout` while logging dry-run notices to `stderr`. The `forge` command uses `stderr` for progress tickers (dots printed at regular intervals during agent calls) and verbose agent output when `--verbose` is enabled. The `build` command uses a structured progress bar on `stderr` that tracks each pipeline step with weighted progress values.
|
|
321
259
|
<!-- {{/text}} -->
|