forge-orkes 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.
Files changed (38) hide show
  1. package/bin/create-forge.js +103 -0
  2. package/package.json +28 -0
  3. package/template/.claude/agents/executor.md +177 -0
  4. package/template/.claude/agents/planner.md +148 -0
  5. package/template/.claude/agents/researcher.md +111 -0
  6. package/template/.claude/agents/reviewer.md +211 -0
  7. package/template/.claude/agents/verifier.md +210 -0
  8. package/template/.claude/settings.json +40 -0
  9. package/template/.claude/skills/architecting/SKILL.md +121 -0
  10. package/template/.claude/skills/auditing/SKILL.md +302 -0
  11. package/template/.claude/skills/beads-integration/SKILL.md +125 -0
  12. package/template/.claude/skills/debugging/SKILL.md +130 -0
  13. package/template/.claude/skills/designing/SKILL.md +134 -0
  14. package/template/.claude/skills/discussing/SKILL.md +229 -0
  15. package/template/.claude/skills/executing/SKILL.md +154 -0
  16. package/template/.claude/skills/forge/SKILL.md +524 -0
  17. package/template/.claude/skills/planning/SKILL.md +225 -0
  18. package/template/.claude/skills/quick-tasking/SKILL.md +74 -0
  19. package/template/.claude/skills/refactoring/SKILL.md +168 -0
  20. package/template/.claude/skills/researching/SKILL.md +117 -0
  21. package/template/.claude/skills/securing/SKILL.md +104 -0
  22. package/template/.claude/skills/verifying/SKILL.md +201 -0
  23. package/template/.forge/templates/constitution.md +123 -0
  24. package/template/.forge/templates/context.md +53 -0
  25. package/template/.forge/templates/design-systems/material-ui.md +44 -0
  26. package/template/.forge/templates/design-systems/primereact.md +46 -0
  27. package/template/.forge/templates/design-systems/shadcn-ui.md +47 -0
  28. package/template/.forge/templates/framework-absorption/generic.md +52 -0
  29. package/template/.forge/templates/framework-absorption/gsd.md +174 -0
  30. package/template/.forge/templates/framework-absorption/spec-kit.md +52 -0
  31. package/template/.forge/templates/plan.md +84 -0
  32. package/template/.forge/templates/project.yml +40 -0
  33. package/template/.forge/templates/refactor-backlog.yml +16 -0
  34. package/template/.forge/templates/requirements.yml +49 -0
  35. package/template/.forge/templates/roadmap.yml +44 -0
  36. package/template/.forge/templates/state/index.yml +51 -0
  37. package/template/.forge/templates/state/milestone.yml +42 -0
  38. package/template/CLAUDE.md +150 -0
