$npx -y skills add jmxt3/gitscape.ai --skill source-driven-developmentGrounds every implementation decision in official documentation. Use when you want authoritative, source-cited code free from outdated patterns. Use when building with any framework or library where correctness matters.
| 1 | # Source-Driven Development |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Every framework decision and library usage should be grounded in official documentation. AI agents have training cutoffs and can produce outdated, deprecated, or hallucinated API patterns. Source-driven development means: **verify before you code, cite what you verified, and flag what you couldn't confirm.** |
| 6 | |
| 7 | ## When to Use |
| 8 | |
| 9 | - Using any external library or framework |
| 10 | - Implementing a pattern that isn't already established in the codebase |
| 11 | - Unsure whether an API or approach is current |
| 12 | - Seeing a pattern that looks right but isn't confirmed in the existing codebase |
| 13 | |
| 14 | ## The Process |
| 15 | |
| 16 | ### Step 1: Identify What Needs Verification |
| 17 | |
| 18 | Before writing any code that uses an external library: |
| 19 | |
| 20 | 1. List the specific APIs, functions, or patterns you plan to use |
| 21 | 2. Note the version you're targeting (check `requirements.txt`, `package.json`, or `pyproject.toml`) |
| 22 | 3. Flag anything you're not 100% confident is current |
| 23 | |
| 24 | ### Step 2: Verify in Official Sources |
| 25 | |
| 26 | **Priority order for sources:** |
| 27 | 1. **Official docs** — the library's own documentation site |
| 28 | 2. **Official GitHub** — the library's `README.md`, `CHANGELOG.md`, or `examples/` |
| 29 | 3. **Release notes** — for the specific version in use |
| 30 | 4. **Existing codebase** — how the library is already used in this project |
| 31 | |
| 32 | **Never use as authoritative sources:** |
| 33 | - Stack Overflow answers (can be outdated) |
| 34 | - Blog posts (may target a different version) |
| 35 | - Your own training knowledge without verification |
| 36 | - ChatGPT or other AI outputs as a source of truth |
| 37 | |
| 38 | ### Step 3: Cite Your Sources |
| 39 | |
| 40 | When writing code that uses verified patterns, leave a reference comment for future maintainers: |
| 41 | |
| 42 | ```python |
| 43 | # FastAPI dependency injection pattern |
| 44 | # Source: https://fastapi.tiangolo.com/tutorial/dependencies/ |
| 45 | async def get_db() -> AsyncGenerator[AsyncSession, None]: |
| 46 | async with AsyncSessionLocal() as session: |
| 47 | yield session |
| 48 | ``` |
| 49 | |
| 50 | ```typescript |
| 51 | // React Query v5 data fetching |
| 52 | // Source: https://tanstack.com/query/v5/docs/framework/react/guides/queries |
| 53 | const { data, isLoading } = useQuery({ |
| 54 | queryKey: ['skills', repoId], |
| 55 | queryFn: () => fetchSkills(repoId), |
| 56 | }); |
| 57 | ``` |
| 58 | |
| 59 | ### Step 4: Flag What You Couldn't Verify |
| 60 | |
| 61 | If you're using a pattern you cannot confirm is current, say so explicitly: |
| 62 | |
| 63 | ```python |
| 64 | # NOTE: Verify this middleware pattern against the current FastAPI docs. |
| 65 | # Used based on prior codebase patterns — may have changed in recent versions. |
| 66 | app.add_middleware(GZipMiddleware, minimum_size=1000) |
| 67 | ``` |
| 68 | |
| 69 | And note it in the PR description or task update. |
| 70 | |
| 71 | ## GitScape-Specific Sources |
| 72 | |
| 73 | For the GitScape stack, always verify against: |
| 74 | |
| 75 | | Technology | Official Source | |
| 76 | |---|---| |
| 77 | | FastAPI | https://fastapi.tiangolo.com/ | |
| 78 | | Google Gen AI SDK (Python) | https://googleapis.github.io/python-genai/ | |
| 79 | | Google Cloud Run | https://cloud.google.com/run/docs | |
| 80 | | GitHub API (PyGithub) | https://pygithub.readthedocs.io/ | |
| 81 | | React / TypeScript | https://react.dev/ | |
| 82 | | Vite | https://vitejs.dev/ | |
| 83 | | Cloud Build | https://cloud.google.com/build/docs | |
| 84 | |
| 85 | Check the version in `api/requirements.txt` and `web/package.json` before citing docs for a specific version. |
| 86 | |
| 87 | ## Anti-Patterns to Avoid |
| 88 | |
| 89 | | Anti-Pattern | Why It Fails | |
| 90 | |---|---| |
| 91 | | Using an API without checking the version | Libraries break across major versions | |
| 92 | | Copying a pattern from memory | Training data may lag 12-24 months behind current releases | |
| 93 | | "This looks right" as verification | Looks right ≠ is right | |
| 94 | | Citing an AI as a source | AI outputs require human-verified sources, not circular citation | |
| 95 | |
| 96 | ## Common Rationalizations |
| 97 | |
| 98 | | Rationalization | Reality | |
| 99 | |---|---| |
| 100 | | "I know this library well" | APIs change. Verify. The minute spent checking prevents the hour debugging. | |
| 101 | | "I'll verify later" | You won't. And by then the wrong pattern is baked in. | |
| 102 | | "The existing code uses this pattern" | Great — that's evidence. Check if the existing usage is from a current dependency version. | |
| 103 | |
| 104 | ## Red Flags |
| 105 | |
| 106 | - Library usage with no reference to a source |
| 107 | - Patterns that differ from every other usage in the codebase without explanation |
| 108 | - Using a deprecated API (check for deprecation warnings in docs) |
| 109 | - Citing a blog post or Stack Overflow answer as the source |
| 110 | |
| 111 | ## Verification |
| 112 | |
| 113 | After writing code that uses external libraries: |
| 114 | |
| 115 | - [ ] Every external API usage is confirmed in official docs or the existing codebase |
| 116 | - [ ] The docs version matches the version in `requirements.txt` / `package.json` |
| 117 | - [ ] Unverified patterns are explicitly flagged with a `# NOTE: verify` comment |
| 118 | - [ ] No deprecated APIs are used (or if used, the deprecation is documented) |