Skip to content

Commit 3413873

Browse files
committed
docs: refresh helix specs and plans
1 parent a58ac1d commit 3413873

75 files changed

Lines changed: 2234 additions & 125 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
---
2+
dun:
3+
id: F-001
4+
depends_on:
5+
- helix.prd
6+
review:
7+
self_hash: 1490cef1b15ca48c530d4f0c4eae1e5e9912c5d3a7dfa1aa0343e7c59290dd78
8+
deps:
9+
helix.prd: 58d3c4be8edb0a0be9d01a3325824c9b350f758a998d02f16208525949c4f1ad
10+
---
111
# Feature Spec: F-001 Auto-Discovery
212

313
## Summary
@@ -7,12 +17,39 @@ manual configuration.
717

818
## Requirements
919

10-
- Detect Go repositories via `go.mod`.
11-
- Detect Helix workflow via `docs/helix/`.
12-
- Produce a deterministic set of checks for the repo state.
20+
- Discover core checks from repo signals (files and conventions).
21+
- Detect Go repositories via `go.mod` to enable baseline Go quality checks.
22+
- Detect Helix workflow via `docs/helix/` to enable doc/gate validation checks.
23+
- Produce a deterministic set of checks for the same repo state.
24+
- Require no manual configuration for core discovery.
25+
26+
## Inputs
27+
28+
- Repository root file tree.
29+
- `go.mod` (Go detection signal).
30+
- `docs/helix/` (Helix workflow detection signal).
1331

1432
## Acceptance Criteria
1533

16-
- `dun check` lists checks based on detected repo signals.
34+
- `dun check` selects Go quality checks when `go.mod` is present.
35+
- `dun check` selects Helix doc/gate checks when `docs/helix/` is present.
1736
- Check IDs and ordering are stable across runs for the same repo state.
1837
- No user configuration is required for core discovery.
38+
39+
## Gaps & Conflicts
40+
41+
- Missing canonical registry of check IDs and their discovery rules (depends on
42+
F-003 Plugin System).
43+
- Missing ordering rules when multiple signals match (priority and grouping).
44+
- Missing definition of baseline Go quality checks to enable (depends on
45+
F-014 Go Quality Checks).
46+
- Missing definition of how discovery hooks into doc drift detection (depends
47+
on F-006 Doc Reconciliation and F-016 Doc DAG).
48+
- No conflicts identified in the provided inputs.
49+
50+
## Traceability
51+
52+
- Supports PRD goals for "one command that discovers and runs the right
53+
checks" and deterministic output.
54+
- Supports PRD scope for built-in Helix doc validation and baseline Go quality
55+
checks by using repo signals for discovery.

docs/helix/01-frame/features/F-002-output-formats.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
---
2+
dun:
3+
id: F-002
4+
depends_on:
5+
- helix.prd
6+
review:
7+
self_hash: 83b2a3c2ac4e9a760bd04598c3ff9c3ea3504c0f49e8d246cd9a61d540e87898
8+
deps:
9+
helix.prd: 58d3c4be8edb0a0be9d01a3325824c9b350f758a998d02f16208525949c4f1ad
10+
---
111
# Feature Spec: F-002 Output Formats
212

313
## Summary
@@ -12,12 +22,29 @@ consumption by humans and tools.
1222
- Provide `--format=json` for structured results.
1323
- Output is deterministic and stable for a given repo state.
1424

25+
## Inputs
26+
27+
- Check results emitted by `dun check`.
28+
- Repository state that drives deterministic ordering.
29+
- PRD goals for deterministic, agent-friendly output formats.
30+
1531
## Acceptance Criteria
1632

1733
- `dun check` emits prompt envelopes by default when agent checks are present.
1834
- `dun check --format=llm` prints concise summaries.
1935
- `dun check --format=json` emits structured JSON output.
2036

