π¨ REPOSITORY DIRECTIVE: This package lives at
git@github.com:ramsaptami/code-directives.git
All commits and changes MUST be made to the dedicated repository, not to tessellate!
Automated best practices enforcement for development projects with standardized workflows across all team repositories.
# Global installation
npm install -g @ramsaptami/code-directives
# Project-level installation
npm install --save-dev @ramsaptami/code-directivesThis SDK follows a clean dependency model where:
- Generated projects contain only unique business logic
- SDKs are imported as npm dependencies, not copied
- No duplication of framework code in new projects
- Template files provide structure, not duplicate implementations
When you create a new project, it contains:
my-new-project/
βββ src/ # Your unique business logic
βββ tests/ # Your project tests
βββ package.json # Dependencies reference SDKs
βββ .bp-config.yml # Your project configuration
βββ README.md # Project-specific documentation
βββ .env.example # Environment template
{
"devDependencies": {
"@company/code-directives": "^1.0.0", // Development standards
"@company/rubric-sdk": "^1.0.0" // Task tracking
}
}- β Copied SDK source files
- β Duplicated validation logic
- β Cloned utility functions
- β Template boilerplate in production code
Code Directives works seamlessly with @company/rubric-sdk for comprehensive project management:
- Code Directives: Development standards, validation, project generation
- Rubric SDK: Task scoring, prioritization, decision tracking
// Use both SDKs as imported dependencies
const bp = require('@company/code-directives');
const rubric = require('@company/rubric-sdk');
// Validate project quality
const validation = await bp.validate({ autoFix: true });
// Score and prioritize tasks
const taskScores = await rubric.compare([
{ description: "Add authentication", impact: 5, complexity: 4 },
{ description: "Optimize queries", impact: 4, complexity: 3 }
]);β
No version conflicts - Each SDK manages its own dependencies
β
Easy updates - npm update pulls latest versions
β
Smaller projects - No duplicated code
β
Clear boundaries - Each SDK has distinct responsibilities
- Primary Repository:
git@github.com:ramsaptami/code-directives.git - Package Name:
@ramsaptami/code-directives - Development: Always commit changes to the dedicated repository
- Usage: Install as dependency in other projects
This repository uses a comprehensive automated workflow system to ensure code quality, consistency, and streamlined development across all team projects.
- Protected Branch:
main(direct commits blocked by pre-commit hooks) - All changes must go through feature branches and pull requests
- Standardized naming ensures automated workflow triggers and proper PR categorization
| Branch Pattern | Purpose | Auto-PR Title | Labels | Examples |
|---|---|---|---|---|
feature/description |
New features and enhancements | β¨ Feature: [description] | enhancement, auto-created |
feature/accessibility-validator |
fix/description |
Bug fixes and corrections | π Fix: [description] | bug, auto-created |
fix/performance-check-timeout |
refactor/description |
Code restructuring without changing functionality | β»οΈ Refactor: [description] | refactoring, auto-created |
refactor/validation-engine |
docs/description |
Documentation updates | π Docs: [description] | documentation, auto-created |
docs/validation-api-guide |
hotfix/description |
Critical production fixes | π¨ Hotfix: [description] | hotfix, auto-created, priority-high |
hotfix/security-vulnerability |
- Create Feature Branch:
git checkout -b feature/your-feature-name - Push Changes: Triggers automatic PR creation with proper titles and labels
- Automated Checks: Dependencies validation, tests, security audit
- Code Review: Manual review with auto-generated checklist
- Auto-Merge: Approved PRs merge automatically with cleanup
# Feature development
git checkout main && git pull
git checkout -b feature/new-validation-rule
# Make changes, commit, and push
git push -u origin feature/new-validation-rule
# PR created automatically!
# Bug fix
git checkout -b fix/timeout-handling-error
# Fix issue and push - auto-PR created with bug labels
# Documentation update
git checkout -b docs/api-reference-update
# Update docs and push - fast-track merge for docs-
Clone Repository:
git clone git@github.com:ramsaptami/code-directives.git cd code-directives npm install -
Verify Pre-commit Hooks:
# Hooks should be installed automatically # Test branch protection echo "test" > test.txt && git add test.txt git commit -m "test" # Should be blocked with helpful message
-
Configure Git Aliases (Optional):
git config alias.newfeature '!git checkout main && git pull && git checkout -b feature/$1' git config alias.newfix '!git checkout main && git pull && git checkout -b fix/$1'
-
First Feature Branch:
git checkout -b feature/setup-complete echo "Setup completed by [your-name]" >> CONTRIBUTORS.md git add CONTRIBUTORS.md git commit -m "Add contributor setup completion" git push -u origin feature/setup-complete
Symptoms: Pushed branch but no PR created Solutions:
- Verify branch name matches pattern:
feature/*,fix/*,refactor/*,docs/*,hotfix/* - Check GitHub Actions are enabled in repository settings
- Ensure you have proper repository permissions
Solutions:
# Verify hook exists and is executable
ls -la .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
# Reinstall hooks if needed
npm install # Hooks should reinstall automaticallySymptoms: PR approved but not merging Checklist:
- All status checks passed
- No merge conflicts
- Required approvals received
- No requested changes pending
- Branch is up to date with main
Solution:
# Verify repository default branch
git remote show origin
# Should show: HEAD branch: mainFor detailed workflow examples and advanced scenarios, see ../../docs/PR_WORKFLOW_EXAMPLES.md
- Project Initialization: Create new projects with best practices built-in
- Code Validation: Automated checking of code quality, security, and performance
- Audit Reports: Generate compliance reports in multiple formats
- CI/CD Integration: GitHub Actions workflows for automated enforcement
- Documentation Generation: Auto-generate project documentation
# Initialize a new project
bp init my-project --template web-app
# Validate existing project
bp validate --fix
# Generate audit report
bp audit --output report.jsonProjects use .bp-config.yml to customize standards and automation settings.
For detailed usage and API documentation, see docs/.