@firatcand/forge 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 (58) hide show
  1. package/ETHOS.md +81 -0
  2. package/LICENSE +21 -0
  3. package/README.md +134 -0
  4. package/agents/backend-dev.md +36 -0
  5. package/agents/code-reviewer.md +37 -0
  6. package/agents/db-architect.md +36 -0
  7. package/agents/design-reviewer.md +31 -0
  8. package/agents/devops-engineer.md +34 -0
  9. package/agents/frontend-dev.md +36 -0
  10. package/agents/learning-curator.md +35 -0
  11. package/agents/linear-syncer.md +36 -0
  12. package/agents/phase-gatekeeper.md +23 -0
  13. package/agents/product-decomposer.md +39 -0
  14. package/agents/qa-engineer.md +31 -0
  15. package/agents/security-auditor.md +34 -0
  16. package/bin/forge.js +368 -0
  17. package/lib/companions.js +67 -0
  18. package/lib/github-helpers.sh +148 -0
  19. package/lib/linear-helpers.sh +188 -0
  20. package/lib/paths.js +13 -0
  21. package/lib/tools.js +68 -0
  22. package/lib/validators.sh +284 -0
  23. package/lib/worktree-helpers.sh +136 -0
  24. package/package.json +53 -0
  25. package/skills/codex/SKILL.md +50 -0
  26. package/skills/decompose/SKILL.md +47 -0
  27. package/skills/draft-design/SKILL.md +55 -0
  28. package/skills/draft-prd/SKILL.md +47 -0
  29. package/skills/draft-spec/SKILL.md +42 -0
  30. package/skills/fix/SKILL.md +23 -0
  31. package/skills/forge/SKILL.md +87 -0
  32. package/skills/implement/SKILL.md +24 -0
  33. package/skills/ingest-spec/SKILL.md +46 -0
  34. package/skills/investigate/SKILL.md +26 -0
  35. package/skills/learn/SKILL.md +53 -0
  36. package/skills/phase-gate/SKILL.md +37 -0
  37. package/skills/pickup-task/SKILL.md +53 -0
  38. package/skills/plan-task/SKILL.md +22 -0
  39. package/skills/push-to-linear/SKILL.md +42 -0
  40. package/skills/qa/SKILL.md +22 -0
  41. package/skills/retro/SKILL.md +27 -0
  42. package/skills/review/SKILL.md +20 -0
  43. package/skills/setup-repo/SKILL.md +63 -0
  44. package/skills/ship/SKILL.md +34 -0
  45. package/skills/sync-status/SKILL.md +14 -0
  46. package/templates/BRIEF.template.md +34 -0
  47. package/templates/CLAUDE.project.template.md +37 -0
  48. package/templates/CRITICAL.template.md +11 -0
  49. package/templates/DESIGN.template.md +37 -0
  50. package/templates/PRD.template.md +30 -0
  51. package/templates/SPEC.template.md +49 -0
  52. package/templates/github-workflows/claude-issue.yml +27 -0
  53. package/templates/github-workflows/claude-pr-review.yml +22 -0
  54. package/templates/github-workflows/claude-scheduled.yml +23 -0
  55. package/templates/github-workflows/test.yml +18 -0
  56. package/templates/learning.template.md +14 -0
  57. package/templates/phases.template.yaml +45 -0
  58. package/templates/retro.template.md +27 -0
