Agentic Base is a lean, 14-file kit that supercharges Claude Code CLI. It provides:
- Auto-detected project context (git, framework, runtime)
- Security gates blocking sensitive files + bloated directories
- 4 specialized agents (planner, tester, reviewer, debugger)
- Three Pillars enforcement (Document-Driven, Test-Driven, Observability-Driven)
- Lifecycle hooks tracking edit quality
cd /path/to/your-project
npx @namtroi/agentic-base initclaudeThat's it. Claude Code auto-reads CLAUDE.md + .claude/settings.json on startup.
your-project/
├── CLAUDE.md # Entry point — Claude reads this first
└── .claude/
├── settings.json # Hook wiring (auto-loaded by Claude Code)
├── .agenticignore # Blocked directories (node_modules, dist, etc.)
├── hooks/
│ ├── session-init.cjs # Detects git, framework, runtime on startup
│ ├── privacy-gate.cjs # Blocks .env, credentials, keys
│ ├── scout-gate.cjs # Blocks node_modules, dist, .git access
│ └── post-edit-reminder.cjs # Warns about TDD/DDD violations after 8 edits
├── agents/
│ ├── planner.md # Planning agent — creates implementation plans
│ ├── tester.md # TDD agent — Red→Green→Refactor
│ ├── reviewer.md # Code review agent — checks Three Pillars
│ └── debugger.md # Debug agent — investigate issues
├── rules/
│ ├── orchestration.md # Workflow: Plan→Test→Code→Test→Docs→Review
│ └── three-pillars.md # DDD/TDD/ODD enforcement rules
└── skills/
├── plan/SKILL.md # `/plan` — create implementation plans
└── preview/SKILL.md # `/preview` — generate Mermaid/ASCII diagrams
session-init.cjs fires automatically, injects context:
## Session Context (auto-injected)
- Git Branch: main
- Git Remote: git@github.com:user/project.git
- Node: v20.10.0
- Framework: Next.js
- Package Manager: pnpm
- CWD: /home/user/project
Claude now knows your stack without you typing anything.
Two gates fire on every file access:
- Scout Gate — blocks bloated dirs (
node_modules,dist,.git...). Prevents token overflow. - Privacy Gate — blocks sensitive files (
.env, credentials, keys). Asks user for approval.
If privacy-blocked:
PRIVACY BLOCK: Sensitive file requires approval
File: .env
Claude: Use AskUserQuestion tool, then:
If "Yes": Use bash: cat ".env"
If "No": Continue without this file.
post-edit-reminder.cjs tracks edits. After 8 code file modifications:
⚠️ TDD warning if no test files written⚠️ DDD warning if no docs updated- 📝 General quality reminder
For any significant task, Claude follows a 6-step pipeline:
1. Plan → planner agent creates plan.md (with Docs/Test/Observability sections)
2. Test (R) → tester agent writes failing tests FIRST
3. Code → implement minimal code to pass tests
4. Test (G) → run tests, all green
5. Docs → update/create docs per plan
6. Review → reviewer agent checks Three Pillars compliance
For trivial changes (<20 lines, single file), steps 1 and 6 are skipped. Tests are never skipped.
> /plan Add user authentication with OAuth2
Claude will research, analyze, and create a plan.md with:
- Phases + effort estimates
## Docs Impact— what docs to update## Test Strategy— what tests to write## Observability— what logging to add
> /preview --diagram authentication flow
> /preview --explain how the payment system works
> /preview --ascii database schema
Agents are specialized sub-agents Claude delegates to. You can also invoke them directly:
> Use the planner agent to design a caching layer
> Use the tester agent to write tests for the auth module
> Use the reviewer agent to review my recent changes
> Use the debugger agent to investigate the 500 error on /api/users
Edit .claude/.agenticignore:
# Add your own
.dart_tool
.gradle
.terraform
Append project-specific info:
## Project Context
- Stack: Next.js 14 + Supabase + Prisma
- DB Schema: `./docs/database-schema.md`
- API Docs: `./docs/api-reference.md`
- Deploy: Vercel (auto-deploy on push to `main`)Create .claude/skills/<skill-name>/SKILL.md:
---
name: my-skill
description: "What this skill does"
---
# My Skill
Instructions for Claude when this skill is activated.Create .claude/agents/<agent-name>.md:
---
name: my-agent
description: "When to use this agent"
tools: Glob, Grep, Read, Bash
---
Agent instructions here.- First time in a project? Claude auto-detects your stack. Just start coding.
- Need a plan? Say
/plan <task>. Claude creates a structured plan before coding. - Privacy block annoying? It protects your secrets. Approve once per session.
- Want stricter TDD? Add a git pre-commit hook that rejects commits without test files.
- Too many reminders? Edit
THRESHOLDinpost-edit-reminder.cjs(default: 8). - New framework not detected? Add detection logic to
session-init.cjsdetectFramework().
| Issue | Cause | Fix |
|---|---|---|
fatal: not a git repository on startup |
No git repo | Run git init. Harmless — hook continues. |
| Privacy gate blocks too much | Pattern too broad | Edit SENSITIVE_PATTERNS in privacy-gate.cjs |
| Scout gate blocks needed dir | Dir in .agenticignore |
Add !your-dir negation in .agenticignore |
| Hooks don't fire | settings.json not loaded |
Ensure .claude/settings.json exists at project root |
| Agent not found | Wrong file location | Agents go in .claude/agents/, must have YAML frontmatter |