@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/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@firatcand/forge",
3
+ "version": "0.1.0",
4
+ "description": "A lightweight framework for shipping software products from idea to production with AI coding agents (Claude Code, Codex CLI, Cursor, Gemini)",
5
+ "type": "module",
6
+ "bin": {
7
+ "forge": "bin/forge.js"
8
+ },
9
+ "files": [
10
+ "bin/",
11
+ "lib/",
12
+ "skills/",
13
+ "agents/",
14
+ "templates/",
15
+ "ETHOS.md",
16
+ "README.md",
17
+ "LICENSE"
18
+ ],
19
+ "engines": {
20
+ "node": ">=18.0.0"
21
+ },
22
+ "dependencies": {
23
+ "@inquirer/prompts": "^7.0.0",
24
+ "chalk": "^5.3.0",
25
+ "fs-extra": "^11.2.0"
26
+ },
27
+ "keywords": [
28
+ "claude-code",
29
+ "claude",
30
+ "codex",
31
+ "cursor",
32
+ "gemini",
33
+ "ai-agent",
34
+ "agentic-coding",
35
+ "framework",
36
+ "skills",
37
+ "subagents",
38
+ "compound-engineering",
39
+ "product-development",
40
+ "linear",
41
+ "github"
42
+ ],
43
+ "author": "Firat Can Basarir",
44
+ "license": "MIT",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/firatcand/forge.git"
48
+ },
49
+ "homepage": "https://github.com/firatcand/forge#readme",
50
+ "bugs": {
51
+ "url": "https://github.com/firatcand/forge/issues"
52
+ }
53
+ }
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: codex
3
+ description: Get a second opinion from Codex CLI on the current diff or specific files. Required for changes touching CRITICAL.md paths.
4
+ tools: Bash(codex*), Bash(git*), Read
5
+ ---
6
+
7
+ # /codex
8
+
9
+ ## Preconditions
10
+
11
+ - Codex CLI installed (`which codex`)
12
+ - Active Codex membership (handled by Codex CLI's own auth)
13
+
14
+ ## Modes
15
+
16
+ ### review (default)
17
+
18
+ ```bash
19
+ git diff HEAD | codex --stdin
20
+ ```
21
+
22
+ ### adversarial
23
+
24
+ ```bash
25
+ codex --adversarial --diff
26
+ ```
27
+
28
+ Prompts Codex to actively try to find ways to break the code.
29
+
30
+ ### consult
31
+
32
+ ```bash
33
+ codex consult --file [path]
34
+ ```
35
+
36
+ Open a session with Codex on a specific file or topic.
37
+
38
+ ## When to use
39
+
40
+ - Always for files matching paths in CRITICAL.md
41
+ - Architecture decisions
42
+ - Anything where you'd want a second engineer to look at it
43
+
44
+ ## Integration with /ship
45
+
46
+ If `/ship` detects the diff touches CRITICAL.md paths, it runs `/codex review` automatically and blocks PR creation if critical findings.
47
+
48
+ ## Output
49
+
50
+ Codex CLI's review output, formatted for readability. Findings categorized by severity.
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: decompose
3
+ description: Break the validated spec into phases.yaml — a dependency graph of tasks across Phase 1/2/3 with gate criteria, owner types, and acceptance criteria.
4
+ tools: Read, Write, Edit
5
+ subagent: product-decomposer
6
+ ---
7
+
8
+ # /decompose
9
+
10
+ Delegate to the `product-decomposer` subagent.
11
+
12
+ ## Preconditions
13
+
14
+ `spec/CONTEXT.md` must exist.
15
+
16
+ ## Algorithm
17
+
18
+ 1. Identify the smallest end-to-end working slice → Phase 1
19
+ - Phase 1 goal is always: "skeleton works end-to-end with mock/seed data"
20
+ 2. Identify the core feature loops → Phase 2
21
+ - Phase 2 goal: "real users can complete the primary JTBD"
22
+ 3. Identify polish + launch prep → Phase 3
23
+ - Phase 3 goal: "quality bar for public launch"
24
+
25
+ ## Per-task fields
26
+
27
+ - id (P{phase}-T{nn})
28
+ - title (verb + noun, max 8 words)
29
+ - description (1 paragraph)
30
+ - type (foundation | data | backend | frontend | design | infra | content | integration)
31
+ - priority (P0 | P1 | P2)
32
+ - depends_on (list of task IDs)
33
+ - estimate (S | M | L | XL)
34
+ - owner_type (which subagent picks this up)
35
+ - acceptance_criteria (concrete, testable)
36
+
37
+ ## Hard rules
38
+
39
+ - No XL tasks ship — split them
40
+ - Every phase has explicit gate_criteria
41
+ - Dependency graph must be a DAG (validator catches cycles)
42
+
43
+ ## Refinement
44
+
45
+ Show YAML to user, ask for one round of edits. Then write to `plans/phases.yaml`.
46
+
47
+ Print: "phases.yaml written. /push-to-linear unlocked. Gate 4 — review the breakdown."
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: draft-design
3
+ description: Generate spec/DESIGN.md from spec/PRD.md. References user's brand-book and design-system via @inherit pattern.
4
+ tools: Read, Write, Edit
5
+ ---
6
+
7
+ # /draft-design
8
+
9
+ ## Preconditions
10
+
11
+ - `spec/PRD.md` must exist
12
+ - User's brand assets configured in `~/.claude/CLAUDE.md` under `brand_assets`
13
+
14
+ ## Configuration expected
15
+
16
+ ```yaml
17
+ # In ~/.claude/CLAUDE.md
18
+ brand_assets:
19
+ brand_book: ~/work/brand/BRAND-BOOK.md
20
+ design_system: ~/work/brand/DESIGN-SYSTEM.md
21
+ voice_register: ~/work/brand/VOICE.md
22
+ ```
23
+
24
+ If not configured, prompt user to set these once.
25
+
26
+ ## Orchestration
27
+
28
+ 1. Read PRD, brand_book, design_system, voice_register
29
+ 2. Check if user has a `ux-design` skill — invoke with all four as context
30
+ 3. Determine project surface area (marketing site, app UI, email, docs)
31
+ 4. Generate DESIGN.md using `@inherit` pattern — reference brand assets, don't duplicate
32
+
33
+ ## The @inherit pattern
34
+
35
+ DESIGN.md should reference, not duplicate:
36
+
37
+ ```markdown
38
+ ## Tokens
39
+ @inherit ~/work/brand/DESIGN-SYSTEM.md#tokens
40
+
41
+ Project-specific overrides:
42
+ - accent: --color-coral (use only for primary CTA)
43
+
44
+ ## Voice
45
+ @inherit ~/work/brand/VOICE.md
46
+
47
+ Project-specific calibration:
48
+ - This is a tool, not editorial — trim lyricism, keep precision
49
+ ```
50
+
51
+ When brand assets update, project DESIGN.md inherits the change.
52
+
53
+ ## Output
54
+
55
+ `spec/DESIGN.md` + Gate 3 confirmation.
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: draft-prd
3
+ description: Generate spec/PRD.md from spec/BRIEF.md. Orchestrates the user's product-spec skill if available, otherwise guides Claude through the PRD template directly.
4
+ tools: Read, Write, Edit
5
+ ---
6
+
7
+ # /draft-prd
8
+
9
+ ## Preconditions
10
+
11
+ `spec/BRIEF.md` must exist. If not, refuse and direct user to `/forge`.
12
+
13
+ ## Orchestration
14
+
15
+ 1. Read `spec/BRIEF.md`
16
+ 2. Check if user has a `product-spec` skill available globally — if yes, invoke it with BRIEF.md as input
17
+ 3. If not, use `templates/PRD.template.md` directly and guide Claude through filling each required section based on BRIEF
18
+ 4. Cross-check generated PRD against BRIEF — flag any drift (new features not in v1 scope, success metrics differing from BRIEF's north star)
19
+ 5. Write to `spec/PRD.md`
20
+
21
+ ## Required PRD sections
22
+
23
+ - Problem (synthesized from BRIEF.pain, made concrete)
24
+ - Target user (specific persona, JTBD format)
25
+ - Acceptance Criteria (testable bullets)
26
+ - Non-goals (must include all from BRIEF.non-goals)
27
+ - Success metrics (must include north-star from BRIEF)
28
+ - Constraints (budget, timeline, regulatory, integrations)
29
+
30
+ ## Output
31
+
32
+ Print:
33
+
34
+ ```
35
+ PRD written to spec/PRD.md
36
+
37
+ Acceptance criteria preview:
38
+ - [criterion 1]
39
+ - [criterion 2]
40
+ - [criterion 3]
41
+
42
+ Gate 2 — review the PRD. To proceed:
43
+ • /draft-spec to generate the technical SPEC
44
+ • /draft-design to generate the DESIGN doc (if UI-heavy)
45
+ • Edit spec/PRD.md directly
46
+ • /draft-prd --refine [section] to re-generate a weak section
47
+ ```
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: draft-spec
3
+ description: Generate spec/SPEC.md from spec/PRD.md. Orchestrates the user's software-architect skill if available, otherwise guides Claude through the SPEC template.
4
+ tools: Read, Write, Edit
5
+ ---
6
+
7
+ # /draft-spec
8
+
9
+ ## Preconditions
10
+
11
+ `spec/PRD.md` must exist (Gate 2 must have passed).
12
+
13
+ ## Orchestration
14
+
15
+ 1. Read `spec/PRD.md`
16
+ 2. Read `~/.claude/CLAUDE.md` for any stack_preferences block
17
+ 3. Check if user has a `software-architect` skill available — if yes, invoke it with PRD + stack preferences
18
+ 4. If not, use `templates/SPEC.template.md` and guide Claude through filling sections
19
+ 5. Invoke `security-auditor` subagent in advisory mode for the chosen stack — get security model recommendations
20
+ 6. Write to `spec/SPEC.md`
21
+
22
+ ## Required SPEC sections
23
+
24
+ - Stack (runtime, frontend, backend, db, hosting, auth)
25
+ - Data model (tables, relationships, indexes)
26
+ - Key flows (numbered steps with edge cases)
27
+ - Integration points (external services)
28
+ - Security model (authN, authZ, sensitive data handling)
29
+ - Environment variables (12-Factor compliant — names + descriptions)
30
+ - Performance targets (p95 metrics)
31
+ - Observability (logs, metrics, errors)
32
+
33
+ ## Stack choice ceremony
34
+
35
+ If SPEC implies a tech stack not yet committed, invoke Confusion Protocol:
36
+ - List 2-3 viable options
37
+ - Show concrete trade-offs
38
+ - Stop and ask user to pick before writing
39
+
40
+ ## Output
41
+
42
+ Print confirmation + Gate 3 instructions.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: fix
3
+ description: Apply a fix based on /investigate output. Refuses to run without recent investigation.
4
+ tools: Edit, Read, Bash(*)
5
+ ---
6
+
7
+ # /fix
8
+
9
+ ## Preconditions
10
+
11
+ `plans/tasks/{LINEAR-ID}.investigation.md` must exist and be < 24 hours old.
12
+
13
+ ## Process
14
+
15
+ 1. Read investigation
16
+ 2. Apply minimal fix matching root cause
17
+ 3. Add regression test that reproduces the original bug (Test-or-die)
18
+ 4. Verify fix + test passes
19
+ 5. Commit with conventional message: `fix(scope): brief description`
20
+
21
+ ## After 3 failed attempts
22
+
23
+ Stop. Demand fresh `/investigate`. Do not thrash.
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: forge
3
+ description: Apply Socratic pressure to a raw idea and produce a validated project BRIEF. Heavy ceremony — 6 forcing questions. The required first command for any new forge project.
4
+ tools: Read, Write, Edit, Bash(git*)
5
+ ---
6
+
7
+ # /forge
8
+
9
+ Take a raw idea — a sentence in the user's head — and produce a validated `spec/BRIEF.md` that everything downstream draws from.
10
+
11
+ ## When invoked
12
+
13
+ User runs `/forge` (no args) at the start of a new project, OR `/forge --refine [section]` to re-run on a weak section of an existing BRIEF.md.
14
+
15
+ ## The 6 Forcing Questions
16
+
17
+ You MUST ask all six. Do not skip. Do not soften. Push back when answers are vague.
18
+
19
+ ### Q1 — The pain
20
+ "What pain are we solving? Who feels it most acutely? When did you last see it felt? What do they do today instead?"
21
+
22
+ If the answer is "people want X" — push back. People wanting is not pain. Demand a specific moment, a specific user, a specific workaround.
23
+
24
+ ### Q2 — The unfair advantage
25
+ "Why you, and why now? What do you know, have access to, or have built before that gives you a meaningful edge?"
26
+
27
+ If the user has none, push back: "If anyone could build this in a weekend, why hasn't it won?"
28
+
29
+ ### Q3 — The smallest valuable thing
30
+ "What is the smallest version of this that would still be worth using? Strip everything optional. What remains?"
31
+
32
+ If the answer includes "and also" more than twice, force a cut.
33
+
34
+ ### Q4 — The non-goals
35
+ "What will you explicitly NOT build, even when asked? What's tempting but a trap?"
36
+
37
+ If the user can't list non-goals, the scope will balloon.
38
+
39
+ ### Q5 — Success in one number
40
+ "If this is wildly successful in 6 months, what single number proves it? Not a vanity metric."
41
+
42
+ Push back on multi-metric answers. Force one.
43
+
44
+ ### Q6 — The kill criteria
45
+ "What evidence in 4 weeks, 12 weeks, 6 months would mean 'stop'?"
46
+
47
+ Most projects die because nobody set a kill line.
48
+
49
+ ## Adaptive depth
50
+
51
+ If answers to Q1-Q3 are sharp, you may compress Q4-Q6 into a single combined question. You do not skip the questions, only their separation.
52
+
53
+ If any answer is vague, ask up to 3 follow-ups before moving on.
54
+
55
+ ## Output
56
+
57
+ Use `templates/BRIEF.template.md` to write `spec/BRIEF.md`.
58
+
59
+ After writing, print:
60
+
61
+ ```
62
+ BRIEF written to spec/BRIEF.md
63
+
64
+ 5-bullet summary:
65
+ 1. [problem]
66
+ 2. [user]
67
+ 3. [v1 scope]
68
+ 4. [north star]
69
+ 5. [kill criteria]
70
+
71
+ Gate 1 — review the brief. To proceed:
72
+ • /draft-prd to generate the PRD
73
+ • Edit spec/BRIEF.md directly for fixes
74
+ • /forge --refine [section] to re-Socratic a weak section
75
+ ```
76
+
77
+ ## --refine mode
78
+
79
+ When invoked with `--refine [section]`:
80
+ 1. Read existing spec/BRIEF.md
81
+ 2. Re-ask the relevant forcing questions with sharper framing
82
+ 3. Update only that section
83
+ 4. Show diff before writing
84
+
85
+ ## Confusion Protocol
86
+
87
+ If the user's idea is too vague to even start the forcing questions, stop and ask for the one-sentence pitch first. Don't try to extract Q1 from "I want to build something."
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: implement
3
+ description: Execute the approved plan from /plan-task. Refuses to run without an approved plan unless --quickfix flag.
4
+ tools: Edit, Read, Write, Bash(*)
5
+ ---
6
+
7
+ # /implement
8
+
9
+ ## Preconditions
10
+
11
+ - `plans/tasks/{LINEAR-ID}.plan.md` exists and was committed
12
+ - OR `--quickfix` flag with justification
13
+
14
+ ## Execution
15
+
16
+ 1. Read plan
17
+ 2. Execute step-by-step, committing after each logical unit
18
+ 3. Use conventional commit messages
19
+ 4. If you encounter a Confusion Protocol trigger not in the plan, STOP and ask
20
+ 5. Run `npm run typecheck` (or equivalent) after each major change
21
+
22
+ ## Output
23
+
24
+ Summary of files changed, commits made, any deviations from plan.
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: ingest-spec
3
+ description: Validate that BRIEF, PRD, SPEC, and (optional) DESIGN are all complete and consistent. Build CONTEXT.md as canonical synthesis. Required before /decompose.
4
+ tools: Read, Write
5
+ ---
6
+
7
+ # /ingest-spec
8
+
9
+ ## Validation checklist
10
+
11
+ For BRIEF.md:
12
+ - [ ] Pain section is concrete (not "people want")
13
+ - [ ] Target user is specific
14
+ - [ ] Non-goals listed
15
+ - [ ] North-star metric has a number
16
+
17
+ For PRD.md:
18
+ - [ ] Acceptance criteria are testable
19
+ - [ ] Non-goals match BRIEF non-goals
20
+ - [ ] Success metrics include BRIEF north-star
21
+
22
+ For SPEC.md:
23
+ - [ ] Stack is specified
24
+ - [ ] Data model present
25
+ - [ ] Env variables enumerated
26
+ - [ ] Security model defined
27
+
28
+ For DESIGN.md (if exists):
29
+ - [ ] Tokens reference brand-book via @inherit OR are explicitly defined
30
+ - [ ] Voice section calibrated for this product
31
+
32
+ ## Cross-document consistency
33
+
34
+ - PRD acceptance criteria must be testable given SPEC's data model
35
+ - DESIGN voice must be compatible with PRD's target user
36
+ - All env vars in SPEC must have entries in `.env.example`
37
+
38
+ ## On failure
39
+
40
+ List what's missing or inconsistent. Block /decompose.
41
+
42
+ ## On success
43
+
44
+ Write `spec/CONTEXT.md` — single-page synthesis of all four docs. This is what `/decompose` reads.
45
+
46
+ Print: "Spec validated. /decompose unlocked."
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: investigate
3
+ description: Iron Law of Investigation — required before /fix. Trace data flow, test hypotheses, identify root cause.
4
+ tools: Read, Bash(*)
5
+ ---
6
+
7
+ # /investigate
8
+
9
+ ## Process
10
+
11
+ 1. Reproduce the bug — write the minimal repro steps
12
+ 2. Identify the data flow involved
13
+ 3. Form hypothesis: "I think the bug is caused by X because Y"
14
+ 4. Test the hypothesis — instrument code, check logs, run debugger
15
+ 5. Either confirm or rule out; if ruled out, form next hypothesis
16
+ 6. Document the root cause: "Root cause: X. Evidence: Y. Affected paths: Z"
17
+
18
+ ## Output
19
+
20
+ Write `plans/tasks/{LINEAR-ID}.investigation.md` with:
21
+ - Repro steps
22
+ - Hypotheses tested
23
+ - Root cause identified
24
+ - Proposed fix approach (high-level)
25
+
26
+ This file is required by /fix.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: learn
3
+ description: Write a learning entry capturing what surprised us, what we'd do differently. Auto-suggested by /ship if task was notable.
4
+ tools: Read, Write
5
+ subagent: learning-curator
6
+ ---
7
+
8
+ # /learn
9
+
10
+ Delegate to `learning-curator`.
11
+
12
+ ## Triggers (any one makes the task "notable")
13
+
14
+ - Investigation took > 30 min
15
+ - > 2 fix attempts before success
16
+ - Surprised by behaviour
17
+ - Found a non-obvious gotcha
18
+ - Made a non-trivial trade-off
19
+ - Bootstrapped something new (test framework, CI, infrastructure)
20
+
21
+ ## Process
22
+
23
+ 1. Read the last commit + PR description + investigation file (if exists)
24
+ 2. Extract:
25
+ - What we expected
26
+ - What actually happened
27
+ - Why
28
+ - What we'd do differently
29
+ 3. Tag with relevant types
30
+ 4. Write 5-10 line learning to `docs/learnings/{quarter}/{slug}.md` using `templates/learning.template.md`
31
+
32
+ ## Format
33
+
34
+ ```markdown
35
+ # {Slug title}
36
+ > {ISO date} · {LINEAR-ID} · tags: [foundation, testing]
37
+
38
+ ## What we expected
39
+ [1-2 lines]
40
+
41
+ ## What happened
42
+ [2-3 lines]
43
+
44
+ ## Why
45
+ [1-2 lines]
46
+
47
+ ## Next time
48
+ [1-2 lines]
49
+ ```
50
+
51
+ ## Retrieval
52
+
53
+ `/pickup-task` reads recent learnings tagged with the new task's type and injects them into context. The system gets smarter over time.
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: phase-gate
3
+ description: Ceremony to advance from phase N to phase N+1. Verifies gate criteria, runs end-to-end check, generates retro, prompts for human approval.
4
+ tools: Read, Write, Bash(*)
5
+ subagent: phase-gatekeeper
6
+ ---
7
+
8
+ # /phase-gate
9
+
10
+ Delegate to `phase-gatekeeper`.
11
+
12
+ ## Args
13
+
14
+ - `phase-{N}` (e.g., `phase-1`)
15
+
16
+ ## Steps
17
+
18
+ 1. Read `plans/phases.yaml` for `phase-N.gate_criteria`
19
+ 2. Verify all phase-N tasks are Done in Linear (abort with list if not)
20
+ 3. Run `gate_check_command` from phases.yaml (e.g., `npm run e2e && npm run typecheck`)
21
+ 4. Generate `docs/retros/phase-{N}.md`:
22
+ - Tasks shipped (with PR links)
23
+ - Decisions made
24
+ - Scope changes from original phases.yaml
25
+ - Learnings to harvest
26
+ - What to do differently in phase-{N+1}
27
+ 5. Print summary, ask: "Approve advancing to phase-{N+1}? [y/N]"
28
+ 6. On `y`:
29
+ - Linear: close Cycle N, activate Cycle N+1
30
+ - Move all phase-(N+1) tasks Backlog → Todo
31
+ - Update phases.yaml: `phase-N.status = "complete"`
32
+ - Commit retro
33
+ 7. On `N`: list what's missing, exit (no partial advances)
34
+
35
+ ## Output
36
+
37
+ If approved: confirmation + Phase N+1 task summary. If not: list of blockers.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: pickup-task
3
+ description: Claim the next available task from Linear (or local phases.yaml), create a git worktree, and inject relevant learnings.
4
+ tools: Read, Edit, Bash(git*), Bash(gh*)
5
+ subagent: learning-curator
6
+ ---
7
+
8
+ # /pickup-task
9
+
10
+ ## Args
11
+
12
+ - `[phase]` — default: current active phase
13
+ - `[type-filter]` — optional, filter by owner_type
14
+
15
+ ## Steps
16
+
17
+ 1. Query Linear (via MCP) for issues in current Cycle that are:
18
+ - Status: Todo
19
+ - All `blocked_by` issues are Done
20
+ 2. If multiple match, list and ask user to pick. If one, auto-pick.
21
+ 3. Set Linear issue status → "In Progress"
22
+ 4. Compute branch name: `feat/{LINEAR-ID}-{kebab-case-title}`
23
+ 5. Create git worktree:
24
+ ```bash
25
+ PROJECT_NAME=$(basename "$(pwd)")
26
+ WORKTREE_PATH="../${PROJECT_NAME}-worktrees/${LINEAR-ID}"
27
+ git worktree add "${WORKTREE_PATH}" -b "${BRANCH_NAME}" dev
28
+ ```
29
+ 6. Delegate to `learning-curator` to retrieve relevant learnings:
30
+ - Tags matching task type
31
+ - Created in last 90 days
32
+ 7. Output:
33
+
34
+ ```
35
+ ✓ Worktree created: ../my-project-worktrees/TLOG-101
36
+ ✓ Linear issue TLOG-101 → In Progress
37
+ ✓ Branch: feat/TLOG-101-bootstrap-nextjs
38
+
39
+ Acceptance criteria:
40
+ - Email + Google OAuth working
41
+ - Migrations run cleanly
42
+ - Vercel preview deploy on PR
43
+
44
+ Relevant learnings (3):
45
+ - 2026-Q2/nextjs-supabase-typegen.md
46
+ - 2026-Q2/vercel-env-vars-runtime.md
47
+ - 2026-Q1/git-hooks-prettier-conflict.md
48
+
49
+ Next:
50
+ cd ../my-project-worktrees/TLOG-101
51
+ claude
52
+ > /plan-task
53
+ ```
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: plan-task
3
+ description: Run Plan mode for the current task. Outputs structured plan; required before /implement.
4
+ tools: Read, Write, Edit
5
+ ---
6
+
7
+ # /plan-task
8
+
9
+ ## Steps
10
+
11
+ 1. Read Linear issue (or phases.yaml task) for current branch
12
+ 2. Determine task type → delegate to relevant specialist subagent (frontend-dev, backend-dev, db-architect, etc.)
13
+ 3. Specialist enters Plan mode: research codebase, propose approach
14
+ 4. Write structured plan to `plans/tasks/{LINEAR-ID}.plan.md`:
15
+ - Files to change (predicted)
16
+ - Component tree / data flow
17
+ - State / data flow
18
+ - Edge cases
19
+ - Test strategy
20
+ - Open questions (Confusion Protocol triggers)
21
+ 5. Show plan to user, wait for approval
22
+ 6. On approval: commit plan, unlock /implement