Skip to content

Add /document-feature slash command - #21

Open
andre-crator wants to merge 1 commit into
juleswhite:mainfrom
andre-crator:add-document-feature-command
Open

Add /document-feature slash command#21
andre-crator wants to merge 1 commit into
juleswhite:mainfrom
andre-crator:add-document-feature-command

Conversation

@andre-crator

Copy link
Copy Markdown

Summary

Adds /document-feature, a slash command that generates paired documentation for an existing feature in a project:

  • docs/dev/<slug>-implementation.md — technical write-up: overview, files involved (with paths/line refs), architecture and data flow, API/interfaces, data models, implementation notes, dependencies, and tests.
  • docs/user/how-to-<slug>.md — plain-language user guide: what the feature does, step-by-step instructions with [SCREENSHOT: ...] placeholders at each state change, and a troubleshooting section sourced from real error messages in the code.

Key behaviors:

  • Normalizes the feature name into a kebab-case slug used consistently across both file names.
  • Searches the codebase (Glob/Grep) for the feature before writing anything — if nothing matches, it stops, lists what it searched for, suggests partial matches if any, and asks the user instead of inventing content.
  • Detects and follows existing documentation conventions in the repo (docs/dev/, docs/user/, or a style guide) if present.
  • Warns before overwriting existing docs at the target paths.

Also updates README.md (previously just a one-line title) with a Commands table and install/usage instructions, so the command is discoverable.

Test plan

  • Ran the command against a real feature in a separate project (an expense-tracker export flow) and confirmed it produced accurate, non-hallucinated docs, correctly stopped and asked when pointed at a feature that didn't exist yet, and warned before overwriting existing docs.

Generates paired documentation for an existing feature: a technical
write-up (files involved, data flow, API, data models, tests) in
docs/dev/, and a plain-language user guide with step-by-step
instructions and screenshot placeholders in docs/user/. Locates the
feature by searching the codebase for it first, and asks for
clarification instead of inventing content when nothing matches.

Also updates the README with a Commands table and install/usage
instructions, since it only had a one-line title before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant