@stackone/agent-config
v1.4.0
Published
Configuration utilities and shared agent instructions for StackOne projects
Downloads
1,795
Readme
@stackone/agent-config
Configuration utilities for StackOne projects. This package provides access to reusable agent instructions (CLAUDE.md) that can be shared across multiple repositories.
What is this?
This package provides a simple way to import and use the shared StackOne agent configuration (CLAUDE.md) in any TypeScript or JavaScript project. It's published as a public npm package to https://registry.npmjs.org.
What it does:
- Provides access to the shared agent configuration file
- Allows copying the config to your project as
CLAUDE.md - Includes a CLI tool for easy setup
Installation
Install via npm:
npm install @stackone/agent-configOr add to your package.json:
Usage
CLI
Copy CLAUDE.md to your project:
npx stackone-agent-pullOr use the installed binary:
stackone-agent-pullProgrammatic
import { getConfig, addConfig } from "@stackone/agent-config";
// Read config as string
const config = getConfig();
console.log(config);
// Copy to CLAUDE.md in current working directory
addConfig();Direct File Access
const fs = require("fs");
const path = require("path");
const agentMdPath = require.resolve("@stackone/agent-config/agent.md");
const config = fs.readFileSync(agentMdPath, "utf8");Example: Auto-Update CLAUDE.md with GitHub Actions
Create .github/workflows/update-claude-md.yaml:
name: Update CLAUDE.md
on:
schedule:
- cron: '0 2 * * *' # Daily at 2 AM UTC
workflow_dispatch: # Manual trigger
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Install package
run: npm install "@stackone/agent-config@latest" --save
- name: Pull latest CLAUDE.md
run: npx stackone-agent-pull
- name: Check for changes
id: check
run: |
if git diff --quiet CLAUDE.md; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes
if: steps.check.outputs.changed == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add CLAUDE.md
git commit -m "chore: update CLAUDE.md from @stackone/agent-config"
git pushAPI
getConfig()- Returns CLAUDE.md content as stringaddConfig()- Copies CLAUDE.md to current working directory
Publishing (Maintainers Only)
This package is automatically published to npm when changes are pushed to main branch:
- Update code in
packages/config/ - Push to
mainbranch - GitHub Actions will:
- Auto-increment patch version
- Build the package
- Publish to npm as private package
- Create git tag
Manual publishing:
cd packages/config
npm run build
npm publish --access restrictedDevelopment
npm run build # Build TypeScript to dist/
npm run test # Run tests
npm run lint # Check code quality
npm run lint:fix # Auto-fix issuesSecurity
This is a public package, so no authentication is required for installation.
License
ISC
