Internal
internal/core/prompts
Package prompts contains embedded prompt model defaults.
import "github.com/nilstate/scafld/v2/internal/core/prompts"
Package prompts contains embedded prompt model defaults.
Constants
Harden is the built-in fallback prompt used to drive spec hardening rounds.
Source: internal/core/prompts/prompts.go:4
const Harden = `# HARDEN MODE TEMPLATE
This is the built-in fallback harden prompt. Workspace-owned copies may override
it at .scafld/prompts/harden.md.
**Status:** ACTIVE
**Mode:** HARDEN
**Output:** Add grounded questions under the latest ## Harden Rounds entry in the spec; keep harden_status in_progress until the operator runs --mark-passed.
**Do NOT:** Modify code outside the spec file while hardening.
---
Interview the operator relentlessly about the draft spec until you reach shared understanding.
Work these harden questions before polishing wording:
- What is the real product goal, not just the requested implementation?
- What is authoritative when two artifacts contain the same fact?
- What are the ownership boundaries?
- What fails halfway, and how is it repaired?
- What invariants must be testable?
- What hidden cutovers are bundled?
- What examples or golden fixtures prove the shape?
- What operational command lets a human recover?
- Can we dogfood this?
- What complexity is being accepted, and why is it worth it?
Ask one question at a time. For each question, provide your recommended answer.
If a question can be answered by exploring the codebase, explore the codebase instead of asking.
Every question must carry one Grounded in value: spec_gap:<field>, code:<file>:<line>, or archive:<task_id>.
Use Grounded in as audit trail, not ceremony. Do not invent citations. Do not cite code you have not read. Do not ask about behavior the spec already settles.
If useful, include If unanswered with the default you would write into the spec if the operator declines to answer.
If you cannot form a genuine grounded question, stop. Do not pad the round.
Record each question in this exact Markdown shape under the latest harden round.
Do not use YAML object keys such as question:, grounded_in:, recommended_answer:, or resolution.
` + "```markdown" + `
Questions:
- Which module owns session cleanup?
- Grounded in: code:src/auth/session.ts:84
- Recommended answer: Use the existing cleanupSession owner.
- If unanswered: Default to the existing cleanup path.
- Answered with: Use cleanupSession.
` + "```" + `
The operator can end the loop by saying done or stop. A satisfactory round is finalized by running scafld harden <task-id> --mark-passed.
`