@codebehind/agent-workflow 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -0
- package/bin/agent-workflow.mjs +96 -0
- package/package.json +28 -0
- package/templates/.agent-workflow/README.md +160 -0
- package/templates/.agent-workflow/acceptance-verification.md +192 -0
- package/templates/.agent-workflow/artifacts/.gitkeep +0 -0
- package/templates/.agent-workflow/docs/README.md +45 -0
- package/templates/.agent-workflow/docs/_template.md +35 -0
- package/templates/.agent-workflow/notion-spec-mapping.md +54 -0
- package/templates/.agent-workflow/plans/.gitkeep +0 -0
- package/templates/.agent-workflow/plans/README.md +19 -0
- package/templates/.agent-workflow/playwright-acceptance.md +169 -0
- package/templates/.agent-workflow/specs/README.md +46 -0
- package/templates/.agent-workflow/specs/_template.md +60 -0
- package/templates/.agent-workflow/specs/assets/.gitkeep +0 -0
- package/templates/.agent-workflow/specs/assets/README.md +15 -0
- package/templates/.claude/hooks/.gitkeep +0 -0
- package/templates/.claude/rules/agentic-workflow.md +138 -0
- package/templates/.claude/settings.json +76 -0
- package/templates/.claude/skills/acceptance-proof/SKILL.md +68 -0
- package/templates/.claude/skills/create-mr-summary/SKILL.md +29 -0
- package/templates/.claude/skills/implement-spec/SKILL.md +97 -0
- package/templates/.claude/skills/prepare-spec/SKILL.md +77 -0
- package/templates/AGENTS.md +43 -0
- package/templates/agents-workflow-dev-process.md +212 -0
- package/templates/agents-workflow-env-setup.md +136 -0
- package/templates/scripts/agent/LOCAL_GITLAB_WORKFLOW.md +83 -0
- package/templates/scripts/agent/cleanup-worktree.sh +23 -0
- package/templates/scripts/agent/ensure-codebase.sh +43 -0
- package/templates/scripts/agent/git-detect-default-branch.sh +32 -0
- package/templates/scripts/agent/git-find-open-mr.sh +6 -0
- package/templates/scripts/agent/git-open-mr.sh +24 -0
- package/templates/scripts/agent/git-prepare-worktree.sh +54 -0
- package/templates/scripts/agent/git-push-branch.sh +12 -0
- package/templates/scripts/agent/git-update-mr.sh +28 -0
- package/templates/scripts/agent/implement-task.sh +19 -0
- package/templates/scripts/agent/mr-template.sh +33 -0
- package/templates/scripts/agent/post-run-summary.sh +24 -0
- package/templates/scripts/agent/prepare-spec.sh +19 -0
- package/templates/scripts/agent/start-worktree.sh +36 -0
- package/templates/scripts/agent/verify-acceptance.sh +12 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Notion → spec template mapping
|
|
2
|
+
|
|
3
|
+
This document defines how agents map **Notion** content into [`.agent-workflow/specs/_template.md`](specs/_template.md) when preparing a spec from a Notion URL (see Phase A in [`.agent-workflow/README.md`](README.md)).
|
|
4
|
+
|
|
5
|
+
**Status:** Scaffold — extend the tables below with your team’s explicit mappings and examples. Agents should use **Notion MCP** (`notion-fetch`) to load the page, then apply the rules here.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Defaults (frontmatter)
|
|
10
|
+
|
|
11
|
+
When creating a spec from Notion, use these unless the user specifies otherwise:
|
|
12
|
+
|
|
13
|
+
| Field | Default | Notes |
|
|
14
|
+
|--------|---------|--------|
|
|
15
|
+
| `status` | `draft` | User promotes to `open` when ready for implementation (Phase B). |
|
|
16
|
+
| `verification` | `true` | Override if the user asks. |
|
|
17
|
+
| `notion_source` | *(optional)* | Full Notion page URL for traceability. |
|
|
18
|
+
| `scope` | *(optional)* | e.g. `frontend` / `backend` when one Notion page splits across repos (see below). |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Section mapping (fill in)
|
|
23
|
+
|
|
24
|
+
Map Notion blocks or headings to template sections. Mark each row **explicit** (strict) or **heuristic** (agent infers).
|
|
25
|
+
|
|
26
|
+
| Notion (source) | Template section | Mapping type |
|
|
27
|
+
|-----------------|------------------|--------------|
|
|
28
|
+
| *(add rows)* | Title / Summary / Requirements / … | explicit \| heuristic |
|
|
29
|
+
|
|
30
|
+
**Minimum content** agents should aim to fill (from Notion or clarification): **Title**, **Summary**, and **Acceptance Criteria** (or equivalent). Remaining sections: infer, mark as provisional, or leave with placeholders for the user.
|
|
31
|
+
|
|
32
|
+
**Unmapped content:** Do not drop silently — place under **References** or **Notes (from Notion)** in the spec body.
|
|
33
|
+
|
|
34
|
+
**Non-feature / incident / freeform pages:** Map to the nearest template sections; use **Goals** / **Non-Goals** with clear **(proposed)** labeling where needed.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Multi-repo: one Notion page, several repositories
|
|
39
|
+
|
|
40
|
+
One **feature** in Notion may produce **separate specs** in **different repos** (e.g. frontend app vs API/backend).
|
|
41
|
+
|
|
42
|
+
- Each **repository** has its own `.agent-workflow/specs/*.md` and its own agent run.
|
|
43
|
+
- Use the **same** `notion_source` URL in each spec when they derive from the same page.
|
|
44
|
+
- **Scope** each spec to this codebase: include only requirements, APIs, or UI that belong in **this** repo; reference sibling work in **References** or **API / Data Contracts** as needed.
|
|
45
|
+
- Two agents (two Slack threads / two branches) may run in parallel — one per repo — from the same Notion link with different scope instructions in chat.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Agent checklist (Notion → spec file)
|
|
50
|
+
|
|
51
|
+
1. `notion-fetch` the URL (or ID).
|
|
52
|
+
2. Apply this mapping + [`.agent-workflow/README.md`](README.md) Phase A (plan-style: outline, questions, user agreement).
|
|
53
|
+
3. Write `.agent-workflow/specs/{name}.md` from `_template.md`, typically `status: draft`.
|
|
54
|
+
4. Tell the user the path and that they should review and set `status: open` when ready for development.
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Plans
|
|
2
|
+
|
|
3
|
+
This folder contains implementation plans created by the Agent during Plan mode.
|
|
4
|
+
|
|
5
|
+
## Source of Truth
|
|
6
|
+
|
|
7
|
+
Read `../README.md` first for the full workflow used by both Users and Agents.
|
|
8
|
+
|
|
9
|
+
## Naming Convention
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
{feature-spec-filename}_plan.md
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Example: spec `20260220_schedule_page.md` -> plan `20260220_schedule_page_plan.md`.
|
|
16
|
+
|
|
17
|
+
## Format
|
|
18
|
+
|
|
19
|
+
Plans are markdown and can be free-form, but should be clear and actionable.
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# Playwright Acceptance Instructions
|
|
2
|
+
|
|
3
|
+
Use this guide when a spec has `acceptance_proof: true` and at least one acceptance criterion is UI / visual.
|
|
4
|
+
|
|
5
|
+
## Goal
|
|
6
|
+
|
|
7
|
+
Produce **runtime proof**, not just code references.
|
|
8
|
+
|
|
9
|
+
For UI tasks, the minimum proof set is:
|
|
10
|
+
- one automated browser run against the implemented flow
|
|
11
|
+
- one screenshot for each important state or tab mentioned by the spec
|
|
12
|
+
- a short acceptance summary that links each criterion to evidence
|
|
13
|
+
|
|
14
|
+
## Required evidence standard
|
|
15
|
+
|
|
16
|
+
The acceptance report must distinguish between these states:
|
|
17
|
+
|
|
18
|
+
- **Implemented** — code exists
|
|
19
|
+
- **Verified in browser** — Playwright opened the page and checked the UI
|
|
20
|
+
- **Human QA pending** — still recommended for final review
|
|
21
|
+
|
|
22
|
+
Do not collapse these into one status.
|
|
23
|
+
|
|
24
|
+
## Recommended file layout
|
|
25
|
+
|
|
26
|
+
Store proof under:
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
.agent-workflow/artifacts/acceptance-<spec-slug>-<YYYYMMDD>/
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Recommended sub-files:
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
playwright/
|
|
36
|
+
test-results.json
|
|
37
|
+
smoke.spec.ts (optional copy only if generated specifically for the task)
|
|
38
|
+
01-<criterion-slug>.png
|
|
39
|
+
02-<criterion-slug>.png
|
|
40
|
+
acceptance-summary.md
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Suggested verification flow
|
|
44
|
+
|
|
45
|
+
### 1. Start the app
|
|
46
|
+
|
|
47
|
+
Use the repository's normal local startup flow.
|
|
48
|
+
|
|
49
|
+
Examples:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm run dev
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
If frontend and backend run separately, ensure both are reachable before continuing.
|
|
56
|
+
|
|
57
|
+
### 2. Use deterministic test data
|
|
58
|
+
|
|
59
|
+
When a spec depends on one concrete record, prefer a stable URL or fixture.
|
|
60
|
+
|
|
61
|
+
Examples:
|
|
62
|
+
- a known `gameId`
|
|
63
|
+
- a seeded local DB row
|
|
64
|
+
- a fixture JSON file already captured in `.agent-workflow/specs/assets/<spec-slug>/`
|
|
65
|
+
|
|
66
|
+
If stable data is not available, document the chosen runtime example inside `acceptance-summary.md`.
|
|
67
|
+
|
|
68
|
+
### 3. Run Playwright checks
|
|
69
|
+
|
|
70
|
+
At minimum, each UI-oriented acceptance run should:
|
|
71
|
+
|
|
72
|
+
1. open the page or flow
|
|
73
|
+
2. wait for the page heading or primary container
|
|
74
|
+
3. assert the key labels/tabs/sections from the spec
|
|
75
|
+
4. click through the primary interactions
|
|
76
|
+
5. save screenshots after each meaningful state
|
|
77
|
+
|
|
78
|
+
### 4. Save browser evidence
|
|
79
|
+
|
|
80
|
+
Recommended screenshots for UI tasks:
|
|
81
|
+
|
|
82
|
+
- top section / hero / summary state
|
|
83
|
+
- each important tab
|
|
84
|
+
- result state after interaction
|
|
85
|
+
- any empty / fallback state explicitly required by the spec
|
|
86
|
+
|
|
87
|
+
If a criterion spans multiple states, capture multiple screenshots.
|
|
88
|
+
|
|
89
|
+
### 5. Write the acceptance summary
|
|
90
|
+
|
|
91
|
+
For every acceptance criterion, record:
|
|
92
|
+
|
|
93
|
+
- criterion text
|
|
94
|
+
- classification (`ui`, `api`, `config`)
|
|
95
|
+
- code status (`implemented` / `not implemented`)
|
|
96
|
+
- automated verification (`passed` / `failed` / `not run`)
|
|
97
|
+
- human verification (`pending` unless already performed)
|
|
98
|
+
- evidence path(s)
|
|
99
|
+
- notes / blockers
|
|
100
|
+
|
|
101
|
+
## Screenshot naming
|
|
102
|
+
|
|
103
|
+
Use ordered names tied to criterion order.
|
|
104
|
+
|
|
105
|
+
Examples:
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
01-route-navigation.png
|
|
109
|
+
02-top-section.png
|
|
110
|
+
03-team-stats-tab.png
|
|
111
|
+
04-home-team-tab.png
|
|
112
|
+
05-away-team-tab.png
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
If one criterion has multiple screenshots, suffix them:
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
03-team-stats-tab-a.png
|
|
119
|
+
03-team-stats-tab-b.png
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## What good proof looks like
|
|
123
|
+
|
|
124
|
+
Good:
|
|
125
|
+
- “Playwright navigated from `/games` to `/games/123`, URL changed, page heading rendered, screenshot saved at `01-route-navigation.png`.”
|
|
126
|
+
|
|
127
|
+
Bad:
|
|
128
|
+
- “`onRowClick` was added in `Games.tsx`.”
|
|
129
|
+
|
|
130
|
+
The second statement is implementation evidence, not acceptance evidence.
|
|
131
|
+
|
|
132
|
+
## Suggested Playwright assertions
|
|
133
|
+
|
|
134
|
+
Prefer assertions against user-visible UI:
|
|
135
|
+
|
|
136
|
+
- heading text
|
|
137
|
+
- table/tab labels
|
|
138
|
+
- score line
|
|
139
|
+
- player names
|
|
140
|
+
- stat labels
|
|
141
|
+
- empty-state text
|
|
142
|
+
- navigation URL
|
|
143
|
+
|
|
144
|
+
Avoid relying only on internal selectors when visible text is available.
|
|
145
|
+
|
|
146
|
+
## When screenshots are enough
|
|
147
|
+
|
|
148
|
+
For simple static UI changes, screenshots plus a few assertions are enough.
|
|
149
|
+
|
|
150
|
+
## When video is worth adding
|
|
151
|
+
|
|
152
|
+
Use video or a trace when:
|
|
153
|
+
- multiple interactions are required
|
|
154
|
+
- animation/state transitions matter
|
|
155
|
+
- the bug is intermittent
|
|
156
|
+
- reviewer context would benefit from replay
|
|
157
|
+
|
|
158
|
+
## Failure handling
|
|
159
|
+
|
|
160
|
+
If automated browser verification fails:
|
|
161
|
+
|
|
162
|
+
1. save the failure screenshot
|
|
163
|
+
2. record the actual error in `acceptance-summary.md`
|
|
164
|
+
3. do not mark the criterion as passed
|
|
165
|
+
4. do not open the MR until resolved or explicitly marked as blocked
|
|
166
|
+
|
|
167
|
+
## Reviewer-friendly rule
|
|
168
|
+
|
|
169
|
+
The reviewer should be able to glance at the artifact folder and understand whether the feature likely works **without pulling the branch first**.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Specs
|
|
2
|
+
|
|
3
|
+
This folder contains feature specifications that drive implementation. Each `.md` file (except `_template.md`) describes one feature to be built.
|
|
4
|
+
|
|
5
|
+
## Source of Truth
|
|
6
|
+
|
|
7
|
+
Read `../README.md` first for the full workflow used by both Users and Agents.
|
|
8
|
+
|
|
9
|
+
## Status Values
|
|
10
|
+
|
|
11
|
+
| Status | Meaning |
|
|
12
|
+
|--------|---------|
|
|
13
|
+
| `open` | Ready for planning and implementation |
|
|
14
|
+
| `done` | Already implemented and documented |
|
|
15
|
+
|
|
16
|
+
## Verification Values
|
|
17
|
+
|
|
18
|
+
| Verification | Meaning |
|
|
19
|
+
|-------------|---------|
|
|
20
|
+
| `true` | Use standard workflow checkpoints (plan approval and implementation approval). |
|
|
21
|
+
| `false` | Skip verification checkpoints; agent creates plan, implements immediately, writes/updates docs, and marks spec done without waiting for approvals. |
|
|
22
|
+
|
|
23
|
+
Example frontmatter:
|
|
24
|
+
|
|
25
|
+
```yaml
|
|
26
|
+
---
|
|
27
|
+
status: open
|
|
28
|
+
verification: true
|
|
29
|
+
---
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Backward compatibility: if `verification` is missing, treat it as `true`.
|
|
33
|
+
|
|
34
|
+
## File Conventions
|
|
35
|
+
|
|
36
|
+
- `_template.md` is a template, not a real feature.
|
|
37
|
+
- All other `.md` files are specs (including historical specs).
|
|
38
|
+
- Keep supporting assets in `./docs/` when useful for implementation context.
|
|
39
|
+
|
|
40
|
+
## For AI Agents
|
|
41
|
+
|
|
42
|
+
1. Read `../README.md` first.
|
|
43
|
+
2. Find specs with `status: open`.
|
|
44
|
+
3. Skip specs with `status: done`.
|
|
45
|
+
4. Read `verification` in spec frontmatter (`true`/`false`, default to `true` when missing).
|
|
46
|
+
5. Create plan files in `../plans/` and follow the full workflow.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
# status: draft (authoring) | open (ready for implementation) | done (finished)
|
|
3
|
+
status: open
|
|
4
|
+
# verification: true = plan/impl approval checkpoints; false = autonomous after plan
|
|
5
|
+
verification: true
|
|
6
|
+
# acceptance_proof: true = agent captures video/screenshots/curl output and posts to Slack before MR
|
|
7
|
+
# false = skip capture (use only for pure config/infra specs with no visual or API surface)
|
|
8
|
+
acceptance_proof: true
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
### Title
|
|
12
|
+
|
|
13
|
+
Brief, user-impacting title.
|
|
14
|
+
|
|
15
|
+
### Epic Context (Optional)
|
|
16
|
+
|
|
17
|
+
*Include this section only if this feature is part of an epic*
|
|
18
|
+
|
|
19
|
+
- Epic Name: [Name of the epic]
|
|
20
|
+
- Epic README: [Link to epic README]
|
|
21
|
+
- Feature Position: [Position in epic, e.g., "Feature 1 of 3"]
|
|
22
|
+
|
|
23
|
+
### Summary
|
|
24
|
+
|
|
25
|
+
One paragraph describing the problem and desired outcome.
|
|
26
|
+
|
|
27
|
+
### Goals
|
|
28
|
+
|
|
29
|
+
- What success looks like.
|
|
30
|
+
|
|
31
|
+
### Non-Goals
|
|
32
|
+
|
|
33
|
+
- Out-of-scope items.
|
|
34
|
+
|
|
35
|
+
### Requirements
|
|
36
|
+
|
|
37
|
+
- Functional requirements
|
|
38
|
+
- Data and state changes
|
|
39
|
+
- Permissions
|
|
40
|
+
|
|
41
|
+
### UX / UI
|
|
42
|
+
|
|
43
|
+
- Links to designs, screenshots, or sketches.
|
|
44
|
+
|
|
45
|
+
### API / Data Contracts
|
|
46
|
+
|
|
47
|
+
- Endpoints, payloads, GraphQL queries, or types.
|
|
48
|
+
|
|
49
|
+
### Acceptance Criteria
|
|
50
|
+
|
|
51
|
+
- [ ] Testable checklist items
|
|
52
|
+
|
|
53
|
+
### Rollout / Risks
|
|
54
|
+
|
|
55
|
+
- Migration, flags, monitoring, fallback.
|
|
56
|
+
|
|
57
|
+
### References
|
|
58
|
+
|
|
59
|
+
- Links to related specs, tickets, docs.
|
|
60
|
+
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Spec assets
|
|
2
|
+
|
|
3
|
+
Store spec-specific supporting files here.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
- `.agent-workflow/specs/assets/<spec-slug>/...`
|
|
7
|
+
|
|
8
|
+
## Examples
|
|
9
|
+
- API response examples
|
|
10
|
+
- screenshots from Notion or design tools
|
|
11
|
+
- CSV samples
|
|
12
|
+
- referenced markdown notes
|
|
13
|
+
- diagrams
|
|
14
|
+
|
|
15
|
+
Specs should reference these assets instead of keeping large payloads inline.
|
|
File without changes
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Claude operating rules for agentic workflow for this repository
|
|
2
|
+
|
|
3
|
+
You are operating inside a spec-driven delivery workflow with GitLab merge-request handoff.
|
|
4
|
+
Follow these rules in every session.
|
|
5
|
+
|
|
6
|
+
## Read order at session start
|
|
7
|
+
1. Read `.agent-workflow/README.md`
|
|
8
|
+
2. Read `.agent-workflow/codebase.md` if it exists
|
|
9
|
+
3. Read the target spec and any linked feature doc before planning or implementation
|
|
10
|
+
4. Read relevant existing code (inside the appropriate submodule) before proposing structural changes
|
|
11
|
+
|
|
12
|
+
## Source of truth
|
|
13
|
+
- The spec is the source of truth for scope.
|
|
14
|
+
- Acceptance Criteria define done.
|
|
15
|
+
- Existing codebase conventions beat generic preferences.
|
|
16
|
+
- Keep changes minimal unless the spec explicitly asks for broader refactoring.
|
|
17
|
+
|
|
18
|
+
## Workflow states
|
|
19
|
+
- `draft` = not ready for implementation
|
|
20
|
+
- `open` = ready for planning and implementation
|
|
21
|
+
- `done` = implementation, verification, docs, and handoff are complete
|
|
22
|
+
|
|
23
|
+
Never implement a spec while it is `draft`.
|
|
24
|
+
|
|
25
|
+
## Branch and worktree model
|
|
26
|
+
- Spec preparation sessions use branch pattern `agent/spec/<slug>`.
|
|
27
|
+
- Planning + implementation sessions use branch pattern `agent/task/<slug>`.
|
|
28
|
+
- Worktrees live under `~/agent-runs/<repo>/worktrees/`.
|
|
29
|
+
- Work only inside the current assigned worktree.
|
|
30
|
+
- Never mix spec work and task work on the same branch.
|
|
31
|
+
- Always branch from the repository default branch detected from GitLab remote state.
|
|
32
|
+
|
|
33
|
+
## Required workflow
|
|
34
|
+
### A. Prepare spec
|
|
35
|
+
When asked to prepare a spec:
|
|
36
|
+
- Create or update a file under `.agent-workflow/specs/`
|
|
37
|
+
- Default status to `draft`
|
|
38
|
+
- Default `verification: true` unless user explicitly says otherwise
|
|
39
|
+
- Default `acceptance_proof: true` unless user explicitly says otherwise
|
|
40
|
+
- Collect supporting assets into `.agent-workflow/specs/assets/<spec-slug>/`
|
|
41
|
+
- Prefer assets over embedding large JSON, CSV, or screenshots inline
|
|
42
|
+
- When spec is ready, commit the changes, push the current branch `agent/spec/<slug>`, and open or update a GitLab MR (always, unless the user explicitly says to skip GitLab flow)
|
|
43
|
+
|
|
44
|
+
### B. Plan implementation
|
|
45
|
+
When asked to implement a spec:
|
|
46
|
+
- Confirm spec status is `open`
|
|
47
|
+
- Create or update a plan in `.agent-workflow/plans/`
|
|
48
|
+
- Validate impacted tables, files, APIs, and migrations against the actual codebase and schema before finalizing the plan
|
|
49
|
+
- If `verification: true`, stop after drafting the plan and wait for approval
|
|
50
|
+
- Commit and push the plan on the current `agent/task/<slug>` branch before waiting for approval (always, unless the user explicitly says to skip GitLab flow)
|
|
51
|
+
|
|
52
|
+
### C. Implement
|
|
53
|
+
After plan approval:
|
|
54
|
+
- Work only on the approved scope
|
|
55
|
+
- Keep changes aligned with existing project patterns
|
|
56
|
+
- Add migrations or schema updates whenever persistent data structures change
|
|
57
|
+
- Update the plan if implementation changes materially
|
|
58
|
+
- Push the task branch as meaningful checkpoints are reached when requested
|
|
59
|
+
|
|
60
|
+
### D. Verify and handoff
|
|
61
|
+
Before marking work complete:
|
|
62
|
+
- Execute or describe verification steps per acceptance criterion
|
|
63
|
+
- Save evidence in `.agent-workflow/artifacts/<spec-slug>/`
|
|
64
|
+
- Update or create the most relevant feature doc in `.agent-workflow/docs/`
|
|
65
|
+
- Produce a concise MR summary
|
|
66
|
+
- Push the branch and open or update the GitLab MR
|
|
67
|
+
- Only then set the spec status to `done`
|
|
68
|
+
|
|
69
|
+
## GitLab workflow rules
|
|
70
|
+
- Prefer repository scripts under `scripts/agent/` for worktree, push, and MR actions.
|
|
71
|
+
- Use `scripts/agent/git-detect-default-branch.sh` to resolve the target base branch.
|
|
72
|
+
- Use `scripts/agent/git-push-branch.sh` before opening or updating an MR.
|
|
73
|
+
- Use `scripts/agent/git-open-mr.sh` to create a new MR.
|
|
74
|
+
- Use `scripts/agent/git-update-mr.sh` to refresh an existing MR description when continuing work on the same branch.
|
|
75
|
+
- Never force-push.
|
|
76
|
+
- Never open an MR against the wrong target branch.
|
|
77
|
+
|
|
78
|
+
## Assets convention
|
|
79
|
+
Store spec assets here:
|
|
80
|
+
- `.agent-workflow/specs/assets/<spec-slug>/`
|
|
81
|
+
|
|
82
|
+
Types of assets:
|
|
83
|
+
- API examples (`.json`)
|
|
84
|
+
- screenshots (`.png`, `.jpg`, `.webp`)
|
|
85
|
+
- CSV samples
|
|
86
|
+
- referenced markdown notes
|
|
87
|
+
- diagrams
|
|
88
|
+
|
|
89
|
+
If a Notion page links to another page, database item, table, image, or attachment relevant to implementation, retrieve it and store a local asset copy when practical.
|
|
90
|
+
|
|
91
|
+
## Inconsistency handling
|
|
92
|
+
If you discover a mismatch between:
|
|
93
|
+
- acceptance criteria and real data,
|
|
94
|
+
- spec text and existing schema,
|
|
95
|
+
- plan assumptions and code reality,
|
|
96
|
+
|
|
97
|
+
then do not silently continue.
|
|
98
|
+
|
|
99
|
+
You must:
|
|
100
|
+
1. stop,
|
|
101
|
+
2. explain the inconsistency clearly,
|
|
102
|
+
3. propose the smallest correction,
|
|
103
|
+
4. wait for approval if the inconsistency changes expected behavior, counts, schema, or outputs.
|
|
104
|
+
|
|
105
|
+
## Guardrails
|
|
106
|
+
- Do not expand scope beyond the spec.
|
|
107
|
+
- Do not move files to new locations unless required.
|
|
108
|
+
- Do not create duplicate docs if an existing feature doc should be updated.
|
|
109
|
+
- Do not invent migrations, fields, or endpoints without checking the actual code.
|
|
110
|
+
- Do not claim verification that was not actually performed.
|
|
111
|
+
- For UI tasks, prefer Playwright-first browser verification and screenshots over code-only assertions.
|
|
112
|
+
- Do not commit unrelated files.
|
|
113
|
+
- Ignore `.DS_Store` and `__MACOSX` artifacts if present in local archives.
|
|
114
|
+
|
|
115
|
+
## Output expectations
|
|
116
|
+
Every meaningful handoff should mention:
|
|
117
|
+
- spec path
|
|
118
|
+
- plan path
|
|
119
|
+
- assets path if used
|
|
120
|
+
- doc path updated
|
|
121
|
+
- verification status
|
|
122
|
+
- current branch
|
|
123
|
+
- MR status or URL
|
|
124
|
+
- blockers or assumptions
|
|
125
|
+
|
|
126
|
+
## Preferred structure and naming
|
|
127
|
+
- Specs: `.agent-workflow/specs/<date>_<slug>.md`
|
|
128
|
+
- Plans: `.agent-workflow/plans/<spec-filename-without-ext>_plan.md`
|
|
129
|
+
- Assets: `.agent-workflow/specs/assets/<spec-filename-without-ext>/`
|
|
130
|
+
- Artifacts: `.agent-workflow/artifacts/<spec-filename-without-ext>/`
|
|
131
|
+
|
|
132
|
+
## Practical prompting behavior
|
|
133
|
+
When the user invokes `/prepare-spec`, `/implement-spec`, `/acceptance-proof`, or `/create-mr-summary` (or says "Use X skill"), follow that skill strictly.
|
|
134
|
+
|
|
135
|
+
For acceptance proof on UI tasks, also read `.agent-workflow/playwright-acceptance.md`.
|
|
136
|
+
|
|
137
|
+
## Meta-repo rule
|
|
138
|
+
This is the project's meta repository. Specs, plans, docs, and artifacts live here. Application code changes go inside submodule directories (`backend/`, `web/`, `mobile/`). Each affected submodule gets its own MR in its own GitLab project. Never commit application code directly to the meta repo.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
3
|
+
"permissions": {
|
|
4
|
+
"allow": [
|
|
5
|
+
"Edit",
|
|
6
|
+
"Write",
|
|
7
|
+
"Read",
|
|
8
|
+
"Glob",
|
|
9
|
+
"Grep",
|
|
10
|
+
"NotebookEdit",
|
|
11
|
+
"WebFetch",
|
|
12
|
+
"WebSearch",
|
|
13
|
+
"Bash(find:*)",
|
|
14
|
+
"Bash(ls:*)",
|
|
15
|
+
"Bash(pwd:*)",
|
|
16
|
+
"Bash(cat:*)",
|
|
17
|
+
"Bash(sed:*)",
|
|
18
|
+
"Bash(grep:*)",
|
|
19
|
+
"Bash(rg:*)",
|
|
20
|
+
"Bash(head:*)",
|
|
21
|
+
"Bash(tail:*)",
|
|
22
|
+
"Bash(sort:*)",
|
|
23
|
+
"Bash(uniq:*)",
|
|
24
|
+
"Bash(mkdir:*)",
|
|
25
|
+
"Bash(cp:*)",
|
|
26
|
+
"Bash(mv:*)",
|
|
27
|
+
"Bash(touch:*)",
|
|
28
|
+
"Bash(chmod:*)",
|
|
29
|
+
"Bash(date:*)",
|
|
30
|
+
"Bash(jq:*)",
|
|
31
|
+
"Bash(npm run *)",
|
|
32
|
+
"Bash(npm test *)",
|
|
33
|
+
"Bash(npm install *)",
|
|
34
|
+
"Bash(git status:*)",
|
|
35
|
+
"Bash(git diff:*)",
|
|
36
|
+
"Bash(git add:*)",
|
|
37
|
+
"Bash(git restore:*)",
|
|
38
|
+
"Bash(git checkout:*)",
|
|
39
|
+
"Bash(git switch:*)",
|
|
40
|
+
"Bash(git branch:*)",
|
|
41
|
+
"Bash(git fetch:*)",
|
|
42
|
+
"Bash(git pull:*)",
|
|
43
|
+
"Bash(git worktree:*)",
|
|
44
|
+
"Bash(git commit:*)",
|
|
45
|
+
"Bash(git push:*)",
|
|
46
|
+
"Bash(git remote:*)",
|
|
47
|
+
"Bash(git rev-parse:*)",
|
|
48
|
+
"Bash(glab:*)",
|
|
49
|
+
"Bash(curl:*)",
|
|
50
|
+
"Bash(python3:*)",
|
|
51
|
+
"Bash(claude mcp:*)",
|
|
52
|
+
"Bash(node:*)",
|
|
53
|
+
"Bash(timeout:*)",
|
|
54
|
+
"Bash(pkill:*)",
|
|
55
|
+
"Bash(sleep:*)",
|
|
56
|
+
"Bash(echo:*)"
|
|
57
|
+
],
|
|
58
|
+
"deny": [
|
|
59
|
+
"Bash(git push --force:*)",
|
|
60
|
+
"Bash(git push -f:*)",
|
|
61
|
+
"Bash(git reset --hard:*)",
|
|
62
|
+
"Bash(git reset --hard*)",
|
|
63
|
+
"Bash(rm -rf /:*)",
|
|
64
|
+
"Bash(sudo:*)",
|
|
65
|
+
"Bash(curl *prod*:*)",
|
|
66
|
+
"Bash(curl *production*:*)",
|
|
67
|
+
|
|
68
|
+
"Read(./**/secrets/**)",
|
|
69
|
+
"Bash(rm -rf /)",
|
|
70
|
+
"Bash(sudo *)"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"env": {
|
|
74
|
+
"AGENT_WORKFLOW_ROOT": ".agent-workflow"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: acceptance-proof
|
|
3
|
+
description: Produce explicit acceptance verification evidence for every acceptance criterion in a spec and store the evidence under the standard artifact path.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use this skill after implementation or when the user explicitly asks for acceptance verification.
|
|
7
|
+
|
|
8
|
+
## Goal
|
|
9
|
+
Create a clear artifact trail showing whether each acceptance criterion passed or failed.
|
|
10
|
+
|
|
11
|
+
## Inputs
|
|
12
|
+
- target spec path
|
|
13
|
+
- optional implementation context
|
|
14
|
+
- optional commands or endpoints to exercise
|
|
15
|
+
|
|
16
|
+
## Output location
|
|
17
|
+
Store artifacts in:
|
|
18
|
+
- `.agent-workflow/artifacts/acceptance-<spec-slug>-<YYYYMMDD>/`
|
|
19
|
+
|
|
20
|
+
## Required process
|
|
21
|
+
1. Read the acceptance criteria from the spec.
|
|
22
|
+
2. Number them in order.
|
|
23
|
+
3. For each criterion, capture:
|
|
24
|
+
- criterion text
|
|
25
|
+
- method used to verify it
|
|
26
|
+
- classification (`ui`, `api`, `config`)
|
|
27
|
+
- code status (`implemented` / `not implemented`)
|
|
28
|
+
- human verification (`pending` unless already checked)
|
|
29
|
+
- command, request, screenshot, or file used as evidence
|
|
30
|
+
- observed result
|
|
31
|
+
- automated verification (`passed` / `failed` / `not run`)
|
|
32
|
+
4. Save one artifact file per criterion when useful, plus a short summary index.
|
|
33
|
+
|
|
34
|
+
## Artifact naming
|
|
35
|
+
Examples:
|
|
36
|
+
- `01-sync-endpoint.txt`
|
|
37
|
+
- `02-fetch-endpoint.txt`
|
|
38
|
+
- `03-route-navigation.png`
|
|
39
|
+
- `04-team-stats-tab.png`
|
|
40
|
+
- `05-game-summary-response.txt`
|
|
41
|
+
- `acceptance-summary.md`
|
|
42
|
+
|
|
43
|
+
## Rules
|
|
44
|
+
- Do not claim a pass without evidence.
|
|
45
|
+
- If a criterion cannot be verified, state why.
|
|
46
|
+
- If the live result contradicts the spec, flag it as an inconsistency and recommend a spec correction instead of hiding the issue.
|
|
47
|
+
- Keep artifacts concise and easy to review in a PR.
|
|
48
|
+
- Distinguish clearly between `implemented`, `verified automatically`, and `human QA pending`.
|
|
49
|
+
|
|
50
|
+
## Final handoff
|
|
51
|
+
Return:
|
|
52
|
+
- artifact directory path
|
|
53
|
+
- per-criterion pass/fail summary
|
|
54
|
+
- inconsistencies found
|
|
55
|
+
- note whether UI criteria were verified in-browser or only inspected statically
|
|
56
|
+
|
|
57
|
+
## UI tasks
|
|
58
|
+
For frontend/UI tasks, acceptance proof is incomplete unless runtime browser evidence is included. Prefer Playwright for:
|
|
59
|
+
- route navigation
|
|
60
|
+
- tab or modal behavior
|
|
61
|
+
- visible text and layout checks
|
|
62
|
+
- screenshots attached to the artifact folder
|
|
63
|
+
|
|
64
|
+
When UI proof is produced, report each criterion using:
|
|
65
|
+
- Code status
|
|
66
|
+
- Automated verification
|
|
67
|
+
- Human QA
|
|
68
|
+
- Evidence
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-mr-summary
|
|
3
|
+
description: Produce a concise PR/MR summary grounded in the spec, plan, implementation, docs update, and acceptance evidence.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use this skill when work is complete and a merge request description or handoff summary is needed.
|
|
7
|
+
|
|
8
|
+
## Required inputs
|
|
9
|
+
- spec path
|
|
10
|
+
- plan path
|
|
11
|
+
- relevant changed files
|
|
12
|
+
- docs path
|
|
13
|
+
- artifact path
|
|
14
|
+
|
|
15
|
+
## Output format
|
|
16
|
+
Generate a markdown summary with these sections:
|
|
17
|
+
- Title
|
|
18
|
+
- What changed
|
|
19
|
+
- Why
|
|
20
|
+
- Files/areas touched
|
|
21
|
+
- Verification
|
|
22
|
+
- Docs updated
|
|
23
|
+
- Follow-ups / risks
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
- Base the summary on actual completed work, not intention.
|
|
27
|
+
- Mention any approved deviation from the original spec.
|
|
28
|
+
- Reference acceptance artifacts explicitly.
|
|
29
|
+
- Keep it easy for reviewer scanning.
|