architecture-awareness
Skill6 starsChanged 8 months agoMITView on GitHub
Detects project type, analyzes existing patterns, generates architecture specifications, and maintains architectural consistency across sessions. The key innovation that turns CLAUDE.md-style contracts into automatic, evolving project specifications.
In this repository64 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- api-backward-compatibilitySkill
- api-design-standardsSkill
- api-versioningSkill
- database-designSkill
- distributed-systemsSkill
- observability-by-defaultSkill
- performance-budgetsSkill
- resilience-patternsSkill
- twelve-factor-appSkill
- codex-cross-reviewSkill
- dispatching-parallel-agentsSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- subagent-driven-developmentSkill
- intent-to-specSkill
- project-diagnosisSkill
- using-shipworthySkill
- systematic-debuggingSkill
- documentation-as-codeSkill
- accessibilitySkill
- frontend-standardsSkill
- retrospectiveSkill
- writing-skillsSkill
- ci-cd-awarenessSkill
- context-managerSkill
- environment-setupSkill
- feature-flag-disciplineSkill
- finishing-a-development-branchSkill
- guardrail-audit-logSkill
- incident-responseSkill
- mcp-integrationSkill
- migration-strategiesSkill
- production-readinessSkill
- scope-creep-detectionSkill
- session-memorySkill
- slo-sli-definitionSkill
- tech-debt-trackingSkill
- using-git-worktreesSkill
- zero-downtime-migrationsSkill
- brainstormingSkill
- decision-frameworksSkill
- design-documentsSkill
- executing-plansSkill
- writing-plansSkill
- code-complexitySkill
- confidence-based-strictnessSkill
- error-handling-patternsSkill
- feedback-driven-adaptationSkill
- quality-gatesSkill
- response-schema-validationSkill
- test-driven-developmentSkill
- verification-before-completionSkill
- adaptive-securitySkill
- bias-detectionSkill
- compliance-awarenessSkill
- container-securitySkill
- dependency-managementSkill
- pii-detectionSkill
- secrets-managementSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. About 0 are common, 19 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 50
Check for CLAUDE.md (or .claude/CLAUDE.md) in the project root when generating or updating architecture.md.
- Distinctive: line 53
Read CLAUDE.md first: Before generating architecture.md, read any existing CLAUDE.md and extract its rules.
- Distinctive: line 54
Do not conflict: If CLAUDE.md says "use snake_case for files" and architecture.md would default to kebab-case, architecture.md MUST adopt …
- Distinctive: line 55
Do not duplicate: If a rule exists in CLAUDE.md, reference it rather than copying it verbatim.
- Distinctive: line 66
If there is a genuine conflict between CLAUDE.md and what architecture.md would recommend:
- Distinctive: line 68
Ask which rule should win
- Distinctive: line 69
Document the resolution in architecture.md
- Distinctive: line 76
Every architecture.md SHOULD have a Summary section at the top (under 500 characters) for quick context injection when the full spec …
- Distinctive: line 91
If it does, it extracts only the Mandatory Rules section
- Distinctive: line 96
Keep Mandatory Rules to 5-15 items, each on one line
- Distinctive: line 97
Use the Summary section for the essential identity and top 3 rules
- Distinctive: line 99
Prefer terse, actionable rules over verbose explanations
- Distinctive: line 142
Shared types/contracts: Document how types are shared between languages (API schemas, protobuf, GraphQL, etc.).
- Distinctive: line 143
Build coordination: Document how the different language components are built and tested together.
- Distinctive: line 174
Read existing source files to detect naming patterns (camelCase, snake_case, PascalCase)
- Distinctive: line 175
Check import patterns (relative, absolute, aliases)
- Distinctive: line 176
Check error handling patterns
- Distinctive: line 177
Check existing test patterns (framework, location, naming)
- Distinctive: line 191
If the project doesn't match any template, use the closest one and adapt.
- Distinctive: line 274
When the architecture needs to change:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Architecture Awareness
Purpose
This skill solves the critical problem of architectural amnesia — when AI coding assistants forget project constraints between sessions. It generates and maintains an architecture specification that acts as a persistent, enforceable contract.
When This Skill Activates
- No architecture spec exists — first interaction with a new project
- User runs
/scaffold— explicit regeneration request - New technology detected — package.json/requirements.txt changes
- Architectural decision made — during brainstorming, a decision warrants documentation
User Tier Detection
The session-start hook detects a project's maturity tier based on these signals. Architecture awareness should adapt its behavior to the detected tier.
Tier Signals
| Signal | How to Detect | What It Means |
| Has code | package.json, requirements.txt, go.mod, Cargo.toml, pom.xml, setup.py, pyproject.toml exist | Project has been initialized with a language/framework |
| Has tests | tests/, __tests__/, test/, spec/ directories exist, or files matching *.test.*, *.spec.*, test_*.py, *_test.go | Project has some test coverage |
| Has CI | .github/workflows/, .gitlab-ci.yml, .circleci/, Jenkinsfile, .travis.yml, .buildkite/ exist | Project has automated quality checks |
| Has architecture | .shipworthy/architecture.md exists | Project has documented constraints |
Tier Definitions
- Builder (no code OR no tests): Focus on getting working code first. Architecture spec should be lightweight — just Project Identity and 3-5 Mandatory Rules. Do not overwhelm with sections the project is not ready for yet.
- Maker (code + tests, no CI/architecture): Standard architecture spec with all sections. Recommend CI setup as part of architecture generation.
- Engineer (code + tests + CI/architecture): Full architecture spec with strict rules. Include Quality Gate Levels and Performance Budgets sections.
Adapting Spec Generation to Tier
- Builder: Generate a minimal spec (Project Identity, Mandatory Rules, Directory Structure, Testing Strategy). Skip Quality Gate Levels and Performance Budgets unless the user asks.
- Maker: Generate a standard spec (all sections). Keep Common Mistakes to 5 items. Suggest but do not require CI configuration.
- Engineer: Generate a comprehensive spec (all sections fully populated). Include 8-10 Common Mistakes. Require CI configuration documentation.
Coexistence with CLAUDE.md
Many projects already have a CLAUDE.md file that defines project-specific rules and conventions for AI assistants. When both CLAUDE.md and architecture.md exist (or when generating a new architecture.md), follow these rules:
Detection
Check for CLAUDE.md (or .claude/CLAUDE.md) in the project root when generating or updating architecture.md.
Incorporation Rules
- Read CLAUDE.md first: Before generating architecture.md, read any existing CLAUDE.md and extract its rules.
- Do not conflict: If CLAUDE.md says "use snake_case for files" and architecture.md would default to kebab-case, architecture.md MUST adopt snake_case. CLAUDE.md rules about the specific project take priority over template defaults.
- Do not duplicate: If a rule exists in CLAUDE.md, reference it rather than copying it verbatim. Example: "See CLAUDE.md for commit message format" rather than restating the same rule.
- Complement, do not compete: architecture.md should add engineering structure (Quality Gates, Performance Budgets, Testing Strategy) that CLAUDE.md typically does not cover. CLAUDE.md typically covers conventions and preferences.
- Document the relationship: Include a note in architecture.md:
## Relationship to CLAUDE.md This project has a CLAUDE.md file. Rules in CLAUDE.md take priority for project-specific conventions. This architecture spec adds engineering structure (quality gates, testing strategy, performance budgets) that complements CLAUDE.md.
Conflict Resolution
If there is a genuine conflict between CLAUDE.md and what architecture.md would recommend:
- Flag the conflict to the user
- Ask which rule should win
- Document the resolution in architecture.md
Context Budget
For large projects, the session-start hook has a 4000-character context budget. Architecture specs that exceed this limit will be summarized to just the Mandatory Rules section.
Summary Section Requirement
Every architecture.md SHOULD have a Summary section at the top (under 500 characters) for quick context injection when the full spec exceeds the budget.
# Architecture Specification: [Project Name]
## Summary
[Under 500 characters. Project type, language, framework, and the 3 most critical rules.
This section is used for context injection when the full spec is too large.]
## Project Identity
...How Summarization Works
- The session-start hook checks if combined context exceeds 4000 characters
- If it does, it extracts only the Mandatory Rules section
- A note is added telling the assistant to read the full file for details
- Skills that need full architecture context should read the file directly
Best Practices for Budget-Friendly Specs
- Keep Mandatory Rules to 5-15 items, each on one line
- Use the Summary section for the essential identity and top 3 rules
- Move detailed examples and rationale into separate ADR files in
.shipworthy/decisions/ - Prefer terse, actionable rules over verbose explanations
Polyglot Projects
For projects with multiple languages (e.g., TypeScript frontend + Python backend, Go services + React UI), generate a composite architecture spec.
Detection
A project is polyglot if it has multiple language indicators:
package.json+requirements.txt(JS + Python)package.json+go.mod(JS + Go)pom.xml+package.json(Java + JS)- Multiple
go.modfiles in subdirectories (Go monorepo) Cargo.toml+package.json(Rust + JS)
Composite Spec Structure
For polyglot projects, the architecture spec should:
- Shared sections at the top: Project Identity, Summary, and Mandatory Rules that apply to ALL languages.
- Language-specific sections: Clearly scoped by directory path.
## Mandatory Rules (All Languages)
1. All code must have tests
2. No secrets in source code
3. Use conventional commits
## TypeScript Rules (applies to: src/frontend/, src/shared/)
4. Strict mode enabled
5. No any types
6. Use React functional components
## Python Rules (applies to: src/backend/, scripts/)
7. Type hints required on all public functions
8. Use FastAPI for API endpoints
9. Format with black, lint with ruff
## Go Rules (applies to: services/)
10. Use standard library where possible
11. Error wrapping with fmt.Errorf
12. Table-driven tests- Directory mapping: Include a clear mapping of which rules apply where.
- Shared types/contracts: Document how types are shared between languages (API schemas, protobuf, GraphQL, etc.).
- Build coordination: Document how the different language components are built and tested together.
Common Pitfalls in Polyglot Projects
- Applying JavaScript conventions to Python code (or vice versa)
- Missing integration tests between language boundaries
- Inconsistent error handling across language boundaries
- Different naming conventions in shared API contracts
Phase 1: Project Detection
Analyze the project to understand its technology stack. Check for:
Language & Framework Indicators
package.json-> Node.js (check for Next.js, Express, React, Vue, etc.)tsconfig.json-> TypeScript (check strict mode, target, module system)requirements.txt/pyproject.toml/setup.py-> Python (check for FastAPI, Django, Flask)go.mod-> GoCargo.toml-> Rustpom.xml/build.gradle-> Java/Kotlin
Structure Indicators
src/app/orapp/-> Next.js App Router / framework conventionsrc/pages/-> Next.js Pages Router or similarsrc/components/-> Component-based frontendsrc/routes/orroutes/-> Express/backend routingprisma/ordrizzle.config.*-> ORM usage.github/workflows/-> CI/CD with GitHub ActionsDockerfile/docker-compose.yml-> Containerized deploymenttests/or__tests__/or*.test.*-> Testing patterns
Existing Convention Indicators
- Read existing source files to detect naming patterns (camelCase, snake_case, PascalCase)
- Check import patterns (relative, absolute, aliases)
- Check error handling patterns
- Check existing test patterns (framework, location, naming)
Phase 2: Template Selection
Select the most appropriate template from templates/:
nextjs.md— Next.js applications (App Router or Pages Router)express.md— Express/Node.js API servicesfastapi.md— Python FastAPI servicesgo-service.md— Go microservicesreact-spa.md— React single-page applicationsgeneric-typescript.md— TypeScript projects without specific frameworkgeneric-python.md— Python projects without specific frameworkmonorepo.md— Multi-package repositories
If the project doesn't match any template, use the closest one and adapt.
For polyglot projects, combine relevant templates and use the composite spec structure described above.
Phase 3: Specification Generation
For Greenfield Projects (no existing code)
Fill the template with sensible defaults and best practices for the detected stack. Prescribe what SHOULD BE.
For Brownfield Projects (existing code)
Analyze existing patterns and document them as-is. Describe what IS.
Critical rule: Do NOT impose alien patterns on existing codebases. If the project uses snake_case for files, the spec should say snake_case, not kebab-case. The spec should codify existing conventions, making them explicit and enforceable.
Specification Structure
Generate .shipworthy/architecture.md with these sections:
# Architecture Specification: [Project Name]
## Summary
[Under 500 characters. Project type, language, framework, and the 3 most critical rules.
Used for context injection when the full spec exceeds the budget.]
## Project Identity
- **Type**: [e.g., Next.js 14 App Router application]
- **Language**: [e.g., TypeScript 5.x strict mode]
- **Runtime**: [e.g., Node.js 20+]
- **Primary Framework**: [e.g., Next.js 14]
- **Package Manager**: [e.g., npm/pnpm/yarn/bun]
## Relationship to CLAUDE.md
[If CLAUDE.md exists: note the relationship. If not: omit this section.]
## Mandatory Rules
[Numbered list of 5-15 inviolable constraints specific to this project]
[These become the CLAUDE.md-style rules enforced at every session]
## Directory Structure
[Expected layout with purpose annotations]
## Naming Conventions
[File naming, variable naming, component naming, test naming]
## Type System
[Where types live, how shared between modules, strict mode rules]
## Testing Strategy
[Framework, file locations, naming patterns, coverage expectations]
[What MUST be tested vs what's optional]
## Error Handling
[Stack-specific error handling pattern]
## Security Baseline
[Stack-specific security requirements]
## Performance Budgets
[Default thresholds — bundle size, API response time, query limits]
## Quality Gate Levels
[Graduated thresholds configuration]
Level 1 (always): [checks]
Level 2 (10+ files): [checks]
Level 3 (50+ files): [checks]
Level 4 (100+ files): [checks]
## Common Mistakes
[5-10 documented pitfalls specific to this stack/project]Phase 4: User Approval
Present the generated specification to the user with:
- Summary of what was detected
- The full specification
- Invitation to modify before saving
Do NOT save architecture.md without user approval. This is their project; the spec is a suggestion until they accept it.
Phase 5: Evolution
When the architecture needs to change:
- Identify what changed (new dependency, new pattern, architectural decision)
- Propose specific updates to the relevant sections
- Show the diff (old -> new)
- Get user approval before updating
Track significant decisions as Architecture Decision Records in .shipworthy/decisions/:
# ADR-NNN: [Decision Title]
## Status: [Accepted/Superseded/Deprecated]
## Date: [YYYY-MM-DD]
## Context
[What prompted this decision]
## Decision
[What was decided]
## Consequences
[What this means going forward]Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

