Skip to content
Back to skills

Docs Framework

ASecurity

Use when creating files in the .devflow/docs/ directory.

  • 23 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 3, 2026
toolsshellbashnodecode-reviewgitsecuritydocumentation

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add dean0x/devflow --skill docs-framework --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Docs Framework?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Docs Framework
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dean0x-docs-framework/badge)](https://www.skillsdirectory.com/skills/dean0x-docs-framework)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: docs-framework
description: Use when creating files in the .devflow/docs/ directory.
user-invocable: false
allowed-tools: Read, Bash, Glob
---

# Documentation Framework

The canonical source for what Devflow names under `.devflow/docs/`. A command that writes or looks up a doc path follows it, and the one place a command differs is stated here as an exception, never left implicit.

## Iron Law

> **ALL ARTIFACTS FOLLOW NAMING CONVENTIONS**
>
> A run directory is `YYYY-MM-DD_HHMM` in local time; a second run in the same minute takes
> seconds (`YYYY-MM-DD_HHMMSS`). Branch slugs replace `/` with `-`. Topic slugs are lowercase
> alphanumeric with single dashes, at most 50 characters. The exceptions are the ones listed
> under Naming Conventions, and no others. Follow the pattern or fix the pattern for everyone.

## Directory Structure

All generated documentation lives under `.devflow/docs/` at the checkout's toplevel:

```
.devflow/docs/
├── reviews/{branch-slug}/              # /code-review, per branch
│   └── {timestamp}/                   # one directory per review
│       ├── {focus}.md                 # Review agent report (security.md, architecture.md, ...)
│       ├── review-summary.md          # Synthesize agent output
│       ├── {pr-description,prior-resolutions}.txt  # /code-review: passed to agents by path
│       ├── resolution-summary.md      # /resolve
│       ├── evidence.md                # /resolve: appended test-plan claims
│       └── stale-plan.md              # /resolve: stale test-plan lines
├── bug-analysis/{branch-slug}/         # /bug-analysis, per branch
│   └── {timestamp}/
│       ├── {focus}.md                 # Debug agent report
│       ├── static-findings.md         # Top 50 static findings and the status of each tool
│       ├── {tool}.sarif               # Scanner SARIF file (semgrep, snyk, codeql); snyk-all.json is Snyk before its scope filter, changed.z the changed names for that filter
│       ├── codeql.log                 # CodeQL output, kept out of the call output
│       ├── findings.tsv               # Every static finding, one row each; findings-{tool}.tsv holds one tool's rows, findings-top.tsv the top 50
│       ├── bug-analysis-summary.md    # Synthesize agent output
│       └── resolution-summary.md      # /resolve (evidence.md and stale-plan.md as in reviews)
├── research/{topic-slug}/{timestamp}/  # /research
│   ├── {type}.md                      # Research agent output (codebase.md, external.md, ...)
│   └── research-summary.md            # Synthesize agent output
├── plan/{timestamp}/                   # /plan, from plan-files.cjs claim
├── design/
│   ├── {ISSUE_ID}-{topic-slug}.{timestamp}.md  # /plan, one issue
│   ├── multi-{topic-slug}.{timestamp}.md       # /plan, several issues (frontmatter issue: pending)
│   └── {topic-slug}.{timestamp}.md             # /plan, no issue
├── handoff-{branch-slug}.md            # Code agent phase handoff; deleted once the PR exists
└── evidence-{branch-slug}.md           # /implement test plan and claims; stays after the PR

.devflow/memory/
├── WORKING-MEMORY.md                   # Note when working memory is on
└── backup.json                         # Pre-compact git state snapshot

.devflow/curation/
├── decisions.md                        # Architectural decisions (ADR-NNN format)
└── pitfalls.md                         # Known pitfalls (PF-NNN format)
```

`{ISSUE_ID}` is the filesystem-safe issue identifier the Git agent emits as `- **Issue ID**:` under `### Handoff Values`. A multi-issue batch fetch returns none, which is why that variant is named `multi-`. Example: `42-jwt-auth.2026-04-07_1430.md`.

The head markers for incremental runs are not part of this tree. `/code-review` and `/bug-analysis` keep each one under the git directory of the worktree, at `<git dir>/devflow/reviews/{branch-slug}/.last-review-head` and `<git dir>/devflow/bug-analysis/{branch-slug}/.last-analysis-head`. `<git dir>` is the path that `git rev-parse --absolute-git-dir` prints, so each worktree has its own markers.

## Naming Conventions

### Timestamps

`YYYY-MM-DD_HHMM`, local time (sortable, readable), computed once per run and reused for every path of that run.
- **Same-minute collision.** `/code-review`, `/bug-analysis`, `/research` and `/plan` create their run directory with `plan-files.cjs claim`: when it already exists, the second run appends seconds (`2025-12-26_143005`). It sorts after its minute, so newest-first listings stay correct.
- A design document's timestamp is the suffix before `.md`, so a listing sorts by that suffix, not by the leading `{ISSUE_ID}`.

### Branch Slugs

The branch name with every `/` replaced by `-`; case, dots and underscores are kept. A detached HEAD has no name and uses `standalone`.
A slug builds a path or reaches a shell only when it matches `^[A-Za-z0-9._-]{1,200}$`. Every command derives `{branch_slug}` (the underscore spelling in `handoff-*` and `evidence-*`) this way, from the branch the work is on.

### Topic Slugs

One rule for every topic `{slug}`: lowercase; each run of characters outside `a-z0-9` becomes one `-`; leading and trailing `-` are trimmed; at most 50 characters (trim again after the cut); `untitled` when nothing is left. A command makes the slug in prose; no shell call takes the topic. It uses the slug only when it matches `^[a-z0-9-]{1,50}$`, else `untitled`. `/plan` and `/research` take `{topic-slug}` from it.

## Helper Functions

Define these inline, in the Bash call that needs them, for consistent naming. `.devflow/docs/` lives at the checkout's toplevel, never under a subdirectory the session started in:

```bash
get_timestamp() { date +%Y-%m-%d_%H%M; }
get_branch_slug() { local b; b=$(git branch --show-current 2>/dev/null); echo "${b:-standalone}" | sed 's/\//-/g'; }
```

Make a run directory, or the `design/` folder, only with `node "$HOME/.devflow/scripts/plan-files.cjs" claim`, never with `mkdir -p`: the script applies the shared folder checks.

## Agent Persistence Rules

### Who Writes What

- **Reviews**: the Review agents and the Synthesize agent (review mode) write into `reviews/{branch-slug}/{timestamp}/`; `/resolve` adds `resolution-summary.md` (Phase 5); `/code-review` overwrites its `.last-review-head` marker, under the git directory, with the HEAD SHA.
- **Bug analysis**: the Debug agents and the Synthesize agent (bug-analysis mode) write into `bug-analysis/{branch-slug}/{timestamp}/`; the scanner calls write the SARIF files, the changed-name list for the Snyk filter and the CodeQL log, and the counts step writes the findings tables, all into that run folder; `/bug-analysis` overwrites its `.last-analysis-head` marker, under the git directory, with the HEAD SHA only when every tool that was to run completed, or `--no-static` is set.
- **Research**: the Research agents write `{type}.md`, and the Synthesize agent (research mode) writes `research-summary.md` through `RESEARCH_BASE_DIR`, both into `research/{topic-slug}/{timestamp}/`.
- **Design**: `/plan` writes the design document, and its Skim, Design and Synthesize agents write `plan/{timestamp}/{agent}-{k}.md`.
- **Handoff and evidence**: `/implement` writes `evidence-{branch-slug}.md`, which stays after the PR, and the handoff file, to which each Code agent appends one phase section and which is deleted once the PR exists.
- **Memory and curation**: The worker updates `WORKING-MEMORY.md` when working memory is on (`devflow memory --enable`). `decisions.md` and `pitfalls.md` come from `decisions-ledger.jsonl` (full active entries; Inactive table).

### Agents That Don't Persist

- Git (fetch-issue: read-only, post-review-summary: consolidated review comment only)
- Code agent (commits to git; its only file is the handoff section it appends when `HANDOFF_FILE` is given)

## Implementation Checklist

When creating or modifying persisting agents or commands:

- [ ] Document output location in agent's final message
- [ ] Update relevant index files

## Extended References

- **[patterns.md](./references/patterns.md)** - Full templates, helper functions, naming examples, edge cases
- **[violations.md](./references/violations.md)** - Common violations with detection patterns and fixes

Files in this skill

  • SKILL.md9.2 KB
  • references/patterns.md8.6 KB
  • references/violations.md5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.