37+
## Gaps & Conflicts
38+
39+
- Missing formal schema for the JSON output format (field names, ordering,
40+
error model).
41+
- Missing definition of the prompt envelope structure and how callbacks are
42+
encoded for agent checks.
43+
- Missing length and content guidelines for `--format=llm` summaries.
44+
- Missing rules for how multi-check results are ordered and grouped across
45+
formats.
46+
- No conflicts identified in the provided inputs.
47+
2148
## Traceability
2249

2350
- Supports success metrics for time to first output and median run time by
Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,59 @@
1+
---
2+
dun:
3+
id: F-003
4+
depends_on:
5+
- helix.prd
6+
review:
7+
self_hash: 8bbe08567869ffbb1fa3c56eb1af0d585f1918acb50240d7c541a86b4ace030e
8+
deps:
9+
helix.prd: 58d3c4be8edb0a0be9d01a3325824c9b350f758a998d02f16208525949c4f1ad
10+
---
111
# Feature Spec: F-003 Plugin System
212

313
## Summary
414

5-
Support manifest-defined checks so Dun can detect and run workflow-specific
6-
rules (including Helix).
15+
Provide an extensible plugin system so Dun can ship built-in workflows
16+
(including Helix doc and gate validation) and add future workflow-specific
17+
checks while keeping discovery deterministic.
718

819
## Requirements
920

21+
- Provide an extensible plugin system for future workflows.
22+
- Include a built-in Helix plugin for documentation and gate validation.
1023
- Load built-in plugin manifests embedded in the binary.
1124
- Activate plugins via repo signals (paths/globs).
1225
- Support check types: rule-set, gates, state-rules, agent prompts.
13-
- Maintain deterministic check ordering.
26+
- Maintain deterministic plugin and check ordering.
27+
28+
## Inputs
29+
30+
- PRD goals for an extensible plugin system and built-in Helix plugin.
31+
- Repository signals used to activate plugins.
32+
- Built-in plugin manifests shipped with the CLI.
1433

1534
## Acceptance Criteria
1635

1736
- Helix plugin activates when `docs/helix/` exists.
1837
- Gate and state rules run without custom config.
1938
- Agent prompts emit prompt envelopes with callbacks.
39+
- Plugin discovery and ordering are deterministic for a given repo state.
40+
41+
## Gaps & Conflicts
42+
43+
- The PRD does not define the plugin manifest schema, validation rules, or
44+
where manifests live on disk versus embedded in the binary.
45+
- The activation signal format (paths/globs), precedence rules, and failure
46+
behavior are unspecified.
47+
- The supported check types (rule-set, gates, state-rules, agent prompts) are
48+
listed here but lack definitions and lifecycle requirements.
49+
- The scope of the Helix plugin's doc and gate validation is not specified
50+
(which checks, inputs, or outputs it owns).
51+
- No conflicts identified in the provided inputs.
2052

2153
## Traceability
2254

2355
- Supports adoption success metric by enabling reuse across repos.
56+
- Supports PRD scope for a built-in Helix plugin for doc and gate validation.
57+
- Supports PRD scope for an extensible plugin system for future workflows.
58+
- Supports deterministic output goals by requiring stable plugin discovery.
2459
- Primary personas: agent operators and engineering leads.
Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,73 @@
1+
---
2+
dun:
3+
id: F-004
4+
depends_on:
5+
- helix.prd
6+
review:
7+
self_hash: f0ee8193702c1900c29140bab9213036a72b8ba2c411b55bfb63c03a23329d3e
8+
deps:
9+
helix.prd: 58d3c4be8edb0a0be9d01a3325824c9b350f758a998d02f16208525949c4f1ad
10+
---
111
# Feature Spec: F-004 Install Command
212

313
## Summary
414

5-
Provide a `dun install` command that inserts AGENTS.md guidance for agent loops.
15+
Provide a `dun install` command that seeds AGENTS guidance and default Dun
16+
configuration in a repository.
617

718
## Requirements
819

