复制安装命令
用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。
复制前请先查看来源、License 和安全提示。
docflow gives your AI coding assistant a memory. It creates a small set of Markdown
用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。
复制前请先查看来源、License 和安全提示。
来源文件:README.md
docflow gives your AI coding assistant a memory. It creates a small set of Markdown files in your project — a place for what the product does, how it's built, why choices were made, and what shipped each month. Every time you start a session, your assistant reads the latest of these automatically, so it already knows the project instead of guessing. No database, no service to run — just text files and a few small Bash scripts.
Status: early MVP developer tool. This is not a document approval, e-signature, or workflow-analytics SaaS.
Full glossary: docs/references/glossary.md.
/docflow:doctor. It looks at your repo and tells you
the one command to run next.You don't have to choose between setup paths yourself — doctor decides. (If you want to:
init for an empty repo, adopt if docs already exist, repair to refresh an existing
docflow setup.)
Every docflow capability works two ways — pick whichever feels natural:
/docflow:check, /docflow:doctor, /docflow:validate, …SessionStart hook.AGENTS.md.Example scaffold output is committed under examples/basic-repo.
Minimal flow:
bash scripts/scaffold.sh --target /path/to/repo --docs-root docs --project "My App"
cd /path/to/repo
find docs -maxdepth 2 -type f | sort
CLAUDE_PROJECT_DIR="$PWD" bash /path/to/docflow/hooks/docflow-context.sh
Expected result:
docs/README.md becomes the human-readable documentation index.docs/INDEX.md becomes the compact path-to-purpose map agents read first.docs/changelog/ holds monthly shipped-work memory.AGENTS.md tells Codex and other repo-aware agents where to start.| Folder | Answers | Naming |
|---|---|---|
product-spec/ | What a feature does for users | NN-topic.md |
specs/ | How it is built | (mmm-yy)-topic.md |
decisions/ | Why a choice was made | NNNN-title.md |
references/ | Rules, conventions, cheat sheets | topic.md |
plans/ | Roadmap and work status | (mmm-yy)-name.md, upcoming/* |
reviews/ | Quality, audits, known bugs | (mmm-yy)-topic.md, bugs/ |
changelog/ | What shipped by month | (mmm-yy).md |
Full naming rules ship in templates/NAMING.md.
Use this section to install docflow for each agent. Replace /path/to/docflow with your local clone path, for example /Users/Adem/Desktop/migration/docflow.
Recommended setup flow in any repo:
Claude Code has native plugin support.
Install from a local checkout inside Claude Code:
/plugin marketplace add /path/to/docflow
/plugin install docflow
Or from GitHub:
/plugin marketplace add https://github.com/MedAdemBHA/docflow
/plugin install docflow
Verify:
/plugin list
/plugin details docflow@docflow
Use in a target repo:
| Need | Command | What it does |
|---|---|---|
| Check readiness | /docflow:check | Shows one status and the exact next command |
| Inspect docs state | /docflow:doctor | Read-only scan; recommends init, adopt, or repair |
| New repo docs | /docflow:init | Creates the docs tree only when no meaningful docs exist |
| Existing docs | /docflow:adopt | Adds docflow around current user-authored docs without rewriting them |
| Fix generated docs helpers | /docflow:repair | Regenerates INDEX.md, installs helpers, reports link/placeholders |
| Validate docs before completion | /docflow:validate | Fails on blocking doc issues and reports metadata/update-log cleanup warnings |
| Find the right doc | /docflow:router | Routes a question to one doc before reading code |
| Write a doc | /docflow:author | Creates a doc in the right folder with the right name |
| Record shipped work | /docflow:changelog | Adds an entry to the monthly changelog |
| Plan a feature | /docflow:feature-plan <msg> | Creates or updates plans/features/(mmm-yy)-<slug>.md |
| Describe product behavior | /docflow:product-spec <msg or code path> | Creates or updates product-spec/ WHAT docs |
| Draft from code signals | /docflow:scan | Generates spec/roadmap drafts from code, TODOs, and git churn |
All commands are namespaced as /docflow:<name> — type /docflow: to see them all.
Examples:
/docflow:feature-plan add team comments to documents
/docflow:product-spec src/features/comments
After updating a local plugin, run /reload-plugins in Claude Code before testing new commands.
The Claude plugin also installs a read-only SessionStart hook. On new sessions it prints the docs map and newest valid changelog month when the repo has docflow.json.
This repository includes a Codex plugin manifest at .codex-plugin/plugin.json, but there is no public Codex marketplace entry yet.
Use it today as a local/native marketplace source:
codex plugin marketplace add /path/to/docflow
Enable the plugin in ~/.codex/config.toml if your Codex build does not add an enabled plugin entry automatically:
[plugins."docflow@docflow"]
enabled = true
If your Codex CLI rejects service_tier = "default", start Codex with:
codex -c 'service_tier="fast"'
Use in a target repo:
Use the doctor skill to inspect this repo.
Use the init skill to initialize docflow in this repo.
If docs already exist:
Use the adopt skill to adopt this repo into docflow.
For maintenance:
Use the repair skill to regenerate the docs map and check links.
Only after docflow is published to a Codex marketplace does this command become a ready-to-run install step:
codex plugin add docflow@<marketplace-name>
Gemini does not use the Claude/Codex plugin manifests in this repository. Use docflow by scaffolding repo-level guidance files:
bash /path/to/docflow/scripts/scaffold.sh --target /path/to/repo --docs-root docs --project "Project Name"
Then open the target repo in Gemini and tell it to read:
Read GEMINI.md, then follow AGENTS.md before making changes.
The scaffolded GEMINI.md points back to AGENTS.md, which routes Gemini to docs/README.md, docs/INDEX.md, and the changelog.
Cursor does not use the Claude/Codex plugin manifests in this repository. Use the scaffolded .cursorrules and AGENTS.md:
bash /path/to/docflow/scripts/scaffold.sh --target /path/to/repo --docs-root docs --project "Project Name"
Then open the target repo in Cursor. .cursorrules points Cursor to AGENTS.md, and AGENTS.md tells it how to route questions through the docs tree.
For any agent or editor, the reliable setup path is the scaffold script:
bash /path/to/docflow/scripts/docflow-doctor.sh --target /path/to/repo
bash /path/to/docflow/scripts/scaffold.sh --target /path/to/repo --docs-root docs --project "Project Name"
cd /path/to/repo
bash scripts/check-links.sh docs
CLAUDE_PROJECT_DIR="$PWD" bash /path/to/docflow/hooks/docflow-context.sh
Expected output:
docs/ contains the 7-category doc tree.docflow.json points agents to the docs root and changelog.AGENTS.md, GEMINI.md, and .cursorrules exist at repo root.Use these script commands for existing repos:
bash /path/to/docflow/scripts/docflow-adopt.sh --target /path/to/repo --docs-root docs --project "Project Name"
bash /path/to/docflow/scripts/docflow-repair.sh --target /path/to/repo
bash /path/to/docflow/scripts/docflow-validate.sh --target /path/to/repo
docflow asks users to install an AI-agent plugin and run Bash. That deserves explicit proof.
shellcheck on scripts and hooks.SessionStart hook is read-only and prints truncated docs context only.Run checks locally:
bash scripts/test-scaffold.sh
for t in tests/*.sh; do bash "$t"; done
shellcheck scripts/*.sh hooks/*.sh tests/*.sh
docflow/
├── .claude-plugin/ # Claude plugin manifest
├── .codex-plugin/ # Codex plugin manifest
├── .github/workflows/ # CI
├── commands/ # Claude slash commands
├── examples/basic-repo/ # Filled example output
├── hooks/ # SessionStart context hook
├── repo-templates/ # AGENTS.md, GEMINI.md, .cursorrules
├── scripts/ # doctor, adopt, repair, scaffold, map, generators, tests
├── skills/ # doctor/check/init/adopt/repair/validate/router/author/changelog
└── templates/ # generic docs skeletons
| Agent | Support level | How it works |
|---|---|---|
| Claude Code | Primary | Slash commands, skills, and read-only SessionStart context hook |
| Codex | Manifest + repo guidance | Codex plugin manifest, skills, and scaffolded AGENTS.md |
| Gemini / Cursor | Repo guidance | Scaffolded GEMINI.md and .cursorrules point back to AGENTS.md |
The portable product is the docs tree and workflow. The plugin runtime is agent-specific.
docs/README.md and product-spec/00-overview.md.Before presenting this as a polished public tool:
Documentation memory for AI coding agents.claude-code, codex, documentation, changelog, adr, ai-agents, developer-tools.See CONTRIBUTING.md.
This repo dogfoods its own docs system. Browse the knowledge base at docs/README.md — start with docs/INDEX.md for the full path → purpose map.
See CHANGELOG.md.
MIT - see LICENSE.
name: router
description: 'Find the right doc before reading code. Use when asked "where is X documented", "is there a spec/ADR for X", "what''s the roadmap", "open bugs", "read the docs about X", or "share the docs".'Project-agnostic. No hardcoded tree — discover, then route. Works in any repo.
Run a cheap scan to learn what this project has. Cache the result mentally for the session.
# docs roots + entry points
ls README* CONTRIBUTING* 2>/dev/null
fd -t d -d 2 -i 'docs?|spec|adr|decisions|wiki|reference' 2>/dev/null \
|| find . -maxdepth 3 -type d \( -iname 'docs' -o -iname 'spec*' -o -iname 'adr' -o -iname 'decisions' \) -not -path '*/node_modules/*'
# the markdown tree under the main docs dir (swap <DOCS> for what you found)
fd -e md . <DOCS> 2>/dev/null | head -80 || find <DOCS> -name '*.md' | head -80
If a hand-maintained index exists (<DOCS>/README.md, SUMMARY.md, mkdocs.yml, docusaurus.config.*), read that — it's the authoritative map. Don't rebuild what the maintainer already wrote.
Match the question's shape to a folder by its conventional name, then Read that one doc. Don't bulk-read the tree.
| Question shape | Look in (by conventional name) |
|---|---|
| "What does feature X do?" (user-facing) | product-spec/, docs/features/, top-level README |
| "How is X implemented / data flow / API contract?" | specs/, docs/architecture/, design/ |
| "Why did we choose X?" | decisions/, adr/, docs/adr/ (ADR files) |
| "How do I do X / convention for X?" | references/, docs/guides/, CONTRIBUTING.md |
| "What's planned / status of X?" | plans/, roadmap/, docs/roadmap/, project board |
| "Known issues / open bugs?" | reviews/bugs/, ISSUES.md, GitHub issues |
| "What shipped recently?" | CHANGELOG.md, changelog/, releases |
If names don't match these, fall back to the discovered index from step 1.
Three layers — do whichever the user asked for.
Project skills live at .claude/skills/<name>/SKILL.md and are checked into git — anyone who pulls + uses Claude Code gets them automatically, zero setup.
mkdir -p .claude/skills/router
cp ~/.claude/skills/router/SKILL.md .claude/skills/router/SKILL.md # or author a project-tuned copy
git add .claude/skills/router && git commit -m "docs: add docs router skill"
~/.claude/skills/) = only you, every project..claude/skills/ in repo) = whole team, this repo. Commit it to share.<DOCS>/README.md index with relative links to every doc — GitHub renders it; links are clickable in the web UI.README.md pointing at <DOCS>/.For a teammate who'll use Claude Code: create an ONBOARDING.md at repo root (point them at <DOCS>/ + the skills), then use the ShareOnboardingGuide tool to upload it and get a link they open in Claude Code. Generic and project-agnostic.
This skill is intentionally project-agnostic — it lives in ~/.claude/skills/ so it loads in every repo. To specialize it for one project, copy it into that repo's .claude/skills/ and replace step 1's discovery with the project's actual doc tree (like a hand-written router).
评论 (0)
暂无评论,成为第一个评论者吧!