-
Notifications
You must be signed in to change notification settings - Fork 0
feat: zero-config project documentation auto-discovery #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cc0f568
c0bc691
2b1c7e2
e272fb7
df09e4e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,74 @@ | ||||||
| --- | ||||||
| name: project-docs-discovery | ||||||
| description: Auto-discover and consult project-specific documentation before development tasks. | ||||||
| version: 1.0.0 | ||||||
| triggers: [review, plan, create, enhance, debug, design, architecture, compliance, screen, component] | ||||||
| --- | ||||||
|
|
||||||
| # Project Docs Discovery | ||||||
|
|
||||||
| > **Purpose**: Automatically find and reference project-specific documentation so workflows produce output aligned with the project's design system, architecture, and guidelines — without manual prompting. | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Discovery Algorithm | ||||||
|
|
||||||
| At the start of any workflow that modifies or evaluates code, execute these steps: | ||||||
|
|
||||||
| ### Step 1: Scan for documentation | ||||||
|
|
||||||
| Use Glob to find project docs: | ||||||
|
|
||||||
| ``` | ||||||
| Glob("docs/**/*.md") | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||
| ``` | ||||||
|
|
||||||
| Also check project root for: `ARCHITECTURE.md`, `COMPLIANCE.md`, `DESIGN.md`, `SECURITY.md` | ||||||
|
|
||||||
|
Comment on lines
+20
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Documentation mismatch: code scans more directories than documented. The SKILL.md only mentions 📝 Suggested documentation update Use Glob to find project docs:
-Glob("docs//*.md") 🤖 Prompt for AI Agents |
||||||
| If no results found — **skip remaining steps silently**. Do not mention missing docs. | ||||||
|
|
||||||
| ### Step 2: Classify by relevance to current task | ||||||
|
|
||||||
| | Task Domain | Priority Docs | Why | | ||||||
| |---|---|---| | ||||||
| | Frontend/UI | `docs/design-system/`, `docs/screens/`, `SCREENS-INVENTORY.md` | Component consistency, token compliance | | ||||||
| | Security | `COMPLIANCE.md`, `docs/design-system/accessibility.md` | Regulatory and a11y requirements | | ||||||
| | Planning | `docs/epics/`, `ROADMAP.md`, `SPRINT*.md` | Feature scope and priorities | | ||||||
| | Backend/API | `docs/api-docs/`, `ARCHITECTURE.md` | API contracts and system design | | ||||||
| | Architecture | `ARCHITECTURE.md`, `docs/architecture/` | System design decisions | | ||||||
| | Any task | `ARCHITECTURE.md` | Always relevant for system context | | ||||||
|
|
||||||
| ### Step 3: Read top 3-5 most relevant docs (context-aware) | ||||||
|
|
||||||
| Budget rules to preserve context window: | ||||||
|
|
||||||
| - **Design system files** (tokens, components, patterns): read **FULLY** — they define hard constraints | ||||||
| - **Architecture docs** (>200 lines): read **first 100 lines** for system overview | ||||||
| - **Epic/screen specs**: read **only the section** relevant to the current task | ||||||
| - **Total context budget**: ~800 lines max across all discovered docs | ||||||
|
|
||||||
| Skip directories: | ||||||
| - `docs/archives/` — historical only | ||||||
| - `docs/research/` — exploratory only | ||||||
|
|
||||||
| ### Step 4: Reference in output | ||||||
|
|
||||||
| Cite specific constraints from discovered docs in your output. | ||||||
|
|
||||||
| Examples: | ||||||
| - "Per `design-system/tokens.md`, spacing uses 4px base unit" | ||||||
| - "Per `ARCHITECTURE.md`, data layer uses Repository pattern" | ||||||
| - "Per `COMPLIANCE.md`, PII must be encrypted at rest" | ||||||
|
|
||||||
| ### Step 5: Graceful no-docs handling | ||||||
|
|
||||||
| If Glob returns zero results and no root-level doc files exist, skip this discovery entirely. Do not mention missing docs to the user. Not all projects have a `docs/` directory. | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## When NOT to discover | ||||||
|
|
||||||
| - `/deploy` — deployment procedures, not code evaluation | ||||||
| - `/upgrade` — framework upgrade, not project code | ||||||
| - `/pr-merge` — merge mechanics, not code analysis | ||||||
| - Any project with no `docs/` directory — auto-skipped | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,7 +3,7 @@ description: Pre-task research and validation protocol. Market research, gap ana | |||||
| args: feature name | ||||||
| version: 2.1.0 | ||||||
| sdlc-phase: discover | ||||||
| skills: [brainstorming] | ||||||
| skills: [brainstorming, project-docs-discovery] | ||||||
| commit-types: [docs, chore] | ||||||
| --- | ||||||
|
|
||||||
|
|
@@ -18,7 +18,7 @@ commit-types: [docs, chore] | |||||
|
|
||||||
| ## Critical Rules | ||||||
|
|
||||||
| 1. No implementation without validated research | ||||||
| 1. No implementation without validated research — review project `ROADMAP.md` and architecture docs for alignment | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 21 makes 💡 Suggested fix (workflow-side, low-risk)-1. No implementation without validated research — review project `ROADMAP.md` and architecture docs for alignment
+1. No implementation without validated research — review roadmap and architecture documentation discovered in the project for alignment💡 Suggested fix (discovery-side, if explicit ROADMAP.md support is intended) const ROOT_DOC_FILES = Object.freeze([
'ARCHITECTURE.md',
'COMPLIANCE.md',
'DESIGN.md',
+ 'ROADMAP.md',
'SECURITY.md',
]);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| 2. All claims backed by market data or competitor analysis | ||||||
| 3. Ethics gate — privacy, bias, automation risks evaluated | ||||||
| 4. Approval required before proceeding | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment here indicates there are 9 modular governance rules, but this pull request increases the count to 10. Other parts of the documentation in this PR have been updated to reflect this. For consistency, this comment should also be updated.