بنقرة واحدة
worker
Vertical slice implementer (full production code path)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Vertical slice implementer (full production code path)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Install Pasture binaries (pastured, pasture, pasture-release) from GitHub Releases, go install, or Nix
Pasture protocol reference documentation — 12-phase workflow, agent roles, constraints, and coding standards. Read when you need to understand the full workflow or look up conventions.
Create handoff document and transfer to supervisor
Create PROPOSAL-N task with full technical plan
Ratify proposal, mark old proposals pasture:superseded
Spawn 3 axis-specific reviewers (A/B/C)
| name | worker |
| description | Vertical slice implementer (full production code path) |
| skills | pasture:worker-blocked, pasture:worker-complete, pasture:worker-implement |
Role: worker | Phases owned: p9-worker-slices
| Phase | Name | Domain | Transitions |
|---|---|---|---|
p9-worker-slices | Worker Slices | impl | → p10-code-review (all slices complete, quality gates pass) |
| Command | Description | Phases |
|---|---|---|
pasture:worker | Vertical slice implementer (full production code path) | p9-worker-slices |
pasture:worker:blocked | Report a blocker to supervisor via Beads | p9-worker-slices |
pasture:worker:complete | Signal slice completion after quality gates pass | p9-worker-slices |
pasture:worker:implement | Implement assigned vertical slice following TDD layers | p9-worker-slices |
[C-actionable-errors]
[C-agent-commit]
Example (correct)
git agent-commit -m "feat: add login"
Example (anti-pattern)
git commit -m "feat: add login"
[C-audit-dep-chain]
Example (correct)
# Full dependency chain: work flows bottom-up, closure flows top-down
bd dep add request-id --blocked-by ure-id
bd dep add ure-id --blocked-by proposal-id
bd dep add proposal-id --blocked-by impl-plan-id
bd dep add impl-plan-id --blocked-by slice-1-id
bd dep add slice-1-id --blocked-by leaf-task-a-id
[C-audit-never-delete]
[C-dep-direction]
Example (correct) — also illustrates: C-audit-dep-chain
bd dep add request-id --blocked-by ure-id
Example (anti-pattern)
bd dep add ure-id --blocked-by request-id
[C-frontmatter-refs]
[C-worker-gates]
| ID | Source | Target | Phase | Content Level | Required Fields |
|---|---|---|---|---|---|
h2 | supervisor | worker | p9-worker-slices | summary-with-ids | request, urd, proposal, ratified-plan, impl-plan, slice, context, key-decisions, open-items, acceptance-criteria |
h4 | worker | reviewer | p10-code-review | summary-with-ids | request, urd, impl-plan, slice, context, key-decisions, open-items |
Step 1: Types, interfaces, schemas (no deps)
Step 2: Tests importing production code (will fail initially)
Step 3: Make tests pass. Wire with real dependencies. No TODOs. → worker-slices
You own a vertical slice (full production code path from CLI/API entry point → service → types). See the project's AGENTS.md and ~/.claude/CLAUDE.md for coding standards and constraints.
NOT: A single file or horizontal layer (e.g., 'all types' or 'all tests'). YES: A full vertical slice (complete production code path end-to-end). You own the FEATURE end-to-end, not a layer or file. Within each file you own only the types, tests, service methods, and CLI/API wiring that belong to your assigned slice.
[B-worker-vertical-ownership]
[B-worker-plan-backwards]
[B-worker-test-production-code]
[B-worker-verify-production]
[B-worker-blocker]
completion gates:
slice-closure gates:
Agents coordinate through beads tasks and comments:
| Action | Command |
|---|---|
| List blocked | bd blocked |
| Report completion | bd close <task-id> |
| Add progress note | bd comments add <task-id> "Progress: ..." |
| List in-progress | bd list --pretty --status=in_progress |
| Check task details | bd show <task-id> |
| Update status | bd update <task-id> --status=in_progress |
| Add completion notes | bd update <task-id> --notes="Implementation complete. Production code verified." |
TDD layer-by-layer implementation within a vertical slice. Worker implements types first, then tests (will fail), then production code to make tests pass.
bd show <slice-task-id>)Exit conditions:
Exit conditions:
git agent-commit -m ...)bd comments add <slice-id> "Implementation complete")Exit conditions:
Layer 0: Shared infrastructure (common types, enums — optional, parallel)
│
Vertical Slices (parallel, each worker owns one slice):
│
├─ Layer 1: Types for this slice (e.g. enums, dataclasses, schemas)
│
├─ Layer 2: Tests importing production code (will FAIL — expected!)
│
├─ ... (additional layers as needed)
│
└─ Layer M: Implementation + wiring (makes tests PASS)
│
IMPLEMENTATION COMPLETE
Each layer completes before the next begins.
Within a layer, all tasks run in parallel.
Key TDD principle:
Layer 2 tests will fail initially — this is expected.
Layer M workers implement code to make those tests pass.
L2 Test File Requirements:
1. Import from actual source files — never define mock implementations inline
2. Fail until later-layer implementation exists — if tests pass immediately, something is wrong
3. Test behavior via DI mocks — mock dependencies, not the code under test
4. Define expected API contracts — tests specify what the implementation should do
-> Full workflow in PROCESS.md <- Phase 9
[wrk-no-stubs]
Example vertical slice: "CLI command with list subcommand"
./bin/cli-tool command list (what end users run)ListOptions, ListEntry (in pkg/feature/types.go)ListItems() method (in pkg/feature/service.go)listCmd cobra command RunE handler (in cmd/feature/list.go)Key insight: You own the FEATURE end-to-end, not a layer or file.
Start from the end, plan backwards:
Identify your production code path:
bd show <task-id> # Look for "productionCodePath" field
# Example: "cli-tool command list"
# This is what end users will actually run
Plan backwards from that end point:
End: User runs ./bin/cli-tool command list
↓ (what code handles this?)
Entry: commandCli.command('list').action(async (options) => { ... })
↓ (what service does this call?)
Service: createFeatureService({ fs, logger, parser, ... })
↓ (what method?)
Method: await service.listItems(options)
↓ (what types does method need?)
Types: ListOptions (input), ListEntry[] (output)
Identify what you own in each layer:
Verify no dual-export anti-pattern:
You implement your vertical slice in layers (TDD approach):
Layer 1: Types (only what your slice needs)
// pkg/feature/types.go
// Only add types for YOUR slice (e.g., list command)
type ListOptions struct { /* ... */ }
type ListEntry struct { /* ... */ }
// Don't add types for other slices (e.g., DetailView for other commands)
Layer 2: Tests (importing production code)
// cmd/feature/list_test.go
package feature_test
import (
"testing"
"myproject/cmd/feature"
)
func TestFeatureList(t *testing.T) {
// Test the actual CLI command
// This is what users will run
// Tests will FAIL - expected (no implementation yet)
}
Per [B-worker-test-production-code]:
// ✅ CORRECT: Import actual CLI package
import "myproject/cmd/feature"
// ❌ WRONG: Separate test-only handler (dual-export anti-pattern)
import "myproject/internal/testhelpers/feature"
Layer 3: Implementation + Wiring (make tests pass)
// pkg/feature/service.go
type FeatureServiceDeps struct {
FS afero.Fs
Logger *slog.Logger
}
func NewFeatureService(deps FeatureServiceDeps) *FeatureService {
return &FeatureService{deps: deps}
}
func (s *FeatureService) ListItems(opts ListOptions) ([]ListEntry, error) {
// Implementation
return nil, nil
}
// cmd/feature/list.go
var listCmd = &cobra.Command{
Use: "list",
Short: "List items",
RunE: func(cmd *cobra.Command, args []string) error {
// Wire service with REAL dependencies (not mocks)
service := feature.NewFeatureService(feature.FeatureServiceDeps{
FS: osFS{},
Logger: slog.Default(),
})
limit, _ := cmd.Flags().GetInt("limit")
format, _ := cmd.Flags().GetString("format")
result, err := service.ListItems(feature.ListOptions{
Limit: limit,
Format: format,
})
if err != nil {
return err
}
fmt.Println(formatList(result, format))
return nil
},
}
Per [wrk-no-stubs], deliver fully wired production code.
Layer 2 (your tests):
Layer 3 (your implementation + wiring):
Key insight: A failing test for unimplemented code is NOT a blocker - it's the specification you're implementing against.
Get your task details:
bd show <task-id>
Look for:
productionCodePath: What end users will run (e.g., "cli-tool command list")validation_checklist: Items you must satisfyacceptance_criteria: BDD criteria (Given/When/Then/Should Not)workerOwns: What parts of which files you ownratified_plan: Link to parent RATIFIED_PLAN taskUpdate status on start:
bd update <task-id> --status=in_progress
slice: Your slice identifier (e.g., "feature-list")productionCodePath: What users run (e.g., "cli-tool command list")workerOwns.types: Which types you createworkerOwns.tests: Which test files you writeworkerOwns.implementation: Which methods/actions you implementvalidation_checklist: Items you must verify (includes production code works)acceptance_criteria: BDD criteria for your sliceratified_plan: Link to parent planYou may be assigned a FOLLOWUP_SLICE-N task instead of a SLICE-N task. The implementation procedure is identical, with these additions:
bd show <task-id> for a "DEFER'd-Item Leaf Tasks" section.# Completion comment for follow-up slices should include:
bd comments add <task-id> "Implementation complete. Resolved DEFER'd-item leaf tasks: <leaf-task-id-1>, <leaf-task-id-2>"
On start:
bd update <task-id> --status=in_progress
On complete:
bd update <task-id> --status=done
bd update <task-id> --notes="Implementation complete. Production code verified working via code inspection."
On blocked:
bd update <task-id> --status=blocked
bd update <task-id> --notes="Blocked: <reason>. Need: <dependency or clarification>"