9-
- Idempotently insert a Dun tool snippet in AGENTS.md.
10-
- Support `--dry-run` to show planned changes.
11-
- Avoid destructive edits; use marker blocks.
20+
- Provide a local CLI command named `dun install`.
21+
- Seed AGENTS guidance in the target repo using a marker-delimited template.
22+
- Create `.dun/config.yaml` when missing.
23+
- Be idempotent and safe to re-run.
24+
- Support `--dry-run` to show planned changes without writing.
25+
- Keep output deterministic and agent-friendly.
26+
27+
## Gaps & Conflicts
28+
29+
- The PRD does not mention creating `.dun/config.yaml`; confirm this behavior
30+
remains desired.
31+
- There is no defined backup or undo behavior for AGENTS edits.
32+
- The install command only targets the repo root; no guidance exists for
33+
multi-root or monorepo installs.
34+
35+
## Template
36+
37+
`dun install` inserts or updates the following marker-delimited block in
38+
`AGENTS.md`:
39+
40+
```
41+
<!-- DUN:BEGIN -->
42+
- **dun**: Development quality checker with autonomous loop support
43+
44+
Quick commands:
45+
- `dun check` - Run all quality checks
46+
- `dun check --prompt` - Get work list as a prompt (pick ONE task, complete it, exit)
47+
- `dun loop --harness claude` - Run autonomous loop with Claude
48+
- `dun loop --harness gemini` - Run autonomous loop with Gemini
49+
- `dun help` - Full documentation
50+
51+
Autonomous iteration pattern:
52+
1. Run `dun check --prompt` to see available work
53+
2. Pick ONE task with highest impact
54+
3. Complete that task fully (edit files, run tests)
55+
4. Exit - the loop will call you again for the next task
56+
<!-- DUN:END -->
57+
```
58+
59+
## Insertion Rules
60+
61+
- If `AGENTS.md` already contains the marker block, replace the block content.
62+
- If `AGENTS.md` contains a `## Tools` header, insert the block immediately
63+
after the header (preserve existing content).
64+
- Otherwise, append a new `## Tools` section with the block at the end.
1265

1366
## Acceptance Criteria
1467

15-
- `dun install` writes AGENTS.md if missing.
16-
- `dun install --dry-run` shows planned steps without changes.
17-
- Re-running `dun install` is safe and idempotent.
68+
- `dun install` is available in the CLI and documents its usage.
69+
- Running `dun install` creates `.dun/config.yaml` when missing.
70+
- Running `dun install` results in AGENTS guidance being seeded in the repo
71+
using the defined template and insertion rules.
72+
- Re-running `dun install` does not change files when no updates are needed.
73+
- `dun install --dry-run` emits the planned steps without writing.

docs/helix/01-frame/features/F-005-git-hygiene.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
---
2+
dun:
3+
id: F-005
4+
depends_on:
5+
- helix.prd
6+
review:
7+
self_hash: b98c3a3624a6c461688e617b70892cd2bbb0cf1b990ebefdbf350ee1fa8c6cdc
8+
deps:
9+
helix.prd: 58d3c4be8edb0a0be9d01a3325824c9b350f758a998d02f16208525949c4f1ad
10+
---
111
# Feature Spec: F-005 Git Hygiene and Hook Checks
212

313
## Summary
@@ -16,7 +26,16 @@ committing after manual approval.
1626
command.
1727
- If a hook tool is configured but missing, emit a warning with a clear next
1828
step (install tool or skip).
19-
- Keep the check fast and local-only.
29+
- Keep the check fast, local-only, and deterministic.
30+
31+
## Gaps & Conflicts
32+
33+
- Exit code behavior for warning-only checks is not defined in the PRD or
34+
F-015; confirm whether warnings should still return exit code 0.
35+
- Hook support beyond lefthook and pre-commit (for example, husky or
36+
lint-staged) is not specified.
37+
- The PRD does not specify whether a dirty working tree should be a warning or
38+
failure; this spec defaults to **warn** so other checks can still run.
2039

2140
## Detection
2241

