| facade | true |
| experimental | true |
| name | skillweave-promptchain-validate |
| description | Validate and improve SkillWeave prompt sequences. Detects sequence type (plan/build/mixed) and adapts output format. Accepts sequence as parameter or .md/.txt attachment. |
| argument-hint | sequence="[prompt sequence]" risk_mode="[conservative/medium/unicorn]" (or attach .md/.txt file) |
/skillweave-promptchain-validate
Review an existing prompt sequence against the SkillWeave standard and improve it if needed.
Mandatory Pre-Flight: SkillWeave Sandboxing
Before generating any output, you MUST verify and enforce the SkillWeave sandbox. This applies to every skill invocation without exception:
1. Enforce .skillweave/ Directory Structure
If .skillweave/ does not exist in the project root, create it:
.skillweave/
.skillweave/tracking-log/
.skillweave/templates/
.skillweave/sequences/
2. Route All Outputs Into .skillweave/
All validation reports, corrected sequences, and improvement logs MUST be saved exclusively within .skillweave/ or its sub-folders. Never dump artifacts into the repository root.
3. Git Isolation
Check .gitignore — if .skillweave/ is not listed, append it. AI-generated validation files are excluded from source control.
4. Default Config
If .skillweave/config.yaml does not exist, create it with:
mode: medium
checklist: true
design_thinking: true
community_knowhow: true
modular_templates: true
Proceed with core skill logic only AFTER these four criteria are met.
Usage
Invoke the skill by its name with arguments. The skill is
host-neutral; no executable prefix is required — route it through any host on
any supported transport (Markdown or MCP).
skillweave-promptchain-validate sequence="[prompt sequence text]"
Or attach a .md or .txt file containing the prompt sequence.
Parameters:
sequence (optional if file attached): Prompt sequence text to validate
strictness (optional): Validation strictness level (basic, standard, strict)
risk_mode (optional): conservative, medium, unicorn - overrides environment variable and config files
Attachment detection: If no sequence parameter is provided, check for attached .md/.txt files. If multiple options exist, ask for clarification.
Examples:
With inline sequence:
skillweave-promptchain-validate sequence="[paste sequence here]"
With attached file:
Attach sequence.md or sequence.txt and use:
skillweave-promptchain-validate
Example Validation Interaction:
- Skill analyzes sequence and detects type (e.g., "plan mode - business concept development")
- Skill presents validation findings with specific improvements needed
- Skill asks: "What should be saved as .md?
- Validation Report (complete)
- Improved sequence only
- Both in separate files
- Custom answer"
- Skill asks about output structure: "Based on the plan mode detection, should outputs be structured as:
- Single consolidated business plan document
- Multiple separate documents (executive summary, business plan, appendices)
- Custom structure"
- Skill provides complete improved sequence with all placeholder content replaced
- Skill offers to split consolidated outputs into appropriate separate documents if requested
Output Options (ask user before finalizing):
What should be saved as .md?
- Validation Report (complete) - Full validation report including improved version
- Improved sequence only - Only the improved sequence block
- Both in separate files - Report and improved sequence as two separate .md files
- Custom answer - User specifies custom format
Validation Process:
-
Sequence Type Detection:
- Analyze if sequence is plan mode (conceptual, business planning, strategy)
- Analyze if sequence is build mode (development, coding, implementation)
- Analyze if sequence is mixed (combination of plan and build)
- Use detailed heuristics from
references/sequence-type-detection.md for accurate detection
- Adapt output structure based on detected type
-
Complete Improved Sequence:
- Provide FULL improved sequence, NOT just references to original
- Replace placeholder comments like
[Unverändert aus Original – hier einfügen] with actual content
- Ensure improved sequence is fully self-contained and executable
-
Output Format Adaptation:
- For plan mode: Structure outputs as business plan sections, executive summaries, strategic documents
- For build mode: Structure outputs as technical specifications, code modules, implementation guides
- For mixed: Separate plan and build components with clear delineation
- Ask user about preferred document splitting (single consolidated vs. multiple separate files)
-
Validation Focus:
Detect which format the sequence is in first, then validate against
that format's contract — never apply the other format's checklist.
- Build sequences (the ecosystem-produced
execution-sequences.yaml,
emitted by regen-sequence.py and consumed by promptchain-execute).
Validate the build structure keys directly:
phases: every phase has dispatches_total, one session boundary,
and depends_on_phase where ordering matters
parallel_lanes: each lane owns a disjoint write surface and a
separate worktree/branch; two sessions sharing a git index collide
no matter how disjoint their files are
mutual_exclusion: surfaces written by more than one task are listed;
a surface written by exactly one task must NOT be here (it costs that
task its parallel slot)
gate_pass_requires: binary gates a phase must clear before the next
one may start (branch tip refetched and SHA named, red proofs exit 1
against base, reviewer role separate from ops)
Rules:
- Do not only critique; provide complete improved sequence
- Preserve original intent when possible
- Call out weak assumptions explicitly
- Identify when steps are too broad, too vague, or out of order
- Ensure improved sequence is production-ready and fully self-contained
Standard format — topic contract (twelve sections)
This is the topic format: a twelve-section prompt sequence laid out for a
human or a general prompt-chain run. It is the document this skill's pre-0.6
behaviour assumed for every input. Its consuming flow is the standalone
prompt-chain player / copilot-inline execution — not regen-sequence.py.
When the input is a build sequence instead, validate it against the
Build format contract below, NOT these twelve sections.
The topic format's expected structure is:
- Metadata
- Objective
- Success Criteria
- Assumptions
- Usage Notes
- Inputs Required
- Outputs Required
- Sequence Steps
- Final Assembly
- Validation Rules
- Failure Handling
- Final Deliverable Format
Build format — machine-issued dispatch contract
This is the build format: the execution-sequences.yaml that
regen-sequence.py emits from a PRD and promptchain-execute dispatches.
It is what the SkillWeave ecosystem produces today. Validate these keys, not
the twelve sections:
sequence_id, sequence_type (build/plan/mixed), execution_mode
phases: — one per dependency level, each with level, session: separate, depends_on_phase, dispatches_total, and lanes split into
parallel_lanes (subagent per lane, disjoint scope) and
serialized_lanes (shared surface, never concurrent)
parallel_lanes: — each lane carries id, criteria, dispatches,
points, its worktree/branch, and write surface (creates|modifies)
mutual_exclusion: — surfaces written by more than one task, with
rule: at_most_one_in_flight; used to serialize lanes that dependsOn
cannot order
gate_pass_requires: — the binary gates a phase must clear before the next
one starts
session_boundary: — where a session may stop; batch means one batch per
session and a second batch in the same session is refused
Consuming flow: regen-sequence.py (producer) → promptchain-execute
(dispatcher). If the input is a build sequence, run this skill in build mode
and never fall back to the twelve-section checklist.
Next Level Features
SkillWeave Next Level provides advanced capabilities that can enhance prompt chain validation. These features are controlled by .skillweave/config.yaml and can be accessed via the SkillWeaveNextLevel class.
Risk Mode Integration
SkillWeave v0.5.5 introduces a hierarchical override system for risk mode. The effective risk mode is determined by the following precedence order (highest to lowest):
- CLI parameter:
risk_mode="conservative/medium/unicorn" (if provided)
- Environment variable:
SKILLWEAVE_RISK_MODE (if set)
- Project config:
.skillweave/config.yaml mode setting
- Global config:
~/.skillweave/config.yaml mode setting
- Default:
medium
Use the RiskModeResolver class from skillweave.risk_mode_resolver to resolve the effective risk mode programmatically.
Command-line utilities:
skillweave-risk-mode - shows effective risk mode given current context. Use skillweave-risk-mode --cli-risk-mode=conservative --verbose to see precedence resolution.
skillweave-interactive-mode - interactive risk mode selection with project analysis and persistence options (temporary, project config, global config).
Adjust validation behavior according to the effective risk mode:
- Conservative: Extra validation, explicit approvals, strict safety checks, detailed validation reports
- Medium: Balanced approach with standard validation
- Unicorn: Optimistic assumptions, minimal confirmations, maximum speed, concise validation feedback
Checklist-Based Execution
If checklist: true is set in the config, the skill will:
- Parse markdown checklists (
- [ ] and - [x]) from sequence inputs
- Track checklist item completion across validation steps using
.skillweave/tracking-log/
- Loop until all checklist items are marked complete
- Provide progress reports and remaining items
Design-Thinking Lens
If design_thinking: true is set in the config, apply these cognitive ergonomics principles to validation outputs:
- Value ≥ Noise: Ensure every validation finding provides clear user value
- Scan Before Read: Structure validation reports for quick scanning with clear headings
- Hierarchy of Needs: Address functional needs before advanced features
- Progressive Disclosure: Reveal complexity gradually as needed
- Recognition Over Recall: Use consistent patterns and familiar formats
- Error Tolerance: Design for mistakes with clear recovery paths
Community Know-How
If community_knowhow: true is set, the skill will:
- Extract patterns from
.skillweave/tracking-log/ across projects
- Provide repository cleanup recommendations based on common issues
- Suggest optimizations and best practices from community patterns
Modular Templates
If modular_templates: true is set, the skill can:
- Load and combine templates from
.skillweave/templates/ for validation reports
- Use template inheritance for consistent validation structures
- Generate custom validation sections from reusable components
Using Next Level Features
from skillweave.next_level import SkillWeaveNextLevel
next_level = SkillWeaveNextLevel("/path/to/project")
if next_level.is_checklist_enabled():
checklist = next_level.parse_checklist(markdown_content)
if next_level.is_design_thinking_enabled():
lens = next_level.get_design_thinking_lens()
lens.apply_to_output(your_content)
Adjust your validation based on enabled features to provide enhanced results while maintaining backward compatibility.
Intelligent Guidance (v0.5.5)
SkillWeave v0.5.5 introduces intelligent prompt analysis and onboarding flows
that help ensure you're using the right skill with the right parameters.
How It Works
When this skill is invoked, you should first use the SkillIntegrationHelper
to analyze the user's prompt and validate the request:
from skillweave.intelligent_detection import integrate_with_skill
import os
project_root = os.getcwd()
if not os.path.exists(os.path.join(project_root, ".skillweave")):
parent = os.path.dirname(project_root)
if os.path.exists(os.path.join(parent, ".skillweave")):
project_root = parent
result = integrate_with_skill(
user_prompt=user_prompt,
current_skill="skillweave-promptchain-validate",
project_root=project_root
)
Handling the Result
The integrate_with_skill function returns a dictionary with an action key:
-
action: "proceed" - Skill selection is appropriate, parameters are valid
- Continue with normal skill execution
- Use
result["validated_parameters"] for parameter values
- Apply
result["mode_override"] if present (risk mode from CLI/env)
-
action: "gather_parameters" - Missing or invalid parameters detected
- Show
result["missing_parameters"] to the user
- Ask for each missing parameter using
result["parameter_prompts"]
- Use interactive Q&A to gather all required information
- After gathering, re-run
integrate_with_skill with updated parameters
-
action: "switch_skill" - Different skill might be more appropriate
- Consider switching to
result["recommended_skill"]
- Show explanation:
result["switch_reason"]
- Ask user for confirmation before switching
- If confirmed, load the recommended skill instead
-
action: "onboarding_flow" - User needs guided onboarding
- Follow the interactive onboarding flow
- Use
result["onboarding_steps"] for guidance
- Gather information step by step
- Complete onboarding before skill execution
Benefits
- Skill Validation: Ensures this skill is appropriate for the task
- Parameter Completeness: Checks all required parameters are provided
- Intelligent Routing: Suggests better-suited skills when applicable
- Guided Onboarding: Helps new users through step-by-step setup
- Learning System: Improves recommendations based on user feedback
Integration with Existing Features
The intelligent guidance system works alongside existing Next Level features:
- Respects risk mode overrides from CLI, environment, or config
- Uses the same project root and configuration
- Integrates with checklist tracking and design thinking
- Maintains backward compatibility
Example Workflow
result = integrate_with_skill(user_prompt, "skillweave-blueprint", project_root)
if result["action"] == "proceed":
params = result["validated_parameters"]
if "mode_override" in result:
set_risk_mode(result["mode_override"])
execute_skill(params)
elif result["action"] == "gather_parameters":
for param in result["missing_parameters"]:
prompt = result["parameter_prompts"].get(param, f"Enter value for {param}:")
value = ask_user(prompt)
elif result["action"] == "switch_skill":
if confirm_switch(result["recommended_skill"], result["switch_reason"]):
load_skill(result["recommended_skill"])
Always use intelligent guidance when executing this skill to provide the best
user experience and ensure successful outcomes.
Recommended companion files
Use these files if present:
references/format-spec.md
references/validation-rules.md
references/sequence-type-detection.md
assets/prompt-sequence.schema.json
assets/workflow-context.schema.json
Effective-profile contract validation (SW1312-CHAIN-001)
When the input is a profile-derived sequence (produced by
skillweave-promptchain-generate from an effective-profile snapshot), validate
against the profile contract, in addition to the existing structural rules
above (build or topic format). Do not apply the twelve-section topic checklist to
a profile chain.
Profile contract checks (each fail-closed, returned as a violation):
- Profile contract present — the sequence binds
profile_id,
profile_version, sdk_digest and effective_digest; a missing identity
field is a violation, never an empty default.
- Evidence contracts — the profile declares evidence contracts (
job_receipt,
verification, and for high/critical risk cold_review and replay).
- Surfaces — every mutating (ops) step owns a non-empty write surface; a
surface-free mutating step is a violation.
- Authority — an
ops role must never approve a gate on its own work
(can_approve_gate on ops is refused).
- Dependencies — a step's handoff must reference its actual predecessor
phase (
handoff:<prev>-><next>); a broken chain link is a violation.
- Handoffs — every non-first step carries exactly one handoff naming the
preceding phase, and the handoff list matches the phase count minus one. Each
handoff must also carry the four identity fields (
profile_id,
profile_version, sdk_digest, effective_digest); a handoff that omits
any identity field is a violation, never a bare phase-pair string.
Preview boundary: a sequence that asks to execute a preview-only runtime
dimension (phases, topology, control, human_coupling, change_surfaces,
autonomy_bounds, skills, capabilities, kernel_stage) is invalid: those
dimensions are declarations only. Validation reports the dimension and refuses to
mark the sequence dispatchable, never silently accepting a fall-back.
Backward compatibility: without an explicit profile, the existing
build/topic validation rules above are unchanged.