Loading...
Loading...
Harness Engineering Phase 1 Step 2: Conduct in-depth analysis of project code and fill in the substantive content of each file in the docs/ knowledge base. Use this skill after the directory skeleton is created by harness-step1-create-agents-md. Immediately trigger this skill when the user says "fill document content", "improve docs/ files", "add substantive content to documents", "analyze project and write architecture document", "write ARCHITECTURE.md", or "write technical decision document". Prerequisite: The project already has AGENTS.md and the docs/ directory skeleton (created by harness-step1).
npx skill4agent add simbajigege/book2skills harness-step2-fill-docs# 1. Confirm the docs/ skeleton exists
ls docs/
# 2. Understand the directory structure (3 levels)
find . -maxdepth 3 \
-not -path '*/node_modules/*' -not -path '*/.git/*' \
-not -path '*/__pycache__/*' -not -path '*/dist/*' \
-not -path '*/.next/*' -not -path '*/build/*' | sort
# 3. Read main entry files
# (Judge based on tech stack: main.ts / main.py / app.go / index.js, etc.)
# 4. Read module boundaries (index file or first file of each main directory)
# Goal: Clarify the responsibility of each directory
# 5. Read dependency declarations
cat package.json 2>/dev/null || cat pyproject.toml 2>/dev/null || \
cat go.mod 2>/dev/null || cat Cargo.toml 2>/dev/null
# 6. Read existing documentation (reuse, do not duplicate)
cat README.md 2>/dev/null
cat AGENTS.md 2>/dev/nulldocs/ARCHITECTURE.md# Verify if a component is actually referenced by a page
grep -r "ChatInterface" frontend/src/app/[locale]/book/[bookCode]/ 2>/dev/null
# Verify which files actually reference a component
grep -rl "ComponentName" src/ 2>/dev/null# Architecture Description
## Overall Structure
[Describe the overall layering in text, then use a directory tree for illustration]
[Directory tree, only to key levels, do not list all files]
## Dependency Direction Rules
[Use arrow diagrams or lists to explain which layers can reference which layers]
Key Constraints:
- [Constraint 1, explain the reason]
- [Constraint 2, explain the reason]
## Main Data Flow
[Describe the 1-2 core request/data flows, from entry to database]
## To be Supplemented
- [ ] [Content that cannot be determined during scanning]docs/CONVENTIONS.md# Check file naming rules
find src -name "*.ts" -o -name "*.py" -o -name "*.go" 2>/dev/null | head -30
# Check function/variable naming (randomly select a few files)
head -50 [main source file path]# Code Conventions
## File Naming
- [Rule 1]: Example `XxxYyy.tsx`
- [Rule 2]: Example `xxx-yyy.ts`
## Variable and Function Naming
- Variables/Functions: [Rule + Example]
- Classes/Components: [Rule + Example]
- Constants: [Rule + Example]
## Directory Organization
[What types of files are placed in each main directory]
## Git Commit Format
[Summarize from git log, or write recommended format]
`type(scope): description`
Optional types: feat / fix / docs / refactor / test
## To be Supplemented
- [ ] [Conventions that cannot be inferred from code]docs/TECH_DECISIONS.md# Check all direct dependencies
cat package.json | grep '"dependencies"' -A 50 2>/dev/null
# Or
cat pyproject.toml | grep -A 30 '\[tool.poetry.dependencies\]' 2>/dev/null# Technical Decision Records
## [Framework/Library Name]
**Purpose**: [What this library/framework is used for]
**Reasons for Selection**: [Inferable reasons, or mark "To be supplemented"]
**Alternative Solutions**: [List obvious alternatives and explain why they were not chosen]
**Notes**: [Points that need special attention during use]
## To be Supplemented
- [ ] [Libraries whose selection reasons cannot be inferred from code, need manual explanation]docs/QUALITY.md# Check test file patterns
find . -name "*.test.*" -o -name "*.spec.*" -o -name "*_test.*" 2>/dev/null | head -10
# Check CI configuration (if available)
cat .github/workflows/*.yml 2>/dev/null | head -60# Quality Standards
## Definition of Done
A task is considered complete only if it meets:
- [ ] Functions run normally locally
- [ ] Corresponding tests are written (covering normal paths + at least one exception path)
- [ ] [Supplement based on actual project situation, e.g., type checking passed, no lint errors]
- [ ] Clear git commit message
- [ ] If architecture or conventions are modified, docs/ has been updated synchronously
## Code Review Checklist
**Correctness**
- [ ] [Project-specific correctness checks, e.g., multi-tenant isolation, permission verification]
**Maintainability**
- [ ] Does the naming conform to CONVENTIONS.md?
- [ ] Is there duplicate code that can be extracted?
- [ ] Is the business logic in the correct layer? (See ARCHITECTURE.md)
## Testing Requirements
[Testing conventions summarized from existing test files, or write recommended standards]
## To be Supplemented
- [ ] [Acceptance criteria that cannot be inferred from code]docs/exec-plans/tech-debt-tracker.md# Technical Debt Tracker
Each entry format: `[Priority: High/Medium/Low] Issue Description — Scope of Impact`
## Current Debts
[Issues discovered during scanning, record truthfully]
## Resolved
(Empty)harness-step3-state-management