@@ -31,7 +50,7 @@ committing after manual approval.
3150

3251
- Use `git status --porcelain` to detect uncommitted changes.
3352
- **Pass**: no changes.
34-
- **Fail**: working tree dirty; include a list of changed paths in issues.
53+
- **Warn**: working tree dirty; include a list of changed paths in issues.
3554

3655
### Hook Check (Optional)
3756

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
1+
---
2+
dun:
3+
id: F-006
4+
depends_on:
5+
- helix.prd
6+
review:
7+
self_hash: c0cc87165a06f1ff8b90f446f9ae6723319287c7645b0f1659aa3ee618eb4962
8+
deps:
9+
helix.prd: 58d3c4be8edb0a0be9d01a3325824c9b350f758a998d02f16208525949c4f1ad
10+
---
111
# Feature Spec: F-006 Doc and Code Reconciliation
212

313
## Summary
414

5-
Detect documentation drift across the Helix stack and propose downstream
6-
changes from PRD to implementation.
15+
Detect documentation and implementation drift across the Helix stack and emit
16+
a deterministic, ordered reconciliation plan for downstream updates.
717

818
## Requirements
919

10-
- Compare PRD, feature specs, user stories, design docs, ADRs, test plans, and
11-
implementation for drift.
12-
- Emit a structured plan that lists required downstream updates.
13-
- Support both documentation-only drift and implementation drift.
14-
- Keep the analysis deterministic and reproducible.
20+
- Build a deterministic inventory of artifacts: PRD, feature specs, user
21+
stories, design docs, ADRs, test plans, and implementation markers.
22+
- Detect drift types: missing artifacts, stale artifacts due to upstream
23+
changes, and implementation drift relative to docs.
24+
- Emit a structured reconciliation plan as ordered issues with clear next
25+
steps per artifact.
26+
- Order the plan from upstream to downstream so operators update artifacts in
27+
dependency order.
28+
- Support automation modes for reconciliation (plan vs yolo) as part of the
29+
run context.
30+
- Keep the analysis deterministic and reproducible for the same repo state.
1531

1632
## Inputs
1733

@@ -21,10 +37,33 @@ changes from PRD to implementation.
2137
- `docs/helix/02-design/**/*.md`
2238
- `docs/helix/03-test/test-plan.md`
2339
- Source code paths (e.g., `cmd/`, `internal/`) as needed by the agent
40+
- Automation mode configuration (CLI/config) for plan vs yolo behavior
2441

2542
## Acceptance Criteria
2643

2744
- When a PRD change is detected, Dun emits a drift plan listing impacted
28-
artifacts in order.
45+
artifacts in deterministic dependency order.
46+
- The plan includes updates for feature specs, design docs, ADRs, test plans,
47+
and implementation artifacts; user stories are included when present.
2948
- Drift output is structured as issues with clear next steps.
30-
- The plan traces updates all the way to implementation and tests.
49+
- Automation mode `plan` emits the reconciliation plan without edits; `yolo`
50+
allows agents to complete missing artifacts per policy.
51+
52+
## Gaps & Conflicts
53+
54+
- Conflicts: none identified in the provided inputs.
55+
- Missing definition of the drift detection method (hashing, stamps, or diff
56+
strategy) and how implementation drift is identified.
57+
- Missing ordering rules for artifacts at the same layer and how user stories
58+
interleave with feature specs.
59+
- Missing plan schema (fields, IDs, severity) and mapping to output formats
60+
(prompt envelopes vs JSON).
61+
- Missing rules for code scope selection and how much code context to include.
62+
- Dependencies: automation mode policy (F-007), doc dependency tracking
63+
(F-016), and output format rules (F-002).
64+
65+
## Traceability
66+
67+
- Supports PRD goals for deterministic, agent-friendly output and doc-to-code
68+
reconciliation with plan and yolo modes.
69+
- Supports US-005 by emitting ordered downstream updates from PRD changes.

0 commit comments

Comments
 (0)