plugins/teamcraft-glgd/skills/analyze-codebase/SKILL.md
Systematically analyze an existing codebase and produce structured artifacts — architecture documentation, component-level rules, ADR candidates, convention comparison, or CLAUDE.md audit. Use when onboarding to a brownfield project, inheriting a codebase, wanting consistent architecture docs, comparing repo practices against team conventions, needing per-component .claude/rules/ files, or auditing an existing CLAUDE.md. Works for any language, framework, or project size.
npx skillsauth add codingthefuturewithai/claude-code-primitives teamcraft-glgd:analyze-codebaseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Produce the foundation artifacts that downstream Teamcraft skills depend on — architecture documentation, component-level rules, ADR candidates — by systematically analyzing an existing codebase. The user decides which artifacts they need, how deep the analysis goes, and what gets written. Everything is reviewed before it's saved.
This skill analyzes an existing codebase and produces foundation artifacts. It does NOT:
capture-conventionssync-claude-mdonboardThe handoff is natural: analyze-codebase produces the foundation, then sync-claude-md maintains it over time.
Before touching the codebase, understand what the user needs. The answer shapes everything — which agents to run, which artifacts to produce, how deep to go.
Common intents:
Ask what they're trying to accomplish and what they want to walk away with. Don't assume — a tech lead standardizing across repos has different needs than a developer who just got assigned a legacy project.
Only resolve Drive when the user's intent involves convention comparison or they mention having team documents in Drive. Do not resolve proactively.
Call mcp__google-drive__list_accounts before any other Drive operation:
account_email explicitly on every Drive tool call.Run the teamcraft-glgd:brownfield-analyzer agent using the Task tool. This gives a fast overview of the codebase — tech stack, structure, patterns, health indicators — without consuming the main conversation's context window with raw exploration.
Present the findings to the user as a structured summary. This serves two purposes: it gives the user immediate orientation, and it informs what deeper analysis (if any) makes sense.
For small codebases (under ~5k LOC or a handful of modules), the quick pass may be sufficient. Ask whether the user wants to go deeper or whether this covers what they need.
Run only what the user's intent requires. Each path below is independent — run one, some, or all based on what was established in the intent conversation.
Run the teamcraft-glgd:architecture-mapper agent using the Task tool. Pass the brownfield-analyzer's findings in the task prompt so the architecture mapper builds on them rather than re-discovering the basics.
When the agent returns, present the architecture documentation to the user for review. See references/example-architecture.md for the structure and depth that good architecture documentation achieves — read it before presenting to the user so you can calibrate the output.
Once approved, write to .teamcraft/architecture.md.
From the architecture mapping (or brownfield analysis if architecture mapping was skipped), identify components that have non-obvious patterns Claude would get wrong. For each component:
Only capture patterns that are NOT visible from a casual read of the code — things Claude would miss or get wrong without guidance. Present proposed rules to the user per component, then write approved rules to .claude/rules/<component-name>.md.
Surface architectural decisions detected from the code — framework choices, infrastructure patterns, unusual dependencies, authentication approaches, data access patterns. These are decisions someone made for a reason, but the reason isn't in the code.
For each candidate, present what was detected and ask the user WHY that decision was made. The user may know the history, or they may not — "I don't know why this was chosen" is a valid answer that gets recorded.
Draft ADRs for confirmed candidates. See references/example-adr.md for the format. Present each ADR for review, then store approved ADRs in .teamcraft/adrs/ (one file per decision).
Ask the user where team conventions live — Google Drive, local files, or "I don't have any." If Drive, search for and load the convention documents. If local, ask the user to point at them.
Compare what the convention documents say against what the codebase actually does. Produce a read-only delta report:
| Area | Convention Says | Repo Does | Notes |
|------|----------------|-----------|-------|
No judgments. No suggestions. Just the delta. The user decides what matters and what to do about it.
If CLAUDE.md exists, evaluate it:
.teamcraft/project.md via @.teamcraft/project.md?If CLAUDE.md doesn't exist, offer to create one following best practices — lean, focused on non-obvious gotchas only.
Present proposed changes (or the draft) for review. Write only after approval.
Adapt analysis depth to the codebase:
Summarize what was produced and where each artifact was saved. If the analysis surfaced areas that weren't covered (because the user scoped them out or because they require separate work), mention them briefly as future considerations — not demands.
development
Plan a time-boxed iteration (sprint, cycle, milestone) from the backlog and the PRD/roadmap behind it — gather the goal, the window, and the team's real capacity, then select, sequence, and size a committed set of work items to fit. Writes an `iteration` label onto each chosen work item. Use when the user says 'plan a sprint', 'plan the next iteration', 'plan our cycle', 'sprint planning', 'iteration planning', 'plan the next two weeks', 'set up a milestone', 'what should we take on this sprint', 'plan from the PRD', or otherwise wants to commit a scoped, time-boxed batch of work rather than create issues one at a time. This is the planning layer between requirements and the build loop — distinct from create-issue (one item) and pick-next-issue (pick one to build now).
tools
Capture feedback about Teamcraft itself and turn it into a well-structured GitHub issue on the plugin's repo. Vets whether the problem is really a Teamcraft skill defect (vs. misuse, the harness, or the user's own project) by root-causing against the actual skill source, then helps the developer decide whether to file and publishes via the GitHub CLI. Use when the user says 'improve teamcraft', 'a teamcraft skill did the wrong thing', 'file feedback on teamcraft', 'report a teamcraft bug', 'I have an idea to make teamcraft better', or when a Teamcraft skill clearly misbehaved and the user wants that captured upstream.
tools
Learn the Teamcraft plugin itself — how its workflow, skills, and artifacts fit together. A guided overview for a human getting started, or a system map for Claude orienting itself to how Teamcraft works before working in a Teamcraft repo. Teaching only; needs no project or environment access. Use when someone wants to understand Teamcraft (the tool, not their specific project), asks "how does Teamcraft work", "explain the workflow", "which skill do I use for X", or when Claude needs the big picture of how the skills hook together.
tools
--- name: teamcraft:work-board description: Launch (or re-launch) the user's live, multi-project work board. The dashboard is a single HTML file copied to a stable user-side location at ~/.claude/teamcraft-board.html and opened in the user's default browser. It has two views via a header toggle — a drag-and-drop Kanban Board and a live Status tab (analytics: work by status, throughput, cycle time, aging, blocked chains, recomputed on every poll). Each project is added via a header dropdown; the