본문으로 건너뛰기
cccskills
무료GitHub에 공개

format-source

Use this skill to format Liferay source files according to the project’s conventions. It describes the formatter workflows for modules and committed changes, how to handle Go and shell files, and which generated files to leave untouched.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Format source files to align with Liferay's coding standards.

liferay/liferay-portal스타 2,267(GitHub 2,267 + cccskills 0)

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Formatting source files in a module
  • Checking formatting across committed changes
  • Applying the separate Go or shell formatting rules

포함된 파일(1)

  • SKILL.md3.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Format Source

All the code is strictly formatted using the source formatter (Java, JavaScript, JSON, JSP, Markdown, properties, shell, XML, YAML, and others). This is how it works:

Run for a specific module:

cd <module-root> && <gradlew> formatSource

Run across the entire codebase:

git fetch --no-tags https://github.com/brianchandotcom/liferay-portal.git master

cd <repo-root>/portal-impl && ANT_OPTS="-Xmx2560m -Dgit.working.branch.name=$(git merge-base HEAD FETCH_HEAD)" ant format-source-current-branch

Pass git.working.branch.name in ANT_OPTS rather than on the command line, since the yarn formatter lists its files through a separate ant git-util call that inherits nothing else. When the fetch fails, leave out -Dgit.working.branch.name.

ant format-source-current-branch only inspects committed files, so run it after creating the commit, and amend any formatter changes or fixes into that commit.

In both cases, if there are issues to be fixed, the formatter will list them. Fix them.

Skip generated files. The automatic formatter already does this via BaseSourceProcessor.hasGeneratedTag; apply the same rule to any manual edit. A file is generated when it contains any of these unquoted markers:

  • @generated — Service Builder, REST Builder, taglib generator (Java, by far the most common; ~18k files)

  • $ANTLR — ANTLR-generated lexers and parsers

  • # This is a generated file. — generated scripts

  • ## Autogenerated — generated Markdown and config

  • // Code generated ... DO NOT EDIT. — go generate output, such as the controller-gen deepcopy and kubebuilder scaffolding under cloud/

These files are overwritten on the next build, so manual edits are lost and only pollute the diff.

Shell Scripts

Shell scripts (*.sh) follow a separate style guide maintained in the liferay-docker repository. Defer their formatting to the format-bash-source skill and the CODE_STYLE.md it depends on. Resolve both files in this order:

  1. Local Checkout — when liferay-docker sits beside this repository, read ../liferay-docker/.claude/skills/format-bash-source/SKILL.md and ../liferay-docker/.claude/CODE_STYLE.md.

  2. Remote Fallback — when the local checkout is absent, download both files from raw.githubusercontent.com and read them from there:

    temp_dir=$(mktemp -d)
    
    curl \
    	--fail \
    	--output "${temp_dir}/format-bash-source.md" \
    	--silent \
    	--url "https://raw.githubusercontent.com/liferay/liferay-docker/refs/heads/master/.claude/skills/format-bash-source/SKILL.md"
    
    curl \
    	--fail \
    	--output "${temp_dir}/CODE_STYLE.md" \
    	--silent \
    	--url "https://raw.githubusercontent.com/liferay/liferay-docker/refs/heads/master/.claude/CODE_STYLE.md"
    

For any *.sh file in scope, read the resolved format-bash-source SKILL.md and the CODE_STYLE.md it points to, then apply those rules.

Go Code

Go files (*.go) are outside the portal source formatter's set of file types, so the automatic formatter gofmt is used instead. The conventions for Go live in .claude/rules/go-style.md, which is scoped to cloud/operator/**/*.go. Read that file and apply it.

The workflow mirrors the one above. Run gofmt across the Go module — the directory that holds go.mod — apply the rules from .claude/rules/go-style.md, then rerun gofmt to absorb any changes. Both the first pass and the rerun are the same command:

cd <go-module-root> && gofmt -w .

List the files that are not yet formatted without rewriting them:

cd <go-module-root> && gofmt -l .

When a rule and gofmt disagree, gofmt wins; leave the formatted code as it stands.

Skip generated Go files. Beyond the marker line listed above, a Go file whose name contains zz_generated is generated output that the next go generate rewrites.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

jira-bug

무료

Use this skill to file a bug in the LPD Jira project from a description or fix commit. It gathers reproduction steps and expected versus actual behavior, applies required project fields, and returns the created ticket key and link.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Filing a newly reported LPD bug
  • Turning a fix commit into a bug ticket
  • Recording reproduction steps and expected behavior
liferay/liferay-portal2.3천2026년 10월 29일 업데이트

jira-task

무료

Use this skill to create a Task ticket in the LPD Jira project from a description or commit. It gathers missing details, selects a matching component, formats the description with acceptance criteria when applicable, and returns the ticket key and link.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Creating an LPD task from a short description
  • Turning a commit into a task ticket
  • Adding acceptance criteria to a Jira task
liferay/liferay-portal2.3천2026년 10월 29일 업데이트

Format Markdown files for Liferay repositories by aligning front matter, heading capitalization, shell examples, and prose with the project’s style rules. Use it to clean up or copy-edit a document and receive a summary of the changes.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Formatting a Markdown guide for a Liferay repository
  • Cleaning up headings and front matter in a document
  • Polishing shell examples and prose in Markdown
liferay/liferay-portal2.3천2026년 10월 29일 업데이트

Analyzes a Liferay Poshi `.testcase`, checks feasibility and existing coverage, then routes each test to Playwright, Jest, JUnit unit, or Java integration tests. It creates a migration plan and can implement the approved changes using repository patterns.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Migrating Poshi test cases to modern test layers
  • Finding existing specs that already cover Poshi tests
  • Planning Playwright, Jest, or JUnit test conversions
liferay/liferay-portal2.3천2026년 10월 29일 업데이트

Plan and carry out a reduction of a Liferay component’s Poshi test suite by identifying overlapping tests and combining their unique assertions. The skill inventories matching test files, preserves tests with special setup or properties, and commits each planned rename or merge separately.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Reduce overlapping Poshi tests for a component
  • Prepare a test suite for migration to another test layer
  • Review a file-by-file plan for merging functional tests
liferay/liferay-portal2.3천2026년 10월 29일 업데이트

pr

무료

Create a GitHub pull request from the current branch, assemble its title and description from the branch’s commits, and connect it to the relevant Jira tickets. The workflow also runs the required PR check and records the new PR URL on each ticket.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Opening a pull request for the current development branch
  • Preparing a PR description from commits and Jira tickets
  • Recording a new PR on its related Jira work items
liferay/liferay-portal2.3천2026년 10월 29일 업데이트

liferay의 스킬 모두 보기

이 스킬의 문제 신고