@@ -0,0 +1,150 @@
1
+ # Forge
2
+
3
+ A lean meta-prompting framework for Claude Code. Synthesizes context engineering (GSD) and constitutional governance (Spec-Kit) on Claude Code's native primitives.
4
+
5
+ ## Core Principles
6
+
7
+ 1. **Lean by default, powerful when needed.** Quick fixes skip ceremony. Complex features get full governance. The framework adapts — you don't.
8
+ 2. **Native-first.** Skills, agents, hooks, plugins — use Claude Code's built-in systems. No custom JavaScript, no reinvented orchestration.
9
+ 3. **Context is sacred.** Every token earns its place. Size-gate all artifacts, lazy-load skills, spawn fresh agents for isolated work.
10
+ 4. **Decisions are contracts.** User decisions lock before building begins. Downstream agents honor contracts or flag violations — never silently override.
11
+ 5. **Verify against goals, not tasks.** "Does it work?" beats "Did we complete the checklist?" Goal-backward verification at every tier.
12
+ 6. **Never forget.** Project state persists via `.forge/state/` and survives session boundaries. Milestones can be worked on concurrently across sessions. Compatible with external memory tools like Beads for deeper cross-session context.
13
+ 7. **Pave the desire paths.** When agents repeatedly deviate, users repeatedly correct, or steps repeatedly get skipped — that's a signal, not a failure. Track these patterns and evolve the framework to match how it's actually used.
14
+
15
+ ## Workflow Tiers
16
+
17
+ Forge auto-detects complexity. Override with: "Use Quick/Standard/Full tier."
18
+
19
+ ### Quick (minutes)
20
+ **Triggers:** bug fix, typo, config change, dependency bump, < 50 lines changed
21
+ **Flow:** → `quick-tasking` → commit → done
22
+
23
+ ### Standard (hours)
24
+ **Triggers:** new feature, component, significant refactor, multi-file change
25
+ **Flow:** → `researching` → `discussing` → `planning` → `executing` → `verifying` → `auditing` → `refactoring` → done
26
+
27
+ ### Full (days)
28
+ **Triggers:** new project, major milestone, complex multi-system feature, architectural decisions needed
29
+ **Flow:** → `researching` → `discussing` → `architecting` → `planning` → `executing` → `verifying` → `auditing` → `refactoring` → done
30
+ **Optional additions:** `designing` (UI work), `securing` (auth/data/API), `debugging` (stuck on issue)
31
+
32
+ ## Skill Routing
33
+
34
+ | When you need to... | Use skill | Tier |
35
+ |---------------------|-----------|------|
36
+ | Start any task (entry point) | `forge` | All |
37
+ | Investigate codebase, tech, or requirements | `researching` | Standard, Full |
38
+ | Talk through approach, trade-offs, or revisit a plan | `discussing` | Standard, Full (also on-demand) |
39
+ | Make architectural decisions with rationale | `architecting` | Full |
40
+ | Break work into executable tasks with gates | `planning` | Standard, Full |
41
+ | Build code with deviation rules + atomic commits | `executing` | All |
42
+ | Prove work actually delivers on goals | `verifying` | Standard, Full |
43
+ | Audit application health before shipping | `auditing` | Standard, Full |
44
+ | Review refactoring opportunities after milestone audit | `refactoring` | Standard, Full |
45
+ | Fix a small, scoped issue fast | `quick-tasking` | Quick |
46
+ | Build UI with design system consistency | `designing` | When UI involved |
47
+ | Review security before shipping | `securing` | When auth/data/API involved |
48
+ | Debug systematically with hypotheses | `debugging` | When stuck |
49
+ | Use Beads for cross-session memory | `beads-integration` | When Beads installed |
50
+
51
+ ## Context Engineering
52
+
53
+ ### Size Gates (enforced by agents)
54
+ | Artifact | Max Size | Why |
55
+ |----------|----------|-----|
56
+ | `project.yml` | 5 KB | Forces clarity — if you can't describe it concisely, you don't understand it |
57
+ | `requirements.yml` | 50 KB | Prevents scope creep — trim to v1 essentials |
58
+ | `plan.md` (per task) | 30 KB | Keeps executor context under 50% — quality degrades above this |
59
+ | `constitution.md` | 10 KB | Immutable gates should be scannable, not novels |
60
+
61
+ ### Fresh Agent Pattern
62
+ When a task touches 20+ files or a complex subsystem, spawn a fresh executor agent with isolated context. This prevents context rot — the #1 cause of quality degradation in long sessions.
63
+
64
+ ### Lazy Loading
65
+ Skills load only when invoked. CLAUDE.md stays in context; skill details load on demand. This keeps base context lean (~300 lines) while making full framework available.
66
+
67
+ ## Agents
68
+
69
+ | Agent | Role | Tools | When Used |
70
+ |-------|------|-------|-----------|
71
+ | `researcher` | Investigation specialist | Read-only (Read, Glob, Grep, WebFetch) | Research phases |
72
+ | `planner` | Planning with constitutional gates | Read + Write (plan files only) | Planning phases |
73
+ | `executor` | Building with deviation rules | All dev tools | Execution phases |
74
+ | `verifier` | Goal-backward verification | Read + Bash (test execution) | Verification phases |
75
+ | `security-auditor` | Security vulnerability scanner | Read, Bash, Grep, Glob | Auditing phase |
76
+ | `architecture-auditor` | Structural health assessor | Read, Grep, Glob | Auditing phase |
77
+ | `reviewer` | Security + code quality audit | Read-only + npm audit | Before shipping |
78
+
79
+ ## Project Init (First Run)
80
+
81
+ When `forge` detects no `.forge/project.yml`, it auto-detects the project type and runs the appropriate init:
82
+
83
+ **Brownfield** (existing codebase detected — has package.json, src/, .git/):
84
+ 1. **Framework detection** — checks for existing meta-frameworks (GSD, Spec-Kit, BMAD, custom). If found, offers: absorb & convert, archive & start fresh, or keep both. Also detects companion tools (Beads, etc.) and preserves their configuration.
85
+ 2. **Framework absorption** — reads existing framework docs, converts project knowledge to Forge format (PROJECT.md → project.yml, etc.), archives originals in `.forge/archive/`
86
+ 3. **Docs vs. code verification** — cross-references all framework documentation against the actual codebase. Flags discrepancies (stale docs, missing features, drifted tech stack). The codebase is the source of truth, not the docs.
87
+ 4. **Tech stack scan** — auto-detects language, framework, dependencies, codebase size
88
+ 5. **Design system detection** — identifies component library from imports and dependencies, builds mapping
89
+ 6. **Pattern analysis** — detects testing style, commit conventions, architecture patterns
90
+ 7. **Constitutional inference** — suggests articles based on what's already in the codebase
91
+ 8. **User confirmation** — presents findings and discrepancies, user corrects/approves
92
+
93
+ **Greenfield** (new project):
94
+ 1. **Project basics** — asks user to describe the project, fills in tech stack and constraints
95
+ 2. **Design system** — which component library? Researches and builds component mapping in `.forge/design-system.md`
96
+ 3. **Constitution** — walks through 9 articles grouped by domain. User selects which apply.
97
+ 4. **State init** — writes `project.yml`, `constitution.md`, `design-system.md`, `state/index.yml`, `state/milestone-1.yml`
98
+
99
+ Example design system configs for PrimeReact, MUI, and shadcn/ui ship in `.forge/templates/design-systems/`.
100
+
101
+ For Quick tier tasks, init is skipped — just do the work.
102
+
103
+ ## State Management
104
+
105
+ Project state lives in `.forge/`:
106
+ - `project.yml` — Vision, stack, design system, constraints (< 5 KB)
107
+ - `constitution.md` — Active architectural gates (selected during init)
108
+ - `design-system.md` — Component mapping table (generated during init)
109
+ - `requirements.yml` — Structured requirements with `[NEEDS CLARIFICATION]` markers
110
+ - `roadmap.yml` — Phases, milestones, dependencies
111
+ - `state/index.yml` — Global state: active milestones list, desire_paths, metrics
112
+ - `state/milestone-{id}.yml` — Per-milestone cursor: current position, progress, decisions, blockers, deviations
113
+ - `context.md` — Locked user decisions + deferred ideas (created during discuss phase)
114
+ - `plan.md` — Per-phase task plans with must_haves frontmatter
115
+ - `refactor-backlog.yml` — Refactoring opportunities cataloged after milestone audits, worked via quick-tasking
116
+
117
+ ### Milestones
118
+ Milestones group phases into concurrent work streams. Each milestone has its own state file, so different sessions can work on different milestones without conflicts. On resume, Forge shows active milestones and asks which one to work on.
119
+
120
+ ### Machine-Readable State
121
+ YAML for anything agents parse programmatically (project, requirements, roadmap, state). Markdown for human-facing content (constitution, context, verification reports). Never free-form prose for machine state.
122
+
123
+ ## Deviation Rules (Executor Decision Tree)
124
+
125
+ When the executor encounters issues during building:
126
+
127
+ 1. **Bug blocking current task** → Auto-fix. Document in summary with "Rule 1."
128
+ 2. **Missing critical functionality** (error handling, validation, auth, null checks) → Auto-add. Document with "Rule 2."
129
+ 3. **Blocking infrastructure issue** (missing dep, wrong types, broken imports) → Auto-fix. Document with "Rule 3."
130
+ 4. **Architectural change needed** (new DB table, service layer, library switch) → **STOP. Checkpoint with user.** Document with "Rule 4."
131
+
132
+ Priority: Rule 4 first (stop if architectural). Then Rules 1-3 (auto-fix). Uncertain? → Rule 4 (ask).
133
+
134
+ ## Beads Integration (Optional)
135
+
136
+ When Beads is installed, Forge gains persistent cross-session memory:
137
+ - **Session start:** `bd prime` injects ~1-2K tokens of project context
138
+ - **Task selection:** `bd ready` returns unblocked tasks sorted by priority
139
+ - **Task completion:** `bd complete` updates dependency graph
140
+ - **Memory hygiene:** `bd compact` summarizes old closed tasks
141
+
142
+ Without Beads, Forge uses `.forge/state/` + Claude Code's Session Memory. Beads adds depth for long-horizon multi-session projects.
143
+
144
+ ## Atomic Commits
145
+
146
+ Every task gets its own commit. Format: `{type}({scope}): {description}`
147
+
148
+ Types: `feat`, `fix`, `test`, `refactor`, `chore`, `docs`
149
+ Scope: phase-plan or feature area
150
+ Never use `git add .` or `git add -A` — stage files individually.