Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cli/specs/design.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "PromptKit CLI — Design Specification"
project: "PromptKit CLI (@alan-jowett/promptkit)"
version: "0.3.0"
date: "2025-07-17"
version: "0.6.1"
date: "2026-04-07"
status: draft
related:
- requirements: cli/specs/requirements.md
Expand All @@ -17,6 +17,7 @@ related:
|-----|------|--------|-------------|
| 0.1 | 2025-07-17 | Spec-extraction-workflow | Initial draft extracted from source code |
| 0.2 | 2025-07-18 | Engineering-workflow Phase 2 | Removed assemble.js module design (§2.2), manifest.js module design (§2.3), assembly pipeline data flow (§3.1). Updated cli.js design for two commands with inline manifest parsing. Updated module structure, dependency graph, command flow, interface contracts, dependencies. Resolved GAP-001 through GAP-007, GAP-009, GAP-011. |
| 0.6.1 | 2026-04-07 | Maintenance audit (F-003) | Bumped version to match requirements.md and package.json. No design changes — version alignment only. |

---

Expand Down
96 changes: 96 additions & 0 deletions formats/decision-log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<!-- SPDX-License-Identifier: MIT -->
<!-- Copyright (c) PromptKit Contributors -->

---
name: decision-log
type: format
description: >
Lightweight architectural decision record (ADR) format. Records
significant design decisions with context, options considered,
rationale, and consequences. Agent-consumable and human-readable.
produces: decision-log
---

# Format: Decision Log

The output MUST be a decision log document with one or more decision
entries in the following structure. Each entry records a single
significant design decision. Decisions are appended chronologically.

If a section has no content, state "None identified" — never omit
a section.

## Document Structure

```markdown
# Decision Log — {{project-or-component-name}}

## Decision: [Title]

**Date**: YYYY-MM-DD
**Status**: Proposed | Accepted | Deprecated | Superseded by [Decision Title]
Comment thread
Alan-Jowett marked this conversation as resolved.
Resolved
**Deciders**: [who made or approved this decision]

### Context

What situation, problem, or requirement prompted this decision? Include
relevant constraints, forces, and prior art. Be specific enough that a
reader unfamiliar with the project history can understand why a decision
was needed.

### Options Considered

| Option | Pros | Cons |
|--------|------|------|
| Option A — [name] | [advantages] | [disadvantages] |
| Option B — [name] | [advantages] | [disadvantages] |
| Option C — [name] | [advantages] | [disadvantages] |
Comment thread
Alan-Jowett marked this conversation as resolved.
Resolved

### Decision

State the chosen option clearly and unambiguously.

### Rationale

Why was this option chosen over the alternatives? Reference specific
constraints, evidence, benchmarks, or principles that drove the choice.
Distinguish between "we chose this because X" and "we chose this
despite Y" — both are important.

### Consequences

What follows from this decision? Include:

- **Positive**: What becomes easier, simpler, or more reliable.
- **Negative**: What becomes harder, constrained, or deferred.
- **Neutral**: What changes but is neither better nor worse.
- **Follow-up actions**: Work items, future decisions, or reversibility
notes created by this decision.
```

## Structural Rules

1. **One decision per entry.** Do not bundle multiple decisions.
2. **Chronological order.** New decisions are appended at the end.
3. **Immutable once accepted.** Do not edit accepted decisions — instead,
add a new decision that supersedes the old one and update the old
entry's Status to `Superseded by [Decision Title]`.
4. **Options table is mandatory.** Even if the decision seems obvious,
document at least one alternative considered (including "do nothing").
5. **Consequences must include negatives.** Every decision has tradeoffs.
If no negative consequences are identified, the analysis is incomplete.

## When to Record a Decision

Record a decision when:

- It affects the system's architecture, API surface, or data model.
- It constrains future choices (technology selection, protocol choice).
- It was debated — multiple reasonable options existed.
- A future contributor might ask "why was it done this way?"

Do NOT record decisions about:

- Routine implementation choices with no architectural impact.
- Style or formatting preferences (these belong in coding standards).
- Temporary workarounds (these belong in issue trackers).
8 changes: 8 additions & 0 deletions manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,14 @@ formats:
motivation with Before/After content, traceability matrix, and
invariant impact assessment. Domain-agnostic.

- name: decision-log
path: formats/decision-log.md
produces: decision-log
description: >
Lightweight architectural decision record (ADR) format. Records
significant design decisions with context, options considered,
rationale, and consequences. Agent-consumable and human-readable.

- name: presentation-kit
path: formats/presentation-kit.md
produces: presentation-kit
Expand Down
16 changes: 15 additions & 1 deletion protocols/guardrails/operational-constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,21 @@ If your environment supports parallel or delegated execution:
- Each work stream should produce a structured artifact that can
be independently verified.

### 7. Coverage Documentation
### 8. Two-Failures Rule

If the same approach fails twice, **stop and switch strategies**. Do not
retry a failing method with minor variations — this consumes context and
tool capacity in a futile loop. After two failures of the same approach:

1. Reassess your assumptions about the problem.
2. Try a fundamentally different strategy (different tool, different
algorithm, different decomposition).
3. If no alternative is apparent, ask the user for guidance.

This rule applies to tool usage, debugging approaches, search strategies,
and any repeated action that is not producing progress.

### 9. Coverage Documentation

Every analysis MUST include a coverage statement:

Expand Down
22 changes: 22 additions & 0 deletions taxonomies/specification-drift.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,28 @@ Use these labels to classify findings when auditing requirements, design,
and validation documents for consistency and completeness. Every finding
MUST use exactly one label from this taxonomy.

## Label Group Summaries

When only a subset of labels is applicable to a given audit type, use
these summaries for cross-reference context. The primary label group
(determined by the audit template) uses full definitions below; non-primary
groups use these summaries to preserve semantic context without consuming
prompt tokens.

- **D1–D7 (Traceability)**: Document-level drift — untraced requirements,
untested requirements, orphaned design decisions, orphaned test cases,
assumption drift between documents, constraint violations in design,
and acceptance criteria mismatches between test plans and requirements.
- **D8–D10 (Code Compliance)**: Code-to-spec drift — unimplemented
requirements, undocumented behavior in source code, and constraint
violations in implementation.
- **D11–D13 (Test Compliance)**: Test-to-plan drift — unimplemented test
cases, untested acceptance criteria, and assertion mismatches between
test code and validation plans.
- **D14–D16 (Integration)**: Cross-component drift — unspecified
integration flows, interface contract mismatches between components,
and untested integration paths.

## Labels

### D1_UNTRACED_REQUIREMENT
Expand Down
Loading