Docs framework

From dean0x/devflow · View interactive version

Docs framework is an AI agent skill from the GitHub repository dean0x/devflow. Use when creating files in the .devflow/docs/ directory.

How to use this skill

Skill file

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.

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:

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

Agents That Don't Persist

Implementation Checklist

When creating or modifying persisting agents or commands:

Extended References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.