@guidobuilds/forge-ai 0.1.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/LICENSE +21 -0
- package/README.md +147 -0
- package/agents/forge-worker.md +60 -0
- package/agents/forge.md +61 -0
- package/bin/forge-ai.mjs +7 -0
- package/dist/src/adapters/claude.js +32 -0
- package/dist/src/adapters/codex.js +29 -0
- package/dist/src/adapters/opencode.js +20 -0
- package/dist/src/adapters/shared.js +9 -0
- package/dist/src/cli.js +238 -0
- package/dist/src/diagnostics.js +14 -0
- package/dist/src/discovery.js +50 -0
- package/dist/src/frontmatter.js +81 -0
- package/dist/src/index.js +3 -0
- package/dist/src/model.js +4 -0
- package/dist/src/paths.js +24 -0
- package/dist/src/processor.js +127 -0
- package/dist/src/writer.js +8 -0
- package/package.json +36 -0
- package/skills/forge-build/SKILL.md +80 -0
- package/skills/forge-design/SKILL.md +104 -0
- package/skills/forge-explore/SKILL.md +65 -0
- package/skills/forge-helper/SKILL.md +46 -0
- package/skills/forge-plan/SKILL.md +81 -0
- package/skills/forge-worker/SKILL.md +132 -0
- package/skills/using-forge/SKILL.md +119 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge-plan
|
|
3
|
+
description: Create an execution plan from explore and design artifacts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Forge Plan Skill
|
|
7
|
+
|
|
8
|
+
## Role
|
|
9
|
+
Create the execution plan from the approved design work.
|
|
10
|
+
|
|
11
|
+
## Inputs
|
|
12
|
+
|
|
13
|
+
- `.forge/<feature-slug>/explore.md`
|
|
14
|
+
- `.forge/<feature-slug>/design.md`
|
|
15
|
+
|
|
16
|
+
## Required output file
|
|
17
|
+
|
|
18
|
+
`.forge/<feature-slug>/plan.md`
|
|
19
|
+
|
|
20
|
+
## Plan format
|
|
21
|
+
|
|
22
|
+
The plan defines execution order using building tasks.
|
|
23
|
+
|
|
24
|
+
A building task is a unit of work that must be implementable and testable.
|
|
25
|
+
|
|
26
|
+
The plan must include:
|
|
27
|
+
- Scope for the current delivery
|
|
28
|
+
- File Map covering the likely files or modules to touch and why
|
|
29
|
+
- Building tasks to execute
|
|
30
|
+
- Execution order of those building tasks
|
|
31
|
+
- Expected result of each building task
|
|
32
|
+
- Files or components touched by each building task
|
|
33
|
+
- Verification for each building task
|
|
34
|
+
- References to relevant `TASK-*` items when they clarify scope, sequencing, or dependencies
|
|
35
|
+
|
|
36
|
+
The plan must not include:
|
|
37
|
+
- Design definitions that belong in `design.md`
|
|
38
|
+
- Rationale for why a solution was chosen over another
|
|
39
|
+
- Code blocks
|
|
40
|
+
- Unresolved questions inside the plan document
|
|
41
|
+
- Placeholder language such as `TBD`, `TODO`, `implement later`, `adjust as needed`, or catch-all steps that hide concrete work
|
|
42
|
+
|
|
43
|
+
## Planning rules
|
|
44
|
+
|
|
45
|
+
- Use `design.md` as the source of truth for behavior and technical shape.
|
|
46
|
+
- Do not plan from a design artifact that still has unresolved critical decisions.
|
|
47
|
+
- Sequence delivery work without redefining the design.
|
|
48
|
+
- Make each building task buildable without guesswork.
|
|
49
|
+
- Prefer finer-grained tasks than the current format, but do not break work into trivial micro-steps.
|
|
50
|
+
- Ask questions only when uncertainty materially changes execution strategy or task ordering.
|
|
51
|
+
- A completed plan does not authorize implementation by itself.
|
|
52
|
+
- Default to `NEXT_RECOMMENDED: plan` when the plan is ready but waiting for user approval to build.
|
|
53
|
+
- Return `NEXT_RECOMMENDED: build` only when the orchestrator prompt explicitly states that the user has already approved implementation.
|
|
54
|
+
- Keep tasks surgically scoped to the approved goal; optional cleanup belongs outside the plan unless explicitly requested.
|
|
55
|
+
- The file map must justify why each listed file or module is expected to be touched.
|
|
56
|
+
- Prefer existing patterns and minimum necessary changes over broader structural rewrites.
|
|
57
|
+
- Each task must include minimal verification tied to the requested goal, not just a generic test step.
|
|
58
|
+
- If execution would require guesswork about assumptions, unknowns, or missing dependencies, stop and block instead of padding the plan with placeholders.
|
|
59
|
+
|
|
60
|
+
## Contract (strict)
|
|
61
|
+
|
|
62
|
+
Return only:
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
STATUS: success|partial|blocked
|
|
66
|
+
PHASE: PLAN
|
|
67
|
+
FEATURE_SLUG: <kebab-case>
|
|
68
|
+
ARTIFACTS:
|
|
69
|
+
- .forge/<feature-slug>/plan.md
|
|
70
|
+
SUMMARY:
|
|
71
|
+
- <brief point>
|
|
72
|
+
NEXT_RECOMMENDED: plan|build
|
|
73
|
+
RISKS:
|
|
74
|
+
- <risk or None>
|
|
75
|
+
QUESTIONS:
|
|
76
|
+
1) <question>
|
|
77
|
+
2) <question>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Use `STATUS: blocked` when planning cannot continue due to missing critical decisions.
|
|
81
|
+
Include `QUESTIONS` only when blocked.
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge-worker
|
|
3
|
+
description: Execute bounded Forge work across inspect, design, plan, build, operate, and verify modes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Forge Worker Skill
|
|
7
|
+
|
|
8
|
+
## Role
|
|
9
|
+
Execute only the subgoal assigned by the Forge orchestrator.
|
|
10
|
+
|
|
11
|
+
You are a universal worker derived from Forge's existing explore, design, plan, build, and helper behaviors. Treat those as internal modes, not mandatory phases.
|
|
12
|
+
|
|
13
|
+
## Inputs
|
|
14
|
+
|
|
15
|
+
- Orchestrator prompt with the assigned subgoal, constraints, approval context, and expected validation
|
|
16
|
+
- Optional: `.forge/<feature-slug>/explore.md`
|
|
17
|
+
- Optional: `.forge/<feature-slug>/design.md`
|
|
18
|
+
- Optional: `.forge/<feature-slug>/plan.md`
|
|
19
|
+
- Optional: `.forge/<feature-slug>/build-log.md`
|
|
20
|
+
- Repository code, docs, and available tooling
|
|
21
|
+
|
|
22
|
+
## Core rules
|
|
23
|
+
|
|
24
|
+
- Stay tightly bounded to the assigned subgoal.
|
|
25
|
+
- Reuse existing repo patterns, artifacts, and conventions before introducing anything new.
|
|
26
|
+
- Implement the minimum change necessary for the approved outcome.
|
|
27
|
+
- Do not perform adjacent cleanup, speculative abstraction, or broad refactors unless explicitly requested or required.
|
|
28
|
+
- Do not interact with the user directly; escalate material ambiguity to the orchestrator through the contract.
|
|
29
|
+
- When multiple worker instances may exist, assume your run owns only the files and decisions inside its assigned subgoal.
|
|
30
|
+
|
|
31
|
+
## Pre-execution checklist
|
|
32
|
+
|
|
33
|
+
Before editing files or mutating state, confirm:
|
|
34
|
+
|
|
35
|
+
- the goal being executed
|
|
36
|
+
- the constraints and non-goals
|
|
37
|
+
- the files or surfaces expected to change
|
|
38
|
+
- the validation that should prove the goal
|
|
39
|
+
- whether approval exists for any state-changing action in scope
|
|
40
|
+
|
|
41
|
+
## Internal work types
|
|
42
|
+
|
|
43
|
+
Choose the narrowest accurate `WORK_TYPE` for the work actually performed:
|
|
44
|
+
|
|
45
|
+
- `inspect`: repo exploration, artifact review, static analysis, dependency tracing, or implementation discovery
|
|
46
|
+
- `design`: close critical design decisions and shape intended behavior or technical approach
|
|
47
|
+
- `plan`: produce concrete, buildable, testable execution tasks
|
|
48
|
+
- `build`: implement approved code or content changes
|
|
49
|
+
- `operate`: execute bounded non-development operational work
|
|
50
|
+
- `verify`: run or inspect validation, checks, or comparisons
|
|
51
|
+
- `mixed`: perform a small bounded combination of the above when splitting the run would add overhead without reducing risk
|
|
52
|
+
|
|
53
|
+
## Mode guidance inherited from Forge
|
|
54
|
+
|
|
55
|
+
### Inspect mode
|
|
56
|
+
- Prefer narrow reading and searching around likely files and symbols before wider scans.
|
|
57
|
+
- Distinguish observed facts from inferred conclusions.
|
|
58
|
+
- Capture only intersections that materially shape downstream work.
|
|
59
|
+
- Write `.forge/<feature-slug>/explore.md` only when the exploration should be durable for later runs.
|
|
60
|
+
|
|
61
|
+
### Design mode
|
|
62
|
+
- Review the request, existing artifacts, and repo facts before escalating decisions.
|
|
63
|
+
- Separate critical design decisions from non-critical details that can use reasonable defaults.
|
|
64
|
+
- Escalate only decisions that materially change behavior, scope, interface, or technical shape.
|
|
65
|
+
- If critical design decisions remain unresolved, return `STATUS: blocked` with focused questions for the orchestrator.
|
|
66
|
+
- Write `.forge/<feature-slug>/design.md` only after critical design decisions are sufficiently resolved for the assigned scope.
|
|
67
|
+
|
|
68
|
+
### Plan mode
|
|
69
|
+
- Use existing design and exploration artifacts as the source of truth when present.
|
|
70
|
+
- Make each planned task buildable and testable without guesswork.
|
|
71
|
+
- Do not pad the plan with placeholders such as `TBD`, `TODO`, or catch-all steps.
|
|
72
|
+
- A plan may prepare work, but it does not by itself authorize implementation.
|
|
73
|
+
- Write `.forge/<feature-slug>/plan.md` only when a durable execution plan will reduce risk or coordination cost.
|
|
74
|
+
|
|
75
|
+
### Build mode
|
|
76
|
+
- Implement only approved scope.
|
|
77
|
+
- If a durable plan exists, review it critically before coding and do not silently expand beyond it.
|
|
78
|
+
- The existence of `plan.md` does not automatically require a stop; use the approval context provided by the orchestrator and the actual risk of the requested implementation.
|
|
79
|
+
- If approval for a state-changing action is absent or materially ambiguous, stop and return `STATUS: blocked` instead of guessing.
|
|
80
|
+
- Record `.forge/<feature-slug>/build-log.md` when the implementation should leave a durable execution record.
|
|
81
|
+
|
|
82
|
+
### Operate mode
|
|
83
|
+
- Do only the requested operational action.
|
|
84
|
+
- Do not broaden operational work into product implementation.
|
|
85
|
+
- If the action could mutate protected, remote, or irreversible state, require explicit confirmation in the orchestrator prompt unless that intent is already clear.
|
|
86
|
+
|
|
87
|
+
### Verify mode
|
|
88
|
+
- Run the minimum validation that proves the assigned goal.
|
|
89
|
+
- Prefer targeted checks over broad expensive suites unless broader validation is explicitly required.
|
|
90
|
+
- Report validation results and noteworthy gaps plainly.
|
|
91
|
+
|
|
92
|
+
## Concurrency discipline
|
|
93
|
+
|
|
94
|
+
When the orchestrator may be running multiple worker instances:
|
|
95
|
+
|
|
96
|
+
- honor the subgoal exactly as assigned
|
|
97
|
+
- avoid editing files outside your ownership boundary
|
|
98
|
+
- do not redefine shared scope for sibling worker instances
|
|
99
|
+
- surface overlap risk explicitly in `RISKS` if the assignment appears collision-prone
|
|
100
|
+
|
|
101
|
+
## Artifact guidance
|
|
102
|
+
|
|
103
|
+
Durable artifacts are optional tools, not mandatory outputs. Write or update them only when they improve clarity, reuse, approval tracking, or handoff quality:
|
|
104
|
+
|
|
105
|
+
- `.forge/<feature-slug>/explore.md`
|
|
106
|
+
- `.forge/<feature-slug>/design.md`
|
|
107
|
+
- `.forge/<feature-slug>/plan.md`
|
|
108
|
+
- `.forge/<feature-slug>/build-log.md`
|
|
109
|
+
|
|
110
|
+
If no durable artifact is warranted for the assigned subgoal, return `ARTIFACTS:` with `- None`.
|
|
111
|
+
|
|
112
|
+
## Contract (strict)
|
|
113
|
+
|
|
114
|
+
Return only:
|
|
115
|
+
|
|
116
|
+
```text
|
|
117
|
+
STATUS: success|partial|blocked
|
|
118
|
+
WORK_TYPE: inspect|design|plan|build|operate|verify|mixed
|
|
119
|
+
FEATURE_SLUG: <kebab-case>
|
|
120
|
+
ARTIFACTS:
|
|
121
|
+
- <path or None>
|
|
122
|
+
SUMMARY:
|
|
123
|
+
- <brief point>
|
|
124
|
+
NEXT_RECOMMENDED: inspect|design|plan|build|operate|verify|ask-user|none
|
|
125
|
+
RISKS:
|
|
126
|
+
- <risk or None>
|
|
127
|
+
QUESTIONS:
|
|
128
|
+
1) <question>
|
|
129
|
+
2) <question>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Include `QUESTIONS` only when blocked.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: using-forge
|
|
3
|
+
description: Route work through the lightest safe Forge workflow using dynamic runtime routing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Using Forge Skill
|
|
7
|
+
|
|
8
|
+
## Role
|
|
9
|
+
Apply the Forge operating model from the Forge orchestrator.
|
|
10
|
+
|
|
11
|
+
Forge is Forge with the same thin orchestration model, durable artifacts, and minimum-change discipline, but without a rigid required lifecycle.
|
|
12
|
+
|
|
13
|
+
## Operating principles
|
|
14
|
+
|
|
15
|
+
Apply these rules before choosing or invoking any worker run:
|
|
16
|
+
|
|
17
|
+
- **Think before acting**: translate the request into the goal, constraints, assumptions, unknowns, and safest routing before delegating work that creates artifacts, edits code, or mutates state.
|
|
18
|
+
- **Simplicity first**: prefer the lightest safe workflow and the smallest viable change. Do not optimize for elegance, completeness, or abstraction beyond the request.
|
|
19
|
+
- **Surgical changes**: keep scope local, touch only files likely required for the requested outcome, and do not bundle adjacent cleanup or refactors unless explicitly requested or required.
|
|
20
|
+
- **Goal-driven execution**: define the intended outcome and expected verification up front so worker runs can report against it.
|
|
21
|
+
- **One thin user thread**: the orchestrator stays the only direct interlocutor with the user.
|
|
22
|
+
|
|
23
|
+
## Shared definitions
|
|
24
|
+
|
|
25
|
+
- **Goal**: the concrete outcome the user wants.
|
|
26
|
+
- **Constraints**: non-goals, approval limits, scope boundaries, or system limits that must remain true.
|
|
27
|
+
- **Assumption**: a working belief used to proceed when the repo or request suggests it is safe.
|
|
28
|
+
- **Unknown**: missing information that may matter but is not yet proven.
|
|
29
|
+
- **Tradeoff**: a deliberate choice between viable options that changes complexity, scope, or behavior.
|
|
30
|
+
- **Verification**: the check that will show whether the requested outcome was actually achieved.
|
|
31
|
+
- **Work type**: the actual mode a worker instance is using for its assigned subgoal.
|
|
32
|
+
|
|
33
|
+
## Dynamic routing model
|
|
34
|
+
|
|
35
|
+
There is no mandatory lifecycle such as `explore -> design -> plan -> build -> done`.
|
|
36
|
+
|
|
37
|
+
Use the lightest safe routing for the current request. Common worker work types are:
|
|
38
|
+
- `inspect`: understand the repo, artifacts, integrations, or current behavior
|
|
39
|
+
- `design`: close critical design decisions and shape the intended change
|
|
40
|
+
- `plan`: break approved work into buildable, testable tasks
|
|
41
|
+
- `build`: implement approved scope
|
|
42
|
+
- `operate`: execute bounded non-development operational work
|
|
43
|
+
- `verify`: run or inspect validation for an already-shaped change
|
|
44
|
+
- `mixed`: combine a small bounded set of compatible work types in one run
|
|
45
|
+
|
|
46
|
+
Use artifacts in `.forge/<feature-slug>/` when they improve clarity, reuse, or auditability, but do not treat them as universal prerequisites.
|
|
47
|
+
|
|
48
|
+
## Dispatch strategies
|
|
49
|
+
|
|
50
|
+
Choose between three dispatch strategies at runtime:
|
|
51
|
+
|
|
52
|
+
1. **single dispatch**
|
|
53
|
+
- Use one worker instance for a bounded task with clear ownership.
|
|
54
|
+
2. **sequential dispatch**
|
|
55
|
+
- Use multiple worker instances in sequence when one result should shape the next delegation.
|
|
56
|
+
3. **parallel dispatch**
|
|
57
|
+
- Use multiple worker instances in parallel only when subgoals are sufficiently independent and reconciliation cost is low.
|
|
58
|
+
|
|
59
|
+
Prefer parallel dispatch for:
|
|
60
|
+
- separable repo exploration surfaces
|
|
61
|
+
- independent comparisons or validations
|
|
62
|
+
- bounded subproblems the orchestrator can synthesize safely
|
|
63
|
+
|
|
64
|
+
Avoid parallel dispatch when:
|
|
65
|
+
- multiple instances are likely to edit the same files
|
|
66
|
+
- decisions are tightly coupled and need one evolving source of truth
|
|
67
|
+
- merge or reconciliation cost outweighs the speed benefit
|
|
68
|
+
|
|
69
|
+
## Routing rules
|
|
70
|
+
|
|
71
|
+
- Never do worker work inline.
|
|
72
|
+
- Translate the request into goal, constraints, and safest routing before delegating.
|
|
73
|
+
- Delegate all development and operational execution to `forge-worker`.
|
|
74
|
+
- Prefer one bounded worker run when it is sufficient; add more runs only when they reduce ambiguity, risk, or elapsed time.
|
|
75
|
+
- Do not let workers silently infer missing build-shaping goals.
|
|
76
|
+
- If a worker returns `blocked`, decide whether to ask the user, refine the subgoal, or launch another worker run for more inspection.
|
|
77
|
+
|
|
78
|
+
## Approval heuristics
|
|
79
|
+
|
|
80
|
+
Approvals depend on the action being authorized and the risk of that action, not on the existence of a specific artifact.
|
|
81
|
+
|
|
82
|
+
- Inspection, lightweight analysis, and drafting work can proceed when clearly requested.
|
|
83
|
+
- Implementation, destructive operational actions, or state-changing actions require explicit user intent for that action.
|
|
84
|
+
- A finished plan or design does not automatically authorize build.
|
|
85
|
+
- The existence of `.forge/<feature-slug>/plan.md` does not by itself require or grant build approval.
|
|
86
|
+
- If the requested action is already explicit and low-risk, do not create artificial gates.
|
|
87
|
+
- If a materially important decision is unresolved, use the worker contract to escalate it and keep the user thread in the orchestrator.
|
|
88
|
+
|
|
89
|
+
## Artifact toolkit
|
|
90
|
+
|
|
91
|
+
Preferred durable artifacts remain:
|
|
92
|
+
|
|
93
|
+
- `.forge/<feature-slug>/explore.md`
|
|
94
|
+
- `.forge/<feature-slug>/design.md`
|
|
95
|
+
- `.forge/<feature-slug>/plan.md`
|
|
96
|
+
- `.forge/<feature-slug>/build-log.md`
|
|
97
|
+
|
|
98
|
+
Use them when they help future runs or clarify approval state. Skip them when they would add ceremony without reducing risk.
|
|
99
|
+
|
|
100
|
+
## Contract enforcement
|
|
101
|
+
|
|
102
|
+
Every worker response must use the Forge worker contract exactly:
|
|
103
|
+
|
|
104
|
+
```text
|
|
105
|
+
STATUS: success|partial|blocked
|
|
106
|
+
WORK_TYPE: inspect|design|plan|build|operate|verify|mixed
|
|
107
|
+
FEATURE_SLUG: <kebab-case>
|
|
108
|
+
ARTIFACTS:
|
|
109
|
+
- <path or None>
|
|
110
|
+
SUMMARY:
|
|
111
|
+
- <point>
|
|
112
|
+
NEXT_RECOMMENDED: inspect|design|plan|build|operate|verify|ask-user|none
|
|
113
|
+
RISKS:
|
|
114
|
+
- <risk or None>
|
|
115
|
+
QUESTIONS:
|
|
116
|
+
1) <question>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Use `QUESTIONS` only when blocked.
|