forge-workflow 1.1.3 → 1.3.0
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/.claude/settings.local.json +4 -1
- package/AGENTS.md +19 -202
- package/bin/forge.js +205 -40
- package/package.json +1 -1
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
"Bash(git add:*)",
|
|
13
13
|
"Bash(git commit:*)",
|
|
14
14
|
"Bash(git push)",
|
|
15
|
-
"Bash(\"C:\\\\Program Files\\\\nodejs\\\\npm.cmd\" pkg fix)"
|
|
15
|
+
"Bash(\"C:\\\\Program Files\\\\nodejs\\\\npm.cmd\" pkg fix)",
|
|
16
|
+
"WebFetch(domain:www.aihero.dev)",
|
|
17
|
+
"Bash(\"C:\\\\Program Files\\\\nodejs\\\\npm.cmd\" version minor --no-git-tag-version)",
|
|
18
|
+
"WebFetch(domain:ohmyopencode.com)"
|
|
16
19
|
]
|
|
17
20
|
}
|
|
18
21
|
}
|
package/AGENTS.md
CHANGED
|
@@ -1,217 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AGENTS.md
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This is a [describe what this project does in one sentence].
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Package manager**: npm (or specify: pnpm/yarn/bun)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|-------|---------|-------------|
|
|
9
|
-
| 1 | `/status` | Check current context, active work, recent completions |
|
|
10
|
-
| 2 | `/research` | Deep research with web search, document to docs/research/ |
|
|
11
|
-
| 3 | `/plan` | Create implementation plan, branch, OpenSpec if strategic |
|
|
12
|
-
| 4 | `/dev` | TDD development (RED-GREEN-REFACTOR cycles) |
|
|
13
|
-
| 5 | `/check` | Validation (type/lint/security/tests) |
|
|
14
|
-
| 6 | `/ship` | Create PR with full documentation |
|
|
15
|
-
| 7 | `/review` | Address ALL PR feedback |
|
|
16
|
-
| 8 | `/merge` | Update docs, merge PR, cleanup |
|
|
17
|
-
| 9 | `/verify` | Final documentation verification |
|
|
18
|
-
|
|
19
|
-
## Workflow Flow
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
/status → /research → /plan → /dev → /check → /ship → /review → /merge → /verify
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Core Principles
|
|
26
|
-
|
|
27
|
-
- **TDD-First**: Write tests BEFORE implementation (RED-GREEN-REFACTOR)
|
|
28
|
-
- **Research-First**: Understand before building, document decisions
|
|
29
|
-
- **Security Built-In**: OWASP Top 10 analysis for every feature
|
|
30
|
-
- **Documentation Progressive**: Update at each stage, verify at end
|
|
31
|
-
|
|
32
|
-
## Prerequisites
|
|
33
|
-
|
|
34
|
-
- Git, GitHub CLI (`gh`)
|
|
35
|
-
- Beads (recommended): `npm i -g @beads/bd && bd init`
|
|
36
|
-
- OpenSpec (optional): `npm i -g @fission-ai/openspec && openspec init`
|
|
37
|
-
|
|
38
|
-
## Toolchain Quick Reference
|
|
39
|
-
|
|
40
|
-
### Beads (Issue Tracking)
|
|
7
|
+
**Build commands**:
|
|
41
8
|
```bash
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
bd close <id> # Complete
|
|
47
|
-
bd sync # Git sync (always at session end!)
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### OpenSpec (Specs - AI Commands)
|
|
51
|
-
```bash
|
|
52
|
-
/opsx:new # Start change
|
|
53
|
-
/opsx:ff # Generate all planning docs
|
|
54
|
-
/opsx:apply # Implement tasks
|
|
55
|
-
/opsx:verify # Validate
|
|
56
|
-
/opsx:archive # Complete
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### GitHub CLI
|
|
60
|
-
```bash
|
|
61
|
-
gh pr create --title "..." --body "..."
|
|
62
|
-
gh pr view <n>
|
|
63
|
-
gh pr merge <n> --squash --delete-branch
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Quick Start
|
|
67
|
-
|
|
68
|
-
1. `/status` - Check where you are
|
|
69
|
-
2. `/research <feature-name>` - Research the feature
|
|
70
|
-
3. `/plan <feature-slug>` - Create formal plan
|
|
71
|
-
4. `/dev` - Implement with TDD
|
|
72
|
-
5. `/check` - Validate everything
|
|
73
|
-
6. `/ship` - Create PR
|
|
74
|
-
|
|
75
|
-
## Stage Details
|
|
76
|
-
|
|
77
|
-
### 1. Status (`/status`)
|
|
78
|
-
|
|
79
|
-
Check current context before starting work:
|
|
80
|
-
- Active issues (via Beads if installed)
|
|
81
|
-
- Recent completions
|
|
82
|
-
- Current branch state
|
|
83
|
-
- OpenSpec proposals in progress
|
|
84
|
-
|
|
85
|
-
### 2. Research (`/research <feature-name>`)
|
|
86
|
-
|
|
87
|
-
Research before building:
|
|
88
|
-
- Web search for best practices
|
|
89
|
-
- Security analysis (OWASP Top 10)
|
|
90
|
-
- Existing patterns in codebase
|
|
91
|
-
- Document to `docs/research/<feature>.md`
|
|
92
|
-
|
|
93
|
-
### 3. Plan (`/plan <feature-slug>`)
|
|
94
|
-
|
|
95
|
-
Create implementation plan:
|
|
96
|
-
- Create feature branch
|
|
97
|
-
- Define scope and approach
|
|
98
|
-
- Create tracking issue (Beads)
|
|
99
|
-
- OpenSpec proposal if strategic
|
|
100
|
-
|
|
101
|
-
### 4. Development (`/dev`)
|
|
102
|
-
|
|
103
|
-
TDD implementation:
|
|
104
|
-
- RED: Write failing test
|
|
105
|
-
- GREEN: Make it pass
|
|
106
|
-
- REFACTOR: Clean up
|
|
107
|
-
- Commit after each GREEN cycle
|
|
108
|
-
|
|
109
|
-
### 5. Check (`/check`)
|
|
110
|
-
|
|
111
|
-
Validate everything:
|
|
112
|
-
- Type checking
|
|
113
|
-
- Linting
|
|
114
|
-
- Unit tests
|
|
115
|
-
- Integration tests
|
|
116
|
-
- Security scan
|
|
117
|
-
|
|
118
|
-
### 6. Ship (`/ship`)
|
|
119
|
-
|
|
120
|
-
Create pull request:
|
|
121
|
-
- Push branch
|
|
122
|
-
- Create PR with documentation
|
|
123
|
-
- Link to research doc
|
|
124
|
-
- List test coverage
|
|
125
|
-
|
|
126
|
-
### 7. Review (`/review`)
|
|
127
|
-
|
|
128
|
-
Address ALL feedback:
|
|
129
|
-
- GitHub Actions failures
|
|
130
|
-
- Code review comments
|
|
131
|
-
- Security scan issues
|
|
132
|
-
- Automated tool feedback
|
|
133
|
-
|
|
134
|
-
### 8. Merge (`/merge`)
|
|
135
|
-
|
|
136
|
-
Complete the work:
|
|
137
|
-
- Update documentation
|
|
138
|
-
- Squash merge PR
|
|
139
|
-
- Archive OpenSpec (if used)
|
|
140
|
-
- Close tracking issues
|
|
141
|
-
|
|
142
|
-
### 9. Verify (`/verify`)
|
|
143
|
-
|
|
144
|
-
Final documentation check:
|
|
145
|
-
- All docs updated
|
|
146
|
-
- Cross-references valid
|
|
147
|
-
- Examples work
|
|
148
|
-
- README current
|
|
149
|
-
|
|
150
|
-
## Directory Structure
|
|
151
|
-
|
|
152
|
-
```
|
|
153
|
-
your-project/
|
|
154
|
-
├── AGENTS.md # This file (universal)
|
|
155
|
-
├── CLAUDE.md # Claude Code
|
|
156
|
-
├── GEMINI.md # Google Antigravity
|
|
157
|
-
├── .cursorrules # Cursor
|
|
158
|
-
├── .windsurfrules # Windsurf
|
|
159
|
-
├── .clinerules # Cline/Roo Code
|
|
160
|
-
├── .github/
|
|
161
|
-
│ └── copilot-instructions.md # GitHub Copilot
|
|
162
|
-
│
|
|
163
|
-
├── .claude/commands/ # Claude Code commands
|
|
164
|
-
├── .agent/workflows/ # Antigravity workflows
|
|
165
|
-
├── .cursor/rules/ # Cursor rules
|
|
166
|
-
├── .windsurf/workflows/ # Windsurf workflows
|
|
167
|
-
├── .kilocode/workflows/ # Kilo Code workflows
|
|
168
|
-
├── .opencode/commands/ # OpenCode commands
|
|
169
|
-
├── .continue/prompts/ # Continue prompts
|
|
170
|
-
├── .roo/commands/ # Roo Code commands
|
|
171
|
-
│
|
|
172
|
-
└── docs/
|
|
173
|
-
├── planning/
|
|
174
|
-
│ └── PROGRESS.md
|
|
175
|
-
├── research/
|
|
176
|
-
│ └── TEMPLATE.md
|
|
177
|
-
└── WORKFLOW.md
|
|
9
|
+
npm install # Install dependencies
|
|
10
|
+
npm run dev # Start development
|
|
11
|
+
npm run build # Production build
|
|
12
|
+
npm test # Run tests
|
|
178
13
|
```
|
|
179
14
|
|
|
180
|
-
|
|
15
|
+
**Workflow**: See [`docs/WORKFLOW.md`](docs/WORKFLOW.md) for the 9-stage TDD workflow.
|
|
181
16
|
|
|
182
|
-
|
|
183
|
-
- `.claude/skills/forge-workflow/SKILL.md`
|
|
184
|
-
- `.agent/skills/forge-workflow/SKILL.md` (Antigravity)
|
|
185
|
-
- `.cursor/skills/forge-workflow/SKILL.md`
|
|
186
|
-
- `.windsurf/skills/forge-workflow/SKILL.md`
|
|
187
|
-
- `.kilocode/skills/forge-workflow/SKILL.md`
|
|
188
|
-
- `.cline/skills/forge-workflow/SKILL.md`
|
|
189
|
-
- `.continue/skills/forge-workflow/SKILL.md`
|
|
190
|
-
- `.opencode/skills/forge-workflow/SKILL.md`
|
|
17
|
+
**Project-specific conventions**: Add them below as you discover patterns.
|
|
191
18
|
|
|
192
|
-
|
|
19
|
+
---
|
|
193
20
|
|
|
194
|
-
|
|
21
|
+
<!-- USER:START - Add learnings here as you work -->
|
|
195
22
|
|
|
196
|
-
|
|
197
|
-
|-------|-------------|----------|--------|
|
|
198
|
-
| Claude Code | CLAUDE.md | .claude/commands/ | .claude/skills/ |
|
|
199
|
-
| Google Antigravity | GEMINI.md | .agent/workflows/ | .agent/skills/ |
|
|
200
|
-
| Cursor | .cursorrules | .cursor/rules/ | .cursor/skills/ |
|
|
201
|
-
| Windsurf | .windsurfrules | .windsurf/workflows/ | .windsurf/skills/ |
|
|
202
|
-
| Kilo Code | AGENTS.md | .kilocode/workflows/ | .kilocode/skills/ |
|
|
203
|
-
| OpenCode | AGENTS.md | .opencode/commands/ | .opencode/skills/ |
|
|
204
|
-
| Cline | .clinerules | AGENTS.md | .cline/skills/ |
|
|
205
|
-
| Roo Code | .clinerules | .roo/commands/ | - |
|
|
206
|
-
| Continue | .continuerules | .continue/prompts/ | .continue/skills/ |
|
|
207
|
-
| GitHub Copilot | .github/copilot-instructions.md | .github/prompts/ | - |
|
|
208
|
-
| Aider | AGENTS.md (via config) | In-chat | - |
|
|
23
|
+
💡 **Keep this section minimal** - Instruction budget is ~150-200 instructions max.
|
|
209
24
|
|
|
210
|
-
|
|
25
|
+
As you work, when you give the same instruction twice, add it here:
|
|
26
|
+
- Coding style preferences
|
|
27
|
+
- Architecture decisions
|
|
28
|
+
- Domain concepts unique to this project
|
|
211
29
|
|
|
212
|
-
|
|
30
|
+
<!-- USER:END -->
|
|
213
31
|
|
|
214
32
|
---
|
|
215
33
|
|
|
216
|
-
See `docs/
|
|
217
|
-
See `docs/TOOLCHAIN.md` for comprehensive tool reference.
|
|
34
|
+
See [`docs/TOOLCHAIN.md`](docs/TOOLCHAIN.md) for comprehensive tool reference.
|
package/bin/forge.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Forge v1.
|
|
4
|
+
* Forge v1.3.0 - Universal AI Agent Workflow
|
|
5
5
|
* https://github.com/harshanandak/forge
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
@@ -591,6 +591,70 @@ function writeEnvTokens(tokens, preserveExisting = true) {
|
|
|
591
591
|
}
|
|
592
592
|
|
|
593
593
|
// Detect existing project installation status
|
|
594
|
+
// Smart merge for AGENTS.md - preserves USER sections, updates FORGE sections
|
|
595
|
+
function smartMergeAgentsMd(existingContent, newContent) {
|
|
596
|
+
// Check if existing content has markers
|
|
597
|
+
const hasUserMarkers = existingContent.includes('<!-- USER:START') && existingContent.includes('<!-- USER:END');
|
|
598
|
+
const hasForgeMarkers = existingContent.includes('<!-- FORGE:START') && existingContent.includes('<!-- FORGE:END');
|
|
599
|
+
|
|
600
|
+
if (!hasUserMarkers || !hasForgeMarkers) {
|
|
601
|
+
// Old format without markers - return new content (let user decide via overwrite prompt)
|
|
602
|
+
return null;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
// Extract USER section from existing content
|
|
606
|
+
const userStartMatch = existingContent.match(/<!-- USER:START.*?-->([\s\S]*?)<!-- USER:END -->/);
|
|
607
|
+
const userSection = userStartMatch ? userStartMatch[0] : '';
|
|
608
|
+
|
|
609
|
+
// Extract FORGE section from new content
|
|
610
|
+
const forgeStartMatch = newContent.match(/(<!-- FORGE:START.*?-->[\s\S]*?<!-- FORGE:END -->)/);
|
|
611
|
+
const forgeSection = forgeStartMatch ? forgeStartMatch[0] : '';
|
|
612
|
+
|
|
613
|
+
// Build merged content
|
|
614
|
+
const setupInstructions = newContent.includes('<!-- FORGE:SETUP-INSTRUCTIONS')
|
|
615
|
+
? newContent.match(/(<!-- FORGE:SETUP-INSTRUCTIONS[\s\S]*?-->)/)?.[0] || ''
|
|
616
|
+
: '';
|
|
617
|
+
|
|
618
|
+
let merged = '# AGENTS.md\n\n';
|
|
619
|
+
|
|
620
|
+
// Add setup instructions if this is first-time setup
|
|
621
|
+
if (setupInstructions && !existingContent.includes('FORGE:SETUP-INSTRUCTIONS')) {
|
|
622
|
+
merged += setupInstructions + '\n\n';
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
// Add preserved USER section
|
|
626
|
+
merged += userSection + '\n\n';
|
|
627
|
+
|
|
628
|
+
// Add updated FORGE section
|
|
629
|
+
merged += forgeSection + '\n\n';
|
|
630
|
+
|
|
631
|
+
// Add footer
|
|
632
|
+
merged += `---\n\n## 💡 Improving This Workflow\n\nEvery time you give the same instruction twice, add it to this file:\n1. User-specific rules → Add to USER:START section above\n2. Forge workflow improvements → Suggest to forge maintainers\n\n**Keep this file updated as you learn about the project.**\n\n---\n\nSee \`docs/WORKFLOW.md\` for complete workflow guide.\nSee \`docs/TOOLCHAIN.md\` for comprehensive tool reference.\n`;
|
|
633
|
+
|
|
634
|
+
return merged;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
// Helper function for yes/no prompts with validation
|
|
638
|
+
async function askYesNo(question, prompt, defaultNo = true) {
|
|
639
|
+
const defaultText = defaultNo ? '[n]' : '[y]';
|
|
640
|
+
while (true) {
|
|
641
|
+
const answer = await question(`${prompt} (y/n) ${defaultText}: `);
|
|
642
|
+
const normalized = answer.trim().toLowerCase();
|
|
643
|
+
|
|
644
|
+
// Handle empty input (use default)
|
|
645
|
+
if (normalized === '') return defaultNo ? false : true;
|
|
646
|
+
|
|
647
|
+
// Accept yes variations
|
|
648
|
+
if (normalized === 'y' || normalized === 'yes') return true;
|
|
649
|
+
|
|
650
|
+
// Accept no variations
|
|
651
|
+
if (normalized === 'n' || normalized === 'no') return false;
|
|
652
|
+
|
|
653
|
+
// Invalid input - re-prompt
|
|
654
|
+
console.log(' Please enter y or n');
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
|
|
594
658
|
function detectProjectStatus() {
|
|
595
659
|
const status = {
|
|
596
660
|
type: 'fresh', // 'fresh', 'upgrade', or 'partial'
|
|
@@ -604,10 +668,10 @@ function detectProjectStatus() {
|
|
|
604
668
|
// Determine installation type
|
|
605
669
|
if (status.hasAgentsMd && status.hasClaudeCommands && status.hasDocsWorkflow) {
|
|
606
670
|
status.type = 'upgrade'; // Full forge installation exists
|
|
607
|
-
} else if (status.
|
|
608
|
-
status.type = 'partial'; //
|
|
671
|
+
} else if (status.hasClaudeCommands || status.hasEnvLocal) {
|
|
672
|
+
status.type = 'partial'; // Agent-specific files exist (not just base files from postinstall)
|
|
609
673
|
}
|
|
610
|
-
// else: 'fresh' - new installation
|
|
674
|
+
// else: 'fresh' - new installation (or just postinstall baseline with AGENTS.md)
|
|
611
675
|
|
|
612
676
|
// Parse existing env vars if .env.local exists
|
|
613
677
|
if (status.hasEnvLocal) {
|
|
@@ -641,8 +705,8 @@ async function configureExternalServices(rl, question, selectedAgents = [], proj
|
|
|
641
705
|
}
|
|
642
706
|
console.log('');
|
|
643
707
|
|
|
644
|
-
const reconfigure = await question
|
|
645
|
-
if (reconfigure
|
|
708
|
+
const reconfigure = await askYesNo(question, 'Reconfigure external services?', true);
|
|
709
|
+
if (!reconfigure) {
|
|
646
710
|
console.log('');
|
|
647
711
|
console.log('Keeping existing configuration.');
|
|
648
712
|
return;
|
|
@@ -654,9 +718,9 @@ async function configureExternalServices(rl, question, selectedAgents = [], proj
|
|
|
654
718
|
console.log('(You can also add them later to .env.local)');
|
|
655
719
|
console.log('');
|
|
656
720
|
|
|
657
|
-
const configure = await question
|
|
721
|
+
const configure = await askYesNo(question, 'Configure external services?', false);
|
|
658
722
|
|
|
659
|
-
if (configure
|
|
723
|
+
if (!configure) {
|
|
660
724
|
console.log('');
|
|
661
725
|
console.log('Skipping external services. You can configure them later by editing .env.local');
|
|
662
726
|
return;
|
|
@@ -867,7 +931,7 @@ function showBanner(subtitle = 'Universal AI Agent Workflow') {
|
|
|
867
931
|
console.log(' ██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝ ');
|
|
868
932
|
console.log(' ██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗');
|
|
869
933
|
console.log(' ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝');
|
|
870
|
-
console.log(' v1.
|
|
934
|
+
console.log(' v1.3.0');
|
|
871
935
|
console.log('');
|
|
872
936
|
if (subtitle) {
|
|
873
937
|
console.log(` ${subtitle}`);
|
|
@@ -876,6 +940,23 @@ function showBanner(subtitle = 'Universal AI Agent Workflow') {
|
|
|
876
940
|
|
|
877
941
|
// Minimal installation (postinstall)
|
|
878
942
|
function minimalInstall() {
|
|
943
|
+
// Check if this looks like a project (has package.json)
|
|
944
|
+
const hasPackageJson = fs.existsSync(path.join(projectRoot, 'package.json'));
|
|
945
|
+
|
|
946
|
+
if (!hasPackageJson) {
|
|
947
|
+
console.log('');
|
|
948
|
+
console.log(' ✅ Forge installed successfully!');
|
|
949
|
+
console.log('');
|
|
950
|
+
console.log(' To set up in a project:');
|
|
951
|
+
console.log(' cd your-project');
|
|
952
|
+
console.log(' npx forge setup');
|
|
953
|
+
console.log('');
|
|
954
|
+
console.log(' Or specify a project directory:');
|
|
955
|
+
console.log(' npx forge setup --path ./my-project');
|
|
956
|
+
console.log('');
|
|
957
|
+
return;
|
|
958
|
+
}
|
|
959
|
+
|
|
879
960
|
showBanner();
|
|
880
961
|
console.log('');
|
|
881
962
|
|
|
@@ -1125,6 +1206,11 @@ async function interactiveSetup() {
|
|
|
1125
1206
|
|
|
1126
1207
|
showBanner('Agent Configuration');
|
|
1127
1208
|
|
|
1209
|
+
// Show target directory
|
|
1210
|
+
console.log(` Target directory: ${process.cwd()}`);
|
|
1211
|
+
console.log(' (Use --path <dir> to change target directory)');
|
|
1212
|
+
console.log('');
|
|
1213
|
+
|
|
1128
1214
|
// Check prerequisites first
|
|
1129
1215
|
checkPrerequisites();
|
|
1130
1216
|
console.log('');
|
|
@@ -1161,8 +1247,8 @@ async function interactiveSetup() {
|
|
|
1161
1247
|
|
|
1162
1248
|
// Ask about overwriting AGENTS.md if it exists
|
|
1163
1249
|
if (projectStatus.hasAgentsMd) {
|
|
1164
|
-
const overwriteAgents = await question
|
|
1165
|
-
if (overwriteAgents
|
|
1250
|
+
const overwriteAgents = await askYesNo(question, 'Found existing AGENTS.md. Overwrite?', true);
|
|
1251
|
+
if (!overwriteAgents) {
|
|
1166
1252
|
skipFiles.agentsMd = true;
|
|
1167
1253
|
console.log(' Keeping existing AGENTS.md');
|
|
1168
1254
|
} else {
|
|
@@ -1172,8 +1258,8 @@ async function interactiveSetup() {
|
|
|
1172
1258
|
|
|
1173
1259
|
// Ask about overwriting .claude/commands/ if it exists
|
|
1174
1260
|
if (projectStatus.hasClaudeCommands) {
|
|
1175
|
-
const overwriteCommands = await question
|
|
1176
|
-
if (overwriteCommands
|
|
1261
|
+
const overwriteCommands = await askYesNo(question, 'Found existing .claude/commands/. Overwrite?', true);
|
|
1262
|
+
if (!overwriteCommands) {
|
|
1177
1263
|
skipFiles.claudeCommands = true;
|
|
1178
1264
|
console.log(' Keeping existing .claude/commands/');
|
|
1179
1265
|
} else {
|
|
@@ -1246,8 +1332,28 @@ async function interactiveSetup() {
|
|
|
1246
1332
|
console.log(' Skipped: AGENTS.md (keeping existing)');
|
|
1247
1333
|
} else {
|
|
1248
1334
|
const agentsSrc = path.join(packageDir, 'AGENTS.md');
|
|
1249
|
-
|
|
1250
|
-
|
|
1335
|
+
const agentsDest = path.join(projectRoot, 'AGENTS.md');
|
|
1336
|
+
|
|
1337
|
+
// Try smart merge if file exists
|
|
1338
|
+
if (fs.existsSync(agentsDest)) {
|
|
1339
|
+
const existingContent = fs.readFileSync(agentsDest, 'utf8');
|
|
1340
|
+
const newContent = fs.readFileSync(agentsSrc, 'utf8');
|
|
1341
|
+
const merged = smartMergeAgentsMd(existingContent, newContent);
|
|
1342
|
+
|
|
1343
|
+
if (merged) {
|
|
1344
|
+
fs.writeFileSync(agentsDest, merged, 'utf8');
|
|
1345
|
+
console.log(' Updated: AGENTS.md (preserved USER sections)');
|
|
1346
|
+
} else {
|
|
1347
|
+
// No markers, do normal copy (user already approved overwrite)
|
|
1348
|
+
if (copyFile(agentsSrc, 'AGENTS.md')) {
|
|
1349
|
+
console.log(' Updated: AGENTS.md (universal standard)');
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
} else {
|
|
1353
|
+
// New file
|
|
1354
|
+
if (copyFile(agentsSrc, 'AGENTS.md')) {
|
|
1355
|
+
console.log(' Created: AGENTS.md (universal standard)');
|
|
1356
|
+
}
|
|
1251
1357
|
}
|
|
1252
1358
|
}
|
|
1253
1359
|
|
|
@@ -1305,7 +1411,7 @@ async function interactiveSetup() {
|
|
|
1305
1411
|
// =============================================
|
|
1306
1412
|
console.log('');
|
|
1307
1413
|
console.log('==============================================');
|
|
1308
|
-
console.log(' Forge v1.
|
|
1414
|
+
console.log(' Forge v1.3.0 Setup Complete!');
|
|
1309
1415
|
console.log('==============================================');
|
|
1310
1416
|
console.log('');
|
|
1311
1417
|
console.log('What\'s installed:');
|
|
@@ -1329,16 +1435,33 @@ async function interactiveSetup() {
|
|
|
1329
1435
|
}
|
|
1330
1436
|
});
|
|
1331
1437
|
console.log('');
|
|
1332
|
-
console.log('
|
|
1333
|
-
console.log(
|
|
1334
|
-
console.log(
|
|
1335
|
-
console.log(` ${PKG_MANAGER} install -g @fission-ai/openspec`);
|
|
1336
|
-
console.log(' 2. Start with: /status');
|
|
1337
|
-
console.log(' 3. Read the guide: docs/WORKFLOW.md');
|
|
1438
|
+
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
1439
|
+
console.log('📋 NEXT STEP - Complete AGENTS.md');
|
|
1440
|
+
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
1338
1441
|
console.log('');
|
|
1339
|
-
console.log(
|
|
1442
|
+
console.log('Ask your AI agent:');
|
|
1443
|
+
console.log(' "Fill in the project description in AGENTS.md"');
|
|
1340
1444
|
console.log('');
|
|
1341
|
-
console.log('
|
|
1445
|
+
console.log('The agent will:');
|
|
1446
|
+
console.log(' ✓ Add one-sentence project description');
|
|
1447
|
+
console.log(' ✓ Confirm package manager');
|
|
1448
|
+
console.log(' ✓ Verify build commands');
|
|
1449
|
+
console.log('');
|
|
1450
|
+
console.log('Takes ~30 seconds. Done!');
|
|
1451
|
+
console.log('');
|
|
1452
|
+
console.log('💡 As you work: Add project patterns to AGENTS.md');
|
|
1453
|
+
console.log(' USER:START section. Keep it minimal - budget is');
|
|
1454
|
+
console.log(' ~150-200 instructions max.');
|
|
1455
|
+
console.log('');
|
|
1456
|
+
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
1457
|
+
console.log('');
|
|
1458
|
+
console.log('Optional tools:');
|
|
1459
|
+
console.log(` ${PKG_MANAGER} install -g @beads/bd && bd init`);
|
|
1460
|
+
console.log(` ${PKG_MANAGER} install -g @fission-ai/openspec`);
|
|
1461
|
+
console.log('');
|
|
1462
|
+
console.log('Start with: /status');
|
|
1463
|
+
console.log('');
|
|
1464
|
+
console.log(`Package manager: ${PKG_MANAGER}`);
|
|
1342
1465
|
console.log('');
|
|
1343
1466
|
}
|
|
1344
1467
|
|
|
@@ -1526,7 +1649,7 @@ async function quickSetup(selectedAgents, skipExternal) {
|
|
|
1526
1649
|
// Final summary
|
|
1527
1650
|
console.log('');
|
|
1528
1651
|
console.log('==============================================');
|
|
1529
|
-
console.log(' Forge v1.
|
|
1652
|
+
console.log(' Forge v1.3.0 Quick Setup Complete!');
|
|
1530
1653
|
console.log('==============================================');
|
|
1531
1654
|
console.log('');
|
|
1532
1655
|
console.log('Next steps:');
|
|
@@ -1564,6 +1687,11 @@ async function interactiveSetupWithFlags(flags) {
|
|
|
1564
1687
|
|
|
1565
1688
|
showBanner('Agent Configuration');
|
|
1566
1689
|
|
|
1690
|
+
// Show target directory
|
|
1691
|
+
console.log(` Target directory: ${process.cwd()}`);
|
|
1692
|
+
console.log(' (Use --path <dir> to change target directory)');
|
|
1693
|
+
console.log('');
|
|
1694
|
+
|
|
1567
1695
|
// Check prerequisites first
|
|
1568
1696
|
checkPrerequisites();
|
|
1569
1697
|
console.log('');
|
|
@@ -1600,8 +1728,8 @@ async function interactiveSetupWithFlags(flags) {
|
|
|
1600
1728
|
|
|
1601
1729
|
// Ask about overwriting AGENTS.md if it exists
|
|
1602
1730
|
if (projectStatus.hasAgentsMd) {
|
|
1603
|
-
const overwriteAgents = await question
|
|
1604
|
-
if (overwriteAgents
|
|
1731
|
+
const overwriteAgents = await askYesNo(question, 'Found existing AGENTS.md. Overwrite?', true);
|
|
1732
|
+
if (!overwriteAgents) {
|
|
1605
1733
|
skipFiles.agentsMd = true;
|
|
1606
1734
|
console.log(' Keeping existing AGENTS.md');
|
|
1607
1735
|
} else {
|
|
@@ -1611,8 +1739,8 @@ async function interactiveSetupWithFlags(flags) {
|
|
|
1611
1739
|
|
|
1612
1740
|
// Ask about overwriting .claude/commands/ if it exists
|
|
1613
1741
|
if (projectStatus.hasClaudeCommands) {
|
|
1614
|
-
const overwriteCommands = await question
|
|
1615
|
-
if (overwriteCommands
|
|
1742
|
+
const overwriteCommands = await askYesNo(question, 'Found existing .claude/commands/. Overwrite?', true);
|
|
1743
|
+
if (!overwriteCommands) {
|
|
1616
1744
|
skipFiles.claudeCommands = true;
|
|
1617
1745
|
console.log(' Keeping existing .claude/commands/');
|
|
1618
1746
|
} else {
|
|
@@ -1685,8 +1813,28 @@ async function interactiveSetupWithFlags(flags) {
|
|
|
1685
1813
|
console.log(' Skipped: AGENTS.md (keeping existing)');
|
|
1686
1814
|
} else {
|
|
1687
1815
|
const agentsSrc = path.join(packageDir, 'AGENTS.md');
|
|
1688
|
-
|
|
1689
|
-
|
|
1816
|
+
const agentsDest = path.join(projectRoot, 'AGENTS.md');
|
|
1817
|
+
|
|
1818
|
+
// Try smart merge if file exists
|
|
1819
|
+
if (fs.existsSync(agentsDest)) {
|
|
1820
|
+
const existingContent = fs.readFileSync(agentsDest, 'utf8');
|
|
1821
|
+
const newContent = fs.readFileSync(agentsSrc, 'utf8');
|
|
1822
|
+
const merged = smartMergeAgentsMd(existingContent, newContent);
|
|
1823
|
+
|
|
1824
|
+
if (merged) {
|
|
1825
|
+
fs.writeFileSync(agentsDest, merged, 'utf8');
|
|
1826
|
+
console.log(' Updated: AGENTS.md (preserved USER sections)');
|
|
1827
|
+
} else {
|
|
1828
|
+
// No markers, do normal copy (user already approved overwrite)
|
|
1829
|
+
if (copyFile(agentsSrc, 'AGENTS.md')) {
|
|
1830
|
+
console.log(' Updated: AGENTS.md (universal standard)');
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
} else {
|
|
1834
|
+
// New file
|
|
1835
|
+
if (copyFile(agentsSrc, 'AGENTS.md')) {
|
|
1836
|
+
console.log(' Created: AGENTS.md (universal standard)');
|
|
1837
|
+
}
|
|
1690
1838
|
}
|
|
1691
1839
|
}
|
|
1692
1840
|
|
|
@@ -1749,7 +1897,7 @@ async function interactiveSetupWithFlags(flags) {
|
|
|
1749
1897
|
// =============================================
|
|
1750
1898
|
console.log('');
|
|
1751
1899
|
console.log('==============================================');
|
|
1752
|
-
console.log(' Forge v1.
|
|
1900
|
+
console.log(' Forge v1.3.0 Setup Complete!');
|
|
1753
1901
|
console.log('==============================================');
|
|
1754
1902
|
console.log('');
|
|
1755
1903
|
console.log('What\'s installed:');
|
|
@@ -1773,16 +1921,33 @@ async function interactiveSetupWithFlags(flags) {
|
|
|
1773
1921
|
}
|
|
1774
1922
|
});
|
|
1775
1923
|
console.log('');
|
|
1776
|
-
console.log('
|
|
1777
|
-
console.log(
|
|
1778
|
-
console.log(
|
|
1779
|
-
console.log(` ${PKG_MANAGER} install -g @fission-ai/openspec`);
|
|
1780
|
-
console.log(' 2. Start with: /status');
|
|
1781
|
-
console.log(' 3. Read the guide: docs/WORKFLOW.md');
|
|
1924
|
+
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
1925
|
+
console.log('📋 NEXT STEP - Complete AGENTS.md');
|
|
1926
|
+
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
1782
1927
|
console.log('');
|
|
1783
|
-
console.log(
|
|
1928
|
+
console.log('Ask your AI agent:');
|
|
1929
|
+
console.log(' "Fill in the project description in AGENTS.md"');
|
|
1784
1930
|
console.log('');
|
|
1785
|
-
console.log('
|
|
1931
|
+
console.log('The agent will:');
|
|
1932
|
+
console.log(' ✓ Add one-sentence project description');
|
|
1933
|
+
console.log(' ✓ Confirm package manager');
|
|
1934
|
+
console.log(' ✓ Verify build commands');
|
|
1935
|
+
console.log('');
|
|
1936
|
+
console.log('Takes ~30 seconds. Done!');
|
|
1937
|
+
console.log('');
|
|
1938
|
+
console.log('💡 As you work: Add project patterns to AGENTS.md');
|
|
1939
|
+
console.log(' USER:START section. Keep it minimal - budget is');
|
|
1940
|
+
console.log(' ~150-200 instructions max.');
|
|
1941
|
+
console.log('');
|
|
1942
|
+
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
1943
|
+
console.log('');
|
|
1944
|
+
console.log('Optional tools:');
|
|
1945
|
+
console.log(` ${PKG_MANAGER} install -g @beads/bd && bd init`);
|
|
1946
|
+
console.log(` ${PKG_MANAGER} install -g @fission-ai/openspec`);
|
|
1947
|
+
console.log('');
|
|
1948
|
+
console.log('Start with: /status');
|
|
1949
|
+
console.log('');
|
|
1950
|
+
console.log(`Package manager: ${PKG_MANAGER}`);
|
|
1786
1951
|
console.log('');
|
|
1787
1952
|
}
|
|
1788
1953
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "forge-workflow",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "9-stage TDD workflow for ALL AI coding agents (Claude, Cursor, Windsurf, Kilo, OpenCode, Copilot, Cline, Roo, Aider, Continue, Antigravity)",
|
|
5
5
|
"bin": {
|
|
6
6
|
"forge": "bin/forge.js"
|