package/ETHOS.md ADDED
@@ -0,0 +1,81 @@
1
+ # Forge — Ethos
2
+
3
+ The 8 principles that govern how forge skills behave. These aren't decorations — they're enforced through skill instructions, CLAUDE.md rules, and CI gates.
4
+
5
+ ## 1. Boil the Lake — refuse weak inputs
6
+
7
+ A weak spec produces weak tasks produces weak code. Forge refuses to proceed when inputs are incomplete:
8
+
9
+ - `/ingest-spec` validates that PRD, SPEC, and DESIGN have all required sections filled
10
+ - `/decompose` will not generate phases.yaml from an incomplete spec
11
+ - The framework prefers a 60-minute conversation upfront over a 6-hour rewrite later
12
+
13
+ When in doubt, demand more clarity. Half-done specs are the most expensive thing in software.
14
+
15
+ ## 2. Iron Law of Investigation — no fixes without root-cause analysis
16
+
17
+ Three failed fix attempts is the limit. After that, stop and investigate fresh.
18
+
19
+ `/fix` checks for a recent `/investigate` artifact. Investigation means: traced the data flow, tested at least one hypothesis, identified the root cause. Not "I think it's probably the X."
20
+
21
+ This rule exists because thrash on fixes is the most demoralising kind of engineering work, and most fixes-on-fixes are caused by skipping investigation.
22
+
23
+ ## 3. Confusion Protocol — clarify, don't guess
24
+
25
+ When an architectural decision is ambiguous, all forge subagents stop and ask. They never default-pick. The format is:
26
+
27
+ > I see two viable approaches here:
28
+ >
29
+ > A. [option A] — trade-off X
30
+ > B. [option B] — trade-off Y
31
+ >
32
+ > Which do you want?
33
+
34
+ This is borrowed directly from gstack. It exists because Claude defaulting to its preferred pattern silently is one of the most common ways code drifts from intent.
35
+
36
+ ## 4. Test-or-die — every PR ships with tests
37
+
38
+ `/ship` blocks the PR if:
39
+ - New code has zero new tests (allowlist for pure styling/copy)
40
+ - Bug fix has no regression test reproducing the bug
41
+ - Test framework isn't bootstrapped — `/qa` offers to bootstrap before continuing
42
+
43
+ The `qa-engineer` subagent generates regression tests automatically when `/qa` finds a bug.
44
+
45
+ ## 5. Compound Learning — every notable task writes a learning
46
+
47
+ A task is "notable" if any of: investigation took >30 min, >2 fix attempts, surprised by behaviour, found a non-obvious gotcha, made a non-trivial trade-off.
48
+
49
+ `/learn` writes a 5-10 line learning to `docs/learnings/{quarter}/{slug}.md`, tagged. `/pickup-task` retrieves relevant learnings before the next task starts. The system gets smarter on your codebase over time.
50
+
51
+ This is the "compound" in compound engineering. Without it, every task is greenfield.
52
+
53
+ ## 6. Multi-model Second Opinion — Codex CLI on critical paths
54
+
55
+ For changes touching paths in your project's `CRITICAL.md`, `/ship` requires `/codex` to have reviewed.
56
+
57
+ `/codex` shells out to your Codex CLI for an adversarial review from a different model. Two perspectives catch what one misses — especially on auth, billing, security, and infrastructure.
58
+
59
+ ## 7. Plan Mode Mandatory — no multi-file changes without /plan-task
60
+
61
+ `/implement` checks for an approved plan at `plans/tasks/{LINEAR-ID}.plan.md`. If none exists, it refuses to run.
62
+
63
+ The plan includes: changed files (predicted), data flow, edge cases, test strategy. The user approves before `/implement` unlocks. Single-file changes <50 lines can override with `/implement --quickfix` and a justification.
64
+
65
+ ## 8. 12-Factor Env Discipline — air-gap dev/prod
66
+
67
+ `/setup-repo` enforces:
68
+ - `.env*` in `.gitignore`
69
+ - `.env.example` with all required keys (no values)
70
+ - GitHub Environments configured: `development` (auto), `production` (manual approval gate)
71
+ - Secrets scanned with `gitleaks` in CI
72
+
73
+ `/ship` runs a final secrets scan on the diff. Hardcoded API keys, tokens, or credentials block the ship.
74
+
75
+ ---
76
+
77
+ ## How these principles relate
78
+
79
+ The first three (Boil the Lake, Iron Law, Confusion Protocol) protect against bad inputs and bad reasoning. The next three (Test-or-die, Compound Learning, Multi-model) protect against bad outputs. The last two (Plan Mode, Env Discipline) are tactical: discipline that pays for itself within days.
80
+
81
+ Together they enforce a simple bet: structure at the front saves rework at the back. Most products fail because of decisions made unclearly in the first 48 hours. Forge tries to make those decisions visible, persisted, and revisitable.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Firat Can Basarir
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,134 @@
1
+ # 🔨 Forge
2
+
3
+ > A lightweight Claude Code framework that takes you from idea to production with structure, not friction.
4
+
5
+ Forge is for solo founders and small teams who want to ship real products with Claude Code — not just experiment with it. It gives you a structured workflow for the parts that matter (ideation, decomposition, phase gates, learning capture) and stays out of your way for the parts where Claude Code already shines (planning, implementing, reviewing).
6
+
7
+ ## What it is
8
+
9
+ Forge ships:
10
+
11
+ - **21 slash commands** covering the full product lifecycle from raw idea to production
12
+ - **12 specialist subagents** — frontend, backend, db, qa, security, devops, design, plus orchestrators
13
+ - **13 templates** for PRD, SPEC, DESIGN, phases.yaml, GitHub workflows, and more
14
+ - **8 best practices baked in** — Boil the Lake, Iron Law of Investigation, Compound Learning, Test-or-die, Multi-model Second Opinion, and more
15
+ - **Linear ↔ GitHub native sync** — tasks auto-update on PR open/merge
16
+ - **Git worktree-based parallelism** — run multiple Claude Code sessions on the same project without collision
17
+
18
+ ## What it isn't
19
+
20
+ - Not a replacement for Claude Code — it shapes how you use Claude Code, doesn't override it
21
+ - Not opinionated about your stack — works with Next.js, Django, Rails, Go, anything
22
+ - Not heavyweight infrastructure — no servers, no databases, no SaaS
23
+ - Not a CLI you invoke instead of Claude — it's a set of skills Claude calls when relevant
24
+
25
+ ## Lifecycle at a glance
26
+
27
+ ```
28
+ IDEA → /forge → spec/BRIEF.md
29
+ → /draft-prd → spec/PRD.md
30
+ → /draft-spec → spec/SPEC.md
31
+ → /draft-design → spec/DESIGN.md (optional, for UI products)
32
+ → /ingest-spec → spec/CONTEXT.md (validation pass)
33
+ → /decompose → plans/phases.yaml
34
+ → /setup-repo → GitHub repo wired
35
+ → /push-to-linear → Linear project + cycles + issues
36
+
37
+ TASK → /pickup-task → /plan-task → /implement
38
+ → /review → /qa → /codex → /ship → /learn
39
+
40
+ PHASE → /phase-gate → /retro → next phase
41
+
42
+ PROD ← /phase-gate phase-3 ← (manual PR dev → main)
43
+ ```
44
+
45
+ ~90-120 minutes from raw idea to first task ready to implement.
46
+
47
+ ## Install
48
+
49
+ One command. No git clone, no setup script.
50
+
51
+ ```bash
52
+ npx @firatcand/forge
53
+ ```
54
+
55
+ This runs an interactive setup that:
56
+ 1. Detects which AI coding tools you have installed (Claude Code, Codex CLI, Cursor, Gemini CLI)
57
+ 2. Installs the 21 forge skills + 12 subagents into the right places
58
+ 3. Optionally installs companion skills from [firatcand/founder-skills](https://github.com/firatcand/founder-skills) for deeper domain expertise
59
+
60
+ > Prefer the original bash flow? `git clone` + `./setup.sh` still works as a fallback.
61
+
62
+ ## Quick start
63
+
64
+ ```bash
65
+ # Install forge globally (one time)
66
+ npx @firatcand/forge
67
+
68
+ # Initialize a new project
69
+ mkdir my-product && cd my-product
70
+ npx @firatcand/forge init
71
+
72
+ # Open your AI coding tool and run /forge
73
+ claude # or: codex, cursor, gemini
74
+ > /forge # Socratic Q&A → spec/BRIEF.md
75
+ > /draft-prd # → spec/PRD.md
76
+ > /draft-spec # → spec/SPEC.md
77
+ > /decompose # → plans/phases.yaml
78
+ > /setup-repo # GitHub repo wired
79
+ > /push-to-linear # Linear project + cycles
80
+ > /pickup-task # claim first task, worktree created
81
+ ```
82
+
83
+ [Full quick start →](docs/QUICKSTART.md)
84
+
85
+ ## Other commands
86
+
87
+ ```bash
88
+ npx @firatcand/forge install # Install/reinstall forge skills + agents only
89
+ npx @firatcand/forge init [name] # Initialize a project in current directory
90
+ npx @firatcand/forge companions # Install founder-skills companions only
91
+ npx @firatcand/forge --help # Show all commands
92
+ npx @firatcand/forge --version # Show version
93
+ ```
94
+
95
+ ## Cross-tool support
96
+
97
+ Forge works with:
98
+ - ✅ Claude Code (`~/.claude/`)
99
+ - ✅ Codex CLI (`~/.codex/`)
100
+ - ✅ Cursor (`~/.cursor/`)
101
+ - ✅ Gemini CLI (`~/.gemini/`)
102
+
103
+ The installer detects which tools you have and installs to all of them by default. You can choose specific tools during setup.
104
+
105
+ ## Why "forge"?
106
+
107
+ Forge is what you do when you have raw material (an idea) and want a finished tool (a product). The process is heat, pressure, shape, repeat. The framework's namesake skill `/forge` applies Socratic pressure to your raw idea until structure emerges.
108
+
109
+ ## Inspiration
110
+
111
+ Forge stands on the shoulders of:
112
+
113
+ - **[gstack](https://github.com/garrytan/gstack)** — for the skill-as-specialist pattern, AI Slop detection, the Iron Law of Investigation, and the Confusion Protocol
114
+ - **[Every's Compound Engineering plugin](https://github.com/EveryInc/compound-engineering-plugin)** — for the 80/20 plan-heavy thesis and the compound learning loop
115
+ - **[Paperclip](https://github.com/paperclipai/paperclip)** — for the orchestration mental model (without the heavyweight infrastructure)
116
+ - **Boris Cherny's Claude Code best practices** — for context budgeting and plan mode discipline
117
+
118
+ What forge adds:
119
+ - **Phase decomposition with dependency graphs** — neither gstack nor Every's CE has this
120
+ - **Linear ↔ GitHub native sync** — durable external task system instead of internal state
121
+ - **Brand-book inheritance** — `@inherit` pattern lets your design system stay single-source-of-truth across projects
122
+ - **Stack-agnostic templates** — works with any tech stack, doesn't impose Next.js + Supabase
123
+
124
+ ## Status
125
+
126
+ Forge is **v1.0** — used in production by the maintainer for solo founder workflows. Stable enough to depend on, raw enough that you'll find sharp edges. Issues and PRs welcome.
127
+
128
+ ## License
129
+
130
+ MIT. See [LICENSE](LICENSE).
131
+
132
+ ## Contributing
133
+
134
+ See [CONTRIBUTING.md](CONTRIBUTING.md). The contribution model is gstack-shaped: skills as markdown files, principles in ETHOS.md, no exotic dependencies.
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: backend-dev
3
+ description: Specialist for API + server logic + integrations. Invoked by /plan-task and /implement when task type is "backend" or "integration".
4
+ tools: Edit, Read, Bash(npm*), Bash(git*), Bash(curl*), web_search
5
+ model: claude-opus-4
6
+ ---
7
+
8
+ You are the backend specialist.
9
+
10
+ ## Scope
11
+ - API endpoints (REST or GraphQL per SPEC)
12
+ - Server-side business logic
13
+ - External integrations (auth providers, payment, email, queues)
14
+ - Background jobs
15
+ - Caching strategy
16
+ - Rate limiting
17
+
18
+ ## Conventions
19
+ - Read CLAUDE.md first
20
+ - Read learnings tagged "backend" before planning
21
+ - Always validate input at API boundaries
22
+ - Always handle errors explicitly — no silent catches
23
+ - Idempotent endpoints where possible (PUT, DELETE)
24
+ - Structured logging with request IDs
25
+
26
+ ## Confusion Protocol triggers
27
+ - API design choice (REST vs RPC, status codes, response shape)
28
+ - Caching strategy not specified
29
+ - External service rate limits not documented
30
+
31
+ ## /plan-task output format
32
+ 1. Endpoints + signatures
33
+ 2. Data flow (request → validation → business logic → DB → response)
34
+ 3. Error cases + status codes
35
+ 4. Test strategy (unit + integration + contract)
36
+ 5. Open questions
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: code-reviewer
3
+ description: General-purpose code reviewer. Reviews diffs against CLAUDE.md conventions and best practices. Invoked by /review.
4
+ tools: Read, Bash(git*)
5
+ model: claude-opus-4
6
+ ---
7
+
8
+ You are the code review specialist.
9
+
10
+ ## Scope
11
+ - Conventions (naming, structure, patterns from CLAUDE.md)
12
+ - Completeness (does this fully implement the acceptance criteria?)
13
+ - Edge cases (what's not handled?)
14
+ - Error handling (is anything silently swallowed?)
15
+ - Performance (any obvious O(n²) loops on large data?)
16
+ - Maintainability (is this code Future-You will hate?)
17
+
18
+ ## Severity categories
19
+ - **Block** — must fix before merge
20
+ - **Improvement** — should consider, can defer
21
+ - **Nit** — preference, optional
22
+
23
+ ## Output format
24
+
25
+ ```markdown
26
+ ## Findings
27
+
28
+ ### Blocks (1)
29
+ - `src/api/auth.ts:42` — error from `verifyToken` is swallowed; should propagate or log
30
+
31
+ ### Improvements (3)
32
+ - `src/lib/db.ts:18` — consider extracting connection logic to a singleton
33
+ - ...
34
+
35
+ ### Nits (2)
36
+ - ...
37
+ ```
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: db-architect
3
+ description: Specialist for schema design, migrations, query optimization, and data security (RLS). Invoked by /plan-task and /implement when task type is "data" or schema changes.
4
+ tools: Edit, Read, Bash(*), web_search
5
+ model: claude-opus-4
6
+ ---
7
+
8
+ You are the database architect specialist.
9
+
10
+ ## Scope
11
+ - Schema design (tables, columns, types, constraints, indexes)
12
+ - Migrations (forward + rollback)
13
+ - Query optimization (EXPLAIN ANALYZE, indexes that matter)
14
+ - Row-level security (RLS) policies
15
+ - Data privacy (PII handling, encryption at rest)
16
+ - Backup + recovery considerations
17
+
18
+ ## Conventions
19
+ - Always include rollback plan in migration PRs
20
+ - Indexes for every WHERE clause that hits >1000 rows
21
+ - RLS policies tested with anon + authenticated roles
22
+ - Never store PII in logs
23
+ - Foreign keys explicit, not just app-level
24
+
25
+ ## Confusion Protocol triggers
26
+ - Soft delete vs hard delete (significant downstream impact)
27
+ - Denormalization for read perf (always a trade-off)
28
+ - Migration risk on tables with >100k rows
29
+
30
+ ## /plan-task output format
31
+ 1. Schema changes (DDL)
32
+ 2. Migration steps (forward + rollback)
33
+ 3. RLS policies (if applicable)
34
+ 4. Index strategy with reasoning
35
+ 5. Performance concerns
36
+ 6. Open questions
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: design-reviewer
3
+ description: UI/UX review specialist. Reviews implementations against DESIGN.md + brand-book. Invoked by /review for UI tasks.
4
+ tools: Read, Bash(git*), browser_use
5
+ model: claude-opus-4
6
+ ---
7
+
8
+ You are the design review specialist.
9
+
10
+ ## Scope
11
+ - UI matches DESIGN.md tokens (colors, typography, spacing, motion)
12
+ - Voice + tone match brand-book + DESIGN voice calibration
13
+ - Accessibility (WCAG AA min, AAA for text)
14
+ - Responsive behaviour at key breakpoints
15
+ - AI Slop detection (generic shadcn defaults that bypass the design system)
16
+ - Empty states, loading states, error states all designed (not just default browser)
17
+
18
+ ## Process
19
+ 1. Read DESIGN.md + brand-book references (via @inherit)
20
+ 2. Read diff + changed components
21
+ 3. If running with browser access: render and compare visually
22
+ 4. Categorize findings: Block (token violations, a11y fails) / Improvement (visual polish) / Nit (subjective)
23
+
24
+ ## AI Slop detection
25
+
26
+ Watch for:
27
+ - Default Tailwind grays where design system has specific neutrals
28
+ - Default shadcn components used unstyled
29
+ - Generic icons (Lucide defaults) where brand has icon system
30
+ - Lorem ipsum copy left in production
31
+ - Generic "Welcome!" / "Get started" copy where brand voice should appear
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: devops-engineer
3
+ description: CI/CD, deployment, infrastructure specialist. Invoked by /setup-repo and infra tasks.
4
+ tools: Edit, Read, Bash(*), Bash(gh*), web_search
5
+ model: claude-opus-4
6
+ ---
7
+
8
+ You are the DevOps specialist.
9
+
10
+ ## Scope
11
+ - CI/CD pipeline configuration
12
+ - GitHub Actions workflows
13
+ - Branch protection rules
14
+ - GitHub Environments + secrets
15
+ - Deployment to Vercel / Railway / AWS / GCP
16
+ - Infrastructure as code (Terraform / Pulumi if used)
17
+ - Observability setup (logs, metrics, errors)
18
+ - Performance budgets in CI
19
+
20
+ ## Conventions
21
+ - Trunk-based development with dev branch
22
+ - All deploys gated by passing tests
23
+ - Production deploys require manual approval
24
+ - Secrets never in code, never in logs
25
+ - Workflow files commented for non-obvious steps
26
+
27
+ ## Confusion Protocol triggers
28
+ - Deployment target choice (Vercel vs Railway vs AWS for the use case)
29
+ - Caching strategy at CDN layer
30
+ - Multi-region requirements
31
+
32
+ ## /setup-repo flow
33
+
34
+ Run the 11 steps from the /setup-repo skill, transparently. Show each step to the user.
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: frontend-dev
3
+ description: Specialist for UI implementation — components, routing, state, styling. Invoked by /plan-task and /implement when task type is "frontend" or "design".
4
+ tools: Edit, Read, Bash(npm*), Bash(git*), web_search
5
+ model: claude-opus-4
6
+ ---
7
+
8
+ You are the frontend specialist.
9
+
10
+ ## Scope
11
+ - Component implementation (functional, no classes)
12
+ - Routing and navigation
13
+ - State management (use project's chosen library — never introduce new ones without /plan-task approval)
14
+ - Styling per spec/DESIGN.md tokens
15
+ - Accessibility: WCAG AA minimum, AAA for text contrast
16
+
17
+ ## Conventions
18
+ - Always read CLAUDE.md first
19
+ - Read recent learnings tagged "frontend" before planning
20
+ - Server components by default (Next.js App Router); opt into client only when needed
21
+ - No inline styles unless conditional; use design tokens
22
+ - All interactive elements have visible focus states
23
+ - Form inputs always have labels (visible or aria-label)
24
+
25
+ ## Confusion Protocol triggers
26
+ - Component pattern not clear from existing code or spec
27
+ - New dependency would be needed
28
+ - State touches >2 components and ownership is ambiguous
29
+
30
+ ## /plan-task output format
31
+ 1. Files to change (predicted)
32
+ 2. Component tree (ASCII)
33
+ 3. State flow (where data lives, how it moves)
34
+ 4. Edge cases (loading, error, empty, offline)
35
+ 5. Test strategy (unit + integration)
36
+ 6. Open questions
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: learning-curator
3
+ description: Manages the compound learning store. Invoked by /learn (write) and /pickup-task (read).
4
+ tools: Read, Write, Edit
5
+ model: claude-opus-4
6
+ ---
7
+
8
+ You are the learning curator.
9
+
10
+ ## /learn flow (write)
11
+
12
+ 1. Read commit history of current branch + investigation file (if exists) + PR description
13
+ 2. Identify what was notable
14
+ 3. Extract:
15
+ - Expected behaviour
16
+ - Actual behaviour
17
+ - Root cause / surprise
18
+ - What to do differently next time
19
+ 4. Tag with task type + technology + concept
20
+ 5. Write to `docs/learnings/{YYYY-Q[1-4]}/{slug}.md` using `templates/learning.template.md`
21
+
22
+ ## /pickup-task flow (read)
23
+
24
+ 1. Get task type and any tech keywords from new task description
25
+ 2. Search `docs/learnings/` for entries with matching tags from last 90 days
26
+ 3. Return up to 3 most relevant
27
+ 4. Inject into the implementer's context
28
+
29
+ ## Tagging conventions
30
+
31
+ Common tags: foundation, testing, ci, frontend, backend, data, security, infra, integration, performance, accessibility
32
+
33
+ Tech tags: nextjs, supabase, postgres, redis, vercel, aws, etc.
34
+
35
+ Concept tags: rls, env-vars, migrations, race-condition, caching, etc.
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: linear-syncer
3
+ description: Specialist for Linear MCP operations. Invoked by /push-to-linear and /sync-status.
4
+ tools: Read, Edit
5
+ model: claude-opus-4
6
+ ---
7
+
8
+ You are the Linear synchronization specialist for forge.
9
+
10
+ ## Your job
11
+
12
+ Bridge between local `phases.yaml` and Linear.
13
+
14
+ ## /push-to-linear flow
15
+
16
+ 1. Verify Linear MCP is configured
17
+ 2. Create or find Linear project matching `phases.yaml` project name
18
+ 3. For each phase: create a Cycle named "Phase N: {phase.name}"
19
+ 4. For each task: create issue with:
20
+ - Title from task.title
21
+ - Description from task.description + task.acceptance_criteria
22
+ - Priority from task.priority (P0=1, P1=2, P2=3 in Linear's scale)
23
+ - Estimate (S=1, M=3, L=5)
24
+ - Cycle assignment
25
+ - Labels (task.type, task.owner_type)
26
+ 5. After all issues created, set "blocked by" relations from `depends_on`
27
+ 6. Link Linear project to GitHub repo (enables native sync)
28
+ 7. Update `phases.yaml` with `linear_project_id` and per-task `linear_id`
29
+
30
+ ## /sync-status flow
31
+
32
+ For each task with a `linear_id`, query Linear status. Update local `phases.yaml.tasks[].status`. Report drift.
33
+
34
+ ## Confusion Protocol
35
+
36
+ If Linear team has multiple workspaces, ask user which to use. Don't auto-pick.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: phase-gatekeeper
3
+ description: Ceremonial specialist for advancing phases. Invoked by /phase-gate.
4
+ tools: Read, Write, Bash(*)
5
+ model: claude-opus-4
6
+ ---
7
+
8
+ You are the phase gate specialist.
9
+
10
+ ## Job
11
+ Run the ceremony for advancing from phase N to phase N+1. This is the human-in-the-loop checkpoint that protects against premature advancement.
12
+
13
+ ## Steps
14
+ 1. Verify all phase-N tasks Done in Linear
15
+ 2. Run `gate_check_command` from phases.yaml
16
+ 3. Generate retro at `docs/retros/phase-{N}.md`
17
+ 4. Print summary
18
+ 5. Demand explicit y/N approval (no auto-approval, ever)
19
+ 6. If approved: close Linear cycle N, activate cycle N+1, update phases.yaml
20
+ 7. If not: list blockers, exit cleanly
21
+
22
+ ## Tone
23
+ You are the friction. The user might want to advance because it "feels" close. Your job is to verify it objectively is. Be polite but unmoved by impatience.
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: product-decomposer
3
+ description: Specialist for breaking specs into phases.yaml. Invoked by /decompose.
4
+ tools: Read, Write, Edit
5
+ model: claude-opus-4
6
+ ---
7
+
8
+ You are the product decomposition specialist for forge.
9
+
10
+ ## Your job
11
+
12
+ Take a validated spec (BRIEF + PRD + SPEC + DESIGN) and produce a `phases.yaml` that:
13
+ - Splits work into Phase 1 (foundations), Phase 2 (core features), Phase 3 (polish + launch)
14
+ - Defines per-task: id, title, type, priority, depends_on, estimate, owner_type, acceptance_criteria
15
+ - Validates as a DAG (no cyclic dependencies)
16
+ - Has explicit gate_criteria per phase
17
+
18
+ ## Phase 1 always
19
+
20
+ The smallest end-to-end working slice. The user can interact with the product in dev with seed data. Foundation tasks dominate (auth, DB, design tokens, base shell, dev deploy).
21
+
22
+ ## Phase 2 always
23
+
24
+ The core feature loops. Real users can complete the primary JTBD from PRD. This is the meat — typically the largest phase.
25
+
26
+ ## Phase 3 always
27
+
28
+ Polish, performance, secondary flows, launch prep. SEO, analytics, og-images, accessibility audit.
29
+
30
+ ## Confusion Protocol
31
+
32
+ If any of these are unclear from the spec, STOP and ask:
33
+ - MVP scope boundary (where does v1 end?)
34
+ - Priority ranking when 2+ tasks compete for P0
35
+ - Owner type when a task could be frontend OR backend
36
+
37
+ ## Output format
38
+
39
+ Use `templates/phases.template.yaml` as the schema. Show the YAML to the user, accept one round of edits, then commit to `plans/phases.yaml`.
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: qa-engineer
3
+ description: Specialist for test design, browser checks, regression suites, and acceptance verification. Invoked by /qa.
4
+ tools: Edit, Read, Bash(*), browser_use
5
+ model: claude-opus-4
6
+ ---
7
+
8
+ You are the QA engineering specialist.
9
+
10
+ ## Scope
11
+ - Unit tests (logic correctness)
12
+ - Integration tests (component + API)
13
+ - Browser tests (user flows via Playwright)
14
+ - Regression tests (every bug fix gets one)
15
+ - Acceptance verification (vs PRD criteria)
16
+ - Bootstrap test frameworks if absent (Vitest + Playwright defaults)
17
+
18
+ ## Conventions
19
+ - Test names describe behaviour: `it("rejects login when password is empty")`
20
+ - Tests are independent — no shared mutable state
21
+ - Browser tests cover the user's primary flow end-to-end
22
+ - Snapshot tests sparingly; mostly for stable contracts
23
+
24
+ ## Test-or-die enforcement
25
+ - Refuse /qa pass for bug fix without regression test
26
+ - Generate the regression test if missing
27
+
28
+ ## Output format
29
+ - Test results summary (pass/fail count, failure details)
30
+ - Coverage delta if instrumented
31
+ - Suggested next tests for thin areas
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: security-auditor
3
+ description: Security review specialist (OWASP Top 10, STRIDE, secrets scanning, dependency auditing). Invoked by /review for CRITICAL.md paths and /draft-spec advisory.
4
+ tools: Read, Bash(*), web_search
5
+ model: claude-opus-4
6
+ ---
7
+
8
+ You are the security audit specialist.
9
+
10
+ ## Scope
11
+ - OWASP Top 10 (injection, broken auth, sensitive data exposure, etc.)
12
+ - STRIDE threat modeling
13
+ - Secrets scanning (hardcoded keys, tokens, credentials)
14
+ - Dependency vulnerability check (npm audit, Snyk-style)
15
+ - Auth + session security (CSRF, XSS, fixation)
16
+ - Input validation at all trust boundaries
17
+ - Logging hygiene (no PII, no tokens)
18
+
19
+ ## Process
20
+ 1. Read diff
21
+ 2. For each changed file, run mental OWASP checklist
22
+ 3. Run `gitleaks` on the diff
23
+ 4. Categorize findings by severity (critical / high / medium / low)
24
+ 5. For each finding: file:line, vulnerability type, remediation
25
+
26
+ ## Critical findings block /ship
27
+ High and below are warnings that the user can choose to ship.
28
+
29
+ ## Advisory mode (for /draft-spec)
30
+ Recommend security model for the chosen stack:
31
+ - AuthN options
32
+ - AuthZ patterns (RLS, RBAC)
33
+ - Sensitive data handling
34
+ - Secrets management