AGENT SKILL

dh-contingency

Generate architectural alternatives (Plan A/B/C) with trade-off analysis before committing to a path: identify decision areas, rate risk and complexity, and recommend one plan. Use when multiple plausible approaches exist, to compare architecture options, or during planning. Output: ./docs/plans/<plan-slug>/contingency.md.

License 许可
MIT
最近更新
2026-11-10
Stars
★ 8
Forks
1

01 前言 Front Matter

name
dh-contingency
license
MIT
metadata
{ "audience": "developers", "workflow": "development" }
description
Generate architectural alternatives (Plan A/B/C) with trade-off analysis before committing to a path: identify decision areas, rate risk and complexity, and recommend one plan. Use when multiple plausible approaches exist, to compare architecture options, or during planning. Output: ./docs/plans/<plan-slug>/contingency.md.
allowed-tools
read, write
compatibility
opencode, copilot, antigravity

03 SKILL.md 正文

Evaluate architectural decision points and produce a small set of concrete alternatives with explicit risk, complexity, and trade-offs. Executed by the plan's selected architecture agent (see ../dh-planning/references/agent-selection.md); invoked by dh-planning when more than one plausible approach exists, and consumed by dh-artifact-check for planned deployment paths.

Output contract: write the analysis to ./docs/plans/<plan-slug>/contingency.md (create the plan directory when it does not exist yet).

Core Rules

  • Run the analysis only when multiple plausible approaches genuinely exist — do not manufacture alternatives for a single viable path.
  • Identify the architectural decision areas first, then map each alternative against all of them.
  • Keep each plan concrete: components, modules, data flow, integrations, and migration/deployment impact.
  • Rate every plan on three axes: Risk, Complexity (S/M/L plus rough effort), and Trade-offs (gains vs sacrifices).
  • Recommend exactly one plan and justify it against the requirements and constraints; read ./docs/plans/<plan-slug>/sdd.md when it exists.
  • Keep alternatives mutually exclusive and genuinely different — not variations of the same approach.
  • Do not write implementation code, modify source files, or edit plan documents.
  • Write only to ./docs/plans/<plan-slug>/contingency.md.

Method

  1. Read the request, plus ./docs/plans/<plan-slug>/sdd.md and ./docs/plans/<plan-slug>/plan.md when they exist — extract constraints, acceptance criteria, and out-of-scope items every alternative must respect.
  2. Survey existing project patterns, modules, and dependencies; use the dh-explore skill when the codebase is unfamiliar. When the project graph is indexed, use the dh-code-query skill (importers, callers, implementors) to map real dependencies and the blast radius each alternative would touch.
  3. List the architectural decision areas where approaches diverge (data model and versioning, backend vs frontend responsibilities, integration boundaries, deployment topology, and similar).
  4. Define 2–3 coherent plans. Each plan states how it resolves every decision area; label the strongest candidate as recommended.
  5. Assess each plan: Risk (likelihood and impact), Complexity (size and rough effort), Trade-offs (what is gained, what is sacrificed).
  6. Recommend one plan, naming the conditions under which an alternative becomes preferable.
  7. Save the report using the output template below to ./docs/plans/<plan-slug>/contingency.md.

Output Template

# Contingency Analysis: [Feature / Plan Title]

## Architectural Decision Areas
1. **[Area]** — [why multiple approaches exist]
2. **[Area]** — [why multiple approaches exist]

## Plan A: [Name] — Recommended
### Approach
1. [Concrete steps covering every decision area]
### Risk: Low / Medium / High
- [Main risks and failure modes]
### Complexity: S / M / L ([rough effort])
- [Work breakdown per area]
### Trade-offs
- **Gain:** [what improves]
- **Sacrifice:** [what is given up]

## Plan B: [Name]
### Approach
- [same shape as Plan A]
### Risk: Low / Medium / High
- [...]
### Complexity: S / M / L ([rough effort])
- [...]
### Trade-offs
- **Gain:** [...]
- **Sacrifice:** [...]

## Plan C: [Name]
### Approach
- [same shape as Plan A]
### Risk: Low / Medium / High
- [...]
### Complexity: S / M / L ([rough effort])
- [...]
### Trade-offs
- **Gain:** [...]
- **Sacrifice:** [...]

## Recommendation
**Proceed with Plan A** — [rationale tied to requirements and constraints].
Adopt Plan B only if [condition]; adopt Plan C only if [condition].

Safety

  • Never present an alternative without naming its risks and failure modes.
  • Never recommend an approach that violates requirements or skips validation.
  • Do not expose secrets, credentials, or tokens in the analysis.
  • If only one approach is viable, state that explicitly and skip the comparison instead of forcing alternatives.

Final Check

  • Every decision area is covered by every plan.
  • Risk, complexity, and trade-offs are present for each plan.
  • The recommendation names the winning plan and the conditions that would change it.
  • The report is saved at ./docs/plans/<plan-slug>/contingency.md.

Doc search

Documentation management: delegate create / update / delete / retrieve of generated documents (excluding docs/plans) to the best available documentation agent (bundled documentation capability as fallback) — the main and only documentation owner (see dh-create-documentation).

Search generated documentation quickly: notesmd-cli search-content "<term>" --vault "<project-name>" or obsidian search query="<term>" (fallback: rg --glob '*.md' "<term>" docs/).

04 同仓库更多 Skills

andrescevp
andrescevp/development-harness

dh-simplify

Review changed code for reuse, quality, and efficiency (three parallel reviews), then fix findings directly. Use after making changes or when asked to clean up, refactor, simplify, or improve this code.

★ 8
andrescevp
andrescevp/development-harness

dh-setup

Audit system software, configure user MCPs/plugins, scaffold project QA (hooks + per-stack tools), bootstrap docs/architecture with the selected architecture agent, and write harness directives into AGENTS.md. Use to check requirements or setup the environment.

★ 8
andrescevp
andrescevp/development-harness

dh-semver

Apply strict Semantic Versioning — analyze commits since the last tag to determine the bump type (major/minor/patch from conventional commit prefixes), generate an automated changelog grouped by breaking changes, features, fixes, and chores, and create a git tag locally without pushing until confirmed, handling both conventional commits and manual version decisions. Use when preparing a release, invoked by dh-execute-plan after plan completion and dh-final-review for release readiness, or when the user asks "what version is next?", "bump version", "generate changelog", "tag release", or "what changed since last release?".

★ 8
andrescevp
andrescevp/development-harness

dh-review

Verify a plan sub-task against acceptance criteria, scope, done-when; review diff, validation, regression risk; structured verdict to tasks/review.md. Plan Alignment Mode (fast execution) is a separate mode: no sub-task selection, no diff review, no code review — it compares plan.md with plan_fast.md and writes tasks/review-fast.md (pre-execution) or tasks/review-fast-final.md (plan-end). Use after implementation, to review/verify the sub-task, or to check fast-plan alignment.

★ 8
andrescevp
andrescevp/development-harness

dh-resume-plan

Resume a paused phased plan from docs/plans/<slug>/handoff.md: validate the contract, detect drift, rehydrate context, mark the handoff resumed, and continue via dh-execute-plan resume mode. Use when the user says "resume the plan", "continue where we stopped", "pick up the plan", or "resume after a pause".

★ 8
andrescevp
andrescevp/development-harness

dh-preflight

Run tests, linters, static analysis as a release gate: auto-detect tooling, check dirty state, pass/fail verdict with actionable failures (no auto-fixes). Use to run preflight, pre-release check, or validate before release.

★ 8