Shared Coding Contract
- Refer to Shared Coding Workflow Contract in
../lcs-shared/contract.mdfor folder conventions, Handoff format, and token optimization.
Purpose
- Execute a single task (
task-###.md), update its status todone(orblocked), and support Normal or TDD development flows with automatic analysis and user recommendation.
Trigger
- Activate when the user requests to "Eksekusi TASK-###", "Eksekusi task-###.md", "continue TASK-###", or "implement TASK-###".
Behavior checklist
- Read
.lcs/state.mdfirst to identify the active work-item directory:.lcs/work-items/{timestamp}-{slug-work-item}/. - Locate and read the target task file
.lcs/work-items/{timestamp}-{slug-work-item}/task/task-###.md. - Read Source coverage from the task file. If Source coverage is missing or empty, update the task status to
blocked, reportTask lacks Source coverage. Re-run lcs-task-slicer to repair task slicing., and stop. - Read every referenced source artifact from Source coverage before implementation:
SRC-###-> Source Requirement Ledger inprd-enhanced.mdorprd.mdFR-###/BR-###/VR-###/EC-###->srs.mdAC-###->srs.mdAcceptance Criteria sectionTEST-###->tests.mdIf a referenced artifact is missing, mark the taskblockedand report the missing source.
- Check task dependencies listed in
Depends on. If they are notdone(or not met), update the task status toblocked, report the blocker, and stop. - Analyze task requirements and recommend development mode:
- TDD Mode Criteria: Logic-heavy, complex state transitions, algorithm/data transformations, high-risk code, or tasks explicitly requiring testing.
- Normal Mode Criteria: UI/styling only, configurations, plain boilerplates, low-risk documentation, or trivial chores.
- Action: Present the recommendation with brief rationale. Ask user for confirmation.
- If Normal mode is chosen:
- Implement target logic.
- Add/update tests if relevant.
- Run validation commands (linter, tests).
- Record execution results.
- If TDD mode is chosen (based on vertical slices / tracer bullets):
- Step A: Plan Interfaces & Behaviors: Confirm public interfaces and testable behaviors first. Avoid vertical slicing of private details.
- Step B: Tracer Bullet (RED -> GREEN): Write ONE failing test checking ONE public behavior. Implement minimal code to pass.
- Step C: Incremental Vertical Slices: Loop writing one failing test and minimal implementation for each remaining behavior. Do not write all tests first.
- Step D: Refactor: Extract duplication, deepen modules (keep interfaces small/simple), and apply SOLID principles. Never refactor while test is RED.
- Once task is fully executed and verified:
- Update Chain of Truth Report before Handoff with executed Source IDs, AC pass/fail, tests run, and remaining uncovered IDs.
- Update
Status: doneinside the.lcs/work-items/{timestamp}-{slug-work-item}/task/task-###.mdfile.
- Update
.lcs/state.mdwith:
current_phase: executionlast_session_note: Executed TASK-###: <task-name> successfullytimestamp: <current-ISO-timestamp>
- End with Handoff pointing to the next logical step (e.g., the next sequential task or
lcs-doc-finalizer).
Prompt templates
- Starter Task Execution: "Eksekusi TASK-001"
- Starter TDD explicitly: "Eksekusi TASK-001 dengan TDD"
- Starter Normal explicitly: "Eksekusi TASK-001 mode normal"
Handoff example:
Chain of Truth Report
Level
Very Strict
Sources Checked
.lcs/state.md.lcs/work-items/{timestamp}-{slug-work-item}/task/task-###.md
Assumptions
- [verified] Task dependencies met.
- [verified] Chosen mode (Normal/TDD) confirmed with user.
Plan Before Action
- Read state.md and task file.
- Check dependencies.
- Implement task.
- Run validation.
Actions Taken
- <Exact commands run with stdout/stderr captured>
Verification
- <All test and lint commands run; results quoted verbatim>
Proof of Result
<Quoted command outputs>
Blocked Items
<None, or list with reasons>
Confidence
<high/medium/low>
Risk Notes
<None, or outstanding concerns>
Handoff
Next recommended skill: lcs-task-executer Next file to read: .lcs/work-items/{timestamp}-{slug-work-item}/task/task-###.md Current phase: execution Current confidence: high Blocking questions: None Risks to carry forward: None Source of Truth Bundle: target task, prd-enhanced.md if present, prd.md, srs.md if referenced, tests.md if referenced, traceability.md if present, task-coverage.md if present Must Preserve IDs: <executed SRC/FR/AC/TEST IDs> Unresolved IDs: Suggested next command: Eksekusi TASK-002
Chain of Truth Level
Level: Very Strict
This skill follows the LCS Chain of Truth protocol at the declared level.
Deprecated name. This skill name (
lcs-task-executer) is kept for backward compatibility. Preferlcs-task-executorfor new workflows. Guard: Do not run this legacy skill andlcs-task-executorinterchangeably within the same work item. Always use the same executor for all tasks of a work item to keep.lcs/state.mdcurrent_phaseand task statuses consistent. If a work item was started withlcs-task-executor, continue with it; do not switch to this legacy alias mid-work-item.