opencastle 1.6.3 → 1.6.4
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/README.md +9 -9
- package/bin/cli.mjs +6 -4
- package/dist/cli/adapters/adapter-contract.test.js +1 -1
- package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
- package/dist/cli/adapters/single-file-base.js +2 -12
- package/dist/cli/adapters/single-file-base.js.map +1 -1
- package/dist/cli/bootstrap.js +1 -1
- package/dist/cli/bootstrap.js.map +1 -1
- package/dist/cli/command-namespace.test.js +4 -21
- package/dist/cli/command-namespace.test.js.map +1 -1
- package/dist/cli/convoy/engine.js +2 -2
- package/dist/cli/convoy/engine.js.map +1 -1
- package/dist/cli/convoy/read-model.d.ts +8 -15
- package/dist/cli/convoy/read-model.d.ts.map +1 -1
- package/dist/cli/convoy/read-model.js +9 -68
- package/dist/cli/convoy/read-model.js.map +1 -1
- package/dist/cli/convoy/read-model.test.js +6 -25
- package/dist/cli/convoy/read-model.test.js.map +1 -1
- package/dist/cli/convoy/spec-builder.d.ts +2 -2
- package/dist/cli/convoy/spec-builder.d.ts.map +1 -1
- package/dist/cli/convoy/spec-builder.js +1 -1
- package/dist/cli/dashboard.js +1 -1
- package/dist/cli/dashboard.test.js +10 -2
- package/dist/cli/dashboard.test.js.map +1 -1
- package/dist/cli/dispatcher.test.js +5 -2
- package/dist/cli/dispatcher.test.js.map +1 -1
- package/dist/cli/docs-accuracy.test.js +5 -1
- package/dist/cli/docs-accuracy.test.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +0 -25
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/pipeline.d.ts +1 -1
- package/dist/cli/pipeline.flow.test.js +77 -77
- package/dist/cli/pipeline.flow.test.js.map +1 -1
- package/dist/cli/pipeline.js +24 -24
- package/dist/cli/pipeline.js.map +1 -1
- package/dist/cli/plan.d.ts +8 -2
- package/dist/cli/plan.d.ts.map +1 -1
- package/dist/cli/plan.js +18 -12
- package/dist/cli/plan.js.map +1 -1
- package/dist/cli/plan.test.js +17 -19
- package/dist/cli/plan.test.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +1 -58
- package/dist/cli/update.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/adapters/adapter-contract.test.ts +1 -1
- package/src/cli/adapters/single-file-base.ts +2 -11
- package/src/cli/bootstrap.ts +1 -1
- package/src/cli/command-namespace.test.ts +5 -22
- package/src/cli/convoy/engine.ts +2 -2
- package/src/{orchestrator/prompts/assess-complexity.prompt.md → cli/convoy/prompts/convoy-assess.prompt.md} +0 -3
- package/src/{orchestrator/prompts/fix-convoy.prompt.md → cli/convoy/prompts/convoy-plan-fix.prompt.md} +0 -3
- package/src/{orchestrator/prompts/validate-convoy.prompt.md → cli/convoy/prompts/convoy-plan-review.prompt.md} +0 -3
- package/src/{orchestrator/prompts/generate-convoy.prompt.md → cli/convoy/prompts/convoy-plan.prompt.md} +0 -2
- package/src/{orchestrator/prompts/fix-prd.prompt.md → cli/convoy/prompts/convoy-prd-fix.prompt.md} +0 -3
- package/src/{orchestrator/prompts/validate-prd.prompt.md → cli/convoy/prompts/convoy-prd-review.prompt.md} +0 -3
- package/src/{orchestrator/prompts/generate-prd.prompt.md → cli/convoy/prompts/convoy-prd.prompt.md} +0 -3
- package/src/cli/convoy/read-model.test.ts +5 -29
- package/src/cli/convoy/read-model.ts +11 -71
- package/src/cli/convoy/spec-builder.ts +2 -2
- package/src/cli/dashboard/dashboard.js +2 -4
- package/src/cli/dashboard.test.ts +10 -2
- package/src/cli/dashboard.ts +1 -1
- package/src/cli/dispatcher.test.ts +6 -2
- package/src/cli/docs-accuracy.test.ts +5 -1
- package/src/cli/doctor.ts +0 -26
- package/src/cli/pipeline.flow.test.ts +78 -78
- package/src/cli/pipeline.ts +25 -25
- package/src/cli/plan.test.ts +18 -20
- package/src/cli/plan.ts +18 -12
- package/src/cli/update.ts +1 -66
- package/src/orchestrator/agent-workflows/README.md +10 -18
- package/src/orchestrator/agent-workflows/data-pipeline.md +7 -140
- package/src/orchestrator/agent-workflows/database-migration.md +7 -153
- package/src/orchestrator/agent-workflows/performance-optimization.md +6 -119
- package/src/orchestrator/agent-workflows/refactoring.md +8 -137
- package/src/orchestrator/agent-workflows/schema-changes.md +8 -159
- package/src/orchestrator/agent-workflows/security-audit.md +7 -142
- package/src/orchestrator/agent-workflows/shared-delivery-phase.md +8 -25
- package/src/orchestrator/agents/architect.agent.md +2 -14
- package/src/orchestrator/agents/content-engineer.agent.md +8 -10
- package/src/orchestrator/agents/data-engineer.agent.md +8 -8
- package/src/orchestrator/agents/developer.agent.md +3 -10
- package/src/orchestrator/agents/devops-expert.agent.md +0 -3
- package/src/orchestrator/agents/performance-expert.agent.md +2 -3
- package/src/orchestrator/agents/security-expert.agent.md +10 -12
- package/src/orchestrator/agents/team-lead.agent.md +31 -75
- package/src/orchestrator/agents/testing-expert.agent.md +3 -6
- package/src/orchestrator/agents/ui-ux-expert.agent.md +1 -4
- package/src/orchestrator/agents/writer.agent.md +0 -3
- package/src/orchestrator/customizations/README.md +3 -4
- package/src/orchestrator/customizations/agents/agent-registry.md +3 -3
- package/src/orchestrator/customizations/agents/skill-matrix.json +6 -42
- package/src/orchestrator/instructions/general.instructions.md +10 -37
- package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +4 -6
- package/src/orchestrator/prompts/brainstorm.prompt.md +7 -12
- package/src/orchestrator/prompts/bug-fix.prompt.md +19 -100
- package/src/orchestrator/prompts/convoy.prompt.md +20 -0
- package/src/orchestrator/prompts/create-skill.prompt.md +1 -5
- package/src/orchestrator/prompts/implement-feature.prompt.md +22 -93
- package/src/orchestrator/prompts/resolve-pr-comments.prompt.md +1 -5
- package/src/orchestrator/skills/api-patterns/SKILL.md +21 -18
- package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +1 -1
- package/src/orchestrator/skills/fast-review/SKILL.md +28 -65
- package/src/orchestrator/skills/frontend-design/REFERENCE.md +0 -1
- package/src/orchestrator/skills/frontend-design/SKILL.md +3 -1
- package/src/orchestrator/skills/git-workflow/SKILL.md +18 -34
- package/src/orchestrator/skills/panel-majority-vote/SKILL.md +16 -46
- package/src/orchestrator/skills/security-hardening/SKILL.md +20 -19
- package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +2 -2
- package/src/orchestrator/skills/self-improvement/SKILL.md +21 -46
- package/src/orchestrator/skills/technical-writing/SKILL.md +3 -1
- package/src/orchestrator/skills/technical-writing/TEMPLATES.md +23 -0
- package/src/orchestrator/skills/testing-workflow/SKILL.md +21 -23
- package/src/orchestrator/skills/validation-gates/REFERENCE.md +2 -14
- package/src/orchestrator/skills/validation-gates/SKILL.md +10 -88
- package/dist/cli/log.d.ts +0 -44
- package/dist/cli/log.d.ts.map +0 -1
- package/dist/cli/log.js +0 -336
- package/dist/cli/log.js.map +0 -1
- package/dist/cli/log.test.d.ts +0 -2
- package/dist/cli/log.test.d.ts.map +0 -1
- package/dist/cli/log.test.js +0 -208
- package/dist/cli/log.test.js.map +0 -1
- package/src/cli/log.test.ts +0 -228
- package/src/cli/log.ts +0 -374
- package/src/orchestrator/agent-workflows/bug-fix.md +0 -130
- package/src/orchestrator/agent-workflows/feature-implementation.md +0 -232
- package/src/orchestrator/instructions/ai-optimization.instructions.md +0 -17
- package/src/orchestrator/prompts/quick-refinement.prompt.md +0 -110
- package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +0 -44
- package/src/orchestrator/skills/agent-hooks/SKILL.md +0 -80
- package/src/orchestrator/skills/agent-memory/KNOWLEDGE-GRAPH.md +0 -49
- package/src/orchestrator/skills/agent-memory/SKILL.md +0 -50
- package/src/orchestrator/skills/code-commenting/SKILL.md +0 -18
- package/src/orchestrator/skills/context-map/REFERENCE.md +0 -67
- package/src/orchestrator/skills/context-map/SKILL.md +0 -71
- package/src/orchestrator/skills/decomposition/SKILL.md +0 -103
- package/src/orchestrator/skills/documentation-standards/SKILL.md +0 -33
- package/src/orchestrator/skills/fast-review/REFERENCE.md +0 -28
- package/src/orchestrator/skills/memory-merger/SKILL.md +0 -77
- package/src/orchestrator/skills/observability-logging/LOG-SCHEMA.md +0 -238
- package/src/orchestrator/skills/observability-logging/SKILL.md +0 -73
- package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +0 -38
- package/src/orchestrator/skills/orchestration-protocols/SKILL.md +0 -120
- package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +0 -49
- package/src/orchestrator/skills/panel-majority-vote/panel-report.template.md +0 -38
- package/src/orchestrator/skills/performance-optimization/SKILL.md +0 -23
- package/src/orchestrator/skills/project-consistency/SKILL.md +0 -80
- package/src/orchestrator/skills/project-consistency/TEMPLATES.md +0 -35
- package/src/orchestrator/skills/react-development/SKILL.md +0 -24
- package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +0 -56
- package/src/orchestrator/skills/session-checkpoints/SKILL.md +0 -40
- package/src/orchestrator/skills/team-lead-reference/SKILL.md +0 -126
|
@@ -1,115 +1,34 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: '
|
|
2
|
+
description: 'Fix a bug in this session: reproduce it, find the root cause, fix it with a regression test, verify it, and open a pull request.'
|
|
3
3
|
agent: 'Team Lead (OpenCastle)'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
7
7
|
|
|
8
|
-
# Fix Bug
|
|
8
|
+
# Fix a Bug
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Fix the bug the user described with this command, here, in this session.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## 1. Reproduce it
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
- Look for it in `.opencastle/KNOWN-ISSUES.md` and `.opencastle/LESSONS-LEARNED.md`, and read the tracker issue if the report names one.
|
|
15
|
+
- Reproduce it before changing anything: a failing test when you can write one, otherwise the exact steps — for a UI bug, in a browser (**browser-testing**). Note the expected and the actual behaviour.
|
|
16
|
+
- Cannot reproduce it? Say what you tried and ask for what is missing. Do not fix by guessing.
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
## How Bug Fixes Differ from Other Workflows
|
|
19
|
-
|
|
20
|
-
| Aspect | Roadmap Task | Follow-Up | Bug Fix |
|
|
21
|
-
|--------|-------------|-----------|---------|
|
|
22
|
-
| Issue tracking | Required | Not required | **Required** |
|
|
23
|
-
| Urgency | Planned | Low | Can be critical |
|
|
24
|
-
| Root cause analysis | Feature design | Not needed | **Required** |
|
|
25
|
-
| Reproduction steps | N/A | N/A | **Required** |
|
|
26
|
-
| Panel review | High-stakes only | Rarely | If security-related |
|
|
27
|
-
| Documentation | Roadmap + ADRs | Minimal | Known issues if needed |
|
|
28
|
-
| Scope | Multi-step feature | Focused tweak | Focused fix |
|
|
29
|
-
|
|
30
|
-
## Workflow
|
|
31
|
-
|
|
32
|
-
### 1. Triage & Reproduce
|
|
33
|
-
|
|
34
|
-
1. **Check known issues** — Search `.opencastle/KNOWN-ISSUES.md` for an existing entry. If found, note workarounds and decide if a fix is now feasible
|
|
35
|
-
2. **Check tracker** — Search for existing bug tickets. If one exists, take it over instead of creating duplicate
|
|
36
|
-
3. **Read lessons learned** — Check `.opencastle/LESSONS-LEARNED.md` for related pitfalls
|
|
37
|
-
4. **Reproduce the bug** — Start the dev server (see **codebase-tool** skill), navigate to the affected page in Chrome, follow the repro steps, and screenshot the broken state
|
|
38
|
-
5. **Determine scope** — Which apps are affected? (see `.opencastle/project.instructions.md` for the app inventory)
|
|
39
|
-
6. **Assess severity**: Critical (crash/data loss/auth bypass) | High (broken + workaround) | Medium (minor functional) | Low (edge case/cosmetic)
|
|
40
|
-
|
|
41
|
-
### 2. Create Tracker Issue
|
|
42
|
-
|
|
43
|
-
Every bug gets tracked. Create tracker issue with:
|
|
44
|
-
|
|
45
|
-
- **Title**: `[Bug] Short description of symptom`
|
|
46
|
-
- **Label**: `bug`; **Priority**: based on severity
|
|
47
|
-
- **Description**: Symptom, reproduction steps, expected vs actual behavior, affected apps + files, screenshot
|
|
48
|
-
|
|
49
|
-
### 3. Root Cause Analysis
|
|
50
|
-
|
|
51
|
-
1. **Search the codebase** — Find the components, queries, styles, and logic involved
|
|
52
|
-
2. **Trace the data flow** — Source (CMS/database) → query → component → render
|
|
53
|
-
3. **Check recent changes** — `git log` on suspected files
|
|
54
|
-
4. **Identify the root cause** — Code bug, Data issue, Race condition, CSS/Layout, or Integration failure
|
|
55
|
-
5. **Update the tracker issue** — Add root cause findings and affected file paths
|
|
56
|
-
|
|
57
|
-
### 4. Implement the Fix
|
|
58
|
-
|
|
59
|
-
All bug fixes execute via OpenCastle's convoy engine — even single-task fixes — for observability, crash recovery. The convoy engine is experimental; say so when you hand the spec over.
|
|
60
|
-
|
|
61
|
-
1. **Write the convoy spec** — plan the fix by the rules in the `generate-convoy` prompt, with the root cause analysis, fix approach, and file paths as context. That prompt returns JSON, which the CLI converts only when `npx opencastle convoy "<task>"` runs it; here, write the spec yourself as YAML to `.opencastle/convoys/<name>.convoy.yml`, with `version: 1` and the same fields. Use plain file paths (no `*` or `?`).
|
|
62
|
-
2. **Check the spec** — run `npx opencastle convoy run .opencastle/convoys/<name>.convoy.yml --dry-run`. It runs the same checks a run does and prints what would run, without starting an agent or recording anything.
|
|
63
|
-
3. **Hand the spec to the user** — tell them the convoy engine is experimental, and to run: `npx opencastle convoy run .opencastle/convoys/<name>.convoy.yml`. It runs each task in a git worktree made from the last commit, so the work it builds on must be committed; it runs on the agent runtime `opencastle init` set up, which must be installed and signed in (`--adapter <name>` picks another: claude, codex, cursor, opencode or copilot). The work lands on a branch of its own.
|
|
64
|
-
4. **After convoy completes** — proceed to Step 5 (validation).
|
|
65
|
-
|
|
66
|
-
#### Convoy Task Prompt Must Include
|
|
67
|
-
|
|
68
|
-
- Tracker issue ID, title, root cause, fix approach, file paths, reproduction steps
|
|
69
|
-
- Boundaries: "Only modify files listed above. Fix the bug, do not refactor surrounding code."
|
|
70
|
-
- Self-improvement reminder (see **self-improvement** skill)
|
|
71
|
-
|
|
72
|
-
#### Implementation Rules
|
|
73
|
-
|
|
74
|
-
- **Fix cause not symptom** — Minimal change, no refactoring. A CSS `!important` or silent `catch {}` is not a fix
|
|
75
|
-
- **Add a test** — If no test covers this scenario, add one
|
|
76
|
-
- **Cross-app awareness** — If the fix is in `libs/`, verify it works in all consuming apps
|
|
77
|
-
|
|
78
|
-
### 5. Validate
|
|
79
|
-
|
|
80
|
-
> Load **validation-gates** skill for detailed steps on each gate.
|
|
81
|
-
|
|
82
|
-
1. **Secret Scanning** — block if API keys/tokens/passwords found in diff
|
|
83
|
-
2. **Deterministic Checks** — lint, test, build — zero errors (see **codebase-tool** skill)
|
|
84
|
-
3. **Blast Radius** — bug fixes should be ≤100 lines / ≤3 files; escalate if larger
|
|
85
|
-
4. **Dependency Audit** — when `package.json` or lockfiles change
|
|
86
|
-
5. **Fast Review** (MANDATORY) — single reviewer sub-agent
|
|
87
|
-
6. **Bug-Specific Verification** (MANDATORY) — reproduce original bug (should be gone), verify correct behavior, screenshot before/after, check both apps if shared code
|
|
88
|
-
7. **Browser Testing** (for UI bugs) — clear cache, verify fix + responsive + screenshots
|
|
89
|
-
8. **Regression Testing** — run tests for all projects consuming modified files
|
|
90
|
-
9. **Panel Review** — only if fix touches auth/authorization, RLS, security headers, or sensitive data (use **panel-majority-vote** skill)
|
|
91
|
-
|
|
92
|
-
### 6. Delivery
|
|
93
|
-
|
|
94
|
-
Follow the **Delivery Checklist** in the **git-workflow** skill — commit, push, open PR (not merged), link to tracker.
|
|
18
|
+
## 2. Find the root cause
|
|
95
19
|
|
|
96
|
-
|
|
20
|
+
- Trace the failing path from the input to the wrong output. `git log` on the files involved shows what changed recently.
|
|
21
|
+
- Name the cause in one sentence. A change that only hides the symptom — a silent `catch`, an `!important`, a retry around a race — is not a fix.
|
|
97
22
|
|
|
98
|
-
|
|
99
|
-
2. **Capture lessons** — Use the **self-improvement** skill if the root cause reveals a pattern others should know
|
|
100
|
-
3. **Note prevention** — If the bug class could be caught earlier, note it in the tracker as a follow-up
|
|
23
|
+
## 3. Fix it
|
|
101
24
|
|
|
102
|
-
|
|
25
|
+
- The smallest change that removes the cause. No refactoring around it.
|
|
26
|
+
- A regression test that fails without the fix and passes with it.
|
|
27
|
+
- Shared code: check every place that uses it.
|
|
103
28
|
|
|
104
|
-
|
|
29
|
+
## 4. Verify and deliver
|
|
105
30
|
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
- [ ] Bug verified fixed in the browser
|
|
111
|
-
- [ ] Both apps checked if shared code was modified
|
|
112
|
-
- [ ] Delivery Checklist completed (see the **git-workflow** skill) — branch pushed, PR opened (not merged), tracker linked
|
|
113
|
-
- [ ] Tracker issue moved to Done
|
|
114
|
-
- [ ] Known issues updated if applicable
|
|
115
|
-
- [ ] Lessons learned captured if any retries occurred
|
|
31
|
+
- The reproduction passes now; run the project's tests, lint and build.
|
|
32
|
+
- Have the fix reviewed (**fast-review**). One that touches auth, permissions or data access: **panel-majority-vote**.
|
|
33
|
+
- Commit on a branch and open a pull request (**git-workflow**). Report the cause, the fix, the test, and how you verified it.
|
|
34
|
+
- It fixes an entry in `.opencastle/KNOWN-ISSUES.md`: update or remove the entry. A cause others will hit again: record a lesson (**self-improvement**).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Plan work as a convoy — tasks that agents run in parallel, each in its own git worktree, merged onto one branch — with the experimental convoy engine, and hand the plan over to run.'
|
|
3
|
+
agent: 'Team Lead (OpenCastle)'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
7
|
+
|
|
8
|
+
# Plan a Convoy
|
|
9
|
+
|
|
10
|
+
Plan the work the user gave with this command as a convoy, for OpenCastle's convoy engine (experimental). OpenCastle's planner writes the plan; your part is to start it, check what it wrote, and hand it over. Do not write the spec yourself, and do not start the run.
|
|
11
|
+
|
|
12
|
+
1. **Check it is convoy work.** A convoy pays off for work that splits into several tasks with separate files — a feature across API, UI and tests, a change repeated across modules. A change in a few files is faster in this session: say so, suggest `/oc:implement-feature` or `/oc:bug-fix`, and stop.
|
|
13
|
+
2. **Check the work is committed.** Every task starts from the last commit, so changes it builds on must be committed first. Uncommitted changes: tell the user and stop.
|
|
14
|
+
3. **Plan it.** From the project root, run:
|
|
15
|
+
|
|
16
|
+
`npx opencastle convoy "<the work in one paragraph, and what done means>" --dry-run`
|
|
17
|
+
|
|
18
|
+
The planner reads the repository and changes nothing. It takes from under a minute to a few, writes the spec to `.opencastle/convoys/` — and, for larger work, a PRD to `.opencastle/prds/` — and prints the plan. It runs on the agent CLI `opencastle init` set up (claude, codex, cursor-agent, opencode or copilot); if that is not installed or signed in, it says so.
|
|
19
|
+
4. **Show the plan.** Each task, its agent, what it waits for and the files it may change; the checks that run at the end; where the spec is. Point out anything that looks wrong — a missing task, two tasks that should be one — and offer to plan again with a clearer description.
|
|
20
|
+
5. **Hand it over.** The user starts the run, in a terminal: `npx opencastle convoy run <spec>`. Tell them the engine is experimental, that the work lands on a branch of its own for them to review and merge, and that `npx opencastle convoy dashboard` shows it as it runs. A PRD they want to change: edit it, then `npx opencastle convoy plan --prd <file>`.
|
|
@@ -7,11 +7,7 @@ agent: 'Team Lead (OpenCastle)'
|
|
|
7
7
|
|
|
8
8
|
# Create Skill
|
|
9
9
|
|
|
10
|
-
Scaffold new skill for AI agent configuration. Skills encode domain-specific knowledge agents load on demand.
|
|
11
|
-
|
|
12
|
-
## Skill Request
|
|
13
|
-
|
|
14
|
-
{{skillDescription}}
|
|
10
|
+
Scaffold a new skill for the AI agent configuration, from what the user described with this command. Skills encode domain-specific knowledge agents load on demand.
|
|
15
11
|
|
|
16
12
|
---
|
|
17
13
|
|
|
@@ -1,110 +1,39 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: '
|
|
2
|
+
description: 'Implement a feature or change in this session — a roadmap item or a small follow-up: understand it, plan it to its size, build it with tests, verify it, have it reviewed, and open a pull request.'
|
|
3
3
|
agent: 'Team Lead (OpenCastle)'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
7
7
|
|
|
8
|
-
# Implement
|
|
8
|
+
# Implement a Feature
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Implement the change the user gave with this command — a feature, a roadmap item, or a follow-up tweak — here, in this session. (Work to plan into parallel tasks and run unattended is `/oc:convoy`.)
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## 1. Understand it
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
- Restate the goal and what "done" means in a sentence or two. If either is unclear and a guess would waste work, ask first; for a large or open-ended request, suggest `/oc:brainstorm`.
|
|
15
|
+
- Read what applies: the Project Context, `.opencastle/LESSONS-LEARNED.md`, `.opencastle/KNOWN-ISSUES.md`, and the code you will touch. Look for what already exists before writing anything new.
|
|
16
|
+
- A tracker issue named in the request: read it. Its acceptance criteria are the definition of done.
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
## Workflow
|
|
19
|
-
|
|
20
|
-
> **HARD GATE:** Steps 1→2 are **blocking prerequisites**. Do NOT write, edit, or delegate any code until tracker issues exist for every subtask. If you catch yourself writing code before issues are created, STOP immediately; create the issues; then resume.
|
|
21
|
-
|
|
22
|
-
### 1. Research & Context Gathering
|
|
23
|
-
|
|
24
|
-
1. **Read the roadmap** — Confirm scope, status, and acceptance criteria in `.opencastle/project/roadmap.md`, if there is one; otherwise from the task as given
|
|
25
|
-
2. **Check blockers** — Read `.opencastle/KNOWN-ISSUES.md` and `.opencastle/LESSONS-LEARNED.md` for pitfalls and workarounds
|
|
26
|
-
3. **Read architecture docs** — Check `.opencastle/project.instructions.md` and, when it exists, `.opencastle/project/decisions.md` for constraints
|
|
27
|
-
4. **Search existing code** — Find related files, components, queries, and tests; check for reusable implementations before creating anything new
|
|
28
|
-
|
|
29
|
-
### 2. Task Board Setup (BLOCKING — must complete before Step 3)
|
|
30
|
-
|
|
31
|
-
Every subtask must be tracked. **No issue = no implementation.** This step produces the issues that gate all downstream work.
|
|
32
|
-
|
|
33
|
-
1. **Check existing issues** — Search the board for any in-progress or completed work related to this task
|
|
34
|
-
2. **Decompose into issues** — Create one tracker issue per subtask using `[Area] Short description` naming
|
|
35
|
-
3. **Set metadata** — Assign labels (agent name), priority, dependencies, and file partitions
|
|
36
|
-
4. **Write descriptions** — Objective (1 sentence), files (partition paths), acceptance criteria (checklist), dependencies (links)
|
|
37
|
-
5. **Link to roadmap** — Reference the roadmap section in the issue description so context is never lost
|
|
38
|
-
6. **Verify issues exist** — List all created issue IDs. If count is 0, do NOT proceed to Step 2.5
|
|
39
|
-
|
|
40
|
-
### 2.5 Write the Convoy Spec (BLOCKING — decides how Step 3 proceeds)
|
|
41
|
-
|
|
42
|
-
All project-related work executes via OpenCastle's convoy engine — regardless of subtask count. The convoy engine is experimental; say so when you hand the spec over.
|
|
43
|
-
|
|
44
|
-
1. **Write the spec** — plan the decomposed task list by the rules in the `generate-convoy` prompt: self-contained task prompts, plain file paths (no `*` or `?`), no two tasks in the same phase sharing a path, `depends_on` for ordering. That prompt returns JSON, which the CLI converts only when `npx opencastle convoy "<task>"` runs it; here, write the spec yourself as YAML to `.opencastle/convoys/<name>.convoy.yml`, with `version: 1` and the same fields. The spec IS the implementation plan; even single-task fixes go through convoy for observability.
|
|
45
|
-
2. **Check the spec** — run `npx opencastle convoy run .opencastle/convoys/<name>.convoy.yml --dry-run`. It runs the same checks a run does — the spec's schema, glob paths, two tasks in the same phase sharing a path — and prints what would run, without starting an agent or recording anything. Fix what it reports before handing the spec over.
|
|
46
|
-
3. **Hand the spec to the user** — tell them the convoy engine is experimental, and to run: `npx opencastle convoy run .opencastle/convoys/<name>.convoy.yml`. It runs each task in a git worktree made from the last commit, so the work it builds on must be committed; it runs on the agent runtime `opencastle init` set up, which must be installed and signed in (`--adapter <name>` picks another: claude, codex, cursor, opencode or copilot). The work lands on a branch of its own.
|
|
47
|
-
4. **The convoy engine handles** isolated git worktrees, parallel execution, merge queue ordering, crash recovery, and structured logging automatically.
|
|
48
|
-
5. **After convoy completes** — proceed to Step 4 (validation) and Step 5 (delivery/PR).
|
|
49
|
-
|
|
50
|
-
### 3. Implementation Rules
|
|
51
|
-
|
|
52
|
-
> **Convoy execution:** Convoy spec IS the implementation plan — skip manual delegation; jump to Step 4 after user runs convoy.
|
|
53
|
-
|
|
54
|
-
#### Issue Traceability
|
|
55
|
-
|
|
56
|
-
- Include tracker issue ID and title in every delegation prompt
|
|
57
|
-
- Reference issue IDs (e.g., `TAS-42`) in commit messages; move issues In Progress → Done as work progresses
|
|
58
|
-
|
|
59
|
-
#### DRY Code
|
|
60
|
-
|
|
61
|
-
- Search before creating — check for existing components, hooks, utilities, queries first
|
|
62
|
-
- Extract shared logic to `libs/`; no copy-paste across apps. Refactor duplicates when discovered
|
|
63
|
-
|
|
64
|
-
#### Visual Consistency
|
|
65
|
-
|
|
66
|
-
- Use shared component library; never re-implement existing components
|
|
67
|
-
- Match spacing, typography, colors from existing pages; verify in all affected apps
|
|
68
|
-
|
|
69
|
-
### 4. Validation & Testing
|
|
70
|
-
|
|
71
|
-
> Load **validation-gates** skill for detailed steps on each gate.
|
|
72
|
-
|
|
73
|
-
Every subtask must pass ALL gates before being marked Done:
|
|
74
|
-
|
|
75
|
-
1. **Secret Scanning** — block if API keys/tokens/passwords found in diff
|
|
76
|
-
2. **Deterministic Checks** — lint, test, build — zero errors (see **codebase-tool** skill)
|
|
77
|
-
3. **Blast Radius** — ≤200 lines / ≤5 files normal; escalate if >500 lines or >10 files
|
|
78
|
-
4. **Dependency Audit** — when `package.json` changes
|
|
79
|
-
5. **Fast Review** (MANDATORY) — single reviewer sub-agent
|
|
80
|
-
6. **Browser Testing** (MANDATORY for UI) — clear cache, verify features + responsive + screenshots
|
|
81
|
-
7. **Regression Testing** — full suite for affected projects
|
|
82
|
-
8. **Panel Review** — for security, DB migrations, architecture (use **panel-majority-vote** skill)
|
|
83
|
-
9. **Final Smoke Test** — end-to-end verification of complete feature
|
|
18
|
+
## 2. Plan it to its size
|
|
84
19
|
|
|
85
|
-
|
|
20
|
+
- **One area, a few files:** do it yourself, now.
|
|
21
|
+
- **Several areas (API, UI, data, tests):** split it into tasks that each own their files, order them by dependency (shared types and schema, then the API, then the UI), and hand each to the specialist agent that fits, as the Team Lead does. Tasks that run at the same time never share a file.
|
|
86
22
|
|
|
87
|
-
|
|
23
|
+
## 3. Build it
|
|
88
24
|
|
|
89
|
-
|
|
25
|
+
- Follow the project's conventions and the skill for each domain you touch.
|
|
26
|
+
- Write or update the tests with the change, not after it.
|
|
27
|
+
- Stay in scope: no refactoring the change does not need.
|
|
90
28
|
|
|
91
|
-
|
|
92
|
-
2. **Update known issues** — Add new limitations to `.opencastle/KNOWN-ISSUES.md`
|
|
93
|
-
3. **Update architecture docs** — Add ADRs for architectural decisions to `.opencastle/project/decisions.md`, creating it with the first one
|
|
94
|
-
4. **Link tracker issues** — Reference roadmap section, partition files, and related issues in each description
|
|
95
|
-
5. **Close issues properly** — Move to Done only after independent verification passes all gates
|
|
29
|
+
## 4. Verify it
|
|
96
30
|
|
|
97
|
-
|
|
31
|
+
- Run the project's tests, lint and build (Key Commands) and fix what fails.
|
|
32
|
+
- A UI change: check it in a browser — it works at mobile and desktop widths, with no console errors (**browser-testing**).
|
|
33
|
+
- Have it reviewed by someone who did not write it (**fast-review**). Auth, payments, data migrations, or anything that deletes data: **panel-majority-vote**.
|
|
98
34
|
|
|
99
|
-
|
|
35
|
+
## 5. Deliver
|
|
100
36
|
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
- [ ] No duplicated code — shared logic extracted to libraries
|
|
105
|
-
- [ ] Visual consistency maintained across all affected pages, apps
|
|
106
|
-
- [ ] Documentation updated (roadmap, known issues, decisions)
|
|
107
|
-
- [ ] Panel review passed for any high-stakes changes
|
|
108
|
-
- [ ] Roadmap item marked complete in `.opencastle/project/roadmap.md`, if the task came from it
|
|
109
|
-
- [ ] Delivery Checklist completed (see the **git-workflow** skill) — branch pushed, PR opened (not merged), tracker linked
|
|
110
|
-
- [ ] Lessons learned captured if any retries occurred
|
|
37
|
+
- Commit on a feature branch and open a pull request; never push to `main` (**git-workflow**). Link the tracker issue when there is one.
|
|
38
|
+
- Report what changed (files), how you verified it, what is still open, and anything you noticed outside the task, with its file and line.
|
|
39
|
+
- A retry that taught you something the next agent should know: record it (**self-improvement**).
|
|
@@ -7,11 +7,7 @@ agent: 'Team Lead (OpenCastle)'
|
|
|
7
7
|
|
|
8
8
|
# Resolve PR Comments
|
|
9
9
|
|
|
10
|
-
You are the Team Lead. A pull request has review comments needing resolution. Read comments, group by file, delegate fixes efficiently.
|
|
11
|
-
|
|
12
|
-
## PR Reference
|
|
13
|
-
|
|
14
|
-
{{prReference}}
|
|
10
|
+
You are the Team Lead. A pull request has review comments needing resolution. Read comments, group by file, delegate fixes efficiently. The user named the pull request with this command — a number or a URL; with none, take the pull request of the current branch.
|
|
15
11
|
|
|
16
12
|
---
|
|
17
13
|
|
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: api-patterns
|
|
3
|
-
description: "
|
|
3
|
+
description: "Conventions for HTTP endpoints, server actions and calls to external APIs: the contract, input validation, error shapes, status codes, versioning, pagination, retries and caching. Use when adding or changing an endpoint or server action, or wiring an external API."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# API Patterns
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
The project's endpoints and where they live: `.opencastle/stack/api-config.md` when it has one, and the skill bound to the **framework** slot. Match what the existing endpoints do; where they disagree, follow the majority and say so, rather than add a third way.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Contract first
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|-------|---------|
|
|
14
|
-
| **Server Actions** (preferred) | mutations, form submissions, data writes, auth |
|
|
15
|
-
| **Route Handlers** (`route.ts`) | analytics, autocomplete, external integrations |
|
|
16
|
-
| **Proxy layer** | IP rate limiting, fingerprinting, bot detection |
|
|
12
|
+
Decide the request, the response, the status codes and the error cases before you write the handler. Writing the handler first is how inconsistent APIs happen.
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
- **Validate** every input with a schema at the top of the handler (Zod, Pydantic, the framework's validator): 400 or 422 on failure, naming the field.
|
|
15
|
+
- **One error shape**, such as `{ "error": { "code": "VALIDATION_ERROR", "message": "...", "details": [...] } }`, with no stack trace or query in it. The status says what happened: 400, 401, 403, 404, 409, 422, 429, 500.
|
|
16
|
+
- **Lists are paginated**, with a cursor when the data changes under the reader, and `limit` capped on the server.
|
|
17
|
+
- **Changes are additive.** Add fields; never remove or rename one a client may use without a new version and a deprecation period.
|
|
19
18
|
|
|
20
|
-
##
|
|
19
|
+
## Writes and side effects
|
|
21
20
|
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
- Error shape: `{ "error": { "code": "VALIDATION_ERROR", "message": "...", "details": [...] } }` — never leak stack traces. Status codes: 400, 401, 403, 404, 422, 429, 500.
|
|
25
|
-
- RESTful nouns, versioned: `/api/v1/places/:slug`. Add fields only — never remove or rename; deprecation headers before removal.
|
|
26
|
-
- Pagination: cursor-based preferred; params `limit`, `cursor`, `sort`, `order`.
|
|
27
|
-
- Retry external API calls twice with linear backoff (500 ms × attempt).
|
|
28
|
-
- Rate-limit public endpoints; set `Cache-Control` and `ETag`/`If-None-Match`.
|
|
21
|
+
- A mutation a client may retry is idempotent: an idempotency key, or an upsert on a natural key.
|
|
22
|
+
- Authorization is checked on the server for every call (**security-hardening**).
|
|
29
23
|
|
|
30
|
-
|
|
24
|
+
## External APIs
|
|
25
|
+
|
|
26
|
+
- A timeout on every call. Retry only what is safe to repeat, at most twice, with backoff.
|
|
27
|
+
- Map their errors to your error shape, and log the upstream detail on the server.
|
|
28
|
+
|
|
29
|
+
## Limits and caching
|
|
30
|
+
|
|
31
|
+
Rate-limit public endpoints. Set `Cache-Control`, and an `ETag` on responses clients poll.
|
|
32
|
+
|
|
33
|
+
Smoke-test a new endpoint against the dev server with `curl -fsS` before you call it done.
|
|
@@ -37,6 +37,6 @@ Load **security-hardening** skill for full CSP inventory and header configuratio
|
|
|
37
37
|
|
|
38
38
|
## Release & Rollback
|
|
39
39
|
|
|
40
|
-
Gate a release on lint + test + build all exiting 0 and no draft PRs, then semver-tag with a changelog in the **
|
|
40
|
+
Gate a release on lint + test + build all exiting 0 and no draft PRs, then semver-tag with a changelog in the **technical-writing** format. Verify with `curl -sI https://example.com | grep -E 'HTTP|Strict'` — homepage 200, headers correct.
|
|
41
41
|
|
|
42
42
|
A failed release gets rolled back immediately, not patched forward: the platform's instant rollback (e.g. Vercel or Netlify, promote the last good deploy) first, then a revert PR (`git revert`, on a branch) so `main` matches what runs. Re-run the `curl -sI` check before calling it resolved.
|
|
@@ -1,85 +1,48 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fast-review
|
|
3
|
-
description: "
|
|
3
|
+
description: "One independent reviewer checks a change against its acceptance criteria and answers PASS or FAIL before it is accepted. Use before accepting delegated work, before delivering a change, or when someone asks for a review."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Fast Review
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
A change is reviewed by someone who did not write it: one reviewer — a sub-agent dispatched as the **Reviewer** — who sees only what it needs.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|------|--------|
|
|
12
|
-
| Trigger | After **every** delegation — no exceptions |
|
|
13
|
-
| Reviewer | Single sub-agent; Economy tier (Standard for premium/security work) |
|
|
14
|
-
| Verdict | PASS or FAIL with structured feedback |
|
|
15
|
-
| Retry & escalation | The Handle Verdict table below, the one ladder every skill refers to |
|
|
10
|
+
## When to skip it
|
|
16
11
|
|
|
17
|
-
|
|
12
|
+
No reviewer for research with no code change, a docs-only change, or ≤10 lines across ≤2 files with the project's tests, lint and build passing — **except** auth or middleware, migrations, access policies, security headers or CSP, environment variable schemas, and CI/CD config, which are reviewed even for one line. A review never replaces tests, lint and build: run those first.
|
|
18
13
|
|
|
19
|
-
|
|
14
|
+
## Review
|
|
20
15
|
|
|
21
|
-
|
|
16
|
+
Give the reviewer the acceptance criteria, the diff, the files the change was allowed to touch, and the results of the tests, lint and build — not the conversation or the delegation prompt: it judges the result, not the intent.
|
|
22
17
|
|
|
23
|
-
|
|
18
|
+
```text
|
|
19
|
+
You review a change. Be concise and specific.
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
Task: <title>. Acceptance criteria: <list>
|
|
22
|
+
Files it may change: <paths>
|
|
23
|
+
Diff: <diff>
|
|
24
|
+
Tests / lint / build: <passed or failed>
|
|
25
|
+
Previous FAIL, on a retry: <its feedback>
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
[criteria]
|
|
31
|
-
Diff:
|
|
32
|
-
[diff]
|
|
33
|
-
Deterministic gates: lint ✅ test ✅ build ✅
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Full reviewer prompt template: [REFERENCE.md](REFERENCE.md).
|
|
37
|
-
|
|
38
|
-
### 3 — Parse Verdict
|
|
27
|
+
Check: the criteria are met · only the allowed files changed · nothing regressed ·
|
|
28
|
+
errors are surfaced, not swallowed · the types are sound · no secret or injection
|
|
29
|
+
vector · the edge cases are handled.
|
|
39
30
|
|
|
40
|
-
```
|
|
41
31
|
VERDICT: PASS | FAIL
|
|
42
32
|
ISSUES:
|
|
43
|
-
- [
|
|
44
|
-
FEEDBACK:
|
|
45
|
-
CONFIDENCE: low | medium | high
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
- **PASS** — no critical/major issues (minor noted, non-blocking).
|
|
49
|
-
- **FAIL** — any critical/major issue, or output format mismatch.
|
|
50
|
-
|
|
51
|
-
**Auto-PASS** (skip reviewer): pure research/no code changes; docs-only `.md` changes; ≤10 lines across ≤2 non-sensitive files with all deterministic gates passing.
|
|
52
|
-
|
|
53
|
-
> **Sensitive override:** Auth/middleware, DB migrations, RLS policies, security headers, CSP, env var schemas, CI/CD config always require review — even 1-line changes.
|
|
54
|
-
|
|
55
|
-
### 4 — Handle Verdict
|
|
56
|
-
|
|
57
|
-
| Outcome | Action |
|
|
58
|
-
|---------|--------|
|
|
59
|
-
| PASS | Log review; continue |
|
|
60
|
-
| FAIL 1–2 | Log; re-delegate same agent with the reviewer's feedback: "Retry N/2 — address listed issues" |
|
|
61
|
-
| FAIL 3 | Log `escalated: true`; load **panel-majority-vote** skill |
|
|
62
|
-
| Panel BLOCK ×3 | Dispute in `.opencastle/DISPUTES.md` (see **team-lead-reference** § Dispute Protocol) |
|
|
63
|
-
| Tool/runtime failure ×2 (crash, timeout, empty or off-topic output) | Entry in `.opencastle/AGENT-FAILURES.md` (see **team-lead-reference** § Dead Letter Queue Format) |
|
|
64
|
-
|
|
65
|
-
## Logging
|
|
66
|
-
|
|
67
|
-
> **⛔ HARD GATE — Log the review before proceeding.**
|
|
68
|
-
|
|
69
|
-
```sh
|
|
70
|
-
npx opencastle log --type review --tracker_issue PRJ-42 --agent Developer \
|
|
71
|
-
--verdict pass --attempt 1 --issues_critical 0 --issues_major 0 --issues_minor 2 \
|
|
72
|
-
--confidence high --escalated false --duration_sec 45
|
|
33
|
+
- [critical|major|minor] <description, file:line>
|
|
34
|
+
FEEDBACK: <what to change>
|
|
73
35
|
```
|
|
74
36
|
|
|
75
|
-
|
|
37
|
+
PASS: no critical or major issue; minor ones are noted, not blocking. FAIL: any critical or major issue, or an answer not in that shape.
|
|
76
38
|
|
|
77
|
-
|
|
39
|
+
## After a FAIL
|
|
78
40
|
|
|
79
|
-
|
|
41
|
+
| What happened | What to do |
|
|
42
|
+
|---|---|
|
|
43
|
+
| FAIL, the first or second time | Fix it, or send it back to its author with the feedback ("retry N of 2"), and review again |
|
|
44
|
+
| FAIL a third time | A panel of three (**panel-majority-vote**) |
|
|
45
|
+
| The panel blocks it, or the reviewers disagree on what is right | Stop, and tell the user what blocks it, with each side's evidence |
|
|
46
|
+
| The agent crashes, times out or returns nothing usable, twice | Stop and tell the user; do not try a third time |
|
|
80
47
|
|
|
81
|
-
|
|
82
|
-
- **Reviewer sees delegation prompt** — evaluate against acceptance criteria only.
|
|
83
|
-
- **Ignoring minor issues** — track; 3+ recurrences → ticket.
|
|
84
|
-
- **Force-accepting FAIL** — retry or escalate.
|
|
85
|
-
- **Skipping deterministic checks** — does NOT replace lint/test/build.
|
|
48
|
+
A panel costs three reviews: it is not a fast review. Never accept a FAIL without fixing it or asking.
|
|
@@ -11,4 +11,3 @@ Frontend Design REFERENCE: the principles behind each dimension of a design.
|
|
|
11
11
|
| Layout | Asymmetry, overlap, diagonal flow, grid-breaking. Consistent spacing tokens — no ad-hoc values. Holds at mobile/tablet/desktop. |
|
|
12
12
|
| Atmosphere | Gradient meshes, noise textures, geometric patterns, layered transparencies, dramatic shadows, each only where it serves the direction. |
|
|
13
13
|
|
|
14
|
-
Link lessons and PRs that change foundational tokens to the **project-consistency** skill guidance.
|
|
@@ -30,4 +30,6 @@ Design principles and the reasoning behind them: [REFERENCE.md](./REFERENCE.md).
|
|
|
30
30
|
|
|
31
31
|
Choose a pairing that fits the subject. Always ship a metric-preserving fallback chain (e.g. `'Fraunces', 'Georgia', serif`).
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
## Several agents building UI at once
|
|
34
|
+
|
|
35
|
+
Build the foundation first, in one task, and start the pages only when it is done: the design tokens (`:root` custom properties in one file), the shared layout, and the UI components. Every page task then imports those and adds none of its own — no new color, font or spacing value, no copied component, no inline `style`. Give each page task the paths to the tokens, the layout and the components, the aesthetic in its 2–3 words, and the content tone.
|
|
@@ -1,52 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: git-workflow
|
|
3
|
-
description: "Branch
|
|
3
|
+
description: "Branch names, commit messages, pushing and opening a pull request, and working with the task tracker. Use when branching, committing, pushing or opening a PR."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Git Workflow
|
|
6
|
+
# Git Workflow
|
|
7
7
|
|
|
8
|
-
**
|
|
8
|
+
**Never push to `main`.** Every change goes through a branch and a pull request, and a person merges it.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
| | |
|
|
11
|
+
|---|---|
|
|
12
|
+
| Branch | From `main`: `<type>/<slug>`, or `<type>/<issue-id>-<slug>` when there is an issue. Types: `feat`, `fix`, `refactor`, `perf`, `docs`, `chore` |
|
|
13
|
+
| Commits | Small and atomic, with an imperative subject — the issue ID first when there is one (`TAS-42: Fix token refresh`) |
|
|
14
|
+
| History | Never `--force` or `--amend` on a shared branch; `--force-with-lease` on your own only |
|
|
15
|
+
| Secrets | None in commits, pull request bodies or output; a leaked one is rotated at once |
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
|------|--------|
|
|
14
|
-
| Branch from `main` | `git checkout -b <type>/<ticket-id>-<slug>` |
|
|
15
|
-
| Types | `fix`, `feat`, `chore`, `refactor`, `perf`, `docs` |
|
|
16
|
-
| Commit messages | Must reference issue ID — `TAS-42: Fix token refresh` |
|
|
17
|
-
| No force-push | Never `--force` or `--amend` on shared branches; `--force-with-lease` on personal only |
|
|
18
|
-
| No secrets | No tokens/keys in commits, PR descriptions, or output (rotate immediately if leaked) |
|
|
17
|
+
## Deliver
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
1. Commit, then push: `git push -u origin <branch>`.
|
|
20
|
+
2. Open the pull request with its body in a file — an inline `--body` breaks on backticks and quotes in zsh:
|
|
21
21
|
|
|
22
|
-
1. Branch `<type>/<ticket-id>-<slug>` from `main`
|
|
23
|
-
2. Atomic commits referencing issue ID
|
|
24
|
-
3. Push branch to origin
|
|
25
|
-
4. Open PR (do NOT merge) — write body to temp file first; use `--body-file`:
|
|
26
22
|
```sh
|
|
27
|
-
# Write PR body to a temp file to avoid shell escaping issues
|
|
28
23
|
cat > /tmp/pr-body.md << 'EOF'
|
|
29
|
-
Resolves TAS-
|
|
30
|
-
|
|
24
|
+
Resolves TAS-42
|
|
25
|
+
|
|
31
26
|
## Changes
|
|
32
27
|
- ...
|
|
33
28
|
EOF
|
|
34
|
-
GH_PAGER=cat gh pr create --base main --title "TAS-
|
|
29
|
+
GH_PAGER=cat gh pr create --base main --title "TAS-42: Short description" --body-file /tmp/pr-body.md
|
|
35
30
|
```
|
|
36
|
-
**Never use inline `--body` with markdown/backticks/special chars** — breaks in zsh heredocs, quoted strings.
|
|
37
|
-
5. Update issue with PR URL
|
|
38
|
-
|
|
39
|
-
## Discovered Issues Policy
|
|
40
|
-
|
|
41
|
-
**No issue gets ignored.** An untracked bug found during work is a quality-gate
|
|
42
|
-
failure. Search `.opencastle/KNOWN-ISSUES.md` and the tracker first; if it is not
|
|
43
|
-
tracked, either add it to KNOWN-ISSUES.md with all six fields (Issue ID, Status,
|
|
44
|
-
Severity, Evidence, Root Cause, Solution Options) when it is an upstream
|
|
45
|
-
limitation, or open a `bug` ticket with symptoms, repro steps, and affected files
|
|
46
|
-
when it is fixable.
|
|
47
31
|
|
|
48
|
-
|
|
32
|
+
3. Do not merge it. Link it from the tracker issue when there is one.
|
|
49
33
|
|
|
50
|
-
|
|
34
|
+
## The tracker
|
|
51
35
|
|
|
52
|
-
|
|
36
|
+
When the project uses one, its conventions are in `.opencastle/project/<tracker>-config.md` and the skill bound to the **task-management** slot. Without its tools in this session, list the issues you would have created — title and acceptance criteria — in your answer, and carry on.
|